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!

My v19 source + download

Loyal Member
Joined
Aug 1, 2011
Messages
1,122
Reaction score
153
This is what the Update 3 Colosseum.cpp and Colosseum.h looks like:

Colosseum.cpp:
#include "stdafx.h"
#include "Colosseum.h"

#ifdef __COLOSSEUM

#include "defineText.h"
#include "User.h"
#include "worldmng.h"

extern CWorldMng g_WorldMng;
extern CUserMng g_UserMng;
extern CPartyMng g_PartyMng;


CColosseumMng::CColosseumMng()
{
}

CColosseumMng::~CColosseumMng()
{
}

CColosseumMng* CColosseumMng::GetInstance( void )
{
static CColosseumMng sColosseum;
return &sColosseum;
}

BOOL CColosseumMng::CreateNewMatch( CUser* pUser, BYTE byDifficult, BYTE byMenu )
{
CParty* pParty = g_PartyMng.GetParty( pUser->GetPartyId() );
if( pParty && IsValidObj( pUser ) )
{
if( GetMatchByParty( pParty ) != 0 ) return FALSE;
if( !pUser->GetGuild() && byMenu == 2 ) return FALSE;
if( byDifficult != 1 && byDifficult != 2 ) byDifficult = 1;
if( byMenu != 1 && byMenu != 2 ) byMenu = 1;
if( byDifficult == 1 && pUser->m_nLevel > 90 ) return FALSE;

CColosseumMatch* pMatch = new CColosseumMatch;
pMatch->m_uPartyID = pParty->m_uPartyId;
pMatch->m_byDifficult = byDifficult;
pMatch->m_byMenu = byMenu;
if( byMenu == 2 )
pMatch->m_uGuildID = pUser->m_idGuild;

if( byMenu == 1 )
pMatch->m_byBossStage = xRandom( 1, byMaxLowStage );
else
pMatch->m_byBossStage = xRandom( 1, byMaxHardStage );

pMatch->CreateRoomLayer();

for( int i = 1; i < pParty->m_nSizeofMember; i++ )
{
CUser* pPartyUser = g_UserMng.GetUserByPlayerID( pParty->m_aMember.m_uPlayerId );
if( pPartyUser )
if( pMatch->m_byMenu == 2 )
{
if( pPartyUser->m_idGuild == pMatch->m_uGuildID )
pPartyUser->SendColosseumEnter();
}
else
pPartyUser->SendColosseumEnter();
}

m_mapMatch.insert( make_pair( pParty->m_uPartyId, pMatch ));
return TRUE;
}
return FALSE;
}

BOOL CColosseumMng::LoadScript()
{
if( m_Lua.RunScript( "Colosseum.lua" ) != 0 )
{
Error( "Colosseum.lua Load Failed!!!" );
exit(0);
}

nStartWaitTime = static_cast<int>( m_Lua.GetGlobalNumber( "StartWaitTime" ) );
nWaitAfterStage = static_cast<int>( m_Lua.GetGlobalNumber( "WaitAfterStage" ) );
byMaxLowStage = static_cast<BYTE>( m_Lua.GetGlobalNumber( "LowStages" ) );
byMaxHardStage = static_cast<BYTE>( m_Lua.GetGlobalNumber( "HardStages" ) );

m_Lua.GetGloabal( "tMonster" );
m_Lua.PushNil();


while( m_Lua.TableLoop( -2 ) )
{
__COLOSSEUM_MONSTER srMonster;
srMonster.dwFakeId = static_cast<int>( CScript::GetDefineNum( m_Lua.GetFieldToString( -1, "strFakeMonsterId" ) ) );
srMonster.dwTrueId = static_cast<int>( CScript::GetDefineNum( m_Lua.GetFieldToString( -1, "strTrueMonsterId" ) ) );
srMonster.nTime = static_cast<int>( m_Lua.GetFieldToNumber( -1, "nTime" ) );
srMonster.nStage = static_cast<int>( m_Lua.GetFieldToNumber( -1, "nStage" ) );
srMonster.nDifficult = static_cast<int>( m_Lua.GetFieldToNumber( -1, "nType" ) );
srMonster.nProb = static_cast<int>( m_Lua.GetFieldToNumber( -1, "nProb" ) );
m_vecMonster.push_back( srMonster );
m_Lua.Pop(1);
}


m_Lua.Pop(0);


return TRUE;
}

void CColosseumMng::DestroyMatch( u_long m_uPartyID )
{
COLOSSEUMMATCH::iterator it=m_mapMatch.find( m_uPartyID );
if( it == m_mapMatch.end() )
{
return;
}

safe_delete ( it->second );
m_mapMatch.erase( it );
}

