예제 #1
0
        public void UpdateCurrentRoomReference(IClientDistributedRoom room)
        {
            mCurrentRoom = room;
            UserAccountProxy userAccountProxy = GameFacade.Instance.RetrieveProxy <UserAccountProxy>();

            userAccountProxy.SetAccountProperty <RoomId>(UserAccountProperties.LastRoomId, mCurrentRoom.RoomId);
        }
예제 #2
0
        /// <summary>
        /// Handle initial entry into the game.  Put user in a default location based on their if they are a first time user,
        /// and their entry point into the client from the web
        /// </summary>
        private void HandleInitialEntryToGame()
        {
            UserAccountProxy userAccountProxy = GameFacade.Instance.RetrieveProxy <UserAccountProxy>();
            bool             isFirstTimeUser  = false;

            Console.WriteLine("User properties " + userAccountProxy.ToString());
            if (!userAccountProxy.TryGetAccountProperty <bool>(UserAccountProperties.FirstTimeUser, ref isFirstTimeUser))
            {
                Console.WriteLine("First time user property not set, assume it our first time in");
                isFirstTimeUser = true;
            }

            ConfigManagerClient configManager = GameFacade.Instance.RetrieveProxy <ConfigManagerClient>();
            bool returnUsersStartMinigame     = configManager.GetBool("return_users_start_minigame", true);

            if (isFirstTimeUser)
            {
                ConnectionProxy connectionProxy = GameFacade.Instance.RetrieveProxy <ConnectionProxy>();
                switch (connectionProxy.WebEntryPointId)
                {
                case FunnelGlobals.PUBLIC_LOBBY:
                    RoomManagerProxy roomManager = GameFacade.Instance.RetrieveProxy <RoomManagerProxy>();
                    roomManager.JoinLastRoom();
                    break;

                case FunnelGlobals.FASHION_MINIGAME:
                    SendNotification(GameFacade.SWITCHING_TO_FASHION_MINI_GAME);
                    break;

                default:
                    throw new Exception("Unexpected entry point received: " + connectionProxy.WebEntryPointId);
                }
                // Set firstTimeUser property to false
                userAccountProxy.SetAccountProperty <bool>(UserAccountProperties.FirstTimeUser, false);
            }
            else
            {
                if (returnUsersStartMinigame)
                {
                    SendNotification(GameFacade.SWITCHING_TO_FASHION_MINI_GAME);
                }
                else
                {
                    Console.WriteLine("Not a First time user go to room");
                    // Returning user.  Go to default room
                    RoomManagerProxy roomManager = GameFacade.Instance.RetrieveProxy <RoomManagerProxy>();
                    roomManager.JoinLastRoom();
                }
            }
        }