|
online scoreboard help
#440739
04/30/14 19:54
04/30/14 19:54
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Hi, I think this is more for people who have used fogman's online scoreboard - but maybe not so please keep reading I have successfully implemented fogman's online scoreboard into my game, and it works fine -> If I don't use an important feature.
webscore_send(name_1_str,"textfile",str_for_num(NULL,score_count),str_for_num(NULL,stage_count));
What you see here ^^ is what I would like to send (score and stage) When returning values
return_code=webscore_get("temp.txt","textfile");
Both Score and Stage return as stage. If However, I set only one or the other
webscore_send(name_1_str,"textfile",str_for_num(NULL,score_count),"");
This returns the score. and if I swap "" with stage_count it gives the proper stage. Never both Both gives me 2 stage counts
Last edited by DLively; 04/30/14 20:27.
|
|
|
Re: online scoreboard help
[Re: DLively]
#440740
04/30/14 20:29
04/30/14 20:29
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
Serious User
|
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
Some more code would be helpful xD IDK this fogman code, I did it myself since my friend loves php^^ EDIT: Would be nice to know whats in return_code and how you split the information (code)
Last edited by Ch40zzC0d3r; 04/30/14 20:59.
|
|
|
Re: online scoreboard help
[Re: Ch40zzC0d3r]
#440747
05/01/14 00:28
05/01/14 00:28
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Im so sorry, but I just don't understand This is splitting your return string. Maybe wrong splitter or something. Just debug a littl Are you suggesting that you see the answer to the problem?
Last edited by DLively; 05/01/14 00:28.
|
|
|
Re: online scoreboard help
[Re: Realspawn]
#440813
05/02/14 18:57
05/02/14 18:57
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
OP
Serious User
|
OP
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Okay I've looked into this more - I've noted that it is not the splitter. the splitter works fine. It seems to be the webscore_send: I know this because If I open the .txt file stored in my server after its been created the score is 50 and the time is 50. 50 = stage 50.
var webscore_send(STRING* name,STRING* scores_file,STRING* score,STRING* time)
{
if(!load_web_dll()) return -1;
STRING* send=str_create(WEBSCORE_SCRIPT);
str_cat(send,"?action=add&key=");
str_cat(send,webscore_clean(WEBSCORE_KEY));
str_cat(send,"&name=");
str_cat(send,webscore_clean(name));
str_cat(send,"&scores_file=");
str_cat(send,webscore_clean(scores_file));
str_cat(send,"&score=");
str_cat(send,webscore_clean(score));
str_cat(send,"&time=");
//str_cat(send,time); // This is the original line
str_cat(send,webscore_clean(time));//I tried to replace it with this
var r=DownloadToFile(_chr(send),_chr("score_temp"));
if(!r) return -2;
STRING* res=file_get_contents("score_temp");
if(str_cmp(res,"")) r=-2;
else if(str_cmp(res,"0") || str_cmp(res,"2")) r=0;
else if(str_cmp(res,"1")) r=-3;
else r=-4;
file_delete("score_temp");
return r;
}
Perhaps someone else can see the error here?
|
|
|
|