private void HandleWorldCacheURL(NetworkMessage msg) { if (WorldURL != string.Empty) { return; } MsgCacheURL url = msg as MsgCacheURL; WorldURL = url.URL; NetClient.SendMessage(new MsgWantWHash()); // fastmap servers send the world cache before the hash, so send the hash request again so they know we wants it }
private static void HandleWorldCacheURL(NetworkMessage msg) { if (GotURL) { return; } GotURL = true; MsgCacheURL url = msg as MsgCacheURL; WriteLine("Received Cache URL" + url.URL); client.SendMessage(new MsgWantWHash()); }
public override void Setup() { SettingsCache = new MsgGameSettings(); byte[] worldBuffer = World.GetWorldData(); SettingsCache.WorldSize = worldBuffer.Length; SettingsCache.GameType = Config.GameData.GameType; SettingsCache.GameOptions = Config.GameData.GameOptions; SettingsCache.MaxPlayers = Config.GameData.MaxPlayers; SettingsCache.MaxShots = Config.GameData.MaxShots; SettingsCache.MaxFlags = FlagManager.MaxFlagID; SettingsCache.LinearAcceleration = Config.GameData.LinearAcceleration; SettingsCache.AngularAcceleration = Config.GameData.AngularAcceleration; HashCache = new MsgWantWHash(); HashCache.IsRandomMap = World.IsRandom; HashCache.WorldHash = BZFlag.Data.Utils.Cryptography.MD5Hash(worldBuffer); URLCache = new MsgCacheURL(); URLCache.URL = Config.GameData.MapURL; }