GML Ds lists and Multiplayer

C

CodeBlack

Guest
Hey there,

I just wanted to know if there is a way to sync a ds list, so all users on a server can acces it. Currently i am using gmnet Engine and i couldnt find a way to do so.

Player A clicks a Button and his name get added to a ds list.
Player B clicks the same button and his name gets added as well.
Player C now opens a dropwdown Menu wich uses this ds list, so he gets shown those Names as options.

I already have a working Dropdown menu, but right now nothing happens when you click it because there are no entries to use in the ds list.

greetings
CodeBlack
 
C

CodeBlack

Guest
mmm Seems like nobody knows that...
Any ideas how i could achieve the same effect without using ds lists? Something i can sync?

Im really stuck right now. I tried different approaches but nothing worked out so far.
Guess ill have to skip that part for now and work on some other mechanics :/

greetings
CodeBlack
 
D

DarthTenebris

Guest
I don't do networking or deal with ds_* functions, but what I can think of (at least) is that when you click the button, it sends a command to the server to update the ds_list, then if you open the menu you send a command to the server that tells it to send the ds_list data to the client.

Like I said, I don't do networking or ds_* functions so I cannot provide code, but at least I can give an idea on how it can be done.

Hope I helped enough :)
 
C

CodeBlack

Guest
I don't do networking or deal with ds_* functions, but what I can think of (at least) is that when you click the button, it sends a command to the server to update the ds_list, then if you open the menu you send a command to the server that tells it to send the ds_list data to the client.

Like I said, I don't do networking or ds_* functions so I cannot provide code, but at least I can give an idea on how it can be done.

Hope I helped enough :)
Thanks for the answer :D
But this is something i already tried and it didnt work out that well...I stored the data in an array to sync it and then called the array.
The problem is that the client doesnt know for how many entries he has to check, because there is no fixed number of entries.
The other way around i had the problem that the server didnt know for wich variables he had to check to put them into the ds list.

basically every player can be the one who clicks the button and basically every player can be the one who opens the dropdown menu.

to be a bit more clear what i want:
I want the players to be able to create a "team" or to join one of the existing "teams" via the dropdowm menu.
Basically something like a "dynamic team lobby".

greetings
CodeBlack
 
M

MilkyBrain

Guest
Hi!
What if you will try to use "string = ds_list_write(list_of_names)" then send this string throw the buffer typte "buffer_string" and on another client use "string = buffer_read(buffer, buffer_string) -> ds_list_read(list_of_names,string)"?
 

PNelly

Member
All of networking is about syncing information across multiple machines, of course there are ways to sync a ds list. However, if something happens on one machine, no other machine will know about that change unless it is told about the change.

After all, you don't know that you need to pick someone up at the airport unless someone shares that information with you. Much the same in computing.

Never looked at GM Net, but it sounds like you're jumping into it without really knowing anything about networking (at a conceptual level), which means this will probably be a very frustrating experience for you. I'd encourage you to take a step back and see if you can find some good learning resources / tutorials on the subject.
 
Top