log when moving sqlite dll fails

This commit is contained in:
UnknownShadow200 2018-07-20 05:16:33 +10:00
parent 58369eb962
commit fd7c23e1a3
4 changed files with 48 additions and 49 deletions

View File

@ -17,45 +17,45 @@
*/
using System;
namespace MCGalaxy.Commands.World {
public sealed class CmdReload : Command2 {
public override string name { get { return "Reload"; } }
public override string shortcut { get { return "Reveal"; } }
public override string type { get { return CommandTypes.World; } }
public override bool museumUsable { get { return false; } }
public override CommandAlias[] Aliases {
get { return new [] { new CommandAlias("ReJoin"), new CommandAlias("rd"),
new CommandAlias("WFlush"), new CommandAlias("WorldFlush") }; }
}
public override CommandPerm[] ExtraPerms {
get { return new[] { new CommandPerm(LevelPermission.Operator, "can reload for all players") }; }
}
public sealed class CmdReload : Command2 {
public override string name { get { return "Reload"; } }
public override string shortcut { get { return "Reveal"; } }
public override string type { get { return CommandTypes.World; } }
public override bool museumUsable { get { return false; } }
public override CommandAlias[] Aliases {
get { return new [] { new CommandAlias("ReJoin"), new CommandAlias("rd"),
new CommandAlias("WFlush"), new CommandAlias("WorldFlush") }; }
}
public override CommandPerm[] ExtraPerms {
get { return new[] { new CommandPerm(LevelPermission.Operator, "can reload for all players") }; }
}
public override void Use(Player p, string message, CommandData data) {
if (CheckSuper(p, message, "player or level name")) return;
if (message.Length == 0) message = p.name;
string[] parts = message.SplitSpaces();
if (!parts[0].CaselessEq("all")) {
LevelActions.ReloadFor(p, p, true);
} else {
Level lvl = p.level;
if (parts.Length == 2) {
lvl = Matcher.FindLevels(p, parts[1]);
if (lvl == null) return;
} else if (p.IsSuper) {
SuperRequiresArgs(name + " all", p, "level name"); return;
}
if (!CheckExtraPerm(p, data, 1)) return;
LevelActions.ReloadAll(lvl, p, true);
}
Server.DoGC();
}
public override void Help(Player p) {
p.Message("%T/Reload %H- Reloads the map you are in, just for you.");
p.Message("%T/Reload all %H- Reloads for all players in map you are in.");
p.Message("%T/Reload all [map] %H- Reloads for all players in [map]");
}
}
public override void Use(Player p, string message, CommandData data) {
if (CheckSuper(p, message, "player or level name")) return;
if (message.Length == 0) message = p.name;
string[] parts = message.SplitSpaces();
if (!parts[0].CaselessEq("all")) {
LevelActions.ReloadFor(p, p, true);
} else {
Level lvl = p.level;
if (parts.Length == 2) {
lvl = Matcher.FindLevels(p, parts[1]);
if (lvl == null) return;
} else if (p.IsSuper) {
SuperRequiresArgs(name + " all", p, "level name"); return;
}
if (!CheckExtraPerm(p, data, 1)) return;
LevelActions.ReloadAll(lvl, p, true);
}
Server.DoGC();
}
public override void Help(Player p) {
p.Message("%T/Reload %H- Reloads the map you are in, just for you.");
p.Message("%T/Reload all %H- Reloads for all players in map you are in.");
p.Message("%T/Reload all [map] %H- Reloads for all players in [map]");
}
}
}

View File

@ -651,9 +651,9 @@ namespace MCGalaxy {
Message("%WInfinite message block loop detected, aborting");
return false;
}
} else if (data.Context == CommandContext.Normal) {
} else if (data.Context == CommandContext.Normal) {
mbRecursion = 0;
}
}
return true;
}

View File

@ -129,12 +129,11 @@ namespace MCGalaxy {
static void MoveSqliteDll() {
try {
if (File.Exists("sqlite3_x32.dll") && IntPtr.Size == 4)
File.Copy("sqlite3_x32.dll", "sqlite3.dll", true);
if (File.Exists("sqlite3_x64.dll") && IntPtr.Size == 8)
File.Copy("sqlite3_x64.dll", "sqlite3.dll", true);
} catch { }
string dll = IntPtr.Size == 8 ? "sqlite3_x64.dll" : "sqlite3_x32.dll";
if (File.Exists(dll)) File.Copy(dll, "sqlite3.dll", true);
} catch (Exception ex) {
Logger.LogError("Error moving SQLite dll", ex);
}
}
static void EnsureFilesExist() {

View File

@ -152,7 +152,7 @@ namespace MCGalaxy.Tasks {
foreach (var kvp in botsByLevel) {
string path = BotsFile.BotsPath(kvp.Key);
using (StreamWriter w = new StreamWriter(path)) {
BotsFile.WriteAll(w, kvp.Value);
BotsFile.WriteAll(w, kvp.Value);
}
}