Pages: « 1 2
  Print  
Author Topic: Yoyogames Example in Enigma  (Read 7055 times)
Offline (Male) Goombert
Reply #15 Posted on: September 19, 2013, 05:43:24 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Quote
On linux you proably have to install loads of crap.
Code: [Select]
sudo apt-get install libcurl-devLike I said on Windows is where people were having problems getting the curl headers, and I don't know where you got them from because they are not in the MinGW folder.

Quote
We can let it die.

It's fine I already have it started and that will be the last of the remaining old Game Maker API to implement.

Quote
Of course implementing the new GM:S networking functions should be more important.

Here is what is left to do...
1) Make buffers be able to read/write floats right now if you write 214.568 it comes back out as 214 with the point precision dropped off.
2) Implement buffer data alignment
3) Merge networking functions together, I don't think we need two sets, I think I can expand Studio's so that there exists only one set, I haven't decided yet.
4) Implement network_receive(); which decodes a buffer into a data structure map, or else just implement that asynchronous network event and make a global constant for it.
5) Make network_ functions non-blocking.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #16 Posted on: September 20, 2013, 09:52:52 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
I just checked my previous project and I used #include <winsock.h> on windows (exactly the same as sockets on linux, but requires some 3 init lines) and this on Linux:
Code: [Select]
#include <sys/types.h>
        #include <sys/socket.h>
        #include <netinet/in.h>
        #include <arpa/inet.h>
So I am still not sure what curl you are talking about. It seems to be very specific for some http stuff and in that case they may be required. For regular TCP/IP Berkley Sockets though, they are not needed.
Logged
Offline (Male) Goombert
Reply #17 Posted on: September 20, 2013, 05:50:58 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Quote
libcurl - the multiprotocol file transfer library - Haxx
curl.haxx.se/libcurl/‎
May 6, 2013 - libcurl is a free and easy-to-use client-side URL transfer library, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP ...
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #18 Posted on: September 22, 2013, 11:16:29 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
Well that explains it. But why do we need HTTP? Shouldn't that be an extension or something? For games and GM:S compatibility we only need TCP/IP / UDP. I don't think GM:S allows using HTTPS (although I don't have it, so I don't know). But at least TCP/UDP should be supported out of the box. Then HTTPS can be added via the Additional folder by including curls.
Logged
Offline (Male) Goombert
Reply #19 Posted on: September 22, 2013, 11:21:44 AM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Quote
The HTTP Event is one that is triggered by the call back from one of the http_ functions, like http_post_string. It actually generates a ds_map (more commonly known as a "dictionary") that is exclusive to this event and is stored in the special variable async_load (please see the individual functions for code examples that explain the use of this event in further detail). This ds_map has the following structure:

◦"url": The complete URL you requested.


◦"result": The data received (string only).


◦"http_status": The raw http status code (if available). This returns the standard web status code for most browsers, eg: 304 for "Not Modified" or 204 for "No Content", etc...


◦"id": The id which was returned from the command. If you fire off a series of http_ requests then you need to know which one you are getting the reply to, and so you would use this value to compare to the value you stored when you originally sent the request to find the right one.


◦"status": Returns a value of less than 0 for an error.
That is for when you use the http_post_string() function, but each of the http_ functions will return a slightly different map, so please refer to the manual entry for each function to find out the precise data that is returned for it.



NOTE: The variable async_load is only valid in these events, as the ds_map that is points to is created at the start of the event, then deleted again at the end, with this variable being reset to a value of -1.

NOTE: As async_load creates a ds_map, these functions are particularly useful when coupled with the json_encode and json_decode functions.



Quote
http_get(url);




Argument Description
url The web address of the server that you wish to get information from




Returns: Real




Description
With this function, you connect to the specified URL in order to retrieve information. As this is an asynchronous function, GameMaker:Studio will not block while waiting for a reply, but will keep on running unless it gets callback information. This information will be in the form of a string and will trigger an Async Event in any instance that has one defined in their object properties. You should also note that HTTP request parameters (the bits sometimes "tacked on" to the end of a URL when you submit a form on a web page) are perfectly acceptable when using this function, for example:


http_get("http://www.YoYoGames.com/logon?username="+name);


will pass the string held in the variable "name" to the server as well a retrieve the data from that URL. So, essentially, any time a simple, short piece of data needs to be passed from the client to the server, this would be reasonable choice as the function to use.

This event will generate a "call back" which is picked up by any HTTP Events, in which case it will generate a ds_map (more commonly known as a "dictionary") that is exclusive to this event and is stored in the special variable async_load. This ds_map has the following structure:

Yup.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) fervi
Reply #20 Posted on: October 28, 2013, 03:27:19 AM
Member
Joined: Feb 2013
Posts: 78

View Profile Email
Quote
but Highscore table doesn't work
That is part of widget systems, which is defaulted to Win32 on Windows and I don't think highscore functions were added, on Linux for widgets you need to set GTK+

With GTK+ Widget still doesn't work (in theory, because you have highscore into the game [like a text], no popup)

show_message, also doesn't work (but in linux console you have infos about it)

Fervi
« Last Edit: October 28, 2013, 03:34:54 AM by fervi » Logged
Offline (Male) Goombert
Reply #21 Posted on: October 28, 2013, 03:36:09 AM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Ok, it'll need fixed but it's not priority right now.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Female) IsmAvatar
Reply #22 Posted on: August 26, 2014, 10:18:24 AM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 886

View Profile Email
DirectPlay had a few things going for it:
* The ability to sniff games over a LAN.
* Global storage of variables
These are things that I was never able to figure out in Berkeley, and especially LAN sniffing is extremely useful. Minecraft has this ability (even on linux), and it's used a LOT.

Frankly, I don't care if you port mplay as-is or not. DirectPlay is dead - decaying, and touching it is likely to give you and all your players the bubonic plague. I also don't care if you re-imagine multiplayer and build some fancy new multiplayer library. But one thing is for sure, DirectPlay gave us some really fancy features that made it usable and make ours unusable. At the very least, we need to offer some usability features, and I really want to see LAN play.
Logged
Pages: « 1 2
  Print