Resolved "холостые" вызовы ивента финиша

Автор темы #1
Дата рег
19 Фев 2011
Сообщения
197
Симпатии
73
До старта сервера ивент финиша вызывается 2 раза.

Код:
Module Master = null;
 
void ModuleInit()
{
	__EventFinish.Subscribe( OnFinish ); // Некорретная остановка сервера при отсутствии этого ивента.
	@Master = @Module();
}
 
void OnFinish( )
{
	Log( "Finish" );
}
 
class Module
{
	Module( )	{
		Log( "Construct");
		OnInit( );
	}
 
	~Module( ) {
		Log( "Destruct");
		OnFinish( );
	}
 
	void OnInit( )
	{
		__EventGenerateWorld.Subscribe( EventGenerateWorldFunc( @this.OnGenerateWorld ) );
		__EventFinish.Subscribe( EventFinishFunc( @this.OnFinish ) );
		__EventCritterInit.SubscribeToFirstTime( true, EventCritterInitFunc( @this.OnCritterFirstInit ) );
	}
 
	void OnFinish( )
	{
		Log( "ThisFinish" );
		/*__EventGenerateWorld.Unsubscribe( EventGenerateWorldFunc( @this.OnGenerateWorld ) );
		  __EventFinish.Unsubscribe( EventFinishFunc( @this.OnFinish ) );
		  __EventCritterInit.UnsubscribeFromFirstTime( true, EventCritterInitFunc( @this.OnCritterFirstInit ) );
		  @Master = null;*/
	}
 
	void OnGenerateWorld( uint16& multiplier, uint16& year, uint16& month, uint16& day, uint16& hour, uint16& minute )
	{
		Log( "this Generated" );
	}
 
	void OnCritterFirstInit( Critter critter, bool firstTime )
	{
		Log( "OnCritterFirstInit");
	}
}
[00:023] FOnline server, version 799.
[00:023] *** Starting initialization ***
[00:024] Script system initialization...
[00:030] Reload scripts...
[00:072] Reload scripts complete.
[00:073] Script system initialization complete.
[00:073] Load language packs...
[00:075] Load language packs complete, count 1.
[00:075] Reload client scripts...
[00:079] Reload scripts...
[00:211] Reload scripts complete.
[00:238] Reload client scripts complete.
[00:238] Indexing client data...
[00:239] Indexing client data complete, count 0.
[00:239] Load dialogs...
[00:241] Load dialogs complete, count 0.
[00:241] Load prototypes...
[00:257] Load prototypes complete, count 17.
[00:257] Main : Construct
[00:257] Generate update files...
[00:310] Generate update files complete.
[00:311] Main : ThisFinish
[00:311] Main : Finish

[00:312] World dump file not found.
[00:312] Main : ThisFinish
[00:312] Main : Finish

[00:312] Main : this Generated
[00:312] Starting server on port 4005 and 4006.
[00:312] *** Starting game loop ***
[02:855] *** Finishing game loop ***
[02:855] Main : ThisFinish
[02:855] Main : Finish
[02:855] World saved in 0.155042 ms.
[02:861] World flushed on disk in 6.0743 ms.
[02:861] Dialog manager finish...
[02:861] Dialog manager finish complete.
[02:861] Script system finish...
[02:862] Main : Destruct
[02:862] Main : ThisFinish
[02:866] Script system finish complete.
[02:867] Server stopped.
[02:867] Statistics:
[02:867] Traffic:
[02:867] Bytes Send: 0
[02:867] Bytes Recv: 0
[02:867] Cycles count: 247
[02:867] Approx cycle period: 0
[02:867] Min cycle period: 0
[02:867] Max cycle period: 0
[02:867] Count of lags (>100ms): 0

П.С. Оно конечно правится банально установкой этого ивента в скриптах во время ивента старта, но если проморгать может выйти боком.
 
Последнее редактирование:
Дата рег
16 Сен 2011
Сообщения
208
Симпатии
72
Должно быть исправлено с переходом на новую ситему хранения данных с ревизии 800.