-
Notifications
You must be signed in to change notification settings - Fork 49
How to install LGSL
Note that your hosting have to be able to send queries to gameservers!
composer require tltneon/lgsl:~6.0.0
After that you can use LGSL as regular or as library:
include('lgsl/lgsl_files/lgsl_class.php');
$result = lgsl_query_live('urbanterror', '176.9.28.206', 27971, 27971, 0, "sep");
print_r($result);
include('lgsl/lgsl_files/lgsl_class.php');
$result = lgsl_query_live('discord', 'nDuNTC6', 1, 1, 0, "sep");
print_r($result);
-
Download and Setup PHP (PHP)
Create empty database (for example: lgsl)
Note: For easiest way you may use WinNMP or XAMPP or AMMPS
- Download stable version or latest commit. of LGSL. (*Note that commit can have any bugs)
- Unzip on your website. (for example to: //wwwroot/lgsl)
- Open your LGSL (for example: http://your.awesome.website.com/lgsl/)
- Go to Installation page and fill inputs with your database credentials (db server ip, db username, db password, database name)
- Choose LGSL table name and click on "Create table".
- Fill remaining inputs (lgsl admin name, password), choose LGSL style, language and other options.
- Click on "Generate config"
- Copy entire text to lgsl_files/lgsl_config.php and save.
- !! Delete install.php
- Go to http://your.awesome.website.com/lgsl/admin.php
- Use your admin login and password.
- On the next page add IP and connection port, choose game type (protocol) and click on "Save - Clear cache"
CREATE TABLE
lgsl
(
id
INT (11) NOT NULL auto_increment,
type
VARCHAR (50) NOT NULL DEFAULT '',
ip
VARCHAR (255) NOT NULL DEFAULT '',
c_port
VARCHAR (5) NOT NULL DEFAULT '0',
q_port
VARCHAR (5) NOT NULL DEFAULT '0',
s_port
VARCHAR (5) NOT NULL DEFAULT '0',
zone
VARCHAR (255) NOT NULL DEFAULT '',
disabled
TINYINT (1) NOT NULL DEFAULT '0',
comment
VARCHAR (255) NOT NULL DEFAULT '',
status
TINYINT (1) NOT NULL DEFAULT '0',
cache
TEXT NOT NULL,
cache_time
TEXT NOT NULL,
PRIMARY KEY (id
)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in ***\html\lgsl\lgsl_files\lgsl_class.php:109
To solve that problem you need to uncomment next line into php.ini:
;extension=mysqli
turn into:
extension=mysqli
If it doesn't help you, you should find php\ext folder and set absolute path to mysqli lib like for example
extension=C:\nginx\php\ext\php_mysqli.dll
Your LGSL is not installed. First you need to create database and after it create a lgsl table. Or you just have wrong configuration settings in config.php.