mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-16 08:42:25 +00:00
Zone.GetEntityAttributes
Zone.SetEntityAttribute
This commit is contained in:
parent
ee8b950df1
commit
9eb41c7b0d
@ -17,6 +17,8 @@ void register_authorized_methods()
|
||||
authorized_methods["Zone.GetInitialEntityPositions"] = std::make_pair(10, handle_method_zone);
|
||||
authorized_methods["Zone.MoveEntity"] = std::make_pair(10, handle_method_zone);
|
||||
authorized_methods["Zone.Action"] = std::make_pair(10, handle_method_zone);
|
||||
authorized_methods["Zone.GetEntityAttributes"] = std::make_pair(10, handle_method_zone);
|
||||
authorized_methods["Zone.SetEntityAttribute"] = std::make_pair(10, handle_method_zone);
|
||||
authorized_methods["World.GetFileContents"] = std::make_pair(10, handle_method_world);
|
||||
authorized_methods["World.SaveFileContents"] = std::make_pair(10, handle_method_world);
|
||||
}
|
||||
|
||||
@ -56,6 +56,8 @@ void register_remote_call_handlers() {
|
||||
remote_call_methods["Zone.GetInitialEntityPositions"] = handle_rc_relay;
|
||||
remote_call_methods["Zone.MoveEntity"] = handle_rc_relay;
|
||||
remote_call_methods["Zone.Action"] = handle_rc_relay;
|
||||
remote_call_methods["Zone.GetEntityAttributes"] = handle_rc_relay;
|
||||
remote_call_methods["Zone.SetEntityAttribute"] = handle_rc_relay;
|
||||
remote_call_methods["World.GetFileContents"] = handle_rc_get_file_contents;
|
||||
remote_call_methods["World.SaveFileContents"] = handle_rc_save_file_contents;
|
||||
}
|
||||
|
||||
@ -83,6 +83,8 @@ void register_remote_call_handlers() {
|
||||
remote_call_methods["Zone.Unsubscribe"] = handle_rc_unsubscribe;
|
||||
remote_call_methods["Zone.GetInitialEntityPositions"] = handle_rc_get_initial_entity_positions;
|
||||
remote_call_methods["Zone.MoveEntity"] = handle_rc_move_entity;
|
||||
remote_call_methods["Zone.GetEntityAttributes"] = handle_rc_get_entity_attributes;
|
||||
remote_call_methods["Zone.SetEntityAttribute"] = handle_rc_set_entity_attribute;
|
||||
remote_call_methods["Zone.Action"] = handle_rc_zone_action;
|
||||
}
|
||||
|
||||
@ -263,4 +265,46 @@ void handle_rc_zone_action(const std::string &method, const std::string &connect
|
||||
Mob *ent = entity_list.GetMob(atoi(params[1].c_str()));
|
||||
if (ent){ ent->Kill(); }
|
||||
}
|
||||
}
|
||||
|
||||
void handle_rc_get_entity_attributes(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms) {
|
||||
std::string error;
|
||||
std::map<std::string, std::string> res;
|
||||
|
||||
if (params.size() != 1) {
|
||||
error = "Missing function data";
|
||||
std::cout << error << "\n" << std::endl;
|
||||
RemoteCallResponse(connection_id, request_id, res, error);
|
||||
return;
|
||||
}
|
||||
|
||||
Mob *ent = entity_list.GetMob(atoi(params[0].c_str()));
|
||||
if (ent){
|
||||
res["ent_id"] = itoa(ent->GetID());
|
||||
res["clean_name"] = ent->GetCleanName();
|
||||
res["name"] = ent->GetName();
|
||||
res["race"] = itoa(ent->GetRace());
|
||||
res["class"] = itoa(ent->GetClass());
|
||||
RemoteCallResponse(connection_id, request_id, res, error);
|
||||
}
|
||||
}
|
||||
|
||||
void handle_rc_set_entity_attribute(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms) {
|
||||
std::string error;
|
||||
std::map<std::string, std::string> res;
|
||||
|
||||
if (params.size() != 3) {
|
||||
error = "Missing function data";
|
||||
std::cout << error << "\n" << std::endl;
|
||||
RemoteCallResponse(connection_id, request_id, res, error);
|
||||
return;
|
||||
}
|
||||
|
||||
Mob *ent = entity_list.GetMob(atoi(params[0].c_str()));
|
||||
if (ent){
|
||||
if (params[1] == "race"){
|
||||
ent->SendIllusionPacket(atoi(params[2].c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -34,6 +34,8 @@ void handle_rc_unsubscribe(const std::string &method, const std::string &connect
|
||||
void handle_rc_get_initial_entity_positions(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms);
|
||||
void handle_rc_move_entity(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms);
|
||||
void handle_rc_zone_action(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms);
|
||||
void handle_rc_get_entity_attributes(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms);
|
||||
void handle_rc_set_entity_attribute(const std::string &method, const std::string &connection_id, const std::string &request_id, const std::vector<std::string> ¶ms);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user