public void ReadFromByteArray(ByteArray byteArray) { this.BattleMode = BattleModeHelper.ReadFromByteArray(byteArray); this.LinkMode = BattleLinkModeHelper.ReadFromByteArray(byteArray); this.Rules = new BattleRuleSequence(); this.Rules.ReadFromByteArray(byteArray); }
private static bool OnDirectBattle(ByteArray byteArray, IRoomClientService clientService) { int server = byteArray.ReadInt(); BattleMode battleMode = BattleModeHelper.ReadFromByteArray(byteArray); clientService.OnDirectBattle(server, battleMode); return(true); }
private static bool OnAgentBattle(ByteArray byteArray, IRoomClientService clientService) { int identity = byteArray.ReadInt(); byte playerPosition = byteArray.ReadByte(); BattleMode battleMode = BattleModeHelper.ReadFromByteArray(byteArray); clientService.OnAgentBattle(identity, playerPosition, battleMode); return(true); }
private static bool OnLogon(int sessionID, ByteArray byteArray, IPokemonBattleServerService serverService) { string identity = byteArray.ReadUTF(); BattleMode modeInfo = BattleModeHelper.ReadFromByteArray(byteArray); string versionInfo = byteArray.ReadUTF(); serverService.OnLogon(sessionID, identity, modeInfo, versionInfo); return(true); }
public static ByteArray Logon(string identity, BattleMode modeInfo, string versionInfo) { ByteArray byteArray = new ByteArray(); byteArray.WriteInt(0x5bbe67ef); byteArray.WriteUTF(identity); BattleModeHelper.WriteToByteArray(byteArray, modeInfo); byteArray.WriteUTF(versionInfo); return(byteArray); }
public void WriteToByteArray(ByteArray byteArray) { BattleModeHelper.WriteToByteArray(byteArray, this.BattleMode); BattleLinkModeHelper.WriteToByteArray(byteArray, this.LinkMode); this.Rules.WriteToByteArray(byteArray); }