mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-28 07:37:56 +00:00
Stuff
This commit is contained in:
@@ -6,6 +6,7 @@ extern WorldServer *worldserver;
|
||||
extern std::map<std::string, std::pair<int, MethodHandler>> authorized_methods;
|
||||
extern std::map<std::string, MethodHandler> unauthorized_methods;
|
||||
|
||||
/* Web Interface */
|
||||
void register_authorized_methods()
|
||||
{
|
||||
authorized_methods["WebInterface.Authorize"] = std::make_pair(0, handle_method_token_auth);
|
||||
@@ -13,6 +14,7 @@ void register_authorized_methods()
|
||||
authorized_methods["World.GetZoneDetails"] = std::make_pair(10, handle_method_get_zone_info);
|
||||
authorized_methods["Zone.Subscribe"] = std::make_pair(10, handle_method_subscribe);
|
||||
authorized_methods["Zone.Unsubscribe"] = std::make_pair(10, handle_method_subscribe);
|
||||
authorized_methods["Zone.GetInitialEntityPositions"] = std::make_pair(10, handle_method_void_event);
|
||||
}
|
||||
|
||||
void register_unauthorized_methods()
|
||||
@@ -108,3 +110,30 @@ void handle_method_subscribe(per_session_data_eqemu *session, rapidjson::Documen
|
||||
worldserver->SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
void handle_method_void_event(per_session_data_eqemu *session, rapidjson::Document &document, std::string &method) {
|
||||
CheckParams(2, "[zone_id, instance_id]");
|
||||
VerifyID();
|
||||
CalculateSize();
|
||||
|
||||
ServerPacket *pack = new ServerPacket(ServerOP_WIRemoteCall, sz);
|
||||
pack->WriteUInt32((uint32)id.size());
|
||||
pack->WriteString(id.c_str());
|
||||
pack->WriteUInt32((uint32)session->uuid.size());
|
||||
pack->WriteString(session->uuid.c_str());
|
||||
pack->WriteUInt32((uint32)method.size());
|
||||
pack->WriteString(method.c_str());
|
||||
pack->WriteUInt32(2);
|
||||
|
||||
auto ¶ms = document["params"];
|
||||
auto ¶m = params[(rapidjson::SizeType)0];
|
||||
pack->WriteUInt32((uint32)strlen(param.GetString()));
|
||||
pack->WriteString(param.GetString());
|
||||
|
||||
param = params[1];
|
||||
pack->WriteUInt32((uint32)strlen(param.GetString()));
|
||||
pack->WriteString(param.GetString());
|
||||
|
||||
worldserver->SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
@@ -61,6 +61,7 @@ void handle_method_token_auth(per_session_data_eqemu *session, rapidjson::Docume
|
||||
void handle_method_no_args(per_session_data_eqemu *session, rapidjson::Document &document, std::string &method);
|
||||
void handle_method_get_zone_info(per_session_data_eqemu *session, rapidjson::Document &document, std::string &method);
|
||||
void handle_method_subscribe(per_session_data_eqemu *session, rapidjson::Document &document, std::string &method);
|
||||
void handle_method_void_event(per_session_data_eqemu *session, rapidjson::Document &document, std::string &method);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user