本文整理汇总了C#中MUd.UruStream类的典型用法代码示例。如果您正苦于以下问题:C# UruStream类的具体用法?C# UruStream怎么用?C# UruStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UruStream类属于MUd命名空间,在下文中一共展示了UruStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public void Write(UruStream s)
{
s.WriteUInt(fTransID);
s.WriteUInt(fAgeMcpID);
s.WriteBytes(fAcctUuid.ToByteArray());
s.WriteUInt(fPlayerID);
}
示例2: Read
public void Read(UruStream s)
{
fTransID = s.ReadUInt();
fAgeMcpID = s.ReadUInt();
fAcctUuid = new Guid(s.ReadBytes(16));
fPlayerID = s.ReadUInt();
}
示例3: Write
public void Write(UruStream s)
{
s.WriteUInt(fParentIdx);
s.WriteUInt(fChildIdx);
s.WriteUInt(fSaverIdx);
s.WriteByte(0);
}
示例4: Read
public void Read(UruStream s)
{
fParentIdx = s.ReadUInt();
fChildIdx = s.ReadUInt();
fSaverIdx = s.ReadUInt();
s.ReadByte(); //Seen
}
示例5: Read
public void Read(UruStream s)
{
fType = (EConnType)s.ReadByte();
fSockHeaderSize = s.ReadUShort();
fBuildID = s.ReadUInt();
fBuildType = (NetCliBuildType)s.ReadUInt();
fBranchID = s.ReadUInt();
fProductID = new Guid(s.ReadBytes(16));
}
示例6: ToArray
public byte[] ToArray()
{
MemoryStream ms = new MemoryStream();
UruStream s = new UruStream(ms);
Write(s);
byte[] buf = ms.ToArray();
s.Close();
ms.Close();
return buf;
}
示例7: Read
public void Read(UruStream s)
{
while (true) {
AuthFileEntry entry = new AuthFileEntry();
entry.fName = s.ReadUnicodeString();
if (entry.fName == String.Empty) break;
entry.fSize = (long)(s.ReadUShort() << 16 | s.ReadUShort() & 0xFFFF);
s.ReadUShort(); //NULL
fFiles.Add(entry);
}
}
示例8: Read
public void Read(UruStream s)
{
fTransID = s.ReadUInt();
fResult = (ENetError)s.ReadInt();
fAgeMcpID = s.ReadUInt();
fAgeInstanceUuid = new Guid(s.ReadBytes(16));
fAgeVaultID = s.ReadUInt();
byte[] game = s.ReadBytes(4);
Array.Reverse(game);
fGameServerIP = new IPAddress(game);
}
示例9: Write
public void Write(UruStream s)
{
foreach (AuthFileEntry file in fFiles) {
s.WriteBytes(Encoding.Unicode.GetBytes(file.fName));
s.WriteUShort(0);
s.WriteUShort((ushort)(file.fSize >> 16));
s.WriteUShort((ushort)(file.fSize & 0xFFFF));
s.WriteUShort(0);
}
s.WriteUShort(0);
}
示例10: Connect
public override bool Connect()
{
if (!base.Connect()) return false;
//Send the FileConnectHeader
UruStream s = new UruStream(new NetworkStream(fSocket, false));
s.BufferWriter();
fHeader.Write(s);
s.WriteUInt(12); //Size
s.WriteUInt(0);
s.WriteUInt(0);
s.FlushWriter();
s.Close();
fSocket.BeginReceive(new byte[4], 0, 4, SocketFlags.Peek, new AsyncCallback(IReceive), null);
return true;
}
示例11: 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();
}
}
示例12: 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;
}
示例13: Read
public void Read(UruStream s)
{
while (true) {
FileManifestEntry me = new FileManifestEntry();
me.fFileName = s.ReadUnicodeString();
if (me.fFileName == String.Empty) break; //The end of the manifest is an empty string
me.fDownloadName = s.ReadUnicodeString();
me.fHash = s.ReadUnicodeString();
me.fCompressedHash = s.ReadUnicodeString();
me.fFileSize = (uint)(s.ReadUShort() << 16 | s.ReadUShort() & 0xFFFF);
s.ReadUShort(); //NULL
me.fCompressedSize = (uint)(s.ReadUShort() << 16 | s.ReadUShort() & 0xFFFF);
s.ReadUShort(); //NULL
me.fFlags = (uint)(s.ReadUShort() << 16 | s.ReadUShort() & 0xFFFF);
s.ReadUShort(); //NULL
fEntries.Add(me);
}
}
示例14: Write
public void Write(UruStream s)
{
s.WriteByte((byte)fType);
s.WriteUShort(fSockHeaderSize);
s.WriteUInt(fBuildID);
s.WriteUInt((uint)fBuildType);
s.WriteUInt(fBranchID);
s.WriteBytes(fProductID.ToByteArray());
}
示例15: Read
public void Read(UruStream s)
{
fTransID = s.ReadUInt();
fGroup = s.ReadUnicodeStringF(260);
fBuildID = s.ReadUInt();
}