DWCEvalPlayerCallback

Syntax

#include <dwc.h>

typedef int (*DWCEvalPlayerCallback)( int   index,
                                      void* param );

Description

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 will be selected as the connection destination. If a value of 0 or less is returned, the player in question is removed as a matchmaking target.

In the library, the specifications call for attempting a connection to introduce some variance for partners with the same rating, by shifting the value 8 bits to the left and adding 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 rating, use the DWC_GetMatchIntValue or DWC_GetMatchStringValue function. These functions can only be used inside this function.

Because it takes time for added index keys to be applied by the server, a determination might be made that there is no index key and the default value (default string) might be returned, even if the index key is set on the application side.

This callback function can be configured with the DWC_ConnectToAnybodyAsync or DWC_ConnectToFriendsAsync function.

Arguments

index Index of the evaluation target player used by the library. Pass this argument to the DWC_GetMatchIntValue or DWC_GetMatchStringValue function used to obtain the matchmaking condition keys.
param The parameters for the callback designated with DWC_ConnectToAnybodyAsync and DWC_ConnectToFriendsAsync.

Return Values

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.

See Also

DWC_ConnectToAnybodyAsync
DWC_ConnectToFriendsAsync
DWC_GetLastErrorEx

Revision History

2008/04/28 Added the fact that time is required for an index key to be applied on the server.
2008/04/28 Corrected the incorrect description for the additon of a random element.
2005/12/16 Revised the function description and description of return values.
2005/11/01 Initial version.


CONFIDENTIAL