Comments (38)
ok i'm looking at it now, i must have forgotten a file!
from lgsl.
Hello,
For Farming Simulator 13/15/17/19, you must add a "code" column in the TABLE.
Create an XML function 'simplexml_load_string'.
exemple : https://gmus.duckdns.org/listserver-d-MTM
ex code : $serverAddress = "http://{$server['b']['ip']}:{$server['b']['q_port']}/feed/dedicated-server-stats.xml?code={$server['b']['code']}";
thank.
from lgsl.
?? i cant do this :-(
from lgsl.
Can you Help me,in which File Mist i implate this
from lgsl.
@Webby0815
Hi,
I add this code in 'lgsl_protocol.php' 'lgsl_protocol.php'
Please note that this works for me, but I am not a professional, please be indulgent.
after line 53 :
"fs2013" => "Farming Simulator 2013",
"fs2015" => "Farming Simulator 15",
"fs2017" => "Farming Simulator 17",
"fs2019" => "Farming Simulator 19",
after line 184 :
"fs2013" => "39",
"fs2015" => "39",
"fs2017" => "39",
"fs2019" => "39",
after line 3994 :
//------------------------------------------------------------------------------------------------------------+
//------------------------------------------------------------------------------------------------------------+
function lgsl_query_39(&$server, &$lgsl_need, &$lgsl_fp){ // Farming Simulator 13/15/17/19 | OK - 26/03/21
$serverAddress = "http://{$server['b']['ip']}:{$server['b']['q_port']}/feed/dedicated-server-stats.xml?code={$server['b']['code']}";
$xml = getServerStatsSimpleXML($serverAddress,$server['b']['type'],$server['b']['q_port']);
$key = array('Big Bud Pack','Platinum Expansion','KUHN Pack','ROPA Pack'); // LIST DLC FS
$m=0;
if($xml){
if($xml["name"] != NULL){$server['s']['name'] = $xml["name"];}else{$server['s']['name'] = "WebInterface ON | Server OFF";}
$server['b']['status'] = 1;
$server['s']['map'] = $xml["mapName"];
$server['s']['playersmax'] = $xml->Slots["capacity"];
$server['s']['players'] = $xml->Slots["numUsed"];
$server['s']['password'] = 0;
$server['e']['Game'] = $xml["game"];
$server['e']['Server'] = $xml["server"];
$server['e']['dedicated'] = "Dedicated";
$server['e']['Platform'] = "Wine";
$server['e']['Version'] = $xml["version"];
$server['e']['Heure_Carte'] = gmdate("H:i:s",($xml['dayTime'] * 1)/1000);
foreach($xml->Mods->Mod as $mod){
if(in_array($mod, $key )){$item_value = '-DLC- /';}else{$item_value = '';}
$server['e']['Mods'] = isset($server['e']['Mods']) ? $server['e']['Mods'] : NULL;
$m++; $server['e']['Mods'] .= $m ." | ".$mod." / ".$item_value." ".$mod["author"]." / ". $mod["version"]."
";
}
$server['e']['Money'] = number_format($xml['money']+0, 0, '','.').' Euros';
if ($xml->Slots["numUsed"] >= 1) {
$slotCount = 1;
foreach ($xml->Slots->Player as $player){
if ($player["isUsed"] == "true") {
$hours = floor($player["uptime"]/60);
$minutes = floor($player["uptime"]-($hours * 60));
$server['p'][$slotCount]['name'] = $player;
$server['p'][$slotCount]['Time'] = $hours . ":" . sprintf("%02d", $minutes) . "h ";
$server['p'][$slotCount]['Adn'] = (($player["isAdmin"] == "true")?"Yes":"No");
}
$slotCount++;
}
}else{$server['p'] = "";}
return TRUE;
}else{
return FALSE;
}
}
//------------------------------------------------------------------------------------------------------------+
//------------------------------------------------------------------------------------------------------------+
//---Fonction Farming Simulator----------------//
function loadFileHTTPSocket($domain, $port, $path, $timeout) {
$fp = fsockopen($domain, $port, $errno, $errstr, $timeout);
if ($fp) {
// Make request
$out = "GET ". $path . " HTTP/1.0\r\n";
$out .= "Host: ". $domain . "\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
// Get response
$resp = "";
while (!feof($fp)){$resp .= fgets($fp, 256);}
fclose($fp);
// Check status is 200
if(preg_match("/HTTP/1.\d\s(\d+)/", $resp, $matches) && $matches[1] == 200) {
// Load xml as object
$parts = explode("\r\n\r\n", $resp);
$temp = "";
for ($i=1;$i<count($parts);$i++) {
$temp .= $parts[$i];
}
return $temp;
}
}
return false;
}
//-----
function getServerStatsSimpleXML($url,$type,$q_port) {
$urlParts = parse_url($url);
$cacheFile = ".cache/dedicated-server-stats-$type-$q_port.cached";
$cacheTimeout = 4*2;
if(file_exists($cacheFile) && filemtime($cacheFile) > (time() - ($cacheTimeout) + rand(0, 10))) {
$xmlStr = file_get_contents($cacheFile);
} else {
error_reporting(0);
$xmlStr = loadFileHTTPSocket($urlParts["host"], $urlParts["port"], $urlParts["path"] . "?" . $urlParts["query"], 4);
error_reporting(E_ALL);
if ($xmlStr) {
$fp = fopen($cacheFile, "w");
fwrite($fp, $xmlStr);
fclose($fp);
}
}
return simplexml_load_string($xmlStr);
}
from lgsl.
Parse error: syntax error, unexpected '1' (T_LNUMBER) in /var/www/clients/client1/web19/web/lgsl_files/lgsl_protocol.php on line 4022
this is the line $server['e']['Heure_Carte'] = gmdate("H:i:s",($xml['dayTime']1)/1000);
but what is with the api code ?
from lgsl.
Hello
you use the code for which farming simulator?
from lgsl.
this code is not functionally , the xml api code was not implate in the code.... has you discord ?
from lgsl.
no I have no discord and I am French and do not speak English :(
did you create the .cache directory at the root?
You load the xml file, read it and display the info, with simplexml_load_string function of php (https://www.php.net/manual/fr/function.simplexml-load-string.php).
Do you have the server link like this so that I can test: :
http://192.168.0.20:8090/feed/dedicated-server-stats.xml?code=eaef1e92044c7441a46514773f074ec3
from lgsl.
YES , you must insert the ?code=eaef1e92044c7441a46514773f074ec3 by registriatrion a server ...where is that form ? thas my problem :-(
from lgsl.
There,
It is this column 'code' that I added in the table after 's_port'.
Please note that another page must be modified afterwards.
code={$server['b']['code']}
from lgsl.
can you send me the modify files please , i think iam too stupid :-(
from lgsl.
Do you know PhpMyAdmin?
from lgsl.
yes ,thats row have a set , i need the files ,ikl. the add page :-(
from lgsl.
is the 'lgsl_add.php' page causing you a problem?
from lgsl.
no , thats row :
$server['e']['Heure_Carte'] = gmdate("H:i:s",($xml['dayTime']1)/1000);
i think the 1 iss the problem ... the error is delete , but how becam i the key form
in the add page
from lgsl.
Yes it is missing '*'
sorry I did not see :(
line 4022 ,4034
$server['e']['Heure_Carte'] = gmdate("H:i:s",($xml['dayTime']*1)/1000);
$minutes = floor($player["uptime"]-($hours * 60));
from lgsl.
okay ,and the form for the api key code ?
from lgsl.
Page lgsl_add.php ?
from lgsl.
yes ...
from lgsl.
Can you wait 5 minutes have to modify it because I don't use it.
Did you create the "code" column in the table?
from lgsl.
yes ....
from lgsl.
more than 5 mins ;-)
from lgsl.
Sorry for the delay,
I modified all the files, I even advise you to do a reinstallation like that even the BDD will be Good.
Or Rename column "code" in "g_code" !
Exemple : https://farming-simulator.gmus.fr/
https://uptobox.com/8z1zm7s1z27q ( update 23/11/21-23h10)
from lgsl.
this works half ;-/
look : https://g-tracker.de/index.php?s=21
from lgsl.
Hello
Since I don't have an fs22 server, I don't know how the xml file is constructed so that I can adapt the code.
from lgsl.
no , the image stats dont works
@ other servers too
error 500 : https://g-tracker.de/userbar.php?s=19
from lgsl.
Update : https://uptobox.com/4ztsl6lofj80 (24/11/21-19h20) Update image + game fs2022 👍
Attention I noticed that if a port or g_code is at "0", the banner does not work. [put a value (ex: 1) ]
https://farming-simulator.gmus.fr/userbar.php?s=1
from lgsl.
good , now works the chats.php not :-(
from lgsl.
charts.php
line 43 replace :
$server = lgsl_query_cached($lookup['type'], $lookup['ip'], $lookup['c_port'], $lookup['q_port'], $lookup['s_port'], "s");
to :
$server = lgsl_query_cached($lookup['type'], $lookup['ip'], $lookup['c_port'], $lookup['q_port'], $lookup['s_port'], $lookup['g_code'], "s");
from lgsl.
Great , its works ! i wait for the chart updates ....big thanks to you
from lgsl.
lgsl_protocol.php
line 4029 replace :
if($type != 'fs2022'){
to :
if($server['b']['type'] != 'fs2022'){
thank.
update : https://uptobox.com/yqbq7rs0lmne (24/11/21-20h00)
from lgsl.
Cool ,thanks,
can i do it , the uipdate only from rcon ,the page speed is not to fast
from lgsl.
Hello,
I use it and I have no problem.
from lgsl.
https://g-tracker.de/
some servers show nothing and the page is a bit slow. I would like to update the whole thing via cron job
from lgsl.
Hello
lgsl_protocol.php
line 4092 replace :
$cacheTimeout = 4*2;
to :
$cacheTimeout = 25*2;
bye.
from lgsl.
the side is slowly , can i remove update per view @ index ...
from lgsl.
How did you add the player bargraph bubble in the list.php?
from lgsl.
Related Issues (20)
- Add a vote for the server HOT 1
- 6.2.0 Errors HOT 1
- timezone settings HOT 4
- userbar not refresh HOT 2
- TS3 Loading Time HOT 7
- V7.0.0 - lgsl_protocol.php HOT 1
- Request to api.hellbz.de has changed HOT 5
- Discord and mumble not working !! HOT 5
- Server Banners are not updating HOT 3
- does this work for cs2? HOT 10
- charts not working HOT 1
- LGSL7: 2 BUGS (UserBAR T=3 && lgsl_feed.php) HOT 2
- LGSL7: lgsl_protocol.php HOT 2
- LGSL7: mysqli_sql_exception HOT 1
- e107 version for LGSL 6.2.0 available HOT 1
- minecraft new versions HOT 7
- Erro: lgsl_protocol HOT 1
- $server->lgsl_live_query('sep') not working in the right way HOT 4
- pagination not working HOT 6
- Add VRising support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lgsl.