Jump to content
Sign in to follow this  
Guest

Server & Game Source

Recommended Posts

Guest

--Quoting original post by V3ct0r.

On the 16th of May, Monday, user with a nickname: "JIANJIAN", was selling source codes for 1.36 server and 1.10 client. Comparing to other suchlike threads, JIANJIAN added some proofs to the post. After the thread was deleted by the administration (@Zankza), with the following explanation: "that user might be a scammer". Later on that user started spamming threads where other people had been selling their stuff. 

5502c974d632.jpg

All those posts had been deleted and user "JIANJIAN" was completely deleted from serverdev. 

Who he is, where he got them from - nobody knows. I tried to contact him via PM at serverdev but his PM channel was closed, which is weird. He might be a former Moli's developer or he might have found the sources somewhere on Chinese forums. However, he left his email (QQ - the most prevalent Instant messages sending service).

[email protected]

He has also released TradeServer source and some more auxiliary tools for VS 2003. Download.

And finally a video, where he shows how he compiles a client in Visual Studio 2013. For someone the video works (slowly, though), for somebody not:

http://www.56.com/u35/v_MTQwOTYwNjI0.html

So, what do you guys think? It's not the first time we see sources for sale. I once saw somebody selling dumped client code as .c type files calling them the source...

Share this post


Link to post
Share on other sites
3 часа назад, GustavoHMA сказал:

You contacted via email?

No, I didn't


Share this post


Link to post
Share on other sites
Guest
20 hours ago, xtc said:

Since he is not wanted in serverdev, I propose that we invite him here and see what he has to offer. 

He doesn't seem to check his email quite often, so it's gonna be a bit difficult to reach him.

Share this post


Link to post
Share on other sites

I asked him before and he said 450$ price for the source. Anyone want to buy it? 

 

note: im not able to contact him anymore. 

Edited by Treuno86

Hit Like If You Like It!

Tekken-7.jpg

Share this post


Link to post
Share on other sites

@c0d3x also said me that JianJian wants 500$. It is great money for us. 


Share this post


Link to post
Share on other sites

The only reason I think this could be real is because zankza keeps removing all talk of it on serverdev. Bear in mind its likely to be back doored, so anyone who buys it will have fun checking each file.

  • Like 1

Share this post


Link to post
Share on other sites
В 30.05.2016в23:37, Treuno86 сказал:

Is there any other way to contact this person? Im gonna try to buy it

Maybe someone wants to buy too. You can make joint purchase, it will took less money

  • Like 1

Share this post


Link to post
Share on other sites

This is the message i got from the source chinese seller
Price: 500$
 

this is kop's source  video。

url:http://www.5 6.com/u27/v_ MTQxMDg5OTc2 .html

or other url:http://v.you ku.com/v_sho w/id_XMTU5MD g5MjgwMA==.h tml

 

I know english a little,i'm sorry。

 

// CharTrade.cpp Created by knight-gongjian 2004.12.7.

//---------------------------------------------------------

 

#include "CharTrade.h"

#include "GameApp.h"

#include "GameAppNet.h"

#include "SubMap.h"

#include "Player.h"

#include "GameDB.h"

#include "lua_gamectrl.h"

//---------------------------------------------------------

 

mission::CTradeSystem g_TradeSystem;

 

mission::CStoreSystem g_StoreSystem;

 

namespace mission

