MapServer.PlayerObject.ChatNotice C# (CSharp) Method

ChatNotice() public method

public ChatNotice ( String text ) : void
text String
return void
        public void ChatNotice(String text)
        {
            NetMsg.MsgNotice notice = new NetMsg.MsgNotice();
            notice.Create(null, GetGamePackKeyEx());
            byte[] buff = notice.GetChatNoticeBuff(text);
            this.SendData(buff);
        }

Usage Example

Example #1
0
        private void Action_Eudemon_Create(ActionInfo info, PlayerObject play)
        {
            String[] split = info.param.Split(' ');
            if (split.Length < 1)
            {
                Log.Instance().WriteLog("Action_Eudemon_Create 参数错误" + info.param + "id" + info.id.ToString());
                return;
            }
            uint itemid = Convert.ToUInt32(split[0]);

            int count = 1;
            if (split.Length >= 2)
            {
                count = Convert.ToInt32(split[1]);
            }

            //幻兽背包已满
            if (play.GetItemSystem().GetEudemonCount()+ count > PlayerEudemon.MAX_EUDEMON_COUNT)
            {
                play.ChatNotice("幻兽背包已满!!");
                return;

            }

            GameStruct.ItemTypeInfo baseitem = ConfigManager.Instance().GetItemTypeInfo(itemid);
            if (baseitem == null)
            {
                Log.Instance().WriteLog("创建幻兽出错,找不到该幻兽id" + itemid.ToString());
                return;
            }
            for (int i = 0; i < count; i++)
            {
                play.GetItemSystem().AwardItem(itemid, NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK);
            }
            //   GameStruct.RoleItemInfo iteminfo = null;
            //if (itemid == 0)
            //{
            //    iteminfo  = play.GetItemSystem().FindItem(play.GetItemSystem().GetScriptItemId());
            //    if (iteminfo == null) return;
            //}
            //else //没有道具的情况下增加幻兽,要先增加道具--
            //{

            //}

            // iteminfo.postion = NetMsg.MsgItemInfo.ITEMPOSITION_EUDEMON_PACK;
            // play.GetItemSystem().UpdateItemInfo(iteminfo.id);

            //增加幻兽
            //  play.GetEudemonSystem().AddEudemon(iteminfo);
        }
All Usage Examples Of MapServer.PlayerObject::ChatNotice