Fix joining a level that does not allow guns but you still were using a gun meaning you couldn't place/delete any blocks (Thanks lavacraft), fix levels with + in their name causing /server backup to error.

This commit is contained in:
UnknownShadow200 2016-06-09 20:05:50 +10:00
parent f8f54b278e
commit 27eae5fc3e
10 changed files with 16 additions and 17 deletions

View File

@ -337,7 +337,7 @@ namespace MCGalaxy
w.WriteLine("# If someone has royally screwed up the ranks, just delete this file and let the server restart");
w.WriteLine("# Allowed ranks: " + Group.concatList(false, false, true));
w.WriteLine("# Disallow and allow can be left empty, just make sure there's 2 spaces between the colons");
w.WriteLine("# This works entirely on permission values, not names. Do not enter a rank name. Use it's permission value");
w.WriteLine("# This works entirely on permission values, not names. Do not enter a rank name. Use its permission value");
w.WriteLine("# BlockName : LowestRank : Disallow : Allow");
w.WriteLine("# lava : 60 : 80,67 : 40,41,55");
w.WriteLine("");

View File

@ -25,7 +25,7 @@ namespace MCGalaxy.Commands {
public override string name { get { return "loginmessage"; } }
public override string shortcut { get { return "loginmsg"; } }
public override string type { get { return CommandTypes.Other; } }
public override string type { get { return CommandTypes.Chat; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
public CmdLoginMessage() { }

View File

@ -25,7 +25,7 @@ namespace MCGalaxy.Commands {
public override string name { get { return "logoutmessage"; } }
public override string shortcut { get { return "logoutmsg"; } }
public override string type { get { return CommandTypes.Other; } }
public override string type { get { return CommandTypes.Chat; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
public CmdLogoutMessage() { }

View File

@ -59,7 +59,7 @@ namespace MCGalaxy.Commands
Player.Message(p, "You freed " + who.name + " from jail");
Player.SendChatFrom(who, who.ColoredName + " %Swas &afreed %Sfrom jail", false);
}
Server.jailed.Save();
Server.jailed.Save(true);
}
public override void Help(Player p) {

View File

@ -26,7 +26,7 @@ namespace MCGalaxy.Commands
{
public override string name { get { return "review"; } }
public override string shortcut { get { return "rvw"; } }
public override string type { get { return CommandTypes.Other; } }
public override string type { get { return CommandTypes.Moderation; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
public CmdReview() { }

View File

@ -20,7 +20,7 @@ namespace MCGalaxy.Commands {
public override string name { get { return "main"; } }
public override string shortcut { get { return "h"; } }
public override string type { get { return CommandTypes.Other; } }
public override string type { get { return CommandTypes.World; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
public override CommandPerm[] AdditionalPerms {

View File

@ -115,7 +115,7 @@ namespace MCGalaxy.SQL {
}
}
sql.WriteLine();
using (DataTable tableRowData = Database.fillData("SELECT * FROM " + tableName))
using (DataTable tableRowData = Database.fillData("SELECT * FROM `" + tableName + "`"))
{
if (tableRowData.Rows.Count > 0)
{

View File

@ -171,6 +171,8 @@
<Compile Include="Commands\Chat\CmdHigh5.cs" />
<Compile Include="Commands\Chat\CmdHug.cs" />
<Compile Include="Commands\Chat\CmdIgnore.cs" />
<Compile Include="Commands\Chat\CmdLoginMessage.cs" />
<Compile Include="Commands\Chat\CmdLogoutMessage.cs" />
<Compile Include="Commands\Chat\CmdMe.cs" />
<Compile Include="Commands\Chat\CmdNick.cs" />
<Compile Include="Commands\Chat\CmdOpChat.cs" />
@ -303,6 +305,7 @@
<Compile Include="Commands\Moderation\CmdResetBot.cs" />
<Compile Include="Commands\Moderation\CmdRestart.cs" />
<Compile Include="Commands\Moderation\CmdRestoreSelection.cs" />
<Compile Include="Commands\Moderation\CmdReview.cs" />
<Compile Include="Commands\Moderation\CmdSetRank.cs" />
<Compile Include="Commands\Moderation\CmdShutdown.cs" />
<Compile Include="Commands\Moderation\CmdTempBan.cs" />
@ -334,15 +337,11 @@
<Compile Include="Commands\other\CmdImpersonate.cs" />
<Compile Include="Commands\other\CmdInvincible.cs" />
<Compile Include="Commands\other\CmdKill.cs" />
<Compile Include="Commands\other\CmdLoginMessage.cs" />
<Compile Include="Commands\other\CmdLogoutMessage.cs" />
<Compile Include="Commands\other\CmdMain.cs" />
<Compile Include="Commands\other\CmdMove.cs" />
<Compile Include="Commands\other\CmdPass.cs" />
<Compile Include="Commands\other\CmdRepeat.cs" />
<Compile Include="Commands\other\CmdReport.cs" />
<Compile Include="Commands\other\CmdResetPass.cs" />
<Compile Include="Commands\other\CmdReview.cs" />
<Compile Include="Commands\other\CmdRide.cs" />
<Compile Include="Commands\other\CmdSend.cs" />
<Compile Include="Commands\other\CmdSendCmd.cs" />
@ -378,6 +377,7 @@
<Compile Include="Commands\World\CmdImport.cs" />
<Compile Include="Commands\World\CmdLoad.cs" />
<Compile Include="Commands\World\CmdLockdown.cs" />
<Compile Include="Commands\World\CmdMain.cs" />
<Compile Include="Commands\World\CmdMap.cs" />
<Compile Include="Commands\World\CmdMuseum.cs" />
<Compile Include="Commands\World\CmdNewLvl.cs" />

View File

@ -389,8 +389,10 @@ namespace MCGalaxy {
if ( OnSendMap != null )
OnSendMap(this, buffer);
if (!level.guns)
if (!level.guns && aiming) {
aiming = false;
ClearBlockchange();
}
} catch( Exception ex ) {
success = false;
PlayerActions.ChangeMap(this, Server.mainLevel.name);

View File

@ -59,17 +59,14 @@ namespace MCGalaxy {
return players.Count;
} }
public void Save() { Save(path, true); }
public void Save(string path, bool console) {
public void Save(bool console = false) {
using (StreamWriter w = File.CreateText(path)) {
lock (locker) {
foreach (string line in lines)
w.WriteLine(line);
}
}
if (console)
Server.s.Log("SAVED: " + path);
if (console) Server.s.Log("SAVED: " + path);
}
public static PlayerExtList Load(string path) {