{

// 2008-8-27 yangyinyu add begin!

void lgtool_printTrade( CCharacter* pRequest, CCharacter* pAccept, CTradeData* pTradeData )

{

// 字符串。

static char sText[512];

static char sTextEx[512];

 

// *

_snprintf( sText, 512, "@%s;%d;", pRequest->GetName(), pTradeData->ReqTradeData.dwMoney );

bool once = true;

for( int i = 0; i < ROLE_MAXNUM_TRADEDATA; i ++ )

{

if( pTradeData->ReqTradeData.ItemArray.sItemID != 0 )

{

CItemRecord* cir = GetItemRecordInfo( pTradeData->ReqTradeData.ItemArray.sItemID );

 

if( cir )

{

//

if( once == false )

strncat( sText, ",", 256 );

else

once = false;

 

//

_snprintf( sTextEx, 512,"%s-%d", cir->szName, pTradeData->ReqTradeData.ItemArray.byCount );

strncat( sText, sTextEx, 512 );

};

};

};

 

 

//

once = true;

_snprintf( sTextEx, 512, ";%s;%d;", pAccept->GetName(), pTradeData->AcpTradeData.dwMoney );

strncat( sText, sTextEx, 512 );

for( int i = 0; i < ROLE_MAXNUM_TRADEDATA; i ++ )

{

if( pTradeData->AcpTradeData.ItemArray.sItemID != 0 )

{

CItemRecord* cir = GetItemRecordInfo( pTradeData->AcpTradeData.ItemArray.sItemID );

 

if( cir )

{

//

if( once == false )

strncat( sText, ",", 512 );

else

once = false;

 

//

_snprintf( sTextEx, 512,"%s-%d", cir->szName, pTradeData->AcpTradeData.ItemArray.byCount );

strncat( sText, sTextEx, 512 );

};

};

};

 

strncat(sText, "\n", 512 );

 

//

LG("query_trade", sText );

};

// 2008-8-27 yangyinyu add end!

 

//----------------------------------------------------

// CTradeData implemented

 

CTradeData::CTradeData(dbc::uLong lSize)

: PreAllocStru(1)

{T_B

 

T_E}

 

CTradeData::~CTradeData()

{T_B

 

T_E}

 

//----------------------------------------------------

// CTradeSystem implemented

 

CTradeSystem::CTradeSystem()

{T_B

 

T_E}

 

CTradeSystem::~CTradeSystem()

{T_B

 

T_E}

 

// 交易操作

BOOL CTradeSystem::Request( BYTE byType, CCharacter& character, DWORD dwAcceptID )

{T_B

if(character.GetPlyMainCha()->IsStoreEnable())

{

//character.SystemNotice("无法交易!");

character.SystemNotice(RES_STRING(GM_CHARTRADE_CPP_00001));

return FALSE;

}

 

if( character.GetBoat() )

{

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00002) );

return FALSE;

}

 

if( character.GetStallData() )

{

//character.SystemNotice( "正在摆摊,不可以交易" );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00003) );

return FALSE;

}

 

//add by ALLEN 2007-10-16

if(character.IsReadBook())

{

//character.SystemNotice("正在读书,不可以交易");

character.SystemNotice(RES_STRING(GM_CHARTRADE_CPP_00004));

return FALSE;

}

 

if( character.m_CKitbag.IsLock() || !character.GetActControl(enumACTCONTROL_ITEM_OPT) )

{

//character.SystemNotice( "背包已被锁定,不可以交易!" );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00005) );

return FALSE;

}

 

if( character.GetPlyMainCha() && character.GetPlyMainCha()->m_CKitbag.IsLock() )

{

//character.SystemNotice( "背包已被锁定,不可以交易!" );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00005) );

return FALSE;

}

 

        if( character.GetPlyMainCha() && character.GetPlyMainCha()->m_CKitbag.IsPwdLocked() )

        {

            //character.SystemNotice( "背包已被密码锁定,不可以交易!" );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00006) );

return FALSE;

        }

 

CCharacter* pMain = &character;

CCharacter* pChar = pMain->GetSubMap()->FindCharacter( dwAcceptID, pMain->GetShape().centre );

if( pChar == NULL ) 

{

//pMain->SystemNotice( "被邀请玩家已经离开!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00007) );

return FALSE;

}

 

        if(pChar->GetPlayer()->GetBankNpc())

        {

            //pMain->SystemNotice( "对方正在使用银行,请稍候再试!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00008)  );

            return FALSE;

        }

 

if(pChar->GetPlyMainCha()->IsStoreEnable())

{

//character.SystemNotice("无法交易!");

character.SystemNotice(RES_STRING(GM_CHARTRADE_CPP_00001));

return FALSE;

}

 

if( !pMain->GetPlyMainCha() || !pChar->GetPlyMainCha() )

{

/*pMain->SystemNotice( "交易角色不存在!" );

pChar->SystemNotice( "交易角色不存在!" );*/

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00010) );

pChar->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00010) );

}

 

if(pMain->GetPlyMainCha()->GetLevel() < 6)

{

//pMain->SystemNotice("您的等级不够,无法交易!");

pMain->SystemNotice(RES_STRING(GM_CHARTRADE_CPP_00011));

return FALSE;

}

 

if( pChar->GetBoat() )

{

//character.SystemNotice( "角色%s正在造船,不可以交易", pChar->GetName() );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00012), pChar->GetName() );

return FALSE;

}

 

if( pChar->GetStallData() )

