示例#1
0
 public bool JoinRandomRoom(LNSJoinRoomFilter filter)
 {
     if (isConnected && !isInActiveRoom)
     {
         lock (thelock)
         {
             writer.Reset();
             writer.Put(LNSConstants.SERVER_EVT_JOIN_RANDOM_ROOM);
             if (filter == null)
             {
                 writer.Put((byte)0);
             }
             else
             {
                 filter.AppendToWriter(writer);
             }
             peer.Send(writer, DeliveryMethod.ReliableOrdered);
         }
         return(true);
     }
     return(false);
 }
示例#2
0
 public bool FetchRoomList(LNSJoinRoomFilter filter)
 {
     if (isConnected && !isInActiveRoom)
     {
         currentRoomFilter = filter;
         lock (thelock)
         {
             writer.Reset();
             writer.Put(LNSConstants.SERVER_EVT_FETCH_ROOM_LIST);
             if (filter != null)
             {
                 filter.AppendToWriter(writer);
             }
             else
             {
                 writer.Put((byte)0);
             }
             peer.Send(writer, DeliveryMethod.ReliableOrdered);
         }
         return(true);
     }
     return(false);
 }