Esempio n. 1
0
 public RoomModel TryGetModel()
 {
     lock (mSyncRoot)
     {
         return(RoomManager.GetModel(mModelName));
     }
 }
Esempio n. 2
0
        private static void OnCreateRoom(Session Session, ClientMessage Message)
        {
            string Name      = UserInputFilter.FilterString(Message.PopString());
            string ModelName = Message.PopString().ToLower();

            if (Name.Length < 3)
            {
                return;
            }

            RoomModel Model = RoomManager.GetModel(ModelName);

            if (Model == null || !Model.IsUsableBySession(Session) || Session.CharacterInfo.GetRoomCount() >= Navigator.MaxRoomsPerUser)
            {
                return;
            }

            uint RoomId = RoomManager.CreateRoom(Session.CharacterId, Name, ModelName);

            if (RoomId > 0)
            {
                Session.SendData(RoomCreateResultComposer.Compose(RoomId, Name));
            }
        }