aboutsummaryrefslogtreecommitdiff
path: root/src/server/proto/Client/resource_service.pb.cc
blob: 12e79aa5567fdf4a4cdc9f79832e93881bb439bf (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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: resource_service.proto

#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "resource_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 resources {
namespace v1 {

namespace {

const ::google::protobuf::Descriptor* ContentHandleRequest_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  ContentHandleRequest_reflection_ = NULL;
const ::google::protobuf::Descriptor* GetTitleIconsRequest_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  GetTitleIconsRequest_reflection_ = NULL;
const ::google::protobuf::Descriptor* GetTitleIconsResponse_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  GetTitleIconsResponse_reflection_ = NULL;
const ::google::protobuf::ServiceDescriptor* ResourcesService_descriptor_ = NULL;

}  // namespace

void protobuf_AssignDesc_resource_5fservice_2eproto() {
  protobuf_AddDesc_resource_5fservice_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "resource_service.proto");
  GOOGLE_CHECK(file != NULL);
  ContentHandleRequest_descriptor_ = file->message_type(0);
  static const int ContentHandleRequest_offsets_[3] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContentHandleRequest, program_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContentHandleRequest, stream_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContentHandleRequest, version_),
  };
  ContentHandleRequest_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      ContentHandleRequest_descriptor_,
      ContentHandleRequest::default_instance_,
      ContentHandleRequest_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContentHandleRequest, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContentHandleRequest, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(ContentHandleRequest));
  GetTitleIconsRequest_descriptor_ = file->message_type(1);
  static const int GetTitleIconsRequest_offsets_[3] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GetTitleIconsRequest, title_ids_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GetTitleIconsRequest, usage_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GetTitleIconsRequest, version_),
  };
  GetTitleIconsRequest_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      GetTitleIconsRequest_descriptor_,
      GetTitleIconsRequest::default_instance_,
      GetTitleIconsRequest_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GetTitleIconsRequest, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GetTitleIconsRequest, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(GetTitleIconsRequest));
  GetTitleIconsResponse_descriptor_ = file->message_type(2);
  static const int GetTitleIconsResponse_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GetTitleIconsResponse, title_icon_content_handles_),
  };
  GetTitleIconsResponse_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      GetTitleIconsResponse_descriptor_,
      GetTitleIconsResponse::default_instance_,
      GetTitleIconsResponse_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GetTitleIconsResponse, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GetTitleIconsResponse, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(GetTitleIconsResponse));
  ResourcesService_descriptor_ = file->service(0);
}

namespace {

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

void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    ContentHandleRequest_descriptor_, &ContentHandleRequest::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    GetTitleIconsRequest_descriptor_, &GetTitleIconsRequest::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    GetTitleIconsResponse_descriptor_, &GetTitleIconsResponse::default_instance());
}

}  // namespace

void protobuf_ShutdownFile_resource_5fservice_2eproto() {
  delete ContentHandleRequest::default_instance_;
  delete ContentHandleRequest_reflection_;
  delete GetTitleIconsRequest::default_instance_;
  delete GetTitleIconsRequest_reflection_;
  delete GetTitleIconsResponse::default_instance_;
  delete GetTitleIconsResponse_reflection_;
}

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

  ::bgs::protocol::protobuf_AddDesc_content_5fhandle_5ftypes_2eproto();
  ::bgs::protocol::protobuf_AddDesc_rpc_5ftypes_2eproto();
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n\026resource_service.proto\022\031bgs.protocol.r"
    "esources.v1\032\032content_handle_types.proto\032"
    "\017rpc_types.proto\"\\\n\024ContentHandleRequest"
    "\022\017\n\007program\030\001 \002(\007\022\016\n\006stream\030\002 \002(\007\022\033\n\007ver"
    "sion\030\003 \001(\007:\n1701729619:\006\202\371+\002\020\001\"M\n\024GetTit"
    "leIconsRequest\022\025\n\ttitle_ids\030\001 \003(\rB\002\020\001\022\r\n"
    "\005usage\030\002 \001(\r\022\017\n\007version\030\003 \001(\r\"a\n\025GetTitl"
    "eIconsResponse\022H\n\032title_icon_content_han"
    "dles\030\001 \003(\0132$.bgs.protocol.TitleIconConte"
    "ntHandle2\262\002\n\020ResourcesService\022h\n\020GetCont"
    "entHandle\022/.bgs.protocol.resources.v1.Co"
    "ntentHandleRequest\032\033.bgs.protocol.Conten"
    "tHandle\"\006\202\371+\002\010\001\022z\n\rGetTitleIcons\022/.bgs.p"
    "rotocol.resources.v1.GetTitleIconsReques"
    "t\0320.bgs.protocol.resources.v1.GetTitleIc"
    "onsResponse\"\006\202\371+\002\010\002\0328\202\371+.\n!bnet.protocol"
    ".resources.Resources*\tresources\212\371+\002\020\001B\005H"
    "\002\200\001\000", 684);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "resource_service.proto", &protobuf_RegisterTypes);
  ContentHandleRequest::default_instance_ = new ContentHandleRequest();
  GetTitleIconsRequest::default_instance_ = new GetTitleIconsRequest();
  GetTitleIconsResponse::default_instance_ = new GetTitleIconsResponse();
  ContentHandleRequest::default_instance_->InitAsDefaultInstance();
  GetTitleIconsRequest::default_instance_->InitAsDefaultInstance();
  GetTitleIconsResponse::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_resource_5fservice_2eproto);
}

// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_resource_5fservice_2eproto {
  StaticDescriptorInitializer_resource_5fservice_2eproto() {
    protobuf_AddDesc_resource_5fservice_2eproto();
  }
} static_descriptor_initializer_resource_5fservice_2eproto_;
// ===================================================================

