Example #1
0
 public void AddPlayerObject(PlayerObject obj)
 {
     m_DicPlayerObject[obj.GetGameID()] = obj;
 }
Example #2
0
 public void RemovePlayObject(PlayerObject obj)
 {
     //从地图中删除
     if (obj == null) return;
     if (obj.GetGameMap() != null)
     {
         obj.GetGameMap().RemoveObj(obj);
     }
     obj.Dispose();
     if (m_DicPlayerObject.ContainsKey(obj.GetGameID()))
     {
         m_DicPlayerObject.Remove(obj.GetGameID());
     }
 }
Example #3
0
 public PlayerObject CreatePlayObject()
 {
     PlayerObject play = new PlayerObject();
     m_DicPlayerObject[play.GetGameID()] = play;
     return play;
 }
Example #4
0
        public void AddTempPlayObject(GameBase.Network.Internal.RoleInfo info)
        {
            TempPlayObject temp = new TempPlayObject();
            PlayerObject play = new PlayerObject();
            temp.play = play;
            temp.key = info.mKey;
            temp.key2 = info.mKey1;
            temp.isRole = info.isRole;
            temp.accountid = info.accountid;
            //基本属性
            m_DicTempPlayObject[play.GetGameID()] = temp;

            if (temp.isRole)
            {
                play.SetName(info.name);
                GameStruct.PlayerAttribute attr = play.GetBaseAttr();
                attr.account_id = info.accountid;
                attr.player_id = info.playerid;
                attr.mana = info.mana;
                attr.lookface = info.lookface;
                attr.hair = info.hair;
                attr.profession = info.profession;
                attr.level = info.lv;
                attr.exp = (int)info.exp;
                attr.life = info.life;
                attr.pk = info.pk;
                attr.gold = info.gold;
                attr.gamegold = info.gamegold;
                attr.stronggold = info.stronggold;
                attr.mapid = (uint)info.mapid;
                attr.guanjue = info.guanjue;
                attr.sAccount = info.sAccount;
                attr.godlevel = (byte)info.godlevel;
                attr.maxeudemon = info.maxeudemon;
                play.SetHotKeyInfo(info.hotkey);
                play.CalcSex();
                play.SetPoint(info.x, info.y);

                //官爵信息
                GameStruct.GUANGJUELEVEL gjlevel = GuanJueManager.Instance().GetLevel(play);
                play.SetGuanJue(gjlevel);
                //初始化军团信息
                play.GetLegionSystem().Init();
            }
        }
Example #5
0
 public void AddSaveRole(PlayerObject play)
 {
     for (int i = 0; i < mListSaveRole.Count; i++)
     {
         if (mListSaveRole[i].GetGameID() == play.GetGameID())
         {
             return;
         }
     }
     mListSaveRole.Add(play);
 }
Example #6
0
        public void ClearThis(PlayerObject play)
        {
            NetMsg.MsgClearObjectInfo info = new NetMsg.MsgClearObjectInfo();
             info.Create(null, play.GetGamePackKeyEx());
             info.id = this.GetTypeId();
             play.SendData(info.GetBuffer());

             this.GetVisibleList().Remove(play.GetGameID());
        }