2 registered members (AndrewAMD, SBGuy),
987
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
[ANet] Internet Serverlist Beta
#352322
01/02/11 21:21
01/02/11 21:21
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
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
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: SchokoKeks]
#365347
03/25/11 16:17
03/25/11 16:17
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
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: darkinferno]
#365567
03/27/11 15:27
03/27/11 15:27
|
Joined: Nov 2002
Posts: 913 Berlin, Germany
SchokoKeks
User
|
User
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:
//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
OP
Serious User
|
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: SchokoKeks]
#365660
03/28/11 12:02
03/28/11 12:02
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
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
OP
Serious User
|
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:
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:
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
SchokoKeks
User
|
User
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.
|
|
|
|