• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Trying to understand Gamemaker's Lan Project example

Hello there, I was recently looking at Gamemaker's 1.4 Lan project demo and I wasn't really able to understand fully the purpose of this chunk of code

This one is located at the async event
/// Server network control
var eventid = ds_map_find_value(async_load, "id");

if( server == eventid ){
    // If the socket ID is the server one, then we have a new
    /// client connecting, OR an old client disconnecting
}else if( eventid==global.client){
    // Do nothing if this is for our "local" client
    // All other sockets are connected client sockets, and we have recieved commands from them.
When I look at other tutorials using 2 projects , they don't use thisif( server == eventid )
Can anyone explain this concept to me
sorry if this sounds like a newbie question

Thanks :)


The other tutorials probably have something along the lines of async_load[? "id"] == server, which is equivalent to what's done here if you trace back where eventid gets its value. Looking for exact word-for-word matches is a fool's errand, look instead for logical similarities.