Пример #1
0
        //发送给玩家刷新信息
        public void SendPlayRefreshInfo(PlayerObject play)
        {
            if (play.GetGameSession() == null) return;
            if (mMonsterInfo == null) return;
            //刷新幻兽数据
            NetMsg.MsgEudemonBattleInfo battleinfo = new NetMsg.MsgEudemonBattleInfo();
            battleinfo.Create(null, play.GetGamePackKeyEx());
            battleinfo.id = mInfo.GetTypeID();
            battleinfo.lookface = mMonsterInfo.lookface;
            battleinfo.name = mInfo.name;
            battleinfo.monsterid = mMonsterInfo.id;
            battleinfo.x = play.GetCurrentX();
            battleinfo.y = play.GetCurrentY();
            battleinfo.dir = play.GetDir();
            play.SendData(battleinfo.GetBuffer());

            //要有血量,不然就挂了
            NetMsg.MsgEudemonInfo eudemoninfo = new NetMsg.MsgEudemonInfo();
            eudemoninfo.Create(null, play.GetGamePackKeyEx());
            eudemoninfo.id = mInfo.GetTypeID();
            eudemoninfo.AddAttribute(GameStruct.EudemonAttribute.Life, mInfo.life);
            eudemoninfo.AddAttribute(GameStruct.EudemonAttribute.Life_Max, mInfo.life);
            play.SendData(eudemoninfo.GetBuffer());
        }