Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

howto use old "lgsl_servers.txt" file? #238

Open
RonXTCdaBass opened this issue Dec 8, 2024 · 4 comments
Open

howto use old "lgsl_servers.txt" file? #238

RonXTCdaBass opened this issue Dec 8, 2024 · 4 comments

Comments

@RonXTCdaBass
Copy link

Hello and big THX for holding this lgsl project alive!

my question is

How to read an old lgsl_servers.txt file from same webhost because in this file is written the actual IP to use like a dyndns.

the feed php from the old "lgsl_standalone_v3.2" makes an error 500 at my webhost.

@tltneon
Copy link
Owner

tltneon commented Dec 27, 2024

Hi @RonXTCdaBass
You can try open http://urwebsite/lgsl_files/lgsl_export.php and copy data.
image

After it you can paste it into new LGSL instance using Advanced management
image

@RonXTCdaBass
Copy link
Author

RonXTCdaBass commented Dec 27, 2024

Thanks, but its not what i am searching...

i'll try to expose...

in my old version of lgsl are some lines:

file: lgsl_settings.php

unset($get_type);

  $lines = file("../../../dyn/lgsl_servers.txt");

  foreach ($lines as $line)
  {
    if (!trim($line)) { continue; } // SKIP BLANK LINES

    $part        = explode(":", $line);
    $server_ip   = trim($part[0]);  // TRIM REMOVES
    $server_port = trim($part[1]);  // ACCIDENTAL SPACES
    $server_type = trim($part[2]);  // AND NEWLINE CHARACTERS
    
    if ($server_ip == $get_ip && $server_port == $get_port)
    {
      $get_type = $server_type; // GETS THE SERVER TYPE FROM THE LGSL_SERVERS.TXT
    }
  }

and it works => link
old_lgsl_works

it takes the server data from a file wich is automaticly updated from a small script for detecting the actual ip from my router at home, like a dyndns... i've added a few lines so the old lgsl worked with the txt file.

my file setip.php

if (isset($_GET["passwd"]) && isset($_GET["sip"]))
  {
    $passwd = $_GET["passwd"];
    $sip = $_GET["sip"];
 
    if ($passwd == $pwort)
    {
        // der Server muss Schreibrechte im akt. Verzeichnis besitzen
        $f = fopen("dyn/dyndns.txt", "w");
        fwrite($f, $sip);
        fclose($f); 
		
		$g = fopen("dyn/lgsl_servers.txt", "w");
        fwrite($g, $sip);
		fwrite($g, ':28960:wolfet:on');
        fclose($g); 
    }
  }

how can i add this way to the actual version, maybe to the "lgsl_feed.php" or "lgsl_protocol.php"
and for the menu like the add New "~ Test ( For PHP Developers )" ?

i think the right way can be a new part into the "lgsl_protocol.php" ?
like function lgsl_query_file ?

i hope my english was good enough to understand what i mean. ^^
(i'm not a developer... only a user who tries something until it works ;) ...)

@Rosenstein
Copy link
Contributor

Why not update LGSL to V6.2.1 or V7.0 and then change your setip.php script to update the "ip" field in lgsl SQL table?
That might be hard for you at first, but will be easier down the road when new versions of LGSL get released ( no PHP code patching on every update ).

@RonXTCdaBass
Copy link
Author

Thanks Rosenstein.

I think it's the only way with a target.

I've made a php upgrade at the weekend d and no lots of my scripts and snippets runs nevermore. I've looked at some scripts to (maybe) learn an see how it works.

But all this can wait until next year 😂

🎉✌️ I wich all here a great Silvester and a HAPPY NEW Year! 🍻🍻🍻🎉🎈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants