Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:SendPlayerSearchRequest

From RoR Wiki

UI Lua API · Social functions
Version: WAR 1.4.8

Asks the server for a list of players matching search criteria.

SendPlayerSearchRequest(name, guildName, careerName, zoneIds, minRank, maxRank, advisorsOnly)

Arguments

name
wstring – Player name to search for; L"" for any.
guildName
wstring – Guild name to search for; L"" for any.
careerName
wstring – Career name; L"" for any.
zoneIds
number-table – List of zone ids to search. The stock UI passes { -1 } to search all zones.
minRank
number – Lowest rank. Sent as an 8-bit value.
maxRank
number – Highest rank. Sent as an 8-bit value.
advisorsOnly
boolean – State of the stock UI's "include advisors only" check box.

Returns

Nothing.

Details

  • The client turns careerName into a career line id by matching it against the male and female career line names. An empty or unmatched name is sent as 0.
  • If minRank is greater than maxRank, the two are swapped.
  • The results are read with GetSearchList.
  • If there is no player object, or the Lua state is not available, nothing is sent.
  • The function needs at least seven arguments and only reads the last seven. advisorsOnly must be a real boolean.

Errors

None besides the generic Invalid Parameters message when an argument has the wrong type.

Example

From default/ea_socialwindow/source/socialwindowtabsearch.lua:

local includeAdvisorsOnly = ButtonGetPressedFlag( "SocialWindowTabSearchIncludeAdvisorsOnlyButton" )

SendPlayerSearchRequest(SocialWindowTabSearchEditBoxPlayerName.Text,
                        SocialWindowTabSearchEditBoxGuildName.Text,
                        SocialWindowTabSearchEditBoxCareerName.Text,
                        SocialWindowTabSearch.ZoneID,
                        minRank, maxRank,
                        includeAdvisorsOnly)

The stock UI clamps the ranks to 1–40 first; a comment there notes that the server only ignores -1 values.

See also