Page 1 of 2

Force loadscreen

Posted: 16 Nov 2008 12:11
by breach
Is there an easy way to implement a function for forcing custom loadscreens? I don´t belong in PHP at all so i am shooting in the dark whenever i try to make modifications on my own :oops:

I have tried to use this snippet :

Code: Select all

Aseco::registerEvent('onEndRace', 'forceModEndRace');
function forceModEndRace($aseco, $command){
    $modsStadium = array(
   'http://www.fileden.com/45645645645/StadiumLoadENG.zip'
   );
    $modsIsland = array(
   'http://www.fileden.com/45645645645/IslandLoadENG.zip'
   );
    $modsSpeed = array(
   'http://www.fileden.com/45645645645/SpeedLoadENG.zip'
   );
    $modsRally = array(
   'http://www.fileden.com/45645645645/RallyLoadENG.zip'
   );
    $modsBay = array(
   'http://www.fileden.com/45645645645/BayLoadENG.zip'
   );
    $modsCoast = array(
   'http://www.fileden.com/45645645645/CoastLoadENG.zip'
   );
    $modsAlpine = array(
   'http://www.fileden.com/45645645645/AlpineLoadENG.zip'
   );
    $idxStadium = rand(0, count($modsStadium)-1);
    $idxIsland = rand(0, count($modsIsland)-1);
    $idxSpeed = rand(0, count($modsSpeed)-1);
    $idxRally = rand(0, count($modsRally)-1);
    $idxBay = rand(0, count($modsBay)-1);
    $idxCoast = rand(0, count($modsCoast)-1);
    $idxAlpine = rand(0, count($modsAlpine)-1);
   $modCalls = array(
   array('Env'=>'Stadium', 'Url'=>$modsStadium[$idxStadium]),
   array('Env'=>'Island', 'Url'=>$modsIsland[$idxIsland]),
   array('Env'=>'Speed', 'Url'=>$modsSpeed[$idxSpeed]),
   array('Env'=>'Rally', 'Url'=>$modsRally[$idxRally]),
   array('Env'=>'Bay', 'Url'=>$modsBay[$idxBay]),
   array('Env'=>'Coast', 'Url'=>$modsCoast[$idxCoast]),
   array('Env'=>'Alpine', 'Url'=>$modsAlpine[$idxAlpine])
   );
    $aseco->addCall('SetForcedMods', array(True, $modCalls));
}
... from this thread viewtopic.php?f=28&t=17422&p=136869&hil ... en#p132930

I put the code in the idlekick plugin, i guessed it is used in the EndRace... I thought i got this to work for a while, but after some rounds i decided to put it in it´s own pluignfile to be more scalable and be used in several servers. It didnt work... so i put it back into idlekick.plugin but it wont work...

Any suggestions...?!

Re: Force loadscreen

Posted: 16 Nov 2008 13:11
by Mistral
No clue about the function, but the documentation says

Mods, an array of structures [{EnvName, Url}, ...].

$aseco->addCall('SetForcedMods', array(True, $modCalls));

$modCalls seems to be an array of arrays, not an array of structs.

Re: Force loadscreen

