コード例 #1
0
 private static void QueueServerSessionResponse(Queue <byte[]> queueList, SoeBaseObject sessionRecived)
 {
     using (var stream = new MemoryStream())
     {
         using (var output = new SwgOutputStream(stream))
         {
             output.SetOpCode((short)SoeOpCodes.SoeSessionResponse);         // OPCode
             output.WriteInt(sessionRecived.ClientId);                       // Client Id
             output.ReverseBytes(sessionRecived.CsrSeed);                    // CsrSeed
             output.WriteByte(2);                                            // CsrLength
             output.WriteByte(1);                                            // Use compression
             output.WriteByte(4);                                            // SeedSize
             output.WriteInt(Constants.Constants.LoginServer.MaxPacketSize); // Server UDP Size
             stream.Position = 0;
             var byterray = stream.ToArray();
             queueList.Enqueue(byterray);
         }
     }
 }
コード例 #2
0
 private static byte[] GenerateNetStatusRequest()
 {
     using (var memoryStream = new MemoryStream())
         using (var outputStream = new SwgOutputStream(memoryStream))
         {
             outputStream.WriteShort((short)SoeOpCodes.SoeNetStatusRes);
             outputStream.ReverseBytes(0); // Client Tick (TODO: Implement client tick)
             outputStream.ReverseBytes(0); // Tick Count (TODO: Implement tick count)
             outputStream.ReverseBytes(0); // ClientPacketsSent (TODO: Implement tick count)
             outputStream.ReverseBytes(0); // ClientPacketsReceived (TODO: Implement tick count)
             outputStream.ReverseBytes(0); // ClientPacketsReceived (TODO: Implement tick count)
             outputStream.ReverseBytes(0); // serverPacketsReceivedThisClient (TODO: Implement)
             return(memoryStream.ToArray());
         }
 }