本文整理汇总了C#中MUd.UruStream类的典型用法代码示例。如果您正苦于以下问题:C# UruStream类的具体用法?C# UruStream怎么用?C# UruStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UruStream类属于MUd命名空间,在下文中一共展示了UruStream类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Write
public void Write(UruStream s)
{
s.WriteUInt(fTransID);
s.WriteUInt(fAgeMcpID);
s.WriteBytes(fAcctUuid.ToByteArray());
s.WriteUInt(fPlayerID);
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:7,代码来源:GameMessages.cs
示例2: Read
public void Read(UruStream s)
{
fTransID = s.ReadUInt();
fAgeMcpID = s.ReadUInt();
fAcctUuid = new Guid(s.ReadBytes(16));
fPlayerID = s.ReadUInt();
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:7,代码来源:GameMessages.cs
示例3: Write
public void Write(UruStream s)
{
s.WriteUInt(fParentIdx);
s.WriteUInt(fChildIdx);
s.WriteUInt(fSaverIdx);
s.WriteByte(0);
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:7,代码来源:VaultNode.cs
示例4: Read
public void Read(UruStream s)
{
fParentIdx = s.ReadUInt();
fChildIdx = s.ReadUInt();
fSaverIdx = s.ReadUInt();
s.ReadByte(); //Seen
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:7,代码来源:VaultNode.cs
示例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));
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:9,代码来源:NetCliCore.cs
示例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;
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:12,代码来源:AuthManifest.cs
示例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);
}
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:12,代码来源:AuthManifest.cs
示例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);
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:12,代码来源:AuthMessages.cs
示例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);
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:13,代码来源:AuthManifest.cs
示例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;
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:17,代码来源:FileClient.cs
示例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();
}
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:20,代码来源:FileClient.cs
示例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;
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:20,代码来源:GateClient.cs
示例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);
}
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:23,代码来源:Manifest.cs
示例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());
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:9,代码来源:NetCliCore.cs
示例15: Read
public void Read(UruStream s)
{
fTransID = s.ReadUInt();
fGroup = s.ReadUnicodeStringF(260);
fBuildID = s.ReadUInt();
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:6,代码来源:FileMessages.cs
示例16: 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);
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:10,代码来源:FileMessages.cs
示例17: IReceive
private void IReceive(IAsyncResult ar)
{
try {
lock (fSocket) {
fSocket.EndReceive(ar);
ResetIdleTimer();
//Size
byte[] buf = new byte[4];
fSocket.Receive(buf);
//Message
buf = new byte[BitConverter.ToInt32(buf, 0) - 4];
fSocket.Receive(buf);
fStream = new UruStream(new MemoryStream(buf));
FileSrv2Cli msg = (FileSrv2Cli)fStream.ReadInt();
switch (msg) {
case FileSrv2Cli.BuildIdReply:
IGotBuildID();
break;
case FileSrv2Cli.PingReply:
IPong();
break;
default:
string test = Enum.GetName(typeof(FileSrv2Cli), msg);
throw new NotSupportedException(msg.ToString("X") + " - " + test);
}
fStream.Close();
}
fSocket.BeginReceive(new byte[2], 0, 2, SocketFlags.Peek, new AsyncCallback(IReceive), null);
} catch (ObjectDisposedException) {
} catch (SocketException) {
fSocket.Close();
#if !DEBUG
} catch (Exception e) {
FireException(e);
#endif
}
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:43,代码来源:FileClient.cs
示例18: Write
public void Write(UruStream s)
{
s.WriteUInt(fTransID);
s.WriteUInt(fNodeID);
s.WriteBytes(fRevisionID.ToByteArray());
if (fNodeData == null) fNodeData = new byte[0];
s.WriteInt(fNodeData.Length);
s.WriteBytes(fNodeData);
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:10,代码来源:VaultMessages.cs
示例19: 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;
}
开发者ID:Hoikas,项目名称:mudpit,代码行数:22,代码来源:FileClient.cs
注:本文中的MUd.UruStream类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论