void CColosseumMng::process()
{
for( COLOSSEUMMATCH::iterator it = m_mapMatch.begin(); it != m_mapMatch.end(); it++ )
{
u_long idParty = it->first;
CColosseumMatch* pMatch = it->second;

if( !pMatch ) return;

CMover* pMover = prj.GetMover(pMatch->m_nMoverID);
if( pMover )
{
if( pMatch->m_nNextStage < (int)g_tmCurrent )
pMatch->EndMatch( FALSE );
}
else
{
//Kontrollieren ob letze Stage erreicht wurde
if( pMatch->m_nNextStage < (int)g_tmCurrent )
{
if( pMatch->m_nStage == 0 )
{
for( int i = 0; i < pMatch->m_vecPlayerID.size(); i++ )
{
CUser* pUser = pMatch->GetUser( pMatch->m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) && pMatch->m_bWaitTime )
pUser->SendColosseumStart(0);
}
}
if( pMatch->m_nStage >= byMaxLowStage )
pMatch->EndMatch( TRUE );
else
{
pMatch->m_bWaitTime = FALSE;
pMatch->m_nStage++;
pMatch->CreateMover();
}
}
}
}
}

CColosseumMatch* CColosseumMng::GetMatchByParty( CParty* pParty)
{
for( COLOSSEUMMATCH::iterator it = m_mapMatch.begin(); it != m_mapMatch.end(); it++ )
if( pParty->m_uPartyId == it->first )
{
return it->second;
}


return NULL;
}

CColosseumMatch* CColosseumMng::GetMatchByMoverID( DWORD dwMoverID )
{
for( COLOSSEUMMATCH::iterator it = m_mapMatch.begin(); it != m_mapMatch.end(); it++ )
{
CColosseumMatch* cMatch = it->second;
if( cMatch && cMatch->m_nMoverID == dwMoverID )
return cMatch;
}

return NULL;
}

CColosseumMatch::CColosseumMatch()
{
m_bWaitTime = TRUE;
m_nMoverID = NULL;
m_nStartTime = g_tmCurrent;
m_nStage = 0;
m_nNextStage = (int)g_tmCurrent + CColosseumMng::GetInstance()->nStartWaitTime;
}

CColosseumMatch::~CColosseumMatch()
{
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_COLOSSEUM );
if( pWorld && pWorld->m_linkMap.GetLinkMap( static_cast<int>( m_uPartyID ) ) )
pWorld->Invalidate( m_uPartyID );
}

void CColosseumMatch::process()
{
}
void CColosseumMatch::CreateMover()
{
int nMoverID = 0;
int nTime = 0;

vector<__COLOSSEUM_MONSTER> m_vecMobInfo = CColosseumMng::GetInstance()->m_vecMonster;
for( unsigned int i = 0; i < m_vecMobInfo.size(); i++ )
{
if( m_vecMobInfo.at(i).nDifficult == m_byDifficult && m_vecMobInfo.at(i).nStage == m_nStage )
{
int nRnd = xRandom(1, 100);

if( nRnd > 100 - m_vecMobInfo.at(i).nProb )
nMoverID = m_vecMobInfo.at(i).dwTrueId;
else
nMoverID = m_vecMobInfo.at(i).dwFakeId;

nTime = m_vecMobInfo.at(i).nTime;
m_nNextStage = g_tmCurrent + nTime;
}
}

if( nMoverID != 0 )
{
MoverProp* pMoverProp = prj.GetMoverPropEx( nMoverID );
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_COLOSSEUM );

if( pWorld && pMoverProp && pMoverProp->dwID != 0 )
{
D3DXVECTOR3 vPos( 1291.0F, 100.0F, 1231.0F );
CObj* pObj = CreateObj( D3DDEVICE, OT_MOVER, pMoverProp->dwID );
pObj->SetPos( vPos );
pObj->InitMotion( MTI_STAND );
pObj->UpdateLocalMatrix();
((CMover*)pObj)->m_bActiveAttack = TRUE;
((CMover*)pObj)->AddItToGlobalId();
pWorld->ADDOBJ( pObj, FALSE, m_uPartyID );

m_nMoverID = ((CMover*)pObj)->GetId();
}
if( pWorld->GetID() == WI_WORLD_MADRIGAL )
{
CColosseumMng::GetInstance()->DestroyMatch( m_uPartyID );
}
}

for( unsigned int i = 0; i < m_vecPlayerID.size(); i++ )
{
CUser* pUser = g_UserMng.GetUserByPlayerID( m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) )
pUser->SendColosseumReady2( nTime );
}
}

void CColosseumMatch::CreateRoomLayer()
{
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_COLOSSEUM );
if( pWorld && !pWorld->m_linkMap.GetLinkMap( static_cast<int>( m_uPartyID ) ) )
pWorld->CreateLayer( static_cast<int>( m_uPartyID ) );
}

CUser* CColosseumMatch::GetUser( u_long uPlayerID )
{
return g_UserMng.GetUserByPlayerID( uPlayerID );
}

