Exemplo n.º 1
0
	/// <summary>
	/// Raises the game scene shutdown event.
	/// </summary>
	/// <param name="sqlScene">Sql scene.</param>
	protected bool	OnUnloadGameObserver(SqlScene sqlScene)
	{
		List<string> aryObserver = new List<string>(){
			typeof(CharacterObserver).Name,
			typeof(MainObserver).Name,
			typeof(SyncObserver).Name,
		};

		return UnregisterObserver(aryObserver.ToArray());
	}
Exemplo n.º 2
0
	/// <summary>
	/// Raises the character scene event.
	/// </summary>
	/// <param name="sqlScene">Sql scene.</param>
	protected bool	OnCharacterScene(SqlScene sqlScene)
	{
		LogicPlugin logicPlugin = GameEngine.GetSingleton().QueryPlugin<LogicPlugin> ();
		if (logicPlugin)
		{
			SqlSystem sqlSystem = GameSqlLite.GetSingleton().Query<SqlSystem>(0);
			if (!string.IsNullOrEmpty(sqlSystem.MainScript))
				OnExecScript(sqlSystem.MainScript);

			CharacterObserver observer = logicPlugin.RegisterObserver<CharacterObserver>(
				typeof(CharacterObserver).Name
				);
			if (observer)
				observer.Active();
		}
		
		return true;
	}
Exemplo n.º 3
0
	/// <summary>
	/// Raises the city scene event.
	/// </summary>
	/// <param name="sqlScene">Sql scene.</param>
	protected bool	OnLoadGameObserver(SqlScene sqlScene)
	{
		List<string> aryObserver = new List<string>(){
			typeof(SyncObserver).Name,
			typeof(MainObserver).Name,
			typeof(PropertyObserver).Name
		};

		return RegisterObserver(aryObserver.ToArray());
	}
Exemplo n.º 4
0
	/// <summary>
	/// Raises the login scene event.
	/// </summary>
	/// <param name="sqlScene">Sql scene.</param>
	protected bool	OnLoginScene(SqlScene sqlScene)
	{
		// destroy version update server
		Dispatcher.UnregisterObserver(typeof(VersionObserver).Name);
		
		// load login plugin
		LoginPlugin loginPlugin = GameEngine.GetSingleton ().LoadPlugin<LoginPlugin> ();
		if (loginPlugin)
			loginPlugin.Startup ();

		return true;
	}