Description: Ether is a network library (based on XenoN Core Ether module and GMapi; also is a part of SixthSense ) for GameMaker, that contain features of most other libraries (like all-in-one dll). Supports sockets to network communication, buffers to store data, sessions for automated client-server communication (for multiplayer games primarily), HTTP requests to communicate with Web servers (asynchronous download/upload files and data from/to the server), and XML languages reader (HTML websites). Project file contain examples of each engine feature, and I'm working on other advanced examples.

1.
for GET method use: EtSessionDownload(); or EtSessionDownloadAsync() and EtSessionDownloadProgress() [asynchronous mode];
for POST method use: EtSessionSendForm(); or EtSessionSendFormAsync() and EtSessionSendFormProgress() [asynchronous mode];
for other methods use: EtSessionRequest(); or EtSessionRequestAsync() and EtSessionRequestProgress() [asynchronous mode];
EtSessionSendForm*() and EtSessionRequest*() works like download example (some arguments are different - more info in function scripts)

Socket send whole buffer at once, with size-header (if we don't know how much data trying to send and receive) or without size-header.Game session send data like socket.HTTP request session send data like socket but receive parts and flush them to buffer.Now I'm working on sending splited parts of buffer, and receiving like in HTTP requests session, for sockets and game sessions.

Is GMAPI only used for callbacks (it seems)?

only for callbacks

I noticed that 39DLL does have better buffer <-> file functions. You only have load and save.

what functions I missed?

Also, there seems to be a problem with downloading the Google homepage.

Wow. This DLL seems to be feature rich, and the people that have used it, really like it. I will have to use this in my current project. Once I get the hang of it, and start to use it, i'll let you know how I feel about it from a person who isn't so good in this area.

EDIT : I've looked over it and ran the example, and it works really well! I do have a request though, is there a possibility of being able to remove the GMApi portion, so we can use it in other languages as well? Or would you rather keep it to gm.

@kalzme: Yeah. Send the request yourself with the sockets, then the response will include the headers.

@PsichiX: This is great, but I'm having some issues with the XML functions.

Firstly, does including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the beginning of the text cause problems with EtXmlParse? I'm getting the XML from a web server and I want to know if I should remove that before parsing.

because XML reader does not support old standard, but i see that some popular sites like twitter still use this (ehh ;0).I will add this to next update, and reading <?xml?> too, because now reader parse only pure tags, even CDATA are not parsed, and CDATA will be readable soon

btw, is there any way to read the response header fields?

engine already does support this thing, i will add it to Ether.dll too.

@PsichiX: Correct me if I'm wrong (I don't know much about XML, to be honest), but aren't you supposed to only end a tag with /> if it's self-closing, i.e. has nothing inside it? In this case, the <statuses> tag has everything inside it .

@kalzme: Thank you! That worked! I never thought the parse was considering the <?xml?> tag as a tree tag . Thanks!

That said, now I'm a little confused. The <statuses> tag is an array of <status> tags. So how would I, for example, get the value of the created_at tag in the third (or fifth, or thirtieth) <status> tag?

*EDIT* Nevermind. I should look at the examples before asking questions, shouldn't I ? I've got it now, and it's working great!

-IMP

Edited by IceMetalPunk, 22 August 2010 - 03:55 PM.

0

Are you an artist who likes creating original creature designs? Maybe you can help outwith Elementa here! Give it a look; you might like the idea

@PsichiX: Correct me if I'm wrong (I don't know much about XML, to be honest), but aren't you supposed to only end a tag with /> if it's self-closing, i.e. has nothing inside it? In this case, the <statuses> tag has everything inside it .

@kalzme: Thank you! That worked! I never thought the parse was considering the <?xml?> tag as a tree tag . Thanks!

-IMP

You are correct, I guess he didn't see the closing tag at the end.I'm glad it worked.

Oh and by the way if the <statuses> tag has multiple <status> tags in it you can easily read them this way:

With hashtags, you mean like: 'status#id:' + countor do you mean the hashtags used by twitter?

I've only found those in the example:

#next - This one is used to get the next tag elemen

#new - This one is used to create a new tag

#id:0 - This is used to get a specific tag (if you have multiple tags with the same name)

there's also characters like:'.' - This means you use the parent tag'~' - This can be used to get an attribute (<statuses type="array"> so you would use ~ to get the type)

That's all I know They all appear in the example, so you can see for yourself how they work.

Yeah, I meant the Ether hashtags. I saw #next and #new, but must have missed the #id:? tag before.

@PsichiX: Are those all the tags/operators we can use? If not, any chance you could post a quick reference for all the possible tags? It doesn't need to be too detailed; just something like "#next - Gets the next tag" for each...

-IMP

0

Are you an artist who likes creating original creature designs? Maybe you can help outwith Elementa here! Give it a look; you might like the idea

