protected void sendMessage(NetConnection connection, OutgoingMessage message)
        {
            NetOutgoingMessage message1 = this.server.CreateMessage();

            using (NetBufferWriteStream bufferWriteStream = new NetBufferWriteStream((NetBuffer)message1))
            {
                using (BinaryWriter writer = new BinaryWriter((Stream)bufferWriteStream)) {
                    if (message.MessageType < 20)
                    {
                        message.Write(writer);
                    }
                    else
                    {
                        OutgoingMessageBase.WriteFromMessage(message, writer);
                    }
                }
            }
            int num = (int)this.server.SendMessage(message1, connection, NetDeliveryMethod.ReliableOrdered);
        }
Beispiel #2
0
        public override void sendMessage(OutgoingMessage message)
        {
            NetOutgoingMessage message1 = this.client.CreateMessage();

            using (NetBufferWriteStream bufferWriteStream = new NetBufferWriteStream((NetBuffer)message1))
            {
                using (BinaryWriter writer = new BinaryWriter((Stream)bufferWriteStream))
                {
                    if (message.MessageType < 20)
                    {
                        message.Write(writer);
                    }
                    else
                    {
                        OutgoingMessageBase.WriteFromMessage(message, writer);
                    }
                }
            }

            int num = (int)this.client.SendMessage(message1, NetDeliveryMethod.ReliableOrdered);
        }