Author Topic: Server loading add-ons to 40%, going back to 0%, and repeating  (Read 1625 times)

I have no clue what is going on. I've started several servers today and they have worked just fine. I tried to start a server just now, it loads add-ons to ~40% and goes back to 0%. Loads to 40% and back to 0%. This is repeated infinitely. (I waited for ~5min, close enough.) I closed the console window to break the loop.

Between the last time I started a server and now I only joined Nasoa's server for a bit. Starting a server with only default add-ons works. I didn't change my custom gamemode since last time I started a server.

http://mirror.dataorb.net/console_repeated_loading.log

And here's the gamemode.txt which has worked fine several times. (Filename changed for hosting purposes.)
http://mirror.dataorb.net/gamemode_generalbuilding.txt

Try removing TDM for no reason, it stopped after loading that.

Odd. It has worked before with TDM enabled. In fact I took a look inside and noticed one of the filenames had a space in it. Renaming Gamemode_Team Deathmatch.cs to Gamemode_Team_Deathmatch.cs worked. I can host now.

Badspot

  • Administrator
If you could repeat the problem with trace(1); on that would be very helpful in permanently fixing the problem.

I tried several times but I couldn't recreate it with an unmodified Team Deathmatch add-on that previously caused (?) the error. My add-ons have not changed since the error. I did visit a few servers so my cached add-ons have changed but I don't think that affects server creation. But I did discover by comparing the old log and a new log (where I managed to start a server with exactly the same add-ons) that next on the loading list would have been GameMode_ZAPT. In both logs TDM is loaded correctly. In the error log ZAPT is not loaded but instead the load starts over.

Badspot, we encountered a bug like this before. We hunted for a solution for a while and I think we discovered the cause. I'll post a link as soon as the ScatteredSpace website comes back online...

Ok, here is the link: http://scatteredspace.com/forum/index.php?topic=1880.msg38693#msg38693
Thanks to Mr. Doom for the solution.



So OP, one of your add-ons is using the local variable, %i, in the global scope, which is messing up the load add-ons loop.

I *think* this can also happen if you use the findFirstFile/findNextFile functions when your add-on gets executed since those operate globally too.

Ok, here is the link: http://scatteredspace.com/forum/index.php?topic=1880.msg38693#msg38693
Thanks to Mr. Doom for the solution.



So OP, one of your add-ons is using the local variable, %i, in the global scope, which is messing up the load add-ons loop.
For those who don't have an account at SS:

Quote from: Mr. Doom
PROBLEM SOLVED.

DM+'s Ranks.cs
Line 164.
Use of %i in console local scope.

I have discovered that apparently the loading routine runs at the console's local scope instead of the scope of a function, which is strange, but whatever. Never use %i at the console local scope in your scripts. I would also suggest avoiding other one letter local scope variables, just use longer names, it doesn't hurt. As I suggested to Boom, if you have a global scope variable that you use to store the max count, then just use and increment that variable instead, so you'll never have problems again.

And now DM+ & Slayer run on both my dirty Windows 7 64-bit install of Blockland, and my clean install that is running under Ubuntu.

Sincerely,
Mr. Doom

Sorry, didn't realize that topic was in the hidden archive. Thanks Demian.

The bug returns! This time I managed to get a traced log. Like last time, I did nothing out of the ordinary.
    Started Blockland.
    Joined an online server.
    Played for a few minutes.
    Disconnected.
    Started a single player server with custom gamemode.
    Alt-Tab into Firefox, browse while waiting for the game to start.
    After some minutes the game was not yet ready and I noticed it was in the same loop as I described in OP.
    Quit the game. (Because clicking, using the keyboard while the game is loading stuff makes Windows think the game crashed even though it works fine in the background. -> Couldn't trace)

    Started Blockland.
    Trace.
    Started a single player server with custom gamemode.
    Alt-Tab into Firefox. (I did this again because I think it has a connection to the bug. I've yet to confirm that this bug happens when Blockland is constantly in focus.)
    And looped again.
    Tried to open console and Windows thinks the game crashed -> Force quit through the Windows crash dialog that popped up.

Once again it loops after loading Gamemode_TeamDeathmatch.
http://mirror.dataorb.net/console_load_loop_trace.log

Here's the gamemode I used, it has changed since last time.
http://mirror.dataorb.net/gamemode_generalbuilding.txt

I see no reason why this happened again. I've started dozens of singleplayer and multiplayer servers with this gamemode in the past few days.

Commenting out Team Deathmatch from the gamemode works, I can start a server now.

I just confirmed that this bug happens while the Blockland window is in focus the whole time.
Here's a trace in case it's needed: http://mirror.dataorb.net/console_load_loop_trace_noalttab.log