Beispiel #1
0
        public static void Send(Socket owner, INetMessage msg)
        {
            ByteWriter writer = new ByteWriter();

            writer.Write(msg.GetID());
            msg.Encode(writer);

            short      cnt     = (short)writer.GetBytes().Length;
            ByteWriter writer2 = new ByteWriter();

            writer2.Write(cnt);

            List <byte> ret = new List <byte>();

            ret.AddRange(writer2.GetBytes());
            ret.AddRange(writer.GetBytes());

            owner.Send(ret.ToArray());
        }
Beispiel #2
0
 public void Encode(ByteWriter writer)
 {
     writer.Write(msg);
 }