阅读:8904回复:30
【源码编辑】恋人系统
本帖最后由 shevechco 于 2011-11-12 20:59 编辑
11月12日补发恋人系统成功添加的图片 图片:QQ拼音截图未命名1.JPG 需要准备的东西 1.干净的源码 2.文本编辑工具,WINDOWS自带的记事本即可还要在这里介绍下自己,shevechco,巨峰社区的管理员,以后可能会有人知道这个社区,现在估计没人知道这个社区,可惜你们看不到的。 希望有人提供我老飞的飞行器源码支持 如果你还不知道怎么编译源码的话请先学习下源码编译方面的知识! 有问题或者源码编译错误请回帖,我会直到帮一个人解决然后不再跟踪这个问题 还请管理员字数限制调整到1W,我这些文件编辑了两次,第一次字数限制了发布了,累死了,分了三段,注意1楼和2楼还有 请尊重劳动成果,用了希望你回个贴,如果有需要,希望有会员用老飞飞行器源码编辑跟我交换更多的功能! 1. ../AccountServer/VersionCommon.h 找到 #if (_MSC_VER > 1200) #define __VS2003 // 哪颇老矾函版.net #endif 在后面添加 #define __LIANREN //支持恋人系统 2 ../CACHESERVER/VersionCommon.h 找到 #if (_MSC_VER > 1200) #define __VS2003 // 哪颇老矾函版.net #endif在后面添加 #define __LIANREN //支持恋人系统 3 ../CERTIFIER/VersionCommon.h 找到 #if (_MSC_VER > 1200) #define __VS2003 // 哪颇老矾函版.net #endif 在后面添加 #define __LIANREN //支持恋人系统 4 ../CORESERVER/DPCacheSrvr.cpp 找到 void CDPCacheSrvr::SendSetPlayerName( u_long idPlayer, const char* lpszPlayer ) { BEFORESENDSOLE( ar, PACKETTYPE_QUERYSETPLAYERNAME, DPID_ALLPLAYERS ); ar << idPlayer; ar.WriteString( lpszPlayer ); SEND( ar, this, DPID_ALLPLAYERS ); }在后面添加 #ifdef __LIANREN //玩家成为恋人了. void CDPCacheSrvr::SendPlayerCoupled( u_long idPlayer, const char* lpszPlayer ,u_long idPlayer2,const char* lpszPlayer2) { BEFORESENDSOLE( ar, PACKETTYPE_PLAYERCOUPLED, DPID_ALLPLAYERS ); ar << idPlayer; ar.WriteString( lpszPlayer ); ar << idPlayer2; ar.WriteString(lpszPlayer2); SEND( ar, this, DPID_ALLPLAYERS ); } void CDPCacheSrvr::SendPlayerDeCoupled( u_long idPlayer, const char* lpszPlayer ,u_long idPlayer2,const char* lpszPlayer2) { BEFORESENDSOLE( ar, PACKETTYPE_PLAYERDECOUPLED, DPID_ALLPLAYERS ); ar << idPlayer; ar.WriteString( lpszPlayer ); ar << idPlayer2; ar.WriteString(lpszPlayer2); SEND( ar, this, DPID_ALLPLAYERS ); } #endif //__LIANREN5 ../CORESERVER/DPCacheSrvr.h 找到 void SendSetPlayerName( u_long idPlayer, const char* lpszPlayer ); void SendSnoop( const char* lpszString, CPlayer* pSnoop ); 后面添加 #ifdef __LIANREN void SendPlayerCoupled( u_long idPlayer, const char* lpszPlayer ,u_long idPlayer2,const char* lpszPlayer2); void SendPlayerDeCoupled( u_long idPlayer, const char* lpszPlayer ,u_long idPlayer2,const char* lpszPlayer2); #endif //__LIANREN6 ../CORESERVER/DPDatabaseClient.cpp 找到 CDPDatabaseClient::CDPDatabaseClient() { BEGIN_MSG; ON_MSG( PACKETTYPE_PARTYNAME, OnPartyName ); ON_MSG( PACKETTYPE_GLOBAL_DATA, OnGlobalData ); ON_MSG( PACKETTYPE_INSERTTAG_RESULT, OnInsertTagResult ); ON_MSG( PACKETTYPE_DC_ADDVOTERESULT, OnAddVoteResult ); ON_MSG( PACKETTYPE_UPDATE_GUILD_RANKING_END, OnUpdateGuildRankFinish ); ON_MSG( PACKETTYPE_DEL_PLAYER, OnDelPlayer ); ON_MSG( PACKETTYPE_GUILD_MEMBERTIME, OnGuildMemberTime ); ON_MSG( PACKETTYPE_BUYING_INFO, OnBuyingInfo ); ON_MSG( PACKETTYPE_TC_LIST, OnTCList ); ON_MSG( PACKETTYPE_QUERYSETPLAYERNAME, OnSetPlayerName );后面添加 #ifdef __LIANREN ON_MSG( PACKETTYPE_PLAYERCOUPLED, OnPlayerCoupled); ON_MSG( PACKETTYPE_PLAYERDECOUPLED, OnPlayerDeCoupled); #endif //__LIANREN找到 void CDPDatabaseClient::SendSnoopGuild( u_long idGuild, u_long idPlayer, const char* lpszChat ) { BEFORESEND( ar, PACKETTYPE_SETSNOOPGUILD ); ar << idGuild << idPlayer; ar.WriteString( lpszChat ); SEND( ar, this, DPID_SERVERPLAYER ); }在前面添加 #ifdef __LIANREN void CDPDatabaseClient::OnPlayerCoupled( CAr & ar ) { OutputDebugString( \"CORESERVER.EXE\tPACKETTYPE_PLAYERCOUPLED\" ); u_long idPlayer,idPlayer2; char lpszPlayer[MAX_PLAYER] = { 0, }; char lpszPlayer2[MAX_PLAYER] = {0,}; ar >> idPlayer; ar.ReadString( lpszPlayer, MAX_PLAYER ); ar >> idPlayer2; ar.ReadString( lpszPlayer2, MAX_PLAYER ); g_DPCacheSrvr.SendPlayerCoupled(idPlayer,lpszPlayer,idPlayer2,lpszPlayer2); } void CDPDatabaseClient::OnPlayerDeCoupled( CAr & ar ) { u_long idPlayer,idPlayer2; char lpszPlayer[MAX_PLAYER] = { 0, }; char lpszPlayer2[MAX_PLAYER] = {0,}; ar >> idPlayer; ar.ReadString( lpszPlayer, MAX_PLAYER ); ar >> idPlayer2; ar.ReadString( lpszPlayer2, MAX_PLAYER ); g_DPCacheSrvr.SendPlayerDeCoupled(idPlayer,lpszPlayer,idPlayer2,lpszPlayer2); } #endif //__LIANREN7 还是上面的目录里面的DPDatabaseClient.h 找到 #if __VER >= 11 // __SYS_PLAYER_DATA void OnUpdatePlayerData( CAr & ar ); #endif // __SYS_PLAYER_DATA上面添加 #ifdef __LIANREN void OnPlayerCoupled( CAr & ar ); void OnPlayerDeCoupled( CAr & ar ); #endif // __LIANREN8 还是上面目录里面的VersionCommon.h 找到 #if (_MSC_VER > 1200) #define __VS2003 // 哪颇老矾函版.net #endif后面添加 #define __LIANREN //支持恋人系统9 ../DataBaseserver/couplehelper.cpp 找到 #include \"couplehelper.h\" #include \"dptrans.h\" #include \"definetext.h\" #include \"post.h\"在后面添加 #ifdef __LIANREN #include \"DPCoreSrvr.h\" extern CDPCoreSrvr g_dpCoreSrvr; #endif // __LIANREN找到 void CCoupleHelper::OnCouple( CAr & ar ) { int nResult = 0; u_long idProposer, idTarget; ar >> idProposer >> idTarget; election::OutputDebugString( \"\nT: CCoupleHelper.OnCouple: %d, %d\n\", idProposer, idTarget ); if( m_pMgr->GetCouple( idProposer ) ) nResult = TID_GAME_COUPLE_E06; // 目敲捞 酒囱 某腐磐父 啊瓷钦聪促. if( nResult == 0 && m_pMgr->GetCouple( idTarget ) ) nResult = TID_GAME_COUPLE_E01; // 措惑捞 何利钦 钦聪促. 目敲捞 酒囱 捞己 某腐磐俊霸父 啊瓷钦聪促. if( nResult == 0 && !m_pController->Couple( idProposer, idTarget ) ) nResult = TID_GAME_COUPLE_E10; // 单捞磐海捞胶 坷幅涝聪促. if( nResult == 0 ) m_pMgr->Couple( idProposer, idTarget );在后面添加 #ifdef __LIANREN if(nResult == 0) { LPCSTR szProposer = CPlayerDataCenter::GetInstance()->GetPlayerString(idProposer); LPCSTR szTarget = CPlayerDataCenter::GetInstance()->GetPlayerString(idTarget); g_dpCoreSrvr.SendPlayerCoupled(idProposer,szProposer,idTarget,szTarget); } #endif // __LIANREN找到 void CCoupleHelper::OnDecouple( CAr & ar ) { int nResult = 0; u_long idPlayer; ar >> idPlayer; election::OutputDebugString( \"\nT: CCoupleHelper.OnDecouple: %d\n\", idPlayer ); CCouple* pCouple = m_pMgr->GetCouple( idPlayer ); if( !pCouple ) nResult = TID_GAME_COUPLE_E05; if( nResult == 0 && !m_pController->Decouple( idPlayer ) ) nResult = TID_GAME_COUPLE_E10; // 单捞磐海捞胶 坷幅涝聪促. if( nResult == 0 && !m_pMgr->Decouple( idPlayer ) ) nResult = TID_GAME_COUPLE_E11; 在后面添加 #ifdef __LIANREN if(nResult == 0) { u_long idPartner = pCouple->GetPartner(idPlayer); LPCSTR szProposer = CPlayerDataCenter::GetInstance()->GetPlayerString(idPlayer); LPCSTR szTarget = CPlayerDataCenter::GetInstance()->GetPlayerString(idPartner); g_dpCoreSrvr.SendPlayerDeCoupled(idPlayer,szProposer,idPartner,szTarget); } #endif // __LIANREN 10 还是上面的目录里面DPCoreSrvr.cpp 找到 void CDPCoreSrvr::SendAddVoteResult( VOTE_INSERTED_INFO & info ) { BEFORESEND( ar, PACKETTYPE_DC_ADDVOTERESULT ); ar << info; SEND( ar, this, DPID_ALLPLAYERS ); }后面添加 #ifdef __LIANREN void CDPCoreSrvr::SendPlayerCoupled( u_long idPlayer, const char* lpszPlayer,u_long idPlayer2, const char* lpszPlayer2) { BEFORESEND( ar, PACKETTYPE_PLAYERCOUPLED ); ar << idPlayer; ar.WriteString( lpszPlayer ); ar << idPlayer2; ar.WriteString(lpszPlayer2); SEND( ar, this, DPID_ALLPLAYERS ); } void CDPCoreSrvr::SendPlayerDeCoupled(u_long idPlayer, const char* lpszPlayer,u_long idPlayer2, const char* lpszPlayer2) { BEFORESEND( ar, PACKETTYPE_PLAYERDECOUPLED ); ar << idPlayer; ar.WriteString( lpszPlayer ); ar << idPlayer2; ar.WriteString(lpszPlayer2); SEND( ar, this, DPID_ALLPLAYERS ); } #endif // __LIANREN11 还是上面的目录DPCoreSrvr.h 找到 #if __VER >= 11 // __SYS_PLAYER_DATA void SendUpdatePlayerData( u_long idPlayer, PlayerData* pPlayerData ); #endif // __SYS_PLAYER_DATA 上面添加 #ifdef __LIANREN void SendPlayerCoupled( u_long idPlayer, const char* lpszPlayer,u_long idPlayer2, const char* lpszPlayer2); void SendPlayerDeCoupled( u_long idPlayer, const char* lpszPlayer,u_long idPlayer2, const char* lpszPlayer2); #endif // __LIANREN |
|
100% |
沙发#
发布于:2011-11-08 13:00
管理员字数限制了,要分三段
12 还是上面的目录VersionCommon.h 找到 #define __EVENT_1101 // 免媒 捞亥飘 下面添加 #define __LIANREN //支持恋人系统 13 ../LOGINSERVER/VersionCommon.h 找到 #define __CRC #define __SO1014 // 家南 抗寇 贸府( 某浆, 牢刘, 肺弊牢 ) #define __PROTOCOL0910 #define __PROTOCOL1021 #define __VERIFYNETLIB #define __DOS1101 #define __STL_0402 // stl 上面添加 #define __LIANREN //支持恋人系统 14 ../neuz/DPClient.cpp 找到 ON_MSG( PACKETTYPE_QUERYSETPLAYERNAME, OnSetPlayerName ); 下面添加 #ifdef __LIANREN ON_MSG( PACKETTYPE_PLAYERCOUPLED, OnPlayerCoupled ); ON_MSG( PACKETTYPE_PLAYERDECOUPLED, OnPlayerDeCoupled ); #endif // __LIANREN 找到 #if __VER >= 11 // __SYS_PLAYER_DATA PlayerData pd; pd.data.nJob = pPlayer->GetJob(); pd.data.nLevel = pPlayer->GetLevel(); pd.data.nSex = pPlayer->GetSex(); lstrcpy( pd.szPlayer, pPlayer->GetName() ); 下面添加 #ifdef __LIANREN pd.idCouple = pPlayer->GetCoupleId();//恋人id lstrcpy( pd.szCouplePlayer, pPlayer->GetCoupleName() ); //恋人名字 #endif //__LIANREN 接着找,可能跟上面一样 #if __VER >= 11 // __SYS_PLAYER_DATA PlayerData pd; pd.data.nJob = pPlayer->GetJob(); pd.data.nLevel = pPlayer->GetLevel(); pd.data.nSex = pPlayer->GetSex(); lstrcpy( pd.szPlayer, pPlayer->GetName() ); 下面添加 #ifdef __LIANREN pd.idCouple = pPlayer->GetCoupleId();//恋人id lstrcpy( pd.szCouplePlayer, pPlayer->GetCoupleName() ); //恋人名字 #endif //__LIANREN 找到 void CDPClient::SendDoEscape( void ) { if( g_pPlayer ) { CWorld* pWorld = g_pPlayer->GetWorld(); if( pWorld && pWorld->GetID() == WI_WORLD_GUILDWAR ) { g_WndMng.OpenMessageBoxUpper( prj.GetText(TID_GAME_GUILDCOMBAT_NO_OUTWAR) ); return; } SendHdr( PACKETTYPE_DO_ESCAPE ); } } 在上面添加 #ifdef __LIANREN void CDPClient::OnPlayerCoupled( CAr & ar ) { u_long idPlayer,idPlayer2; char lpszPlayer[MAX_PLAYER] = { 0, }; char lpszPlayer2[MAX_PLAYER] = { 0, }; ar >> idPlayer; ar.ReadString( lpszPlayer, MAX_PLAYER ); ar >> idPlayer2;//恋人id ar.ReadString(lpszPlayer2,MAX_PLAYER);//恋人名字 //Error(\"OnPlayerCoupled:ID:%d Name:%s,idCouple:%d NameCouple:%s\",idPlayer,lpszPlayer,idPlayer2,lpszPlayer2); char lpOutputString[128] = { 0, }; sprintf( lpOutputString, \"NEUZ.EXE\\t// PAKCETTYPE_QUERYSETPLAYERNAME\\t// %d\\t// %s\", idPlayer, lpszPlayer ); OutputDebugString( lpOutputString ); CMover* pPlayer = prj.GetUserByID( idPlayer ); if( IsValidObj( (CObj*)pPlayer ) ) { pPlayer->SetCoupleId(idPlayer2);//设置恋人id pPlayer->SetCoupleName( lpszPlayer2 ); //设置恋人名称 } CMover* pPlayer2 = prj.GetUserByID( idPlayer2 ); if( IsValidObj( (CObj*)pPlayer2 ) ) { pPlayer2->SetCoupleId(idPlayer);//设置恋人id pPlayer2->SetCoupleName( lpszPlayer ); //设置恋人名称 } CString str; str.Format(\"恭喜 %s 和 %s 成为恋人\",lpszPlayer,lpszPlayer2); g_WndMng.PutString( str, NULL, prj.GetTextColor(TID_ADMIN_ANNOUNCE), CHATSTY_SYSTEM ); CWndWorld* pWndWorld = (CWndWorld*)g_WndMng.GetWndBase( APP_WORLD ); if( pWndWorld ){ g_Caption1.AddCaption( str,pWndWorld->m_pFontAPITitle , FALSE, D3DCOLOR_ARGB( 255, 255, 255, 153 ) ); } } void CDPClient::OnPlayerDeCoupled( CAr & ar ) { u_long idPlayer,idPlayer2; char lpszPlayer[MAX_PLAYER] = { 0, }; char lpszPlayer2[MAX_PLAYER] = { 0, }; ar >> idPlayer; ar.ReadString( lpszPlayer, MAX_PLAYER ); ar >> idPlayer2;//恋人id ar.ReadString(lpszPlayer2,MAX_PLAYER);//恋人名字 //Error(\"OnPlayerCoupled:ID:%d Name:%s,idCouple:%d NameCouple:%s\",idPlayer,lpszPlayer,idPlayer2,lpszPlayer2); char lpOutputString[128] = { 0, }; CMover* pPlayer = prj.GetUserByID( idPlayer ); if( IsValidObj( (CObj*)pPlayer ) ) { pPlayer->SetCoupleId((u_long)0xffffffff);//设置恋人id pPlayer->SetCoupleName( \"\\0\" ); //设置恋人名称 } CMover* pPlayer2 = prj.GetUserByID( idPlayer2 ); if( IsValidObj( (CObj*)pPlayer2 ) ) { pPlayer2->SetCoupleId((u_long)0xffffffff);//设置恋人id pPlayer2->SetCoupleName( \"\\0\" ); //设置恋人名称 } } #endif // __LIANREN 15 ../neuz/DPClient.h 找到 #if __VER >= 11 // __SYS_PLAYER_DATA void OnUpdatePlayerData( CAr & ar ); #endif // __SYS_PLAYER_DATA 上面添加 #ifdef __LIANREN void OnPlayerCoupled( CAr & ar ); void OnPlayerDeCoupled( CAr & ar ); #endif // __LIANREN 16 还是NEUZ目录 VersionCommon.h 找到 #if (_MSC_VER > 1200) #define __VS2003 // 哪颇老矾函版.net #endif 下面添加 #define __LIANREN //使用恋人系统 17 ..WORLDSERVER/couplehelper.cpp 找到 void CCoupleHelper::OnCoupleResult( CAr & ar ) { u_long idProposer, idTarget; int nResult; ar >> idProposer >> idTarget >> nResult; election::OutputDebugString( \"S: CCoupleHelper.OnCoupleResult: %d, %d, %d\", idProposer, idTarget, nResult ); CUser* pProposer = static_cast<CUser*>( prj.GetUserByID( idProposer ) ); CUser* pTarget = static_cast<CUser*>( prj.GetUserByID( idTarget ) ); if( nResult == 0 ) { m_pMgr->Couple( idProposer, idTarget ); const char* pszProposer = CPlayerDataCenter::GetInstance()->GetPlayerString( idProposer ); const char* pszTarget = CPlayerDataCenter::GetInstance()->GetPlayerString( idTarget ); 后面添加 #ifdef __LIANREN //结婚成功更新下数据以便玩家都可以看到 if (pszProposer) { CUser* pUser = (CUser*)prj.GetUserByID( idProposer ); if (IsValidObj(pUser)) { pUser->SetCoupleId(idTarget); pUser->SetCoupleName(pszTarget); } //CPlayerDataCenter::GetInstance() } if (pszTarget) { CUser* pUser = (CUser*)prj.GetUserByID( idTarget ); if (IsValidObj(pUser)) { pUser->SetCoupleId(idProposer); pUser->SetCoupleName(pszProposer); } //CPlayerDataCenter::GetInstance() } #endif // __LIANREN if( !pszProposer ) pszProposer = \"\"; if( !pszTarget ) pszTarget = \"\"; //结成情侣成功,需要通知每位玩家这2个人的信息. if( IsValidObj( pProposer ) ) { pProposer->AddCoupleResult( idTarget, pszTarget ); 找到 void CCoupleHelper::OnDecoupleResult( CAr & ar ) { u_long idPlayer; int nResult; ar >> idPlayer >> nResult; election::OutputDebugString( \"S: CCoupleHelper.OnDecoupleResult: %d, %d\", idPlayer, nResult ); CUser* pUser = static_cast<CUser*>( prj.GetUserByID( idPlayer ) ); if( nResult == 0 ) { CCouple* pCouple = m_pMgr->GetCouple( idPlayer ); ASSERT( pCouple ); if( !pCouple ) return; CUser* pPartner = static_cast<CUser*>( prj.GetUserByID( pCouple->GetPartner( idPlayer ) ) ); m_pMgr->Decouple( idPlayer ); 后面添加 #ifdef __LIANREN //离婚成功更新下数据以便玩家都可以看到 //CUser* pUser1 = (CUser*)prj.GetUserByID( idPlayer ); if (IsValidObj(pUser)) { pUser->SetCoupleId((u_long)0xffffffff); pUser->SetCoupleName(\"\\0\"); } //CPlayerDataCenter::GetInstance() //CUser* pUser2 = (CUser*)prj.GetUserByID( pCouple->GetPartner( idPlayer ) ); if( IsValidObj( pPartner ) ) { pPartner->SetCoupleId((u_long)0xffffffff); pPartner->SetCoupleName(\"\\0\"); } #endif // __LIANREN |
|
地板#
发布于:2011-11-08 13:03
不错啊,不过源码编译在哪里可以学习
|
|
4楼#
发布于:2011-11-08 13:16
目前还看不懂的...
以后来研究 真想拜你为师啊.... |
|
5楼#
发布于:2011-11-08 13:23
谢谢楼主的分享以及建议 我去修改
|
|
|
6楼#
发布于:2011-11-08 13:26
原来就是1W 现在我调至10W了
|
|
|
7楼#
发布于:2011-11-08 13:29
本帖最后由 shevechco 于 2011-11-8 19:41 编辑
这是我的飞飞,巨峰飞飞 老飞采集系统 图片:QQ拼音截图未命名1.png V17新的技能窗 图片:2.png 老飞闪名系统 图片:QQ拼音截图未命名6.png V17终极图标 图片:QQ拼音截图未命名5.png V17 140-144级图标 图片:QQ拼音截图未命名4.png V16新的地图系统 图片:QQ拼音截图未命名3.png 新的枪 V17光晕效果 图片:12.png 新增V16地图和部分V17地图 新的V17光晕 新的Baruna升级系统 新的地图链接系统 新的第三职业和技能窗口 第三职业图标5级更换 新的时尚组合系统 新的罗马斗兽场 工会等级10级更换颜色,公会等级上限60 读取客户端IP 去除弹出窗口 能够读取新的Spec_Item.txt; 显示迷你地图坐标 新增恋人系统 新增老飞pvp称号和闪名 新增老飞灵兽采集系统 待添加挖宝系统和老飞飞行器系统,挖宝系统自己能解决!!! |
|
8楼#
发布于:2011-11-08 13:44
楼主 留下QQ呗
|
|
|
9楼#
发布于:2011-11-08 13:46
楼主有没有好点的端啊!!发个V15的吧
|
|
10楼#
发布于:2011-11-08 15:07
我的扣扣:117237008
|
|
11楼#
发布于:2011-11-08 15:13
|
|
|
12楼#
发布于:2011-11-08 17:07
顶 顶 顶 ,。 高手。
|
|
13楼#
发布于:2011-11-09 06:42
用户被禁言,该主题自动屏蔽! |
|
14楼#
发布于:2011-11-09 06:58
支持LZ的共享精神
|
|
上一页
下一页