Skip to content
Neon edited this page Jan 3, 2024 · 33 revisions

Hello and welcome to LGSL Wiki! GitHub stars GitHub forks

Visit for the first time? => Leave the Star and Fork LGSL Repo!

Download

v6 (TLS, stable) v7 (DEV, unstable)
Download Download latest Download latest
Environment
Easily updates from oldest versions of LGSL May be incompatible with older versions

Install with Composer

composer require tltneon/lgsl 7.0.0

Querying:

<?php
  include("vendor/autoload.php");
  $server = new tltneon\LGSL\Server([
	'type' => 'urbanterror',
	'ip' => '85.27.184.76',
	'c_port' => 27961,
	'q_port' => 27961,
  ]);
  $server->lgsl_live_query();
?>

Printing:

<p>Name: <?= $server->get_name(); ?></p>
<p>Players: <?= $server->get_players_count(); ?></p>
<p>Map: <?= $server->get_map(); ?></p>
<p>IP: <?= $server->get_ip(); ?>:<?= $server->get_c_port(); ?></p>
<p><a href="<?= $server->get_software_link(); ?>">Connect!</a></p>

Top links

GitHub code size in bytes Packagist

FAQ

How to upgrade LGSL?

  1. Download stable version or latest commit. (*Note that commit can have any bugs)
  2. Backup your LGSL.
  3. Extract new LGSL into your LGSL folder with replacing (DO NOT replace lgsl_config.php)
    3.1 Check out your lgsl_config.php and new one - there are can be several changes.
  4. If everything is good - now you have most latest version of LGSL.
  • In other cases just roll back to your backup version. If you try to upgrade to LGSL v7, I recommend to do clean install.

How to go to Admin panel?

There are two ways you can enter the Admin panel: (Note that you need to install LGSL first)

  1. Just typing http://your_website/lgsl_folder/admin.php (For example: http://your_website/lgsl/admin.php)
  2. Or clicking on the top right corner of the page. Cheers, you just found a hidden link, ha-ha.

How to add servers to website's sidebar?

There are several ways to do that. See Server banners

How to make backup?

  1. Open http://your_website/lgsl_files/lgsl_export.php
  2. Copy whereever you need and save.

Possible parameters:

  • Print as JSON: http://your_website/lgsl_files/lgsl_export.php?json=1
  • Print as XML: http://your_website/lgsl_files/lgsl_export.php?xml=1
  • Download as txt file: http://your_website/lgsl_files/lgsl_export.php?download=1
  • Only online: http://your_website/lgsl_files/lgsl_export.php?online=1
  • Only enabled: http://your_website/lgsl_files/lgsl_export.php?nodisabled=1
  • Sorting by ip or type: http://your_website/lgsl_files/lgsl_export.php?sort=ip

For example, you can export enabled servers sorted by type as xml: http://your_website/lgsl/lgsl_files/lgsl_export.php?xml=1&nodisabled=1&sort=type

Page loads slowly

If you have more than 20 servers in your list, and you need the server information to be more accurate as to current players and map information, then you can schedule updates.

Since LGSL updates when viewed, there has to be a limit on the update time otherwise the page would take a long time to load while it polls all the servers.

By scheduling the webserver to 'view' LGSL at regular intervals, the server information is cached ready for when a visitor views LGSL. Scheduling on webservers is known as a 'cron job'.

Setting up a cron differs between hosts, so you may need find out what method your host supports, but here are examples of cron commands that I have used in the past.

curl --compressed -s -o /dev/null http://*your_website*/lgsl/lgsl_files/lgsl_cron.php
wget -q -O /dev/null http://*your_website*/lgsl/lgsl_files/lgsl_cron.php
php -q /public_html/lgsl/lgsl_files/lgsl_cron.php

Before setting up the cron, its recommended that you view the lgsl_cron.php in your browser to make sure that there are no errors, and you can see how long it takes to update the servers.

The icons and other images are not showing

First make sure the icons uploaded properly and that you can directly open them in your browser. If LGSL is looking for them in the wrong place, manually set the path to /lgsl_files/ in the LGSL_CONFIG.php remembering to include the trailing slash, for example:

$lgsl_config['url_path'] = "http://your_website/folder/gameservers/lgsl_files/";

Troubleshooting with adding game server

There is no game that I'm looking for!

If you not found a game in admin panel, visit that page

Most of games builded on similar query protocols so they are grouped and you can try to find out by yourself.

If you want to add any new game to that list, just create a new issue like that one.

My server isn't working!

Before you say that LGSL isn't works:

  1. Make sure your server is working now and also server's ports is opened.
  2. Make sure you're selected right protocol and entered query port (some servers uses slightly different query port than connection port).
  3. Make sure that your web hosting has open ports and allow to sending requests to game servers.

Changing visuals

How do I change style?

  • Go to lgsl_config.php
  • Find $lgsl_config['style'] = "breeze_style.css"; and replace at $lgsl_config['style'] = "darken_style.css"; for example.

You can find styles at /lgsl_files/styles/ folder.

How do I change language?

  • Go to lgsl_config.php
  • Find include("languages/english.php"); at very end of file and replace at include("languages/russian.php"); for example.

You can find languages at /lgsl_files/languages/ folder.

And a few lines at file install.php

Can't find your language? Contribute us your translation with your native language!

(You can use Google Translate if you need)

How can I make my own style?

You need to know CSS3 and use Developer Tools (e.g. DevTools into Mozilla Firefox).

  • Make file your_file_name.css at /lgsl_files/styles/ folder.
  • Change style in lgsl_config.php and now you have your own custom style of LGSL!

How can I add map images?

  • All of map images stores at /lgsl_files/maps/
  • Images should be only .png, .gif, .jpg

For example, we have any CS:GO server with map de_dust2. So to add map image we need to look at game type, game name and map name. CS:GO has gametype "source", game name "csgo" and map name "de_dust2". After we get that we can upload map image called de_dust2.jpg into /lgsl_files/maps/source/csgo/ folder. If it isn't exists - just create! That's all! If you correctly made it default map image will be replaced with yours new. Watch in YouTube

Most common images you can download from here.

How can I help with .. ?

Mainly we need to help with finding bugs and to help to translate to any language.
Any your ideas (such as new style, game type, new feature) you can suggest to Issues page.
Also you can fork LGSL repository and give a star. Thanks!