Ejemplo n.º 1
0
        public void OnGUI()
        {
            if (m_mgrFSP != null)
            {
                GUILayout.Label("Client[" + m_playerId + "]: " + m_mgrFSP.GameState);
            }
            else
            {
                GUILayout.Label("Client[" + m_playerId + "]");
            }

            GUILayout.Label("最近一次VKey:" + m_lastVKey);

            if (FSPServer.Instance.IsRunning)
            {
                if (GUILayout.Button("Start"))
                {
                    Start(FSPServer.Instance.GetParam());
                }
            }

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

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

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

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

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

            if (GUILayout.Button("SendGameExit"))
            {
                m_mgrFSP.SendGameExit();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 创建玩家
 /// </summary>
 public void CreatePlayer()
 {
     Debuger.Log(LOG_TAG, "CreatePlayer()");
     m_mgrFSP.SendFSP(GameVKey.CreatePlayer);
 }
Ejemplo 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();
            }
        }
Ejemplo n.º 4
0
 public void SendCommand(int cmd, int arg)
 {
     m_fsp.SendFSP(cmd, arg);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Create a player
 /// </summary>
 public void CreatePlayer()
 {
     MyLogger.Log(LOG_TAG, "CreatePlayer()");
     mgrFSP.SendFSP(GameVKeys.CreatePlayer);
 }