{

//character.SystemNotice( "角色%s正在摆摊,不可以交易", pChar->GetName() );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00013), pChar->GetName() );

return FALSE;

}

 

//add by ALLEN 2007-10-16

if( pChar->IsReadBook() )

{

//character.SystemNotice( "角色%s正在读书,不可以交易", pChar->GetName() );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00014), pChar->GetName() );

return FALSE;

}

 

if( pChar->m_CKitbag.IsLock() || !pChar->GetActControl(enumACTCONTROL_ITEM_OPT) )

{

//character.SystemNotice( "角色%s背包已被锁定,不可以交易!", pChar->GetName() );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00015), pChar->GetName() );

return FALSE;

}

 

        if( pChar->GetPlyMainCha()->m_CKitbag.IsPwdLocked() )

        {

           // character.SystemNotice( "角色%s背包已被密码锁定,不可以交易!", pChar->GetName() );

 character.SystemNotice( "角色%s背包已被密码锁定,不可以交易!", pChar->GetName() );

return FALSE;

        }

if( byType == mission::TRADE_CHAR )

{

pMain = pMain->GetPlyMainCha();

pChar = pChar->GetPlyMainCha();

}

else

{

if( pChar == pChar->GetPlyMainCha() || pMain == pMain->GetPlyMainCha() )

{

/*pMain->SystemNotice( "交易角色类型不匹配!" );

pChar->SystemNotice( "交易角色类型不匹配!" );*/

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00017) );

pChar->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00017) );

return FALSE;

}

}

 

if( pMain->GetPlayer()->IsLuanchOut() || pChar->GetPlayer()->IsLuanchOut() )

{

//pMain->SystemNotice( "海上禁止交易!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00018) );

return FALSE;

}

/*else if( pMain->GetPlayer()->IsLuanchOut() && !pChar->GetPlayer()->IsLuanchOut() )

{

pMain->SystemNotice( "你已经出海,现在不可以请求与他交易!" );

return FALSE;

}*/

else if( pMain->GetPlayer()->IsInForge() )

{

//pMain->SystemNotice( "你现在不可以请求与其他人交易!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00019) );

return FALSE;

}

 

CTradeData* pTradeData1 = pChar->GetTradeData();

if( pTradeData1 )

{

//pMain->SystemNotice( "%s正在交易中!", pChar->GetName() );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00020), pChar->GetName() );

return FALSE;

}

 

CTradeData* pTradeData2 = pMain->GetTradeData();

if( pTradeData2 )

{

return FALSE;

}

 

// 发送交易邀请

WPACKET packet = GETWPACKET();

        WRITE_CMD(packet, CMD_MC_CHARTRADE);

        WRITE_SHORT(packet, CMD_MC_CHARTRADE_REQUEST);

WRITE_CHAR(packet, byType);

WRITE_LONG(packet, character.GetID());

 

pChar->ReflectINFof( pChar, packet );

return TRUE;

T_E}

 

BOOL CTradeSystem::IsTradeDist( CCharacter& Char1, CCharacter& Char2, DWORD dwDist )

{T_B

DWORD dwxDist = (Char1.GetShape().centre.x - Char2.GetShape().centre.x) * 

(Char1.GetShape().centre.x - Char2.GetShape().centre.x);

DWORD dwyDist = (Char1.GetShape().centre.y - Char2.GetShape().centre.y) * 

(Char1.GetShape().centre.y - Char2.GetShape().centre.y);

return ( dwxDist + dwyDist < dwDist * 100 );

T_E}

 

BOOL CTradeSystem::Accept( BYTE byType, CCharacter& character, DWORD dwRequestID )

{T_B

if( character.GetBoat() )

{

//character.SystemNotice( "正在建造船只,不可以交易!" );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00002) );

return FALSE;

}

 

if( character.GetStallData() )

{

//character.SystemNotice( "正在摆摊,不可以交易" );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00003) );

return FALSE;

}

 

//add by ALLEN 2007-10-16

if( character.IsReadBook() )

{

//character.SystemNotice("正在读书,不可以交易");

character.SystemNotice(RES_STRING(GM_CHARTRADE_CPP_00004));

return FALSE;

}

 

if( character.m_CKitbag.IsLock() || !character.GetActControl(enumACTCONTROL_ITEM_OPT) )

{

//character.SystemNotice( "背包已被锁定,不可以交易!" );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00005) );

return FALSE;

}

 

if( character.GetPlyMainCha() && character.GetPlyMainCha()->m_CKitbag.IsLock() )

{

//character.SystemNotice( "背包已被锁定,不可以交易!" );

character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00005) );

