game: add: docstring
This commit is contained in:
@ -13,7 +13,14 @@ class MatchMaking
|
||||
this.client = client
|
||||
this.searching = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {CallableFunction} receive_func
|
||||
* @param {CallableFunction} disconnect_func
|
||||
* @param {Number} mode The number of players in a game
|
||||
* @returns {undefined}
|
||||
*/
|
||||
async start(receive_func, disconnect_func, mode)
|
||||
{
|
||||
if (!await this.client.isAuthentificate())
|
||||
@ -36,6 +43,7 @@ class MatchMaking
|
||||
this._socket.onclose = this.onclose.bind(this);
|
||||
}
|
||||
|
||||
|
||||
onclose(event)
|
||||
{
|
||||
this.stop();
|
||||
@ -44,8 +52,10 @@ class MatchMaking
|
||||
|
||||
async stop()
|
||||
{
|
||||
if (this._socket)
|
||||
this._socket.close()
|
||||
this._socket = undefined
|
||||
this.searching = false;
|
||||
this._socket.close()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user