void CColosseumMatch::EnterRoom( CUser* pUser )
{
if( IsValidObj( pUser ) && m_bWaitTime && !IsTeleported( pUser->m_idPlayer ) )
{
m_vecPlayerID.push_back( pUser->m_idPlayer );
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_COLOSSEUM );
if( pWorld )
if( pWorld->m_linkMap.GetLinkMap( static_cast<int>( m_uPartyID ) ) )
{
pUser->SendColosseumStart( (int)(m_nNextStage) );
pUser->REPLACE( g_uIdofMulti, WI_WORLD_COLOSSEUM, D3DXVECTOR3( 1446.0F, 100.0F, 1219.0F ), REPLACE_NORMAL, static_cast<int>( m_uPartyID ) );
}
}
}

void CColosseumMatch::KickUser( u_long m_uPlayerID )
{
BOOL bWin;
for( int i = 0; i < m_vecPlayerID.size(); i++ )
{
CUser* pUser = GetUser( m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) )
{
pUser->SendColosseumEndMatch( bWin, 0 );
pUser->REPLACE( g_uIdofMulti, WI_WORLD_MADRIGAL, D3DXVECTOR3( 6971.984f, 99.8f, 3336.884f ), REPLACE_NORMAL, nDefaultLayer );
}
}
CColosseumMng::GetInstance()->DestroyMatch( m_uPartyID );
}
void CColosseumMatch::EndWaitTime()
{

if( m_bWaitTime )
{
m_nNextStage = (int)g_tmCurrent + (int)CColosseumMng::GetInstance()->nWaitAfterStage;
m_bWaitTime = FALSE;
}

for( int i = 0; i < m_vecPlayerID.size(); i++ )
{

CUser* pUser = GetUser( m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) )
{
pUser->SendColosseumStart(0);
pUser->SendColosseumReady1( m_nNextStage, m_nStage + 1 );
}
}
}

void CColosseumMatch::DestroyMover()
{
//CMover* g_pPlayer;
CWorld* pWorld;/// = g_pPlayer->GetWorld();
if( pWorld->GetID() == WI_WORLD_COLOSSEUM )
{
m_nMoverID = NULL;
m_bWaitTime = FALSE;

m_nNextStage = (int)g_tmCurrent + CColosseumMng::GetInstance()->nWaitAfterStage;

TCHAR strInt[2];
itoa( m_nStage, strInt, 10 );
for( int i = 0; i < m_vecPlayerID.size(); i++ )
{
CUser* pUser = GetUser( m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) )
{
CString strTemp;
strTemp.Format(_T( prj.GetTextColor(TID_COLOSSEUM_COLOSUCCESS01) ), strInt );//.GetText
pUser->AddText( strTemp );


if( m_nStage < CColosseumMng::GetInstance()->byMaxHardStage )
pUser->SendColosseumReady1( m_nNextStage, m_nStage + 1 );
}

}
}
else
{
}
}

void CColosseumMatch::EndMatch( BOOL bWin )
{
for( int i = 0; i < m_vecPlayerID.size(); i++ )
{
CUser* pUser = GetUser( m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) )
{
pUser->SendColosseumEndMatch( bWin, ( g_tmCurrent - m_nStartTime ) );

pUser->REPLACE( g_uIdofMulti, WI_WORLD_MADRIGAL, D3DXVECTOR3( 6971.984f, 99.8f, 3336.884f ), REPLACE_NORMAL, nDefaultLayer );
}
}
CColosseumMng::GetInstance()->DestroyMatch( m_uPartyID );
}

BOOL CColosseumMatch::IsTeleported( u_long m_uPlayerID )
{
for( int i = 0; i < m_vecPlayerID.size(); i++ )
if( m_vecPlayerID.at(i) == m_uPlayerID )
return TRUE;
return FALSE;
}
#endif //__COLOSSEUM


Colosseum.h
#ifndef TESTCLASS_H
#define TESTCLASS_H

#ifdef __COLOSSEUM

struct __COLOSSEUM_MONSTER
{
int dwTrueId;
int dwFakeId;
int nProb;
int dwId;
int nTime;
int nStage;
int nDifficult;
};

class CColosseumMatch
{
public:
CColosseumMatch();
virtual ~CColosseumMatch();
void Process();
void CreateMover();
void DestroyMover();
void CreateRoomLayer();
void EnterRoom( CUser* pUser );
void EndMatch( BOOL bWin );
CUser* GetUser( u_long uPlayerID );
void EndWaitTime();
void KickUser( u_long m_uPlayerID );
BOOL IsTeleported( u_long m_uPlayerID );

u_long m_uPartyID;
BYTE m_nStage;
int m_nStartTime;
int m_nNextStage;
BOOL m_bWaitTime;
BYTE m_byDifficult;
BYTE m_byMenu;
vector<u_long> m_vecPlayerID;
DWORD m_nMoverID;
u_long m_uGuildID;
BYTE m_byBossStage;
};

typedef map<u_long, CColosseumMatch*> COLOSSEUMMATCH;