there are only a few hashtags for now like:
#next - get next tag
#prev - get previous tag
#id:3 - get 3th tag with that name
. - get current tag (if you are use parent tag parametr in function)
.. - get parent tag (one level up in tag-tree)
~ - get an attribute of tag

obviously you can mix them, example:
"html/body/table/tr#id:3/td/span#next#next" - this will go to 3th tr tag in html/body/table/ then 3th (because will find first span, then next + next = +2 so that = 3) span tag in html/body/table/tr#id:3/td/

...Now, according to Ether, the tag ?xml/status/text exists. Great. But when I try to get its value using EtXmlTagGet(xml,"?xml/status/text/"), I get a blank string. Any idea why?

-IMP

Is that the only xml?because otherwise it could be because you have multiple <status> tags so to read from it you would have to specify the id with the #id: hashtag like this: "?xml/status#id:0/text/".

That's all I can come up with.

(EDIT: typo)

Edited by kalzme, 25 August 2010 - 07:56 AM.

0

Please check out this poll on the GMC about why so many Game Maker projects tend to fail.

Yes, that's the only XML. That's the result of updating your status (posting a Tweet) via Twitter API. It sends back your status as confirmation, so there's only one status tag. I'll try using status#id:0 anyway, just to see if it works, though.

*EDIT* Nope, still showing up as an existing tag, but a blank string for the text value...

-IMP

Edited by IceMetalPunk, 26 August 2010 - 05:48 PM.

0

Are you an artist who likes creating original creature designs? Maybe you can help outwith Elementa here! Give it a look; you might like the idea

Your download script doesn't support chunked transfer encoding for website data, if you could possibly implement this in a future build it would make a lot of work with PHP easier.I had to use some hacky PHP script to get it to return data that works properly with your dll.

Your download script doesn't support chunked transfer encoding for website data, if you could possibly implement this in a future build it would make a lot of work with PHP easier.I had to use some hacky PHP script to get it to return data that works properly with your dll.

Chunked encoding is a fairly simple format. So while it would, of course, be useful to have Ether's download functions support it, it would be easier to use the socket functions to parse it yourself rather than trying to make it work on the PHP end.

-IMP

*EDIT* I've worked around my previous problem by implementing my own simple parsing, since I'll always need only text and date information in this one context.

Now I'm having a more distressing issue, one I can't work around.

I have a (third-party, non-GM) application that is both binding and sending information on the same port to 127.0.0.1 (basically using TCP/IP as a communications method for any program that wants information from it). I want to listen in on this information, but it seems that because the program binds the port, I cannot do so with Ether.

So when I start the program first, then my GM program, Ether cannot listen on the port. And when I start my GM program first, then the third-party one, the third-party one says it can't bind/connect. There must be a way to fix this, right? How?

Edited by IceMetalPunk, 06 September 2010 - 08:30 AM.

0

Are you an artist who likes creating original creature designs? Maybe you can help outwith Elementa here! Give it a look; you might like the idea

@IceMetalPunk
You have to use a different port.
A port is bound to the program using it to help simplify networking programming.
Scenario of why this is good

Spoiler

Thea reason why only one program can send and receive on a port is because if more then one is running on the same port then something along the following lines would/could happen
Program a and program b are running on the same port
program b receives data on that port
program a thinks the data is for it and crashes

@PsichiX
3th is not gramaticaly correct
that's like saying "thirth" instead of saying "third"
the two letters are supposed to be the sound at the end, not the beginning
(feel free to call me a grammar nazi)

@IceMetalPunkYou have to use a different port.A port is bound to the program using it to help simplify networking programming.Scenario of why this is good

Spoiler

Thea reason why only one program can send and receive on a port is because if more then one is running on the same port then something along the following lines would/could happenProgram a and program b are running on the same portprogram b receives data on that portprogram a thinks the data is for it and crashes

Right, that's what I thought. Unfortunately, this third-part program binds and sends on the same port. It's designed to send data to Flash--can Flash somehow bypass the restriction? And if I stick with GM, is there any way around this?

-IMP

0

Are you an artist who likes creating original creature designs? Maybe you can help outwith Elementa here! Give it a look; you might like the idea

@IceMetalPunkYou have to use a different port.A port is bound to the program using it to help simplify networking programming.Scenario of why this is good

Spoiler

Thea reason why only one program can send and receive on a port is because if more then one is running on the same port then something along the following lines would/could happenProgram a and program b are running on the same portprogram b receives data on that portprogram a thinks the data is for it and crashes

Right, that's what I thought. Unfortunately, this third-part program binds and sends on the same port. It's designed to send data to Flash--can Flash somehow bypass the restriction? And if I stick with GM, is there any way around this?

I am looking to use the DLL and its capabilities in C++. This is why I am requesting the GMAPI to be removed, but still have one with it in. GMAPI is great, just not when you need to do cross language work. I am using the DLL with GMAPI in my new program right now. Thanks for giving me a time estimate on the time, now I can plan my project around that.