Having problem with send_message_to_url (module_scripts)

正在查看此主题的用户

状态
不接受进一步回复。

Alphα

Section Moderator
Hello there. I can't manage to find any solution to my problem since few days...
I'm tring to export some player's datas to a website through the operation send_message_to_url. For now I've tried 3 cases and no one work. I can't manage to go to the web page to process the php with the datatbase.

("alpha_add_kill_death",
[
(try_begin),
(multiplayer_is_server),
(store_script_param, ":dead_agent_no", 1),
(store_script_param, ":killer_agent_no", 2),

(agent_get_player_id, ":killer_agent_player_id", ":killer_agent_no"),
(agent_get_player_id, ":dead_agent_player_id", ":dead_agent_no"),
 
(neq,":dead_agent_player_id",":killer_agent_player_id"),#Mustn't the same player.. suicid ..
(str_store_player_username,s1,":killer_agent_player_id"),
(str_store_player_username,s2,":dead_agent_player_id"),
(player_get_unique_id,reg1,":killer_agent_player_id"),
(player_get_unique_id,reg2,":dead_agent_player_id"),
 
(try_begin),
(try_for_players, ":eek:ther_players"),
(player_is_active,":eek:ther_players"),
(multiplayer_send_string_to_player,":eek:ther_players",multiplayer_event_show_server_message,"str_alpha_stats_killer_agent"),
(multiplayer_send_string_to_player,":eek:ther_players",multiplayer_event_show_server_message,"str_alpha_stats_dead_agent"),
(try_end),
# Event 0 :dead_agent_no var
# Event 1 :killer_agent_no var

#third try
(str_encode_url, reg3, "@http://alphas-projects.com/content/ng_stats.php"),
(send_message_to_url, "@unique_id=98&local_id=99&username={s1}&event=1", reg3),

#second try
(send_message_to_url, "str_send_http_request_dead_agent"),
(send_message_to_url, "str_send_http_request_killer_agent"),

# first try
(send_message_to_url_advanced, "@http://alphas-projects.com/content/ng_stats.php?unique_id=98&local_id=99&username={s2}&event=0", ""),
(send_message_to_url_advanced, "@http://alphas-projects.com/content/ng_stats.php?unique_id=98&local_id=99&username={s1}&event=1", ""),
(display_message, "@{!}: Send stuff to webserver!"),
(server_add_message_to_log,"str_alpha_stats_killer_agent"),
(server_add_message_to_log,"str_alpha_stats_dead_agent"),
(try_end),
(try_end),
]
),


插入代码块:
#alpha
("send_http_request_dead_agent", "http://alphas-projects.com/content/ng_stats.php?unique_id=98&local_id=99&username={s2}&event=0"),
("send_http_request_killer_agent", "http://alphas-projects.com/content/ng_stats.php?unique_id=98&local_id=99&username={s1}&event=1"),
("alpha_stats_dead_agent", "[Webserver] Receiving dead_agent ({s2}) unique_id ({reg2}) local_id ({reg0})."),
("alpha_stats_killer_agent", "[Webserver] Receiving killer_agent ({s1}) unique_id ({reg1}) local_id ({reg0})."),

As you can see below, I tried many possibilities to get this function called.
Atm, I never got any solutions.

I'm looking for some help  :idea:

Regards,
Alpha
 
Put this atthe beggining fo the script:
(display_message, "@Script got called!!!!"),
(try_for_range, ":c_player", 0, 256),
    (player_is_active, ":c_player"),
    (multiplayer_send_string_to_player, ":c_player", multiplayer_event_show_server_message, "@Script got called!!!!"),
(try_end),

1. When stuffs should happen, do you see the message 'Script got called!!!!"?
2. How are you testing? Do you host the server via ingame hosting button or via a dedicated server?
3. Do you test this with a bot or with another player?

Answer ALL questions.
 
The_dragon 说:
Put this atthe beggining fo the script:
(display_message, "@Script got called!!!!"),
(try_for_range, ":c_player", 0, 256),
    (player_is_active, ":c_player"),
    (multiplayer_send_string_to_player, ":c_player", multiplayer_event_show_server_message, "@Script got called!!!!"),
