Get Rank in game.php

Game development with Board Game Arena Studio
Post Reply
User avatar
Rudolf
Posts: 557
Joined: 24 December 2011, 23:04

Get Rank in game.php

Post 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?
User avatar
Victoria_La
Posts: 620
Joined: 28 December 2015, 20:55

Re: Get Rank in game.php

Post 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...
User avatar
Rudolf
Posts: 557
Joined: 24 December 2011, 23:04

Re: Get Rank in game.php

Post 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 :)
User avatar
Woodruff
Posts: 412
Joined: 08 March 2014, 00:53

Re: Get Rank in game.php

Post 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
User avatar
Rudolf
Posts: 557
Joined: 24 December 2011, 23:04

Re: Get Rank in game.php

Post by Rudolf »

yes I know... but after it can be discovered and the login will be banned.
Post Reply

Return to “Developers”