Match Up
Provides simple drop-in matchmaking support for any networking system.
Match Class Reference

Info about a match More...

Public Member Functions

override bool Equals (object obj)
 
override int GetHashCode ()
 
 Match (long matchID=-1, Dictionary< string, MatchData > matchData=null)
 Create a new match. More...
 
string Serialize (int maxClients)
 Serialize the match for sending to the matchmaking server. More...
 

Static Public Member Functions

static bool operator!= (Match obA, Match obB)
 
static bool operator== (Match obA, Match obB)
 

Public Attributes

long clientID
 The id of this particular client. More...
 
long id
 The id of the match More...
 
Dictionary< string, MatchDatamatchData = new Dictionary<string, MatchData>()
 Data related to the match More...
 

Detailed Description

Info about a match

When you call CreateMatch() or GetMatchList() the Match object(s) will be created for you. matchData and clientID will not be set on clients until after the match is joined.

Constructor & Destructor Documentation

◆ Match()

Match ( long  matchID = -1,
Dictionary< string, MatchData matchData = null 
)

Create a new match.

You should never need to do this yourself. Matches are constructed for you by the Matchmaking when you call CreateMatch() or GetMatchList()

Parameters
matchID
matchData

Member Function Documentation

◆ Serialize()

string Serialize ( int  maxClients)

Serialize the match for sending to the matchmaking server.

Escapes quotes in the match name and serializes the data. You should not be using this directly unless really know what you're doing.

Parameters
maxClientsThe maximum number of clients that will be allowed to join this match.
Returns

Member Data Documentation

◆ clientID

long clientID

The id of this particular client.

This will be different for each client in the match. clientID is not set on clients until after the match is joined.

◆ id

long id

The id of the match

This will be the same for all clients in the match.

◆ matchData

Dictionary<string, MatchData> matchData = new Dictionary<string, MatchData>()

Data related to the match

This can be anything you want, but generally it is used to store the host's connection info.