#include <dwc.h>
u8 DWC_AddMatchKeyInt(u8 keyID,
const char *keyString,
const int *valueSrc);| keyID | Specify 0 when getting a new keyID.If you specify an additional key ID that is already in use, valueSrc will be reset if the same keyString as the one in use is passed. However, nothing will be done if a different keyString is passed. A maximum of 31 keys can be set in the application. |
| keyString | Pointer to the string that identifies the key. The string is copied and maintained in the library. Do not use the same key name with a different key ID. |
| valueSrc | Pointer to the value that corresponds to the key. When the master server performs polling, the string is accessed using this pointer and uploaded to the server. |
The key ID for the added key. The function returns 0 when the key ID could not be added because of a parameter error or because the upper limit for key settings was exceeded. This function returns 0 even if it is called before the DWC_InitFriendsMatch function.
Adds a key (of type int) used as a matchmaking condition.
The added key can be used in the matchmaking condition string for the DWC_ConnectToAnybodyAsync function or in the player ranking callback function (DWCEvalPlayerCallback) for the DWC_ConnectToAnybodyAsync and DWC_ConnectToFriendsAsync functions.
However, the value corresponding to the key is only notified to the matchmaking server every 10 seconds at best, so there is a possibility that a value older than that actually set by the other party will be accessed at the stage in the process above where conditions are evaluated. Therefore, be aware that there is a possibility of matchmaking with unintended parties if this value is changed dynamically. Also, even if this value is not changed dynamically, in extremely rare cases, there is a possibility that an old value will be accessed by the other party due to a situation such as restarting matchmaking again immediately after matchmaking could not complete normally.
If this cannot be allowed, the only resolution is to confirm the conditions after matchmaking.
All data related to the added key is cleared when the matchmaking completes, so the key must be registered again the next time matchmaking is performed.
The total combined length for all keyString values in the application can be no greater than 159 characters. Each keyString value has one separator character added to it, so you must add 1 to the length of the specified string when considering string length. If the keyString value total is greater than 159 characters, the DWC_GetMatchIntValue function returns the default value for any matchmaking indicator keys in excess of the 159 characters.
The total combined length of the keyString / valueSrc values set throughout the application must be no greater than 2048 bytes.
It is no problem if strings of several to dozens of bytes are in valueSrc, but do not set any relatively large amounts of data, such as text encoded as binary data.
A blank character (" ") cannot be specified in the string corresponding to the key. If a NULL character is specified, the DWC_GetMatchIntValue function returns the default value.
Note: Some strings cannot be used for key names. Do not use the following key names.
| country | region | hostname | gamename | gamever | hostport | mapname | gametype | gamevariant |
| numplayers | numteams | maxplayers | gamemode | teamplay | fraglimit | teamfraglimit | timeelapsed | timelimit |
| roundtime | roundelapsed | password | groupid | player_ | score_ | skill_ | ping_ | team_ |
| deaths_ | pid_ | team_t | score_t | dwc_pid | dwc_mtype | dwc_mresv | dwc_mver | dwc_eval |
For the change log prior to 5.1 PR2, click here.
CONFIDENTIAL