Using Game_Receive_URL_Response

正在查看此主题的用户

Kodashi

Sergeant
I'm a bit confused as to how to use this function.  How should I call this function so that it properly relates to send_message_to_url?  It appears to behave differently than the send_message_to_url function..

Sorry for being so vague
 
Kodashi, this is your third short question thread today--please use the stickied Modder's Q&A thread. It's there for this explicit purpose, so we don't clog the board with little threads.
 
You should never call this script explicitly. You use send_message_to_url, which sends a http request with your data to the server. The server will automatically send an http response. If and when the game receives a proper response (code 200), the game will call that script.

You'll need to set up the server to send out pure text responses with each data element separated by a pipe. (This character: | )
 
Thanks.  That's a great hint that I wasn't aware of :smile:

Taking that advice into account, I've encountered a new new issue:

Code for send URL called within - multiplayer_server_player_joined_common
(store_script_param, ":player_no", 1),   
    (str_store_player_username, s1, ":player_no"),
    (player_get_unique_id, ":unique_id", ":player_no"),
    (assign, reg11, ":unique_id"),
(assign, reg2, ":player_no"),
(send_message_to_url, "@http://blahtest/db/CharGet.ASPX?Key={reg11}&Name={s1}"),

Code for Get URL Response

  ("game_receive_url_response",
    [
        (store_script_param, ":num_integers", 6),
        (store_script_param, ":num_strings", 6),
(display_message, "@{reg0}, {reg1}, {reg2}, {reg3}, {reg4}, {reg5}, {reg6}"),
(server_add_message_to_log, "@{reg0}, {reg1}, {reg2}, {reg3}, {reg4}, {reg5}, {reg6}"),
      ]),


Upon Compiling the module, I get the following error within the Scripts portion of the compile output:

Exporting scripts...
WARNING: Local variable never used: num_integers, at: game_receive_url_response
WARNING: Local variable never used: num_strings, at: game_receive_url_response


Datat from the webpage appears good:
1XXXXX|3|3|0|1000|1 

However, from ingame it is not but may be due to my IIS configuration.  I'm checking on that
0,2,0,0,0,0

I also get invalid parameter/OpCode errors ingame when (I think) the server is calling the Game_Receive_URL_Response.

In terms of wrapping my head around this, I think I am almost there :smile: 
 
Well, I've got this mostly figured out.  My Game_Receive_URL_response is returning expeceted data strings.

Anyone familiar with how the game decides when to use a register and when to use a string?
 
I think this one is more or less solved.  I've answered most of my own questions within the context of this thread :smile:
 
后退
顶部 底部