private void SkirmishGameStatusPacketReceived(SkirmishGameStatusPacket packet, IPEndPoint host) { Logger.Info("got mapName" + packet.MapName); // the host may not know its external IP, but we know it packet.Slots[0].EndPoint = host; SkirmishGame.MapName = packet.MapName; SkirmishGame.Slots = packet.Slots; if (SkirmishGame.LocalSlotIndex < 0) { SkirmishGame.LocalSlotIndex = Array.FindIndex(packet.Slots, s => s.ClientId == ClientInstance.Id); Logger.Info($"New local slot index is {SkirmishGame.LocalSlotIndex}"); } }
private void SkirmishGameStatusPacketReceived(SkirmishGameStatusPacket packet, IPEndPoint host) { Logger.Info("got mapName" + packet.MapName); // the host may not know its external IP, but we know it packet.Slots[0].EndPoint = host; Settings.MapName = packet.MapName; Settings.Slots = packet.Slots; // after joining a game, we don't know our slot index, but once // we got the slot data from the host, we can figure it out if (Settings.LocalSlotIndex < 0) { Settings.LocalSlotIndex = Array.FindIndex(packet.Slots, s => s.ClientId == ClientInstance.Id); Logger.Info($"New local slot index is {Settings.LocalSlotIndex}"); } }