本文整理匯總了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);
}
}
}
}