Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Small Tool - Debug Window

Initiate Mage
Joined
Mar 1, 2012
Messages
42
Reaction score
3
Hi there
This a really small tool to display debug text from client and server
Hope this could help your debuging progress

Visual 2013 Solution, just build it yourself
View attachment DebugWindow.rar

Just a small script that handle message sent from masang
g_dbgOutwindowClassName and g_dbgOut was defined on selection build
 

Attachments

You must be registered for see attachments list
Last edited:
Joined
Apr 12, 2013
Messages
896
Reaction score
479
Do you even internet?

Well, this would work with normal DbgOut messages, as written in the article.
But as you may know masang uses their "own" debug output method:

Code:
inline void DbgOutA (LPCSTR p){
    COPYDATASTRUCT cd; 
    HWND hWnd = ::FindWindow (g_dbgOutwindowClassName, g_dbgOut); 
    if (hWnd)
    {  
        cd.dwData = 0;
        cd.cbData = (strlen(p)+1)*sizeof(char);
        cd.lpData = (void *)p; 
        ::SendMessage (hWnd, WM_COPYDATA, 0, (LPARAM)&cd);  
    } 
}

It's sending messages to a window with the name: Client DebugOutput 20020805 and registered Windowclass: Client DebugOut Window

My problem now is: i can't download ther attachement, so i can't see if this release is useless or not :D
 
Initiate Mage
Joined
Mar 1, 2012
Messages
42
Reaction score
3
Sorry, because I don't know how to use the program from microsoft

Just a small script that handle message send from masang
Masang send message to a window with specific Class name and Title name.

I'll learn how to config the debugview from Microsoft, but I'm not sure it has a option to change the window and title name
 
Experienced Elementalist
Joined
May 10, 2015
Messages
278
Reaction score
146
It's funny how actually somebody still have to put some efforts for make such things working...
 
Initiate Mage
Joined
Mar 1, 2012
Messages
42
Reaction score
3
Haha, dont rage bro.
if it's not help your case, just GTFO.
Ton of people out there even don't know how to compile the source code. It's just a little tool can help them.
I just review some of your posts and I can not find any helpful reply, just rage and scold.
Try to gentle and helpful bro.
 
Experienced Elementalist
Joined
May 10, 2015
Messages
278
Reaction score
146
Haha, dont rage bro.

Nobody is raging, i'm always chilled.

Ton of people out there even don't know how to compile the source code.

This is the main reason for them to stop dealing with it.

I just review some of your posts and I can not find any helpful reply, just rage and scold.

Gonna cry in a corner then (still, i'm not raging).

Try to gentle and helpful bro.

I help a lot of people usually, just you don't see it because all the leechers and server bitches here aren't my help target.

Have a good day.
 
Experienced Elementalist
Joined
Oct 9, 2012
Messages
226
Reaction score
76
OK, but why dafaqshould we use this simple tool instead of AllocConsole() ??!!

Anyway you did smth yourself so its ok that you're able to use your brain.
Cheers
 
Retired (Goddamn idiots)
Joined
Dec 3, 2003
Messages
391
Reaction score
483
OK, but why dafaqshould we use this simple tool instead of AllocConsole() ??!!

That is an absolutely stupid question.
Logging purposes, to say the least, let alone timestamping and not having to deal with some cheap hack-y method.

A better idea would be to use OutputDebugString(), but that is beyond the scope of this thread.
 
Experienced Elementalist
Joined
May 10, 2015
Messages
278
Reaction score
146
OK, but why dafaqshould we use this simple tool instead of AllocConsole() ??!!

Anyway you did smth yourself so its ok that you're able to use your brain.
Cheers

You can trash the console if your client crashes at boot.

That is an absolutely stupid question.
Logging purposes, to say the least, let alone timestamping and not having to deal with some cheap hack-y method.

A better idea would be to use OutputDebugString(), but that is beyond the scope of this thread.

I think that are more my hand's fingers than the guys which knows what this function does.
 
Last edited:
[emoji848]
Legend
Joined
Dec 3, 2011
Messages
2,232
Reaction score
1,518
About one and a half year ago (before I kindly got the tip from Dragon to use Sysinternals) I wrote a similar tool in MFC... Sadly I can't find the full code for this right now but I found the C++ part of it that took care of handling the strings output by the DbgOut underlying function:

Code:
// Window Proc override
LRESULT CClientDebugOutDlg::WindowProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg)
	{
		case WM_COPYDATA:
		{
			// Dispatch client Message
			COPYDATASTRUCT* pcds = (COPYDATASTRUCT*)lParam;
			if (pcds->dwData == 0)
			{
				// convert 8-byte char to 16-byte wchar_t
				LPCSTR msg = (LPCSTR)pcds->lpData;
				LPCWSTR w_msg = CA2W(msg);
				handleClientDbgMessage(w_msg);
			}
			else if (pcds->dwData == 0xFEFF)
			{
				// 16-byte char
				LPCWSTR msg = (LPCWSTR)pcds->lpData;
				handleClientDbgMessage(msg);
			}
		}
		break;
	}

	// Default Return
	return CDialogEx::WindowProc(msg, wParam, lParam);
}

void CClientDebugOutDlg::handleClientDbgMessage(std::wstring message /*alternatively: const wchar_t* message*/)
{
	// Handle the message here
}

Be aware that this code was used within a Unicode MFC environment. You can copy paste this into any MFC Unicode project by overriding this WndProc handler in your Dialog class.

You can easily make a standalone version of that using WINAPI function and implement the case switch into your custom WndProc. If you're using MBSC instead of Unicode you'd need for the other case.

If you prefer C# you could also do this via .

Might help someone to make tools...

Edit:
And ofc the window handle must be created with the wnd class "Client DebugOut Window" and the wnd caption "Client DebugOutput 20020805"
 
Experienced Elementalist
Joined
May 10, 2015
Messages
278
Reaction score
146
Or i can release official masang ones, but all the leechers here are too far away from deserve that.
 
[emoji848]
Legend
Joined
Dec 3, 2011
Messages
2,232
Reaction score
1,518
Or i can release official masang ones, but all the leechers here are too far away from deserve that.

By the level of "tools" released by masang I am kinda confident that everyone here would deserve them... You can't get much lower than masang level.
 
Experienced Elementalist
Joined
May 10, 2015
Messages
278
Reaction score
146
By the level of "tools" released by masang I am kinda confident that everyone here would deserve them... You can't get much lower than masang level.

Then i guess this week i will release them ;)
 
Back
Top