예제 #1
0
        /// <summary>
        /// 进入游戏
        /// </summary>
        private void OnEnterGame(ClientSession session, PacketBase packet)
        {
            c2gs.EnterGame msg = packet as c2gs.EnterGame;

            if (session.session_status != eSessionStatus.ALREADY_LOGIN)
            {
                Log.Debug("OnEnterGame::错误的seesion状态:" + session.session_status);
                return;
            }
            //请求进入游戏
            session.session_status = eSessionStatus.ENTER_GAMING;

            gs2ss.EnterGame rep_msg = PacketPools.Get(gs2ss.msg.ENTER_GAME) as gs2ss.EnterGame;
            rep_msg.client_uid  = session.client_uid;
            rep_msg.account_idx = session.account_idx;
            rep_msg.char_idx    = msg.char_idx;
            session.Send2SS(rep_msg);
        }
예제 #2
0
 /// <summary>
 /// 压力测试
 /// </summary>
 private void OnClientRobotTest(ClientSession session, PacketBase packet)
 {
     c2gs.RobotTest msg = packet as c2gs.RobotTest;
     if (Utils.HasFlag(msg.flags, (uint)eServerType.WORLD))
     {
         gs2ws.RobotTest rep_msg = PacketPools.Get(gs2ws.msg.ROBOT_TEST) as gs2ws.RobotTest;
         rep_msg.client_uid = session.client_uid;
         rep_msg.length     = msg.length;
         ServerNetManager.Instance.Send2WS(rep_msg);
     }
     if (Utils.HasFlag(msg.flags, (uint)eServerType.SERVER))
     {
         gs2ss.RobotTest rep_msg = PacketPools.Get(gs2ss.msg.ROBOT_TEST) as gs2ss.RobotTest;
         rep_msg.client_uid = session.client_uid;
         rep_msg.length     = msg.length;
         session.Send2SS(rep_msg);
     }
     if (msg.flags == 0 || Utils.HasFlag(msg.flags, (uint)eServerType.GATE))
     {
         gs2c.RobotTest rep_msg = PacketPools.Get(gs2c.msg.ROBOT_TEST) as gs2c.RobotTest;
         rep_msg.length = msg.length;
         session.Send(rep_msg);
     }
 }