public void Tick(float deltaTime) { try { //if (zone.Id == "H1") { // log.InfoFormat("world = {0} tick", zone.Id); //} playerCountOnStartFrame = playerCount; ItemCache.Tick(deltaTime); asteroidManager.Update(deltaTime); npcManager.Update(deltaTime); nebulaObjectManager.Update(deltaTime); if (mSaveWorldTimer.Update(deltaTime)) { try { application.DatabaseManager.SetWorld(this); } catch (Exception exc) { log.InfoFormat("catched exception when saving worlds"); log.InfoFormat(exc.Message); log.InfoFormat(exc.StackTrace); } } //restore saved objects if (!mStateRestored) { if (mWorldState != null) { mStateRestored = true; mWorldState.RestoreObjectsFromSave(this); } } if (underAttack) { if (mUnderAttackTimer > 0f) { mUnderAttackTimer -= deltaTime; if (mUnderAttackTimer <= 0f) { SetUnderAttack(false); } } mUnderAttackDuration += deltaTime; if (mUnderAttackDuration >= MAX_UNDER_ATTACK_INTERVAL) { if (!invulnerable) { invulnerable = true; mInvulnerableTimer = INVULENRABLE_INTERVAL; BroadcastMessage("OnInvulnerableChanged"); return; } mUnderAttackDuration = 0f; } } if (invulnerable) { mInvulnerableTimer -= deltaTime; if (mInvulnerableTimer <= 0f) { invulnerable = false; BroadcastMessage("OnInvulnerableChanged"); } } //update event manager m_EventManager.Update(deltaTime); } catch (Exception exception) { log.ErrorFormat("exception in world: {0}", zone.Id); log.ErrorFormat(exception.Message); log.ErrorFormat(exception.StackTrace); } }