Esempio n. 1
0
        //---------------------------------------------------------------------
        // 客户端请求炮台倍率切换
        public void c2sTurretRate(int rate)
        {
            List <int> list_rate = mScene.getListTurretRate();

            if (list_rate.Contains(rate))
            {
                _setTurretRate(rate);
                mScene.getProtocol().s2allcTurretRate(mPlayer.et_player_rpcid, mTurretRate);
            }
        }
Esempio n. 2
0
        //---------------------------------------------------------------------
        // 服务端响应玩家获取场景快照
        public void s2cSnapshotScene(uint et_player_rpcid)
        {
            List <string> vec_param_ret = new List <string>();

            vec_param_ret.Add(((byte)_eProtocolDesktop.s2cSnapshotScene).ToString());
            vec_param_ret.Add(et_player_rpcid.ToString());

            // 关卡信息
            CLogicLevel level = mScene.getLevel();

            vec_param_ret.Add(((byte)level.getLevelState()).ToString());
            vec_param_ret.Add(level.getLevelVibId().ToString());
            vec_param_ret.Add(level.CurMapVibId.ToString());
            vec_param_ret.Add(level.NextMapVibId.ToString());
            vec_param_ret.Add(level.getCurSecond().ToString());
            vec_param_ret.Add(level.getMaxSecond().ToString());
            vec_param_ret.Add(level.isFormation().ToString());

            // 同步房间炮台倍率信息。
            List <int> list_rate = mScene.getListTurretRate();

            vec_param_ret.Add(list_rate.Count.ToString());
            foreach (var i in list_rate)
            {
                vec_param_ret.Add(i.ToString());
            }

            // 炮台信息
            Dictionary <uint, CLogicTurret> map_turret = mScene.getMapTurret();

            vec_param_ret.Add(map_turret.Count.ToString());
            foreach (var i in map_turret)
            {
                _tScenePlayer scene_player = i.Value.getScenePlayerInfo();
                vec_param_ret.Add(scene_player.et_player_rpcid.ToString());
                vec_param_ret.Add(scene_player.nickname);
                int player_gold = mScene.getListener().onLogicSceneGetPlayerGold(scene_player.et_player_rpcid);
                vec_param_ret.Add(player_gold.ToString());
                vec_param_ret.Add(scene_player.rate.ToString());
                vec_param_ret.Add(i.Value.getTurretId().ToString());
                vec_param_ret.Add(i.Value.getBufferPower().ToString());
                vec_param_ret.Add(i.Value.getBufferFreeze().ToString());
                vec_param_ret.Add(i.Value.getBufferLongpress().ToString());
                vec_param_ret.Add(i.Value.getBufferRapid().ToString());
                vec_param_ret.Add(i.Value.getTurretAngle().ToString());
                vec_param_ret.Add(i.Value.getTurretRate().ToString());
                vec_param_ret.Add(((byte)(i.Value.getTurretType())).ToString());
                vec_param_ret.Add(i.Value.getLockFishObjId().ToString());
            }

            mScene.getListener().onLogicScene2Render(et_player_rpcid, vec_param_ret);
        }