コード例 #1
0
        public GameplayPrompt(Client user, MOB character)
        {
            MainCharacter = character;
            User          = user;

            if (character.Body != null && character.Body.Position == null)
            {
                Room room = GlobalValues.DefaultStartingRoom;
                if (room != null)
                {
                    using (RoomEvent enterEvent = ThreadManager.StartEvent(room, new SpawnPlayerEvent(character), -1, false))
                    {
                        if (enterEvent == null)
                        {
                            //With no timeout, I don't think this will ever be possible.
                            User.sendMessage("Unknown error with default starting room.");
                            User.ReturnToLoggedInPrompt();
                        }
                        else
                        {
                            //Get listeners for event, fire event.
                            enterEvent.FullRunEvent();
                        }
                    }
                }
                else
                {
                    User.sendMessage("No starting room available. Message an admin for help.");
                    User.ReturnToLoggedInPrompt();
                }
            }
        }