Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pinatz
Member
Join Date: Dec 2008
Old 01-02-2009 , 11:09   How to read the serverlist.ini-file from a http Server?
Reply With Quote #1

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
Pinatz is offline
xOR
Veteran Member
Join Date: Jun 2006
Location: x-base.info
Old 01-02-2009 , 14:04   Re: How to read the serverlist.ini-file from a http Server?
Reply With Quote #2

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
__________________
Got more than one HL1 (CS, DoD, NS, TS, TFC, HLDM...) server? Check:

Last edited by xOR; 01-02-2009 at 14:10.
xOR is offline
Pinatz
Member
Join Date: Dec 2008
Old 01-02-2009 , 18:47   Re: How to read the serverlist.ini-file from a http Server?
Reply With Quote #3

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
Pinatz is offline
davidonpda
Junior Member
Join Date: Dec 2007
Old 01-04-2009 , 10:49   Re: How to read the serverlist.ini-file from a http Server?
Reply With Quote #4

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?
davidonpda is offline
Pinatz
Member
Join Date: Dec 2008
Old 01-04-2009 , 13:52   Re: How to read the serverlist.ini-file from a http Server?
Reply With Quote #5

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.
Pinatz is offline
xOR
Veteran Member
Join Date: Jun 2006
Location: x-base.info
Old 01-06-2009 , 09:04   Re: How to read the serverlist.ini-file from a http Server?
Reply With Quote #6

Quote:
Originally Posted by davidonpda View Post
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 View Post
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 View Post
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.
__________________
Got more than one HL1 (CS, DoD, NS, TS, TFC, HLDM...) server? Check:
xOR is offline
Keamos
Junior Member
Join Date: Nov 2008
Old 01-10-2009 , 13:44   Re: How to read the serverlist.ini-file from a http Server?
Reply With Quote #7

Quote:
Originally Posted by Pinatz View Post
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.
Keamos is offline
Pinatz
Member
Join Date: Dec 2008
Old 01-10-2009 , 17:52   Re: How to read the serverlist.ini-file from a http Server?
Reply With Quote #8

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.
Pinatz is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 01-10-2009 , 18:23   Re: How to read the serverlist.ini-file from a http Server?
Reply With Quote #9

Quote:
Originally Posted by Pinatz View Post
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.
__________________

Community / No support through PM
danielkza is offline
P4rD0nM3
Veteran Member
Join Date: Feb 2006
Old 01-17-2009 , 11:45   Re: How to read the serverlist.ini-file from a http Server?
Reply With Quote #10

A MySQL database would be the best way instead of just a static file. Plus you can filter out who gets access with permissions.
P4rD0nM3 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:28.


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