Changed a bunch of function names to be shorter but still descriptive

This commit is contained in:
KimLS
2014-08-02 14:31:39 -07:00
parent ae30d8b257
commit 379ecc655c
7 changed files with 22 additions and 24 deletions
+6 -6
View File
@@ -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()
+5 -5
View File
@@ -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>