Exemplo n.º 1
0
 /// <summary>
 /// Called when a room list request is made.
 /// </summary>
 /// <param name="packetHeader">The packet header.</param>
 /// <param name="connection">The connection.</param>
 /// <param name="incomingObject"></param>
 private void HandleRoomListRequested(PacketHeader packetHeader, Connection connection, int incomingObject)
 {
     if (this.IsClientAuthenticated(connection))
     {
         RoomItemList itemList = this.ChessGameRoomList.GetRoomItemList();
         connection.SendObject <RoomItemList>(PACKET_TYPE_ROOMLIST_REPLY, itemList);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets a RoomItemList object containing the list of all server's RoomItem.
        /// </summary>
        /// <returns>A RoomItemList object containing the list of all server's RoomItem.</returns>
        public RoomItemList GetRoomItemList()
        {
            RoomItemList itemList = new RoomItemList();

            foreach (ChessGameRoom gameRoom in this.GameRoomList)
            {
                itemList.List.Add(gameRoom.GetRoomItem());
            }
            return(itemList);
        }