distro 99 world save not working

Open discussion forum. For topics that do not fit anywhere else.
Post Reply
destroft
New User
Posts: 9
Joined: Fri May 03, 2013 11:16 pm

distro 99 world save not working

Post by destroft »

ive tried useing the gm command to .savenow and ive tried to save from the pol emulator by pushing s the emulator does nothing and the .savenow keeps saying sending command to world saver and then does nothing i also tried to leave it open for about 20 hours and it still didnt save once any ideas on whats causeing this or what i can do to get saveing working. okay so it was 1 of 15 files that couldnt be compiles the log says.
Compiling: C:/Users/Dayton/Desktop/pol server/099/Destroft/pkg/systems/worldSaver/worldSaver.src
Too many parameters passed to ReportText
Error compiling statement at C:/Users/Dayton/Desktop/pol server/099/Destroft/pkg/systems/worldSaver/include/saver.inc, Line 81
Error compiling statement at C:/Users/Dayton/Desktop/pol server/099/Destroft/pkg/systems/worldSaver/include/saver.inc, Line 80
Error in function 'DoShutDown', File: C:/Users/Dayton/Desktop/pol server/099/Destroft/pkg/systems/worldSaver/include/saver.inc, Line 81

Error in function 'DoShutDown'.
File: C:/Users/Dayton/Desktop/pol server/099/Destroft/pkg/systems/worldSaver/include/saver.inc, Line 81
destroft
New User
Posts: 9
Joined: Fri May 03, 2013 11:16 pm

Re: distro 99 world save not working

Post by destroft »

this is lines 80 & 81 in the include file it is mentioning
for( countdown; countdown>1; countdown-=1 )
ReportText( "SYSTEM: Fantasia Shard is restarting in "+countdown+" minutes.", REPORT_BROADCAST, 33 );
(i still have to edit the shards name and such im more concerned about the errors atm then i am about the little details.)

this is the world saver file i havent edited it yet so this is what the distro comes with out of the download
/*
Maintened by *Edwards

2009-02-10

Last Modifications 2009-10-06
* Fixed server will automatically save by itself now
*/
use uo;
use os;
use math;

include ":worldsaver:saver";
include ":worldsaver:settings";

program WorldSaver()

SetGlobalProperty( "#WorldSaverPid", GetPid() );

var savetimes:=struct{"nextsave":=0, "lasttick":=0};
UpdateTimes( savetimes );

while( 1 )
var event := Wait_For_Event( GetWaitTime( savetimes ));
if( event )
savetimes.lasttick := POLCore().systime;
case( event.type )
EVENT_SAVE_NOW:
WarnPlayers();
DoTheSave();
UpdateTimes( savetimes );
break;
EVENT_START_SHUTDOWN:
DoShutDown( event.data );
break;
endcase
endif

if( ShouldSave( savetimes ))
WarnPlayers();
DoTheSave();
UpdateTimes( savetimes );
endif

SleepMS(2);
endwhile

return 1;
endprogram
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: distro 99 world save not working

Post by CWO »

What's happening is

Code: Select all

Too many parameters passed to ReportText
So the line

Code: Select all

ReportText( "SYSTEM: Fantasia Shard is restarting in "+countdown+" minutes.", REPORT_BROADCAST, 33 );
is passing too many parameters.

Try to find

Code: Select all

function ReportText
somewhere in worldSaver.src, saver.inc, or any other includes that the script is using and post it here.
destroft
New User
Posts: 9
Joined: Fri May 03, 2013 11:16 pm

Re: distro 99 world save not working

Post by destroft »

now that i look at the inc files none of them have function ReportText but it does have the reporttext mentioned in the saver file
function

unction DoShutDown( countdown:=0 )

countdown := CInt( countdown );

for( countdown; countdown>1; countdown-=1 )
ReportText( "SYSTEM: Fantasia Shard is restarting in "+countdown+" minutes.", REPORT_BROADCAST, 33 );
Sleep(60);
endfor

var i;
for( i:=60; i>1; i-=1 )
ReportText( "SYSTEM: Fantasia Shard is restarting in "+i+" seconds.", REPORT_BROADCAST, 33 );
Sleep(1);
endfor

ReportText( "SYSTEM: Shutting down now!", REPORT_ALL, 33 );
Sleep(1);

ShutDown();





and another report text function here in the saver inc file report text isnt used at all in the src file of world saver

function DoTheSave()

