Jump to content


Photo

39dll V2.5


  • Please log in to reply
2510 replies to this topic

#2481 volando

volando

    GMC Member

  • GMC Member
  • 122 posts

Posted 10 June 2012 - 11:45 AM

***HI***

What is it wrong in this HTTP GET ???

What am I doing fatallity wrong?


I am using the great Blijbol onScore server system but I wanted to hack the calls to the php file in order to send scores silently ( w/o opening the browser).

Thank you a lot.


// Copyright © 2006-2009 Jeroen van der Gun (Blijbol)

var type, scorestr, stamp, oid, url;
if(argument4) type = 'quick';
else type = 'form';
scorestr = string(argument3);
stamp = string(current_timestamp());

if(registry_exists('__oid')) oid = registry_read_string('__oid');
else
{
 oid = string_replace_all(string_format(current_time mod 100000, 5, 0) + string_format(floor(random(9999)) + 1, 4, 0), ' ', '0') + string(current_minute mod 10) + string(current_second mod 10);
 registry_write_string('__oid', oid);
}


// 39 dll part


url = 'list.php?list=' + string(argument0) + '&submit=' + type + '&name='+string_urlencode(argument1) + '&website=' + string_urlencode(argument2) + '&score=' + scorestr + '&identity=' + oid + '&stamp=' + stamp + '&auth=' + string_md5(scorestr + string_insert(oid, onscore_connection_script(argument0), 17) + stamp);

newLine = chr(13) + chr(10);

dllinit(0,true,true)

sockId = tcpconnect('www.redefineteclas.com', 80, 0);

setformat(sockId, 1, newLine);
clearbuffer();

writechars('GET/'+ string(url) + newLine);
writechars("Host: volando1" + newLine);
sendmessage(sockId);
dllfree()

  • 0

#2482 PoniesForPeace

PoniesForPeace

    puzzling

  • GMC Member
  • 493 posts
  • Version:GM:Studio

Posted 13 June 2012 - 08:40 PM

How do I have a server list like multiplayer games? Most GM games you have to type in an IP.

I saw this topic but I'm really confused. http://gmc.yoyogames...howtopic=494923

Adding to the confusion, is the fact that 39dll cannot successfully access my IP from whatsmyip.org

Edited by PoniesForPeace, 13 June 2012 - 08:41 PM.

  • 0

#2483 Terrified Virus

Terrified Virus

    Moderators Plaything

  • GMC Member
  • 721 posts
  • Version:GM:Studio

Posted 14 June 2012 - 03:10 AM

How do I have a server list like multiplayer games? Most GM games you have to type in an IP.

I saw this topic but I'm really confused. http://gmc.yoyogames...howtopic=494923

Adding to the confusion, is the fact that 39dll cannot successfully access my IP from whatsmyip.org

I have been thinking about this question for a while, and I came to a conclusion, however, it is not exactly like how professional games do it. First off, the client must be connected to two servers: the master server, and a player-run dedicated server. The player creating the dedicated server must then create a game list running on the master server, with the IP address and port number, and game name. Then the client will run connecting to the master server, seeing the dedicated server's IP address and name in a list. When they click on it, it will redirect them from the master server to conenct to the player-run dedicated server. Sorry if this is confusing, but it should make sense after a while. Basically, the person running the dedicated server must create a topic in a list to be shown up on the master server. This can also work for private games, as the server runner doesn't have to make a list on the master server for players to connect. This would be done by having two options, the list, and a direct-IP option.

As for 39dll not accessing your IP address, port-forwarding whatever port you are using should help that problem.

EDIT: Note: I am not certain that the game-list concept will work properly, as I haven't tested it, but it seems like it should work. If I can get it to somehow work, I will post an example.

Edited by Terrified Virus, 14 June 2012 - 03:11 AM.

  • 0

#2484 Medo42

Medo42

    GMC Member

  • GMC Member
  • 219 posts

Posted 15 June 2012 - 08:23 AM

There are two usual ways to get a list of games, one that is used on local networks and one for the internet.

