Closed Pok4 closed 2 years ago
sorry for duplicates, my internet connection is drop at a time..
If you want a game server status program with the query protocols in their own file, I would suggest uing GameQ. It does that. LGSL has always used a single file for all query protocols. It is easy enough to work with once you get used to using the search feature of the editor you use. When I need to jump to a particular protocol, I might jump to just the number part like "_05" would take me to the 05 query protocol.
Thank you.
Hello @Pok4 ! Easiest way is to use lgsl_query_live function
<?php
include('lgsl/lgsl_files/lgsl_class.php');
$result = lgsl_query_live('urbanterror', '176.9.28.206', 27971, 27971, 0, "sep");
print_r($result); // there is will be an array of result of querying
?>
Thank you, @tltneon, i will test it tomorrow and i will write :) I know about gameq class but he make mistakes sometimes... I will test this one and i'm gonna to report whats the results is :)
PS: Can i just take lgsl_class.php without other files, it will work alone ?
edit: i see this: require $lgsl_file_path."lgsl_config.php"; require $lgsl_file_path."lgsl_protocol.php";
on top, but i will make the tests anyway :)
If you want to use single file, use lgsl_protocol.php (but it causes 1 warning :) )
<?php
include('lgsl_protocol.php');
$result = lgsl_query_live('urbanterror', '176.9.28.206', 27971, 27971, 0, "sep");
print_r($result); // there is will be an array of result of querying
?>
i can give you a suggestion to fix lgsl_protocol warning, find:
$lgsl_config['timeout'] = intval($lgsl_config['timeout']);
and change it to:
if(isset($lgsl_config['timeout'])) {
$lgsl_config['timeout'] = intval($lgsl_config['timeout']);
} else {
$lgsl_config['timeout'] = 0;
}
i tested it... When you use the class, it will get the value from lgsl_config.php, when you use protocol - the value is 0 it fixes the warning.
I want to have a class to querying a servers from my script. (module similar to lgsl but with different design) I'd like to have a class wich can query games like tf2,css,cs1.6,csgo,minecraft,samp and ts3.
I can write one on my own, but i wonder if you have a one... I see lgsl_protocol, but its large and take a lot of time to make the things working..
If you have, please, write and share with us :)