private static bool OnReceiveRandomSeed(ByteArray byteArray, IPokemonBattleClientService clientService) { int seed = byteArray.ReadInt(); clientService.OnReceiveRandomSeed(seed); return(true); }
private static bool OnExit(ByteArray byteArray, IPokemonBattleClientService clientService) { string identity = byteArray.ReadUTF(); clientService.OnExit(identity); return(true); }
private static bool OnRegistObsever(ByteArray byteArray, IPokemonBattleClientService clientService) { int identity = byteArray.ReadInt(); clientService.OnRegistObsever(identity); return(true); }
private static bool OnReceiveTieMessage(ByteArray byteArray, IPokemonBattleClientService clientService) { string identity = byteArray.ReadUTF(); TieMessage message = TieMessageHelper.ReadFromByteArray(byteArray); clientService.OnReceiveTieMessage(identity, message); return(true); }
private static bool OnReceiveRules(ByteArray byteArray, IPokemonBattleClientService clientService) { BattleRuleSequence rules = new BattleRuleSequence(); rules.ReadFromByteArray(byteArray); clientService.OnReceiveRules(rules); return(true); }
private static bool OnReceiveMove(ByteArray byteArray, IPokemonBattleClientService clientService) { PlayerMove move = new PlayerMove(); move.ReadFromByteArray(byteArray); clientService.OnReceiveMove(move); return(true); }
private static bool OnReceiveBattleSnapshot(ByteArray byteArray, IPokemonBattleClientService clientService) { BattleSnapshot snapshot = new BattleSnapshot(); snapshot.ReadFromByteArray(byteArray); clientService.OnReceiveBattleSnapshot(snapshot); return(true); }
private static bool OnReceiveTeam(ByteArray byteArray, IPokemonBattleClientService clientService) { byte position = byteArray.ReadByte(); string identity = byteArray.ReadUTF(); ByteSequence team = new ByteSequence(); team.ReadFromByteArray(byteArray); clientService.OnReceiveTeam(position, identity, team); return(true); }
public static bool InterpretMessage(int sessionID, ByteArray byteArray, IPokemonBattleClientService clientService) { byteArray.BypassHeader(); switch (byteArray.ReadInt()) { case -774376481: return(OnRegistObsever(byteArray, clientService)); case -632492989: return(OnLogonFail(byteArray, clientService)); case -274250105: return(OnReceiveRules(byteArray, clientService)); case -1287328945: return(OnReceiveTeam(byteArray, clientService)); case -1158854104: return(OnExit(byteArray, clientService)); case -1110713650: return(OnTimeUp(byteArray, clientService)); case 0x823c9f1: return(OnReceiveTieMessage(byteArray, clientService)); case 0x18789bab: return(OnReceiveRandomSeed(byteArray, clientService)); case 0x49fd3e0f: return(OnReceiveBattleSnapshot(byteArray, clientService)); case 0x51a0a8fc: return(OnReceiveBattleInfo(byteArray, clientService)); case 0x6615466d: return(OnReceiveMove(byteArray, clientService)); case 0x7ada52ee: return(OnLogonSuccess(byteArray, clientService)); } byteArray.Rewind(); return(false); }