示例#1
0
 /// <summary>
 /// Uses content of the message to regenerate list of packets
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="packetCreator"></param>
 /// <returns></returns>
 public IEnumerable <T> DeserializeList <T>(Func <T> packetCreator) where T : ISerializablePacket
 {
     return(MessageHelper.DeserializeList(_data, packetCreator));
 }
示例#2
0
 /// <summary>
 /// Writes content of the message into a packet
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="packetToBeFilled"></param>
 /// <returns></returns>
 public T Deserialize <T>(T packetToBeFilled) where T : ISerializablePacket
 {
     return(MessageHelper.Deserialize(_data, packetToBeFilled));
 }
示例#3
0
 /// <summary>
 /// Respond with data (message is created internally)
 /// </summary>
 /// <param name="data"></param>
 /// <param name="statusCode"></param>
 public void Respond(ISerializablePacket packet, ResponseStatus statusCode = ResponseStatus.Default)
 {
     Respond(MessageHelper.Create(OpCode, packet.ToBytes()), statusCode);
 }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="response"></param>
 /// <param name="statusCode"></param>
 public void Respond(int response, ResponseStatus statusCode = ResponseStatus.Default)
 {
     Respond(MessageHelper.Create(OpCode, response), statusCode);
 }
示例#5
0
 /// <summary>
 /// Respond with data (message is created internally)
 /// </summary>
 /// <param name="data"></param>
 /// <param name="statusCode"></param>
 public void Respond(byte[] data, ResponseStatus statusCode = ResponseStatus.Default)
 {
     Respond(MessageHelper.Create(OpCode, data), statusCode);
 }