aboutsummaryrefslogtreecommitdiff
path: root/src/server/proto/Client/report_service.pb.cc
blob: fcaea55c60568c66f757960d327f0711370cd5fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: report_service.proto

#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "report_service.pb.h"

#include <utility>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
#include "BattlenetRpcErrorCodes.h"
// @@protoc_insertion_point(includes)

namespace bgs {
namespace protocol {
namespace report {
namespace v1 {

namespace {

const ::google::protobuf::Descriptor* SendReportRequest_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  SendReportRequest_reflection_ = NULL;
const ::google::protobuf::Descriptor* SubmitReportRequest_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  SubmitReportRequest_reflection_ = NULL;
const ::google::protobuf::ServiceDescriptor* ReportService_descriptor_ = NULL;

}  // namespace

void protobuf_AssignDesc_report_5fservice_2eproto() {
  protobuf_AddDesc_report_5fservice_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "report_service.proto");
  GOOGLE_CHECK(file != NULL);
  SendReportRequest_descriptor_ = file->message_type(0);
  static const int SendReportRequest_offsets_[2] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SendReportRequest, report_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SendReportRequest, program_),
  };
  SendReportRequest_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      SendReportRequest_descriptor_,
      SendReportRequest::default_instance_,
      SendReportRequest_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SendReportRequest, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SendReportRequest, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(SendReportRequest));
  SubmitReportRequest_descriptor_ = file->message_type(1);
  static const int SubmitReportRequest_offsets_[3] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SubmitReportRequest, agent_id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SubmitReportRequest, report_type_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SubmitReportRequest, program_),
  };
  SubmitReportRequest_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      SubmitReportRequest_descriptor_,
      SubmitReportRequest::default_instance_,
      SubmitReportRequest_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SubmitReportRequest, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SubmitReportRequest, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(SubmitReportRequest));
  ReportService_descriptor_ = file->service(0);
}

namespace {

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                 &protobuf_AssignDesc_report_5fservice_2eproto);
}

void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    SendReportRequest_descriptor_, &SendReportRequest::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    SubmitReportRequest_descriptor_, &SubmitReportRequest::default_instance());
}

}  // namespace

void protobuf_ShutdownFile_report_5fservice_2eproto() {
  delete SendReportRequest::default_instance_;
  delete SendReportRequest_reflection_;
  delete SubmitReportRequest::default_instance_;
  delete SubmitReportRequest_reflection_;
}

void protobuf_AddDesc_report_5fservice_2eproto() {
  static bool already_here = false;
  if (already_here) return;
  already_here = true;
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  ::bgs::protocol::account::v1::protobuf_AddDesc_account_5ftypes_2eproto();
  ::bgs::protocol::report::v1::protobuf_AddDesc_report_5ftypes_2eproto();
  ::bgs::protocol::protobuf_AddDesc_rpc_5ftypes_2eproto();
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n\024report_service.proto\022\026bgs.protocol.rep"
    "ort.v1\032\023account_types.proto\032\022report_type"
    "s.proto\032\017rpc_types.proto\"T\n\021SendReportRe"
    "quest\022.\n\006report\030\001 \002(\0132\036.bgs.protocol.rep"
    "ort.v1.Report\022\017\n\007program\030\002 \001(\r\"\235\001\n\023Submi"
    "tReportRequest\022<\n\010agent_id\030\001 \001(\0132*.bgs.p"
    "rotocol.account.v1.GameAccountHandle\0227\n\013"
    "report_type\030\002 \001(\0132\".bgs.protocol.report."
    "v1.ReportType\022\017\n\007program\030\003 \001(\r2\361\001\n\rRepor"
    "tService\022U\n\nSendReport\022).bgs.protocol.re"
    "port.v1.SendReportRequest\032\024.bgs.protocol"
    ".NoData\"\006\202\371+\002\010\001\022Y\n\014SubmitReport\022+.bgs.pr"
    "otocol.report.v1.SubmitReportRequest\032\024.b"
    "gs.protocol.NoData\"\006\202\371+\002\010\002\032.\202\371+$\n\"bnet.p"
    "rotocol.report.ReportService\212\371+\002\020\001B\005H\002\200\001"
    "\000", 601);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "report_service.proto", &protobuf_RegisterTypes);
  SendReportRequest::default_instance_ = new SendReportRequest();
  SubmitReportRequest::default_instance_ = new SubmitReportRequest();
  SendReportRequest::default_instance_->InitAsDefaultInstance();
  SubmitReportRequest::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_report_5fservice_2eproto);
}

// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_report_5fservice_2eproto {
  StaticDescriptorInitializer_report_5fservice_2eproto() {
    protobuf_AddDesc_report_5fservice_2eproto();
  }
} static_descriptor_initializer_report_5fservice_2eproto_;
// ===================================================================

#ifndef _MSC_VER
const int SendReportRequest::kReportFieldNumber;
const int SendReportRequest::kProgramFieldNumber;
#endif  // !_MSC_VER

SendReportRequest::SendReportRequest()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:bgs.protocol.report.v1.SendReportRequest)
}

void SendReportRequest::InitAsDefaultInstance() {
  report_ = const_cast< ::bgs::protocol::report::v1::Report*>(&::bgs::protocol::report::v1::Report::default_instance());
}

SendReportRequest::SendReportRequest(const SendReportRequest& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:bgs.protocol.report.v1.SendReportRequest)
}

void SendReportRequest::SharedCtor() {
  _cached_size_ = 0;
  report_ = NULL;
  program_ = 0u;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

SendReportRequest::~SendReportRequest() {
  // @@protoc_insertion_point(destructor:bgs.protocol.report.v1.SendReportRequest)
  SharedDtor();
}

void SendReportRequest::SharedDtor() {
  if (this != default_instance_) {
    delete report_;
  }
}

void SendReportRequest::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SendReportRequest::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return SendReportRequest_descriptor_;
}

const SendReportRequest& SendReportRequest::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_report_5fservice_2eproto();
  return *default_instance_;
}

SendReportRequest* SendReportRequest::default_instance_ = NULL;

SendReportRequest* SendReportRequest::New() const {
  return new SendReportRequest;
}

void SendReportRequest::Swap(SendReportRequest* other) {
  if (other != this) {
    GetReflection()->Swap(this, other);}
}

::google::protobuf::Metadata SendReportRequest::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = SendReportRequest_descriptor_;
  metadata.reflection = SendReportRequest_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
const int SubmitReportRequest::kAgentIdFieldNumber;
const int SubmitReportRequest::kReportTypeFieldNumber;
const int SubmitReportRequest::kProgramFieldNumber;
#endif  // !_MSC_VER

SubmitReportRequest::SubmitReportRequest()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:bgs.protocol.report.v1.SubmitReportRequest)
}

void SubmitReportRequest::InitAsDefaultInstance() {
  agent_id_ = const_cast< ::bgs::protocol::account::v1::GameAccountHandle*>(&::bgs::protocol::account::v1::GameAccountHandle::default_instance());
  report_type_ = const_cast< ::bgs::protocol::report::v1::ReportType*>(&::bgs::protocol::report::v1::ReportType::default_instance());
}

SubmitReportRequest::SubmitReportRequest(const SubmitReportRequest& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:bgs.protocol.report.v1.SubmitReportRequest)
}

void SubmitReportRequest::SharedCtor() {
  _cached_size_ = 0;
  agent_id_ = NULL;
  report_type_ = NULL;
  program_ = 0u;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

SubmitReportRequest::~SubmitReportRequest() {
  // @@protoc_insertion_point(destructor:bgs.protocol.report.v1.SubmitReportRequest)
  SharedDtor();
}

void SubmitReportRequest::SharedDtor() {
  if (this != default_instance_) {
    delete agent_id_;
    delete report_type_;
  }
}

void SubmitReportRequest::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SubmitReportRequest::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return SubmitReportRequest_descriptor_;
}

