Exemplo n.º 1
0
        private void RecvRoleInfo(byte[] data)
        {
            CTdirUserRoleInfo cTdirUserRoleInfo = new CTdirUserRoleInfo();

            cTdirUserRoleInfo.appBuff = new byte[256];
            cTdirUserRoleInfo.Decode(data);
            TdirUserRoleInfo tdirUserRoleInfo = default(TdirUserRoleInfo);

            tdirUserRoleInfo.zoneID        = cTdirUserRoleInfo.zoneID;
            tdirUserRoleInfo.roleID        = cTdirUserRoleInfo.roleID;
            tdirUserRoleInfo.lastLoginTime = cTdirUserRoleInfo.lastLoginTime;
            tdirUserRoleInfo.roleName      = cTdirUserRoleInfo.roleName;
            tdirUserRoleInfo.roleLevel     = cTdirUserRoleInfo.roleLevel;
            tdirUserRoleInfo.appLen        = cTdirUserRoleInfo.appLen;
            if (0u < cTdirUserRoleInfo.appLen)
            {
                tdirUserRoleInfo.appBuff = new byte[tdirUserRoleInfo.appLen];
                int num = 0;
                while ((long)num < (long)((ulong)cTdirUserRoleInfo.appLen))
                {
                    tdirUserRoleInfo.appBuff[num] = cTdirUserRoleInfo.appBuff[num];
                    num++;
                }
            }
            if (this.m_treeRoleInfoDic.ContainsKey(tdirUserRoleInfo.zoneID))
            {
                this.m_treeRoleInfoDic[tdirUserRoleInfo.zoneID].Add(tdirUserRoleInfo);
            }
            else
            {
                List <TdirUserRoleInfo> list = new List <TdirUserRoleInfo>();
                list.Add(tdirUserRoleInfo);
                this.m_treeRoleInfoDic.Add(tdirUserRoleInfo.zoneID, list);
            }
        }
Exemplo n.º 2
0
        private void RecvRoleInfo(byte[] data)
        {
            CTdirUserRoleInfo info = new CTdirUserRoleInfo {
                appBuff = new byte[0x100]
            };

            info.Decode(data);
            TdirUserRoleInfo item = new TdirUserRoleInfo {
                zoneID        = info.zoneID,
                roleID        = info.roleID,
                lastLoginTime = info.lastLoginTime,
                roleName      = info.roleName,
                roleLevel     = info.roleLevel,
                appLen        = info.appLen
            };

            if (0 < info.appLen)
            {
                item.appBuff = new byte[item.appLen];
                for (int i = 0; i < info.appLen; i++)
                {
                    item.appBuff[i] = info.appBuff[i];
                }
            }
            if (this.m_treeRoleInfoDic.ContainsKey(item.zoneID))
            {
                this.m_treeRoleInfoDic[item.zoneID].Add(item);
            }
            else
            {
                List <TdirUserRoleInfo> list = new List <TdirUserRoleInfo> {
                    item
                };
                this.m_treeRoleInfoDic.Add(item.zoneID, list);
            }
        }