public void Start(FSPParam param)
        {
            this.Log("Start()");
            param.sid = m_playerId;
            m_mgrFSP  = new FSPManager();
            m_mgrFSP.Start(param, m_playerId);
            m_mgrFSP.SetFrameListener(OnEnterFrame);
            m_mgrFSP.onGameEnd += (arg) =>
            {
                this.Log("OnGameEnd() " + arg);
                DelayInvoker.DelayInvoke(0.01f, Close);
                //Close();
            };
            m_mgrFSP.onGameExit += (playerId) =>
            {
                this.Log("onGameExit() " + playerId);
                if (playerId == m_playerId)
                {
                    DelayInvoker.DelayInvoke(0.01f, Close);
                    //Close();
                }
            };

            m_mgrFSP.SendGameBegin();
        }
Esempio n. 2
0
 public void GameBegin()
 {
     Debuger.Log(LOG_TAG, "GameBegin()");
     m_mgrFSP.SendGameBegin();
 }
Esempio n. 3
0
        public void OnGUI()
        {
            if (m_mgrFSP != null)
            {
                GUILayout.Label("Client[" + m_playerId + "]: " + m_mgrFSP.GameState);
                GUILayout.Label("Port: " + m_mgrFSP.Port);
            }
            else
            {
                GUILayout.Label("Client[" + m_playerId + "]");
            }
            GUILayout.Label("VKey:" + m_lastVKey);

            // 没开的话只能先开
            if (m_mgrFSP == null)
            {
                if (GUILayout.Button("Start"))
                {
                    // 这些变量不能共用
                    FSPParam param = FSPServer.Instance.GetParam();
                    param.sid    = sid;
                    param.authId = (int)playerId;

                    Start(param);
                }
                return;
            }

            if (GUILayout.Button("SendGameBegin"))
            {
                m_mgrFSP.SendGameBegin();
            }

            if (GUILayout.Button("SendRoundBegin"))
            {
                m_mgrFSP.SendRoundBegin();
            }

            if (GUILayout.Button("SendControlStart"))
            {
                m_mgrFSP.SendControlStart();
            }

            if (GUILayout.Button("SendPing"))
            {
                m_mgrFSP.SendFSP(FSPVKeyBase.PING, UnityEngine.Random.Range(1, 1000));
            }

            if (GUILayout.Button("SendRoundEnd"))
            {
                m_mgrFSP.SendRoundEnd();
            }

            if (GUILayout.Button("SendGameEnd"))
            {
                m_mgrFSP.SendGameEnd();
            }

            if (GUILayout.Button("SendPlayerExit"))
            {
                m_mgrFSP.SendPlayerExit();
            }
        }
Esempio n. 4
0
 public void GameBegin()
 {
     m_fsp.SendGameBegin();
 }
Esempio n. 5
0
 public void GameBegin()
 {
     MyLogger.Log(LOG_TAG, "GameBegin()");
     mgrFSP.SendGameBegin();
 }