return FALSE;

}

 

        if( character.GetPlyMainCha() && character.GetPlyMainCha()->m_CKitbag.IsPwdLocked() )

        {

           // character.SystemNotice( "背包已被密码锁定,不可以交易!" );

 character.SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00006) );

return FALSE;

        }

 

CCharacter* pMain = &character;

if( pMain->GetID() == dwRequestID )

{

//pMain->SystemNotice( "不可以请求和自己交易!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00021) );

return FALSE;

}

 

CCharacter* pChar = pMain->GetSubMap()->FindCharacter( dwRequestID, pMain->GetShape().centre );

if( pChar == NULL ) 

{

//pMain->SystemNotice( "发送通知该角色已经离开!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00022) );

return FALSE;

}

 

        if(character.GetPlyMainCha()->GetPlayer()->GetBankNpc())

        {

           // character.SystemNotice("你正在使用银行,不可以交易");

character.SystemNotice(RES_STRING(GM_CHARTRADE_CPP_00023));

           // pChar->SystemNotice( "对方正在使用银行,请稍候再试!" );

           pChar->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00008) );

return FALSE;

        }

 

if(character.GetPlyMainCha()->IsStoreEnable() || pChar->GetPlyMainCha()->IsStoreEnable())

{

/*character.SystemNotice("无法交易!");

pChar->SystemNotice("无法交易!");*/

character.SystemNotice(RES_STRING(GM_CHARTRADE_CPP_00001));

pChar->SystemNotice(RES_STRING(GM_CHARTRADE_CPP_00001));

return FALSE;

}

 

if( !pChar->IsLiveing() )

{

//pMain->SystemNotice( "请求交易方已死亡不可交易!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00025) );

return FALSE;

}

 

if( !pMain->IsLiveing() )

{

//pMain->SystemNotice( "你已死亡不可交易!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00026) );

return FALSE;

}

 

if( pChar->GetBoat() )

{

//pChar->SystemNotice( "正在建造船只,不可以交易!" );

pChar->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00002) );

return FALSE;

}

 

if( pChar->GetStallData() )

{

//pChar->SystemNotice( "正在摆摊,不可以交易!" );

pChar->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00003) );

return FALSE;

}

 

//add by ALLEN 2007-10-16

if( pChar->IsReadBook() )

{

//pChar->SystemNotice( "正在读书,不可以交易!" );

pChar->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00004) );

return FALSE;

}

 

if( pChar->m_CKitbag.IsLock() || !pChar->GetActControl(enumACTCONTROL_ITEM_OPT) )

{

//pChar->SystemNotice( "背包已被锁定,不可以交易!" );

pChar->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00005) );

return FALSE;

}

 

        if( pChar->GetPlyMainCha()->m_CKitbag.IsPwdLocked() )

        {

            //pChar->SystemNotice( "背包已被密码锁定,不可以交易!" );

pChar->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00006) );

return FALSE;

        }

 

        if(pChar->GetPlayer()->GetBankNpc())

        {

           // pChar->SystemNotice("银行打开时,不允许交易!");

 pChar->SystemNotice(RES_STRING(GM_CHARTRADE_CPP_00027));

            return FALSE;

        }

 

if( byType == mission::TRADE_CHAR )

{

pMain = pMain->GetPlyMainCha();

pChar = pChar->GetPlyMainCha();

}

else

{

if( pChar == pChar->GetPlyMainCha() || pMain == pMain->GetPlyMainCha() )

{

/*pMain->SystemNotice( "交易角色类型不匹配!" );

pChar->SystemNotice( "交易角色类型不匹配!" );*/

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00017) );

pChar->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00017) );

return FALSE;

}

}

 

if( !pMain->GetPlayer()->IsLuanchOut() && pChar->GetPlayer()->IsLuanchOut() )

{

//pMain->SystemNotice( "对方已经出海,你现在不可以接受请求与他交易!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00029) );

return FALSE;

}

else if( pMain->GetPlayer()->IsLuanchOut() && !pChar->GetPlayer()->IsLuanchOut() )

{

//pMain->SystemNotice( "你已经出海,现在不可以接受请求与他交易!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00024) );

return FALSE;

}

else if( pMain->GetPlayer()->IsInForge() )

