private static void SyncUnitLifeState(Units unit, UnitInfo unitInfo, long reliveLeftTime) { try { PvpLifeState lifeState = (PvpLifeState)unitInfo.lifeState; if (lifeState == PvpLifeState.Dead || lifeState == PvpLifeState.WaitRelive) { PvpProtocolTools.ToDie(unit, null, reliveLeftTime); } else { if (!unit.isLive) { if (unit.isHero) { SpawnUtility spawnUtility = GameManager.Instance.Spawner.GetSpawnUtility(); spawnUtility.RespawnPvpHero(unit); } else { ClientLogger.Error(string.Concat(new object[] { "SetUnitState: cannot relive non-hero unit #", unit.unique_id, " ", unit.name, " to state ", lifeState })); } } if (unit.IsMonsterCreep()) { Monster monster = unit as Monster; if (lifeState == PvpLifeState.Unactive) { monster.Sleep(); } else if (lifeState == PvpLifeState.Live) { if (monster.Sleeping.IsInState) { monster.Wakeup(false); } else { monster.Appear(); } } else { ClientLogger.Warn(string.Concat(new object[] { "don't know how to treat ", unit.name, " with life state ", lifeState })); } } } } catch (Exception e) { ClientLogger.LogException(e); } }