Example #1
0
 public void initUI(GuildMsg msg)
 {
     this.msg = msg;
     content  = msg.content;
     string[] strs = content.Split(' ');
     showLabel.text = "[FFB84D]" + strs[0] + " [FFB84D]" + strs[1] + " [FFFFFF]" + strs[2];
 }
    public GameObject createView(object o, GameObject view)
    {
        GuildMsg     msg  = o as GuildMsg;
        GameObject   obj  = NGUITools.AddChild(gameObject, msgItem);
        GuildMsgItem item = obj.GetComponent <GuildMsgItem> ();

        item.initUI(msg);
        return(obj);
    }
    private void updateMsg(GuildMsg msg)
    {
        if (textList == null || multiTextList == null)
        {
            return;
        }
        string content = msg.content;

        string[] strs = content.Split(' ');
        string   str  = "[FFB84D]" + strs [0] + "_" + strs [1] + " " + "[FFFFFF]" + strs [2];

        textList.Add(str);
        multiTextList.Add(str);
    }
    //解析ErlKVMessgae
    public void parseKVMsg(ErlKVMessage message)
    {
        ErlType type = message.getValue("msg") as ErlType;

        if (type is ErlArray)
        {
            ErlArray        array           = type as ErlArray;
            int             index           = 0;
            string          uid             = array.Value [index++].getValueString();
            string          name            = array.Value [index++].getValueString();
            int             level           = StringKit.toInt(array.Value [index++].getValueString());
            int             membership      = StringKit.toInt(array.Value [index++].getValueString());
            int             membershipMax   = StringKit.toInt(array.Value [index++].getValueString());
            int             livenessing     = StringKit.toInt(array.Value [index++].getValueString());
            int             livenessed      = StringKit.toInt(array.Value [index++].getValueString());
            string          declaration     = array.Value [index++].getValueString();
            string          notice          = array.Value [index++].getValueString();
            string          presidentName   = array.Value [index++].getValueString();
            int             job             = StringKit.toInt(array.Value [index++].getValueString());
            int             contributioning = StringKit.toInt(array.Value [index++].getValueString());
            int             contributioned  = StringKit.toInt(array.Value [index++].getValueString());
            ErlArray        msgArray        = array.Value [index++] as ErlArray;
            List <GuildMsg> list            = new List <GuildMsg> ();
            for (int i = 0; i < msgArray.Value.Length; i++)
            {
                GuildMsg msg = new GuildMsg(msgArray.Value [i].getValueString());
                list.Add(msg);
            }
            int  todayDonateTimes = StringKit.toInt(array.Value [index++].getValueString());
            int  rename           = StringKit.toInt(array.Value[index++].getValueString());
            bool isCanRename      = false;
            if (rename == 1)
            {
                isCanRename = true;
            }
            int autoJoin       = StringKit.toInt(array.Value[index++].getValueString());
            int joinTime       = StringKit.toInt(array.Value[index++].getValueString());
            int haveFirstAward = StringKit.toInt(array.Value[index++].getValueString());
            if (index < array.Value.Length)
            {
                GuildManagerment.Instance.selfScore = StringKit.toInt(array.Value[index++].getValueString());
            }
            GuildManagerment.Instance.createGuild(uid, name, level, membership, membershipMax, livenessing, livenessed, declaration, notice, presidentName, job, contributioning, contributioned, list, todayDonateTimes, isCanRename, autoJoin, joinTime, haveFirstAward);
        }
        else
        {
            GuildManagerment.Instance.setGuild(null);
        }
    }
Example #5
0
    public void createMsg(string content)
    {
        if (guild == null)
        {
            return;
        }
        GuildMsg msg = new GuildMsg(content);

        if (guild.msgs.Count <= MSGMAXCOUNT)
        {
            guild.msgs.Add(msg);
        }
        else
        {
            guild.msgs.RemoveAt(0);
            guild.msgs.Add(msg);
        }

        if (updateMsg != null)
        {
            updateMsg(msg);
        }
    }