{

//pMain->SystemNotice( "你现在不可以请求与其他他人交易!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00030) );

return FALSE;

}

 

//if( !IsTradeDist( *pMain, *pChar, ROLE_MAXSIZE_TRADEDIST - 400 ) )

//{

// // 超出角色交易距离,发送角色已离开信息!

// return FALSE;

//}

 

CTradeData* pTradeData1 = pChar->GetTradeData();

if( pTradeData1 )

{

//pMain->SystemNotice( "%s正在交易中!", pChar->GetName() );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00020), pChar->GetName() );

return FALSE;

}

 

CTradeData* pTradeData2 = pMain->GetTradeData();

if( pTradeData2 )

{

// 自己正在与其他王家进行交易中

return FALSE;

}

 

// 分配的资源由交易邀请者释放

CTradeData* pData = g_pGameApp->m_TradeDataHeap.Get();

if( pData == NULL ) 

{

//pMain->SystemNotice( "分配交易数据缓冲失败!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00031) );

return FALSE;

}

pData->Clear();

pData->pRequest = pChar;

pData->pAccept  = pMain;

pData->dwTradeTime = GetTickCount();

pData->bTradeStart = ROLE_TRADE_START;

 

//// 交易验证地点

//pData->sxPos = (USHORT)pMain->GetShape().centre.x;

//pData->syPos = (USHORT)pMain->GetShape().centre.y;

 

// 设置交易交易信息数据

pMain->SetTradeData( pData );

pChar->SetTradeData( pData );

// 锁定交易角色状态

pMain->TradeAction( TRUE );

pChar->TradeAction( TRUE );

CKitbag& ReqBag = pData->pRequest->m_CKitbag;

CKitbag& AcpBag = pData->pAccept->m_CKitbag;

ReqBag.Lock();

AcpBag.Lock();

 

// 发送角色交易页命令

WPACKET packet = GETWPACKET();

        WRITE_CMD(packet, CMD_MC_CHARTRADE);

        WRITE_SHORT(packet, CMD_MC_CHARTRADE_PAGE);

WRITE_CHAR(packet, byType);

        WRITE_LONG(packet, pMain->GetID());

        WRITE_LONG(packet, pChar->GetID());

pChar->ReflectINFof( pMain, packet );

pMain->ReflectINFof( pMain, packet );

return TRUE;

T_E}

 

BOOL CTradeSystem::Cancel( BYTE byType, CCharacter& character, DWORD dwCharID )

{T_B

CCharacter* pMain = &character;

if( !pMain->GetPlyMainCha() )

{

//pMain->SystemNotice( "交易角色不存在!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00010) );

}

 

if( byType == mission::TRADE_CHAR )

{

pMain = pMain->GetPlyMainCha();

}

else

{

if( pMain == pMain->GetPlyMainCha() )

{

//pMain->SystemNotice( "交易角色类型不匹配!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00017) );

return FALSE;

}

}

 

CTradeData* pTradeData2 = pMain->GetTradeData();

if( !pTradeData2 )

{

char szData[128];

//sprintf( szData, "Cancel:该角色%s并不交易中!\n", pMain->GetName() );

sprintf( szData, RES_STRING(GM_CHARTRADE_CPP_00032), pMain->GetName() );

LG( "trade_error", szData );

return FALSE;

}

 

CCharacter* pChar;

if( pMain->GetID() == dwCharID )

{

//printf( "报文信息错误,不能取消和自己ID相同的交易操作!" );

printf( RES_STRING(GM_CHARTRADE_CPP_00033) );

return FALSE;

}

else if( pTradeData2->pRequest->GetID() == dwCharID )

{

pChar = pTradeData2->pRequest;

}

else if( pTradeData2->pAccept->GetID() == dwCharID )

{

pChar = pTradeData2->pAccept;

}

else

{

//pMain->SystemNotice( "客户端请求的交易对象信息错误!ID = 0x%x", dwCharID );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00034), dwCharID );

return FALSE;

}

CTradeData* pTradeData1 = pChar->GetTradeData();

if( pTradeData1 == NULL || pTradeData2 != pTradeData1 )

{

//pMain->SystemNotice( "错误:玩家%s未和你进行交易!", pChar->GetName() );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00009), pChar->GetName() );

return FALSE;

}

// 清除道具栏位锁定状态

pTradeData1->pAccept->m_CKitbag.UnLock();

pTradeData1->pRequest->m_CKitbag.UnLock();

 

ResetItemState( *pTradeData1->pAccept, *pTradeData1 );

ResetItemState( *pTradeData1->pRequest, *pTradeData1 );

pTradeData1->pAccept->SetTradeData( NULL );

pTradeData1->pRequest->SetTradeData( NULL );

 

// 取消角色交易

WPACKET packet = GETWPACKET();

WRITE_CMD(packet, CMD_MC_CHARTRADE );

WRITE_SHORT(packet, CMD_MC_CHARTRADE_CANCEL );

WRITE_LONG(packet, pMain->GetID() );

 

pTradeData1->pAccept->ReflectINFof( pMain, packet );

pTradeData1->pRequest->ReflectINFof( pMain, packet );

 

// 取消角色锁定状态

pTradeData1->pAccept->TradeAction( FALSE );

pTradeData1->pRequest->TradeAction( FALSE );

 

pTradeData1->Free();

 

return TRUE;

T_E}

 