class CColosseumMng
{
public:
CColosseumMng();
virtual ~CColosseumMng();

static CColosseumMng* GetInstance( void );
BOOL CreateRoomLayer( int nPartyID );
void DeleteRoomLayer( int nPartyID );
BOOL CreateNewMatch( CUser* pUser, BYTE byDifficult, BYTE byMenu );
void Process();
BOOL LoadScript();
void DestroyMatch( u_long m_uPartyID );
CColosseumMatch* GetMatchByParty( CParty* pParty );
CColosseumMatch* GetMatchByMoverID( DWORD dwMoverID );

CLuaBase m_Lua;
int nStartWaitTime;
int nWaitAfterStage;
BYTE byMaxLowStage;
BYTE byMaxHardStage;
COLOSSEUMMATCH m_mapMatch;

vector<__COLOSSEUM_MONSTER> m_vecMonster;
};

#endif //__COLOSSEUM
#endif //__COLOSSEUM_H__

And this what my Colosseum.cpp and Colosseum.h looks like:

Colosseum.cpp
#include "stdafx.h"
#include "Colosseum.h"

#ifdef __COLOSSEUM

#include "defineText.h"
#include "User.h"
#include "worldmng.h"

extern CWorldMng g_WorldMng;
extern CUserMng g_UserMng;
extern CPartyMng g_PartyMng;


CColosseumMng::CColosseumMng()
{
}

CColosseumMng::~CColosseumMng()
{
}

CColosseumMng* CColosseumMng::GetInstance( void )
{
static CColosseumMng sColosseum;
return &sColosseum;
}

BOOL CColosseumMng::CreateNewMatch( CUser* pUser, BYTE byDifficult, BYTE byMenu )
{
CParty* pParty = g_PartyMng.GetParty( pUser->GetPartyId() );
if( pParty && IsValidObj( pUser ) )
{
if( GetMatchByParty( pParty ) != 0 ) return FALSE;
if( !pUser->GetGuild() && byMenu == 2 ) return FALSE;
if( byDifficult != 1 && byDifficult != 2 ) byDifficult = 1;
if( byMenu != 1 && byMenu != 2 ) byMenu = 1;
if( byDifficult == 1 && pUser->m_nLevel > 200 ) return FALSE;

CColosseumMatch* pMatch = new CColosseumMatch;
pMatch->m_uPartyID = pParty->m_uPartyId;
pMatch->m_byDifficult = byDifficult;
pMatch->m_byMenu = byMenu;
if( byMenu == 2 )
pMatch->m_uGuildID = pUser->m_idGuild;

if( byMenu == 1 )
pMatch->m_byBossStage = (BYTE)xRandom( 1, (BYTE)byMaxLowStage );
else
pMatch->m_byBossStage = (BYTE)xRandom( 1, (BYTE)byMaxHardStage );

pMatch->CreateRoomLayer();

for( int i = 1; i < pParty->m_nSizeofMember; i++ )
{
CUser* pPartyUser = g_UserMng.GetUserByPlayerID( pParty->m_aMember.m_uPlayerId );
if( pPartyUser )
if( pMatch->m_byMenu == 2 )
{
if( pPartyUser->m_idGuild == pMatch->m_uGuildID )
pPartyUser->SendColosseumEnter();
}
else
pPartyUser->SendColosseumEnter();
}

m_mapMatch.insert( make_pair( pParty->m_uPartyId, pMatch ));
return TRUE;
}
return FALSE;
}

BOOL CColosseumMng::LoadScript()
{
if( m_Lua.RunScript( "Colosseum.lua" ) != 0 )
{
Error( "Colosseum.lua Load Failed!!!" );
exit(0);
}

nStartWaitTime = static_cast<int>( m_Lua.GetGlobalNumber( "StartWaitTime" ) );
nWaitAfterStage = static_cast<int>( m_Lua.GetGlobalNumber( "WaitAfterStage" ) );
byMaxLowStage = static_cast<BYTE>( m_Lua.GetGlobalNumber( "LowStages" ) );
byMaxHardStage = static_cast<BYTE>( m_Lua.GetGlobalNumber( "HardStages" ) );

m_Lua.GetGloabal( "tMonster" );
m_Lua.PushNil();

while( m_Lua.TableLoop( -2 ) )
{
__COLOSSEUM_MONSTER srMonster;
srMonster.dwId = static_cast<int>( CScript::GetDefineNum( m_Lua.GetFieldToString( -1, "strMonsterId" ) ) );
srMonster.nTime = static_cast<int>( m_Lua.GetFieldToNumber( -1, "nTime" ) );
srMonster.nStage = static_cast<int>( m_Lua.GetFieldToNumber( -1, "nStage" ) );
srMonster.nDifficult = static_cast<int>( m_Lua.GetFieldToNumber(-1, "nType" ) );
m_vecMonster.push_back( srMonster );
m_Lua.Pop(1);
}

m_Lua.Pop(0);


return TRUE;
}

void CColosseumMng::DestroyMatch( u_long m_uPartyID )
{
COLOSSEUMMATCH::iterator it=m_mapMatch.find( m_uPartyID );
if( it == m_mapMatch.end() )
return;

safe_delete ( it->second );
m_mapMatch.erase( it );
}