const SubmitReportRequest& SubmitReportRequest::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_report_5fservice_2eproto();
  return *default_instance_;
}

SubmitReportRequest* SubmitReportRequest::default_instance_ = NULL;

SubmitReportRequest* SubmitReportRequest::New() const {
  return new SubmitReportRequest;
}

void SubmitReportRequest::Swap(SubmitReportRequest* other) {
  if (other != this) {
    GetReflection()->Swap(this, other);}
}

::google::protobuf::Metadata SubmitReportRequest::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = SubmitReportRequest_descriptor_;
  metadata.reflection = SubmitReportRequest_reflection_;
  return metadata;
}

// ===================================================================

ReportService::ReportService(bool use_original_hash) : ServiceBase(use_original_hash ? OriginalHash::value : NameHash::value) {
}

ReportService::~ReportService() {
}

google::protobuf::ServiceDescriptor const* ReportService::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return ReportService_descriptor_;
}

void ReportService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) {
  switch(methodId & 0x3FFFFFFF) {
    case 1:
      ParseAndHandleSendReport(token, methodId, buffer);
      break;
    case 2:
      ParseAndHandleSubmitReport(token, methodId, buffer);
      break;
    default:
      LogInvalidMethod(methodId);
      SendResponse(service_hash_, methodId, token, ERROR_RPC_INVALID_METHOD);
      break;
    }
}

uint32 ReportService::HandleSendReport(::bgs::protocol::report::v1::SendReportRequest const* request, ::bgs::protocol::NoData* /*response*/, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) {
  LogUnimplementedServerMethod("ReportService.SendReport", request);
  return ERROR_RPC_NOT_IMPLEMENTED;
}

uint32 ReportService::HandleSubmitReport(::bgs::protocol::report::v1::SubmitReportRequest const* request, ::bgs::protocol::NoData* /*response*/, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) {
  LogUnimplementedServerMethod("ReportService.SubmitReport", request);
  return ERROR_RPC_NOT_IMPLEMENTED;
}

void ReportService::ParseAndHandleSendReport(uint32 token, uint32 methodId, MessageBuffer& buffer) {
  ::bgs::protocol::report::v1::SendReportRequest request;
  if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) {
    LogFailedParsingRequest("ReportService.SendReport");
    SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST);
    return;
  }
  LogCallServerMethod("ReportService.SendReport", "bgs.protocol.report.v1.SendReportRequest", &request);
  std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = CreateServerContinuation(token, methodId, "ReportService.SendReport", ::bgs::protocol::NoData::descriptor());
  ::bgs::protocol::NoData response;
  uint32 status = HandleSendReport(&request, &response, continuation);
  if (continuation)
    continuation(this, status, &response);
}

void ReportService::ParseAndHandleSubmitReport(uint32 token, uint32 methodId, MessageBuffer& buffer) {
  ::bgs::protocol::report::v1::SubmitReportRequest request;
  if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) {
    LogFailedParsingRequest("ReportService.SubmitReport");
    SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST);
    return;
  }
  LogCallServerMethod("ReportService.SubmitReport", "bgs.protocol.report.v1.SubmitReportRequest", &request);
  std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = CreateServerContinuation(token, methodId, "ReportService.SubmitReport", ::bgs::protocol::NoData::descriptor());
  ::bgs::protocol::NoData response;
  uint32 status = HandleSubmitReport(&request, &response, continuation);
  if (continuation)
    continuation(this, status, &response);
}

// @@protoc_insertion_point(namespace_scope)

}  // namespace v1
}  // namespace report
}  // namespace protocol
}  // namespace bgs

// @@protoc_insertion_point(global_scope)