Time.pbj.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using pbd = global::Google.ProtocolBuffers.Descriptors;
  28. using pb = global::Google.ProtocolBuffers;
  29. namespace Sirikata.Network.Protocol {
  30. public class TimeSync : PBJ.IMessage {
  31. protected _PBJ_Internal.TimeSync super;
  32. public _PBJ_Internal.TimeSync _PBJSuper{ get { return super;} }
  33. public TimeSync() {
  34. super=new _PBJ_Internal.TimeSync();
  35. }
  36. public TimeSync(_PBJ_Internal.TimeSync reference) {
  37. super=reference;
  38. }
  39. public static TimeSync defaultInstance= new TimeSync (_PBJ_Internal.TimeSync.DefaultInstance);
  40. public static TimeSync DefaultInstance{
  41. get {return defaultInstance;}
  42. }
  43. public static pbd.MessageDescriptor Descriptor {
  44. get { return _PBJ_Internal.TimeSync.Descriptor; } }
  45. public static class Types {
  46. public enum ReturnOptions {
  47. REPLY_RELIABLE=_PBJ_Internal.TimeSync.Types.ReturnOptions.REPLY_RELIABLE,
  48. REPLY_ORDERED=_PBJ_Internal.TimeSync.Types.ReturnOptions.REPLY_ORDERED
  49. };
  50. }
  51. public static bool WithinReservedFieldTagRange(int field_tag) {
  52. return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912);
  53. }
  54. public static bool WithinExtensionFieldTagRange(int field_tag) {
  55. return false;
  56. }
  57. public const int ClientTimeFieldTag=9;
  58. public bool HasClientTime{ get {return super.HasClientTime&&PBJ._PBJ.ValidateTime(super.ClientTime);} }
  59. public PBJ.Time ClientTime{ get {
  60. if (HasClientTime) {
  61. return PBJ._PBJ.CastTime(super.ClientTime);
  62. } else {
  63. return PBJ._PBJ.CastTime();
  64. }
  65. }
  66. }
  67. public const int ServerTimeFieldTag=10;
  68. public bool HasServerTime{ get {return super.HasServerTime&&PBJ._PBJ.ValidateTime(super.ServerTime);} }
  69. public PBJ.Time ServerTime{ get {
  70. if (HasServerTime) {
  71. return PBJ._PBJ.CastTime(super.ServerTime);
  72. } else {
  73. return PBJ._PBJ.CastTime();
  74. }
  75. }
  76. }
  77. public const int SyncRoundFieldTag=11;
  78. public bool HasSyncRound{ get {return super.HasSyncRound&&PBJ._PBJ.ValidateUint64(super.SyncRound);} }
  79. public ulong SyncRound{ get {
  80. if (HasSyncRound) {
  81. return PBJ._PBJ.CastUint64(super.SyncRound);
  82. } else {
  83. return PBJ._PBJ.CastUint64();
  84. }
  85. }
  86. }
  87. public const int ReturnOptionsFieldTag=14;
  88. public bool HasReturnOptions { get {
  89. if (!super.HasReturnOptions) return false;
  90. return PBJ._PBJ.ValidateFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
  91. } }
  92. public uint ReturnOptions{ get {
  93. if (HasReturnOptions) {
  94. return (uint)PBJ._PBJ.CastFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
  95. } else {
  96. return (uint)PBJ._PBJ.CastFlags((ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
  97. }
  98. }
  99. }
  100. public const int RoundTripFieldTag=2561;
  101. public bool HasRoundTrip{ get {return super.HasRoundTrip&&PBJ._PBJ.ValidateTime(super.RoundTrip);} }
  102. public PBJ.Time RoundTrip{ get {
  103. if (HasRoundTrip) {
  104. return PBJ._PBJ.CastTime(super.RoundTrip);
  105. } else {
  106. return PBJ._PBJ.CastTime();
  107. }
  108. }
  109. }
  110. public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } }
  111. public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); }
  112. public static Builder CreateBuilder() { return new Builder(); }
  113. public static Builder CreateBuilder(TimeSync prototype) {
  114. return (Builder)new Builder().MergeFrom(prototype);
  115. }
  116. public static TimeSync ParseFrom(pb::ByteString data) {
  117. return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data));
  118. }
  119. public static TimeSync ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) {
  120. return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er));
  121. }
  122. public static TimeSync ParseFrom(byte[] data) {
  123. return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data));
  124. }
  125. public static TimeSync ParseFrom(byte[] data, pb::ExtensionRegistry er) {
  126. return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er));
  127. }
  128. public static TimeSync ParseFrom(global::System.IO.Stream data) {
  129. return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data));
  130. }
  131. public static TimeSync ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) {
  132. return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er));
  133. }
  134. public static TimeSync ParseFrom(pb::CodedInputStream data) {
  135. return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data));
  136. }
  137. public static TimeSync ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) {
  138. return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er));
  139. }
  140. protected override bool _HasAllPBJFields{ get {
  141. return true
  142. ;
  143. } }
  144. public bool IsInitialized { get {
  145. return super.IsInitialized&&_HasAllPBJFields;
  146. } }
  147. public class Builder : global::PBJ.IMessage.IBuilder{
  148. protected override bool _HasAllPBJFields{ get {
  149. return true
  150. ;
  151. } }
  152. public bool IsInitialized { get {
  153. return super.IsInitialized&&_HasAllPBJFields;
  154. } }
  155. protected _PBJ_Internal.TimeSync.Builder super;
  156. public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } }
  157. public _PBJ_Internal.TimeSync.Builder _PBJSuper{ get { return super;} }
  158. public Builder() {super = new _PBJ_Internal.TimeSync.Builder();}
  159. public Builder(_PBJ_Internal.TimeSync.Builder other) {
  160. super=other;
  161. }
  162. public Builder Clone() {return new Builder(super.Clone());}
  163. public Builder MergeFrom(TimeSync prototype) { super.MergeFrom(prototype._PBJSuper);return this;}
  164. public Builder Clear() {super.Clear();return this;}
  165. public TimeSync BuildPartial() {return new TimeSync(super.BuildPartial());}
  166. public TimeSync Build() {if (_HasAllPBJFields) return new TimeSync(super.Build());return null;}
  167. public pbd::MessageDescriptor DescriptorForType {
  168. get { return TimeSync.Descriptor; } }
  169. public Builder ClearClientTime() { super.ClearClientTime();return this;}
  170. public const int ClientTimeFieldTag=9;
  171. public bool HasClientTime{ get {return super.HasClientTime&&PBJ._PBJ.ValidateTime(super.ClientTime);} }
  172. public PBJ.Time ClientTime{ get {
  173. if (HasClientTime) {
  174. return PBJ._PBJ.CastTime(super.ClientTime);
  175. } else {
  176. return PBJ._PBJ.CastTime();
  177. }
  178. }
  179. set {
  180. super.ClientTime=(PBJ._PBJ.Construct(value));
  181. }
  182. }
  183. public Builder ClearServerTime() { super.ClearServerTime();return this;}
  184. public const int ServerTimeFieldTag=10;
  185. public bool HasServerTime{ get {return super.HasServerTime&&PBJ._PBJ.ValidateTime(super.ServerTime);} }
  186. public PBJ.Time ServerTime{ get {
  187. if (HasServerTime) {
  188. return PBJ._PBJ.CastTime(super.ServerTime);
  189. } else {
  190. return PBJ._PBJ.CastTime();
  191. }
  192. }
  193. set {
  194. super.ServerTime=(PBJ._PBJ.Construct(value));
  195. }
  196. }
  197. public Builder ClearSyncRound() { super.ClearSyncRound();return this;}
  198. public const int SyncRoundFieldTag=11;
  199. public bool HasSyncRound{ get {return super.HasSyncRound&&PBJ._PBJ.ValidateUint64(super.SyncRound);} }
  200. public ulong SyncRound{ get {
  201. if (HasSyncRound) {
  202. return PBJ._PBJ.CastUint64(super.SyncRound);
  203. } else {
  204. return PBJ._PBJ.CastUint64();
  205. }
  206. }
  207. set {
  208. super.SyncRound=(PBJ._PBJ.Construct(value));
  209. }
  210. }
  211. public Builder ClearReturnOptions() { super.ClearReturnOptions();return this;}
  212. public const int ReturnOptionsFieldTag=14;
  213. public bool HasReturnOptions { get {
  214. if (!super.HasReturnOptions) return false;
  215. return PBJ._PBJ.ValidateFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
  216. } }
  217. public uint ReturnOptions{ get {
  218. if (HasReturnOptions) {
  219. return (uint)PBJ._PBJ.CastFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
  220. } else {
  221. return (uint)PBJ._PBJ.CastFlags((ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
  222. }
  223. }
  224. set {
  225. super.ReturnOptions=((value));
  226. }
  227. }
  228. public Builder ClearRoundTrip() { super.ClearRoundTrip();return this;}
  229. public const int RoundTripFieldTag=2561;
  230. public bool HasRoundTrip{ get {return super.HasRoundTrip&&PBJ._PBJ.ValidateTime(super.RoundTrip);} }
  231. public PBJ.Time RoundTrip{ get {
  232. if (HasRoundTrip) {
  233. return PBJ._PBJ.CastTime(super.RoundTrip);
  234. } else {
  235. return PBJ._PBJ.CastTime();
  236. }
  237. }
  238. set {
  239. super.RoundTrip=(PBJ._PBJ.Construct(value));
  240. }
  241. }
  242. }
  243. }
  244. }