Exemplo n.º 1
0
        /// <summary>
        /// Writes a packet to the server to figure out what to do.
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="serverPacket"></param>
        private void writePackageInfo(NetOutgoingMessage msg, ServerPacketTypes serverPacket)
        {
            PacketInfo packet = new PacketInfo(SenderPackets.Client, ClientPacketTypes.None_None, serverPacket);

            packet.writeToMessage(msg);
            Console.WriteLine(packet.ToString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Read this from an outgoing message.
        /// </summary>
        /// <param name="msg"></param>
        public static PacketInfo readFromMessage(NetIncomingMessage msg)
        {
            PacketInfo info = new PacketInfo();

            info.sender       = SenderPackets.readFromMessage(msg);
            info.clientPacket = ClientPacketTypes.readFromMessage(msg);
            info.serverPacket = ServerPacketTypes.readFromMessage(msg);
            return(info);
        }