Lan Mode

Discuss the Dedicated Server Tools developed by Nadeo Live such as ManiaLive, Trust Circles, Dedicated Manager, Competition Manager and Lobbies

Moderator: NADEO

Post Reply
User avatar
jonthekiller
Translator
Translator
Posts: 4629
Joined: 15 Jun 2010, 11:07
Location: In Maniaplanet Alpha
Contact:

Lan Mode

Post by jonthekiller »

I have modify manialive for add a lan mode. I have tested with manialive r239, MLEPP r394 and Oliverde8 HudMenu.

I have add this :

ManiaLive\bootstrapper.php Line 63

Code: Select all

echo 'Internet              -> optionnal -> ';
if (!$sock = @fsockopen('www.maniaplanet.com', 80, $num, $error, 5)) 
{
        echo '[ No ]'. PHP_EOL; 
        $internet=0;
}else{ 
        echo '[ Yes ]'. PHP_EOL; 
        $internet=1;
}
ManiaLive\libraries\ManiaLive\Features\Updater.php Line 47

Code: Select all

			
if ($internet=1)
{
        $this->checkUpdate();
        $this->lastDisplayed = time() + 3600;
}
ManiaLive\libraries\ManiaLive\PluginHandler\PluginHandler.php Line 158

Code: Select all

			
if ($internet=1)
{
	     $plugin->onReady();
}
Last edited by jonthekiller on 09 Jul 2011, 13:01, edited 2 times in total.
Image
svens
Posts: 97
Joined: 15 Jun 2010, 11:06
Location: Bern, CH
Contact:

Re: Lan Mode

Post by svens »

The last if clauses smell a bit. Did you mean to use '=='?
User avatar
jonthekiller
Translator
Translator
Posts: 4629
Joined: 15 Jun 2010, 11:07
Location: In Maniaplanet Alpha
Contact:

Re: Lan Mode

Post by jonthekiller »

No, only one =

I have test with == and it don't work.
Image
TheM
Posts: 1379
Joined: 15 Jun 2010, 14:30
Location: Uden, Noord-Brabant, Netherlands
Contact:

Re: Lan Mode

Post by TheM »

jonthekiller wrote:No, only one =

I have test with == and it don't work.
It is wrong to not execute the isReady() function of the plugins.
In that function many important things are executed.
Global moderator | Dutch moderator | Laddermoderator | ManiaWiki moderator
Server Manager/webmaster of Smurfen.net, join us on Canyon, Valley and Royal!
ESL (Game) Staff Head for TrackMania (Stadium, Canyon and Valley).
User avatar
jonthekiller
Translator
Translator
Posts: 4629
Joined: 15 Jun 2010, 11:07
Location: In Maniaplanet Alpha
Contact:

Re: Lan Mode

Post by jonthekiller »

It's the only solution I have found actually.

We need to desactivate the function onTick on Updater.php.

After when I launch manialive, MLEPP try to verify the version on internet and it don't have a timeout. When a player connect to the server manialive crash.

You have an other solution?
Image
TheM
Posts: 1379
Joined: 15 Jun 2010, 14:30
Location: Uden, Noord-Brabant, Netherlands
Contact:

Re: Lan Mode

Post by TheM »

jonthekiller wrote:It's the only solution I have found actually.

We need to desactivate the function onTick on Updater.php.

After when I launch manialive, MLEPP try to verify the version on internet and it don't have a timeout. When a player connect to the server manialive crash.

You have an other solution?
I'll try to add an offline mode configoption into MLEPP's upcomming release.
Global moderator | Dutch moderator | Laddermoderator | ManiaWiki moderator
Server Manager/webmaster of Smurfen.net, join us on Canyon, Valley and Royal!
ESL (Game) Staff Head for TrackMania (Stadium, Canyon and Valley).
farfa
Nadeo
Nadeo
Posts: 585
Joined: 14 Jun 2010, 16:15
Location: In front of your hood with one lap late

Re: Lan Mode

Post by farfa »

I added a LAN mod couple of moth ago, to disable the updater. I'll go dig the code to find out how it works to enable it ;)

I dived in the code and I find this:

Code: Select all

if(!Loader::$config->lanMode)
{
	Updater::getInstance();
}
so to enable lanMode in your server just add this in your config.ini

Code: Select all

lanMode = true
Maybe I'll add, this as an option in the command line at startup
Also known as: satanasdiabolo
User avatar
jonthekiller
Translator
Translator
Posts: 4629
Joined: 15 Jun 2010, 11:07
Location: In Maniaplanet Alpha
Contact:

Re: Lan Mode

Post by jonthekiller »

Ok, it's better to add this in config.ini with quote for all people who search to launch manialive in lan mode.

Maybe it's good if you make this option on PluginHandler or other file for make updates for all plugins.

All plugins can use the same system for updates like this

Code: Select all

name_plugin =
url_update = http://....
version = ...
url_checkversion = http://....
And if lanMode is true, any plugin check a new version.
Image
farfa
Nadeo
Nadeo
Posts: 585
Joined: 14 Jun 2010, 16:15
Location: In front of your hood with one lap late

Re: Lan Mode

Post by farfa »

You can load this option from the config in any plugin you want ;)
Also known as: satanasdiabolo
Post Reply

Return to “Dedicated Server Tools”

Who is online

Users browsing this forum: No registered users and 1 guest