On local networks, you can broadcast a UDP packet to everyone (by sending the packet to 255.255.255.255 iirc) and let all running games listen and respond to a broadcast like that.

On the internet, broadcast does not work, so the list of games is usually managed at a fixed location. This can be an actual server with fixed IP. Running game servers register themselves at that lobby server, and players can ask it for the current list.

Gang Garrison 2 uses only the second option, but it has some additional features you might want to consider. For example, it also shows modded games in the list, and can tell the player where he can download the mod if he wants to join. Showing the current map and player count is also generally a good idea.

If you need some server list software, I open-sourced the one I wrote for Gang Garrison 2: https://github.com/Medo42/Faucet-Lobby
You might want to strip out the GG2-related things, but most of it is really quite generic. And it gives you a neat web overview as well :)
  • 0

#2485 PoniesForPeace

PoniesForPeace

    puzzling

  • GMC Member
  • 493 posts
  • Version:GM:Studio

Posted 17 June 2012 - 01:42 PM

meh sorry for the late reply, your quote wasn't showing up in My Content.

Would I need to purchase a server or would I use a free server dedicated to GM games?

Also, I am having trouble with translating my TCP code to UDP, I don't know how the server should send data to the client, does the server need to know the clients IP? Are there any good UDP tuts laying around?
  • 1

#2486 Medo42

Medo42

    GMC Member

  • GMC Member
  • 219 posts

Posted 17 June 2012 - 04:26 PM

Would I need to purchase a server or would I use a free server dedicated to GM games?

Also, I am having trouble with translating my TCP code to UDP, I don't know how the server should send data to the client, does the server need to know the clients IP? Are there any good UDP tuts laying around?

Renting a server just for the game list is a bit overkill because it needs very little resources unless you have thousands of running games. It is probably the most convenient solution though, and you can get small virtual servers for relatively cheap these days, and once you have one you can use it for other things as well, e.g. hosting a website for your game. Another option is to use e.g. an old laptop and put it behind a desk (this is how the GG2 lobby was run in the beginning).

To reply to a client with UDP, the server does need to know its IP. It gets that in the original packet from the client though.

Edited by Medo42, 17 June 2012 - 04:27 PM.

  • 0

#2487 PoniesForPeace

PoniesForPeace

    puzzling

  • GMC Member
  • 493 posts
  • Version:GM:Studio

Posted 18 June 2012 - 12:45 AM


Would I need to purchase a server or would I use a free server dedicated to GM games?

Also, I am having trouble with translating my TCP code to UDP, I don't know how the server should send data to the client, does the server need to know the clients IP? Are there any good UDP tuts laying around?

Renting a server just for the game list is a bit overkill because it needs very little resources unless you have thousands of running games. It is probably the most convenient solution though, and you can get small virtual servers for relatively cheap these days, and once you have one you can use it for other things as well, e.g. hosting a website for your game. Another option is to use e.g. an old laptop and put it behind a desk (this is how the GG2 lobby was run in the beginning).

To reply to a client with UDP, the server does need to know its IP. It gets that in the original packet from the client though.

thanks!
  • 0

#2488 DarkDev

DarkDev

    GMC Member

  • New Member
  • 16 posts
  • Version:GM8

Posted 23 June 2012 - 12:07 PM

I'm having issues with my code. I'm not getting a response from the server. The request works fine with cURL, so my questions is:

Does this DLL have SSL support?

Sorry if it was mentioned before, I didn't feel like reading the 120-some-odd pages to find it.

Thanks!
  • 0

#2489 PoniesForPeace

PoniesForPeace

    puzzling

  • GMC Member
  • 493 posts
  • Version:GM:Studio

Posted 23 June 2012 - 01:23 PM

I'm having issues with my code. I'm not getting a response from the server. The request works fine with cURL, so my questions is:

Does this DLL have SSL support?

Sorry if it was mentioned before, I didn't feel like reading the 120-some-odd pages to find it.

Thanks!


protip, set the maximum amount of posts per page, and use the Search text feature on your browser.
  • 0

#2490 xeoner

xeoner

    GMC Member

  • New Member
  • 3 posts
  • Version:GM8

Posted 23 June 2012 - 08:18 PM

Hi everyone
1 - using 39dll doing an RPG game. I have no problem with users. For example, wolves in the forest but are placed by the server room. Individual users could not send all of these animals. Can you give an example of a link if you have previously made.

me Readbtye Writebtye Could not he have tried to never tell a lot :)

2 - I enter my computer to the internet using my phone. I can not open and the port. But you've ever had a chance to try someone else is trying to use localhost :) Is there another possibility to set the ports? Note: I do not speak English so the translation may have used the incorrect articles :)


Help :)
  • 0

#2491 hi cooper123

hi cooper123

    GMC Member

  • GMC Member
  • 29 posts
  • Version:GM8

Posted 24 June 2012 - 01:57 AM

With using 39dll, how do I start a LAN game, like what port do I use and what Ip?

Thanks in advance
  • 0

#2492 xeoner

xeoner

    GMC Member

  • New Member
  • 3 posts
  • Version:GM8

Posted 24 June 2012 - 06:03 PM

With using 39dll, how do I start a LAN game, like what port do I use and what Ip?

Thanks in advance



127.0.0.1 or localhost ;)
  • 0

#2493 OminousGames

OminousGames

    GMC Member

  • GMC Member
  • 24 posts
  • Version:GM:Studio

Posted 26 June 2012 - 04:38 AM

Hey is there any way to initialize the server on a different ip? If not, could you make a function like that?
  • 0

#2494 creators124

creators124

    awesomeliciousmember

  • GMC Member
  • 866 posts
  • Version:GM8

Posted 26 June 2012 - 05:13 AM

Hey is there any way to initialize the server on a different ip? If not, could you make a function like that?

are you asking for the client to connect to servers that have a different ip?
  • 0

#2495 GameDesigner

GameDesigner

    GMC Member

  • New Member
  • 1 posts
  • Version:GM8

Posted 12 July 2012 - 01:38 AM

I need help installing?


Me too :)
Can't seem to import any of the files that came in the 39dll.zip.
I made a search in this topic for "install" "installing" "import" "importing" and couldn't find anything.

Haven't tried any other DLL's or other types of extensions before though so I'm most likely doing it wrong.
I go to file -> "import resources.." and it only lets me look for .gmres files.
I am running Game Maker standard v8.1.
  • 0

#2496 Flashback2012

Flashback2012

    GMC Member

  • New Member
  • 1 posts
  • Version:GM7

Posted 16 July 2012 - 07:24 AM

I'm having some trouble with this dll. Well I'm not sure if it's the dll or my server but I'm trying to use it to connect to a server and run a php script to receive some data from the server, but the message that 39dll receives is only as follows:
HTTP/1.1 200 OK
Date: Mon, 16 Jul 2012 07:16:45 GMT
Server: LiteSpeed
Connection: close
Content-Type: text/html
Content-Length: 12
<space><newline>
Then it receives nothing. None of the data I tried to receive. I'm using a php script written by someone else as a tutorial (adapted for my server of course) to get data from a MySQL database. I tried it with his example with his server and it works just fine. This has become quite a headache, and nothing I try makes it work properly. I have confirmation that the server has received the message. I would be very thankful for some help on the subject. I'm using phpmyadmin MySQL database.
  • 0

#2497 Funk E. Gamez

Funk E. Gamez

    GMC Member

  • GMC Member
  • 177 posts

Posted 03 August 2012 - 01:42 PM

For those of you having issues installing, here's a .gmres with the scripts:
http://www.host-a.net/u/TehCupcakes/39dll.gmres

Now I have a question about sockets... I'm having this issue where, after a client disconnects from the server, a client cannot connect again until the server has been restarted. The server closes the socket when the client disconnects, so I don't see what could be the issue here. When the client tries to connect again the server refuses to listen to allow it. In the step event of the server:
if open = true
{
    player = tcpaccept(listen, 1)
...
}

