public override void FromBinaryReader(EndianBinaryReader reader) { Address = reader.ReadString(); Id = reader.ReadInt32(); Type = (GameInfoType)reader.ReadInt32(); Name = reader.ReadString(); IsPasswordProtected = reader.ReadBoolean(); MaxPlayers = reader.ReadInt32(); OnlinePlayers = reader.ReadInt32(); Properties = reader.ReadDictionary(); }
private PreGameJoinRequest getJoinRequest(GameInfoType roomType, string roomID) { AccountInfoPacket ac = ClientUIOverlord.getCurrentAcountInfo(); return(new PreGameJoinRequest() { roomID = roomID, joiningPlayer = new PlayerInfo { username = ac.Username, iconNumber = int.Parse(ac.Properties[AlbotDictKeys.icon]) } }); }
public void joinPreGame(GameInfoType roomType, string roomID) { PreGameJoinRequest joinRequest = getJoinRequest(roomType, roomID); if (roomType == GameInfoType.PreGame) { Msf.Connection.SendMessage((short)ServerCommProtocl.RequestJoinPreGame, joinRequest, handleJoinPreGameMsg); } else if (roomType == GameInfoType.PreTournament) { Msf.Connection.SendMessage((short)CustomMasterServerMSG.joinTournament, joinRequest, CurrentTournament.handleJoinedTournament); } }
private void initBackgroundColor(GameInfoType type) { if (type == GameInfoType.PreTournament) { currentColor = tournamentColor; } else { currentColor = defaultColor; } SetIsSelected(false); }
public GameInfoPacket createGameInfoPacket(GameInfoType infoType, string roomID, string hostName, int maxPlayers, int playerAmount, Game.GameType type) { return(new GameInfoPacket() { infoType = infoType, Name = hostName, OnlinePlayers = playerAmount, MaxPlayers = maxPlayers, IsPasswordProtected = false, Properties = new Dictionary <string, string>() { { MsfDictKeys.MapName, type.ToString() }, { MsfDictKeys.IsPreGame, true.ToString() }, { MsfDictKeys.GameType, type.ToString() } }, Id = roomID, Address = "MasterIP" }); }
public void Setup(GameInfoPacket data, Action doubleClickAction = null) { RawData = data; IsLobby = data.infoType == GameInfoType.Lobby; roomType = data.infoType; Name.text = data.Name; GameId = data.Id; initBackgroundColor(data.infoType); this.doubleClickAction = doubleClickAction; if (data.MaxPlayers > 0) { Online.text = string.Format("{0}/{1}", data.OnlinePlayers, data.MaxPlayers); } else { Online.text = data.OnlinePlayers.ToString(); } MapName.text = data.Properties.ContainsKey(MsfDictKeys.MapName) ? data.Properties[MsfDictKeys.MapName] : UnknownMapName; }
public static void handleJoinPreGame(GameInfoType roomType, string roomID) { singleton.joinPreGame(roomType, roomID); }
internal void Write(GameInfoType type) { throw new NotImplementedException(); }