示例#1
0
        public bool IsRoomOwner()
        {
            ClientDistributedGreenScreenRoom room = CurrentRoom as ClientDistributedGreenScreenRoom;

            if (room != null && room.IsLocalClientOwnedRoom)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="roomBackgroundItemId"></param>
 public void UpdateCurrentRoomBackground(ItemId roomBackgroundItemId)
 {
     if (mCurrentRoom != null)
     {
         if (mCurrentRoom.RoomType == RoomType.GreenScreenRoom)
         {
             ClientDistributedGreenScreenRoom greenScreenRoom = mCurrentRoom as ClientDistributedGreenScreenRoom;
             // Only allow this change if the room is owned by the local user
             if (greenScreenRoom.IsLocalClientOwnedRoom)
             {
                 greenScreenRoom.UpdateBackgroundImage(roomBackgroundItemId);
             }
         }
     }
     else
     {
         throw new System.Exception("Error: the current room is null");
     }
 }
示例#3
0
        private IClientDistributedRoom BuildRoomDistributedObject(DistributedObjectId id, List <object> messageData)
        {
            RoomType roomType = CheckType.TryAssignType <RoomType>(messageData[2]);

            IClientDistributedRoom clientDistributedRoom = null;

            switch (roomType)
            {
            case RoomType.GreenScreenRoom:
                clientDistributedRoom = new ClientDistributedGreenScreenRoom(mSendMessage, id, messageData);
                break;

            case RoomType.MiniGameRoom:
                throw new System.Exception("we shouldn't be creating these anymore in this way!! talk to matt!");
            }
            RoomManagerProxy roomManagerProxy = GameFacade.Instance.RetrieveProxy <RoomManagerProxy>();

            roomManagerProxy.UpdateCurrentRoomReference(clientDistributedRoom);
            return(clientDistributedRoom);
        }