void CColosseumMng::process()
{
for( COLOSSEUMMATCH::iterator it = m_mapMatch.begin(); it != m_mapMatch.end(); it++ )
{
u_long idParty = it->first;
CColosseumMatch* pMatch = it->second;

if( !pMatch ) return;

CMover* pMover = prj.GetMover(pMatch->m_nMoverID);
if( pMover )
{
if( pMatch->m_nNextStage < (int)g_tmCurrent )
pMatch->EndMatch( FALSE );
}
else
{
//Kontrollieren ob letze Stage erreicht wurde
if( pMatch->m_nNextStage < (int)g_tmCurrent )
{
if( pMatch->m_nStage == 0 )
{
for( unsigned int i = 0; i < pMatch->m_vecPlayerID.size(); i++ )
{
CUser* pUser = pMatch->GetUser( pMatch->m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) && pMatch->m_bWaitTime )
pUser->SendColosseumStart(0);
}
}
if( pMatch->m_nStage >= byMaxLowStage )
pMatch->EndMatch( TRUE );
else
{
pMatch->m_bWaitTime = FALSE;
pMatch->m_nStage++;
pMatch->CreateMover();
}
}
}
}
}

CColosseumMatch* CColosseumMng::GetMatchByParty( CParty* pParty)
{
for( COLOSSEUMMATCH::iterator it = m_mapMatch.begin(); it != m_mapMatch.end(); it++ )
if( pParty->m_uPartyId == it->first )
return it->second;

return NULL;
}

CColosseumMatch* CColosseumMng::GetMatchByMoverID( DWORD dwMoverID )
{
for( COLOSSEUMMATCH::iterator it = m_mapMatch.begin(); it != m_mapMatch.end(); it++ )
{
CColosseumMatch* cMatch = it->second;
if( cMatch->m_nMoverID == dwMoverID )
return cMatch;
}

return NULL;
}

CColosseumMatch::CColosseumMatch()
{
m_bWaitTime = TRUE;
m_nMoverID = NULL;
m_nStartTime = g_tmCurrent;
m_nStage = 0;
m_nNextStage = (int)g_tmCurrent + CColosseumMng::GetInstance()->nStartWaitTime;
}

CColosseumMatch::~CColosseumMatch()
{
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_COLOSSEUM );
if( pWorld && pWorld->m_linkMap.GetLinkMap( static_cast<int>( m_uPartyID ) ) )
pWorld->Invalidate( m_uPartyID );
}

void CColosseumMatch::process()
{

}

void CColosseumMatch::CreateMover()
{
int nMoverID = 0;

vector<__COLOSSEUM_MONSTER> m_vecMobInfo = CColosseumMng::GetInstance()->m_vecMonster;
for( unsigned int i = 0; i < m_vecMobInfo.size(); i++ )
{
if( m_nStage == m_byBossStage && m_vecMobInfo.at(i).nDifficult == m_byDifficult )
{
nMoverID = m_vecMobInfo.at(i).dwId;
m_nNextStage = g_tmCurrent + m_vecMobInfo.at(i).nTime;
}
else
if( m_vecMobInfo.at(i).nDifficult == m_byDifficult && m_vecMobInfo.at(i).nStage == m_nStage )
{
nMoverID = m_vecMobInfo.at(i).dwId;
m_nNextStage = g_tmCurrent + m_vecMobInfo.at(i).nTime;
}
}

MoverProp* pMoverProp = prj.GetMoverPropEx( nMoverID );
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_COLOSSEUM );
if( pWorld && pMoverProp && pMoverProp->dwID != 0 )
{
D3DXVECTOR3 vPos( 1296.0F, 100.0F, 1228.0F );
CObj* pObj = CreateObj( D3DDEVICE, OT_MOVER, pMoverProp->dwID );
pObj->SetPos( vPos );
pObj->InitMotion( MTI_STAND );
pObj->UpdateLocalMatrix();
((CMover*)pObj)->m_bActiveAttack = TRUE;
((CMover*)pObj)->AddItToGlobalId();
pWorld->ADDOBJ( pObj, FALSE, m_uPartyID );

m_nMoverID = ((CMover*)pObj)->GetId();
}

for( unsigned int i = 0; i < m_vecPlayerID.size(); i++ )
{
CUser* pUser = g_UserMng.GetUserByPlayerID( m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) )
pUser->SendColosseumReady2( m_nNextStage );
}
}

void CColosseumMatch::CreateRoomLayer()
{
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_COLOSSEUM );
if( pWorld && !pWorld->m_linkMap.GetLinkMap( static_cast<int>( m_uPartyID ) ) )
pWorld->CreateLayer( static_cast<int>( m_uPartyID ) );
}

CUser* CColosseumMatch::GetUser( u_long uPlayerID )
{
return g_UserMng.GetUserByPlayerID( uPlayerID );
}

