Exemplo n.º 1
0
        /// <summary>
        /// Constructor object used to initialize a ProtocolReceive object.
        /// </summary>
        /// <param name="networkmsg">A reference to the NetworkMessage instance being
        /// used.</param>
        public ProtocolReceive71(NetworkMessage networkmsg)
        {
            netmsg = networkmsg;

            //+1 because it is 0-based
            messageDecoder = new ProcessMessage[HEADER_MAX_VAL + 1];
            InitDecoder();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor object used to initialize a ProtocolReceive object.
        /// </summary>
        public ProtocolReceive65(Socket socket)
        {
            netmsg = new NetworkMessage(socket);

            //+1 because it is 0-based
            messageDecoder = new ProcessMessage[HEADER_MAX_VAL + 1];
            InitDecoder();
            lockThis = new Object();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Print a message's header along with its message body, in hex.
 /// </summary>
 /// <param name="netmsg">A reference to the netmsg.</param>
 /// <param name="header">The header sent.</param>
 protected void PrintHeader(NetworkMessage netmsg, ushort header)
 {
     lock (lockStatic) {
         string hexString = String.Format("{0:x2}", header);
         Log.WriteLine("Unknown byte header: 0x" + hexString);
         Log.Write("Bytes:");
         for (int i = 0; i < netmsg.GetMessageLength() - 1; i++) {
             Log.Write(" 0x" + String.Format("{0:x2}", netmsg.GetByte()));
         }
         Log.WriteLine("");
     }
 }
Exemplo n.º 4
0
 public ProtocolSend71(NetworkMessage networkmsg)
 {
     netmsg = networkmsg;
     conversion = ItemConversion.GetConversionDictionary();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Protocol constructor.
 /// </summary>
 /// <param name="s"></param>
 public ProtocolSend65(Socket socket)
 {
     netmsg = new NetworkMessage(socket);
 }