Fix System Clean & Other Bugs

Results 1 to 7 of 7
  1. #1
    RailGunZ Soon! megol is offline
    MemberRank
    Jun 2012 Join Date
    261Posts

    Fix System Clean & Other Bugs

    1. How I can make the classification system cleaner to actualize daily, I mean the Delta or Delpa.

    Code:
    #include "StdAfx.h"
    #include "SControl.h"
    #include <iostream>
    #include <fstream>
    using namespace std;
    
    #include <stdio.h>
    
    #define OTL_ODBC_MSSQL_2005
    #define OTL_ENABLE_MSSQL_MARS
    #define OTL_DEFAULT_NUMERIC_NULL_TO_VAL	0
    #include "otlv4.h"
    
    #include <Windows.h>
    #pragma comment(lib, "winmm.lib")
    
    #define DUELTOURNAMENT_RANKING_WEEKLY_UPDATE	// Remove this definition if you want to do daily update.
    
    #define MILLISECOND_SECOND	(1000)						// 1 sec.
    #define MILLISECOND_MINUTE	(MILLISECOND_SECOND * 60)	// 1 min.
    #define MILLISECOND_HOUR	(MILLISECOND_MINUTE * 60)	// 1 hour.
    #define MILLISECOND_DAY		(MILLISECOND_HOUR * 24)		// 1 day.
    #define MILLISECOND_WEEK	(MILLISECOND_DAY * 7)		// 1 week.
    #define TIME_COLOR	RGB(128, 128, 128)
    
    char m_szDB_DNS[64];					///< DB DNS
    char m_szDB_UserName[64];				///< DB Username
    char m_szDB_Password[64];				///< DB Password
    
    otl_connect db;

    me to use or ronny get these error look image why these?



    2. in the source code gunz national sahar when a game ends in the result table is not the name of the characters with their deaths and killed.

    3. Error MatchServer Log here

    Code:
    [05/30/13 14:21:16]  MMatchDBMgr::ExceptionHandler
    ErrSQL( {CALL spDeleteChar (806, 1, 'RiverStonell')} ), ErrCode( -1 )
    ErrMsg - Invalid cursor state
    State:24000,Native:0,Origin:[Microsoft][SQL Server Native Client 10.0]
    
    [14:21:16] Async DB Query(DeleteChar) Failed
    [05/30/13 14:21:35] GARBAGE SESSION CLEANING : m_This(02), ClientCount=36, SessionCount=38, AgentCount=1, CommandPool=228, objHistoryCount=51
    
    [05/30/13 14:24:35] GARBAGE SESSION CLEANING : m_This(02), ClientCount=34, SessionCount=35, AgentCount=1, CommandPool=228, objHistoryCount=46
    
    
    [05/30/13 14:27:04]  MMatchDBMgr::ExceptionHandler
    ErrSQL( {CALL spDeleteChar (705, 0, 'alejandro24')} ), ErrCode( -1 )
    ErrMsg - Invalid cursor state
    State:24000,Native:0,Origin:[Microsoft][SQL Server Native Client 10.0]
    
    [14:27:04] Async DB Query(DeleteChar) Failed
    SPEEDHACK : User='Play_boy', SyncRatio=2.130900 (TimeDiff=42618) 
    [05/30/13 14:27:35] GARBAGE SESSION CLEANING : m_This(02), ClientCount=34, SessionCount=35, AgentCount=1, CommandPool=228, objHistoryCount=43
    4. and also want to know what is the code to revive the character but that with the effect of flame around him.
    they are greatly appreciate.

    Thank.


  2. #2
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: Fix System Clean & Other Bugs

    1. Nick clearly stated , remove these lines
    Spoiler:
    #define DUELTOURNAMENT_RANKING_WEEKLY_UPDATE // Remove this definition if you want to do daily update.

    #define MILLISECOND_SECOND (1000) // 1 sec.
    #define MILLISECOND_MINUTE (MILLISECOND_SECOND * 60) // 1 min.
    #define MILLISECOND_HOUR (MILLISECOND_MINUTE * 60) // 1 hour.
    #define MILLISECOND_DAY (MILLISECOND_HOUR * 24) // 1 day.
    #define MILLISECOND_WEEK (MILLISECOND_DAY * 7) // 1 week.

    if you want to update rankings daily.

    2. This applications terminated only if you dont have proper ODBC, same problem was found on my computer. Just implement the source in matchserver, and loop the code [ make it run in every 12 or 24 hours, so you need not restart the server again n again)

    3. Check out stored procedure, Since i got no idea of sahar's source,i dont know the exact problem. whether its source or db.

    4. Contact superwaffle.

  3. #3
    RailGunZ Soon! megol is offline
    MemberRank
    Jun 2012 Join Date
    261Posts

    Re: Fix System Clean & Other Bugs

    Code:
    ------ Build started: Project: MatchServer, Configuration: BRZ_Release_publish Win32 ------
    
    Compiling...
    MBMatchServer.cpp
    MBMatchServer.cpp(231) : error C2065: 'MILLISECOND_HOUR' : undeclared identifier
    MBMatchServer.cpp(235) : error C3861: 'MILLISECOND_HOUR': identifier not found, even with argument-dependent lookup
    MBMatchServer.cpp(255) : error C3861: 'MILLISECOND_HOUR': identifier not found, even with argument-dependent lookup
    MBMatchServer.cpp(273) : error C3861: 'MILLISECOND_HOUR': identifier not found, even with argument-dependent lookup
    MBMatchServer.cpp(292) : error C3861: 'MILLISECOND_HOUR': identifier not found, even with argument-dependent lookup
    MBMatchServer.cpp(312) : error C3861: 'MILLISECOND_HOUR': identifier not found, even with argument-dependent lookup

  4. #4
    Rival Gamers Owner own_prox is offline
    MemberRank
    Jul 2007 Join Date
    HellLocation
    1,077Posts

    Re: Fix System Clean & Other Bugs

    redeclare
    #define MILLISECOND_SECOND (1000) // 1 sec.
    #define MILLISECOND_MINUTE (MILLISECOND_SECOND * 60) // 1 min.
    #define MILLISECOND_HOUR (MILLISECOND_MINUTE * 60) // 1 hour.
    #define MILLISECOND_DAY (MILLISECOND_HOUR * 24) // 1 day.
    #define MILLISECOND_WEEK (MILLISECOND_DAY * 7) // 1 week.


    and you could use mssql agent to update all ranking on a timed bases pretty simply by copying it all to a temp table ect checkout spRegularUpdateCharRanking procedure
    it wouldnt be to hard to port it to duel ranking

  5. #5
    Developer / Patch Finder Tankado is offline
    MemberRank
    Oct 2011 Join Date
    The NetherlandsLocation
    451Posts

    Re: Fix System Clean & Other Bugs

    for the exe program, it's written for mssql server 2005, if you have higher version it could crash.
    i tested it only on mssql 2005.

  6. #6
    RailGunZ Soon! megol is offline
    MemberRank
    Jun 2012 Join Date
    261Posts

    Re: Fix System Clean & Other Bugs

    Still I have the same problem, however, since the lines are removed from the problem remains the same and are not updated daily.

    duel in the tournament previously could observe players list, but shut the MatchServer to restart the server could no longer see the list players.

    PHP Code:
    #include <iostream>
    #include <fstream>
    using namespace std;
    #include <stdio.h>

    #define OTL_ODBC_MSSQL_2008
    #define OTL_ENABLE_MSSQL_MARS
    #define OTL_DEFAULT_NUMERIC_NULL_TO_VAL    0
    #include "otlv4.h"

    #include <Windows.h>
    #pragma comment(lib, "winmm.lib")

    char m_szDB_DNS[64];                    ///< DB DNS
    char m_szDB_UserName[64];                ///< DB Username
    char m_szDB_Password[64];                ///< DB Password

    otl_connect db;

    Part2

    void SQLErr
    (otl_exception *e)    {
        
    cout << e->msg << '\n' << e->stm_text << '\n' << e->var_info << '\n';
        
    cout << "An error occurred while processing SQL.\n";

        
    ofstream ErrLog("ErrorClean.txt"ios::out ios::app);
        
    ErrLog << e->msg << '\n' << e->stm_text << '\n' << e->var_info << '\n';
        
    ErrLog << "----------------------------------------------------------------------\n";
        
    ErrLog.close();
        
    //return true;
    }


    bool MBMatchServer::RankUpdate()
    {
        
    mlog("================================== Server System Clean ======================================\n");
        
    mlog("CLEAN : Release Date : %s %s\n",__DATE__,__TIME__ );
        
    mlog("CLEAN : Credits : RageZone!!!\n");

        
    #define SERVER_CONFIG_FILENAME            "./server.ini"
        
    GetPrivateProfileString("DB""Gunz""Gunz"m_szDB_DNS64SERVER_CONFIG_FILENAME);
        
    GetPrivateProfileString("DB""sa""sa"m_szDB_UserName64SERVER_CONFIG_FILENAME);
        
    GetPrivateProfileString("DB""123456""123456"m_szDB_Password64SERVER_CONFIG_FILENAME);

        
    // lOGIN DATABASE
        
    char strConnectToDB[256];
        
    sprintf(strConnectToDB"%s/%s@%s"m_szDB_UserNamem_szDB_Passwordm_szDB_DNS);
        try    
        {    
            
    // try to connect to the db via ODBC.
            
    db.rlogon(strConnectToDB);
            
    db.auto_commit_on();
        }
        catch(
    otl_exception &e)    
        {    
            
    // OTL init failed.
            
    SQLErr(&e);
            
    mlog("CLEAN : Failed to connect to the database.\n");
        }
        
    // LOGIN DATABASE END

        // TIME SAVE DWORD
        
    DWORD dwCleanSystemTimetimeGetTime();    
        
    DWORD dwClanDelTime timeGetTime();        
        
    DWORD dwCharacterTime timeGetTime();        
        
    DWORD dwClanTime timeGetTime();            
        
    DWORD dwSurvivalTime timeGetTime();        
        
    DWORD dwDuelTournamentTime timeGetTime();    

        
    // Delete clan start.
        
    if(dwCleanSystemTime <= timeGetTime())
        {
            
    dwCleanSystemTime timeGetTime() + (MILLISECOND_HOUR 1);

            if(
    dwClanDelTime <= timeGetTime())    
            {
                
    dwClanDelTime timeGetTime() + (MILLISECOND_HOUR 1);
                try    
                {
                    
    db.direct_exec("DELETE FROM ClanMember WHERE CLID=(SELECT CLID FROM Clan WHERE DeleteFlag=2);"otl_exception::enabled);    // clean clan member.
                    
    db.direct_exec("UPDATE Clan SET Name=NULL, DeleteFlag=1, DeleteName=Name WHERE DeleteFlag=2;"otl_exception::enabled);    // clean clan.
                
    }
                catch(
    otl_exception &e)    
                {    
                    
    // fail.
                    
    SQLErr(&e);
                    
    mlog("CLEAN : Clan cleaning - FAILED.\n");
                }
                
    // success.
                
    mlog("CLEAN : Clan cleaning - SUCCESS.\n");
            }
            
    // Delete clan end.

            // Character ranking start.
            
    if(dwCharacterTime <= timeGetTime())    
            {
                
    dwCharacterTime timeGetTime() + (MILLISECOND_HOUR 1);
                try    
                {
                    
    db.direct_exec("EXECUTE spFetchTotalRanking;"otl_exception::enabled);    // call character ranking update stored function.
                
    }
                catch(
    otl_exception &e)    
                {    
                    
    // fail.
                    
    mlog("CLEAN : Character ranking updated - FAILED.\n");
                }
                
    // success.
                
    mlog("CLEAN : Character ranking updated - SUCCESS.\n");
            }
            
    // Character ranking end.

            // Clan ranking start.
            
    if(dwClanTime <= timeGetTime())    
            {
                
    dwClanTime dwClanTime + (MILLISECOND_HOUR 1);
                try    
                {
                    
    db.direct_exec("EXECUTE spRegularUpdateClanRanking;"otl_exception::enabled);    // call clan ranking update stored function.
                
    }
                catch(
    otl_exception &e)    
                {    
                    
    // fail.
                    
    SQLErr(&e);
                    
    mlog("CLEAN : Clan ranking updated - FAILED.\n");
                }
                
    // success.
                
    mlog("CLEAN : Clan ranking updated - SUCCESS.\n");
            }
            
    // Clan ranking end.

            // Survival ranking start.
            
    if(dwSurvivalTime <= timeGetTime())    
            {
                
    dwSurvivalTime timeGetTime() + (MILLISECOND_HOUR 1);
                try    
                {
                    
    db.direct_exec("EXECUTE spFetchSurvivalRanking;"otl_exception::enabled);    // call survival ranking update stored function.
                
    }
                catch(
    otl_exception &e)    
                {    
                    
    // fail.
                    
    SQLErr(&e);
                    
    mlog("CLEAN : Survival ranking updated - FAILED.\n");
                }
                
    // success.
                
    mlog("CLEAN : Survival ranking updated - SUCCESS.\n");
            }
            
    // Survival ranking end.


            // Duel tournament ranking start.
            
    if(dwDuelTournamentTime <= timeGetTime())    
            {
                
    dwDuelTournamentTime timeGetTime() + (MILLISECOND_HOUR 1);
                    try    
                    {
                    
    #ifdef DUELTOURNAMENT_RANKING_WEEKLY_UPDATE
                    // weekly update.
                    
    db.direct_exec(
                        
    "IF NOT EXISTS(SELECT * FROM DTTimeStamp WHERE TimeStamp=(CONVERT( CHAR(8), DATEADD(dd, DATEPART(WEEKDAY, CONVERT(DATETIME, GETDATE()))*(-1)+2, CONVERT(DATETIME, GETDATE())), 112))) BEGIN\n"
                        "    EXECUTE spDTInsertDTTimeStamp 1;\n"
                        "END\n"
                        "EXECUTE spDTFetchDTRanking;"

                        
    otl_exception::enabled);
                    
    #else
                    // daily update.
                    
    db.direct_exec(
                        
    "IF NOT EXISTS(SELECT * FROM DTTimeStamp WHERE TimeStamp=(CONVERT( CHAR(8), GETDATE(), 112))) BEGIN\n"
                        "    EXECUTE spDTInsertDTTimeStamp 0;\n"
                        "END\n"
                        "EXECUTE spDTFetchDTRanking;"

                        
    otl_exception::enabled);
                
    #endif
                
    }
                catch(
    otl_exception &e)    
                {    
                    
    // fail.
                    
    SQLErr(&e);
                    
    mlog("CLEAN : Process duel tournament ranking - FAILED.\n");
                }
                
    // success.
                
    mlog("CLEAN : Updated duel tournament ranking and timestamp - SUCCESS.\n");
            }
            
    // Duel tournament ranking end.

            
    db.logoff();
            
    mlog("\n===========================================================================================\n");
        }
      return 
    true;


  7. #7
    RailGunZ Soon! megol is offline
    MemberRank
    Jun 2012 Join Date
    261Posts

    Re: Fix System Clean & Other Bugs

    Why these code error?.



Advertisement