59 std::string subRegionId;
60 auto subRegion = params.find(
"Command_RealmListRequest_v1_b9");
61 if (subRegion != params.end())
62 subRegionId = subRegion->second->string_value();
66 if (compressed.empty())
70 attribute->
set_name(
"Param_RealmList");
71 attribute->
mutable_value()->set_blob_value(compressed.data(), compressed.size());
78 countEntry->
set_count(characterCount.second);
81 std::string json =
"JSONRealmCharacterCountList:" +
JSON::Serialize(realmCharacterCounts);
83 uLongf compressedLength = compressBound(json.length());
84 compressed.resize(4 + compressedLength);
85 *
reinterpret_cast<uint32*
>(compressed.data()) = json.length() + 1;
87 if (compress(compressed.data() + 4, &compressedLength,
reinterpret_cast<uint8 const*
>(json.c_str()), json.length() + 1) !=
Z_OK)
91 attribute->
set_name(
"Param_CharacterCountList");
92 attribute->
mutable_value()->set_blob_value(compressed.data(), compressedLength + 4);
void set_name(const ::std::string &value)
Definition: attribute_types.pb.h:935
Realm realm
Definition: World.cpp:3485
inline::bgs::protocol::Variant * mutable_value()
Definition: attribute_types.pb.h:1009
TC_SHARED_API std::string Serialize(google::protobuf::Message const &message)
Definition: ProtobufJSON.cpp:438
WorldSession * _session
Definition: WorldserverService.h:52
Definition: RealmList.pb.h:542
uint32_t uint32
Definition: Define.h:150
uint32 Build
Definition: Realm.h:87
Definition: RealmList.pb.h:466
void set_count(::google::protobuf::uint32 value)
Definition: RealmList.pb.h:1814
inline::bgs::protocol::Attribute * add_attribute()
Definition: game_utilities_service.pb.h:1617
Definition: BattlenetRpcErrorCodes.h:25
uLong FAR uLongf
Definition: zconf.h:382
Definition: BattlenetRpcErrorCodes.h:604
#define sRealmList
Definition: RealmList.h:101
#define Z_OK
Definition: zlib.h:173
uint8_t uint8
Definition: Define.h:152
#define const
Definition: zconf.h:217
void set_wowrealmaddress(::google::protobuf::uint32 value)
Definition: RealmList.pb.h:1790
inline::JSON::RealmList::RealmCharacterCountEntry * add_counts()
Definition: RealmList.pb.h:1839
std::unordered_map< uint32, uint8 > const & GetRealmCharacterCounts() const
Definition: WorldSession.h:1710
Definition: attribute_types.pb.h:248