Converting a playername to player_id

Posted by Helghast_01
I want to be able to send "invitations to game sessions" directly to players based on their gamemaker server user name.
I figured it would be best to just send a p2p invitation directly to that player, but without their player_id I can't tell the p2p script who to send the invitation to without somehow converting the playername into a player_id.
The point is to be able to invite people from outside of the game session, so looping through "current session players" is not a solution here.
Does anyone have a clue if using "p2p_all_in_game" to send that invitation to everyone but ignore it for those who aren't supposed to be the ones invited is a vialid and proper solution or is there a better way?

Replies (1)

Last message on 25 Mar 2023

Size43 (Administrator) on 25 Mar 2023, 19:44:38
Using p2p_all_in_game should work. I can imagine it feels "wrong" to do it this way (and I'd agree), but there's no way to get the player IDs of players that are not in your session otherwise. And given that GameMaker Server has been end-of-life for a while, you shouldn't expect any more updates.