void CColosseumMatch::EnterRoom( CUser* pUser )
{
if( IsValidObj( pUser ) && m_bWaitTime && !IsTeleported( pUser->m_idPlayer ) )
{
m_vecPlayerID.push_back( pUser->m_idPlayer );
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_COLOSSEUM );
if( pWorld )
if( pWorld->m_linkMap.GetLinkMap( static_cast<int>( m_uPartyID ) ) )
{
pUser->SendColosseumStart( (int)(m_nNextStage) );
pUser->REPLACE( g_uIdofMulti, WI_WORLD_COLOSSEUM, D3DXVECTOR3( 1286.0F, 100.0F, 1087.0F ), REPLACE_NORMAL, static_cast<int>( m_uPartyID ) );
}
}
}

void CColosseumMatch::KickUser( u_long m_uPlayerID )
{
for( unsigned int i = 0; i < m_vecPlayerID.size(); i++ )
if( m_uPlayerID == m_vecPlayerID.at(i) )
{
CUser* pUser = g_UserMng.GetUserByPlayerID( m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) )
pUser->REPLACE( g_uIdofMulti, WI_WORLD_MADRIGAL, D3DXVECTOR3( 6971.984f, 99.8f, 3336.884f ), REPLACE_NORMAL, nDefaultLayer );
m_vecPlayerID.erase(m_vecPlayerID.begin()+i);
}
}

void CColosseumMatch::EndWaitTime()
{

if( m_bWaitTime )
{
m_nNextStage = (int)g_tmCurrent + (int)CColosseumMng::GetInstance()->nWaitAfterStage;
m_bWaitTime = FALSE;
}

for( unsigned int i = 0; i < m_vecPlayerID.size(); i++ )
{

CUser* pUser = GetUser( m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) )
{
pUser->SendColosseumStart(0);
pUser->SendColosseumReady1( m_nNextStage, m_nStage + 1 );
}
}
}

void CColosseumMatch::DestroyMover()
{
m_nMoverID = NULL;
m_bWaitTime = FALSE;

m_nNextStage = (int)g_tmCurrent + CColosseumMng::GetInstance()->nWaitAfterStage;

TCHAR strInt[2];
itoa( m_nStage, strInt, 10 );
for( unsigned int i = 0; i < m_vecPlayerID.size(); i++ )
{
CUser* pUser = GetUser( m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) )
{
CString strTemp;
strTemp.Format(_T( prj.GetText(TID_COLOSSEUM_COLOSUCCESS01) ), strInt );
pUser->AddText( strTemp );

if( m_nStage < CColosseumMng::GetInstance()->byMaxHardStage )
pUser->SendColosseumReady1( m_nNextStage, m_nStage + 1 );
}

}
}

void CColosseumMatch::EndMatch( BOOL bWin )
{
for( unsigned int i = 0; i < m_vecPlayerID.size(); i++ )
{
CUser* pUser = GetUser( m_vecPlayerID.at(i) );
if( IsValidObj( pUser ) )
{
pUser->SendColosseumEndMatch( bWin, ( g_tmCurrent - m_nStartTime ) );

pUser->REPLACE( g_uIdofMulti, WI_WORLD_MADRIGAL, D3DXVECTOR3( 6971.984f, 99.8f, 3336.884f ), REPLACE_NORMAL, nDefaultLayer );
}
}
CColosseumMng::GetInstance()->DestroyMatch( m_uPartyID );
}

BOOL CColosseumMatch::IsTeleported( u_long m_uPlayerID )
{
for( unsigned int i = 0; i < m_vecPlayerID.size(); i++ )
if( m_vecPlayerID.at(i) == m_uPlayerID )
return TRUE;
return FALSE;
}
#endif //__COLOSSEUM


Colosseum.h
#ifndef TESTCLASS_H
#define TESTCLASS_H

#ifdef __COLOSSEUM

struct __COLOSSEUM_MONSTER
{
int dwId;
int nTime;
int nStage;
int nDifficult;
};

class CColosseumMatch
{
public:
CColosseumMatch();
virtual ~CColosseumMatch();
void Process();
void CreateMover();
void DestroyMover();
void CreateRoomLayer();
void EnterRoom( CUser* pUser );
void EndMatch( BOOL bWin );
CUser* GetUser( u_long uPlayerID );
void EndWaitTime();
void KickUser( u_long m_uPlayerID );
BOOL IsTeleported( u_long m_uPlayerID );

u_long m_uPartyID;
BYTE m_nStage;
int m_nStartTime;
int m_nNextStage;
BOOL m_bWaitTime;
BYTE m_byDifficult;
BYTE m_byMenu;
vector<u_long> m_vecPlayerID;
DWORD m_nMoverID;
u_long m_uGuildID;
BYTE m_byBossStage;
};

typedef map<u_long, CColosseumMatch*> COLOSSEUMMATCH;

class CColosseumMng
{
public:
CColosseumMng();
virtual ~CColosseumMng();

static CColosseumMng* GetInstance( void );
BOOL CreateRoomLayer( int nPartyID );
void DeleteRoomLayer( int nPartyID );
BOOL CreateNewMatch( CUser* pUser, BYTE byDifficult, BYTE byMenu );
void Process();
BOOL LoadScript();
void DestroyMatch( u_long m_uPartyID );
CColosseumMatch* GetMatchByParty( CParty* pParty );
CColosseumMatch* GetMatchByMoverID( DWORD dwMoverID );

CLuaBase m_Lua;
int nStartWaitTime;
int nWaitAfterStage;
BYTE byMaxLowStage;
BYTE byMaxHardStage;
COLOSSEUMMATCH m_mapMatch;

vector<__COLOSSEUM_MONSTER> m_vecMonster;
};

