public bool IsRoomOwner() { ClientDistributedGreenScreenRoom room = CurrentRoom as ClientDistributedGreenScreenRoom; if (room != null && room.IsLocalClientOwnedRoom) { return(true); } else { return(false); } }
/// <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"); } }
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); }