public static void AddRoom(string roomName, string playerName) { Rooms.Add(roomName, new RoomState { Players = new List <string> { playerName }, }); OnRoomAdded.Invoke(); }
public override void OnRoomListUpdate(List <RoomInfo> roomList) { base.OnRoomListUpdate(roomList); foreach (RoomInfo tmp_Info in roomList) { if (tmp_Info.RemovedFromList) { if (roomInfoDictionary.ContainsKey(tmp_Info.Name)) { roomInfoDictionary.Remove(tmp_Info.Name); OnRoomRemoved?.Invoke(tmp_Info); } return; } if (roomInfoDictionary.ContainsKey(tmp_Info.Name)) { continue; } roomInfoDictionary.Add(tmp_Info.Name, tmp_Info); OnRoomAdded?.Invoke(tmp_Info); } }