コード例 #1
0
        // -------------------------------------------

        /*
         * Will create a new room for lobby
         */
        public void MenuController_CreateNewLobbyRoom(string _nameLobby, int _finalNumberOfPlayers, string _extraData)
        {
            MultiplayerConfiguration.SaveNameRoomLobby(_nameLobby);
#if ENABLE_BALANCE_LOADER
            UIEventController.Instance.DispatchUIEvent(MenuScreenController.EVENT_MENUEVENTCONTROLLER_SHOW_LOADING_MESSAGE);
            CommsHTTPConfiguration.CreateNewRoom(true, _nameLobby, ClientTCPEventsController.GetPlayersString(_finalNumberOfPlayers), _extraData);
#else
            MenuController_CreateRoomForLobby(_nameLobby, _finalNumberOfPlayers, _extraData);
#endif
        }
        // -------------------------------------------

        /*
         * Release resources
         */
        public void Destroy()
        {
            if (m_hasBeenDestroyed)
            {
                return;
            }
            m_hasBeenDestroyed = true;

            NetworkEventController.Instance.DispatchLocalEvent(NetworkEventController.EVENT_SYSTEM_DESTROY_NETWORK_COMMUNICATIONS);
            NetworkEventController.Instance.NetworkEvent -= OnNetworkEvent;
            UIEventController.Instance.UIEvent           -= OnUIEvent;
            CloseSocket(true);
            Destroy(_instance.gameObject);
            _instance = null;

            if (DEBUG)
            {
                Debug.LogError("ClientTCPEventsController::Destroy::SOCKEDT CONNECTION HAS BEEN SUCCESSFULLY DESTROYED!!!!!!!!!!!!!!!!!!!!!!!!");
            }
        }