var acctWatch := start_script( ":accounts:acctWatcher/acctWatcher" );
if( acctWatch.errortext )
SysLog( "Error starting <:accounts:acctWatcher/acctWatcher> -->"+acctWatch.errortext );
endif

Set_Critical(1);
var save_result := SaveWorldState();
Set_Critical(0);

if( save_result == error )
ReportText( "!!! Error saving world state. Restarting Fantasia in 20 seconds !!!", REPORT_ALL );
Sleep(20);
ShutDown();
else
var save_time := save_result.ElapsedMilliseconds;
save_time := CDbl( CDbl( save_time ) / CDbl( 1000 ));
save_time := FormatRealToString( save_time, 2 );

Sleep(2);
ReportText( "SYSTEM: Finished World Save in "+save_time+" seconds.", REPORT_BROADCAST, 33 );
endif

SaveServerUptime();
destroft
New User
Posts: 9
Joined: Fri May 03, 2013 11:16 pm

Re: distro 99 world save not working

Post by destroft »

this is myecompile file i dont know if i set something up wrong or not? but i have gotten 16 errors when i try to compile all of which arnt to larg except for the world save
# $Id: ecompile.cfg 373 2006-06-17 18:27:33Z austinheilman $
#
# ecompile.cfg: must be in the same directory as ecompile.exe
#

#
# ModuleDirectory: Location of *.em files
#
ModuleDirectory C:\Users\Dayton\Desktop\pol server\099\Destroft\scripts\modules

#
# IncludeDirectory: Location of *.inc files, if not found relative
# or with a specified package
#
IncludeDirectory C:\Users\Dayton\Desktop\pol server\099\Destroft\scripts

#
# PolScriptRoot: Location of "::file" includes
#
PolScriptRoot C:\Users\Dayton\Desktop\pol server\099\Destroft\scripts

#
# PackageRoot: root directories where packages are stored
# This can be specified multiple times.
#
PackageRoot C:\Users\Dayton\Desktop\pol server\099\Destroft\pkg
PackageRoot C:\Users\Dayton\Desktop\pol server\099\Destroft\Dev pkg

#
# Default ecompile options
#
GenerateListing 1
GenerateDebugInfo 1
GenerateDebugTextInfo 1
DisplayWarnings 1
CompileAspPages 1
AutoCompileByDefault 1
UpdateOnlyOnAutoCompile 1
OnlyCompileUpdatedScripts 1
DisplaySummary 1
GenerateDependencyInfo 1
DisplayUpToDateScripts 0

not sure if this will make it easier to help me fix the issue
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Re: distro 99 world save not working

Post by Yukiko »

Look at line 12 of saver.inc:

Code: Select all

include ":security:report";
You will find the function ReportText in ...\pkg\utils\security\include\report.inc

From report.inc:

Code: Select all

function ReportText( report_text:="?", flags:=REPORT_DISABLE, text_color:=0 )

	if( !flags )
		return 0;
	elseif( flags & REPORT_CONSOLE )
		Print( ""+report_text );
	elseif( flags & REPORT_SYSLOG )
		var script_name := CStr( GetProcess( GetPid() ).name ),
                    pkg_name := GetPkgName( script_name );
                    
		LogToFile( "::log/"+pkg_name+".log", "["+script_name+"]: "+report_text, LOG_DATETIME );
	elseif( flags & REPORT_BROADCAST )
		Broadcast( ""+report_text, 3, text_color );
	endif
	
	return 1;
endfunction
POL is reporting this error somewhere in the vacinity of lines 80-82:
Too many parameters passed to ReportText
Error compiling statement at C:/Users/Dayton/Desktop/pol server/099/Destroft/pkg/systems/worldSaver/include/saver.inc, Line 81
Error compiling statement at C:/Users/Dayton/Desktop/pol server/099/Destroft/pkg/systems/worldSaver/include/saver.inc, Line 80
Error in function 'DoShutDown', File: C:/Users/Dayton/Desktop/pol server/099/Destroft/pkg/systems/worldSaver/include/saver.inc, Line 81

Error in function 'DoShutDown'.
File: C:/Users/Dayton/Desktop/pol server/099/Destroft/pkg/systems/worldSaver/include/saver.inc, Line 81

Code: Select all

