Merge branch 'general-devel' of github.com:TShock/TShock

This commit is contained in:
Steven French 2011-07-04 21:45:45 +12:00
commit 35eae48dfe
5 changed files with 19 additions and 23 deletions

View file

@ -68,9 +68,13 @@ namespace TShockAPI
Directory.CreateDirectory(worldpath);
Tools.Broadcast("Server map saving, potential lag spike");
Console.WriteLine("Backing up world...");
Thread SaveWorld = new Thread(Tools.SaveWorld);
SaveWorld.Start();
while (SaveWorld.ThreadState == ThreadState.Running)
Thread.Sleep(50);
Main.worldPathName = worldname;
}
catch (Exception ex)

View file

@ -56,6 +56,7 @@ namespace TShockAPI
{
public string Name { get { return Names[0]; } }
public List<string> Names { get; protected set; }
public bool DoLog { get; set; }
private string permission;
private CommandDelegate command;
@ -71,6 +72,7 @@ namespace TShockAPI
permission = null;
Names = new List<string>(names);
command = cmd;
DoLog = true;
}
public bool Run(string msg, TSPlayer ply, List<string> parms)
@ -152,8 +154,8 @@ namespace TShockAPI
ChatCommands.Add(new Command(PartyChat, "p"));
ChatCommands.Add(new Command(Rules, "rules"));
ChatCommands.Add(new Command("logs", Rules, "displaylogs"));
ChatCommands.Add(new Command("manageusers", ManageUsers, "user"));
ChatCommands.Add(new Command(AttemptLogin, "login"));
ChatCommands.Add(new Command("manageusers", ManageUsers, "user") { DoLog = false });
ChatCommands.Add(new Command(AttemptLogin, "login") { DoLog = false });
ChatCommands.Add(new Command("cfg", Broadcast, "broadcast", "bc"));
ChatCommands.Add(new Command("whisper", Whisper, "whisper", "w", "tell"));
ChatCommands.Add(new Command("whisper", Reply, "reply", "r"));
@ -191,10 +193,8 @@ namespace TShockAPI
}
else
{
if (!cmdText.Contains("login") && !cmdText.Contains("user"))
{
if (cmd.DoLog)
Tools.SendLogs(string.Format("{0} executed: /{1}", player.Name, cmdText), Color.Red);
}
cmd.Run(cmdText, player, args);
}
return true;

View file

@ -35,5 +35,5 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.2.0702")]
[assembly: AssemblyFileVersion("2.3.2.0702")]
[assembly: AssemblyVersion("2.3.2.0704")]
[assembly: AssemblyFileVersion("2.3.2.0704")]

View file

@ -49,8 +49,6 @@ namespace TShockAPI
public static IDbConnection Sql;
public static bool WorldSaving = false;
public override Version Version
{
get { return VersionNum; }
@ -540,15 +538,10 @@ namespace TShockAPI
private void OnSaveWorld(bool resettime, HandledEventArgs e)
{
if (!WorldSaving)
{
WorldSaving = true;
Tools.Broadcast("Saving world, might lag.", Color.Red);
Thread SaveWorld = new Thread(Tools.SaveWorld);
SaveWorld.Start();
WorldSaving = false;
e.Handled = true;
}
Tools.Broadcast("Saving world, might lag.", Color.Red);
Thread SaveWorld = new Thread(Tools.SaveWorld);
SaveWorld.Start();
e.Handled = true;
}
/*
@ -627,7 +620,7 @@ namespace TShockAPI
public void OnConfigRead(ConfigFile file)
{
NPC.maxSpawns = file.DefaultMaximumSpawns;
NPC.defaultMaxSpawns = file.DefaultMaximumSpawns;
NPC.defaultSpawnRate = file.DefaultSpawnRate;
Main.autoSave = file.AutoSave;

View file

@ -106,11 +106,10 @@ namespace TShockAPI
/// </summary>
public static void SaveWorld()
{
WorldGen.saveWorld();
WorldGen.RealsaveWorld();
Broadcast("World Saved", Color.Yellow);
Console.WriteLine("World backed up");
Log.Info(string.Format("World backed up ({0})", Main.worldPathName));
Broadcast("World saved.", Color.Yellow);
Log.Info(string.Format("World saved at ({0})", Main.worldPathName));
}
/// <summary>