Methods
-
<static> exitGameLobby()
-
Informs the server that the game configuration phase ended and the game can start.
-
<static> init(params)
-
Initialize the Phune Gaming SDK.
Parameters:
Name Type Description paramsObject Object containing all the options to configure the SDK. This includes the mandatory callback functions: onMatchPrepare, onMatchStart, onMoveValid, onMoveInvalid, onMatchEnd, as well as the optional callback functions: onServerMessage, onPlayerMessage and onKeyPress. -
<static> ready()
-
Informs the server that the client is ready to start the match.
-
<static> sendMessageToPlayer(messageDetails, sendTimeIntervalLimit)
-
Peer-to-peer message sent directly to another player.
Parameters:
Name Type Argument Description messageDetailsObject The content of the message to be sent. sendTimeIntervalLimitnumber <optional>
Do not allow sending more than one message within the specified time in milliseconds. If this is called more than once during this interval only the last message will be sent. -
<static> sendMessageToServer(messageDetails, isAnswerPublic, serializeRequest)
-
Send a message to the server-side rules. This message is specific to a game and will not be processed by the platform itself. The response from the server could either be sent to you only or to all players.
Parameters:
Name Type Argument Description messageDetailsObject The content of the message to be sent. isAnswerPublicboolean Whether the reply from the server's rules should be sent to all players or not. serializeRequestboolean <optional>
Whether the messages should be processed in order of arrival or can be executed in parallel. -
<static> sendMove(moveDetails, validate) → {boolean}
-
Send a move to the platform server.
Parameters:
Name Type Argument Description moveDetailsObject The move details. validatefunction <optional>
Optional function to validate the move before sending it to server. Returns:
True when the move is valid or when no validation function was provided.- Type
- boolean
-
<static> showMenu()
-
Asks the platform to show the game menu.