本文整理汇总了C#中System.ByteBuffer.Put方法的典型用法代码示例。如果您正苦于以下问题:C# ByteBuffer.Put方法的具体用法?C# ByteBuffer.Put怎么用?C# ByteBuffer.Put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ByteBuffer
的用法示例。
在下文中一共展示了ByteBuffer.Put方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PutBody
protected override void PutBody(ByteBuffer buf)
{
buf.Put((byte)SubCommand);
buf.PutInt(ClusterId);
buf.Put((byte)0);
buf.PutInt(0);
}
示例2: PutBody
protected override void PutBody(ByteBuffer buf)
{
// 初始密钥
buf.PutChar((char)user.QQKey.LoginInfo_Magic_Token.Length);
buf.Put(user.QQKey.LoginInfo_Magic_Token);
ByteBuffer DecodedBuf = new ByteBuffer();
DecodedBuf.PutChar((char)0x010D);
DecodedBuf.Put(0x00);
DecodedBuf.Put(new byte[] { 0x01, 0x01 });
DecodedBuf.Put(VersionData.QQ09_LOCALE);
DecodedBuf.Put(VersionData.QQ09_VERSION_SPEC);
DecodedBuf.PutChar((char)Client.QQUser.QQKey.Answer_Token.Length);
DecodedBuf.Put(Client.QQUser.QQKey.Answer_Token);
DecodedBuf.PutChar((char)Client.QQUser.QQKey.LoginInfo_Token.Length);
DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_Token);
DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_UnknowData);
DecodedBuf.Put(Client.ServerTime);
DecodedBuf.PutChar((char)Client.QQUser.QQKey.LoginInfo_Data_Token.Length);
DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_Data_Token);
DecodedBuf.PutChar((char)0x0000);
DecodedBuf.PutInt(0x00000000);
//Client.QQUser.QQKey.Key = Client.QQUser.QQKey.LoginInfo_Key1;//可能要用到
byte[] EncodedBuf = crypter.Encrypt(DecodedBuf.ToByteArray(), user.QQKey.LoginInfo_Key1);
buf.Put(EncodedBuf);
#if DEBUG
Client.LogManager.Log(ToString() + " key:" + Utils.Util.ToHex(user.QQKey.InitKey));
Client.LogManager.Log(ToString() + " UnBody: " + Utils.Util.ToHex(DecodedBuf.ToByteArray()));
#endif
}
示例3: PutBody
protected override void PutBody(ByteBuffer buf)
{
// 初始密钥
//buf.Put(user.QQKey.InitKey);
buf.PutChar((char)user.QQKey.LoginInfo_Magic_Token.Length);
buf.Put(user.QQKey.LoginInfo_Magic_Token);
ByteBuffer DecodedBuf = new ByteBuffer();
DecodedBuf.PutChar((char)0x0101);
DecodedBuf.PutChar((char)0x0000);
DecodedBuf.Put((byte)Client.QQUser.QQKey.LoginInfo_Token.Length);
DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_Token);
DecodedBuf.Put(new byte[]{0x10,0x03,0xC8,0xEC,0xC8,0x96,
0x8B,0xF2,0xB3,0x6B,0x4D,0x0C,0x5C,0xE0,0x6A,0x51,0xCE});//unknown data
//Client.QQUser.QQKey.Key = Client.QQUser.QQKey.LoginInfo_Key1;//可能要用到
byte[] EncodedBuf = crypter.Encrypt(DecodedBuf.ToByteArray(), user.QQKey.LoginInfo_Key1);
#if DEBUG
Client.LogManager.Log(ToString() + " key:" + Utils.Util.ToHex(user.QQKey.LoginInfo_Key1));
Client.LogManager.Log(ToString() + " UnBody:" + Utils.Util.ToHex(DecodedBuf.ToByteArray()));
#endif
buf.Put(EncodedBuf);
#if DEBUG
Client.LogManager.Log(ToString() + " EnBody:" + Utils.Util.ToHex(buf.ToByteArray()));
#endif
}
示例4: PutBody
protected override void PutBody(ByteBuffer buf)
{
buf.Put((byte)SubCommand);
buf.PutInt(ClusterId);
buf.Put(Operation);
foreach (int i in Members)
buf.PutInt(i);
}
示例5: PutBody
protected override void PutBody(ByteBuffer buf)
{
buf.Put(0x88);
buf.PutInt(Client.QQUser.QQ);
buf.Put(0x00);
#if DEBUG
Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
#endif
}
示例6: PutBody
/// <summary>
/// 初始化包体
/// </summary>
/// <param name="buf">The buf.</param>
protected override void PutBody(ByteBuffer buf)
{
buf.Put((byte)0x1F);
buf.Put((byte)0x01);
buf.PutInt(BeginFrom);
#if DEBUG
Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
#endif
}
示例7: GetBytes
/// <summary>
/// 将serverInfo转成byte[]
/// </summary>
/// <returns></returns>
public byte[] GetBytes()
{
ByteBuffer buf = new ByteBuffer();
buf.Put(CSP_wRedirectCount);
buf.Put(CSP_cRedirectCount);
buf.Put(CSP_dwConnIspID);
buf.Put(CSP_dwServerReserve);
buf.Put(CSP_dwConnIP);
return buf.ToByteArray();
}
示例8: PutBody
protected override void PutBody(ByteBuffer buf)
{
// 命令类型
buf.Put((byte)SubCommand);
// 类型
buf.Put((byte)Type);
// 内部ID
buf.PutInt(ParentClusterId);
// 外部ID
buf.PutInt(ClusterId);
}
示例9: PutBody
protected override void PutBody(ByteBuffer buf)
{
buf.Put(0x01);
buf.PutInt(0);
buf.PutInt(0);
buf.Put(0x02);
buf.PutUShort(StartPosition);
buf.Put(0);
#if DEBUG
Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
#endif
}
示例10: PutBody
protected override void PutBody(ByteBuffer buf)
{
// 命令类型
buf.Put((byte)SubCommand);
// 群类型
buf.Put((byte)SearchType);
// 内部ID
if (SearchType == ClusterSearchType.Demo)
buf.PutInt(0);
else
buf.PutInt(ExternalId);
}
示例11: Read
/// <summary>
/// </summary>
/// <param name="buf">The buf.</param>
public void Read(ByteBuffer buf)
{
ByteBuffer temp = new ByteBuffer();
int i = 0;
while (true)
{
byte b = buf.Get();
if (b != 0x1F)
{
if (b != 0x1E)
{
temp.Put(b);
}
else
{
if (i == 0)
{
QQ = Utils.Util.GetInt(Utils.Util.GetString(temp.ToByteArray()), 0000);
}
else if (i == 1)
Nick = Utils.Util.GetString(temp.ToByteArray());
else if (i == 2)
Province = Utils.Util.GetString(temp.ToByteArray());
i++;
temp.Initialize();
}
}
else
{
Face = Utils.Util.GetInt(Utils.Util.GetString(temp.ToByteArray()), 0);
break;
}
}
}
示例12: PutBody
protected override void PutBody(ByteBuffer buf)
{
buf.PutChar((char)Client.QQUser.QQKey.LoginInfo_Magic_Token.Length);
buf.Put(user.QQKey.LoginInfo_Magic_Token);
ByteBuffer DecodedBuf = new ByteBuffer();
DecodedBuf.PutChar((char)0x011A);
DecodedBuf.PutChar((char)0x0001);
DecodedBuf.Put(VersionData.QQ09_LOCALE);
DecodedBuf.Put(VersionData.QQ09_VERSION_SPEC);
DecodedBuf.Put((byte)0x00);
DecodedBuf.Put((byte)Client.QQUser.QQKey.Answer_Token.Length);
DecodedBuf.Put(Client.QQUser.QQKey.Answer_Token);
DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_UnknowData2);
DecodedBuf.Put(Client.ServerTime);
DecodedBuf.Put(Client.ClientIP);
DecodedBuf.Position += 4;//00 00 00 00
DecodedBuf.PutChar((char)Client.QQUser.QQKey.LoginInfo_Large_Token.Length);
DecodedBuf.Put(Client.QQUser.QQKey.LoginInfo_Large_Token);
DecodedBuf.PutUShort(this.Pos);
DecodedBuf.Position += 2;// 00 00
DecodedBuf.PutChar((char)0x0071);
DecodedBuf.Position += 0x0070;//0x0071 zeros
DecodedBuf.Put(0x00);
byte[] EncodedBuf = crypter.Encrypt(DecodedBuf.ToByteArray(), user.QQKey.LoginInfo_Key1);
#if DEBUG
Client.LogManager.Log(ToString() + " QQKey.LoginInfo_Key1:" + Utils.Util.ToHex(user.QQKey.LoginInfo_Key1));
Client.LogManager.Log(ToString() + " pos:"+this.Pos+" UnBody:" + Utils.Util.ToHex(DecodedBuf.ToByteArray()));
#endif
buf.Put(EncodedBuf);
#if DEBUG
Client.LogManager.Log(ToString() + " EnBody:" + Utils.Util.ToHex(buf.ToByteArray()));
#endif
}
示例13: PutBody
protected override void PutBody(ByteBuffer buf)
{
buf.Put(Reply);
#if DEBUG
Client.LogManager.Log(ToString() + " " + Utils.Util.ToHex(buf.ToByteArray()));
#endif
}
示例14: PutBody
protected override void PutBody(ByteBuffer buf)
{
// 命令类型
buf.Put((byte)SubCommand);
// 子命令
buf.Put((byte)OpByte);
switch (OpByte)
{
case ClusterSubCmd.GET_SUBJECT_LIST:
buf.PutInt(ClusterId);
break;
case ClusterSubCmd.GET_DIALOG_LIST:
buf.PutInt(0);
break;
}
}
示例15: relPut
private static void relPut(ByteBuffer b)
{
int n = b.Capacity;
b.Clear();
for (int i = 0; i < n; i++)
b.Put((byte)Ic(i));
b.Flip();
}