Hi All,
I have recently set-up a games hosting comapny as an extension to my web-design/hosting one.
Although there are some 'ok' control panels out there for starting/stopping services, I would like to build my own custom one to fit in with the rest of my site.
However, I am at a loss as to how to obtain things like Microsoft Services, or player IP addresses through PHP. Can anyone point me in the right direction?
Also, how could I create or use those IP addresses in order to then stop those people connecting to the server, depending on certain criteria.
I am happy doing the coding but am just not sure what existing variables would come in handy.
Any help would be much appreciated.
Obtaining IP addresses and other non-web related data
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
$HTTP_SERVER_VARS["REMOTE_ADDR"];
that gets the users ip address.
im not sure what you mean when stop the users from doing somthing depending on somthing else but you can save a log of the users ip when the login (if they are using a username and password) in a db so you have their most recently used ip on file then you can match the one you get when they connect to the most recently used one but i dont know what you are really trying to do so thats the most start i can offer.
that gets the users ip address.
im not sure what you mean when stop the users from doing somthing depending on somthing else but you can save a log of the users ip when the login (if they are using a username and password) in a db so you have their most recently used ip on file then you can match the one you get when they connect to the most recently used one but i dont know what you are really trying to do so thats the most start i can offer.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
I know most game servers keep logs of all their stats such as
1) player name
2) time online
3) kills/deaths/etc.
4) IP address
and many more.
Your existing control panels probably use SSH to issue commands to the server to tell it to restart or whatever, but your logs are most likely what you are after.
to get the logs, you are probably going to need ftp access to the server
http://www.php.net/ftp - connect to the server
http://www.php.net/file_get_contents - get files as a string
http://www.php.net/preg_match - grab data from string (probably need some help using this one though)
should be usefull
to get you started
1) player name
2) time online
3) kills/deaths/etc.
4) IP address
and many more.
Your existing control panels probably use SSH to issue commands to the server to tell it to restart or whatever, but your logs are most likely what you are after.
to get the logs, you are probably going to need ftp access to the server
http://www.php.net/ftp - connect to the server
http://www.php.net/file_get_contents - get files as a string
http://www.php.net/preg_match - grab data from string (probably need some help using this one though)
should be usefull
to get you started