Online status and players online
Ok, well i dont know how many people will want to use this or not, but i thought it might be nice to share since it is Christmas . What it does is open a connection to a server (doesnt have to be a RunUO to determine if it is online) and then if it is a RunUO server, it retrieves the number of players online. The header pretty much explains everything i think and i put enough comments for even a beginner to understand. One quick note though, is i am not sure what I am sending to the server to get the number of players online except it is UOGateway sends when it checks the status.
So here it is and if anyone has any questions, dont be afraid to ask, but im a definately no expert. Some initial tips though are: make sure the directory that it is in is chmod 777 so the cache file can be created (although you might be able to create it youself and not worry about that, i didnt test that though);make sure your webserver supports allowing php to use sockets because some dont; and dont ever use 0 for the interval except for testing because this means every new page load will connect to your server, which isnt good. Be sure to change the extension to php instead of txt (the forums dont allow uploading php extensions).
Oh and yes it might be faster if i didnt do some of the checks and various things i did, but i wanted to make it simple when you use it, so you dont have to set all of the options, since it will do it automactially.
Edit: Alright well here is the updated version in the zip, you need to upload both the install and the checkserver.php. Also make sure the directory is 775 otherwise you actually have to mess with some stuff manually (deleting and making a config file). It will tell you if it cant write these files and such. Be sure that the table name and the cache file name are unique cause i didnt do any checks so i dunno what will happen and make sure that atleast one or the other is checked. If both are checked, then the cachefile is used as a backup incase the database fails. Only the mySQL database is supported (i have version 4.0.24, but it should work with any, if not, please tell me what the error says), and i have no plans of supporting any others since i believe this is the most popular and i dont have access to anyothers.
UPDATE: I got rid of the install script cause too many variables to check if it doesnt work, now all you have to do is drop it in a directory, read the header of checkserver.php, change your values in the config file, and you should be set. Shouldnt be hard at all if you know anything about php and Ill try to answer questions if i can. I know I havent updated this in a while (and this isnt much of an update anyways), but Ill see if I can be around more now. Oh and I didnt test these changes at all (cause they were small) so if you notice something weird, let me know.
Ok, well i dont know how many people will want to use this or not, but i thought it might be nice to share since it is Christmas . What it does is open a connection to a server (doesnt have to be a RunUO to determine if it is online) and then if it is a RunUO server, it retrieves the number of players online. The header pretty much explains everything i think and i put enough comments for even a beginner to understand. One quick note though, is i am not sure what I am sending to the server to get the number of players online except it is UOGateway sends when it checks the status.
So here it is and if anyone has any questions, dont be afraid to ask, but im a definately no expert. Some initial tips though are: make sure the directory that it is in is chmod 777 so the cache file can be created (although you might be able to create it youself and not worry about that, i didnt test that though);make sure your webserver supports allowing php to use sockets because some dont; and dont ever use 0 for the interval except for testing because this means every new page load will connect to your server, which isnt good. Be sure to change the extension to php instead of txt (the forums dont allow uploading php extensions).
Oh and yes it might be faster if i didnt do some of the checks and various things i did, but i wanted to make it simple when you use it, so you dont have to set all of the options, since it will do it automactially.
Edit: Alright well here is the updated version in the zip, you need to upload both the install and the checkserver.php. Also make sure the directory is 775 otherwise you actually have to mess with some stuff manually (deleting and making a config file). It will tell you if it cant write these files and such. Be sure that the table name and the cache file name are unique cause i didnt do any checks so i dunno what will happen and make sure that atleast one or the other is checked. If both are checked, then the cachefile is used as a backup incase the database fails. Only the mySQL database is supported (i have version 4.0.24, but it should work with any, if not, please tell me what the error says), and i have no plans of supporting any others since i believe this is the most popular and i dont have access to anyothers.
UPDATE: I got rid of the install script cause too many variables to check if it doesnt work, now all you have to do is drop it in a directory, read the header of checkserver.php, change your values in the config file, and you should be set. Shouldnt be hard at all if you know anything about php and Ill try to answer questions if i can. I know I havent updated this in a while (and this isnt much of an update anyways), but Ill see if I can be around more now. Oh and I didnt test these changes at all (cause they were small) so if you notice something weird, let me know.