#endif //__COLOSSEUM
#endif //__COLOSSEUM_H__

There you go. You can compare those files with mine. :thumbup1:


I'll do that when I have time, thanks dude!!
 
Newbie Spellweaver
Joined
Nov 29, 2012
Messages
49
Reaction score
0
Any fix for incompatibility with windows 8 ?
What do you mean? Mine i'm using windows 8.1 and this files working fine and yea Visual Studio too, But vs is too dificult to install you need to bypass regsvr32 by installing some required components.​
 
Initiate Mage
Joined
Jan 19, 2008
Messages
2
Reaction score
0
Well I thought it was incompatible with win8 because it works just fine on my win7 and winXP but there is 3 computers which i can't seem to connect(Win8 and 2x Win7). It used to work on those computers and even if i copy the client im using on win7 thats working to one of those 3 machines it still won't load into the world. It crashes after i choose the character to log in and i get this in client's error log.
Code:
2013/10/ 9   15:48:31   g_pPlayer is ready

2013/10/ 9   15:48:32   Apr  8 2013 18:41:29 1 rCnt=1
Neuz.exe caused an EXCEPTION_ACCESS_VIOLATION in module Neuz.exe at 0023:004C28AF
 - Registers
EAX=00000000  EBX=7FFDE000  ECX=00000000  EDX=00ADB60C  ESI=00000000EDI=75EF4B8B  EBP=0018FD00  ESP=0018F7A4  EIP=004C28AF  FLG=00010293CS=0023   DS=002B  SS=002B  ES=002B   FS=0053  GS=002B

0023:004C28AF Neuz.exe
0023:0060B022Neuz.exe
0023:0051194C Neuz.exe
0023:004C3DE3 Neuz.exe
0023:0046E9EB Neuz.exe
0023:0048D9C0 Neuz.exe
0023:0048D801 Neuz.exe
0023:004756AC Neuz.exe
0023:00943B9C Neuz.exe
0023:75EF850D KERNEL32.DLL, BaseThreadInitThunk()+0014 byte(s)
0023:77C8BF39 ntdll.dll, RtlInitializeExceptionChain()+0133 byte(s)
0023:77C8BF0C ntdll.dll, RtlInitializeExceptionChain()+0088 byte(s)

as for the server I'm not getting anything so I'm 99% positive it's something to do with the computers but what? Since I'm using the exact same client thats working on my win7 and win XP as stated above, it should work. A little help would be appreciated.
 
Newbie Spellweaver
Joined
Nov 29, 2012
Messages
49
Reaction score
0
Well I thought it was incompatible with win8 because it works just fine on my win7 and winXP but there is 3 computers which i can't seem to connect(Win8 and 2x Win7). It used to work on those computers and even if i copy the client im using on win7 thats working to one of those 3 machines it still won't load into the world. It crashes after i choose the character to log in and i get this in client's error log.
Code:
2013/10/ 9   15:48:31   g_pPlayer is ready

2013/10/ 9   15:48:32   Apr  8 2013 18:41:29 1 rCnt=1
Neuz.exe caused an EXCEPTION_ACCESS_VIOLATION in module Neuz.exe at 0023:004C28AF
 - Registers
EAX=00000000  EBX=7FFDE000  ECX=00000000  EDX=00ADB60C  ESI=00000000EDI=75EF4B8B  EBP=0018FD00  ESP=0018F7A4  EIP=004C28AF  FLG=00010293CS=0023   DS=002B  SS=002B  ES=002B   FS=0053  GS=002B

0023:004C28AF Neuz.exe
0023:0060B022Neuz.exe
0023:0051194C Neuz.exe
0023:004C3DE3 Neuz.exe
0023:0046E9EB Neuz.exe
0023:0048D9C0 Neuz.exe
0023:0048D801 Neuz.exe
0023:004756AC Neuz.exe
0023:00943B9C Neuz.exe
0023:75EF850D KERNEL32.DLL, BaseThreadInitThunk()+0014 byte(s)
0023:77C8BF39 ntdll.dll, RtlInitializeExceptionChain()+0133 byte(s)
0023:77C8BF0C ntdll.dll, RtlInitializeExceptionChain()+0088 byte(s)

as for the server I'm not getting anything so I'm 99% positive it's something to do with the computers but what? Since I'm using the exact same client thats working on my win7 and win XP as stated above, it should work. A little help would be appreciated.



Well i don't know about your problem, This files is working fine, Maybe there is some bugs but these bugs don't look like as yours. Sorry for my bad english :3 or you can compile again the neuz, i think the problem is in your neuz :p
adeilson12 - My v19 source + download - RaGEZONE Forums
 
