public static bool HandlePacket( ClientBase sender, Stream stream ) { UInt16 id = BitConverter.ToUInt16( stream.ReadBytes( 2 ), 0 ); if ( stNextID <= id ) throw new Exception( "Unknown packet type recieved" ); ClientPacketType type = stTypeIDs[ id ]; return type.PacketHandler( sender, type, stream ); }
public GameServer( ServerBuilder builder ) { Name = builder.Name; Password = builder.Password; Slots = new ClientBase[ builder.SlotCount ]; ClientCount = 0; World = new World(); }
protected void RemoveClient(ClientBase client) { Slots[client.Slot] = null; --ClientCount; }
protected void AddClient(ClientBase client) { client.Slot = NextFreeSlot; Slots[client.Slot] = client; ++ClientCount; }
protected void RemoveClient( ClientBase client ) { Slots[ client.Slot ] = null; --ClientCount; }
protected void AddClient( ClientBase client ) { client.Slot = NextFreeSlot; Slots[ client.Slot ] = client; ++ClientCount; }