Jump to content

[MOD] Game Server Info


kalyse

Recommended Posts

Hey, As I said in the Thread I would post once I have the time.

 

 

 

I modded the LGSL program and incorporated it to use a mySQL database. This makes things much easier for me because it allows me to assign a server in LGSL to a client etc. It basically means that I can display the servers when and how I choose.

 

 

 

Please don't download this if you do not understand what mySQL means. I dont want to help people install it when you have no use for it and you could just use the standard LGSL 1.8 that uses a TXT file to store the files.

 

 

 

I found it impossible to use for what i wanted so MODDED It.

 

 

 

==============================

 

 

 

PLEASE READ THE README - DO NOT TRY AND USE IT WITHOUT READING

 

 

 

==============================

 

 

 

DOWNLOAD: http://www.invision-gaming.co.uk/downloads/index.php?act=vie w&id=3

 

 

 

CHANGES:

 

There is quite alot of changes with it, most listed in the README.

 

 

 

You will notice a lot more files in there aswell, most are blank and just include other files because it makes it easier to display the data and create a template. Plus I didnt like the name lgsl_players.php so I changed it to players.php which is the file that you should include your header and footer in.

 

 

 

Make sure you setup the details in your Config.

 

 

 

CREDIT: Full credit goes to Richard Perry for creating the Code,

 

 

 

 

Link to comment
Share on other sites

And Example of the script can be seen here:

 

=======================================

 

http://www.invision-gaming.co.uk

 

=======================================

 

 

 

You can see the table on the right.

 

 

 

 

 

FUTURE:

 

I will release the PHP code used to add servers later, but for now you can just make do with that, I assume you know how to add entries with mySQL anyway

 

 

Link to comment
Share on other sites

It requires quit a lot of management from you. Which is why I say dont try and use it if you dont know how mySQL works, and you have good understand of PHP, and you can wrap it within your website. I reckon it would take about 10-20 minutes to setup.

 

 

 

 

 

Do you guuys need the code to remove and add and edit servers?

Link to comment
Share on other sites

I assume you do not have a script inserting the database information for all servers itself from tcadmin? Just want to make sure before I start working on that.

 

 

 

 

 

I didnt have time to do anythignlike that, but the things I was goign to do is this:

 

 

 

 

 

Find out the Servers runnning on TC Admin

 

(Add the remove and add IP for)

 

(Get it working with Crontabs)

 

 

 

The thing at the moment is that it takes about 4 seconds for the user to run the script, I have actually fixd it on my server so that its instant, the user never actually needs to wait for the Game servers to be queried.

 

 

 

http://www.invision-gaming.co.uk

 

 

 

You see how there is no load time, Thats because I have a crontab that runs every minute to execute the script, the crontab is this:

 

 

 

* * * * * php /my/home/directory/servers/cronstats.php

 

 

 

Then the cronstats.php file basically runs the stats PHP file and the distributes the cache around my server. (This is because I have been unable to just use one cache, it seems that there needs to be a cache in each directory where the user canview your website, and if you have multiple websites that can be a pain.

 

 

 

cronstats.php file:

 

 

 

 

 

<?php

 

 

 

 

 

 

 

 

 

include('lgsl_stats.php');

 

 

 

$file = 'lgsl_cache.dat';

 

$newfile = '../lgsl_cache.dat';

 

 

 

copy($file, $newfile);

 

 

 

 

 

//You need to move the file to any child directory that your users view, like for instance http://www.invision-gaming.co.uk/downloads

 

 

 

$file = 'lgsl_cache.dat';

 

$newfile = '../downloads/lgsl_cache.dat';

 

 

 

copy($file, $newfile);

 

 

 

?>

 

 

 

 

 

 

 

 

 

Notes: You have to realise this is a really sloppy way but works. Because I didnt make the original script im just 'editing' it, there is alow of redundant code and effeciency isnt 100% but thats why we make the crontab eecute the script instead so it doesnt matter about effeciency because our users never feel the loading.

 

 

 

Notes#2: I can get the script to automaticaly pull all of your IPs out of TCAdmin, but the problem with that is you would need to run it on your server, the best thing to do would be to use a separate script that isnt related that creates a SQL file.

 

 

 

Also you may have noticed that there is some data already in the SQL file, this is just 'test data' and should be replaced.

 

 

 

Thirdly: You may notice other fields, this is to be used in any way you need, like I use them to show wether they should be displayed maybe because I have decided to bann the user, in whcih case I can change the query that fetches the server to

 

 

 

$query = "SELECT * FROM `iservers` where active = 1";

 

 

 

This will then only display there servers that have the value active.

 

 

 

What else is useful is that you can do other searches, lets say you have 1000 servers, you could add your clients clan name in there and then install a search box and do:

 

 

 

$query = "SELECT * FROM `iservers` where name like '".$searchitem."'";

 

 

 

//Obviosuly the column name would have to be added, but the possibilities using a mySQL database are by far endless, which is why I decided to add this instead of using a standard text file.

 

 

 

Has anyone installed it yet?

Link to comment
Share on other sites

Ok I get what you mean now. You probably still know that somebody (cant remember who) has written the VB TCADMIN Script which generates the LGSL text file. Why don't use that and write an additional file which transfers this data into the Database? That is what i thought about yesterday but I was not sure if I should try that or simply write a new TCADMIN SDK script in first place which imports the data into a database?

 

 

 

What do you think?

Link to comment
Share on other sites

Thanks Kalyse for this...

 

 

 

While I am not a game hosting provider, I do run a clan for Medal of Honor and I have a license with TCAdmin.

 

 

 

I used the basics of your script to use on my site that I have created. (lower right hand content box).

 

 

 

http://www.area51moh.com/testsite/

 

 

 

*Note: I am still building this site, so not all of it is as it will be when I am finished.

 

 

 

Once again, thanks for this as it does exactly what I wanted it to do.

 

 

 

G3mInI

Link to comment
Share on other sites

  • 2 years later...
  • 3 weeks later...
  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use