static public void Handle_SC_ChangeTeam(SC_ChangeTeam pkt, Client client) { GameClient c = ((client as Client <GameClient>)._obj); c._arena.playerChangeTeam(pkt.playerID, pkt.teamname); }
/// <summary> /// Creates a new packet based on the typeID and the received content /// inside the buffer. The user has to create an own implementation /// of this interface. /// </summary> public PacketBase createPacket(NetworkClient client, ushort typeID, byte[] buffer, int offset, int size) { //Ready our packet base PacketBase packet = null; size--; //Was it a system packet? if (buffer[offset++] == 0) { //Yes, find the appropriate type return(createSystemPacket(typeID, buffer, offset, size)); } //So what was the typeid? switch (typeID) { case SC_Login.TypeID: packet = new SC_Login(typeID, buffer, offset, size); break; case SC_PatchInfo.TypeID: packet = new SC_PatchInfo(typeID, buffer, offset, size); break; case SC_AssetInfo.TypeID: packet = new SC_AssetInfo(typeID, buffer, offset, size); break; case SC_ChangeTeam.TypeID: packet = new SC_ChangeTeam(typeID, buffer, offset, size); break; case SC_SetIngame.TypeID: packet = new SC_SetIngame(typeID, buffer, offset, size); break; case SC_PlayerWarp.TypeID: packet = new SC_PlayerWarp(typeID, buffer, offset, size); break; case SC_Chat.TypeID: packet = new SC_Chat(typeID, buffer, offset, size); break; case SC_VehicleDeath.TypeID: packet = new SC_VehicleDeath(typeID, buffer, offset, size); break; case SC_PlayerEnter.TypeID: packet = new SC_PlayerEnter(typeID, buffer, offset, size); break; case SC_PlayerLeave.TypeID: packet = new SC_PlayerLeave(typeID, buffer, offset, size); break; case SC_ArenaList.TypeID: packet = new SC_ArenaList(typeID, buffer, offset, size); break; default: //An undefined packet. packet = new PacketDummy(typeID, buffer, offset, size); break; } return(packet); }