function DoShutDown( countdown:=0 )

	countdown := CInt( countdown );

	for( countdown; countdown>1; countdown-=1 )
		ReportText( "SYSTEM: Zulu Hotel is restarting in "+countdown+" minutes.", REPORT_BROADCAST, 33 ); <---Line 82
		Sleep(60);
	endfor
 
        var i;
        for( i:=60; i>1; i-=1 )
		ReportText( "SYSTEM: Zulu Hotel is restarting in "+i+" seconds.", REPORT_BROADCAST, 33 );
		Sleep(1);
        endfor

	ReportText( "SYSTEM: Shutting down now!", REPORT_ALL, 33 );
	Sleep(1);

	ShutDown();

	return 1;
endfunction
However, line 82 looks to me to have the correct number of parameters. So do the two other lines that call ReportText. I can't figure out why POL is kicking out that error but I'll keep looking.

Also, your ecompile.cfg file seems fine to me as far as having the proper locations set correctly. I usually try to keep the paths shorter though. I place my POL folders directly in the C drive and not the "user" space but your settings should be fine.
destroft
New User
Posts: 9
Joined: Fri May 03, 2013 11:16 pm

Re: distro 99 world save not working

Post by destroft »

okay so my report text security file looks different and when i switch it with what you have it actually gives me more errors
this is my file

Code: Select all

/*
        Maintened by *Edwards
        For FantasiaShard.com

        Edwards@FantasiaShard.com

        2008-11-27

        A security in a serious project is a priority for the players.
        Thanks to the DistroTeam for the wonderfull idea.
*/
use uo;
use os;
use file;

CONST REPORT_DISABLE	:= 0x0;
CONST REPORT_CONSOLE	:= 0x1;
CONST REPORT_SYSLOG	:= 0x2;
CONST REPORT_BROADCAST	:= 0x4;
CONST REPORT_ALL		:= 0x7;

function ReportText( report_text:="?", flags:=REPORT_DISABLE )

	if( !flags )
		return 0;
	endif
	
	if( flags & REPORT_CONSOLE )
		Print( ""+report_text );
	endif
	
	if( flags & REPORT_SYSLOG )
		var script_name := GetProcess(GetPid()).name;
		LogToFile( "::log/security.log", "["+script_name+"]: "+report_text, LOG_DATETIME );
	endif
	
	if( flags & REPORT_BROADCAST )
		Broadcast( ""+report_text );
	endif
	
	return 1;
endfunction
and when its like this i get 15 errors with the way yours is set up it gives me 460+-.
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Re: distro 99 world save not working

Post by Yukiko »

Well, that's odd because I thought I was using the most recent SVN copy of the "Distro".

At any rate you can probably get rid of your original errors by deleting the last parameter from the three lines that call ReportText in the DoShutdown function.

If you look at the ReportText function in your report.inc file it is only asking for two (2) parameters, report_text and flags. Now look at the call to that function in your DoShutdown function. It is trying to pass three (3) parameters to ReportText, the message, the flags and a number. The number, I believe, is supposed to be a colour value for the message but your original ReportText function doesn't want that number.

So, switch back to your original ReportText security file and just remove the ", 33" from the lines in DoShutdown that call ReportText. See if that resolves your problem.

I understand your frustration trying to get the current "Distro" to compile.
destroft
New User
Posts: 9
Joined: Fri May 03, 2013 11:16 pm

Re: distro 99 world save not working

Post by destroft »

okay so this is how i fixed it and i still have 14 errors but at least it saves now i can look at the other errors and fix those to i hope XD

Code: Select all

/*
        Maintened by *Edwards
        For FantasiaShard.com

        Edwards@FantasiaShard.com

        2008-11-27

        A security in a serious project is a priority for the players.
        Thanks to the DistroTeam for the wonderfull idea.
*/
use uo;
use os;
use file;

CONST REPORT_DISABLE	:= 0x0;
CONST REPORT_CONSOLE	:= 0x1;
CONST REPORT_SYSLOG	:= 0x2;
CONST REPORT_BROADCAST	:= 0x4;
CONST REPORT_ALL		:= 0x7;

function ReportText( report_text:="?", flags:=REPORT_DISABLE, text_color:=0  )

	if( !flags )
		return 0;
	endif
	
	if( flags & REPORT_CONSOLE )
		Print( ""+report_text );
	endif
	
	if( flags & REPORT_SYSLOG )
		var script_name := GetProcess(GetPid()).name;
		LogToFile( "::log/security.log", "["+script_name+"]: "+report_text, LOG_DATETIME );
	endif
	
	if( flags & REPORT_BROADCAST )
		Broadcast( ""+report_text, 3, text_color );
	endif
	
	return 1;
endfunction
Post Reply