game_example_protocol.pb.cc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: game_example_protocol.proto
  3. #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
  4. #include "game_example_protocol.pb.h"
  5. #include <algorithm>
  6. #include <google/protobuf/stubs/common.h>
  7. #include <google/protobuf/stubs/once.h>
  8. #include <google/protobuf/io/coded_stream.h>
  9. #include <google/protobuf/wire_format_lite_inl.h>
  10. #include <google/protobuf/descriptor.h>
  11. #include <google/protobuf/generated_message_reflection.h>
  12. #include <google/protobuf/reflection_ops.h>
  13. #include <google/protobuf/wire_format.h>
  14. // @@protoc_insertion_point(includes)
  15. namespace game_example_protocols {
  16. namespace {
  17. const ::google::protobuf::Descriptor* packetc2l_game_play_descriptor_ = NULL;
  18. const ::google::protobuf::internal::GeneratedMessageReflection*
  19. packetc2l_game_play_reflection_ = NULL;
  20. const ::google::protobuf::Descriptor* packetl2c_game_play_result_descriptor_ = NULL;
  21. const ::google::protobuf::internal::GeneratedMessageReflection*
  22. packetl2c_game_play_result_reflection_ = NULL;
  23. } // namespace
  24. void protobuf_AssignDesc_game_5fexample_5fprotocol_2eproto() {
  25. protobuf_AddDesc_game_5fexample_5fprotocol_2eproto();
  26. const ::google::protobuf::FileDescriptor* file =
  27. ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
  28. "game_example_protocol.proto");
  29. GOOGLE_CHECK(file != NULL);
  30. packetc2l_game_play_descriptor_ = file->message_type(0);
  31. static const int packetc2l_game_play_offsets_[2] = {
  32. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(packetc2l_game_play, packet_id_),
  33. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(packetc2l_game_play, select_),
  34. };
  35. packetc2l_game_play_reflection_ =
  36. new ::google::protobuf::internal::GeneratedMessageReflection(
  37. packetc2l_game_play_descriptor_,
  38. packetc2l_game_play::default_instance_,
  39. packetc2l_game_play_offsets_,
  40. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(packetc2l_game_play, _has_bits_[0]),
  41. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(packetc2l_game_play, _unknown_fields_),
  42. -1,
  43. ::google::protobuf::DescriptorPool::generated_pool(),
  44. ::google::protobuf::MessageFactory::generated_factory(),
  45. sizeof(packetc2l_game_play));
  46. packetl2c_game_play_result_descriptor_ = file->message_type(1);
  47. static const int packetl2c_game_play_result_offsets_[2] = {
  48. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(packetl2c_game_play_result, packet_id_),
  49. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(packetl2c_game_play_result, random_),
  50. };
  51. packetl2c_game_play_result_reflection_ =
  52. new ::google::protobuf::internal::GeneratedMessageReflection(
  53. packetl2c_game_play_result_descriptor_,
  54. packetl2c_game_play_result::default_instance_,
  55. packetl2c_game_play_result_offsets_,
  56. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(packetl2c_game_play_result, _has_bits_[0]),
  57. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(packetl2c_game_play_result, _unknown_fields_),
  58. -1,
  59. ::google::protobuf::DescriptorPool::generated_pool(),
  60. ::google::protobuf::MessageFactory::generated_factory(),
  61. sizeof(packetl2c_game_play_result));
  62. }
  63. namespace {
  64. GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
  65. inline void protobuf_AssignDescriptorsOnce() {
  66. ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
  67. &protobuf_AssignDesc_game_5fexample_5fprotocol_2eproto);
  68. }
  69. void protobuf_RegisterTypes(const ::std::string&) {
  70. protobuf_AssignDescriptorsOnce();
  71. ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
  72. packetc2l_game_play_descriptor_, &packetc2l_game_play::default_instance());
  73. ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
  74. packetl2c_game_play_result_descriptor_, &packetl2c_game_play_result::default_instance());
  75. }
  76. } // namespace
  77. void protobuf_ShutdownFile_game_5fexample_5fprotocol_2eproto() {
  78. delete packetc2l_game_play::default_instance_;
  79. delete packetc2l_game_play_reflection_;
  80. delete packetl2c_game_play_result::default_instance_;
  81. delete packetl2c_game_play_result_reflection_;
  82. }
  83. void protobuf_AddDesc_game_5fexample_5fprotocol_2eproto() {
  84. static bool already_here = false;
  85. if (already_here) return;
  86. already_here = true;
  87. GOOGLE_PROTOBUF_VERIFY_VERSION;
  88. ::game_example_protocols::protobuf_AddDesc_game_5fexample_5fdef_2eproto();
  89. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  90. "\n\033game_example_protocol.proto\022\026game_exam"
  91. "ple_protocols\032\026game_example_def.proto\"{\n"
  92. "\023packetc2l_game_play\022Q\n\tpacket_id\030\001 \001(\0162"
  93. ").game_example_protocols.e_server_msg_ty"
  94. "pe:\023e_mst_c2l_game_play\022\021\n\006select\030\002 \001(\005:"
  95. "\0010\"\206\001\n\032packetl2c_game_play_result\022X\n\tpac"
  96. "ket_id\030\001 \001(\0162).game_example_protocols.e_"
  97. "server_msg_type:\032e_mst_l2c_game_play_res"
  98. "ult\022\016\n\006random\030\002 \001(\005", 339);
  99. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  100. "game_example_protocol.proto", &protobuf_RegisterTypes);
  101. packetc2l_game_play::default_instance_ = new packetc2l_game_play();
  102. packetl2c_game_play_result::default_instance_ = new packetl2c_game_play_result();
  103. packetc2l_game_play::default_instance_->InitAsDefaultInstance();
  104. packetl2c_game_play_result::default_instance_->InitAsDefaultInstance();
  105. ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_game_5fexample_5fprotocol_2eproto);
  106. }
  107. // Force AddDescriptors() to be called at static initialization time.
  108. struct StaticDescriptorInitializer_game_5fexample_5fprotocol_2eproto {
  109. StaticDescriptorInitializer_game_5fexample_5fprotocol_2eproto() {
  110. protobuf_AddDesc_game_5fexample_5fprotocol_2eproto();
  111. }
  112. } static_descriptor_initializer_game_5fexample_5fprotocol_2eproto_;
  113. // ===================================================================
  114. #ifndef _MSC_VER
  115. const int packetc2l_game_play::kPacketIdFieldNumber;
  116. const int packetc2l_game_play::kSelectFieldNumber;
  117. #endif // !_MSC_VER
  118. packetc2l_game_play::packetc2l_game_play()
  119. : ::google::protobuf::Message() {
  120. SharedCtor();
  121. }
  122. void packetc2l_game_play::InitAsDefaultInstance() {
  123. }
  124. packetc2l_game_play::packetc2l_game_play(const packetc2l_game_play& from)
  125. : ::google::protobuf::Message() {
  126. SharedCtor();
  127. MergeFrom(from);
  128. }
  129. void packetc2l_game_play::SharedCtor() {
  130. _cached_size_ = 0;
  131. packet_id_ = 10001;
  132. select_ = 0;
  133. ::memset(_has_bits_, 0, sizeof(_has_bits_));
  134. }
  135. packetc2l_game_play::~packetc2l_game_play() {
  136. SharedDtor();
  137. }
  138. void packetc2l_game_play::SharedDtor() {
  139. if (this != default_instance_) {
  140. }
  141. }
  142. void packetc2l_game_play::SetCachedSize(int size) const {
  143. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  144. _cached_size_ = size;
  145. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  146. }
  147. const ::google::protobuf::Descriptor* packetc2l_game_play::descriptor() {
  148. protobuf_AssignDescriptorsOnce();
  149. return packetc2l_game_play_descriptor_;
  150. }
  151. const packetc2l_game_play& packetc2l_game_play::default_instance() {
  152. if (default_instance_ == NULL) protobuf_AddDesc_game_5fexample_5fprotocol_2eproto();
  153. return *default_instance_;
  154. }
  155. packetc2l_game_play* packetc2l_game_play::default_instance_ = NULL;
  156. packetc2l_game_play* packetc2l_game_play::New() const {
  157. return new packetc2l_game_play;
  158. }
  159. void packetc2l_game_play::Clear() {
  160. if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  161. packet_id_ = 10001;
  162. select_ = 0;
  163. }
  164. ::memset(_has_bits_, 0, sizeof(_has_bits_));
  165. mutable_unknown_fields()->Clear();
  166. }
  167. bool packetc2l_game_play::MergePartialFromCodedStream(
  168. ::google::protobuf::io::CodedInputStream* input) {
  169. #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  170. ::google::protobuf::uint32 tag;
  171. while ((tag = input->ReadTag()) != 0) {
  172. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  173. // optional .game_example_protocols.e_server_msg_type packet_id = 1 [default = e_mst_c2l_game_play];
  174. case 1: {
  175. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  176. ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
  177. int value;
  178. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  179. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  180. input, &value)));
  181. if (::game_example_protocols::e_server_msg_type_IsValid(value)) {
  182. set_packet_id(static_cast< ::game_example_protocols::e_server_msg_type >(value));
  183. } else {
  184. mutable_unknown_fields()->AddVarint(1, value);
  185. }
  186. } else {
  187. goto handle_uninterpreted;
  188. }
  189. if (input->ExpectTag(16)) goto parse_select;
  190. break;
  191. }
  192. // optional int32 select = 2 [default = 0];
  193. case 2: {
  194. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  195. ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
  196. parse_select:
  197. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  198. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  199. input, &select_)));
  200. set_has_select();
  201. } else {
  202. goto handle_uninterpreted;
  203. }
  204. if (input->ExpectAtEnd()) return true;
  205. break;
  206. }
  207. default: {
  208. handle_uninterpreted:
  209. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  210. ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  211. return true;
  212. }
  213. DO_(::google::protobuf::internal::WireFormat::SkipField(
  214. input, tag, mutable_unknown_fields()));
  215. break;
  216. }
  217. }
  218. }
  219. return true;
  220. #undef DO_
  221. }
  222. void packetc2l_game_play::SerializeWithCachedSizes(
  223. ::google::protobuf::io::CodedOutputStream* output) const {
  224. // optional .game_example_protocols.e_server_msg_type packet_id = 1 [default = e_mst_c2l_game_play];
  225. if (has_packet_id()) {
  226. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  227. 1, this->packet_id(), output);
  228. }
  229. // optional int32 select = 2 [default = 0];
  230. if (has_select()) {
  231. ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->select(), output);
  232. }
  233. if (!unknown_fields().empty()) {
  234. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  235. unknown_fields(), output);
  236. }
  237. }
  238. ::google::protobuf::uint8* packetc2l_game_play::SerializeWithCachedSizesToArray(
  239. ::google::protobuf::uint8* target) const {
  240. // optional .game_example_protocols.e_server_msg_type packet_id = 1 [default = e_mst_c2l_game_play];
  241. if (has_packet_id()) {
  242. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  243. 1, this->packet_id(), target);
  244. }
  245. // optional int32 select = 2 [default = 0];
  246. if (has_select()) {
  247. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->select(), target);
  248. }
  249. if (!unknown_fields().empty()) {
  250. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  251. unknown_fields(), target);
  252. }
  253. return target;
  254. }
  255. int packetc2l_game_play::ByteSize() const {
  256. int total_size = 0;
  257. if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  258. // optional .game_example_protocols.e_server_msg_type packet_id = 1 [default = e_mst_c2l_game_play];
  259. if (has_packet_id()) {
  260. total_size += 1 +
  261. ::google::protobuf::internal::WireFormatLite::EnumSize(this->packet_id());
  262. }
  263. // optional int32 select = 2 [default = 0];
  264. if (has_select()) {
  265. total_size += 1 +
  266. ::google::protobuf::internal::WireFormatLite::Int32Size(
  267. this->select());
  268. }
  269. }
  270. if (!unknown_fields().empty()) {
  271. total_size +=
  272. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  273. unknown_fields());
  274. }
  275. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  276. _cached_size_ = total_size;
  277. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  278. return total_size;
  279. }
  280. void packetc2l_game_play::MergeFrom(const ::google::protobuf::Message& from) {
  281. GOOGLE_CHECK_NE(&from, this);
  282. const packetc2l_game_play* source =
  283. ::google::protobuf::internal::dynamic_cast_if_available<const packetc2l_game_play*>(
  284. &from);
  285. if (source == NULL) {
  286. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  287. } else {
  288. MergeFrom(*source);
  289. }
  290. }
  291. void packetc2l_game_play::MergeFrom(const packetc2l_game_play& from) {
  292. GOOGLE_CHECK_NE(&from, this);
  293. if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  294. if (from.has_packet_id()) {
  295. set_packet_id(from.packet_id());
  296. }
  297. if (from.has_select()) {
  298. set_select(from.select());
  299. }
  300. }
  301. mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  302. }
  303. void packetc2l_game_play::CopyFrom(const ::google::protobuf::Message& from) {
  304. if (&from == this) return;
  305. Clear();
  306. MergeFrom(from);
  307. }
  308. void packetc2l_game_play::CopyFrom(const packetc2l_game_play& from) {
  309. if (&from == this) return;
  310. Clear();
  311. MergeFrom(from);
  312. }
  313. bool packetc2l_game_play::IsInitialized() const {
  314. return true;
  315. }
  316. void packetc2l_game_play::Swap(packetc2l_game_play* other) {
  317. if (other != this) {
  318. std::swap(packet_id_, other->packet_id_);
  319. std::swap(select_, other->select_);
  320. std::swap(_has_bits_[0], other->_has_bits_[0]);
  321. _unknown_fields_.Swap(&other->_unknown_fields_);
  322. std::swap(_cached_size_, other->_cached_size_);
  323. }
  324. }
  325. ::google::protobuf::Metadata packetc2l_game_play::GetMetadata() const {
  326. protobuf_AssignDescriptorsOnce();
  327. ::google::protobuf::Metadata metadata;
  328. metadata.descriptor = packetc2l_game_play_descriptor_;
  329. metadata.reflection = packetc2l_game_play_reflection_;
  330. return metadata;
  331. }
  332. // ===================================================================
  333. #ifndef _MSC_VER
  334. const int packetl2c_game_play_result::kPacketIdFieldNumber;
  335. const int packetl2c_game_play_result::kRandomFieldNumber;
  336. #endif // !_MSC_VER
  337. packetl2c_game_play_result::packetl2c_game_play_result()
  338. : ::google::protobuf::Message() {
  339. SharedCtor();
  340. }
  341. void packetl2c_game_play_result::InitAsDefaultInstance() {
  342. }
  343. packetl2c_game_play_result::packetl2c_game_play_result(const packetl2c_game_play_result& from)
  344. : ::google::protobuf::Message() {
  345. SharedCtor();
  346. MergeFrom(from);
  347. }
  348. void packetl2c_game_play_result::SharedCtor() {
  349. _cached_size_ = 0;
  350. packet_id_ = 15001;
  351. random_ = 0;
  352. ::memset(_has_bits_, 0, sizeof(_has_bits_));
  353. }
  354. packetl2c_game_play_result::~packetl2c_game_play_result() {
  355. SharedDtor();
  356. }
  357. void packetl2c_game_play_result::SharedDtor() {
  358. if (this != default_instance_) {
  359. }
  360. }
  361. void packetl2c_game_play_result::SetCachedSize(int size) const {
  362. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  363. _cached_size_ = size;
  364. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  365. }
  366. const ::google::protobuf::Descriptor* packetl2c_game_play_result::descriptor() {
  367. protobuf_AssignDescriptorsOnce();
  368. return packetl2c_game_play_result_descriptor_;
  369. }
  370. const packetl2c_game_play_result& packetl2c_game_play_result::default_instance() {
  371. if (default_instance_ == NULL) protobuf_AddDesc_game_5fexample_5fprotocol_2eproto();
  372. return *default_instance_;
  373. }
  374. packetl2c_game_play_result* packetl2c_game_play_result::default_instance_ = NULL;
  375. packetl2c_game_play_result* packetl2c_game_play_result::New() const {
  376. return new packetl2c_game_play_result;
  377. }
  378. void packetl2c_game_play_result::Clear() {
  379. if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  380. packet_id_ = 15001;
  381. random_ = 0;
  382. }
  383. ::memset(_has_bits_, 0, sizeof(_has_bits_));
  384. mutable_unknown_fields()->Clear();
  385. }
  386. bool packetl2c_game_play_result::MergePartialFromCodedStream(
  387. ::google::protobuf::io::CodedInputStream* input) {
  388. #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  389. ::google::protobuf::uint32 tag;
  390. while ((tag = input->ReadTag()) != 0) {
  391. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  392. // optional .game_example_protocols.e_server_msg_type packet_id = 1 [default = e_mst_l2c_game_play_result];
  393. case 1: {
  394. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  395. ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
  396. int value;
  397. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  398. int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
  399. input, &value)));
  400. if (::game_example_protocols::e_server_msg_type_IsValid(value)) {
  401. set_packet_id(static_cast< ::game_example_protocols::e_server_msg_type >(value));
  402. } else {
  403. mutable_unknown_fields()->AddVarint(1, value);
  404. }
  405. } else {
  406. goto handle_uninterpreted;
  407. }
  408. if (input->ExpectTag(16)) goto parse_random;
  409. break;
  410. }
  411. // optional int32 random = 2;
  412. case 2: {
  413. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  414. ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
  415. parse_random:
  416. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  417. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  418. input, &random_)));
  419. set_has_random();
  420. } else {
  421. goto handle_uninterpreted;
  422. }
  423. if (input->ExpectAtEnd()) return true;
  424. break;
  425. }
  426. default: {
  427. handle_uninterpreted:
  428. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  429. ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  430. return true;
  431. }
  432. DO_(::google::protobuf::internal::WireFormat::SkipField(
  433. input, tag, mutable_unknown_fields()));
  434. break;
  435. }
  436. }
  437. }
  438. return true;
  439. #undef DO_
  440. }
  441. void packetl2c_game_play_result::SerializeWithCachedSizes(
  442. ::google::protobuf::io::CodedOutputStream* output) const {
  443. // optional .game_example_protocols.e_server_msg_type packet_id = 1 [default = e_mst_l2c_game_play_result];
  444. if (has_packet_id()) {
  445. ::google::protobuf::internal::WireFormatLite::WriteEnum(
  446. 1, this->packet_id(), output);
  447. }
  448. // optional int32 random = 2;
  449. if (has_random()) {
  450. ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->random(), output);
  451. }
  452. if (!unknown_fields().empty()) {
  453. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  454. unknown_fields(), output);
  455. }
  456. }
  457. ::google::protobuf::uint8* packetl2c_game_play_result::SerializeWithCachedSizesToArray(
  458. ::google::protobuf::uint8* target) const {
  459. // optional .game_example_protocols.e_server_msg_type packet_id = 1 [default = e_mst_l2c_game_play_result];
  460. if (has_packet_id()) {
  461. target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
  462. 1, this->packet_id(), target);
  463. }
  464. // optional int32 random = 2;
  465. if (has_random()) {
  466. target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->random(), target);
  467. }
  468. if (!unknown_fields().empty()) {
  469. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  470. unknown_fields(), target);
  471. }
  472. return target;
  473. }
  474. int packetl2c_game_play_result::ByteSize() const {
  475. int total_size = 0;
  476. if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  477. // optional .game_example_protocols.e_server_msg_type packet_id = 1 [default = e_mst_l2c_game_play_result];
  478. if (has_packet_id()) {
  479. total_size += 1 +
  480. ::google::protobuf::internal::WireFormatLite::EnumSize(this->packet_id());
  481. }
  482. // optional int32 random = 2;
  483. if (has_random()) {
  484. total_size += 1 +
  485. ::google::protobuf::internal::WireFormatLite::Int32Size(
  486. this->random());
  487. }
  488. }
  489. if (!unknown_fields().empty()) {
  490. total_size +=
  491. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  492. unknown_fields());
  493. }
  494. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  495. _cached_size_ = total_size;
  496. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  497. return total_size;
  498. }
  499. void packetl2c_game_play_result::MergeFrom(const ::google::protobuf::Message& from) {
  500. GOOGLE_CHECK_NE(&from, this);
  501. const packetl2c_game_play_result* source =
  502. ::google::protobuf::internal::dynamic_cast_if_available<const packetl2c_game_play_result*>(
  503. &from);
  504. if (source == NULL) {
  505. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  506. } else {
  507. MergeFrom(*source);
  508. }
  509. }
  510. void packetl2c_game_play_result::MergeFrom(const packetl2c_game_play_result& from) {
  511. GOOGLE_CHECK_NE(&from, this);
  512. if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  513. if (from.has_packet_id()) {
  514. set_packet_id(from.packet_id());
  515. }
  516. if (from.has_random()) {
  517. set_random(from.random());
  518. }
  519. }
  520. mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  521. }
  522. void packetl2c_game_play_result::CopyFrom(const ::google::protobuf::Message& from) {
  523. if (&from == this) return;
  524. Clear();
  525. MergeFrom(from);
  526. }
  527. void packetl2c_game_play_result::CopyFrom(const packetl2c_game_play_result& from) {
  528. if (&from == this) return;
  529. Clear();
  530. MergeFrom(from);
  531. }
  532. bool packetl2c_game_play_result::IsInitialized() const {
  533. return true;
  534. }
  535. void packetl2c_game_play_result::Swap(packetl2c_game_play_result* other) {
  536. if (other != this) {
  537. std::swap(packet_id_, other->packet_id_);
  538. std::swap(random_, other->random_);
  539. std::swap(_has_bits_[0], other->_has_bits_[0]);
  540. _unknown_fields_.Swap(&other->_unknown_fields_);
  541. std::swap(_cached_size_, other->_cached_size_);
  542. }
  543. }
  544. ::google::protobuf::Metadata packetl2c_game_play_result::GetMetadata() const {
  545. protobuf_AssignDescriptorsOnce();
  546. ::google::protobuf::Metadata metadata;
  547. metadata.descriptor = packetl2c_game_play_result_descriptor_;
  548. metadata.reflection = packetl2c_game_play_result_reflection_;
  549. return metadata;
  550. }
  551. // @@protoc_insertion_point(namespace_scope)
  552. } // namespace game_example_protocols
  553. // @@protoc_insertion_point(global_scope)