Worldserver with console :)

  • Alright thought I release another simple part :)
    It creates a console window and print the errors out in the console.
    If you want you can add some printf("Sumlog %s",someshit); like when someone logs in you be able to see that.


    In worldserver open versionCommon.h
    add

    Code
    #define __QUGET_CONSOLE


    Open worldserver.cpp and look for

    Code
    // float point ¿¡·¯°¡ exceptionÀ» ³»°Ô ÇÑ´Ù.
    void EnableFloatException()
    {
    	int cw = _controlfp( 0, 0 );
    	cw &= ~(EM_OVERFLOW|EM_UNDERFLOW|EM_ZERODIVIDE|EM_DENORMAL);
    	_controlfp( cw, MCW_EM );
    }


    Add this under it


    In the same file look for


    Code
    BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
    {


    And add this under it

    Code
    #ifdef __QUGET_CONSOLE
    	CreateConsole();
    	SetProcessWorkingSetSize(hInstance, -1, -1);
    	printf("Quget Server Console.\n");
    #endif // __QUGET_CONSOLE


    Open xUtil.cpp


    Look for



    And add this under it


    Code
    #ifdef __QUGET_CONSOLE
    		printf(szStr);
    #endif


    Now the console will print all errors :)


    An example too add extra logs(Some extra features!)


    For showing who logged in and out


    Look for



    And add this under it


    Code
    #ifdef __QUGET_CONSOLE
    	printf("Logged out:[%s],Gold:[%d],JobId:[%d],Level:[%d],Autht:[%d] \n",pUser->GetName(),pUser->GetGold(),pUser->GetJob(),pUser->GetLevel(),pUser->m_dwAuthorization);
    #endif //__QUGET_CONSOLE


    Now for the log in Look for



    And add this under it


    Code
    #ifdef __QUGET_CONSOLE
    		printf("Character logged in:[%s] Gold:[%d] JobId:[%d] level:[%d] Auth:[%d] \n",pUser->GetName(),pUser->GetGold(),pUser->GetJob(),pUser->GetLevel(),pUser->m_dwAuthorization);
    #endif //__QUGET_CONSOLE


    Now you are all done having a wolrdserver with a console window printing everything that goes in error%%%.txt and showing who logged in and off :)


    Credits:
    70% Quget aka Misterkid
    30% Google and some hack source code for giving me the idea.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!