BOOL CTradeSystem::Clear( BYTE byType, CCharacter& character )

{T_B

CCharacter* pMain = &character;

if( !pMain->GetPlyMainCha() )

{

//pMain->SystemNotice( "交易角色不存在!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00010) );

}

 

if( byType == mission::TRADE_CHAR )

{

pMain = pMain->GetPlyMainCha();

}

else

{

if( pMain == pMain->GetPlyMainCha() )

{

//pMain->SystemNotice( "交易角色类型不匹配!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00017) );

return FALSE;

}

}

 

CTradeData* pTradeData = pMain->GetTradeData();

if( !pTradeData )

{

// 该角色并不交易中!

return FALSE;

}

 

if( pTradeData->pRequest == pMain )

{

// 取消角色交易

WPACKET packet = GETWPACKET();

WRITE_CMD(packet, CMD_MC_CHARTRADE );

WRITE_SHORT(packet, CMD_MC_CHARTRADE_CANCEL );

WRITE_LONG(packet, pMain->GetID() );

pTradeData->pAccept->ReflectINFof( pMain, packet );

pTradeData->pAccept->SetTradeData( NULL );

 

// 清除道具栏位锁定状态

pTradeData->pAccept->m_CKitbag.UnLock();

pTradeData->pAccept->TradeAction( FALSE );

ResetItemState( *pTradeData->pAccept, *pTradeData );

}

else if( pTradeData->pAccept == pMain )

{

// 取消角色交易

WPACKET packet = GETWPACKET();

WRITE_CMD(packet, CMD_MC_CHARTRADE );

WRITE_SHORT(packet, CMD_MC_CHARTRADE_CANCEL );

WRITE_LONG(packet, pMain->GetID() );

pTradeData->pRequest->ReflectINFof( pMain, packet );

pTradeData->pRequest->SetTradeData( NULL );

// 清除道具栏位锁定状态

pTradeData->pRequest->m_CKitbag.UnLock();

pTradeData->pRequest->TradeAction( FALSE );

ResetItemState( *pTradeData->pRequest, *pTradeData );

}

else

{

//LG( "Trade", "删除角色时,清除其交易信息发现错误(不匹配的角色指针)!"  );

LG( "Trade", "when delete character,it find error while clear trade information,the error is:(unsuited charcter pointer)!"  );

return FALSE;

}

 

pTradeData->Free();

return TRUE;

T_E}

 

BOOL CTradeSystem::AddMoney( BYTE byType, CCharacter& character, DWORD dwCharID, BYTE byOpType, DWORD dwMoney )

