Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Flyff > Flyff Private Server
You last visited: Today at 22:15

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[All in One Question] WooTheFck

Discussion on [All in One Question] WooTheFck within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
WooTheFck's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 239
Received Thanks: 11
[All in One Question] WooTheFck

About the arena score system 1.2


where can i place this code :

Wndworld.h
Code:
#ifdef __ARENA_SCORE
#include "ArenaScoreClient.h"
extern CArenaScore g_ArenaScore;
#endif
Code:
#ifdef __ARENA_SCORE
    g_ArenaScore.WorldDrawer(p2DRender);
#endif
Code:
#ifdef __ARENA_SCORE
        if( nChar == VK_TAB )
            g_ArenaScore.m_bDraw = !g_ArenaScore.m_bDraw;
#endif
dpTrans.cpp
Code:
#ifdef __ARENA_SCORE
    ON_MSG( PACKETTYPE_ARENA_UPDATE, OnSendArenaScore ); 
    ON_MSG( PACKETTYPE_ARENA_GET, OnGetArenaScore );
#endif
Code:
#ifdef __ARENA_SCORE
void CDPTrans::OnGetArenaScore( CAr & ar, DPID dpid, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
{
    LPDB_OVERLAPPED_PLUS lpDbOverlappedPlus        = g_DbManager.AllocRequest();
    g_DbManager.MakeRequest( lpDbOverlappedPlus, lpBuf, uBufSize );
    lpDbOverlappedPlus->dpid    = dpid;
    lpDbOverlappedPlus->nQueryMode    = LOAD_ARENASCORE;
    PostQueuedCompletionStatus( g_DbManager.m_hIOCPPut, 1, NULL, &lpDbOverlappedPlus->Overlapped );
}

void CDPTrans::OnSendArenaScore( CAr & ar, DPID dpid, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
{
    LPDB_OVERLAPPED_PLUS lpDbOverlappedPlus        = g_DbManager.AllocRequest();
    g_DbManager.MakeRequest( lpDbOverlappedPlus, lpBuf, uBufSize );
    lpDbOverlappedPlus->dpid    = dpid;
    lpDbOverlappedPlus->nQueryMode = SAVE_ARENASCORE;
    PostQueuedCompletionStatus( g_DbManager.m_hIOCPPut, 1, NULL, &lpDbOverlappedPlus->Overlapped );
}

void CDPTrans::SendArenaScore( u_long idPlayer, int nAkill, int nAdeath )
{

    BEFORESENDDUAL( ar, PACKETTYPE_ARENA_GET, DPID_UNKNOWN, DPID_UNKNOWN );
    ar << idPlayer << nAkill << nAdeath;

    SEND( ar, this, DPID_ALLPLAYERS );
}
#endif
dpTrans.h
Code:
#ifdef __ARENA_SCORE
void OnGetArenaScore( CAr & ar, DPID dpid, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize );
void OnSendArenaScore( CAr & ar, DPID dpid, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize );
void SendArenaScore( u_long idPlayer, int nAkill, int nAdeath );
#endif
DbManager.cpp

Code:
#ifdef __ARENA_SCORE
            case LOAD_ARENASCORE:
                LoadArenaScore( pQueryChar, lpDbOverlappedPlus );
                break;
            case SAVE_ARENASCORE:
                SaveArenaScore( pQueryChar, lpDbOverlappedPlus );
                break;
#endif
Code:
#ifdef __ARENA_SCORE
void CDbManager::LoadArenaScore( CQuery *qry, LPDB_OVERLAPPED_PLUS lpDbOverlappedPlus )
{
    CAr arRead( lpDbOverlappedPlus->lpBuf, lpDbOverlappedPlus->uBufSize );
    
    u_long nidPlayer;
    int    nArenaKills; 
    int    nArenaDeaths;
    arRead >> nidPlayer;
    char szQuery[QUERY_SIZE] = {0,};
    sprintf( szQuery, "uspLoadArena @serverindex='%02d', @idPlayer='%07d' ",g_appInfo.dwSys, nidPlayer );    //can add arguments directly %s %d..
    //RUN QUERY

    


    //RUN QUERY
    if( FALSE == qry->Exec( szQuery ) )
    {
        WriteLog( "%s, %d\t%s", __FILE__, __LINE__, szQuery );

    }



            while( qry->Fetch() )
            {    
                    nArenaKills    =    qry->GetInt("nArenaKills");
                    nArenaDeaths    =    qry->GetInt("nArenaDeaths");
            }

    
    CDPTrans::GetInstance()->SendArenaScore( nidPlayer, nArenaKills, nArenaDeaths );

    FreeRequest( lpDbOverlappedPlus );
}

void CDbManager::SaveArenaScore( CQuery *qry, LPDB_OVERLAPPED_PLUS lpDbOverlappedPlus )
{
    CAr arRead( lpDbOverlappedPlus->lpBuf, lpDbOverlappedPlus->uBufSize );
    
    u_long idPlayer;
    int    nArenaKills;
    int    nArenaDeaths;
    BOOL bCreate;
    arRead >> idPlayer >> nArenaKills >> nArenaDeaths >> bCreate;

    char szQuery[250] = {0,};
if( !bCreate )
    sprintf( szQuery, "uspSaveArena @serverindex='%02d', @idPlayer='%07d', @nArenaKills='%d', @nArenaDeaths='%d'", g_appInfo.dwSys, idPlayer, nArenaKills, nArenaDeaths );
else
    sprintf( szQuery, "TRUNCATE TABLE dbo.ArenaScore");


        if( FALSE == qry->Exec( szQuery ) )
        {
            WriteLog( "%s, %d\t%s", __FILE__, __LINE__, szQuery );
            FreeRequest( lpDbOverlappedPlus );
            return;
        }
    

    FreeRequest( lpDbOverlappedPlus );
}
#endif

DbManager.h

Code:
#ifdef __ARENA_SCORE
    ,LOAD_ARENASCORE
    ,SAVE_ARENASCORE
#endif
Code:
#ifdef __ARENA_SCORE
void    LoadArenaScore( CQuery *qry, LPDB_OVERLAPPED_PLUS lpDbOverlappedPlus );
void    SaveArenaScore( CQuery *qry, LPDB_OVERLAPPED_PLUS lpDbOverlappedPlus );
#endif





Thanks if you can response
.................................................. ...........
And when im done i'll make a tutorial for Arena Score System 1.2 ,thanks again
WooTheFck is offline  
Reply




All times are GMT +1. The time now is 22:16.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.