mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Proto: Added messages and services missing descriptors in client
This commit is contained in:
@@ -0,0 +1,216 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: api/client/v2/notification_listener.proto
|
||||
|
||||
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
|
||||
#include "api/client/v2/notification_listener.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 notification {
|
||||
namespace v2 {
|
||||
namespace client {
|
||||
|
||||
namespace {
|
||||
|
||||
const ::google::protobuf::Descriptor* NotificationReceivedNotification_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
NotificationReceivedNotification_reflection_ = NULL;
|
||||
const ::google::protobuf::ServiceDescriptor* NotificationListener_descriptor_ = NULL;
|
||||
|
||||
} // namespace
|
||||
|
||||
void protobuf_AssignDesc_api_2fclient_2fv2_2fnotification_5flistener_2eproto() {
|
||||
protobuf_AddDesc_api_2fclient_2fv2_2fnotification_5flistener_2eproto();
|
||||
const ::google::protobuf::FileDescriptor* file =
|
||||
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
|
||||
"api/client/v2/notification_listener.proto");
|
||||
GOOGLE_CHECK(file != NULL);
|
||||
NotificationReceivedNotification_descriptor_ = file->message_type(0);
|
||||
static const int NotificationReceivedNotification_offsets_[1] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NotificationReceivedNotification, notifications_),
|
||||
};
|
||||
NotificationReceivedNotification_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
NotificationReceivedNotification_descriptor_,
|
||||
NotificationReceivedNotification::default_instance_,
|
||||
NotificationReceivedNotification_offsets_,
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NotificationReceivedNotification, _has_bits_[0]),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NotificationReceivedNotification, _unknown_fields_),
|
||||
-1,
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(NotificationReceivedNotification));
|
||||
NotificationListener_descriptor_ = file->service(0);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
|
||||
inline void protobuf_AssignDescriptorsOnce() {
|
||||
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
|
||||
&protobuf_AssignDesc_api_2fclient_2fv2_2fnotification_5flistener_2eproto);
|
||||
}
|
||||
|
||||
void protobuf_RegisterTypes(const ::std::string&) {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
NotificationReceivedNotification_descriptor_, &NotificationReceivedNotification::default_instance());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void protobuf_ShutdownFile_api_2fclient_2fv2_2fnotification_5flistener_2eproto() {
|
||||
delete NotificationReceivedNotification::default_instance_;
|
||||
delete NotificationReceivedNotification_reflection_;
|
||||
}
|
||||
|
||||
void protobuf_AddDesc_api_2fclient_2fv2_2fnotification_5flistener_2eproto() {
|
||||
static bool already_here = false;
|
||||
if (already_here) return;
|
||||
already_here = true;
|
||||
GOOGLE_PROTOBUF_VERIFY_VERSION;
|
||||
|
||||
::bgs::protocol::protobuf_AddDesc_rpc_5ftypes_2eproto();
|
||||
::bgs::protocol::notification::v2::client::protobuf_AddDesc_api_2fclient_2fv2_2fnotification_5ftypes_2eproto();
|
||||
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
|
||||
"\n)api/client/v2/notification_listener.pr"
|
||||
"oto\022#bgs.protocol.notification.v2.client"
|
||||
"\032\017rpc_types.proto\032&api/client/v2/notific"
|
||||
"ation_types.proto\"l\n NotificationReceive"
|
||||
"dNotification\022H\n\rnotifications\030\001 \003(\01321.b"
|
||||
"gs.protocol.notification.v2.client.Notif"
|
||||
"ication2\346\001\n\024NotificationListener\022\202\001\n\026OnN"
|
||||
"otificationReceived\022E.bgs.protocol.notif"
|
||||
"ication.v2.client.NotificationReceivedNo"
|
||||
"tification\032\031.bgs.protocol.NO_RESPONSE\"\006\202"
|
||||
"\371+\002\010\001\032I\202\371+=\n9bnet.protocol.notification."
|
||||
"v2.client.NotificationListener8\001\212\371+\004\010\001\030\001"
|
||||
"B\005H\002\200\001\000", 487);
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
|
||||
"api/client/v2/notification_listener.proto", &protobuf_RegisterTypes);
|
||||
NotificationReceivedNotification::default_instance_ = new NotificationReceivedNotification();
|
||||
NotificationReceivedNotification::default_instance_->InitAsDefaultInstance();
|
||||
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_api_2fclient_2fv2_2fnotification_5flistener_2eproto);
|
||||
}
|
||||
|
||||
// Force AddDescriptors() to be called at static initialization time.
|
||||
struct StaticDescriptorInitializer_api_2fclient_2fv2_2fnotification_5flistener_2eproto {
|
||||
StaticDescriptorInitializer_api_2fclient_2fv2_2fnotification_5flistener_2eproto() {
|
||||
protobuf_AddDesc_api_2fclient_2fv2_2fnotification_5flistener_2eproto();
|
||||
}
|
||||
} static_descriptor_initializer_api_2fclient_2fv2_2fnotification_5flistener_2eproto_;
|
||||
// ===================================================================
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const int NotificationReceivedNotification::kNotificationsFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
NotificationReceivedNotification::NotificationReceivedNotification()
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
// @@protoc_insertion_point(constructor:bgs.protocol.notification.v2.client.NotificationReceivedNotification)
|
||||
}
|
||||
|
||||
void NotificationReceivedNotification::InitAsDefaultInstance() {
|
||||
}
|
||||
|
||||
NotificationReceivedNotification::NotificationReceivedNotification(const NotificationReceivedNotification& from)
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
MergeFrom(from);
|
||||
// @@protoc_insertion_point(copy_constructor:bgs.protocol.notification.v2.client.NotificationReceivedNotification)
|
||||
}
|
||||
|
||||
void NotificationReceivedNotification::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
NotificationReceivedNotification::~NotificationReceivedNotification() {
|
||||
// @@protoc_insertion_point(destructor:bgs.protocol.notification.v2.client.NotificationReceivedNotification)
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
void NotificationReceivedNotification::SharedDtor() {
|
||||
if (this != default_instance_) {
|
||||
}
|
||||
}
|
||||
|
||||
void NotificationReceivedNotification::SetCachedSize(int size) const {
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
}
|
||||
const ::google::protobuf::Descriptor* NotificationReceivedNotification::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return NotificationReceivedNotification_descriptor_;
|
||||
}
|
||||
|
||||
const NotificationReceivedNotification& NotificationReceivedNotification::default_instance() {
|
||||
if (default_instance_ == NULL) protobuf_AddDesc_api_2fclient_2fv2_2fnotification_5flistener_2eproto();
|
||||
return *default_instance_;
|
||||
}
|
||||
|
||||
NotificationReceivedNotification* NotificationReceivedNotification::default_instance_ = NULL;
|
||||
|
||||
NotificationReceivedNotification* NotificationReceivedNotification::New() const {
|
||||
return new NotificationReceivedNotification;
|
||||
}
|
||||
|
||||
void NotificationReceivedNotification::Swap(NotificationReceivedNotification* other) {
|
||||
if (other != this) {
|
||||
GetReflection()->Swap(this, other);}
|
||||
}
|
||||
|
||||
::google::protobuf::Metadata NotificationReceivedNotification::GetMetadata() const {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::Metadata metadata;
|
||||
metadata.descriptor = NotificationReceivedNotification_descriptor_;
|
||||
metadata.reflection = NotificationReceivedNotification_reflection_;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
NotificationListener::NotificationListener(bool use_original_hash) : ServiceBase(use_original_hash ? OriginalHash::value : NameHash::value) {
|
||||
}
|
||||
|
||||
NotificationListener::~NotificationListener() {
|
||||
}
|
||||
|
||||
google::protobuf::ServiceDescriptor const* NotificationListener::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return NotificationListener_descriptor_;
|
||||
}
|
||||
|
||||
void NotificationListener::OnNotificationReceived(::bgs::protocol::notification::v2::client::NotificationReceivedNotification const* request, bool client /*= false*/, bool server /*= false*/) {
|
||||
LogCallClientMethod("NotificationListener.OnNotificationReceived", "bgs.protocol.notification.v2.client.NotificationReceivedNotification", request);
|
||||
SendRequest(service_hash_, 1 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request);
|
||||
}
|
||||
|
||||
void NotificationListener::CallServerMethod(uint32 /*token*/, uint32 methodId, MessageBuffer /*buffer*/) {
|
||||
LogDisallowedMethod(methodId);
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
} // namespace client
|
||||
} // namespace v2
|
||||
} // namespace notification
|
||||
} // namespace protocol
|
||||
} // namespace bgs
|
||||
|
||||
// @@protoc_insertion_point(global_scope)
|
||||
194
src/server/proto/Client/api/client/v2/notification_listener.pb.h
Normal file
194
src/server/proto/Client/api/client/v2/notification_listener.pb.h
Normal file
@@ -0,0 +1,194 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: api/client/v2/notification_listener.proto
|
||||
|
||||
#ifndef PROTOBUF_api_2fclient_2fv2_2fnotification_5flistener_2eproto__INCLUDED
|
||||
#define PROTOBUF_api_2fclient_2fv2_2fnotification_5flistener_2eproto__INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/stubs/common.h>
|
||||
|
||||
#if GOOGLE_PROTOBUF_VERSION < 2006000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
#endif
|
||||
|
||||
#include <google/protobuf/generated_message_util.h>
|
||||
#include <google/protobuf/message.h>
|
||||
#include <google/protobuf/repeated_field.h>
|
||||
#include <google/protobuf/extension_set.h>
|
||||
#include <google/protobuf/unknown_field_set.h>
|
||||
#include "rpc_types.pb.h"
|
||||
#include "api/client/v2/notification_types.pb.h"
|
||||
#include "ServiceBase.h"
|
||||
#include "MessageBuffer.h"
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
// @@protoc_insertion_point(includes)
|
||||
|
||||
namespace bgs {
|
||||
namespace protocol {
|
||||
namespace notification {
|
||||
namespace v2 {
|
||||
namespace client {
|
||||
|
||||
// Internal implementation detail -- do not call these.
|
||||
void TC_PROTO_API protobuf_AddDesc_api_2fclient_2fv2_2fnotification_5flistener_2eproto();
|
||||
void protobuf_AssignDesc_api_2fclient_2fv2_2fnotification_5flistener_2eproto();
|
||||
void protobuf_ShutdownFile_api_2fclient_2fv2_2fnotification_5flistener_2eproto();
|
||||
|
||||
class NotificationReceivedNotification;
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class TC_PROTO_API NotificationReceivedNotification : public ::google::protobuf::Message {
|
||||
public:
|
||||
NotificationReceivedNotification();
|
||||
virtual ~NotificationReceivedNotification();
|
||||
|
||||
NotificationReceivedNotification(const NotificationReceivedNotification& from);
|
||||
|
||||
inline NotificationReceivedNotification& operator=(const NotificationReceivedNotification& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const NotificationReceivedNotification& default_instance();
|
||||
|
||||
void Swap(NotificationReceivedNotification* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
NotificationReceivedNotification* New() const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// repeated .bgs.protocol.notification.v2.client.Notification notifications = 1;
|
||||
inline int notifications_size() const;
|
||||
inline void clear_notifications();
|
||||
static const int kNotificationsFieldNumber = 1;
|
||||
inline const ::bgs::protocol::notification::v2::client::Notification& notifications(int index) const;
|
||||
inline ::bgs::protocol::notification::v2::client::Notification* mutable_notifications(int index);
|
||||
inline ::bgs::protocol::notification::v2::client::Notification* add_notifications();
|
||||
inline const ::google::protobuf::RepeatedPtrField< ::bgs::protocol::notification::v2::client::Notification >&
|
||||
notifications() const;
|
||||
inline ::google::protobuf::RepeatedPtrField< ::bgs::protocol::notification::v2::client::Notification >*
|
||||
mutable_notifications();
|
||||
|
||||
// @@protoc_insertion_point(class_scope:bgs.protocol.notification.v2.client.NotificationReceivedNotification)
|
||||
private:
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::google::protobuf::uint32 _has_bits_[1];
|
||||
mutable int _cached_size_;
|
||||
::google::protobuf::RepeatedPtrField< ::bgs::protocol::notification::v2::client::Notification > notifications_;
|
||||
friend void TC_PROTO_API protobuf_AddDesc_api_2fclient_2fv2_2fnotification_5flistener_2eproto();
|
||||
friend void protobuf_AssignDesc_api_2fclient_2fv2_2fnotification_5flistener_2eproto();
|
||||
friend void protobuf_ShutdownFile_api_2fclient_2fv2_2fnotification_5flistener_2eproto();
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static NotificationReceivedNotification* default_instance_;
|
||||
};
|
||||
// ===================================================================
|
||||
|
||||
class TC_PROTO_API NotificationListener : public ServiceBase
|
||||
{
|
||||
public:
|
||||
|
||||
explicit NotificationListener(bool use_original_hash);
|
||||
NotificationListener(NotificationListener const&) = delete;
|
||||
NotificationListener(NotificationListener&&) = delete;
|
||||
NotificationListener& operator=(NotificationListener const&) = delete;
|
||||
NotificationListener& operator=(NotificationListener&&) = delete;
|
||||
virtual ~NotificationListener();
|
||||
|
||||
typedef std::integral_constant<uint32, 0x2362BECDu> OriginalHash;
|
||||
typedef std::integral_constant<uint32, 0xF98DCEBCu> NameHash;
|
||||
|
||||
static google::protobuf::ServiceDescriptor const* descriptor();
|
||||
|
||||
// client methods --------------------------------------------------
|
||||
void OnNotificationReceived(::bgs::protocol::notification::v2::client::NotificationReceivedNotification const* request, bool client = false, bool server = false);
|
||||
|
||||
void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final;
|
||||
};
|
||||
|
||||
// ===================================================================
|
||||
|
||||
// ===================================================================
|
||||
|
||||
// NotificationReceivedNotification
|
||||
|
||||
// repeated .bgs.protocol.notification.v2.client.Notification notifications = 1;
|
||||
inline int NotificationReceivedNotification::notifications_size() const {
|
||||
return notifications_.size();
|
||||
}
|
||||
inline void NotificationReceivedNotification::clear_notifications() {
|
||||
notifications_.Clear();
|
||||
}
|
||||
inline const ::bgs::protocol::notification::v2::client::Notification& NotificationReceivedNotification::notifications(int index) const {
|
||||
// @@protoc_insertion_point(field_get:bgs.protocol.notification.v2.client.NotificationReceivedNotification.notifications)
|
||||
return notifications_.Get(index);
|
||||
}
|
||||
inline ::bgs::protocol::notification::v2::client::Notification* NotificationReceivedNotification::mutable_notifications(int index) {
|
||||
// @@protoc_insertion_point(field_mutable:bgs.protocol.notification.v2.client.NotificationReceivedNotification.notifications)
|
||||
return notifications_.Mutable(index);
|
||||
}
|
||||
inline ::bgs::protocol::notification::v2::client::Notification* NotificationReceivedNotification::add_notifications() {
|
||||
// @@protoc_insertion_point(field_add:bgs.protocol.notification.v2.client.NotificationReceivedNotification.notifications)
|
||||
return notifications_.Add();
|
||||
}
|
||||
inline const ::google::protobuf::RepeatedPtrField< ::bgs::protocol::notification::v2::client::Notification >&
|
||||
NotificationReceivedNotification::notifications() const {
|
||||
// @@protoc_insertion_point(field_list:bgs.protocol.notification.v2.client.NotificationReceivedNotification.notifications)
|
||||
return notifications_;
|
||||
}
|
||||
inline ::google::protobuf::RepeatedPtrField< ::bgs::protocol::notification::v2::client::Notification >*
|
||||
NotificationReceivedNotification::mutable_notifications() {
|
||||
// @@protoc_insertion_point(field_mutable_list:bgs.protocol.notification.v2.client.NotificationReceivedNotification.notifications)
|
||||
return ¬ifications_;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
} // namespace client
|
||||
} // namespace v2
|
||||
} // namespace notification
|
||||
} // namespace protocol
|
||||
} // namespace bgs
|
||||
|
||||
#ifndef SWIG
|
||||
namespace google {
|
||||
namespace protobuf {
|
||||
} // namespace google
|
||||
} // namespace protobuf
|
||||
#endif // SWIG
|
||||
|
||||
// @@protoc_insertion_point(global_scope)
|
||||
|
||||
#endif // PROTOBUF_api_2fclient_2fv2_2fnotification_5flistener_2eproto__INCLUDED
|
||||
@@ -0,0 +1,30 @@
|
||||
syntax = "proto2";
|
||||
|
||||
import "rpc_types.proto";
|
||||
import "api/client/v2/notification_types.proto";
|
||||
package bgs.protocol.notification.v2.client;
|
||||
|
||||
option optimize_for = CODE_SIZE;
|
||||
option cc_generic_services = false;
|
||||
|
||||
message NotificationReceivedNotification {
|
||||
repeated .bgs.protocol.notification.v2.client.Notification notifications = 1;
|
||||
}
|
||||
|
||||
service NotificationListener {
|
||||
option (.bgs.protocol.service_options) = {
|
||||
descriptor_name: "bnet.protocol.notification.v2.client.NotificationListener"
|
||||
type: SERVICE_TYPE_RPC_DIRECT
|
||||
};
|
||||
option (.bgs.protocol.sdk_service_options) = {
|
||||
inbound: true
|
||||
use_client_id: true
|
||||
};
|
||||
rpc OnNotificationReceived(.bgs.protocol.notification.v2.client.NotificationReceivedNotification) returns (.bgs.protocol.NO_RESPONSE) {
|
||||
option (.bgs.protocol.method_options) = {
|
||||
id: 1
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
548
src/server/proto/Client/notification_service.pb.cc
Normal file
548
src/server/proto/Client/notification_service.pb.cc
Normal file
@@ -0,0 +1,548 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: notification_service.proto
|
||||
|
||||
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
|
||||
#include "notification_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 notification {
|
||||
namespace v1 {
|
||||
|
||||
namespace {
|
||||
|
||||
const ::google::protobuf::Descriptor* SubscribeRequest_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
SubscribeRequest_reflection_ = NULL;
|
||||
const ::google::protobuf::Descriptor* UnsubscribeRequest_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
UnsubscribeRequest_reflection_ = NULL;
|
||||
const ::google::protobuf::Descriptor* PublishRequest_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
PublishRequest_reflection_ = NULL;
|
||||
const ::google::protobuf::ServiceDescriptor* NotificationService_descriptor_ = NULL;
|
||||
const ::google::protobuf::ServiceDescriptor* NotificationListener_descriptor_ = NULL;
|
||||
|
||||
} // namespace
|
||||
|
||||
void protobuf_AssignDesc_notification_5fservice_2eproto() {
|
||||
protobuf_AddDesc_notification_5fservice_2eproto();
|
||||
const ::google::protobuf::FileDescriptor* file =
|
||||
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
|
||||
"notification_service.proto");
|
||||
GOOGLE_CHECK(file != NULL);
|
||||
SubscribeRequest_descriptor_ = file->message_type(0);
|
||||
static const int SubscribeRequest_offsets_[1] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SubscribeRequest, subscription_),
|
||||
};
|
||||
SubscribeRequest_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
SubscribeRequest_descriptor_,
|
||||
SubscribeRequest::default_instance_,
|
||||
SubscribeRequest_offsets_,
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SubscribeRequest, _has_bits_[0]),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SubscribeRequest, _unknown_fields_),
|
||||
-1,
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(SubscribeRequest));
|
||||
UnsubscribeRequest_descriptor_ = file->message_type(1);
|
||||
static const int UnsubscribeRequest_offsets_[1] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UnsubscribeRequest, subscription_),
|
||||
};
|
||||
UnsubscribeRequest_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
UnsubscribeRequest_descriptor_,
|
||||
UnsubscribeRequest::default_instance_,
|
||||
UnsubscribeRequest_offsets_,
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UnsubscribeRequest, _has_bits_[0]),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UnsubscribeRequest, _unknown_fields_),
|
||||
-1,
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(UnsubscribeRequest));
|
||||
PublishRequest_descriptor_ = file->message_type(2);
|
||||
static const int PublishRequest_offsets_[2] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PublishRequest, target_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PublishRequest, notification_),
|
||||
};
|
||||
PublishRequest_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
PublishRequest_descriptor_,
|
||||
PublishRequest::default_instance_,
|
||||
PublishRequest_offsets_,
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PublishRequest, _has_bits_[0]),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PublishRequest, _unknown_fields_),
|
||||
-1,
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(PublishRequest));
|
||||
NotificationService_descriptor_ = file->service(0);
|
||||
NotificationListener_descriptor_ = file->service(1);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
|
||||
inline void protobuf_AssignDescriptorsOnce() {
|
||||
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
|
||||
&protobuf_AssignDesc_notification_5fservice_2eproto);
|
||||
}
|
||||
|
||||
void protobuf_RegisterTypes(const ::std::string&) {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
SubscribeRequest_descriptor_, &SubscribeRequest::default_instance());
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
UnsubscribeRequest_descriptor_, &UnsubscribeRequest::default_instance());
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
PublishRequest_descriptor_, &PublishRequest::default_instance());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void protobuf_ShutdownFile_notification_5fservice_2eproto() {
|
||||
delete SubscribeRequest::default_instance_;
|
||||
delete SubscribeRequest_reflection_;
|
||||
delete UnsubscribeRequest::default_instance_;
|
||||
delete UnsubscribeRequest_reflection_;
|
||||
delete PublishRequest::default_instance_;
|
||||
delete PublishRequest_reflection_;
|
||||
}
|
||||
|
||||
void protobuf_AddDesc_notification_5fservice_2eproto() {
|
||||
static bool already_here = false;
|
||||
if (already_here) return;
|
||||
already_here = true;
|
||||
GOOGLE_PROTOBUF_VERIFY_VERSION;
|
||||
|
||||
::bgs::protocol::protobuf_AddDesc_rpc_5ftypes_2eproto();
|
||||
::bgs::protocol::notification::v1::protobuf_AddDesc_notification_5ftypes_2eproto();
|
||||
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
|
||||
"\n\032notification_service.proto\022\034bgs.protoc"
|
||||
"ol.notification.v1\032\017rpc_types.proto\032\030not"
|
||||
"ification_types.proto\"T\n\020SubscribeReques"
|
||||
"t\022@\n\014subscription\030\001 \001(\0132*.bgs.protocol.n"
|
||||
"otification.v1.Subscription\"V\n\022Unsubscri"
|
||||
"beRequest\022@\n\014subscription\030\001 \001(\0132*.bgs.pr"
|
||||
"otocol.notification.v1.Subscription\"\210\001\n\016"
|
||||
"PublishRequest\0224\n\006target\030\001 \001(\0132$.bgs.pro"
|
||||
"tocol.notification.v1.Target\022@\n\014notifica"
|
||||
"tion\030\002 \001(\0132*.bgs.protocol.notification.v"
|
||||
"1.Notification2\300\003\n\023NotificationService\022\\"
|
||||
"\n\020SendNotification\022*.bgs.protocol.notifi"
|
||||
"cation.v1.Notification\032\024.bgs.protocol.No"
|
||||
"Data\"\006\202\371+\002\010\001\022Y\n\tSubscribe\022..bgs.protocol"
|
||||
".notification.v1.SubscribeRequest\032\024.bgs."
|
||||
"protocol.NoData\"\006\202\371+\002\010\006\022]\n\013Unsubscribe\0220"
|
||||
".bgs.protocol.notification.v1.Unsubscrib"
|
||||
"eRequest\032\024.bgs.protocol.NoData\"\006\202\371+\002\010\007\022U"
|
||||
"\n\007Publish\022,.bgs.protocol.notification.v1"
|
||||
".PublishRequest\032\024.bgs.protocol.NoData\"\006\202"
|
||||
"\371+\002\010\010\032:\202\371+0\n.bnet.protocol.notification."
|
||||
"NotificationService\212\371+\002\020\0012\274\001\n\024Notificati"
|
||||
"onListener\022g\n\026OnNotificationReceived\022*.b"
|
||||
"gs.protocol.notification.v1.Notification"
|
||||
"\032\031.bgs.protocol.NO_RESPONSE\"\006\202\371+\002\010\001\032;\202\371+"
|
||||
"1\n/bnet.protocol.notification.Notificati"
|
||||
"onListener\212\371+\002\010\001B\005H\002\200\001\000", 1063);
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
|
||||
"notification_service.proto", &protobuf_RegisterTypes);
|
||||
SubscribeRequest::default_instance_ = new SubscribeRequest();
|
||||
UnsubscribeRequest::default_instance_ = new UnsubscribeRequest();
|
||||
PublishRequest::default_instance_ = new PublishRequest();
|
||||
SubscribeRequest::default_instance_->InitAsDefaultInstance();
|
||||
UnsubscribeRequest::default_instance_->InitAsDefaultInstance();
|
||||
PublishRequest::default_instance_->InitAsDefaultInstance();
|
||||
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_notification_5fservice_2eproto);
|
||||
}
|
||||
|
||||
// Force AddDescriptors() to be called at static initialization time.
|
||||
struct StaticDescriptorInitializer_notification_5fservice_2eproto {
|
||||
StaticDescriptorInitializer_notification_5fservice_2eproto() {
|
||||
protobuf_AddDesc_notification_5fservice_2eproto();
|
||||
}
|
||||
} static_descriptor_initializer_notification_5fservice_2eproto_;
|
||||
// ===================================================================
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const int SubscribeRequest::kSubscriptionFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
SubscribeRequest::SubscribeRequest()
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
// @@protoc_insertion_point(constructor:bgs.protocol.notification.v1.SubscribeRequest)
|
||||
}
|
||||
|
||||
void SubscribeRequest::InitAsDefaultInstance() {
|
||||
subscription_ = const_cast< ::bgs::protocol::notification::v1::Subscription*>(&::bgs::protocol::notification::v1::Subscription::default_instance());
|
||||
}
|
||||
|
||||
SubscribeRequest::SubscribeRequest(const SubscribeRequest& from)
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
MergeFrom(from);
|
||||
// @@protoc_insertion_point(copy_constructor:bgs.protocol.notification.v1.SubscribeRequest)
|
||||
}
|
||||
|
||||
void SubscribeRequest::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
subscription_ = NULL;
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
SubscribeRequest::~SubscribeRequest() {
|
||||
// @@protoc_insertion_point(destructor:bgs.protocol.notification.v1.SubscribeRequest)
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
void SubscribeRequest::SharedDtor() {
|
||||
if (this != default_instance_) {
|
||||
delete subscription_;
|
||||
}
|
||||
}
|
||||
|
||||
void SubscribeRequest::SetCachedSize(int size) const {
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
}
|
||||
const ::google::protobuf::Descriptor* SubscribeRequest::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return SubscribeRequest_descriptor_;
|
||||
}
|
||||
|
||||
const SubscribeRequest& SubscribeRequest::default_instance() {
|
||||
if (default_instance_ == NULL) protobuf_AddDesc_notification_5fservice_2eproto();
|
||||
return *default_instance_;
|
||||
}
|
||||
|
||||
SubscribeRequest* SubscribeRequest::default_instance_ = NULL;
|
||||
|
||||
SubscribeRequest* SubscribeRequest::New() const {
|
||||
return new SubscribeRequest;
|
||||
}
|
||||
|
||||
void SubscribeRequest::Swap(SubscribeRequest* other) {
|
||||
if (other != this) {
|
||||
GetReflection()->Swap(this, other);}
|
||||
}
|
||||
|
||||
::google::protobuf::Metadata SubscribeRequest::GetMetadata() const {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::Metadata metadata;
|
||||
metadata.descriptor = SubscribeRequest_descriptor_;
|
||||
metadata.reflection = SubscribeRequest_reflection_;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const int UnsubscribeRequest::kSubscriptionFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
UnsubscribeRequest::UnsubscribeRequest()
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
// @@protoc_insertion_point(constructor:bgs.protocol.notification.v1.UnsubscribeRequest)
|
||||
}
|
||||
|
||||
void UnsubscribeRequest::InitAsDefaultInstance() {
|
||||
subscription_ = const_cast< ::bgs::protocol::notification::v1::Subscription*>(&::bgs::protocol::notification::v1::Subscription::default_instance());
|
||||
}
|
||||
|
||||
UnsubscribeRequest::UnsubscribeRequest(const UnsubscribeRequest& from)
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
MergeFrom(from);
|
||||
// @@protoc_insertion_point(copy_constructor:bgs.protocol.notification.v1.UnsubscribeRequest)
|
||||
}
|
||||
|
||||
void UnsubscribeRequest::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
subscription_ = NULL;
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
UnsubscribeRequest::~UnsubscribeRequest() {
|
||||
// @@protoc_insertion_point(destructor:bgs.protocol.notification.v1.UnsubscribeRequest)
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
void UnsubscribeRequest::SharedDtor() {
|
||||
if (this != default_instance_) {
|
||||
delete subscription_;
|
||||
}
|
||||
}
|
||||
|
||||
void UnsubscribeRequest::SetCachedSize(int size) const {
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
}
|
||||
const ::google::protobuf::Descriptor* UnsubscribeRequest::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return UnsubscribeRequest_descriptor_;
|
||||
}
|
||||
|
||||
const UnsubscribeRequest& UnsubscribeRequest::default_instance() {
|
||||
if (default_instance_ == NULL) protobuf_AddDesc_notification_5fservice_2eproto();
|
||||
return *default_instance_;
|
||||
}
|
||||
|
||||
UnsubscribeRequest* UnsubscribeRequest::default_instance_ = NULL;
|
||||
|
||||
UnsubscribeRequest* UnsubscribeRequest::New() const {
|
||||
return new UnsubscribeRequest;
|
||||
}
|
||||
|
||||
void UnsubscribeRequest::Swap(UnsubscribeRequest* other) {
|
||||
if (other != this) {
|
||||
GetReflection()->Swap(this, other);}
|
||||
}
|
||||
|
||||
::google::protobuf::Metadata UnsubscribeRequest::GetMetadata() const {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::Metadata metadata;
|
||||
metadata.descriptor = UnsubscribeRequest_descriptor_;
|
||||
metadata.reflection = UnsubscribeRequest_reflection_;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const int PublishRequest::kTargetFieldNumber;
|
||||
const int PublishRequest::kNotificationFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
PublishRequest::PublishRequest()
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
// @@protoc_insertion_point(constructor:bgs.protocol.notification.v1.PublishRequest)
|
||||
}
|
||||
|
||||
void PublishRequest::InitAsDefaultInstance() {
|
||||
target_ = const_cast< ::bgs::protocol::notification::v1::Target*>(&::bgs::protocol::notification::v1::Target::default_instance());
|
||||
notification_ = const_cast< ::bgs::protocol::notification::v1::Notification*>(&::bgs::protocol::notification::v1::Notification::default_instance());
|
||||
}
|
||||
|
||||
PublishRequest::PublishRequest(const PublishRequest& from)
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
MergeFrom(from);
|
||||
// @@protoc_insertion_point(copy_constructor:bgs.protocol.notification.v1.PublishRequest)
|
||||
}
|
||||
|
||||
void PublishRequest::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
target_ = NULL;
|
||||
notification_ = NULL;
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
PublishRequest::~PublishRequest() {
|
||||
// @@protoc_insertion_point(destructor:bgs.protocol.notification.v1.PublishRequest)
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
void PublishRequest::SharedDtor() {
|
||||
if (this != default_instance_) {
|
||||
delete target_;
|
||||
delete notification_;
|
||||
}
|
||||
}
|
||||
|
||||
void PublishRequest::SetCachedSize(int size) const {
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
}
|
||||
const ::google::protobuf::Descriptor* PublishRequest::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return PublishRequest_descriptor_;
|
||||
}
|
||||
|
||||
const PublishRequest& PublishRequest::default_instance() {
|
||||
if (default_instance_ == NULL) protobuf_AddDesc_notification_5fservice_2eproto();
|
||||
return *default_instance_;
|
||||
}
|
||||
|
||||
PublishRequest* PublishRequest::default_instance_ = NULL;
|
||||
|
||||
PublishRequest* PublishRequest::New() const {
|
||||
return new PublishRequest;
|
||||
}
|
||||
|
||||
void PublishRequest::Swap(PublishRequest* other) {
|
||||
if (other != this) {
|
||||
GetReflection()->Swap(this, other);}
|
||||
}
|
||||
|
||||
::google::protobuf::Metadata PublishRequest::GetMetadata() const {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::Metadata metadata;
|
||||
metadata.descriptor = PublishRequest_descriptor_;
|
||||
metadata.reflection = PublishRequest_reflection_;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
NotificationService::NotificationService(bool use_original_hash) : ServiceBase(use_original_hash ? OriginalHash::value : NameHash::value) {
|
||||
}
|
||||
|
||||
NotificationService::~NotificationService() {
|
||||
}
|
||||
|
||||
google::protobuf::ServiceDescriptor const* NotificationService::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return NotificationService_descriptor_;
|
||||
}
|
||||
|
||||
void NotificationService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) {
|
||||
switch(methodId & 0x3FFFFFFF) {
|
||||
case 1:
|
||||
ParseAndHandleSendNotification(token, methodId, buffer);
|
||||
break;
|
||||
case 6:
|
||||
ParseAndHandleSubscribe(token, methodId, buffer);
|
||||
break;
|
||||
case 7:
|
||||
ParseAndHandleUnsubscribe(token, methodId, buffer);
|
||||
break;
|
||||
case 8:
|
||||
ParseAndHandlePublish(token, methodId, buffer);
|
||||
break;
|
||||
default:
|
||||
LogInvalidMethod(methodId);
|
||||
SendResponse(service_hash_, methodId, token, ERROR_RPC_INVALID_METHOD);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 NotificationService::HandleSendNotification(::bgs::protocol::notification::v1::Notification const* request, ::bgs::protocol::NoData* /*response*/, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) {
|
||||
LogUnimplementedServerMethod("NotificationService.SendNotification", request);
|
||||
return ERROR_RPC_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
uint32 NotificationService::HandleSubscribe(::bgs::protocol::notification::v1::SubscribeRequest const* request, ::bgs::protocol::NoData* /*response*/, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) {
|
||||
LogUnimplementedServerMethod("NotificationService.Subscribe", request);
|
||||
return ERROR_RPC_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
uint32 NotificationService::HandleUnsubscribe(::bgs::protocol::notification::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* /*response*/, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) {
|
||||
LogUnimplementedServerMethod("NotificationService.Unsubscribe", request);
|
||||
return ERROR_RPC_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
uint32 NotificationService::HandlePublish(::bgs::protocol::notification::v1::PublishRequest const* request, ::bgs::protocol::NoData* /*response*/, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) {
|
||||
LogUnimplementedServerMethod("NotificationService.Publish", request);
|
||||
return ERROR_RPC_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void NotificationService::ParseAndHandleSendNotification(uint32 token, uint32 methodId, MessageBuffer& buffer) {
|
||||
::bgs::protocol::notification::v1::Notification request;
|
||||
if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) {
|
||||
LogFailedParsingRequest("NotificationService.SendNotification");
|
||||
SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST);
|
||||
return;
|
||||
}
|
||||
LogCallServerMethod("NotificationService.SendNotification", "bgs.protocol.notification.v1.Notification", &request);
|
||||
std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = CreateServerContinuation(token, methodId, "NotificationService.SendNotification", ::bgs::protocol::NoData::descriptor());
|
||||
::bgs::protocol::NoData response;
|
||||
uint32 status = HandleSendNotification(&request, &response, continuation);
|
||||
if (continuation)
|
||||
continuation(this, status, &response);
|
||||
}
|
||||
|
||||
void NotificationService::ParseAndHandleSubscribe(uint32 token, uint32 methodId, MessageBuffer& buffer) {
|
||||
::bgs::protocol::notification::v1::SubscribeRequest request;
|
||||
if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) {
|
||||
LogFailedParsingRequest("NotificationService.Subscribe");
|
||||
SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST);
|
||||
return;
|
||||
}
|
||||
LogCallServerMethod("NotificationService.Subscribe", "bgs.protocol.notification.v1.SubscribeRequest", &request);
|
||||
std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = CreateServerContinuation(token, methodId, "NotificationService.Subscribe", ::bgs::protocol::NoData::descriptor());
|
||||
::bgs::protocol::NoData response;
|
||||
uint32 status = HandleSubscribe(&request, &response, continuation);
|
||||
if (continuation)
|
||||
continuation(this, status, &response);
|
||||
}
|
||||
|
||||
void NotificationService::ParseAndHandleUnsubscribe(uint32 token, uint32 methodId, MessageBuffer& buffer) {
|
||||
::bgs::protocol::notification::v1::UnsubscribeRequest request;
|
||||
if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) {
|
||||
LogFailedParsingRequest("NotificationService.Unsubscribe");
|
||||
SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST);
|
||||
return;
|
||||
}
|
||||
LogCallServerMethod("NotificationService.Unsubscribe", "bgs.protocol.notification.v1.UnsubscribeRequest", &request);
|
||||
std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = CreateServerContinuation(token, methodId, "NotificationService.Unsubscribe", ::bgs::protocol::NoData::descriptor());
|
||||
::bgs::protocol::NoData response;
|
||||
uint32 status = HandleUnsubscribe(&request, &response, continuation);
|
||||
if (continuation)
|
||||
continuation(this, status, &response);
|
||||
}
|
||||
|
||||
void NotificationService::ParseAndHandlePublish(uint32 token, uint32 methodId, MessageBuffer& buffer) {
|
||||
::bgs::protocol::notification::v1::PublishRequest request;
|
||||
if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) {
|
||||
LogFailedParsingRequest("NotificationService.Publish");
|
||||
SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST);
|
||||
return;
|
||||
}
|
||||
LogCallServerMethod("NotificationService.Publish", "bgs.protocol.notification.v1.PublishRequest", &request);
|
||||
std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = CreateServerContinuation(token, methodId, "NotificationService.Publish", ::bgs::protocol::NoData::descriptor());
|
||||
::bgs::protocol::NoData response;
|
||||
uint32 status = HandlePublish(&request, &response, continuation);
|
||||
if (continuation)
|
||||
continuation(this, status, &response);
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
NotificationListener::NotificationListener(bool use_original_hash) : ServiceBase(use_original_hash ? OriginalHash::value : NameHash::value) {
|
||||
}
|
||||
|
||||
NotificationListener::~NotificationListener() {
|
||||
}
|
||||
|
||||
google::protobuf::ServiceDescriptor const* NotificationListener::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return NotificationListener_descriptor_;
|
||||
}
|
||||
|
||||
void NotificationListener::OnNotificationReceived(::bgs::protocol::notification::v1::Notification const* request, bool client /*= false*/, bool server /*= false*/) {
|
||||
LogCallClientMethod("NotificationListener.OnNotificationReceived", "bgs.protocol.notification.v1.Notification", request);
|
||||
SendRequest(service_hash_, 1 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request);
|
||||
}
|
||||
|
||||
void NotificationListener::CallServerMethod(uint32 /*token*/, uint32 methodId, MessageBuffer /*buffer*/) {
|
||||
LogDisallowedMethod(methodId);
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
} // namespace v1
|
||||
} // namespace notification
|
||||
} // namespace protocol
|
||||
} // namespace bgs
|
||||
|
||||
// @@protoc_insertion_point(global_scope)
|
||||
517
src/server/proto/Client/notification_service.pb.h
Normal file
517
src/server/proto/Client/notification_service.pb.h
Normal file
@@ -0,0 +1,517 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: notification_service.proto
|
||||
|
||||
#ifndef PROTOBUF_notification_5fservice_2eproto__INCLUDED
|
||||
#define PROTOBUF_notification_5fservice_2eproto__INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/stubs/common.h>
|
||||
|
||||
#if GOOGLE_PROTOBUF_VERSION < 2006000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
#endif
|
||||
|
||||
#include <google/protobuf/generated_message_util.h>
|
||||
#include <google/protobuf/message.h>
|
||||
#include <google/protobuf/repeated_field.h>
|
||||
#include <google/protobuf/extension_set.h>
|
||||
#include <google/protobuf/unknown_field_set.h>
|
||||
#include "rpc_types.pb.h"
|
||||
#include "notification_types.pb.h"
|
||||
#include "ServiceBase.h"
|
||||
#include "MessageBuffer.h"
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
// @@protoc_insertion_point(includes)
|
||||
|
||||
namespace bgs {
|
||||
namespace protocol {
|
||||
namespace notification {
|
||||
namespace v1 {
|
||||
|
||||
// Internal implementation detail -- do not call these.
|
||||
void TC_PROTO_API protobuf_AddDesc_notification_5fservice_2eproto();
|
||||
void protobuf_AssignDesc_notification_5fservice_2eproto();
|
||||
void protobuf_ShutdownFile_notification_5fservice_2eproto();
|
||||
|
||||
class SubscribeRequest;
|
||||
class UnsubscribeRequest;
|
||||
class PublishRequest;
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class TC_PROTO_API SubscribeRequest : public ::google::protobuf::Message {
|
||||
public:
|
||||
SubscribeRequest();
|
||||
virtual ~SubscribeRequest();
|
||||
|
||||
SubscribeRequest(const SubscribeRequest& from);
|
||||
|
||||
inline SubscribeRequest& operator=(const SubscribeRequest& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const SubscribeRequest& default_instance();
|
||||
|
||||
void Swap(SubscribeRequest* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
SubscribeRequest* New() const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// optional .bgs.protocol.notification.v1.Subscription subscription = 1;
|
||||
inline bool has_subscription() const;
|
||||
inline void clear_subscription();
|
||||
static const int kSubscriptionFieldNumber = 1;
|
||||
inline const ::bgs::protocol::notification::v1::Subscription& subscription() const;
|
||||
inline ::bgs::protocol::notification::v1::Subscription* mutable_subscription();
|
||||
inline ::bgs::protocol::notification::v1::Subscription* release_subscription();
|
||||
inline void set_allocated_subscription(::bgs::protocol::notification::v1::Subscription* subscription);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:bgs.protocol.notification.v1.SubscribeRequest)
|
||||
private:
|
||||
inline void set_has_subscription();
|
||||
inline void clear_has_subscription();
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::google::protobuf::uint32 _has_bits_[1];
|
||||
mutable int _cached_size_;
|
||||
::bgs::protocol::notification::v1::Subscription* subscription_;
|
||||
friend void TC_PROTO_API protobuf_AddDesc_notification_5fservice_2eproto();
|
||||
friend void protobuf_AssignDesc_notification_5fservice_2eproto();
|
||||
friend void protobuf_ShutdownFile_notification_5fservice_2eproto();
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static SubscribeRequest* default_instance_;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class TC_PROTO_API UnsubscribeRequest : public ::google::protobuf::Message {
|
||||
public:
|
||||
UnsubscribeRequest();
|
||||
virtual ~UnsubscribeRequest();
|
||||
|
||||
UnsubscribeRequest(const UnsubscribeRequest& from);
|
||||
|
||||
inline UnsubscribeRequest& operator=(const UnsubscribeRequest& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const UnsubscribeRequest& default_instance();
|
||||
|
||||
void Swap(UnsubscribeRequest* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
UnsubscribeRequest* New() const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// optional .bgs.protocol.notification.v1.Subscription subscription = 1;
|
||||
inline bool has_subscription() const;
|
||||
inline void clear_subscription();
|
||||
static const int kSubscriptionFieldNumber = 1;
|
||||
inline const ::bgs::protocol::notification::v1::Subscription& subscription() const;
|
||||
inline ::bgs::protocol::notification::v1::Subscription* mutable_subscription();
|
||||
inline ::bgs::protocol::notification::v1::Subscription* release_subscription();
|
||||
inline void set_allocated_subscription(::bgs::protocol::notification::v1::Subscription* subscription);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:bgs.protocol.notification.v1.UnsubscribeRequest)
|
||||
private:
|
||||
inline void set_has_subscription();
|
||||
inline void clear_has_subscription();
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::google::protobuf::uint32 _has_bits_[1];
|
||||
mutable int _cached_size_;
|
||||
::bgs::protocol::notification::v1::Subscription* subscription_;
|
||||
friend void TC_PROTO_API protobuf_AddDesc_notification_5fservice_2eproto();
|
||||
friend void protobuf_AssignDesc_notification_5fservice_2eproto();
|
||||
friend void protobuf_ShutdownFile_notification_5fservice_2eproto();
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static UnsubscribeRequest* default_instance_;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class TC_PROTO_API PublishRequest : public ::google::protobuf::Message {
|
||||
public:
|
||||
PublishRequest();
|
||||
virtual ~PublishRequest();
|
||||
|
||||
PublishRequest(const PublishRequest& from);
|
||||
|
||||
inline PublishRequest& operator=(const PublishRequest& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const PublishRequest& default_instance();
|
||||
|
||||
void Swap(PublishRequest* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
PublishRequest* New() const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// optional .bgs.protocol.notification.v1.Target target = 1;
|
||||
inline bool has_target() const;
|
||||
inline void clear_target();
|
||||
static const int kTargetFieldNumber = 1;
|
||||
inline const ::bgs::protocol::notification::v1::Target& target() const;
|
||||
inline ::bgs::protocol::notification::v1::Target* mutable_target();
|
||||
inline ::bgs::protocol::notification::v1::Target* release_target();
|
||||
inline void set_allocated_target(::bgs::protocol::notification::v1::Target* target);
|
||||
|
||||
// optional .bgs.protocol.notification.v1.Notification notification = 2;
|
||||
inline bool has_notification() const;
|
||||
inline void clear_notification();
|
||||
static const int kNotificationFieldNumber = 2;
|
||||
inline const ::bgs::protocol::notification::v1::Notification& notification() const;
|
||||
inline ::bgs::protocol::notification::v1::Notification* mutable_notification();
|
||||
inline ::bgs::protocol::notification::v1::Notification* release_notification();
|
||||
inline void set_allocated_notification(::bgs::protocol::notification::v1::Notification* notification);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:bgs.protocol.notification.v1.PublishRequest)
|
||||
private:
|
||||
inline void set_has_target();
|
||||
inline void clear_has_target();
|
||||
inline void set_has_notification();
|
||||
inline void clear_has_notification();
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::google::protobuf::uint32 _has_bits_[1];
|
||||
mutable int _cached_size_;
|
||||
::bgs::protocol::notification::v1::Target* target_;
|
||||
::bgs::protocol::notification::v1::Notification* notification_;
|
||||
friend void TC_PROTO_API protobuf_AddDesc_notification_5fservice_2eproto();
|
||||
friend void protobuf_AssignDesc_notification_5fservice_2eproto();
|
||||
friend void protobuf_ShutdownFile_notification_5fservice_2eproto();
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static PublishRequest* default_instance_;
|
||||
};
|
||||
// ===================================================================
|
||||
|
||||
class TC_PROTO_API NotificationService : public ServiceBase
|
||||
{
|
||||
public:
|
||||
|
||||
explicit NotificationService(bool use_original_hash);
|
||||
NotificationService(NotificationService const&) = delete;
|
||||
NotificationService(NotificationService&&) = delete;
|
||||
NotificationService& operator=(NotificationService const&) = delete;
|
||||
NotificationService& operator=(NotificationService&&) = delete;
|
||||
virtual ~NotificationService();
|
||||
|
||||
typedef std::integral_constant<uint32, 0xCBE3C43u> OriginalHash;
|
||||
typedef std::integral_constant<uint32, 0x53C8C253u> NameHash;
|
||||
|
||||
static google::protobuf::ServiceDescriptor const* descriptor();
|
||||
|
||||
void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final;
|
||||
|
||||
protected:
|
||||
// server methods --------------------------------------------------
|
||||
virtual uint32 HandleSendNotification(::bgs::protocol::notification::v1::Notification const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation);
|
||||
virtual uint32 HandleSubscribe(::bgs::protocol::notification::v1::SubscribeRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation);
|
||||
virtual uint32 HandleUnsubscribe(::bgs::protocol::notification::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation);
|
||||
virtual uint32 HandlePublish(::bgs::protocol::notification::v1::PublishRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation);
|
||||
|
||||
private:
|
||||
void ParseAndHandleSendNotification(uint32 token, uint32 methodId, MessageBuffer& buffer);
|
||||
void ParseAndHandleSubscribe(uint32 token, uint32 methodId, MessageBuffer& buffer);
|
||||
void ParseAndHandleUnsubscribe(uint32 token, uint32 methodId, MessageBuffer& buffer);
|
||||
void ParseAndHandlePublish(uint32 token, uint32 methodId, MessageBuffer& buffer);
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class TC_PROTO_API NotificationListener : public ServiceBase
|
||||
{
|
||||
public:
|
||||
|
||||
explicit NotificationListener(bool use_original_hash);
|
||||
NotificationListener(NotificationListener const&) = delete;
|
||||
NotificationListener(NotificationListener&&) = delete;
|
||||
NotificationListener& operator=(NotificationListener const&) = delete;
|
||||
NotificationListener& operator=(NotificationListener&&) = delete;
|
||||
virtual ~NotificationListener();
|
||||
|
||||
typedef std::integral_constant<uint32, 0xE1CB2EA8u> OriginalHash;
|
||||
typedef std::integral_constant<uint32, 0xC1490E58u> NameHash;
|
||||
|
||||
static google::protobuf::ServiceDescriptor const* descriptor();
|
||||
|
||||
// client methods --------------------------------------------------
|
||||
void OnNotificationReceived(::bgs::protocol::notification::v1::Notification const* request, bool client = false, bool server = false);
|
||||
|
||||
void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final;
|
||||
};
|
||||
|
||||
// ===================================================================
|
||||
|
||||
// ===================================================================
|
||||
|
||||
// SubscribeRequest
|
||||
|
||||
// optional .bgs.protocol.notification.v1.Subscription subscription = 1;
|
||||
inline bool SubscribeRequest::has_subscription() const {
|
||||
return (_has_bits_[0] & 0x00000001u) != 0;
|
||||
}
|
||||
inline void SubscribeRequest::set_has_subscription() {
|
||||
_has_bits_[0] |= 0x00000001u;
|
||||
}
|
||||
inline void SubscribeRequest::clear_has_subscription() {
|
||||
_has_bits_[0] &= ~0x00000001u;
|
||||
}
|
||||
inline void SubscribeRequest::clear_subscription() {
|
||||
if (subscription_ != NULL) subscription_->::bgs::protocol::notification::v1::Subscription::Clear();
|
||||
clear_has_subscription();
|
||||
}
|
||||
inline const ::bgs::protocol::notification::v1::Subscription& SubscribeRequest::subscription() const {
|
||||
// @@protoc_insertion_point(field_get:bgs.protocol.notification.v1.SubscribeRequest.subscription)
|
||||
return subscription_ != NULL ? *subscription_ : *default_instance_->subscription_;
|
||||
}
|
||||
inline ::bgs::protocol::notification::v1::Subscription* SubscribeRequest::mutable_subscription() {
|
||||
set_has_subscription();
|
||||
if (subscription_ == NULL) subscription_ = new ::bgs::protocol::notification::v1::Subscription;
|
||||
// @@protoc_insertion_point(field_mutable:bgs.protocol.notification.v1.SubscribeRequest.subscription)
|
||||
return subscription_;
|
||||
}
|
||||
inline ::bgs::protocol::notification::v1::Subscription* SubscribeRequest::release_subscription() {
|
||||
clear_has_subscription();
|
||||
::bgs::protocol::notification::v1::Subscription* temp = subscription_;
|
||||
subscription_ = NULL;
|
||||
return temp;
|
||||
}
|
||||
inline void SubscribeRequest::set_allocated_subscription(::bgs::protocol::notification::v1::Subscription* subscription) {
|
||||
delete subscription_;
|
||||
subscription_ = subscription;
|
||||
if (subscription) {
|
||||
set_has_subscription();
|
||||
} else {
|
||||
clear_has_subscription();
|
||||
}
|
||||
// @@protoc_insertion_point(field_set_allocated:bgs.protocol.notification.v1.SubscribeRequest.subscription)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// UnsubscribeRequest
|
||||
|
||||
// optional .bgs.protocol.notification.v1.Subscription subscription = 1;
|
||||
inline bool UnsubscribeRequest::has_subscription() const {
|
||||
return (_has_bits_[0] & 0x00000001u) != 0;
|
||||
}
|
||||
inline void UnsubscribeRequest::set_has_subscription() {
|
||||
_has_bits_[0] |= 0x00000001u;
|
||||
}
|
||||
inline void UnsubscribeRequest::clear_has_subscription() {
|
||||
_has_bits_[0] &= ~0x00000001u;
|
||||
}
|
||||
inline void UnsubscribeRequest::clear_subscription() {
|
||||
if (subscription_ != NULL) subscription_->::bgs::protocol::notification::v1::Subscription::Clear();
|
||||
clear_has_subscription();
|
||||
}
|
||||
inline const ::bgs::protocol::notification::v1::Subscription& UnsubscribeRequest::subscription() const {
|
||||
// @@protoc_insertion_point(field_get:bgs.protocol.notification.v1.UnsubscribeRequest.subscription)
|
||||
return subscription_ != NULL ? *subscription_ : *default_instance_->subscription_;
|
||||
}
|
||||
inline ::bgs::protocol::notification::v1::Subscription* UnsubscribeRequest::mutable_subscription() {
|
||||
set_has_subscription();
|
||||
if (subscription_ == NULL) subscription_ = new ::bgs::protocol::notification::v1::Subscription;
|
||||
// @@protoc_insertion_point(field_mutable:bgs.protocol.notification.v1.UnsubscribeRequest.subscription)
|
||||
return subscription_;
|
||||
}
|
||||
inline ::bgs::protocol::notification::v1::Subscription* UnsubscribeRequest::release_subscription() {
|
||||
clear_has_subscription();
|
||||
::bgs::protocol::notification::v1::Subscription* temp = subscription_;
|
||||
subscription_ = NULL;
|
||||
return temp;
|
||||
}
|
||||
inline void UnsubscribeRequest::set_allocated_subscription(::bgs::protocol::notification::v1::Subscription* subscription) {
|
||||
delete subscription_;
|
||||
subscription_ = subscription;
|
||||
if (subscription) {
|
||||
set_has_subscription();
|
||||
} else {
|
||||
clear_has_subscription();
|
||||
}
|
||||
// @@protoc_insertion_point(field_set_allocated:bgs.protocol.notification.v1.UnsubscribeRequest.subscription)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// PublishRequest
|
||||
|
||||
// optional .bgs.protocol.notification.v1.Target target = 1;
|
||||
inline bool PublishRequest::has_target() const {
|
||||
return (_has_bits_[0] & 0x00000001u) != 0;
|
||||
}
|
||||
inline void PublishRequest::set_has_target() {
|
||||
_has_bits_[0] |= 0x00000001u;
|
||||
}
|
||||
inline void PublishRequest::clear_has_target() {
|
||||
_has_bits_[0] &= ~0x00000001u;
|
||||
}
|
||||
inline void PublishRequest::clear_target() {
|
||||
if (target_ != NULL) target_->::bgs::protocol::notification::v1::Target::Clear();
|
||||
clear_has_target();
|
||||
}
|
||||
inline const ::bgs::protocol::notification::v1::Target& PublishRequest::target() const {
|
||||
// @@protoc_insertion_point(field_get:bgs.protocol.notification.v1.PublishRequest.target)
|
||||
return target_ != NULL ? *target_ : *default_instance_->target_;
|
||||
}
|
||||
inline ::bgs::protocol::notification::v1::Target* PublishRequest::mutable_target() {
|
||||
set_has_target();
|
||||
if (target_ == NULL) target_ = new ::bgs::protocol::notification::v1::Target;
|
||||
// @@protoc_insertion_point(field_mutable:bgs.protocol.notification.v1.PublishRequest.target)
|
||||
return target_;
|
||||
}
|
||||
inline ::bgs::protocol::notification::v1::Target* PublishRequest::release_target() {
|
||||
clear_has_target();
|
||||
::bgs::protocol::notification::v1::Target* temp = target_;
|
||||
target_ = NULL;
|
||||
return temp;
|
||||
}
|
||||
inline void PublishRequest::set_allocated_target(::bgs::protocol::notification::v1::Target* target) {
|
||||
delete target_;
|
||||
target_ = target;
|
||||
if (target) {
|
||||
set_has_target();
|
||||
} else {
|
||||
clear_has_target();
|
||||
}
|
||||
// @@protoc_insertion_point(field_set_allocated:bgs.protocol.notification.v1.PublishRequest.target)
|
||||
}
|
||||
|
||||
// optional .bgs.protocol.notification.v1.Notification notification = 2;
|
||||
inline bool PublishRequest::has_notification() const {
|
||||
return (_has_bits_[0] & 0x00000002u) != 0;
|
||||
}
|
||||
inline void PublishRequest::set_has_notification() {
|
||||
_has_bits_[0] |= 0x00000002u;
|
||||
}
|
||||
inline void PublishRequest::clear_has_notification() {
|
||||
_has_bits_[0] &= ~0x00000002u;
|
||||
}
|
||||
inline void PublishRequest::clear_notification() {
|
||||
if (notification_ != NULL) notification_->::bgs::protocol::notification::v1::Notification::Clear();
|
||||
clear_has_notification();
|
||||
}
|
||||
inline const ::bgs::protocol::notification::v1::Notification& PublishRequest::notification() const {
|
||||
// @@protoc_insertion_point(field_get:bgs.protocol.notification.v1.PublishRequest.notification)
|
||||
return notification_ != NULL ? *notification_ : *default_instance_->notification_;
|
||||
}
|
||||
inline ::bgs::protocol::notification::v1::Notification* PublishRequest::mutable_notification() {
|
||||
set_has_notification();
|
||||
if (notification_ == NULL) notification_ = new ::bgs::protocol::notification::v1::Notification;
|
||||
// @@protoc_insertion_point(field_mutable:bgs.protocol.notification.v1.PublishRequest.notification)
|
||||
return notification_;
|
||||
}
|
||||
inline ::bgs::protocol::notification::v1::Notification* PublishRequest::release_notification() {
|
||||
clear_has_notification();
|
||||
::bgs::protocol::notification::v1::Notification* temp = notification_;
|
||||
notification_ = NULL;
|
||||
return temp;
|
||||
}
|
||||
inline void PublishRequest::set_allocated_notification(::bgs::protocol::notification::v1::Notification* notification) {
|
||||
delete notification_;
|
||||
notification_ = notification;
|
||||
if (notification) {
|
||||
set_has_notification();
|
||||
} else {
|
||||
clear_has_notification();
|
||||
}
|
||||
// @@protoc_insertion_point(field_set_allocated:bgs.protocol.notification.v1.PublishRequest.notification)
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
} // namespace v1
|
||||
} // namespace notification
|
||||
} // namespace protocol
|
||||
} // namespace bgs
|
||||
|
||||
#ifndef SWIG
|
||||
namespace google {
|
||||
namespace protobuf {
|
||||
} // namespace google
|
||||
} // namespace protobuf
|
||||
#endif // SWIG
|
||||
|
||||
// @@protoc_insertion_point(global_scope)
|
||||
|
||||
#endif // PROTOBUF_notification_5fservice_2eproto__INCLUDED
|
||||
66
src/server/proto/Client/notification_service.proto
Normal file
66
src/server/proto/Client/notification_service.proto
Normal file
@@ -0,0 +1,66 @@
|
||||
syntax = "proto2";
|
||||
|
||||
import "bgs/low/pb/client/rpc_types.proto";
|
||||
import "bgs/low/pb/client/notification_types.proto";
|
||||
package bgs.protocol.notification.v1;
|
||||
|
||||
option optimize_for = CODE_SIZE;
|
||||
option cc_generic_services = false;
|
||||
|
||||
message SubscribeRequest {
|
||||
optional .bgs.protocol.notification.v1.Subscription subscription = 1;
|
||||
}
|
||||
|
||||
message UnsubscribeRequest {
|
||||
optional .bgs.protocol.notification.v1.Subscription subscription = 1;
|
||||
}
|
||||
|
||||
message PublishRequest {
|
||||
optional .bgs.protocol.notification.v1.Target target = 1;
|
||||
optional .bgs.protocol.notification.v1.Notification notification = 2;
|
||||
}
|
||||
|
||||
service NotificationService {
|
||||
option (.bgs.protocol.service_options) = {
|
||||
descriptor_name: "bnet.protocol.notification.NotificationService"
|
||||
};
|
||||
option (.bgs.protocol.sdk_service_options) = {
|
||||
outbound: true
|
||||
};
|
||||
rpc SendNotification(.bgs.protocol.notification.v1.Notification) returns (.bgs.protocol.NoData) {
|
||||
option (.bgs.protocol.method_options) = {
|
||||
id: 1
|
||||
};
|
||||
}
|
||||
rpc Subscribe(.bgs.protocol.notification.v1.SubscribeRequest) returns (.bgs.protocol.NoData) {
|
||||
option (.bgs.protocol.method_options) = {
|
||||
id: 6
|
||||
};
|
||||
}
|
||||
rpc Unsubscribe(.bgs.protocol.notification.v1.UnsubscribeRequest) returns (.bgs.protocol.NoData) {
|
||||
option (.bgs.protocol.method_options) = {
|
||||
id: 7
|
||||
};
|
||||
}
|
||||
rpc Publish(.bgs.protocol.notification.v1.PublishRequest) returns (.bgs.protocol.NoData) {
|
||||
option (.bgs.protocol.method_options) = {
|
||||
id: 8
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
service NotificationListener {
|
||||
option (.bgs.protocol.service_options) = {
|
||||
descriptor_name: "bnet.protocol.notification.NotificationListener"
|
||||
};
|
||||
option (.bgs.protocol.sdk_service_options) = {
|
||||
inbound: true
|
||||
};
|
||||
rpc OnNotificationReceived(.bgs.protocol.notification.v1.Notification) returns (.bgs.protocol.NO_RESPONSE) {
|
||||
option (.bgs.protocol.method_options) = {
|
||||
id: 1
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
376
src/server/proto/Client/report_service.pb.cc
Normal file
376
src/server/proto/Client/report_service.pb.cc
Normal file
@@ -0,0 +1,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)
|
||||
444
src/server/proto/Client/report_service.pb.h
Normal file
444
src/server/proto/Client/report_service.pb.h
Normal file
@@ -0,0 +1,444 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: report_service.proto
|
||||
|
||||
#ifndef PROTOBUF_report_5fservice_2eproto__INCLUDED
|
||||
#define PROTOBUF_report_5fservice_2eproto__INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/stubs/common.h>
|
||||
|
||||
#if GOOGLE_PROTOBUF_VERSION < 2006000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
#endif
|
||||
|
||||
#include <google/protobuf/generated_message_util.h>
|
||||
#include <google/protobuf/message.h>
|
||||
#include <google/protobuf/repeated_field.h>
|
||||
#include <google/protobuf/extension_set.h>
|
||||
#include <google/protobuf/unknown_field_set.h>
|
||||
#include "account_types.pb.h"
|
||||
#include "report_types.pb.h"
|
||||
#include "rpc_types.pb.h"
|
||||
#include "ServiceBase.h"
|
||||
#include "MessageBuffer.h"
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
// @@protoc_insertion_point(includes)
|
||||
|
||||
namespace bgs {
|
||||
namespace protocol {
|
||||
namespace report {
|
||||
namespace v1 {
|
||||
|
||||
// Internal implementation detail -- do not call these.
|
||||
void TC_PROTO_API protobuf_AddDesc_report_5fservice_2eproto();
|
||||
void protobuf_AssignDesc_report_5fservice_2eproto();
|
||||
void protobuf_ShutdownFile_report_5fservice_2eproto();
|
||||
|
||||
class SendReportRequest;
|
||||
class SubmitReportRequest;
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class TC_PROTO_API SendReportRequest : public ::google::protobuf::Message {
|
||||
public:
|
||||
SendReportRequest();
|
||||
virtual ~SendReportRequest();
|
||||
|
||||
SendReportRequest(const SendReportRequest& from);
|
||||
|
||||
inline SendReportRequest& operator=(const SendReportRequest& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const SendReportRequest& default_instance();
|
||||
|
||||
void Swap(SendReportRequest* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
SendReportRequest* New() const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// required .bgs.protocol.report.v1.Report report = 1;
|
||||
inline bool has_report() const;
|
||||
inline void clear_report();
|
||||
static const int kReportFieldNumber = 1;
|
||||
inline const ::bgs::protocol::report::v1::Report& report() const;
|
||||
inline ::bgs::protocol::report::v1::Report* mutable_report();
|
||||
inline ::bgs::protocol::report::v1::Report* release_report();
|
||||
inline void set_allocated_report(::bgs::protocol::report::v1::Report* report);
|
||||
|
||||
// optional uint32 program = 2;
|
||||
inline bool has_program() const;
|
||||
inline void clear_program();
|
||||
static const int kProgramFieldNumber = 2;
|
||||
inline ::google::protobuf::uint32 program() const;
|
||||
inline void set_program(::google::protobuf::uint32 value);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:bgs.protocol.report.v1.SendReportRequest)
|
||||
private:
|
||||
inline void set_has_report();
|
||||
inline void clear_has_report();
|
||||
inline void set_has_program();
|
||||
inline void clear_has_program();
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::google::protobuf::uint32 _has_bits_[1];
|
||||
mutable int _cached_size_;
|
||||
::bgs::protocol::report::v1::Report* report_;
|
||||
::google::protobuf::uint32 program_;
|
||||
friend void TC_PROTO_API protobuf_AddDesc_report_5fservice_2eproto();
|
||||
friend void protobuf_AssignDesc_report_5fservice_2eproto();
|
||||
friend void protobuf_ShutdownFile_report_5fservice_2eproto();
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static SendReportRequest* default_instance_;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class TC_PROTO_API SubmitReportRequest : public ::google::protobuf::Message {
|
||||
public:
|
||||
SubmitReportRequest();
|
||||
virtual ~SubmitReportRequest();
|
||||
|
||||
SubmitReportRequest(const SubmitReportRequest& from);
|
||||
|
||||
inline SubmitReportRequest& operator=(const SubmitReportRequest& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const SubmitReportRequest& default_instance();
|
||||
|
||||
void Swap(SubmitReportRequest* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
SubmitReportRequest* New() const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// optional .bgs.protocol.account.v1.GameAccountHandle agent_id = 1;
|
||||
inline bool has_agent_id() const;
|
||||
inline void clear_agent_id();
|
||||
static const int kAgentIdFieldNumber = 1;
|
||||
inline const ::bgs::protocol::account::v1::GameAccountHandle& agent_id() const;
|
||||
inline ::bgs::protocol::account::v1::GameAccountHandle* mutable_agent_id();
|
||||
inline ::bgs::protocol::account::v1::GameAccountHandle* release_agent_id();
|
||||
inline void set_allocated_agent_id(::bgs::protocol::account::v1::GameAccountHandle* agent_id);
|
||||
|
||||
// optional .bgs.protocol.report.v1.ReportType report_type = 2;
|
||||
inline bool has_report_type() const;
|
||||
inline void clear_report_type();
|
||||
static const int kReportTypeFieldNumber = 2;
|
||||
inline const ::bgs::protocol::report::v1::ReportType& report_type() const;
|
||||
inline ::bgs::protocol::report::v1::ReportType* mutable_report_type();
|
||||
inline ::bgs::protocol::report::v1::ReportType* release_report_type();
|
||||
inline void set_allocated_report_type(::bgs::protocol::report::v1::ReportType* report_type);
|
||||
|
||||
// optional uint32 program = 3;
|
||||
inline bool has_program() const;
|
||||
inline void clear_program();
|
||||
static const int kProgramFieldNumber = 3;
|
||||
inline ::google::protobuf::uint32 program() const;
|
||||
inline void set_program(::google::protobuf::uint32 value);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:bgs.protocol.report.v1.SubmitReportRequest)
|
||||
private:
|
||||
inline void set_has_agent_id();
|
||||
inline void clear_has_agent_id();
|
||||
inline void set_has_report_type();
|
||||
inline void clear_has_report_type();
|
||||
inline void set_has_program();
|
||||
inline void clear_has_program();
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::google::protobuf::uint32 _has_bits_[1];
|
||||
mutable int _cached_size_;
|
||||
::bgs::protocol::account::v1::GameAccountHandle* agent_id_;
|
||||
::bgs::protocol::report::v1::ReportType* report_type_;
|
||||
::google::protobuf::uint32 program_;
|
||||
friend void TC_PROTO_API protobuf_AddDesc_report_5fservice_2eproto();
|
||||
friend void protobuf_AssignDesc_report_5fservice_2eproto();
|
||||
friend void protobuf_ShutdownFile_report_5fservice_2eproto();
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static SubmitReportRequest* default_instance_;
|
||||
};
|
||||
// ===================================================================
|
||||
|
||||
class TC_PROTO_API ReportService : public ServiceBase
|
||||
{
|
||||
public:
|
||||
|
||||
explicit ReportService(bool use_original_hash);
|
||||
ReportService(ReportService const&) = delete;
|
||||
ReportService(ReportService&&) = delete;
|
||||
ReportService& operator=(ReportService const&) = delete;
|
||||
ReportService& operator=(ReportService&&) = delete;
|
||||
virtual ~ReportService();
|
||||
|
||||
typedef std::integral_constant<uint32, 0x7CAF61C9u> OriginalHash;
|
||||
typedef std::integral_constant<uint32, 0x724F5F47u> NameHash;
|
||||
|
||||
static google::protobuf::ServiceDescriptor const* descriptor();
|
||||
|
||||
void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final;
|
||||
|
||||
protected:
|
||||
// server methods --------------------------------------------------
|
||||
virtual uint32 HandleSendReport(::bgs::protocol::report::v1::SendReportRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation);
|
||||
virtual uint32 HandleSubmitReport(::bgs::protocol::report::v1::SubmitReportRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation);
|
||||
|
||||
private:
|
||||
void ParseAndHandleSendReport(uint32 token, uint32 methodId, MessageBuffer& buffer);
|
||||
void ParseAndHandleSubmitReport(uint32 token, uint32 methodId, MessageBuffer& buffer);
|
||||
};
|
||||
|
||||
// ===================================================================
|
||||
|
||||
// ===================================================================
|
||||
|
||||
// SendReportRequest
|
||||
|
||||
// required .bgs.protocol.report.v1.Report report = 1;
|
||||
inline bool SendReportRequest::has_report() const {
|
||||
return (_has_bits_[0] & 0x00000001u) != 0;
|
||||
}
|
||||
inline void SendReportRequest::set_has_report() {
|
||||
_has_bits_[0] |= 0x00000001u;
|
||||
}
|
||||
inline void SendReportRequest::clear_has_report() {
|
||||
_has_bits_[0] &= ~0x00000001u;
|
||||
}
|
||||
inline void SendReportRequest::clear_report() {
|
||||
if (report_ != NULL) report_->::bgs::protocol::report::v1::Report::Clear();
|
||||
clear_has_report();
|
||||
}
|
||||
inline const ::bgs::protocol::report::v1::Report& SendReportRequest::report() const {
|
||||
// @@protoc_insertion_point(field_get:bgs.protocol.report.v1.SendReportRequest.report)
|
||||
return report_ != NULL ? *report_ : *default_instance_->report_;
|
||||
}
|
||||
inline ::bgs::protocol::report::v1::Report* SendReportRequest::mutable_report() {
|
||||
set_has_report();
|
||||
if (report_ == NULL) report_ = new ::bgs::protocol::report::v1::Report;
|
||||
// @@protoc_insertion_point(field_mutable:bgs.protocol.report.v1.SendReportRequest.report)
|
||||
return report_;
|
||||
}
|
||||
inline ::bgs::protocol::report::v1::Report* SendReportRequest::release_report() {
|
||||
clear_has_report();
|
||||
::bgs::protocol::report::v1::Report* temp = report_;
|
||||
report_ = NULL;
|
||||
return temp;
|
||||
}
|
||||
inline void SendReportRequest::set_allocated_report(::bgs::protocol::report::v1::Report* report) {
|
||||
delete report_;
|
||||
report_ = report;
|
||||
if (report) {
|
||||
set_has_report();
|
||||
} else {
|
||||
clear_has_report();
|
||||
}
|
||||
// @@protoc_insertion_point(field_set_allocated:bgs.protocol.report.v1.SendReportRequest.report)
|
||||
}
|
||||
|
||||
// optional uint32 program = 2;
|
||||
inline bool SendReportRequest::has_program() const {
|
||||
return (_has_bits_[0] & 0x00000002u) != 0;
|
||||
}
|
||||
inline void SendReportRequest::set_has_program() {
|
||||
_has_bits_[0] |= 0x00000002u;
|
||||
}
|
||||
inline void SendReportRequest::clear_has_program() {
|
||||
_has_bits_[0] &= ~0x00000002u;
|
||||
}
|
||||
inline void SendReportRequest::clear_program() {
|
||||
program_ = 0u;
|
||||
clear_has_program();
|
||||
}
|
||||
inline ::google::protobuf::uint32 SendReportRequest::program() const {
|
||||
// @@protoc_insertion_point(field_get:bgs.protocol.report.v1.SendReportRequest.program)
|
||||
return program_;
|
||||
}
|
||||
inline void SendReportRequest::set_program(::google::protobuf::uint32 value) {
|
||||
set_has_program();
|
||||
program_ = value;
|
||||
// @@protoc_insertion_point(field_set:bgs.protocol.report.v1.SendReportRequest.program)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// SubmitReportRequest
|
||||
|
||||
// optional .bgs.protocol.account.v1.GameAccountHandle agent_id = 1;
|
||||
inline bool SubmitReportRequest::has_agent_id() const {
|
||||
return (_has_bits_[0] & 0x00000001u) != 0;
|
||||
}
|
||||
inline void SubmitReportRequest::set_has_agent_id() {
|
||||
_has_bits_[0] |= 0x00000001u;
|
||||
}
|
||||
inline void SubmitReportRequest::clear_has_agent_id() {
|
||||
_has_bits_[0] &= ~0x00000001u;
|
||||
}
|
||||
inline void SubmitReportRequest::clear_agent_id() {
|
||||
if (agent_id_ != NULL) agent_id_->::bgs::protocol::account::v1::GameAccountHandle::Clear();
|
||||
clear_has_agent_id();
|
||||
}
|
||||
inline const ::bgs::protocol::account::v1::GameAccountHandle& SubmitReportRequest::agent_id() const {
|
||||
// @@protoc_insertion_point(field_get:bgs.protocol.report.v1.SubmitReportRequest.agent_id)
|
||||
return agent_id_ != NULL ? *agent_id_ : *default_instance_->agent_id_;
|
||||
}
|
||||
inline ::bgs::protocol::account::v1::GameAccountHandle* SubmitReportRequest::mutable_agent_id() {
|
||||
set_has_agent_id();
|
||||
if (agent_id_ == NULL) agent_id_ = new ::bgs::protocol::account::v1::GameAccountHandle;
|
||||
// @@protoc_insertion_point(field_mutable:bgs.protocol.report.v1.SubmitReportRequest.agent_id)
|
||||
return agent_id_;
|
||||
}
|
||||
inline ::bgs::protocol::account::v1::GameAccountHandle* SubmitReportRequest::release_agent_id() {
|
||||
clear_has_agent_id();
|
||||
::bgs::protocol::account::v1::GameAccountHandle* temp = agent_id_;
|
||||
agent_id_ = NULL;
|
||||
return temp;
|
||||
}
|
||||
inline void SubmitReportRequest::set_allocated_agent_id(::bgs::protocol::account::v1::GameAccountHandle* agent_id) {
|
||||
delete agent_id_;
|
||||
agent_id_ = agent_id;
|
||||
if (agent_id) {
|
||||
set_has_agent_id();
|
||||
} else {
|
||||
clear_has_agent_id();
|
||||
}
|
||||
// @@protoc_insertion_point(field_set_allocated:bgs.protocol.report.v1.SubmitReportRequest.agent_id)
|
||||
}
|
||||
|
||||
// optional .bgs.protocol.report.v1.ReportType report_type = 2;
|
||||
inline bool SubmitReportRequest::has_report_type() const {
|
||||
return (_has_bits_[0] & 0x00000002u) != 0;
|
||||
}
|
||||
inline void SubmitReportRequest::set_has_report_type() {
|
||||
_has_bits_[0] |= 0x00000002u;
|
||||
}
|
||||
inline void SubmitReportRequest::clear_has_report_type() {
|
||||
_has_bits_[0] &= ~0x00000002u;
|
||||
}
|
||||
inline void SubmitReportRequest::clear_report_type() {
|
||||
if (report_type_ != NULL) report_type_->::bgs::protocol::report::v1::ReportType::Clear();
|
||||
clear_has_report_type();
|
||||
}
|
||||
inline const ::bgs::protocol::report::v1::ReportType& SubmitReportRequest::report_type() const {
|
||||
// @@protoc_insertion_point(field_get:bgs.protocol.report.v1.SubmitReportRequest.report_type)
|
||||
return report_type_ != NULL ? *report_type_ : *default_instance_->report_type_;
|
||||
}
|
||||
inline ::bgs::protocol::report::v1::ReportType* SubmitReportRequest::mutable_report_type() {
|
||||
set_has_report_type();
|
||||
if (report_type_ == NULL) report_type_ = new ::bgs::protocol::report::v1::ReportType;
|
||||
// @@protoc_insertion_point(field_mutable:bgs.protocol.report.v1.SubmitReportRequest.report_type)
|
||||
return report_type_;
|
||||
}
|
||||
inline ::bgs::protocol::report::v1::ReportType* SubmitReportRequest::release_report_type() {
|
||||
clear_has_report_type();
|
||||
::bgs::protocol::report::v1::ReportType* temp = report_type_;
|
||||
report_type_ = NULL;
|
||||
return temp;
|
||||
}
|
||||
inline void SubmitReportRequest::set_allocated_report_type(::bgs::protocol::report::v1::ReportType* report_type) {
|
||||
delete report_type_;
|
||||
report_type_ = report_type;
|
||||
if (report_type) {
|
||||
set_has_report_type();
|
||||
} else {
|
||||
clear_has_report_type();
|
||||
}
|
||||
// @@protoc_insertion_point(field_set_allocated:bgs.protocol.report.v1.SubmitReportRequest.report_type)
|
||||
}
|
||||
|
||||
// optional uint32 program = 3;
|
||||
inline bool SubmitReportRequest::has_program() const {
|
||||
return (_has_bits_[0] & 0x00000004u) != 0;
|
||||
}
|
||||
inline void SubmitReportRequest::set_has_program() {
|
||||
_has_bits_[0] |= 0x00000004u;
|
||||
}
|
||||
inline void SubmitReportRequest::clear_has_program() {
|
||||
_has_bits_[0] &= ~0x00000004u;
|
||||
}
|
||||
inline void SubmitReportRequest::clear_program() {
|
||||
program_ = 0u;
|
||||
clear_has_program();
|
||||
}
|
||||
inline ::google::protobuf::uint32 SubmitReportRequest::program() const {
|
||||
// @@protoc_insertion_point(field_get:bgs.protocol.report.v1.SubmitReportRequest.program)
|
||||
return program_;
|
||||
}
|
||||
inline void SubmitReportRequest::set_program(::google::protobuf::uint32 value) {
|
||||
set_has_program();
|
||||
program_ = value;
|
||||
// @@protoc_insertion_point(field_set:bgs.protocol.report.v1.SubmitReportRequest.program)
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
} // namespace v1
|
||||
} // namespace report
|
||||
} // namespace protocol
|
||||
} // namespace bgs
|
||||
|
||||
#ifndef SWIG
|
||||
namespace google {
|
||||
namespace protobuf {
|
||||
} // namespace google
|
||||
} // namespace protobuf
|
||||
#endif // SWIG
|
||||
|
||||
// @@protoc_insertion_point(global_scope)
|
||||
|
||||
#endif // PROTOBUF_report_5fservice_2eproto__INCLUDED
|
||||
41
src/server/proto/Client/report_service.proto
Normal file
41
src/server/proto/Client/report_service.proto
Normal file
@@ -0,0 +1,41 @@
|
||||
syntax = "proto2";
|
||||
|
||||
import "account_types.proto";
|
||||
import "report_types.proto";
|
||||
import "rpc_types.proto";
|
||||
package bgs.protocol.report.v1;
|
||||
|
||||
option optimize_for = CODE_SIZE;
|
||||
option cc_generic_services = false;
|
||||
|
||||
message SendReportRequest {
|
||||
required .bgs.protocol.report.v1.Report report = 1;
|
||||
optional uint32 program = 2;
|
||||
}
|
||||
|
||||
message SubmitReportRequest {
|
||||
optional .bgs.protocol.account.v1.GameAccountHandle agent_id = 1;
|
||||
optional .bgs.protocol.report.v1.ReportType report_type = 2;
|
||||
optional uint32 program = 3;
|
||||
}
|
||||
|
||||
service ReportService {
|
||||
option (.bgs.protocol.service_options) = {
|
||||
descriptor_name: "bnet.protocol.report.ReportService"
|
||||
};
|
||||
option (.bgs.protocol.sdk_service_options) = {
|
||||
outbound: true
|
||||
};
|
||||
rpc SendReport(.bgs.protocol.report.v1.SendReportRequest) returns (.bgs.protocol.NoData) {
|
||||
option (.bgs.protocol.method_options) = {
|
||||
id: 1
|
||||
};
|
||||
}
|
||||
rpc SubmitReport(.bgs.protocol.report.v1.SubmitReportRequest) returns (.bgs.protocol.NoData) {
|
||||
option (.bgs.protocol.method_options) = {
|
||||
id: 2
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1167
src/server/proto/Client/report_types.pb.cc
Normal file
1167
src/server/proto/Client/report_types.pb.cc
Normal file
File diff suppressed because it is too large
Load Diff
2324
src/server/proto/Client/report_types.pb.h
Normal file
2324
src/server/proto/Client/report_types.pb.h
Normal file
File diff suppressed because it is too large
Load Diff
74
src/server/proto/Client/report_types.proto
Normal file
74
src/server/proto/Client/report_types.proto
Normal file
@@ -0,0 +1,74 @@
|
||||
syntax = "proto2";
|
||||
|
||||
import "account_types.proto";
|
||||
import "attribute_types.proto";
|
||||
import "entity_types.proto";
|
||||
import "rpc_types.proto";
|
||||
package bgs.protocol.report.v1;
|
||||
|
||||
option optimize_for = CODE_SIZE;
|
||||
option cc_generic_services = false;
|
||||
|
||||
message ReportType {
|
||||
optional string user_description = 1;
|
||||
oneof type {
|
||||
.bgs.protocol.report.v1.CustomReport custom_report = 10;
|
||||
.bgs.protocol.report.v1.SpamReport spam_report = 11;
|
||||
.bgs.protocol.report.v1.HarassmentReport harassment_report = 12;
|
||||
.bgs.protocol.report.v1.RealLifeThreatReport real_life_threat_report = 13;
|
||||
.bgs.protocol.report.v1.InappropriateBattleTagReport inappropriate_battle_tag_report = 14;
|
||||
.bgs.protocol.report.v1.HackingReport hacking_report = 15;
|
||||
.bgs.protocol.report.v1.BottingReport botting_report = 16;
|
||||
}
|
||||
}
|
||||
|
||||
message CustomReport {
|
||||
optional string type = 1;
|
||||
optional string program_id = 2 [deprecated = true];
|
||||
repeated .bgs.protocol.Attribute attribute = 3;
|
||||
}
|
||||
|
||||
message SpamReport {
|
||||
enum SpamSource {
|
||||
OTHER = 1;
|
||||
FRIEND_INVITATION = 2;
|
||||
WHISPER = 3;
|
||||
CHAT = 4;
|
||||
}
|
||||
optional .bgs.protocol.account.v1.GameAccountHandle target = 1;
|
||||
optional .bgs.protocol.report.v1.SpamReport.SpamSource source = 2 [default = OTHER];
|
||||
}
|
||||
|
||||
message HarassmentReport {
|
||||
optional .bgs.protocol.account.v1.GameAccountHandle target = 1;
|
||||
optional string text = 2;
|
||||
}
|
||||
|
||||
message RealLifeThreatReport {
|
||||
optional .bgs.protocol.account.v1.GameAccountHandle target = 1;
|
||||
optional string text = 2;
|
||||
}
|
||||
|
||||
message InappropriateBattleTagReport {
|
||||
optional .bgs.protocol.account.v1.GameAccountHandle target = 1;
|
||||
optional string battle_tag = 2;
|
||||
}
|
||||
|
||||
message HackingReport {
|
||||
optional .bgs.protocol.account.v1.GameAccountHandle target = 1;
|
||||
}
|
||||
|
||||
message BottingReport {
|
||||
optional .bgs.protocol.account.v1.GameAccountHandle target = 1;
|
||||
}
|
||||
|
||||
message Report {
|
||||
required string report_type = 1;
|
||||
repeated .bgs.protocol.Attribute attribute = 2;
|
||||
optional int32 report_qos = 3 [default = 0];
|
||||
optional .bgs.protocol.EntityId reporting_account = 4;
|
||||
optional .bgs.protocol.EntityId reporting_game_account = 5;
|
||||
optional fixed64 report_timestamp = 6;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user