/// <summary>
        /// Convert a message buffer into its string representation.
        /// </summary>
        /// <param name="buffer">MessageBuffer to use.</param>
        /// <returns></returns>
        public static string MessageContent(this MessageBuffer buffer)
        {
            var message = buffer.CreateMessage();
            var builder = new StringBuilder();
            using (var writer = XmlWriter.Create(builder))
            {
                message.WriteMessage(writer);
                writer.Close();
            }

            return builder.ToString();
        }
Ejemplo n.º 2
0
 public static void SendMessageExceptOne(this NetServer server, MessageBase msg, NetConnection except)
 {
     var om = server.CreateMessage();
     msg.Write(om);
     SendMessageExceptOne(server, msg, except);
 }
Ejemplo n.º 3
0
 public static void SendMessage(this NetServer server, MessageBase msg, NetConnection conn)
 {
     var om = server.CreateMessage();
     msg.Write(om);
     SendMessage(server, om, conn);
 }
Ejemplo n.º 4
0
 public static void SendMessage(this NetServer server, MessageBase msg)
 {
     var om = server.CreateMessage();
     msg.Write(om);
     SendMessage(server, om);
 }