本文整理汇总了C#中System.ByteBuffer.GetUInt方法的典型用法代码示例。如果您正苦于以下问题:C# ByteBuffer.GetUInt方法的具体用法?C# ByteBuffer.GetUInt怎么用?C# ByteBuffer.GetUInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ByteBuffer
的用法示例。
在下文中一共展示了ByteBuffer.GetUInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
/// <summary>从缓冲区中读取一个FriendLevel结构
/// </summary>
/// <param name="buf">The buf.</param>
public void Read(ByteBuffer buf)
{
QQ = buf.GetUInt();
ActiveDays = buf.GetUInt();
Level = buf.GetUShort();
UpgradeDays = buf.GetUShort();
}
示例2: Read
public void Read(ByteBuffer buf)
{
Id = (uint)buf.Get();
Path = buf.GetUInt();
int len = (int)buf.Get();
Name = Utils.Util.GetString(buf.GetByteArray(len));
}
示例3: Read
/// <summary>
/// 给定一个输入流,解析ReceiveIMHeader结构
/// </summary>
/// <param name="buf">The buf.</param>
public void Read(ByteBuffer buf)
{
// 发送者QQ号或者群内部ID
Sender = buf.GetInt();
// 接收者QQ号
Receiver = buf.GetUInt();
// 包序号,这个序号似乎和我们发的包里面的序号不同,至少这个是int,我们发的是char
// 可能这个序号是服务器端生成的一个总的消息序号
Sequence = buf.GetUInt();
// 发送者IP,如果是服务器转发的,那么ip就是服务器ip
SenderIP = buf.GetByteArray(4);
// 发送者端口,如果是服务器转发的,那么就是服务器的端口 两个字节
SenderPort = buf.GetUShort();
// 消息类型,是好友发的,还是陌生人发的,还是系统消息等等
Type = (RecvSource)buf.GetUShort();
}
示例4: ParseBody
protected override void ParseBody(ByteBuffer buf)
{
buf.Get();
ReplyCode = (ReplyCode)buf.Get();
buf.Get();
Onlines = new List<uint>();
while (buf.HasRemaining())
Onlines.Add(buf.GetUInt());
}
示例5: ParseGetCard
/// <summary>
/// 处理得到单个成员群名片回复包
/// <remark>abu 2008-02-22 </remark>
/// </summary>
/// <param name="buf">The buf.</param>
private void ParseGetCard(ByteBuffer buf)
{
if (ReplyCode == ReplyCode.OK)
{
ClusterId = buf.GetUInt();
MemberQQ = buf.GetUInt();
Card = new Card();
Card.Read(buf);
}
}
示例6: ParseModifyInfoReply
/// <summary>
/// 处理修改群信息的回复包
/// <remark>abu 2008-02-22 </remark>
/// </summary>
/// <param name="buf">The buf.</param>
private void ParseModifyInfoReply(ByteBuffer buf)
{
if (ReplyCode == ReplyCode.OK)
{
ClusterId = buf.GetUInt();
}
}
示例7: ParseExitTempClusterReply
/// <summary>
/// <remark>abu 2008-02-22 </remark>
/// </summary>
/// <param name="buf">The buf.</param>
private void ParseExitTempClusterReply(ByteBuffer buf)
{
if (ReplyCode == ReplyCode.OK)
{
Type = (ClusterType)buf.Get();
ParentClusterId = buf.GetUInt();
ClusterId = buf.GetUInt();
}
}
示例8: Read
/// <summary>
/// 给定一个输入流,解析NormalIMHeader结构
/// </summary>
/// <param name="buf">The buf.</param>
public void Read(ByteBuffer buf)
{
// 发送者的QQ版本
SenderVersion = buf.GetChar();
// 发送者的QQ号
Sender = buf.GetInt();
// 接受者的QQ号
Receiver = buf.GetInt();
// md5处理的发送方的uid和session key,用来在传送文件时加密一些消息
FileSessionKey = buf.GetByteArray(16);
// 普通消息类型,比如是文本消息还是其他什么消息
Type = (NormalIMType)buf.GetUShort();
// 消息序号
Sequence = buf.GetChar();
// 发送时间
SendTime = (long)buf.GetUInt() * 1000L;
// 发送者头像
SenderHeader = buf.GetChar();
}
示例9: ParseBody
protected override void ParseBody(ByteBuffer buf)
{
ReplyCode = (ReplyCode)buf.Get();
switch (ReplyCode)
{
case ReplyCode.OK:
// 001-016字节是session key
SessionKey = buf.GetByteArray(QQGlobal.QQ_LENGTH_KEY);
// 017-020字节是用户QQ号
buf.GetUInt();
// 021-024字节是服务器探测到的用户IP
IP = buf.GetByteArray(4);
// 025-026字节是服务器探测到的用户端口
Port = buf.GetUShort();
// 027-030字节是服务器自己的IP
ServerIP = buf.GetByteArray(4);
// 031-032字节是服务器的端口
ServerPort = buf.GetUShort();
// 033-036字节是本次登陆时间,为什么要乘1000?因为这个时间乘以1000才对,-_-!...
LoginTime = (long)buf.GetUInt() * 1000L;
// 037-038, 未知的2字节
buf.GetUShort();
// 039-062, 认证令牌
AuthToken = buf.GetByteArray(24);
// 063-066字节是一个未知服务器1的ip
// 067-068字节是一个未知服务器1的端口
// 069-072是一个未知服务器2的ip
// 073-074是一个未知服务器2的端口
// 075-076是两个未知字节
// 077-078是两个未知字节
buf.GetByteArray(buf.Position + 16);
// 079-110是client key,这个key用在比如登录QQ家园之类的地方
ClientKey = buf.GetByteArray(32);
// 111-122是12个未知字节
buf.GetByteArray(buf.Position + 12);
// 123-126是上次登陆的ip
LastLoginIP = buf.GetByteArray(4);
// 127-130是上次登陆的时间
LastLoginTime = (long)buf.GetUInt() * 1000L;
// 39个未知字节
// do nothing
break;
case ReplyCode.LOGIN_REDIRECT:
// 登陆重定向,可能是为了负载平衡
// 001-004字节是用户QQ号
buf.GetUInt();
// 005-008字节是重定向到的服务器IP
RedirectIP = buf.GetByteArray(4);
// 009-010字节是重定向到的服务器的端口
RedirectPort = buf.GetUShort();
break;
case ReplyCode.LOGIN_FAIL:
// 登录失败,我们得到服务器发回来的消息
byte[] b = buf.ToByteArray();
ReplyMessage = Utils.Util.GetString(b, 1, b.Length - 1);
break;
}
}
示例10: ReadTemp
public void ReadTemp(ByteBuffer buf)
{
QQ = buf.GetUInt();
Organization = buf.Get();
Role = 0;
}
示例11: Read
/// <summary>
/// 给定一个输入流,解析QQFriend结构
/// </summary>
/// <param name="buf">The buf.</param>
public void Read(ByteBuffer buf)
{
//// 000-003: 好友QQ号
//QQ = buf.GetInt();
// 004-005: 头像
Header = buf.GetUShort();
// 006: 年龄
Age = buf.Get();
// 007: 性别
Gender = (Gender)buf.Get();
// 008: 昵称长度
int len = (int)buf.Get();
byte[] b = buf.GetByteArray(len);
Nick = Util.GetString(b);
// 用户属性
UserFlag = buf.GetUInt();
buf.Position += 23;
}
示例12: ParseBody
//.........这里部分代码省略.........
case ClusterCommand.CREATE_CLUSTER:
ParseCreateReply(buf);
break;
case ClusterCommand.CREATE_TEMP:
ParseCreateTempCluster(buf);
break;
case ClusterCommand.ACTIVATE_CLUSTER:
ParseActivateReply(buf);
break;
case ClusterCommand.MODIFY_MEMBER:
ParseModifyMemberReply(buf);
break;
case ClusterCommand.GET_CLUSTER_INFO:
ParseGetInfoReply(buf);
break;
case ClusterCommand.EXIT_CLUSTER:
ParseExitReply(buf);
break;
case ClusterCommand.GET_MEMBER_INFO:
ParseGetMemberInfoReply(buf);
break;
case ClusterCommand.GET_ONLINE_MEMBER:
ParseGetOnlineMemberReply(buf);
break;
case ClusterCommand.JOIN_CLUSTER:
ParseJoinReply(buf);
break;
case ClusterCommand.JOIN_CLUSTER_AUTH:
ParseJoinAuthReply(buf);
break;
case ClusterCommand.MODIFY_CLUSTER_INFO:
ParseModifyInfoReply(buf);
break;
case ClusterCommand.SEARCH_CLUSTER:
ParseSearchReply(buf);
break;
case ClusterCommand.GET_TEMP_INFO:
ParseGetTempClusterInfoReply(buf);
break;
case ClusterCommand.EXIT_TEMP:
ParseExitTempClusterReply(buf);
break;
case ClusterCommand.ACTIVATE_TEMP:
ParseActivateTempCluster(buf);
break;
case ClusterCommand.SUB_CLUSTER_OP:
ParseSubClusterOp(buf);
break;
case ClusterCommand.UPDATE_ORGANIZATION:
ParseUpdateOrganization(buf);
break;
case ClusterCommand.COMMIT_ORGANIZATION:
ParseCommitOrganization(buf);
break;
case ClusterCommand.COMMIT_MEMBER_ORGANIZATION:
ParseCommitMemberOrganization(buf);
break;
case ClusterCommand.MODIFY_TEMP_INFO:
ParseModifyTempClusterInfo(buf);
break;
case ClusterCommand.MODIFY_CARD:
ParseModifyCard(buf);
break;
case ClusterCommand.GET_CARD_BATCH:
ParseGetCardBatch(buf);
break;
case ClusterCommand.GET_CARD:
ParseGetCard(buf);
break;
case ClusterCommand.SET_ROLE:
ParseSetRole(buf);
break;
case ClusterCommand.TRANSFER_ROLE:
ParseTransferRole(buf);
break;
case ClusterCommand.DISMISS_CLUSTER:
ParseDismissCluster(buf);
break;
}
// 如果操作失败
if (ReplyCode != ReplyCode.OK)
{
switch (SubCommand)
{
case ClusterCommand.TRANSFER_ROLE:
ClusterId = buf.GetUInt();
MemberQQ = buf.GetUInt();
ErrorMessage = Util.GetString(buf);
break;
case ClusterCommand.SET_ROLE:
ClusterId = buf.GetUInt();
ErrorMessage = Util.GetString(buf);
break;
default:
/* 操作失败 */
ErrorMessage = Util.GetString(buf);
break;
}
}
}
示例13: ParseActivateTempCluster
/// <summary>
/// 处理激活临时群回复包
/// <remark>abu 2008-02-22 </remark>
/// </summary>
/// <param name="buf">The buf.</param>
private void ParseActivateTempCluster(ByteBuffer buf)
{
if (ReplyCode == ReplyCode.OK)
{
// 临时群类型
Type = (ClusterType)buf.Get();
// 父群内部ID
ParentClusterId = buf.GetUInt();
// 临时群内部ID
ClusterId = buf.GetUInt();
// 成员信息
Members = new List<Member>();
while (buf.HasRemaining())
{
Member member = new Member();
member.QQ = buf.GetUInt();
Members.Add(member);
}
}
}
示例14: ParseTransferRole
/// <summary>
/// 处理转让角色的回复包
/// <remark>abu 2008-02-22 </remark>
/// </summary>
/// <param name="buf">The buf.</param>
private void ParseTransferRole(ByteBuffer buf)
{
if (ReplyCode == ReplyCode.OK)
{
ClusterId = buf.GetUInt();
MemberQQ = buf.GetUInt();
VersionId = buf.GetUInt();
}
}
示例15: ParseUpdateOrganization
/// <summary>
/// 解析更新组织架构回复包
/// <remark>abu 2008-02-22 </remark>
/// </summary>
/// <param name="buf">The buf.</param>
private void ParseUpdateOrganization(ByteBuffer buf)
{
if (ReplyCode == ReplyCode.OK)
{
Organizations = new List<QQOrganization>();
ClusterId = buf.GetUInt();
buf.Get();
OrganizationVersionId = buf.GetUInt();
if (OrganizationVersionId != 0)
{
OrganizationCount = (uint)buf.Get();
while (buf.HasRemaining())
{
QQOrganization org = new QQOrganization();
org.Read(buf);
Organizations.Add(org);
}
}
}
}