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); }