4月22日
GameDesire (Manual Part 2)
4.6.
room_info
room_info(gameId,filter,fields,sort=’’)
Basic function to retrieve info about rooms for given game at the server
|
gameId
|
That parameters describe game that we are interested in
|
|
filter
|
That field will be used to limit searches to one kind of
rooms.
Eg. we can fetch only rooms with admin.
You can use following params: priv, admin,
name of languages(eg. English), type of player, vip.
These options can be joined with |.! signs.
| - logical or eg. admin|priv will fetch data for
private or rooms with admins.
! – logical not eg.!admin will fetch data
for private or rooms with admins,
. – logical and eg admin.vip will return all
games that are for vip and has admins.
Examples
Vip – vip rooms
!vip – remaining(not vip rooms)
private – private rooms
!private – not private (public) rooms
You can also add additional
terms eg.
!private.vip – not private rooms for vip
!private.!vip – not private rooms for not vip (other players)
!private.!vip.admin – not private rooms for not vip with admin
!private.!vip.!admin – not private rooms for not vip without admin
You can go even further if you use |
Eg.
!private.vip.admin|private – not private rooms for vip with admin + all private rooms.
|
|
fields
|
That parameters describe games that we want to get. In
that way we can optimize query. Available queries:
|
*
|
We should get all fields for rooms
|
|
All
|
We should get all fields for rooms
|
|
Id
|
Internal id for room
|
|
Name
|
Name of the room
|
|
Status
|
Status of the room – currently we have two flags that can appear here: admin and priv
|
|
Players
|
number of players at room
|
|
Max
|
max. number of players (there are cases that there is
more than max number of players at room (reconnection of disconnected
players)
|
|
|
Sort
|
Returned table can be sorted by different parameters
(remember that only by one of returned parameters. Eg: When we sort game by players|name
– we will get data sorted first by number of players and then by name.
If before sort field there is ! – we reverse sort. Eg.
!players|name will first sort descending by number of players and
than by game name.
|
|
That function returns eg, for query room_info(game27,admin,*):
room_info =
{
ret
= 1
count
= 4
tbl
=
{
0
=
{
id
= 0
name
= Best Friends
status
= admin
players
= 2
max
= 100
}
1
=
{
id
= 1
name
= Pool Party
status
= admin
players
= 0
max
= 100
}
2
=
{
id
= 2
name
= The Deep End
status
= admin
players
= 0
max
= 100
}
3
=
{
id
= 3
name
= Dust In The Wind
status
= admin
players
= 0
max
= 100
}
}
}
|
4.7.
ranking
Ranking(gameId,secondary='',count=10,start=0,sortBy='')
That function retrieves info about ranking for one game
|
gameId
|
That parameters describe game that we are interested in
|
|
secondary
|
That parameter is used by some games:
·
In single word games it is used to select language,
·
In solitaires – to select variant,
·
In pinballs – to select mode
·
In jungle hunter – to select room
|
|
count
|
How many record do we want to retrieve
|
|
start
|
From that position we want to start
|
|
sortBy
|
Rankings for most games (except solitaires,pinballs and
jungle hunter) can be sorted by different param. You can select here used
param. Eg. if for snooker you will use RF – rankings will be sorted
descending by ranking, if you use !RF – rankings will be sorted ascending by
ranking.
|
That function returns both data and description for it.
|
That function returns eg, for query ranking(game4,0):
ranking =
{
ret
= 1
desc
=
{
rating
=
{
0
= R
1
= Rating
}
games_completed
=
{
0
= GC
1
= Games Completed
}
games_abandoned
=
{
0
= GA
1
= Games Abandoned
}
wins
=
{
0
= W
1
= Wins
}
loses
=
{
0
= L
1
= Loses
}
}
count
= 3
ranking
=
{
0
=
{
playerId
= 372
login
= Object
rating
= 4991
games_completed
= 6
games_abandoned
= 1
wins
= 0
loses
= 6
}
1
=
{
playerId
= 375
login
= bromba
rating
= 4984
games_completed
= 1
games_abandoned
= 1
wins
= 0
loses
= 1
}
2
=
{
playerId
= 373
login
= samuel
rating
= 4935
games_completed
= 6
games_abandoned
= 4
wins
= 5
loses
= 1
}
}
}
|
4.8.
ranking_find
RankingFind(gameId,name,sortBy='')
That function is used to look for player at ranking page.
|
gameId
|
That parameters describe game that we are interested in
|
|
name
|
Name(login) of searched user.
|
|
sortBy
|
Rankings for most games (except solitaires,pinballs and
jungle hunter) can be sorted by different param. You can select here used
param. Eg. if for snooker you will use RF – rankings will be sorted
descending by ranking, if you use !RF – rankings will be sorted ascending by
ranking.
|
|
That function returns eg, for query action= ranking_find(game4,bromba)
ranking_find =
{
ret
= 1
pos
= 2
}
|
4.9.
ladder
Deprecated – not available
4.10. ladder_find
Deprecated – not available