MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / AppServerLoop

Function AppServerLoop

engine/Poseidon/Core/Server/ServerLoop.cpp:79–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77{
78
79bool AppServerLoop()
80{
81 bool enableDraw = false;
82
83 static DWORD lastTime;
84 DWORD actTime = ::GlobalTickCount();
85 DWORD deltaTMs = actTime - lastTime;
86
87 float deltaT = deltaTMs * 0.001;
88 lastTime = actTime;
89
90 static DWORD lastSysTime;
91 DWORD sysTime = ::GetTickCount();
92 DWORD timeDelta = sysTime - lastSysTime;
93 lastSysTime = sysTime;
94 saturateMin(deltaT, 0.3);
95
96 bool focused = GApp->m_appActive && !GApp->m_appPaused && !GApp->m_appIconic;
97
98 if (focused)
99 {
100 ProcessKeyboard(sysTime, timeDelta);
101 }
102
103 if (GApp->m_canRender)
104 {
105 if (GWorld)
106 GWorld->UpdateInputContext();
107 InputSubsystem::Instance().Update();
108
109 Poseidon::RenderFrame(deltaT, enableDraw);
110 return false;
111 }
112
113 return true;
114}
115
116} // namespace Poseidon
117extern void DDTerm();

Callers 2

DedicatedServerLoopMethod · 0.85
DedicatedServerLoopFunction · 0.85

Calls 7

GlobalTickCountFunction · 0.85
GetTickCountFunction · 0.85
saturateMinFunction · 0.85
ProcessKeyboardFunction · 0.85
RenderFrameFunction · 0.85
UpdateInputContextMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected