Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, SBGuy), 987 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
[ANet] Internet Serverlist Beta #352322
01/02/11 21:21
01/02/11 21:21
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Hi!

A lot of people asked for a internet serverlist solution the last days. So I started to rework the old internet serverlist template of ANet. The result is a much cleaner and easier to use template. Just download the .zip and open the .htm file in the documentation folder. The HowTo describes exaclty how it can be used and how you can setup a server. The whole template is open source!

The template also comes with a small example project (compiled):


Here is the link: Internet Serverlist Template (~3 MB)

Please notice that this is a public beta! So there might be some bugs or documentation mistakes.
You don't need to buy ANet to use this template. You can also use it with the free ANet Demo. For those who own ANet: The http feature is required so it does work with ANet Web and ANet Professional but not with the ANet Standard.

Please tell me if it is working for you and what you think laugh


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [ANet] Internet Serverlist Beta [Re: Dark_samurai] #365334
03/25/11 13:22
03/25/11 13:22
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
Just took a look at the script, its very well commented and will hopefully save me a lot of time! It might be helpful for non-anet user too.

However, there is one important security issue:

Why are you letting the application send the mysql username and password over http-post to the server? That is something the application shouldn't even know! Everyone could either find it in the binary or spy the traffic with a sniffer and find it there.

Why not letting the user write it into a settings.php file that gets included into the other php files like other php/sql applications do it? I'm going to modify this script anyway and will do it this way, but I wanted to share this with you.

Re: [ANet] Internet Serverlist Beta [Re: SchokoKeks] #365347
03/25/11 16:17
03/25/11 16:17
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Yes you are right. I will change that!


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [ANet] Internet Serverlist Beta [Re: Dark_samurai] #365563
03/27/11 15:16
03/27/11 15:16
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
have you changed it yet ?

Re: [ANet] Internet Serverlist Beta [Re: darkinferno] #365567
03/27/11 15:27
03/27/11 15:27
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
Found another little problem:

My websever returns the REMOTE_ADDR as a kind of IPv6:
::fffff:255.255.255.255

So I needed another "explode" to get the last part, which is the usual IP. I also added an isset statement to check whether AddServer.php was called with a proper post statement containing the needed variables. Here is the modified code part:



Code:
//check for valid post
        if (!isset( $_POST['Port'], $_POST['Name'] )) die("ERROR: JUST FAIL");

        //gets the ip address from the host that called this script:
        $Ip_Addr = $_SERVER['REMOTE_ADDR'];
        //if the host is on the same machine as the serverlist server,
        //insert "127.0.0.1" (= localhost)
        if($Ip_Addr == "::1" || $Ip_Addr == "localhost") $Ip_Addr = "127.0.0.1";
        //converts the ip address into a 4 byte integer:
        $Ip_TempF = explode(":", $Ip_Addr);
        $Ip_Temp = explode(".", $Ip_TempF[3]);
        $Ip = ($Ip_Temp[0]<<24) + ($Ip_Temp[1]<<16) + ($Ip_Temp[2]<<8)
                        + ($Ip_Temp[3]);



@darkinferno: I have changed it to work that way, it only takes a few minutes. I can post the files if you want to, but there is another bug still remaining that makes the dll crash on some occasions.

Re: [ANet] Internet Serverlist Beta V2.1 [Re: SchokoKeks] #365609
03/27/11 20:12
03/27/11 20:12
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Here the new version: Beta V2.1

Changes:
+ removed the username and password from the lite-c script. You have to set it now directly in the php file.
+ added an isset() check of Port and Name like SchokoKeks did (Thanks!)

Bug fixes:
+ Bad HttpId error fixed
+ Memory problem with string fixed

Thanks for the report SchokoKeks! The problem was in ITemp_Get() where in two cases I closed the function without removing the httpResult string and freeing the HttpId. I hope that this caused the strange problems you had with str_remove().

Please test it and tell me if it's working for you now.

Last edited by Dark_samurai; 03/27/11 20:13.

ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [ANet] Internet Serverlist Beta V2.1 [Re: Dark_samurai] #365622
03/27/11 21:26
03/27/11 21:26
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
The HttpId error is indeed fixed, but I'm still getting the "Invalid memory area STR" error on removal of a string used with http_post with warn_level = 6. I seem to get in on every http_post. If I'm using a global string, I will get this error on closing the engine. I guess there is something wrong within Anet..

Re: [ANet] Internet Serverlist Beta V2.1 [Re: SchokoKeks] #365660
03/28/11 12:02
03/28/11 12:02
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Hmmm.... I will take a look at this.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [ANet] Internet Serverlist Beta V2.1 [Re: Dark_samurai] #365662
03/28/11 12:20
03/28/11 12:20
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Ok the problem is related to the http_get_result() function. If the string passed is to small it will cause this error.

Workaround:
Pass a string that is big enough for the data by replacing this part of the template:
Code:
STRING* httpResult = str_create("#10");
			var length = http_get_result(httpId, httpResult);
			if(length > 9)
			{
				str_remove(httpResult);
				httpResult = str_create(str_printf(NULL, "#%d", (long)length + 1));
				http_get_result(httpId, httpResult);
			}



With this one:
Code:
STRING* httpResult = str_create("#100");
			var length = http_get_result(httpId, httpResult);



This is how I will fix the bug:
http_get_result() will create and return a string, so it's not required to pass a string anymore. But the release of the new version will take some time (sorry).


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: [ANet] Internet Serverlist Beta V2.1 [Re: Dark_samurai] #365698
03/28/11 16:54
03/28/11 16:54
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
Sadly, this workaround doesn't really help.

I now get crashes in SYS and invalid memory area STR in other, totally unrelated code parts that work totally fine when no http_post is done.
The old version of Survive was pretty stable and the server would only crash very rarely, but this version currently is a mess.

Since I want to release the serverlist fast I guess I have to switch to GSTNet, sadly I need to urlencode the post myself, but I guess I can find some code for that.
EDIT: F***, in GSTNet the Post function doesn't seem to work at all (well, at least it doesn't crash). It doesn't send the post data at all, it seams.

Btw, is the AckNet.dll also using your code or is it made by conitec? I somehow remembered that it was based on your code, but i might be wrong here.

Last edited by SchokoKeks; 03/28/11 17:34.
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1