示例#1
0
    private void receiveStatus(byte[] data)
    {
        ObjectPacker unpack = new ObjectPacker();

        Data.StatusInfo info = unpack.Unpack <Data.StatusInfo>(data);
        updateMember(info);
    }
示例#2
0
 private void sendStatus(int status, Action <bool> cb = null)
 {
     Data.StatusInfo info = new Data.StatusInfo();
     info.UserId   = userId;
     info.UserName = windowEntryName.userName;
     info.Status   = status;
     byte[] result = makeData(2, info);
     sock.Send(result, cb);
 }
示例#3
0
    private void updateMember(Data.StatusInfo info)
    {
        // not regist myself
        if (info.UserId == userId)
        {
            return;
        }

        if (info.Status < 1 && mapMember.ContainsKey(info.UserId))
        {
            Debug.Log("remove!!" + info.UserId.ToString() + " : " + info.UserName);
            mapMember.Remove(info.UserId);
        }
        else
        {
            Debug.Log("regist!!" + info.UserId.ToString() + " : " + info.UserName);
            mapMember[info.UserId] = info.UserName;
        }
        windowChat.UpdateMemberList(mapMember);
    }