MCPcopy Create free account
hub / github.com/e2wugui/zeze / onTimer

Method onTimer

ZezeJava/ZezexJava/server/src/Game/App.java:126–136  ·  view source on GitHub ↗
(@NotNull TimerContext context)

Source from the content-addressed store, hash-verified

124
125 public static class ColdTimer implements TimerHandle {
126 @Override
127 public void onTimer(@NotNull TimerContext context) throws Exception {
128 var app = (Game.App)context.timer.zeze.getAppBase();
129 var buf = (BKick)context.customData;
130 //logger.info("XYZ timer={} app={} buf={} counter={}",
131 // context.timerId, app.Zeze.getConfig().getServerId(), buf.getCode(), app.counterColdTimer);
132 if (buf.getCode() != app.counterColdTimer)
133 throw new RuntimeException("XYZ verify cold timer error." + buf.getCode() + " counter=" + app.counterColdTimer);
134 buf.setCode(app.counterColdTimer + 1);
135 Transaction.whileCommit(() -> app.counterColdTimer += 1);
136 }
137 }
138
139 public void Stop() throws Exception {

Callers

nothing calls this directly

Calls 4

whileCommitMethod · 0.95
getAppBaseMethod · 0.80
getCodeMethod · 0.65
setCodeMethod · 0.45

Tested by

no test coverage detected