DWCEvalPlayerCallback

C Specification

#include <dwc.h>

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

Description

In peer matchmaking, this function is called each time a matching target player is found. The larger a player's return value is from this function, the easier it will be for that player to be selected as a connection target. Players with a return value of 0 or less will be excluded as matchmaking targets.

In the library, the specifications call for attempting a connection to introduce some variance for partners with the same evaluation value by shifting the value 28 bits to the left and adding a random number to the lower 8 bits when this function returns a positive value. If positive numbers larger than 0x007fffff are returned, they are all handled as if they were 0x007fffff.

Call the DWC_GetMatchIntValue or DWC_GetMatchStringValue function to get the matchmaking index keys used for player evaluation. These functions can only be used inside this callback function.

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

Arguments

index The index of the evaluation target player that the library uses. Pass this argument to the DWC_GetMatchIntValue or DWC_GetMatchStringValue function that is used to obtain the matchmaking index 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_GetMatch*Value,

Revision History

12/16/2005 Revised the descriptions of the function and the return value
11/01/2005 Initial version