示例#1
0
文件: RoleChar.cs 项目: profiles/Fish
    bool HandleAddCharInfo(NetCmdBase obj)
    {
        LC_Cmd_SendCharInfo ncb = (LC_Cmd_SendCharInfo)obj;

        if (m_CharList.ContainsKey(ncb.MessageInfo.SrcUserID))
        {
            m_CharList[ncb.MessageInfo.SrcUserID] = ncb.MessageInfo;
        }
        else
        {
            tagRoleCharInfo pInfo = new tagRoleCharInfo();
            pInfo.DestUserID  = ncb.MessageInfo.DestUserID;
            pInfo.LogTime     = ncb.MessageInfo.LogTime;
            pInfo.MessageInfo = ncb.MessageInfo.MessageInfo;
            pInfo.SrcUserID   = ncb.MessageInfo.SrcUserID;
            m_CharList.Add(ncb.MessageInfo.SrcUserID, pInfo);
        }
        if (m_CharArrayList.ContainsKey(ncb.MessageInfo.SrcUserID))
        {
            m_CharArrayList[ncb.MessageInfo.SrcUserID].Array.Add(ncb.MessageInfo);
        }
        else
        {
            tagRoleCharArray pInfo = new tagRoleCharArray();
            pInfo.SrcUserID = ncb.MessageInfo.SrcUserID;
            pInfo.Array.Add(ncb.MessageInfo);
            m_CharArrayList.Add(ncb.MessageInfo.SrcUserID, pInfo);
        }

        //产生事件
        tagCharAddCharEvent pEvent = new tagCharAddCharEvent(ncb.MessageInfo);

        MsgEventHandle.HandleMsg(pEvent);
        return(true);
    }
示例#2
0
 public bool AddNewMsg(tagRoleCharInfo pChat)
 {
     if (m_BaseWndObject == null || m_BaseWndObject.activeSelf != true)
     {
         return(false);
     }
     if (pChat.SrcUserID != m_UserID)
     {
         return(false);
     }
     AddMsg(pChat);
     SaveChatLogInfo();
     InitScrollView();
     PlayerRole.Instance.RoleChar.ClearCharInfo(m_UserID);
     //    Debug.Log("AddNews");
     return(true);
 }
示例#3
0
    void AddMsg(tagRoleCharInfo pChat)
    {
        ChatInfo item = new ChatInfo();

        item.m_ChatStr = pChat.MessageInfo;
        item.m_UserID  = pChat.SrcUserID;
        System.DateTime dataTime = SystemTime.Instance.GetDateTimeByTotalSec(pChat.LogTime);
        string          strTime  = dataTime.Year.ToString() + "/" + dataTime.Month.ToString("D2") + "/" + dataTime.Day.ToString("D2") + "  " +
                                   dataTime.Hour.ToString("D2") + ":" + dataTime.Minute.ToString("D2");

        item.m_DataTime = strTime;
        item.m_IsMySelf = 0;
        //聊天记录达上限
        if (m_ChatLogList.Count > ConstValue.MAX_CHATLOG_NUM)
        {
            m_ChatLogList.RemoveAt(0);
        }
        m_ChatLogList.Add(item);
    }
示例#4
0
 public tagCharAddCharEvent(tagRoleCharInfo pInfo)
     : base(MsgEventType.MET_Char_AddChar)
 {
     this.pInfo = pInfo;
 }