📄 server.cpp.svn-base
字号:
#include "StdAfx.h"
#define WORLD_UPDATE_DELAY 50
WorldRunnable::WorldRunnable() : CThread()
{
}
bool WorldRunnable::run()
{
SetThreadName("WorldRunnable (non-instance/logon)");
uint32 LastWorldUpdate=getMSTime();
uint32 LastSessionsUpdate=getMSTime();
THREAD_TRY_EXECUTION2
while(ThreadState != THREADSTATE_TERMINATE)
{
// Provision for pausing this thread.
if(ThreadState == THREADSTATE_PAUSED)
{
while(ThreadState == THREADSTATE_PAUSED)
{
Sleep(200);
}
}
if(ThreadState == THREADSTATE_TERMINATE)
break;
ThreadState = THREADSTATE_BUSY;
uint32 diff;
//calce time passed
uint32 now,execution_start;
now=getMSTime();
execution_start=now;
if( now < LastWorldUpdate)//overrun
diff=WORLD_UPDATE_DELAY;
else
diff=now-LastWorldUpdate;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -