AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   xREDIRECT (https://forums.alliedmods.net/forumdisplay.php?f=128)
-   -   How to read the serverlist.ini-file from a http Server? (https://forums.alliedmods.net/showthread.php?t=82994)

Pinatz 01-02-2009 11:09

How to read the serverlist.ini-file from a http Server?
 
Hey,
I would like to create a central config for xredirect to use with all servers that are running my catchmod version.
The Config-file will be accessable through http.
(http://catchmod.de/serverlist.ini)
But I don't know how to access a file through http with amxmodx / pawn.
Does somebody know how to get this work?
I just need a function that will access the serverlist.ini on the server so that I can integrate it into xredirect.

Sincerely,
Sebastian

xOR 01-02-2009 14:04

Re: How to read the serverlist.ini-file from a http Server?
 
maybe you could explain your position a little more:
- do you think xREDIRECT could do this and you are asking how to turn it on?
- are you aware that xREDIRECT can't do it, so you want to code it yourself as you know how to code a little but need help with that HTTP stuff?
- are you requesting that me or someone else will build it into xREDIRECT?

in case you want to get involved in coding there is a good explanation in this thread, look at the sample application.

if you do it yourself:
- you will get as much help as possible from me (and hopefully others reading our thread), just ask here
- please contribute your code by posting it here, even if you think it doesn't fit the coding style of xREDIRECT or something, then i will make it fit in there and release it
- of course you are given credit for that

Pinatz 01-02-2009 18:47

Re: How to read the serverlist.ini-file from a http Server?
 
Okay
Well, I thought a Server-Network between some server with the same mod installed would be nice. So I began to search for a redirect tool like I had seen it on some servers before. Then I found xREDIRECT and looked into the code. It seemed to be good because it has an easy configuration file for the serverlist. My next thought was that it would be great to have a central config-file on my server so that people who download the mod on my website even can download a servernetwork-addon that will get the other existing Server-IP's and create a global-menu for all servers.
Actually there are only 5 or 6 that are using my version and 20 that are using other versions so the lentgh of the list ingame should not be a problem and later I would create something like a top-10 listing of good servers.
Then I found out that it is not as easy to get data through http like in other programming-languages and I thought I could just ask here if somebody has an idea how to do this.

I know that xREDIRECT cannot do this and I have to implement it on my own. A few minutes I thought of a mysql-database everybody can access, but in sql you cant give only readaccess. So the network would be down within some days because some ppl would flood the database :/
Http seems to be a better alternative for this.
Or maybe I just create a precompiled version. This would save the mysqlpassword in the amxfile. But I think to interact with mysql you have to set it in a config and this would be accessable for everybody.

The Request is not espacially directed to you because I thought maybe somebody has time and knows how to do this.
I will have a closer look to the thread you linked to me. Seems to be interesting. But as the author says, not every server allows sockets :/

Thought it would be easier to access it. Like show_motd easily gives access to http-sites.

I will post every success that I make in this thread and I am thankful for everybody's help.
And yep if we get this working mentioning me in your credits would be cool :)

davidonpda 01-04-2009 10:49

Re: How to read the serverlist.ini-file from a http Server?
 
One server ini uploaded to a website somewhere sure seems a lot easier than maintaining and accessing a sql database like has been mentioned.

Not every server allows sockets, but is it something they can enable?

Pinatz 01-04-2009 13:52

Re: How to read the serverlist.ini-file from a http Server?
 
I just tried to compile the code of the example which was given in the thread but there are some errors so that I can not compile the code :/
I included everything which was needed. amxmodx,amxmisc and sockets. Still there are problems.
I found an interesting thread about http sockets here
http://forums.alliedmods.net/showthread.php?t=63512
Maybe someone is in common with this.

xOR 01-06-2009 09:04

Re: How to read the serverlist.ini-file from a http Server?
 
Quote:

Originally Posted by davidonpda (Post 738212)
Not every server allows sockets, but is it something they can enable?

gameserver providers usually want to limit your machine to game server activities. so rented gameservers could be limited to certain outgoing and incoming ports, they don't necessarily need to be enabled to query port 80 via tcp or tcp ports in general.
so if a server provider limited it e.g. by firewall there is nothing you can do about it. also some servers are even more strict, they set everything up for you, inlucing amxx, but then they could just remove the sockets module.
these are things you as a user can't do much about it, except switching to a different provider maybe.

Quote:

Originally Posted by Pinatz (Post 738325)
I just tried to compile the code of the example which was given in the thread but there are some errors so that I can not compile the code :/
I included everything which was needed. amxmodx,amxmisc and sockets. Still there are problems.

yes, there were some mistakes in it. i have corrected them and replied to the thread with the new code, just look at the thread again. it compiles for me now.

Quote:

Originally Posted by Pinatz (Post 738325)
I found an interesting thread about http sockets here
http://forums.alliedmods.net/showthread.php?t=63512
Maybe someone is in common with this.

but that is for a HTTP server, not for clients. and about the sockets it will use listen sockets, so it's by all means different from what we need here.

Keamos 01-10-2009 13:44

Re: How to read the serverlist.ini-file from a http Server?
 
Quote:

Originally Posted by Pinatz (Post 737265)
A few minutes I thought of a mysql-database everybody can access, but in sql you cant give only readaccess.

Not true; you can create a user that can only execute SELECT queries, using GRANT.

Pinatz 01-10-2009 17:52

Re: How to read the serverlist.ini-file from a http Server?
 
Then the mysql functions that exist could be used for this?
I am not really familiar with the mysql-Syntax, so anybody knows how to rebuild the filerequest to a mysqlrequest?
The problem would be that you can only connect to one sql-database, right? So people who would use amxx with mysql would have to deactivate their mysql-database and change the config to connect to mine. But I think this would be only a problem for 1% of the catchmodusers.

danielkza 01-10-2009 18:23

Re: How to read the serverlist.ini-file from a http Server?
 
Quote:

Originally Posted by Pinatz (Post 741835)
Then the mysql functions that exist could be used for this?
I am not really familiar with the mysql-Syntax, so anybody knows how to rebuild the filerequest to a mysqlrequest?
The problem would be that you can only connect to one sql-database, right? So people who would use amxx with mysql would have to deactivate their mysql-database and change the config to connect to mine. But I think this would be only a problem for 1% of the catchmodusers.

You can connect to as many DBs as you want, even in the same plugin.

P4rD0nM3 01-17-2009 11:45

Re: How to read the serverlist.ini-file from a http Server?
 
A MySQL database would be the best way instead of just a static file. Plus you can filter out who gets access with permissions.


All times are GMT -4. The time now is 07:20.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.