#include <dwc.h>
typedef int(*) DWCEvalPlayerCallback(int index,
void *param);index |
Index used by the library to designate the player targeted for evaluation. Pass this argument to the DWC_GetMatchIntValue or DWC_GetMatchStringValue function used to get the matchmaking condition keys. |
param |
Parameters for the callback set by the DWC_ConnectToAnybodyAsync or DWC_ConnectToFriendsAsync function. |
Evaluation value. The higher this value, the higher the probability that a connection to that player will be attempted. The range of the value obtained is an int, but positive numbers higher than 0x007fffff are all handled as if they were 0x007fffff. If a value of 0 or less is returned, no connection is made with that player.
This player evaluation callback function is called each time a player targeted for matchmaking is found when performing peer matchmaking with or without friend specification. The larger the return value set by this function for a player, the greater the chance that the player is selected as a connection target. If a value of 0 or less is returned, the player in question is removed from the matchmaking targets. However, the absolute size of the evaluation value is not important. Likelihood of selection during matchmaking is determined by the ranking of the players found in order of their evaluation values. For example, even if the evaluation values are 1, 2, 3, and 10,000, respectively, the host having a value of 10,000 is not necessarily overwhelmingly likely to be selected.
Library internal specifications call for attempting to introduce some variance in connection partners with the same evaluation value, by shifting the value 8 bits to the left and appending a random number to the lower 8 bits when this function returns a positive value of 8,388,607 (0x007fffff) or less. If the return value is greater than 8,388,607, it is treated as 8,388,607.
To get the matchmaking condition keys used for player evaluation, use the DWC_GetMatchIntValue or DWC_GetMatchStringValue function. These functions can be used only inside this function.
Because it takes time for additional condition keys to be applied to the server, these functions will sometimes determine that no condition keys exist and return the default value (or default string), even if the application has set a condition key.
This callback function can be set with the DWC_ConnectToAnybodyAsync or DWC_ConnectToFriendsAsync function.
For the changelog prior to 5.1 PR2, click here.
CONFIDENTIAL