#ifndef _MSC_VER
const int ContentHandleRequest::kProgramFieldNumber;
const int ContentHandleRequest::kStreamFieldNumber;
const int ContentHandleRequest::kVersionFieldNumber;
#endif  // !_MSC_VER

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

void ContentHandleRequest::InitAsDefaultInstance() {
}

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

void ContentHandleRequest::SharedCtor() {
  _cached_size_ = 0;
  program_ = 0u;
  stream_ = 0u;
  version_ = 1701729619u;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

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

void ContentHandleRequest::SharedDtor() {
  if (this != default_instance_) {
  }
}

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

const ContentHandleRequest& ContentHandleRequest::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_resource_5fservice_2eproto();
  return *default_instance_;
}

ContentHandleRequest* ContentHandleRequest::default_instance_ = NULL;

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

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

::google::protobuf::Metadata ContentHandleRequest::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = ContentHandleRequest_descriptor_;
  metadata.reflection = ContentHandleRequest_reflection_;
  return metadata;
}

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

#ifndef _MSC_VER
const int GetTitleIconsRequest::kTitleIdsFieldNumber;
const int GetTitleIconsRequest::kUsageFieldNumber;
const int GetTitleIconsRequest::kVersionFieldNumber;
#endif  // !_MSC_VER

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

void GetTitleIconsRequest::InitAsDefaultInstance() {
}

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

void GetTitleIconsRequest::SharedCtor() {
  _cached_size_ = 0;
  usage_ = 0u;
  version_ = 0u;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

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

void GetTitleIconsRequest::SharedDtor() {
  if (this != default_instance_) {
  }
}

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

const GetTitleIconsRequest& GetTitleIconsRequest::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_resource_5fservice_2eproto();
  return *default_instance_;
}

GetTitleIconsRequest* GetTitleIconsRequest::default_instance_ = NULL;

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

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

::google::protobuf::Metadata GetTitleIconsRequest::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = GetTitleIconsRequest_descriptor_;
  metadata.reflection = GetTitleIconsRequest_reflection_;
  return metadata;
}

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

#ifndef _MSC_VER
const int GetTitleIconsResponse::kTitleIconContentHandlesFieldNumber;
#endif  // !_MSC_VER

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

void GetTitleIconsResponse::InitAsDefaultInstance() {
}

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

void GetTitleIconsResponse::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

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

void GetTitleIconsResponse::SharedDtor() {
  if (this != default_instance_) {
  }
}

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

const GetTitleIconsResponse& GetTitleIconsResponse::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_resource_5fservice_2eproto();
  return *default_instance_;
}

GetTitleIconsResponse* GetTitleIconsResponse::default_instance_ = NULL;

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

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

::google::protobuf::Metadata GetTitleIconsResponse::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = GetTitleIconsResponse_descriptor_;
  metadata.reflection = GetTitleIconsResponse_reflection_;
  return metadata;
}

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

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

ResourcesService::~ResourcesService() {
}

google::protobuf::ServiceDescriptor const* ResourcesService::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return ResourcesService_descriptor_;
}

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

uint32 ResourcesService::HandleGetContentHandle(::bgs::protocol::resources::v1::ContentHandleRequest const* request, ::bgs::protocol::ContentHandle* /*response*/, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) {
  LogUnimplementedServerMethod("ResourcesService.GetContentHandle", request);
  return ERROR_RPC_NOT_IMPLEMENTED;
}

uint32 ResourcesService::HandleGetTitleIcons(::bgs::protocol::resources::v1::GetTitleIconsRequest const* request, ::bgs::protocol::resources::v1::GetTitleIconsResponse* /*response*/, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) {
  LogUnimplementedServerMethod("ResourcesService.GetTitleIcons", request);
  return ERROR_RPC_NOT_IMPLEMENTED;
}

void ResourcesService::ParseAndHandleGetContentHandle(uint32 token, uint32 methodId, MessageBuffer& buffer) {
  ::bgs::protocol::resources::v1::ContentHandleRequest request;
  if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) {
    LogFailedParsingRequest("ResourcesService.GetContentHandle");
    SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST);
    return;
  }
  LogCallServerMethod("ResourcesService.GetContentHandle", "bgs.protocol.resources.v1.ContentHandleRequest", &request);
  std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = CreateServerContinuation(token, methodId, "ResourcesService.GetContentHandle", ::bgs::protocol::ContentHandle::descriptor());
  ::bgs::protocol::ContentHandle response;
  uint32 status = HandleGetContentHandle(&request, &response, continuation);
  if (continuation)
    continuation(this, status, &response);
}

void ResourcesService::ParseAndHandleGetTitleIcons(uint32 token, uint32 methodId, MessageBuffer& buffer) {
  ::bgs::protocol::resources::v1::GetTitleIconsRequest request;
  if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) {
    LogFailedParsingRequest("ResourcesService.GetTitleIcons");
    SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST);
    return;
  }
  LogCallServerMethod("ResourcesService.GetTitleIcons", "bgs.protocol.resources.v1.GetTitleIconsRequest", &request);
  std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = CreateServerContinuation(token, methodId, "ResourcesService.GetTitleIcons", ::bgs::protocol::resources::v1::GetTitleIconsResponse::descriptor());
  ::bgs::protocol::resources::v1::GetTitleIconsResponse response;
  uint32 status = HandleGetTitleIcons(&request, &response, continuation);
  if (continuation)
    continuation(this, status, &response);
}

// @@protoc_insertion_point(namespace_scope)

}  // namespace v1
}  // namespace resources
}  // namespace protocol
}  // namespace bgs

// @@protoc_insertion_point(global_scope)