本文整理汇总了C#中MUd.UruStream.WriteInt方法的典型用法代码示例。如果您正苦于以下问题:C# UruStream.WriteInt方法的具体用法?C# UruStream.WriteInt怎么用?C# UruStream.WriteInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MUd.UruStream
的用法示例。
在下文中一共展示了UruStream.WriteInt方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Connect
public override bool Connect()
{
if (!base.Connect()) return false;
//Send the GateConnectHeader
UruStream s = new UruStream(new NetworkStream(fSocket, false));
s.BufferWriter();
fHeader.Write(s);
s.WriteInt(20);
s.WriteBytes(Guid.Empty.ToByteArray());
s.FlushWriter();
s.Close();
//Init encryption
if (!base.NetCliConnect(4))
return false;
fSocket.BeginReceive(new byte[2], 0, 2, SocketFlags.Peek, new AsyncCallback(IReceive), null);
return true;
}
示例2: Ping
public void Ping(int time)
{
File_PingPong ping = new File_PingPong();
ping.fPingTime = time;
ResetIdleTimer();
lock (fSocket) {
MemoryStream ms = new MemoryStream();
UruStream s = new UruStream(ms);
s.WriteUInt(12);
s.WriteInt((int)FileCli2Srv.PingRequest);
ping.Write(s);
fSocket.Send(ms.ToArray());
s.Close();
ms.Close();
}
}
示例3: Write
public void Write(UruStream s)
{
s.WriteUInt(fTransID);
s.WriteInt((int)fResult);
s.WriteInt(fRefs.Length);
foreach (VaultNodeRef r in fRefs)
r.Write(s);
}
示例4: Write
public void Write(UruStream s)
{
s.WriteUInt(fTransID);
s.WriteInt((int)fResult);
s.WriteUInt(fFileSize);
s.WriteUInt(fChunkPos);
if (fChunkData == null) fChunkData = new byte[0];
s.WriteInt(fChunkData.Length);
s.WriteBytes(fChunkData);
}
示例5: Write
public void Write(UruStream s)
{
s.WriteUInt(fTransID);
s.WriteInt((int)fResult);
}
示例6: Write
public void Write(UruStream s)
{
if (fData == null) fData = new byte[0];
s.WriteUInt(fTransID);
s.WriteUInt((uint)fResult);
s.WriteUInt(fReaderID);
s.WriteUInt(fFileSize);
s.WriteInt(fData.Length);
s.WriteBytes(fData);
}
示例7: Connect
public override bool Connect()
{
if (!base.Connect()) return false;
//Send the AuthConnectHeader
UruStream s = new UruStream(new NetworkStream(fSocket, false));
s.BufferWriter();
fHeader.Write(s);
s.WriteInt(20);
s.WriteBytes(Guid.Empty.ToByteArray());
s.FlushWriter();
s.Close();
//Init encryption
if(!base.NetCliConnect(41))
return false;
//Register the client...
//Don't require the user to do this.
Auth_RegisterRequest req = new Auth_RegisterRequest();
req.fBuildID = fHeader.fBuildID;
fStream.BufferWriter();
fStream.WriteUShort((ushort)AuthCli2Srv.ClientRegisterRequest);
req.Write(fStream);
fStream.FlushWriter();
fSocket.BeginReceive(new byte[2], 0, 2, SocketFlags.Peek, new AsyncCallback(IReceive), null);
fChgHack.Reset(); fChgHack.WaitOne();
return true;
}
示例8: Write
public void Write(UruStream s)
{
s.WriteBytes(fInstanceUuid.ToByteArray());
s.WriteUnicodeStringF(fFilename, 64);
s.WriteUnicodeStringF(fInstanceName, 64);
s.WriteUnicodeStringF(fUserName, 64);
s.WriteUnicodeStringF(fDescription, 1024);
s.WriteUInt(fSequenceNumber);
s.WriteInt(fLanguage);
s.WriteUInt(fPopulation);
s.WriteUInt(fCurrPopulation);
}
示例9: RequestBuildID
public uint RequestBuildID()
{
File_BuildIdRequest req = new File_BuildIdRequest();
req.fTransID = IGetTransID();
ResetIdleTimer();
lock (fSocket) {
MemoryStream ms = new MemoryStream();
UruStream s = new UruStream(ms);
s.WriteUInt(12);
s.WriteInt((int)FileCli2Srv.BuildIdRequest);
req.Write(s);
fSocket.Send(ms.ToArray());
s.Close();
ms.Close();
}
return req.fTransID;
}
示例10: ToArray
public byte[] ToArray()
{
MemoryStream ms = new MemoryStream();
UruStream s = new UruStream(ms);
ulong bit = 1;
Fields f = NodeFields;
s.WriteULong((ulong)f);
while (bit != 0 && bit <= (ulong)f) {
switch ((f & (Fields)bit)) {
case Fields.kBlob_1:
s.WriteInt(fBlob[0].Length);
s.WriteBytes(fBlob[0]);
break;
case Fields.kBlob_2:
s.WriteInt(fBlob[1].Length);
s.WriteBytes(fBlob[1]);
break;
case Fields.kCreateAgeName:
s.WriteUnicodeStringV32(fCreateAgeName);
break;
case Fields.kCreateAgeUuid:
s.WriteBytes(fCreateAgeUuid.ToByteArray());
break;
case Fields.kCreateTime:
s.WriteUInt(ToUnixTime(fCreateTime));
break;
case Fields.kCreatorIdx:
s.WriteUInt(fCreatorIdx.Value);
break;
case Fields.kCreatorUuid:
s.WriteBytes(fCreatorUuid.ToByteArray());
break;
case Fields.kInt32_1:
s.WriteInt(fInt32[0].Value);
break;
case Fields.kInt32_2:
s.WriteInt(fInt32[1].Value);
break;
case Fields.kInt32_3:
s.WriteInt(fInt32[2].Value);
break;
case Fields.kInt32_4:
s.WriteInt(fInt32[3].Value);
break;
case Fields.kIString64_1:
s.WriteUnicodeStringV32(fIString64[0]);
break;
case Fields.kIString64_2:
s.WriteUnicodeStringV32(fIString64[1]);
break;
case Fields.kModifyTime:
s.WriteUInt(ToUnixTime(fModifyTime));
break;
case Fields.kNodeIdx:
s.WriteUInt(fIdx);
break;
case Fields.kNodeType:
s.WriteUInt((uint)fNodeType);
break;
case Fields.kString64_1:
s.WriteUnicodeStringV32(fString64[0]);
break;
case Fields.kString64_2:
s.WriteUnicodeStringV32(fString64[1]);
break;
case Fields.kString64_3:
s.WriteUnicodeStringV32(fString64[2]);
break;
case Fields.kString64_4:
s.WriteUnicodeStringV32(fString64[3]);
break;
case Fields.kString64_5:
s.WriteUnicodeStringV32(fString64[4]);
break;
case Fields.kString64_6:
s.WriteUnicodeStringV32(fString64[5]);
break;
case Fields.kText_1:
s.WriteUnicodeStringV32(fText[0]);
break;
case Fields.kText_2:
s.WriteUnicodeStringV32(fText[1]);
break;
case Fields.kUInt32_1:
s.WriteUInt(fUInt32[0].Value);
break;
case Fields.kUInt32_2:
s.WriteUInt(fUInt32[1].Value);
break;
case Fields.kUInt32_3:
s.WriteUInt(fUInt32[2].Value);
break;
case Fields.kUInt32_4:
s.WriteUInt(fUInt32[3].Value);
break;
case Fields.kUuid_1:
s.WriteBytes(fUuid[0].ToByteArray());
break;
case Fields.kUuid_2:
//.........这里部分代码省略.........