diff --git a/web_interface/method_handler.cpp b/web_interface/method_handler.cpp index fc01538a5..a02f76b9b 100644 --- a/web_interface/method_handler.cpp +++ b/web_interface/method_handler.cpp @@ -8,16 +8,16 @@ extern std::map 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() diff --git a/web_interface/test/we.html b/web_interface/test/we.html index 70147c2ba..5095da0a8 100644 --- a/web_interface/test/we.html +++ b/web_interface/test/we.html @@ -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") { } }; diff --git a/world/remote_call.cpp b/world/remote_call.cpp index eb71d9fdd..902220dae 100644 --- a/world/remote_call.cpp +++ b/world/remote_call.cpp @@ -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 ¶ms) { diff --git a/zone/mob.cpp b/zone/mob.cpp index 42b093caa..9a1258b70 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -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); } } diff --git a/zone/net.cpp b/zone/net.cpp index cb88502c5..f89fa165a 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -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; diff --git a/zone/remote_call.cpp b/zone/remote_call.cpp index 7f68e7ef9..071e14ede 100644 --- a/zone/remote_call.cpp +++ b/zone/remote_call.cpp @@ -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 ¶ms) { diff --git a/zone/remote_call_subscribe.cpp b/zone/remote_call_subscribe.cpp index 69440e520..997911a89 100644 --- a/zone/remote_call_subscribe.cpp +++ b/zone/remote_call_subscribe.cpp @@ -96,7 +96,7 @@ void RemoteCallSubscriptionHandler::OnEvent(std::string method, std::vector &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(); - }