As many have noticed when we move Neuz window the game freeze, ie game loop isn't running.
This can cause several problems with network, calculation of monsters positions, etc ...
Here is a short homemade tutorial to correct this
File: _DirectX\d3dapp.h
After lines:
Code:
class CD3DApplication
{
Add:
Code:
private:
bool m_movingOrSizingWindow;
It's a simple variable to indicate when user is moving the window.
File: _DirectX\d3dapp.cpp
After lines:
Code:
CD3DApplication::CD3DApplication()
{
Add:
Code:
m_movingOrSizingWindow = false;
To initialize our variable.
Then in function LRESULT CD3DApplication::MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) replace lines:
Code:
case WM_ENTERSIZEMOVE:
// Halt frame movement while the app is sizing or moving
Pause( true );
break;
By:
Code:
case WM_ENTERSIZEMOVE:
// Halt frame movement while the app is sizing or moving
//Pause(true);
SetTimer(hWnd, 1, USER_TIMER_MINIMUM, NULL);
m_movingOrSizingWindow = true;
break;
case WM_TIMER:
if (wParam == 1 && m_bActive)
{
if (FAILED(Render3DEnvironment()))
SendMessage(m_hWnd, WM_CLOSE, 0, 0);
}
break;
And lines:
Code:
case WM_EXITSIZEMOVE:
Pause( false );
HandlePossibleSizeChange();
break;
By:
Code:
case WM_EXITSIZEMOVE:
//Pause(false);
//HandlePossibleSizeChange(); // We can't resize Neuz window
KillTimer(hWnd, 1);
m_movingOrSizingWindow = false;
break;
When user moves the window, the game loop isn't running but the function MsgProc is still called for WM_TIMER messages so we just have to use a timer to update the game.
To finish in function HRESULT CD3DApplication::Render3DEnvironment() replace line:
Code:
if( IsDrawTiming() )
By:
Code:
if (IsDrawTiming() || m_movingOrSizingWindow)
It seems IsDrawTiming doesn't work when the window is moving and I don't know why, so I added this and it works fine.
Edit: If you got an error with USER_TIMER_MINIMUM non identified, replace it by 0x0000000A
After Server Window Freeze ! 01/17/2011 - Shaiya Private Server - 8 Replies Hey guys ive got an problem ! first , sorry for my bad english :/
First show the Movie ! After the Server set window ive got an freeze , only taskmanager can kill the game.exe !
YouTube - Shaiya P-Server Bug !
I downloadet this Client : http://shaiya.aeriagames.com/download without any Update via Update.exe !!! Its the EP3 Server files !
Anyone know an answer for the problem ?