Posted: 23 Nov 2008 18:44
by itsjustme
Hi ...
I already added this function in an earlierer version of my modded mistral script. (release soon, if mistral give's me the O.K)
But i used a very quick, simple & nasty way to handle this.

Code: Select all

chat.admin.php -> Sample:

// Enable LoadScreen ..
$aseco->addCall('SetForcedMods', array(false, array(array('Env'=>'Stadium', 'Url'=>'http://www.SERVER.de/MODFILE.zip'))));

//Disable LoadScreen
$aseco->addCall('SetForcedMods', array(false, array()));
All other envir's (bay, coast etc.) are removed from the whole script, so i made just one function for stadium.

Re: Force loadscreen

Posted: 04 Jan 2009 07:34
by breach
Hm? Chatadmin? Does this have to be activated ingame with a /admin command? I dont see how to implement this in chat.admin.php

Re: Force loadscreen

Posted: 04 Jan 2009 11:32
by Mistral
breach wrote:Hm? Chatadmin? Does this have to be activated ingame with a /admin command? I dont see how to implement this in chat.admin.php
As you probably want to enable, disable, change it ingame you will have to add your own admin command for this.

f.e. /admin forceload <params>:

/admin forceload on
/admin forceload off
/admin forceload Stadium http://www.SERVER.de/MODFILE.zip

Re: Force loadscreen

Posted: 05 Jan 2009 09:42
by breach
i Just cant get this to work. No clue... :?

Re: Force loadscreen

Posted: 05 Jan 2009 10:48
by itsjustme
try it like this...:

Code: Select all

}elseif (($command['params'][0] == 'fmodon') {
$aseco->addCall('SetForcedMods', array(false, array(array('Env'=>'VARIABLE1', 'Url'=>'VARIABLE2'))));

Re: Force loadscreen

Posted: 06 Jan 2009 15:36
by breach
Yup, tried your example and a few on my own... Something really is fishy around all this...

I have two things to exclude imo.

1) Wrong settings or whatever when saving and compressing the imagefile... Not very likely since thay are working on local machine.

2) Test if the script really connects and downloads the file from remote...

Re: Force loadscreen

Posted: 07 Jan 2009 12:32
by breach
Nope, the script can connect to the remote server and can download the file...

Re: Force loadscreen

Posted: 07 Jan 2009 12:55
by Mistral
Is it really 'Env'? The documentation says its 'EnvName'.

Re: Force loadscreen

Posted: 07 Jan 2009 14:45
by breach
It sure does:
SetForcedMods
boolean SetForcedMods(boolean, array)
Set the mods to apply on the clients. Parameters: Override, if true even the challenges with a mod will be overridden by the server setting; and Mods, an array of structures [{EnvName, Url}, ...]. Requires a challenge restart to be taken into account. Only available to Admin.

But, the strange thing is that i cant get it to work on other AsecoMods either. Xaseco has a plguin for this and i set it up on a developementserver but that wont work either...

So, am i missing any config.setting in the dedicated.cfg perhaps...? Does any setting there has to be set to true or whatever to corespond to the frocemod stuff perhaps...?

This is all really strange to me.

Why is it set to FALSE in itsjustme example?

Code: Select all

elseif (($command['params'][0] == 'fmodon') {
$aseco->addCall('SetForcedMods', array([b]false[/b], array(array('Env'=>'VARIABLE1', 'Url'=>'VARIABLE2'))));

Re: Force loadscreen

Posted: 08 Jan 2009 20:25
by itsjustme
The 'false' is the "mod override" variable....
I set it to false cause tracks with included mods won't load anymore when the settings is "true"
(i'm only using this for showing a custom loadscreen .. so, best way keep all the other trackmods)

The code, i posted above, works very fine on my servers.
Check it out -> Germany/Hesse/Gießen -> INSOMNIA*
(but wait till map change while mod loads)

So, where's exactly the problem ? Code works, just drop it in chat.admin and add a specific chat command infront ;)

Re: Force loadscreen

Posted: 09 Jan 2009 06:56
by breach
Yup, it works fine. On your servers :D Not on mine... :(

This is all to strange to me. The screens simply are not loading when supposed to, or at all. The code should be working and i turned this problem inside out over and over again... but the problem must be somewhere else.

If i´m not completley missundersdtanding the ingame command for it?

in your example it should be activated like this:

/admin fmodon

Or?

Re: Force loadscreen

Posted: 09 Jan 2009 13:15
by itsjustme
Ok, again .. here's my complete code (as i told, very simple way to handle it)

Code: Select all


 :wink:

Re: Force loadscreen

Posted: 09 Jan 2009 15:16
by breach
Thanks, i managed to set up the chat.admin.php like you explained. It does not help :?

I relly believe your code is working... but i dont think it is the code that is the problem... but i have no clue on what it is...

Anything i could have missed in the serverconfig...? anyways... i´ll mind this later on... thanks for your help :thumbsup: