src/Neuron/GameServer/Player/Updates.php
private function refreshSession ()
	{
		$mapper = Neuron_GameServer_Mappers_UpdateMapper::getInstance ();

		// First check if we have a last id
		if (!isset ($_SESSION['ngpu_lastlog']))
		{
			// New session, can't have updates. No flags set.
			$_SESSION['ngpu_lastlog'] = $mapper->getLastLogId ($this->objProfile);
			$_SESSION['ngpu_data'] = array ();
		}

		else
		{
			$lastLogId = $_SESSION['ngpu_lastlog'];

			// Check for updates
			$updates = $mapper->getUpdates ($this->objProfile, $lastLogId);

			// Process these updates
			foreach ($updates as $v)
			{
				$_SESSION['ngpu_data'][$v['key']] = $v['value'];
				$lastLogId = max ($v['id'], $lastLogId);
			}

			$_SESSION['ngpu_lastlog'] = $lastLogId;
		}
	}
private function refreshSession ()
	{
		$mapper = Neuron_GameServer_Mappers_UpdateMapper::getInstance ();

		// First check if we have a last id
		if (!isset ($_SESSION['ngpu_lastlog']))
		{
			// New session, can't have updates. No flags set.
			$_SESSION['ngpu_lastlog'] = $mapper->getLastLogId ($this->objProfile);
			$_SESSION['ngpu_data'] = array ();
		}

		else
		{
			$lastLogId = $_SESSION['ngpu_lastlog'];

			// Check for updates
			$updates = $mapper->getUpdates ($this->objProfile, $lastLogId);

			// Process these updates
			foreach ($updates as $v)
			{
				$_SESSION['ngpu_data'][$v['key']] = $v['value'];
				$lastLogId = max ($v['id'], $lastLogId);
			}

			$_SESSION['ngpu_lastlog'] = $lastLogId;
		}
	}
private function refreshSession ( ) { $ mapper = Neuron_GameServer_Mappers_UpdateMapper :: getInstance ( ) ; // First check if we have a last id if ( ! isset ( $ _SESSION [ 'ngpu_lastlog' ] ) ) { // New session, can't have updates. No flags set. $ _SESSION [ 'ngpu_lastlog' ] = $ mapper -> getLastLogId ( $ this -> objProfile ) ; $ _SESSION [ 'ngpu_data' ] = array ( ) ; } else { $ lastLogId = $ _SESSION [ 'ngpu_lastlog' ] ; // Check for updates $ updates = $ mapper -> getUpdates ( $ this -> objProfile , $ lastLogId ) ; // Process these updates foreach ( $ updates as $ v ) { $ _SESSION [ 'ngpu_data' ] [ $ v [ 'key' ] ] = $ v [ 'value' ] ; $ lastLogId = max ( $ v [ 'id' ] , $ lastLogId ) ; } $ _SESSION [ 'ngpu_lastlog' ] = $ lastLogId ; } }
This method refreshes the session and makes sure we have
the latest data from the database.
This method refreshes the session and makes sure we have the latest data from the database .