MapServer.PlayerObject.SetHotKeyInfo C# (CSharp) Method

SetHotKeyInfo() public method

public SetHotKeyInfo ( String text ) : void
text String
return void
        public void SetHotKeyInfo(String text)
        {
            if (text.Length > 0)
            {
                String[] str = text.Split(',');
                for (int i = 0; i < str.Length; i++)
                {
                    String[] t = str[i].Split('|');
                    if (t.Length == 7)
                    {
                        byte group = Convert.ToByte(t[0]);
                        String data = "";
                        //前面的分隔符是组标识--需要去掉
                        data = str[i].Substring(str[i].IndexOf('|') + 1);
                        GameStruct.HotkeyInfo info = new GameStruct.HotkeyInfo(group, data);
                        AddHotKeyInfo(info);

                    }
                }

            }
        }

Usage Example

Example #1
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();
            }
        }