コード例 #1
0
        public bool Connect(string address, int port)
        {
            bool isConnected = mClientReflector.Connect(address, port);

            if (isConnected)
            {
                SendNotification(GameFacade.CONNECTED);
                mRequestMessageFromReflectorTask = mScheduler.StartCoroutine(RequestMessageFromReflector());
            }
            else
            {
                GameFacade.Instance.SendNotification(GameFacade.DISCONNECTED);
                ShowConnectFailedPopup(address, port);
            }
            return(isConnected);
        }
コード例 #2
0
        public void StartReflector(GameFacade mInstance)
        {
            if (mClientReflector == null)
            {
                string stateServerAddress = mStateServerAddress; //"127.0.0.1";  //"64.106.173.25";
                int    stateServerPort    = mStateServerPort;    //8000;

                Console.WriteLine(stateServerAddress + ":" + stateServerPort);

                mScheduler = mInstance.RetrieveMediator <SchedulerMediator>().Scheduler;

                mClientReflector = new Hangout.Client.ClientReflector(mScheduler, delegate()
                {
                });

                mClientReflector.Connect(stateServerAddress, stateServerPort);

                mPaymentItemCommand = new PaymentItemsCommand(GetMyIpAddress());
            }
        }