Page 1 of 1

Get Rank in game.php

Posted: 02 August 2017, 23:50
by Rudolf
Hi.
I would like to make the teams of players according to their ELO (the higher with the lower , and the two other together).
I know how to get rank in the javascript (client side), with gameui... So I Know how to use it in php after setup...
But I can get it only after complete refresh of the screen (gamesetup is already done).

I've not clue to do this in game.php during setup ('player_rank' field is not given in the table players, nor in the parameter players given in setup).

Is there a mean to access this during setup?

Re: Get Rank in game.php

Posted: 03 August 2017, 13:28
by Victoria_La
You asking good questions! I checked the players structure that is sent to the setupNewGame and it does not have ELO field (which would be nice)

These are fields which were in players

Code: Select all

This is example of player array send to setupNewGame php method
array(2) { 
 [2300663]=> array(7) { 
    ["player_name"]=> string(8) "laskava1" 
    ["player_canal"]=> string(32) "aa5ceb9e01f1367d4f4a42eaa535b0f0" 
    ["player_avatar"]=> string(6) "000000" 
    ["player_is_admin"]=> string(1) "0" 
    ["player_is_ai"]=> string(1) "0" 
    ["player_table_order"]=> string(1) "2" 
    ["beginner"]=> string(1) "1" 
 } 
 [2300662]=> array(8) { 
    ["player_name"]=> string(8) "laskava0" 
    ["player_canal"]=> string(32) "60d9d1240f012630bb8f6bf07cbf5139" 
    ["player_avatar"]=> string(10) "bf78772d42" 
    ["player_is_admin"]=> string(1) "1" 
    ["player_is_ai"]=> string(1) "0" 
    ["player_table_order"]=> string(1) "1" 
    ["player_colorprefs"]=> array(4) { 
       [0]=> string(6) "ff0000" 
       [1]=> string(6) "ffa500" 
       [2]=> string(6) "000000" 
       [3]=> string(6) "ffffff" 
    } 
    ["beginner"]=> string(1) "0" 
 } 
 }
 
So we need Een again to answer that...

Re: Get Rank in game.php

Posted: 12 August 2017, 23:02
by Rudolf
I ve found a way...
I use an intermediate state afertgamesetup in which I get back the ranks from javascript, then I save them.
but it s another trick I discovered,,, its not a easy way... and it lookks weird :)

Re: Get Rank in game.php

Posted: 18 August 2017, 22:53
by Woodruff
Hi.

Trouble is that getting this info by the client creates a breach for cheating... The player could send a different ELO than he actually have.
In this case that won't harm a lot, I admit. Moreover, this kind of cheating would be easy to point out by other players if teams are not set the like they should be.

If you really are paranoid like me, I'd suggest comparing what all clients send back to PHP as ELO and check there are identical.

Cheers,

Tchebychev

Re: Get Rank in game.php

Posted: 19 August 2017, 08:45
by Rudolf
yes I know... but after it can be discovered and the login will be banned.