Newbie Spellweaver
Joined
Feb 20, 2011
Messages
33
Reaction score
8
databaseserver.exe crash only error i see is

2013/10/13 16:49:48 Last read:Default, ID:10 is duplicated. Ä÷³ÀÌ ¹Ð·Áµµ ÀÌ·±¿¡·¯°¡ ³­´Ù. FILE:propMover.txt

i have looked every where can not fine it more the one time

i get the same error in the client exe but it does not crash
 
Loyal Member
Joined
Aug 1, 2011
Messages
1,122
Reaction score
153
databaseserver.exe crash only error i see is

2013/10/13 16:49:48 Last read:Default, ID:10 is duplicated. Ä÷³ÀÌ ¹Ð·Áµµ ÀÌ·±¿¡·¯°¡ ³­´Ù. FILE:propMover.txt

i have looked every where can not fine it more the one time

i get the same error in the client exe but it does not crash

Open your propmover.txt and look for the ID 10 remove one of them.

I got a problem..

When i'm connecting to the server it says "connecting please wait" and after that I can hear the sound when you are connected "the flaris music" , So im ingame but the select character screen are there instead of ingame screen. Any solutions?

A picture:


EDIT:
I found this on one of the errorlogs
2013/10/15 07:29:59
CDPCoreClient.OnJoin: server not found id: 2 account: audis player: hoehoe world: 1
 
Last edited:
Newbie Spellweaver
Joined
Apr 29, 2011
Messages
97
Reaction score
10
Open your propmover.txt and look for the ID 10 remove one of them.

I got a problem..

When i'm connecting to the server it says "connecting please wait" and after that I can hear the sound when you are connected "the flaris music" , So im ingame but the select character screen are there instead of ingame screen. Any solutions?

A picture:


EDIT:
I found this on one of the errorlogs
2013/10/15 07:29:59
CDPCoreClient.OnJoin: server not found id: 2 account: audis player: hoehoe world: 1

Maybe your world is not working. It already happen on me last time.
Did you use the Update 3 Resource?
 
Newbie Spellweaver
Joined
Oct 18, 2010
Messages
18
Reaction score
0
Grettings, a simple question, what client should I get here?
Thanks in advanced for the help and sorry for the botter.
 
Loyal Member
Joined
Aug 1, 2011
Messages
1,122
Reaction score
153
Update 3. then use the world and model folders of E-flyff Client.
It should work. because that is what i did.

This is what I did:

On the update 3 there is,
- Datas (I did put this stuff in the client)
- Program (Normal)
- Resource ( I did put this on the resource and replaced )
- Source (Normal)

Then I downloaded a eflyff client and replaced the world & model folders with the ones from resource. And then I got this problem.
Can you tell me how you exactly did to fix this problem? Step by step .. ^^
 
Newbie Spellweaver
Joined
Apr 29, 2011
Messages
97
Reaction score
10
This is what I did:

On the update 3 there is,
- Datas (I did put this stuff in the client)
- Program (Normal)
- Resource ( I did put this on the resource and replaced )
- Source (Normal)

Then I downloaded a eflyff client and replaced the world & model folders with the ones from resource. And then I got this problem.
Can you tell me how you exactly did to fix this problem? Step by step .. ^^

What i did is,
Have a Fully Patched Eflyff Client
Then i copy the World and Model Folder of the Client and Put them on the Resource of Update 3.
Then made it work like that?


There's also another Problem with Update 3.
When you wan't to View the Inventory of other Characters, the Neuz will Automatically Close.
 
Newbie Spellweaver
Joined
Oct 21, 2010
Messages
14
Reaction score
1
DatabaseServer.exe cache after I accepted the quest and i exit game. I want to fix. Thank.

C:\Run-Serverv19\Program\2.DatabaseServer.exe caused ACCESS_VIOLATION (0xc0000005)
in module C:\Run-Serverv19\Program\2.DatabaseServer.exe at 0023:004276d5.
Error occurred at 2013/10/18 23:51:28.
C:\Run-Serverv19\Program\2.DatabaseServer.exe, run by Administrator.
Operation system : Unknown Windows version (6.1.7601).
4 processor(s), type 586.
50% memory in use.
0 MBytes physical memory.
4029 MBytes physical memory free.
0 MBytes paging file.
0 MBytes paging file free.
2048 MBytes user address space.
1494 MBytes user address space free.
Read from location 1cb343b4 caused an access violation.
 
Newbie Spellweaver
Joined
Jul 20, 2012
Messages
21
Reaction score
2




Well i don't know about your problem, This files is working fine, Maybe there is some bugs but these bugs don't look like as yours. Sorry for my bad english :3 or you can compile again the neuz, i think the problem is in your neuz :p
adeilson12 - My v19 source + download - RaGEZONE Forums

but you are using windows 8.1 or 8.1 beta
 
Newbie Spellweaver
Joined
Oct 29, 2013
Messages
45
Reaction score
1
there so many source lol how to deal with it? update 1, update 2,update 3 and sourceMEU
 
Back
Top