Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl crash #5280

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -486,52 +486,57 @@
return false;
}

if (assetTypeManager instanceof AutoReloadAssetTypeManager) {
try {
((AutoReloadAssetTypeManager) assetTypeManager).reloadChangedAssets();
} catch (IllegalStateException ignore) {
// ignore: This can happen if a module environment switch is happening in a different thread.
return true;
try {
if (assetTypeManager instanceof AutoReloadAssetTypeManager) {
try {
((AutoReloadAssetTypeManager) assetTypeManager).reloadChangedAssets();
} catch (IllegalStateException ignore) {
// ignore: This can happen if a module environment switch is happening in a different thread.
return true;
}
}
}

processPendingState();
processPendingState();

if (currentState == null) {
shutdown();
return false;
}
if (currentState == null) {
shutdown();
return false;
}

Iterator<Float> updateCycles = timeSubsystem.getEngineTime().tick();
CoreRegistry.setContext(currentState.getContext());
rootContext.get(NetworkSystem.class).setContext(currentState.getContext());
Iterator<Float> updateCycles = timeSubsystem.getEngineTime().tick();
CoreRegistry.setContext(currentState.getContext());
rootContext.get(NetworkSystem.class).setContext(currentState.getContext());

for (EngineSubsystem subsystem : allSubsystems) {
try (Activity ignored = PerformanceMonitor.startActivity(subsystem.getName() + " PreUpdate")) {
subsystem.preUpdate(currentState, timeSubsystem.getEngineTime().getRealDelta());
for (EngineSubsystem subsystem : allSubsystems) {
try (Activity ignored = PerformanceMonitor.startActivity(subsystem.getName() + " PreUpdate")) {
subsystem.preUpdate(currentState, timeSubsystem.getEngineTime().getRealDelta());
}
}
}

while (updateCycles.hasNext()) {
float updateDelta = updateCycles.next(); // gameTime gets updated here!
try (Activity ignored = PerformanceMonitor.startActivity("Main Update")) {
currentState.update(updateDelta);
while (updateCycles.hasNext()) {
float updateDelta = updateCycles.next(); // gameTime gets updated here!
try (Activity ignored = PerformanceMonitor.startActivity("Main Update")) {
currentState.update(updateDelta);
}
}
}

// Waiting processes are set by modules via GameThread.a/synch() methods.
GameThread.processWaitingProcesses();
// Waiting processes are set by modules via GameThread.a/synch() methods.
GameThread.processWaitingProcesses();

for (EngineSubsystem subsystem : getSubsystems()) {
try (Activity ignored = PerformanceMonitor.startActivity(subsystem.getName() + " Subsystem postUpdate")) {
subsystem.postUpdate(currentState, timeSubsystem.getEngineTime().getRealDelta());
for (EngineSubsystem subsystem : getSubsystems()) {
try (Activity ignored = PerformanceMonitor.startActivity(subsystem.getName() + " Subsystem postUpdate")) {
subsystem.postUpdate(currentState, timeSubsystem.getEngineTime().getRealDelta());
}
}
assetTypeManager.disposedUnusedAssets();

PerformanceMonitor.rollCycle();
PerformanceMonitor.startActivity("Other");
return true;
} catch (Exception ignore) {
ignore.printStackTrace();

Check warning on line 537 in engine/src/main/java/org/terasology/engine/core/TerasologyEngine.java

View check run for this annotation

Terasology Jenkins.io / PMD

AvoidPrintStackTrace

NORMAL: Avoid printStackTrace(); use a logger call instead.
Raw output
Avoid printStackTrace(); use a logger call instead. <pre> <code> class Foo { void bar() { try { // do something } catch (Exception e) { e.printStackTrace(); } } } </code> </pre> <a href="https://pmd.github.io/pmd-6.55.0/pmd_rules_java_bestpractices.html#avoidprintstacktrace"> See PMD documentation. </a>
return true;
}
assetTypeManager.disposedUnusedAssets();

PerformanceMonitor.rollCycle();
PerformanceMonitor.startActivity("Other");
return true;
}

public void cleanup() {
Expand Down
Loading