Login system is obligatory?

Posted by AouabAdYT
I'm creating a game , but I already did a login system with my SQL Server , is it obligatory to change everything? It will take forever and I already did some variables (money,diamonds...)
Please help

Replies (7)

Last message on 16 Mar 2018

AouabAdYT (Topicstarter) on 8 Mar 2018, 22:49:56
I'm okay with that,

The problem thought is , i don't really know how to do it in that way, how should I define every client's username, how can i send and recieve my custom variables?
Size43 (Administrator) on 11 Mar 2018, 19:09:40
Please see this tutorial for sending and receiving custom variables.

You'll need some way to map users in your database to guest accounts, for example prefixing your user ID with a random string.
AouabAdYT (Topicstarter) on 11 Mar 2018, 22:02:18
Oh thanks!
What i actually did is that when people log in into their database , they are forced to login as a guest with their database name
It might be a good way.

Now i'm having problems with drawing the chat (It draws the chat box but i can't chat)
And also for other player : when i join with two clients , it doesn't draw the other player :/
AouabAdYT (Topicstarter) on 11 Mar 2018, 22:25:39
Here are all the codes :

if test = "ERROR"
{
    a = "Could not find a server because you may be offline! Leaving the game.."
    z = true
}
else
{
    gms_login_set_username(global.sum)
    gms_login_execute(callback_login)
    z = false
}


Global.sum is the name of the player got from the database after logging in
This action is done while loading into the ingame , not in the game start

But
gms_settings(true,1,objPlayer,objOtherPlayer)
Is done at the game start

Here's my chat code:

//This is in objPlayer Create Event
gms_chat_toggle(true)
gms_chat_colors(c_black,c_silver,0.7)
gms_chat_keys(ord("T"),vk_enter,-1)

This is in objPlayerInterface (The object that draws the interface) in draw event
//I just copied what is important there is some addionation code...
d3d_transform_set_identity()
d3d_set_projection_ortho(0,0,1280,720,0);
gms_chat_bind_pos(0,356,310,630)
gms_chat_draw()
AouabAdYT (Topicstarter) on 12 Mar 2018, 20:28:21
Oh nevermind,

I just fixed this issue, it's only about the player's username wich he logs in , i think it shouldn't have any spaces , and it is always prefix with "Guest_" right?

How can i disable that?
How can i do so that player's own username is displayed in the chat?
Size43 (Administrator) on 16 Mar 2018, 19:02:47
If the users don't have an account, their name will be prefixed with "Guest_". You might need to do some more translation if there is someone that has registered an account with GameMaker Server, as you cannot login as guest with the name of a registered account.

There's no built-in way to change the display name, you'll have to add that yourself.
Size43 (Administrator) on 3 Mar 2018, 11:59:06
You may use other login systems if you want to. (obviously only as long as those systems do nothing illegal)

However, do note that GameMaker Server can only do server-side verification of usernames and accounts if you use the default login system.