Xaphan
Banned
I am making new scripts for Oasis because "inserts unnecessary story about them sort of being ripped off by renting scripts".
I am their tech and i'm doing this for free for them. Anyway. People are sick of the low HP at spawn trying to get this sorted for them, along with cutting current monthly server expenses.
To me the response looks fine and should be in compliance with the name server, but the responses are not firing or being received. I am done with the system just need to figure out why the response won't work.
integer and string counts are correct for filtering.
Nothing is working, name server is not having conflict or even working, perms are not being restricted.
Anyone know what is wrong? It must be something simple.
I am their tech and i'm doing this for free for them. Anyway. People are sick of the low HP at spawn trying to get this sorted for them, along with cutting current monthly server expenses.
To me the response looks fine and should be in compliance with the name server, but the responses are not firing or being received. I am done with the system just need to figure out why the response won't work.
integer and string counts are correct for filtering.
Nothing is working, name server is not having conflict or even working, perms are not being restricted.
Anyone know what is wrong? It must be something simple.
Code:
("game_receive_url_response", # called by the game when a response is received from a web server, if used
[(store_script_param, ":integer_count", 1),
(store_script_param, ":string_count", 2),
(assign, "$g_name_server_enabled", 1),
(try_begin), #spawn|player|********|****|*****|****|cheese|9099909909090999909090909|123|133733|333|7777|1|2|3|4|13|5|6|7|8|14|9|10|11|12|44|33|15|
(eq, ":integer_count", 22),
(eq, ":string_count", 7),
(assign, ":gold", reg3),
(assign, ":player_id", reg1),
(assign, ":unique_id", reg2),
(assign, ":head_item_id", reg5),
(assign, ":body_item_id", reg6),
(assign, ":gloves_item_id", reg7),
(assign, ":foot_item_id", reg8),
(assign, ":horse_id", reg9),
(assign, ":item_1_id", reg10),
(assign, ":item_2_id", reg11),
(assign, ":item_3_id", reg12),
(assign, ":item_4_id", reg13),
(assign, ":troop_id", reg14),
(assign, ":coordinate_x", reg15),
(assign, ":coordinate_y", reg16),
(assign, ":coordinate_z", reg17),
(assign, ":deadleave", reg18),
(assign, ":hp", reg19),
(assign, ":food_amount", reg20),
(assign, ":faction_id", reg21),
(player_is_active, ":player_id"),
(player_get_unique_id, ":uid", ":player_id"),
(eq, ":unique_id", ":uid"),
(str_store_player_username, s5, ":player_id"),
(str_store_string, s1, "@Loading character data..."),
(str_store_string, s2, "@Welcome {s5} to Nemesis! Your GUID is {reg2}."),
(str_store_string, s3, "@Your PIN is {s0} Do not share PIN!"),
(str_store_string, s4, "@You currently have {reg4} gold on the bank."),
(str_store_string, s5, "@Visit our website at www.pw-nemesis.com"),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s1),
(call_script, "script_player_adjust_gold", ":player_id", ":gold", 1),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s3),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s4),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s5),
(eq, ":deadleave", 0),
(try_begin),
(player_get_agent_id, ":agent_id", ":player_id"),
(agent_is_active, ":agent_id"),
(agent_is_alive, ":agent_id"),
(call_script, "script_change_faction", ":player_id", ":faction_id", change_faction_type_respawn),
(player_set_troop_id, ":player_id", ":troop_id"),
(agent_set_hit_points, ":agent_id", ":hp", 1),
(call_script, "script_cf_change_armour", ":agent_id", ":head_item_id"),
(call_script, "script_cf_change_armour", ":agent_id", ":body_item_id"),
(call_script, "script_cf_change_armour", ":agent_id", ":gloves_item_id"),
(call_script, "script_cf_change_armour", ":agent_id", ":foot_item_id"),
(gt, ":coordinate_x", 1),
(init_position, pos48),
(position_set_x, pos48, ":coordinate_x"),
(position_set_y, pos48, ":coordinate_y"),
(position_set_z, pos48, ":coordinate_z"),
(agent_set_position, ":agent_id", pos48),
(try_begin),
(gt, ":item_1_id", 0),
(agent_equip_item, ":agent_id", ":item_1_id"),
(gt, ":item_2_id", 0),
(agent_equip_item, ":agent_id", ":item_2_id"),
(gt, ":item_3_id", 0),
(agent_equip_item, ":agent_id", ":item_3_id"),
(gt, ":item_4_id", 0),
(agent_equip_item, ":agent_id", ":item_4_id"),
(try_end),
(try_begin),
(gt, ":horse_id", 200),
(lt, ":horse_id", 800),
(player_get_agent_id, ":player_agent_id", ":player_id"),
(agent_is_active, ":player_agent_id"),
(agent_is_alive, ":player_agent_id"),
(agent_get_position, pos1, ":player_agent_id"),
(position_move_x, pos1, 50),
(position_set_z_to_ground_level, pos1),
(set_spawn_position, pos1),
(spawn_horse, ":horse_id"),
(try_end),
(try_end),
(else_try),
(eq, ":deadleave", 1),
#deadleaved
(try_begin),
(send_message_to_url, "@http://naoasisgate.avalon-gaming.com/removedeadleave.php?uniqueid={reg2}"),
(call_script, "script_player_add_default_troop_items", ":player_id", ":troop_id"),
(call_script, "script_player_add_default_troop_armor", ":player_id", ":troop_id"),
(call_script, "script_player_add_spawn_items", ":player_id", 0),
(try_end),
(try_end),
(else_try),
(try_begin), #deposit|gold|from|********|bank|*****|9099909909090999909090909|1337|133733|333|17777|13333333|
(eq, ":integer_count", 6),
(eq, ":string_count", 6),
(assign, ":gold", reg3),
(assign, ":bank", reg4),
(assign, ":limit", reg5),
(player_is_active, ":player_id"),
(str_store_player_username, s3, ":player_id"),
(player_get_gold, ":gold_value", ":player_id"),
(gt, ":bank", ":limit"),
(str_store_string, s2, "@[!] Bank Limit Reached [!]"),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
(else_try),
(player_is_active, ":player_id"),
(str_store_player_username, s3, ":player_id"),
(player_get_gold, ":gold_value", ":player_id"),
(ge, ":gold_value", 5000),
(lt, ":bank", ":limit"),
(call_script, "script_player_adjust_gold", ":player_id", 5000, -1),
(store_add, ":plus", ":bank", 5000),
(assign, reg19, ":plus"),
(str_store_string, s2, "@Depositing 5000, {reg19} gold in account"),
(send_message_to_url, "@http://naoasisgate.avalon-gaming.com/deposit.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank=5000&deposit=5000"),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
(else_try),
(eq, ":gold_value", 0),
(str_store_string, s2, "@You dont have any money to deposit"),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
(else_try),
(lt, ":gold_value", 5000),
(lt, ":bank", ":limit"),
(player_get_gold, reg21, ":player_id"),
(store_add, ":plus", ":bank", ":gold_value"),
(call_script, "script_player_adjust_gold", ":player_id", ":gold_value", -1),
(send_message_to_url, "@http://naoasisgate.avalon-gaming.com/deposit.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank={reg21}&deposit=5000"),
(assign, reg20, ":plus"),
(str_store_string, s2, "@Depositing {reg21}, {reg20} gold in account"),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
(try_end),
(else_try),
(try_begin), #withdraw|gold|****|bank|9099909909090999909090909|1337|133733|333|17777|13333333|
(eq, ":integer_count", 6),
(eq, ":string_count", 4),
(assign, ":bank", reg4),
(player_is_active, ":player_id"),
(str_store_player_username, s3, ":player_id"),
(player_get_unique_id, ":uid", ":player_id"),
(eq, ":unique_id", ":uid"),
(eq, ":bank", 0),
(str_store_string, s2, "@You do not have enough money in your account"),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
(else_try),
(ge, ":bank", 5000),
(send_message_to_url, "@http://naoasisgate.avalon-gaming.com/withdraw.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank=5000"),
(store_sub, ":min", ":bank", 5000),
(assign, reg5, ":min"),
(str_store_string, s2, "@Withdrawing 5000, {reg5} gold in account"),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
(call_script, "script_player_adjust_gold", ":player_id", 5000, 1),
(else_try),
(lt, ":bank", 5000),
(player_is_active, ":player_id"),
(player_get_unique_id, ":uid", ":player_id"),
(eq, ":unique_id", ":uid"),
(send_message_to_url, "@http://naoasisgate.avalon-gaming.com/withdraw.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank={reg4}"),
(str_store_string, s1, "@Withdrawing {reg4}, 0 gold in account"),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s1),
(call_script, "script_player_adjust_gold", ":player_id", ":bank", 1),
(try_end),
(else_try),
(try_begin),
(eq, ":integer_count", ),
(eq, ":string_count", ),
(assign, ":troop_id", reg14),
(player_is_active, ":player_id"),
(player_set_troop_id, ":player_id", ":troop_id"),
(try_end),
(else_try),
(ge, ":integer_count", 1),
(assign, ":return_code", reg0),
(try_begin), # negative return codes are internal or configuration errors, not requiring action
(lt, ":return_code", 0),
(server_add_message_to_log, "str_name_server_error_code_reg0"),
(else_try), # return code 0 is success, don't kick the player
(eq, ":return_code", 0),
(this_or_next|lt, ":integer_count", 4), # admin permissions not received
(eq, reg3, -1), # admin permissions not set
(else_try),
(ge, ":integer_count", 3),
(ge, ":string_count", 1),
(assign, ":player_id", reg1),
(assign, ":unique_id", reg2),
(player_is_active, ":player_id"),
(player_get_unique_id, ":player_unique_id", ":player_id"),
(eq, ":player_unique_id", ":unique_id"),
(try_begin), # positive return codes are for rejecting the player
(gt, ":return_code", 0),
(try_begin),
(eq, ":return_code", 4),
(assign, ":rejection_string_id", "str_kicked_not_registered"),
(else_try),
(eq, ":return_code", 3),
(assign, ":rejection_string_id", "str_kicked_using_invalid_name"),
(else_try),
(eq, ":return_code", 2),
(assign, ":rejection_string_id", "str_kicked_using_other_clan_tag"),
(else_try),
(assign, ":rejection_string_id", "str_kicked_using_other_players_name"),
(try_end),
(multiplayer_send_2_int_to_player, ":player_id", server_event_preset_message, ":rejection_string_id", preset_message_error|preset_message_log),
(store_mission_timer_a, ":time"), # kick the player after a short delay to try ensure they see the rejection message
(val_add, ":time", name_server_kick_delay_interval),
(player_set_slot, ":player_id", slot_player_kick_at_time, ":time"),
(str_store_string, s10, ":rejection_string_id"),
(server_add_message_to_log, "str_name_server_log_s10"),
(try_end),
(try_begin), # admin permissions were received
(ge, ":integer_count", 4),
(player_is_admin, ":player_id"),
(assign, ":admin_permissions", reg3),
(val_max, ":admin_permissions", 0),
(call_script, "script_player_set_admin_permissions", ":player_id", ":admin_permissions"),
(multiplayer_send_int_to_player, ":player_id", server_event_admin_set_permissions, ":admin_permissions"),
(eq, ":admin_permissions", 0), #passleak
(player_set_is_admin, ":player_id", 0), #passleak
(kick_player, ":player_id"), #passleak
(try_end),
(else_try),
(server_add_message_to_log, "str_name_server_invalid_response"),
(try_end),
(try_end),
]),