コード例 #1
0
ファイル: PacketManager.cs プロジェクト: vashage/MarsMiner
        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 );
        }
コード例 #2
0
ファイル: GameServer.cs プロジェクト: vashage/MarsMiner
        public GameServer( ServerBuilder builder )
        {
            Name = builder.Name;
            Password = builder.Password;

            Slots = new ClientBase[ builder.SlotCount ];
            ClientCount = 0;

            World = new World();
        }
コード例 #3
0
 protected void RemoveClient(ClientBase client)
 {
     Slots[client.Slot] = null;
     --ClientCount;
 }
コード例 #4
0
 protected void AddClient(ClientBase client)
 {
     client.Slot        = NextFreeSlot;
     Slots[client.Slot] = client;
     ++ClientCount;
 }
コード例 #5
0
ファイル: GameServer.cs プロジェクト: vashage/MarsMiner
 protected void RemoveClient( ClientBase client )
 {
     Slots[ client.Slot ] = null;
     --ClientCount;
 }
コード例 #6
0
ファイル: GameServer.cs プロジェクト: vashage/MarsMiner
 protected void AddClient( ClientBase client )
 {
     client.Slot = NextFreeSlot;
     Slots[ client.Slot ] = client;
     ++ClientCount;
 }