Diarkis Server Template - MatchMaker With UDP and/or TCP Server
We explain the sample custom commands for Diarkis MatchMaker.
There are two sample matchmaking implemented for UDP and/or TCP server.
Sample Matching IDs
RankMatch
rank is range of 5
RateAndPlay
rate is range of 1
play is range of 1
MatchMaker Add Command For UDP/RUDP and TCP
MatchMaker add command creates a new room and adds to MatchMaker to be searched and found.
Client receives a response with ver:2 and cmd:100 to evaluate success or failure of the command.
Client raises On Room Creation event if successful.
Command Version and ID
Payload
Endianness is Big Endian.
String List
Property Map
Property Value, size, and Property Name may repeat as a set of data.
MatchMaker Search Command For UDP/RUDP and TCP
MatchMaker search finds rooms that matches the given properties (conditions) and join the found room.
Client receives a response with ver:2 and cmd:102 to evaluate success or failure of the command.
Remote clients that already matched receives a server push with ver:2 and cmd:103 to notify the matched room is now full.
Remote clients that already matched raise On Member Join event on successful search.
Command Version and ID
Payload
String List
size and Matching ID may repeat as a set of data.
Property Map
Property Value, size, and Property Name may repeat as a data set.
P2P Address Report Command For UDP/RUDP and TCP
The command is used to report the client's public address meant for peer-to-peer communication.
This command assumes the client has joined a room.
Command Version and ID
Payload
Client Address is a byte array encoded UTF8 string.
P2P Initialize Command For UDP/RUDP and TCP
Starts peer-to-peer communication with all members of the room the client is in.
Client receives a response with ver:2 and cmd:111 to evaluate success or failure of the command.
All remote clients that are members of the room raise On Member Broadcast with a list of other client's addresses.
The clients may use those addresses to initiate peer-to-peer communication immediately.
Command Version and ID
Payload
Empty payload.
Payload Of On Member Broadcast
String List
size and Client Address may repeat as a set of data.
Last updated