Beispiel #1
0
 public byte[] PacketRequestServerInfo(int iPort)
 {
     byte[] b;
     using (IPCPacket IPP = new IPCPacket())
     {
         IPP.WriteWord(iPort);
         IPP.WriteByte(rnd.Next(1, 250));
         IPP.WriteByte((byte)IPCCommand.IPC_REQUEST_SERVERINFO);
         IPP.WriteWord(0);
         IPP.AddCRC();
         b = IPP.GetBytes();
     }
     return(b);
 }
Beispiel #2
0
 public byte[] PacketResponseServerInfo(int iPort, byte bStatus, UInt16 iMaxSlots, UInt16 iUsedSlots, UInt16 iVersion)
 {
     byte[] b;
     using (IPCPacket IPP = new IPCPacket())
     {
         IPP.WriteWord(iPort);
         IPP.WriteByte(rnd.Next(1, 250));
         IPP.WriteByte((byte)IPCCommand.IPC_INFO_SERVER);
         IPP.WriteWord(5);
         IPP.WriteByte(bStatus);
         IPP.WriteWord(iMaxSlots);
         IPP.WriteWord(iUsedSlots);
         IPP.WriteWord(iVersion);
         IPP.AddCRC();
         b = IPP.GetBytes();
     }
     return(b);
 }
Beispiel #3
0
            public byte[] PacketResponseLogin(int iPort, UInt16 wResult, UInt16 wID, string sBanReason)
            {
                int dLen = sBanReason.Length + 5;

                byte[] b;
                using (IPCPacket IPP = new IPCPacket())
                {
                    IPP.WriteWord(iPort);
                    IPP.WriteByte(rnd.Next(1, 250));
                    IPP.WriteByte((byte)IPCCommand.IPC_INFO_LOGIN);
                    IPP.WriteWord(dLen);
                    IPP.WriteWord(wID);
                    IPP.WriteWord(wResult);
                    IPP.WriteString(sBanReason);
                    IPP.AddCRC();
                    b = IPP.GetBytes();
                }
                return(b);
            }
Beispiel #4
0
            public byte[] PacketRequestLogin(int iPort, string sUserID, string sPassword, UInt16 IPCid)
            {
                int dLen = sUserID.Length + sPassword.Length + 4;

                byte[] b;
                using (IPCPacket IPP = new IPCPacket())
                {
                    IPP.WriteWord(iPort);
                    IPP.WriteByte(rnd.Next(1, 250));
                    IPP.WriteByte((byte)IPCCommand.IPC_REQUEST_LOGIN);
                    IPP.WriteWord(dLen);
                    IPP.WriteString(sUserID);
                    IPP.WriteString(sPassword);
                    IPP.WriteWord(IPCid);
                    IPP.AddCRC();
                    b = IPP.GetBytes();
                }
                return(b);
            }