GameMaker Studio · GML
Players
Each player gets an automatic identity the first time the game runs and keeps it across sessions, with no login screens. The identity is stored locally (gamdato.dat); an internet connection is required for the initial setup.
Retrieving Player Info
gmda_getPlayername() // player nickname (sync)
gmda_getPlayerid() // unique player key (sync)Never show the player ID in production.
Changing Player Name
Change the display name and read newname_completed from the queue. The name must be 2-30 characters; the server validates uniqueness and rejects anything invalid.
if (gmda_status()) {
gmda_setNewname("NewPlayerName"); // -> newname_completed
}
// in the poll loop:
case "newname_completed":
if (e.success) show_debug_message("name is now " + e.player_name);
break;// newname_completed -> on success:
{ "event": "newname_completed", "success": true, "player_name": "NewName" }
// on failure: success is false and e.status == -1 means the name is takenInvitability
Read or set whether other players may send this player friend or group invites.
gmda_getInvitability(); // -> invitability_loaded
gmda_setInvitability(true); // -> invitability_changed