{T_B

CCharacter* pMain = &character;

if( !pMain->GetPlyMainCha() )

{

//pMain->SystemNotice( "交易角色不存在!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00010) );

}

 

if( byType == mission::TRADE_CHAR )

{

pMain = pMain->GetPlyMainCha();

}

else

{

//pMain->SystemNotice( "交易类型错误!type[%d]", byType );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00028), byType );

return FALSE;

}

 

CTradeData* pTradeData = pMain->GetTradeData();

if( !pTradeData )

{

char szData[128];

//sprintf( szData, "AddMoney:该角色%s并不交易中!", pMain->GetName() );

sprintf( szData, RES_STRING(GM_CHARTRADE_CPP_00035), pMain->GetName() );

LG( "trade_error", szData );

return FALSE;

}

 

if( pMain->GetID() == dwCharID )

{

//pMain->SystemNotice( "报文信息错误,不能取消和自己ID相同的交易操作!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00033) );

return FALSE;

}

else if( pTradeData->pRequest->GetID() != dwCharID && pTradeData->pAccept->GetID() != dwCharID )

{

//pMain->SystemNotice( "交易对象信息错误!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00036) );

return FALSE;

}

 

TRADE_DATA* pItemData = NULL;

// 验证是否可以添加物品或取走物品操作

if( pMain == pTradeData->pRequest )

{

// 判断是否可以操作物品

if( pTradeData->bReqTrade == 1 )

{

//

//pMain->SystemNotice( "该角色交易物品验证按钮已经按下,不可以再作交易金钱操作!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00037) );

return FALSE;

}

pItemData = &pTradeData->ReqTradeData;

}

else if( pMain == pTradeData->pAccept )

{

if( pTradeData->bAcpTrade == 1 )

{

//pMain->SystemNotice( "该角色交易物品验证按钮已经按下,不可以再作交易金钱操作!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00037) );

return FALSE;

}

pItemData = &pTradeData->AcpTradeData;

}

else

{

//pMain->SystemNotice( "该角色未在交易中!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00038) );

return FALSE;

}

 

if( byOpType == TRADE_DRAGMONEY_ITEM )

{

//pMain->SystemNotice( "拖动金钱操作类型错误!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00039) );

return FALSE;

}

else if( byOpType == TRADE_DRAGMONEY_TRADE )

{

DWORD dwCharMoney = (long)pMain->m_CChaAttr.GetAttr( ATTR_GD );

pItemData->dwMoney = dwMoney;

if( pItemData->dwMoney > dwCharMoney )

{

pItemData->dwMoney = dwCharMoney;

}

}

else

{

//pMain->SystemNotice( "拖动金钱操作类型错误!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00039) );

return FALSE;

}

 

WPACKET packet = GETWPACKET();

WRITE_CMD(packet, CMD_MC_CHARTRADE );

WRITE_SHORT(packet, CMD_MC_CHARTRADE_MONEY );

WRITE_LONG(packet, pMain->GetID() );

WRITE_LONG(packet, pItemData->dwMoney );

 

pTradeData->pAccept->ReflectINFof( pMain, packet );

pTradeData->pRequest->ReflectINFof( pMain, packet );

return TRUE;

T_E}

 

// 放置或者取走物品到交易栏

BOOL CTradeSystem::AddItem( BYTE byType, CCharacter& character, DWORD dwCharID, BYTE byOpType, BYTE byIndex, BYTE byItemIndex, BYTE byCount )

{T_B

CCharacter* pMain = &character;

if( pMain->GetPlayer() == NULL )

{

return FALSE;

}

 

if( !pMain->GetPlyMainCha() )

{

//pMain->SystemNotice( "交易角色不存在!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00010) );

}

 

if( byType == mission::TRADE_CHAR )

{

pMain = pMain->GetPlyMainCha();

}

else

{

if( pMain == pMain->GetPlyMainCha() )

{

//pMain->SystemNotice( "交易角色类型不匹配!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00017) );

return FALSE;

}

}

 

CKitbag& Bag = pMain->m_CKitbag;

// 2008-8-1 yangyinyu add begin!

// 被锁道具禁止交易。

SItemGrid* pGridCont = Bag.GetGridContByID( byItemIndex );

 

if( pGridCont->dwDBID )

{

pMain->SystemNotice( "道具已绑定,无法交易!" );

return FALSE;

};

// 2008-8-1 yangyinyu add end!

 

CTradeData* pTradeData = pMain->GetTradeData();

if( !pTradeData )

{

char szData[128];

//sprintf( szData, "AddItem:该角色%s并不交易中!", pMain->GetName() );

sprintf( szData, RES_STRING(GM_CHARTRADE_CPP_00040), pMain->GetName() );

LG( "trade_error", szData );

return FALSE;

}

 

if( pMain->GetID() == dwCharID )

{

//pMain->SystemNotice( "报文信息错误,不能添加物品和自己ID相同的交易操作!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00041) );

return FALSE;

}

else if( pTradeData->pRequest->GetID() != dwCharID && pTradeData->pAccept->GetID() != dwCharID )

{

//pMain->SystemNotice( "交易对象信息错误!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00036) );

return FALSE;

}

 

CCharacter* pChar = NULL;

TRADE_DATA* pItemData = NULL;

// 验证是否可以添加物品或取走物品操作

if( pMain == pTradeData->pRequest )

{

// 判断是否可以操作物品

if( pTradeData->bReqTrade == 1 )

{

//pMain->SystemNotice( "该角色交易物品验证按钮已经按下,不可以再作物品拖动操作!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00042) );

return FALSE;

}

pItemData = &pTradeData->ReqTradeData;

pChar = pTradeData->pAccept;

}

else if( pMain == pTradeData->pAccept )

{

if( pTradeData->bAcpTrade == 1 )

{

//pMain->SystemNotice( "该角色交易物品验证按钮已经按下,不可以再作物品拖动操作!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00042) );

return FALSE;

}

pItemData = &pTradeData->AcpTradeData;

pChar = pTradeData->pRequest;

}

else

{

//pMain->SystemNotice( "该角色未在交易!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00038) );

return FALSE;

}

// 设置交易栏物品,并且发送通知信息到客户端

if( byOpType == TRADE_DRAGTO_ITEM )

{

if( byIndex >= ROLE_MAXNUM_TRADEDATA )

{

//pMain->SystemNotice( "未知的交易栏位索引信息!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00043));

return FALSE;

}

int nCapacity = pMain->m_CKitbag.GetCapacity();

if( byItemIndex >= nCapacity )

{

//pMain->SystemNotice( "未知的道具栏位索引信息!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00044) );

return FALSE;

}

if( pItemData->ItemArray[byIndex].sItemID == 0 )

{

//pMain->SystemNotice( "该角色拖动的交易栏位物品不存在!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00045) );

return FALSE;

}

if( Bag.GetNum( pItemData->ItemArray[byIndex].byIndex ) > 0 && 

Bag.GetID( pItemData->ItemArray[byIndex].byIndex ) != pItemData->ItemArray[byIndex].sItemID )

{

//pMain->SystemNotice( "系统物品栏交易记录错误,请通知开发人员,谢谢!ID1= %d, ID2 = %d", 

// Bag.GetID( pItemData->ItemArray[byIndex].byIndex ), pItemData->ItemArray[byIndex].sItemID );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00046), 

Bag.GetID( pItemData->ItemArray[byIndex].byIndex ), pItemData->ItemArray[byIndex].sItemID );

return FALSE;

}

 

WPACKET packet = GETWPACKET();

WRITE_CMD(packet, CMD_MC_CHARTRADE );

WRITE_SHORT(packet, CMD_MC_CHARTRADE_ITEM );

WRITE_LONG(packet, pMain->GetID() );

WRITE_CHAR(packet, TRADE_DRAGTO_ITEM );

WRITE_CHAR(packet, pItemData->ItemArray[byIndex].byIndex );

WRITE_CHAR(packet, byIndex );

WRITE_CHAR(packet, byCount );

 

// 开启道具栏物物品活动状态

Bag.Enable( pItemData->ItemArray[byIndex].byIndex );

pItemData->ItemArray[byIndex].sItemID = 0;

pItemData->ItemArray[byIndex].byCount = 0;

pItemData->ItemArray[byIndex].byType = 0;

pItemData->ItemArray[byIndex].byIndex = 0;

pItemData->byItemCount--;

 

pTradeData->pRequest->ReflectINFof( pMain, packet );

pTradeData->pAccept->ReflectINFof( pMain, packet );

}

else if( byOpType == TRADE_DRAGTO_TRADE )

{

if( byIndex >= ROLE_MAXNUM_TRADEDATA )

{

//pMain->SystemNotice( "未知的交易栏位索引信息!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00043) );

return FALSE;

}

int nCapacity = pMain->m_CKitbag.GetCapacity();

if( byItemIndex >= nCapacity )

{

//pMain->SystemNotice( "未知的道具栏位索引信息!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00044) );

return FALSE;

}

 

if( !Bag.HasItem( byItemIndex ) || !Bag.IsEnable( byItemIndex ) )

{

//pMain->SystemNotice( "该物品栏位已被禁止拖动!" );

pMain->SystemNotice( RES_STRING(GM_CHARTRADE_CPP_00047) );

return FALSE;

}

if( pItemData->ItemArray[byIndex].sItemID != 0 )

<


Hit Like If You Like It!

Tekken-7.jpg

Share this post


Link to post
Share on other sites
On 6/3/2016 at 9:58 AM, Xeon said:

- I have spoken with him myself, managed to get him down to $250 ...

where you able to buy it? he doesnt wanna give me discount


Hit Like If You Like It!

Tekken-7.jpg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...