예제 #1
0
        public override void GetSystemTime(IRpcController controller, bnet.protocol.NoData request, Action <bnet.protocol.exchange.GetSystemTimeResponse> done)
        {
            var builder = bnet.protocol.exchange.GetSystemTimeResponse.CreateBuilder()
                          .SetTime(DateTime.Now.ToExtendedEpoch());

            done(builder.Build());
        }
예제 #2
0
 public static NoData Deserialize(Stream stream, NoData instance, long limit)
 {
     while (true)
     {
         if (limit < (long)0 || stream.Position < limit)
         {
             int num = stream.ReadByte();
             if (num != -1)
             {
                 Key key = ProtocolParser.ReadKey((byte)num, stream);
                 if (key.Field == 0)
                 {
                     throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                 }
                 ProtocolParser.SkipKey(stream, key);
             }
             else
             {
                 if (limit >= (long)0)
                 {
                     throw new EndOfStreamException();
                 }
                 break;
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
예제 #3
0
 public static void Serialize(Stream stream, NoData instance)
 {
 }
예제 #4
0
 public void Serialize(Stream stream)
 {
     NoData.Serialize(stream, this);
 }
예제 #5
0
 public static NoData Deserialize(Stream stream, NoData instance)
 {
     return(NoData.Deserialize(stream, instance, -1L));
 }
예제 #6
0
 public void Deserialize(Stream stream)
 {
     NoData.Deserialize(stream, this);
 }