Don't bother reloading map for ClassicalSharp <= 0.98.5

This commit is contained in:
UnknownShadow200 2017-02-28 13:39:07 +11:00
parent a8f5c6b5cb
commit 2e83c38642
3 changed files with 1 additions and 35 deletions

View File

@ -440,7 +440,6 @@ namespace MCGalaxy.Commands.CPE {
Player.Message(p, "Set {0} for {1} to {2}", parts[2], blockName, value); Player.Message(p, "Set {0} for {1} to {2}", parts[2], blockName, value);
BlockDefinition.Add(def, defs, p == null ? null : p.level); BlockDefinition.Add(def, defs, p == null ? null : p.level);
ReloadMap(p, global);
} }
@ -483,18 +482,7 @@ namespace MCGalaxy.Commands.CPE {
} }
return block; return block;
} }
static void ReloadMap(Player p, bool global) {
Player[] players = PlayerInfo.Online.Items;
foreach (Player pl in players) {
if (!pl.hasBlockDefs) continue;
if (!global && p.level != pl.level) continue;
if (pl.level == null || !pl.level.HasCustomBlocks) continue;
if (!pl.outdatedClient) continue;
LevelActions.ReloadMap(p, pl, true);
}
}
static byte GetFreeId(bool global, Level lvl) { static byte GetFreeId(bool global, Level lvl) {
// Start from opposite ends to avoid overlap. // Start from opposite ends to avoid overlap.

View File

@ -29,7 +29,6 @@ namespace MCGalaxy.Core {
LoadWaypoints(p); LoadWaypoints(p);
LoadIgnores(p); LoadIgnores(p);
CheckOutdatedClient(p);
CheckLoginJailed(p); CheckLoginJailed(p);
} }
@ -92,25 +91,6 @@ namespace MCGalaxy.Core {
p.SendMessage("&cType &a/ignore list &cto see who you are still ignoring"); p.SendMessage("&cType &a/ignore list &cto see who you are still ignoring");
} }
static void CheckOutdatedClient(Player p) {
if (p.appName == null || !p.appName.StartsWith("ClassicalSharp ")) return;
int spaceIndex = p.appName.IndexOf(' ');
string version = p.appName.Substring(spaceIndex, p.appName.Length - spaceIndex);
Version ver;
try {
ver = new Version(version);
} catch {
return;
}
if (ver < new Version("0.98.6")) {
p.SendMessage("%aYou are using an outdated version of ClassicalSharp.");
p.SendMessage("%aYou can click %eCheck for updates %ain the launcher to update. " +
"(make sure to close the client first)");
p.outdatedClient = true;
}
}
static void CheckLoginJailed(Player p) { static void CheckLoginJailed(Player p) {
string line = Server.jailed.Find(p.name); string line = Server.jailed.Find(p.name);
if (line == null) return; if (line == null) return;

View File

@ -149,8 +149,6 @@ namespace MCGalaxy {
public int overallDeath; public int overallDeath;
public bool staticCommands = false; public bool staticCommands = false;
internal bool outdatedClient = false; // for ClassicalSharp 0.98.5, which didn't reload map for BlockDefinitions
public DateTime ZoneSpam; public DateTime ZoneSpam;
public bool aiming; public bool aiming;