(try_end),

1. When stuffs should happen, do you see the message 'Script got called!!!!"?
2. How are you testing? Do you host the server via ingame hosting button or via a dedicated server?
3. Do you test this with a bot or with another player?


Answer ALL questions.


Hello,

1. I've already some message who appears in the chat ingame. So yes, I got your message when I made a kill.

2. Via dedicated server. Hosted. You can test it by yourself on alpha_devMapTest

3. All are valid kills for now. So If I kill a horse or a bot or a player it works. I will edit that as soon as I got something with the http request.


:idea: Maybe add me on steam to point this easier.
 
_Sebastian_ 说:
Check if script_game_receive_url_response get's called and if yes, display it's response.

You mean I've to display those variables ?
插入代码块:
(store_script_param, ":num_integers", 1),
(store_script_param, ":num_strings", 2),

 
Yup.
Also display s0 (if you're receiving a string) this usually contains an error message if the request failed.
 
Hey back.

I've debugged...

插入代码块:
("alpha_add_kill_death",
		[
		(server_add_message_to_log,"@script is called 0"),
		(try_for_range, ":c_player", 0, 256),
			(player_is_active, ":c_player"),
				(multiplayer_send_string_to_player, ":c_player", multiplayer_event_show_server_message, "@Script got called!!!!"), 
		(try_end),
			(try_begin),
				(multiplayer_is_server),
				(server_add_message_to_log,"@script is called 1"),
				(store_script_param, ":dead_agent_no", 1),
				(store_script_param, ":killer_agent_no", 2),
				
				(agent_get_player_id, ":killer_agent_player_id", ":killer_agent_no"),
				(agent_get_player_id, ":dead_agent_player_id", ":dead_agent_no"),
			  
				(neq,":dead_agent_player_id",":killer_agent_player_id"),#Mustn't the same player.. suicid ..
				(str_store_player_username,s1,":killer_agent_player_id"),
				(str_store_player_username,s2,":dead_agent_player_id"),
				(player_get_unique_id,reg1,":killer_agent_player_id"),
				(player_get_unique_id,reg2,":dead_agent_player_id"),
		   
				(try_begin),
					(server_add_message_to_log,"@script is called 2"),
					(try_for_players, ":other_players"), 
						(player_is_active,":other_players"),
							(multiplayer_send_string_to_player,":other_players",multiplayer_event_show_server_message,"str_alpha_stats_killer_agent"), 
							(multiplayer_send_string_to_player,":other_players",multiplayer_event_show_server_message,"str_alpha_stats_dead_agent"), 
							(server_add_message_to_log,"@script is called 3"),
					(try_end),
					(server_add_message_to_log,"@script is called 4"),
					# Event 0 :dead_agent_no var
					# Event 1 :killer_agent_no var
					
					# third try
					# (str_encode_url, reg3, "@http://alphas-projects.com/content/ng_stats.php"),
					# (send_message_to_url, "@unique_id=98&local_id=99&username={s1}&event=1", reg3),
					
					# second try
					(send_message_to_url, "str_send_http_request_dead_agent"),
					(send_message_to_url, "str_send_http_request_killer_agent"),
					(server_add_message_to_log,"@script is called 5"),
					# first try
					# (send_message_to_url_advanced, "@http://alphas-projects.com/content/ng_stats.php?unique_id=98&local_id=99&username={s2}&event=0", ""),
					# (send_message_to_url_advanced, "@http://alphas-projects.com/content/ng_stats.php?unique_id=98&local_id=99&username={s1}&event=1", ""),
					(server_add_message_to_log,"str_alpha_end"),
					# (server_add_message_to_log,"str_alpha_stats_dead_agent"),
				(try_end),		
			(try_end),
		]
	),

插入代码块:
#alpha
("send_http_request_dead_agent", "http://alphas-projects.com/content/ng_stats.php?unique_id=98&local_id=99&username={s2}&event=0"),
("send_http_request_killer_agent", "http://alphas-projects.com/content/ng_stats.php?unique_id=98&local_id=99&username={s1}&event=1"),
("alpha_stats_dead_agent", "[Webserver] Receiving dead_agent ({s2}) unique_id ({reg2}) local_id ({reg0})."),
("alpha_stats_killer_agent", "[Webserver] Receiving killer_agent ({s1}) unique_id ({reg1}) local_id ({reg0})."),
("alpha_end", "end of the script"),

插入代码块:
18:16:34 -  <img=ico_headshot> AlphA 
 18:16:34 - script is called 0 
 18:16:34 - script is called 1 
 18:16:34 - script is called 2 
 18:16:34 - script is called 3 
 18:16:34 - script is called 4 
 18:16:34 - script is called 5 
 18:16:34 - end of the script




About the script_game_receive_url_response, nothing.

插入代码块:
("game_receive_url_response",
    [
      #here is an example usage
		(store_script_param, ":num_integers", 1),
		(store_script_param, ":num_strings", 2),
		(assign, reg10, ":num_integers"),
		(assign, reg11, ":num_strings"),
		(display_message, "@{!}DEBUG : NUM INTEGERS {reg10}"),
		(display_message, "@{!}DEBUG : NUM STRINGS {reg11}"),
		(display_message, "@{!}DEBUG : REG {s0}"),
		
    ]),
 
Is the webserver receiving anything from the gameserver?
Track the connection.

Edit
You can also test the http request through a browser, in case you didn't know.
So test it in order to ensure that the issue isn't caused by the webserver itself.
 
In order to speed up the process: He already tested it in the browser, that seems to work as far as I know.
 
_Sebastian_ 说:
Is the webserver receiving anything from the gameserver?
Track the connection.

Nothing. You can test by yourself.
http://alphas-projects.com/content/ng_stats.php?unique_id=99&local_id=98&username=test&event=0

Edit
You can also test the http request through a browser, in case you didn't know.
So test it in order to ensure that the issue isn't caused by the webserver itself.

Already done.
Don't think it's webserver side.


If you want to have a look.
There is my module_system : https://dl.dropboxusercontent.com/u/84919020/module_sys.rar



 
AlphA-FR 说:
About the script_game_receive_url_response, nothing.
Ofc there is an error message, just tested it on my own.
插入代码块:
404 Not Found

Not Found
The requested URL /content/ng stats.php was not found on this server.

Namakan 说:
In order to speed up the process: He already tested it in the browser, that seems to work as far as I know.
Yup confirmed, you got a new player added to your database btw. :wink:

That's really strange, the engine may can't handle the url for some reason.
 
_Sebastian_ 说:
AlphA-FR 说:
About the script_game_receive_url_response, nothing.
Ofc there is an error message, just tested it on my own.
插入代码块:
404 Not Found

Not Found
The requested URL /content/ng stats.php was not found on this server.

wut? Could send me what you done in this script?
 
I just displayed the received string, what else?

Btw...
.php is not needed after ng_stats ...I just wanted to mention it.
 
_Sebastian_ 说:
I just displayed the received string, what else?

Btw...
.php is not needed after ng_stats ...I just wanted to mention it.

I've already printed with :

插入代码块:
(store_script_param, ":num_integers", 1),
		(store_script_param, ":num_strings", 2),
		(assign, reg10, ":num_integers"),
		(assign, reg11, ":num_strings"),
		(display_message, "@{!}DEBUG : NUM INTEGERS {reg10}"),
		(display_message, "@{!}DEBUG : NUM STRINGS {reg11}"),
		(display_message, "@{!}DEBUG : REG {s0}"),

Nothing appear.
 
Is the game- and web-server located on the same machine?
Is is a rented server, or do you host it at home?
 
_Sebastian_ 说:
Is the game- and web-server located on the same machine?
Is is a rented server, or do you host it at home?

Rented server.
they aren't on the same machine.
 
For testing purposes;
Turn off all antivirus- and firewall-softwares, open all relevant ports on the router(if accessible) ... On both Machines
Then try again.
 
Any other idea ?
Did you have tested on an another website? Does there is no other possibility?

I can't go futher without this  :dead:
 
状态
不接受进一步回复。
后退
顶部 底部