Open is true (I used debug mode to check), so that's not the issue. The client connects with this code:
friend = tcpconnect(127.0.0.1, 11114, 2)
connecting = true
And since it's using non-blocking, in step:
if connecting = true
{
    if tcpconnected(friend)
    {
        instance_create(x,y+32,_x_obj_download)
        connecting = false
        alarm[0] = -1
    }
}

The client is not detecting the server either. It's so weird. Could someone help please?
  • 0

#2498 PoniesForPeace

PoniesForPeace

    puzzling

  • GMC Member
  • 493 posts
  • Version:GM:Studio

Posted 07 August 2012 - 09:28 PM

You're sure they're not both trying to open the same port number?
Also, if you've added UDP recently for your shooting variables, make sure that you're forwarding ports if you are behind a router.

<{POST_SNAPBACK}>


You should only have to forward if you're hosting remotely and you're the server. If you're doing local testing or you're the client you shouldn't have to forward unless you're doing something stupid.

Here's how to use UDP without port forwarding on the client:

Pretend the server is NAT A, and the client is NAT B. If NAT B is firewall'd or behind a router, then NAT A can send UDP packets for as long as it wants and NAT B will just drop them. So how do you get around it? Simple - have NAT B send UDP packets first. So now NAT B is hammering NAT A with UDP packets, but NAT A accepts them because its port open. We now have a tunnel open for UDP packets, because NAT B expects a reply on its UDP socket, so it leaves the port temporarily open. This allows the server to make its reply.

So here's the simple version:
NAT A -> NAT B won't work until NAT A <- NAT B.
(See this link: Got Root: Why your should never forward UDP out of your firewall by mshinn)

Now, how would you do this in code, you ask? Simple.
PRE
<span style='font-size:10pt;line-height:100%'>// Receive a message on the UDP socket
while (receivemessage(udp) > 0) {
switch (readbyte()) { // Get the message ID
case 0: // 0 is the message ID for a simple UDP packet here
clearbuffer();
writebyte(0); // Send it back to the client
sendmessage(udp, ip, port);
break;
}
}
</span>


Now, this only assumes that you already know what port the client is using. What happens when the client has to use a different port? You have to tell the server what port it's using. What I would do is when the client connects, have the server send a packet requesting what it needs to know from the client (via TCP). The client then responds with the player name, UDP port, etc (also via TCP). The server then sends its UDP port (via TCP). Now the client and can create their UDP link on the correct ports.

The above code also doesn't account for UDP's chance of the packet not making it to the client. So what you do there is have a check to see if the client responded with its packet in a reasonable amount of time. If so, then create a new tunnel packet and fire it off. Unfortunately, now we have another problem. What happens when so many of these packets are fired off, it starts to lag? Well then, now you just make the server drop any of these empty packets that it's not expecting. For instance, if it had just sent one off, and it receives more than one, then drop the others and handle the first one.

I hope this helps someone.
-Arcalyth

Edit, over a year later: see my post #1715 in the topic. <{POST_SNAPBACK}>


I did this method of holepunching, it works with some but not all routers. I made a topic about it here http://gmc.yoyogames...l=&fromsearch=1

PS: Supposedly he made the only working UDP example on the GMC, and the link is down. Someone please reupload this? http://gmc.yoyogames...2

Edited by PoniesForPeace, 08 August 2012 - 05:54 PM.

  • 0

#2499 Terrified Virus

Terrified Virus

    Moderators Plaything

  • GMC Member
  • 721 posts
  • Version:GM:Studio

Posted 07 August 2012 - 09:53 PM

This DLL is amazing. Nothing more to say.
  • -2

#2500 bartas225

bartas225

    GMC Member

  • GMC Member
  • 25 posts

Posted 11 August 2012 - 08:22 PM

Hey, I have problem with my DLL* in Delphi, so I have code:
size := receivemessage(server,0,0);
  if size<0 then 
  begin
   Result:=size;
   break;
end;
and size is always -10035. I know what's that mean, but I don't know how to make it working. But when I run client in GM (not Delphi) all is working. Connection is OK because server (in GM) receive message from client (in Delphi), but server can't receive message from client :/

*I'm creating DLL that is using 39dll
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users