mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 00:01:28 +00:00
Changed a bunch of function names to be shorter but still descriptive
This commit is contained in:
parent
ae30d8b257
commit
379ecc655c
@ -8,16 +8,16 @@ extern std::map<std::string, MethodHandler> unauthorized_methods;
|
||||
|
||||
void register_authorized_methods()
|
||||
{
|
||||
authorized_methods["WebInterface::Authorize"] = std::make_pair(0, handle_method_token_auth);
|
||||
authorized_methods["World::ListZones"] = std::make_pair(10, handle_method_no_args);
|
||||
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["WebInterface.Authorize"] = std::make_pair(0, handle_method_token_auth);
|
||||
authorized_methods["World.ListZones"] = std::make_pair(10, handle_method_no_args);
|
||||
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);
|
||||
}
|
||||
|
||||
void register_unauthorized_methods()
|
||||
{
|
||||
unauthorized_methods["WebInterface::Authorize"] = handle_method_token_auth;
|
||||
unauthorized_methods["WebInterface.Authorize"] = handle_method_token_auth;
|
||||
}
|
||||
|
||||
void register_methods()
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
socket.onopen = function(e) {
|
||||
var obj = {};
|
||||
obj.id = 'token_auth_id';
|
||||
obj.method = 'WebInterface::Authorize';
|
||||
obj.method = 'WebInterface.Authorize';
|
||||
obj.params = ['c5b80ec8-4174-4c4c-d332-dbf3c3a551fc'];
|
||||
socket.send(JSON.stringify(obj));
|
||||
};
|
||||
@ -32,18 +32,18 @@
|
||||
console.log(obj);
|
||||
|
||||
if(obj.id == 'token_auth_id') {
|
||||
socket.send(JSON.stringify({id: 'list_zones_id', method: 'World::ListZones', params: []}));
|
||||
socket.send(JSON.stringify({id: 'list_zones_id', method: 'World.ListZones', params: []}));
|
||||
} else if(obj.id == 'list_zones_id') {
|
||||
for (var key in obj.result) {
|
||||
if(obj.result.hasOwnProperty(key)) {
|
||||
var str = JSON.stringify({id: 'get_zone_info_id', method: 'World::GetZoneDetails', params: [obj.result[key]]});
|
||||
console.log(str);
|
||||
var str = JSON.stringify({id: 'get_zone_info_id', method: 'World.GetZoneDetails', params: [obj.result[key]]});
|
||||
socket.send(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(obj.id == 'get_zone_info_id') {
|
||||
socket.send(JSON.stringify({id: 'subscribe_id', method: 'Zone::Subscribe', params: [obj.result["zone_id"], obj.result["instance_id"], 'NPC::MakeSpawnUpdateNoDelta']}));
|
||||
socket.send(JSON.stringify({id: 'subscribe_id', method: 'Zone.Subscribe', params: [obj.result["zone_id"], obj.result["instance_id"], 'NPCPosition']}));
|
||||
} else if(obj.method = "On.NPCPosition") {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -46,10 +46,10 @@ void RemoteCallResponse(const std::string &connection_id, const std::string &req
|
||||
}
|
||||
|
||||
void register_remote_call_handlers() {
|
||||
remote_call_methods["World::ListZones"] = handle_rc_list_zones;
|
||||
remote_call_methods["World::GetZoneDetails"] = handle_rc_get_zone_info;
|
||||
remote_call_methods["Zone::Subscribe"] = handle_rc_relay;
|
||||
remote_call_methods["Zone::Unsubscribe"] = handle_rc_relay;
|
||||
remote_call_methods["World.ListZones"] = handle_rc_list_zones;
|
||||
remote_call_methods["World.GetZoneDetails"] = handle_rc_get_zone_info;
|
||||
remote_call_methods["Zone.Subscribe"] = handle_rc_relay;
|
||||
remote_call_methods["Zone.Unsubscribe"] = handle_rc_relay;
|
||||
}
|
||||
|
||||
void handle_rc_list_zones(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms) {
|
||||
|
||||
@ -1225,7 +1225,7 @@ void Mob::MakeSpawnUpdateNoDelta(PlayerPositionUpdateServer_Struct *spu){
|
||||
params.push_back(std::to_string((double)y_pos));
|
||||
params.push_back(std::to_string((double)z_pos));
|
||||
params.push_back(std::to_string((double)heading));
|
||||
RemoteCallSubscriptionHandler::Instance()->OnEvent("NPC::MakeSpawnUpdateNoDelta", params);
|
||||
RemoteCallSubscriptionHandler::Instance()->OnEvent("NPCPosition", params);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -406,10 +406,6 @@ int main(int argc, char** argv) {
|
||||
worldwasconnected = false;
|
||||
}
|
||||
|
||||
if(RemoteCallProcessTimer.Check()) {
|
||||
RemoteCallSubscriptionHandler::Instance()->Process();
|
||||
}
|
||||
|
||||
if (ZoneLoaded && zoneupdate_timer.Check()) {
|
||||
{
|
||||
if(net.group_timer.Enabled() && net.group_timer.Check())
|
||||
@ -445,6 +441,9 @@ int main(int argc, char** argv) {
|
||||
if(quest_timers.Check())
|
||||
quest_manager.Process();
|
||||
|
||||
if(RemoteCallProcessTimer.Check()) {
|
||||
RemoteCallSubscriptionHandler::Instance()->Process();
|
||||
}
|
||||
}
|
||||
}
|
||||
DBAsyncWork* dbaw = 0;
|
||||
|
||||
@ -68,8 +68,8 @@ void RemoteCall(const std::string &connection_id, const std::string &method, con
|
||||
}
|
||||
|
||||
void register_remote_call_handlers() {
|
||||
remote_call_methods["Zone::Subscribe"] = handle_rc_subscribe;
|
||||
remote_call_methods["Zone::Unsubscribe"] = handle_rc_unsubscribe;
|
||||
remote_call_methods["Zone.Subscribe"] = handle_rc_subscribe;
|
||||
remote_call_methods["Zone.Unsubscribe"] = handle_rc_unsubscribe;
|
||||
}
|
||||
|
||||
void handle_rc_subscribe(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms) {
|
||||
|
||||
@ -96,7 +96,7 @@ void RemoteCallSubscriptionHandler::OnEvent(std::string method, std::vector<std:
|
||||
return;
|
||||
}
|
||||
|
||||
std::string func = "WebInterface::DispatchEvent::" + method;
|
||||
std::string func = "On." + method;
|
||||
std::vector<std::string> &conns = registered_events[method];
|
||||
if(conns.size() > 0) {
|
||||
auto &iter = conns.begin();
|
||||
@ -158,5 +158,4 @@ void RemoteCallSubscriptionHandler::ClearConnection(std::string connection_id) {
|
||||
void RemoteCallSubscriptionHandler::ClearAllConnections() {
|
||||
registered_events.clear();
|
||||
connection_ids.clear();
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user