From 88521abae251179667ea4167fee36d28fbe855bf Mon Sep 17 00:00:00 2001 From: ketoo <342006@qq.com> Date: Sun, 6 Nov 2016 02:25:27 -0800 Subject: [PATCH] fixed for mysql[removed mysql from development branch] --- .../NFPluginLoader.vcxproj.user | 5 + .../NFCGuildBroadcastModule.cpp | 441 ------------- .../NFCGuildBroadcastModule.h | 44 -- .../NFGameLogicPlugin/NFCGuildDataModule.cpp | 350 ---------- .../NFGameLogicPlugin/NFCGuildDataModule.h | 66 -- .../NFCGuildEctypeModule.cpp | 157 ----- .../NFGameLogicPlugin/NFCGuildEctypeModule.h | 72 --- NFServer/NFGameLogicPlugin/NFCGuildModule.cpp | 612 ------------------ NFServer/NFGameLogicPlugin/NFCGuildModule.h | 73 --- .../NFGameLogicPlugin.vcxproj | 8 - .../NFGameLogicPlugin.vcxproj.filters | 27 - NFServer/NFWorldLogicPlugin/NFCTeamModule.cpp | 14 +- NFServer/NFWorldLogicPlugin/NFCTeamModule.h | 2 - 13 files changed, 7 insertions(+), 1864 deletions(-) delete mode 100644 NFServer/NFGameLogicPlugin/NFCGuildBroadcastModule.cpp delete mode 100644 NFServer/NFGameLogicPlugin/NFCGuildBroadcastModule.h delete mode 100644 NFServer/NFGameLogicPlugin/NFCGuildDataModule.cpp delete mode 100644 NFServer/NFGameLogicPlugin/NFCGuildDataModule.h delete mode 100644 NFServer/NFGameLogicPlugin/NFCGuildEctypeModule.cpp delete mode 100644 NFServer/NFGameLogicPlugin/NFCGuildEctypeModule.h delete mode 100644 NFServer/NFGameLogicPlugin/NFCGuildModule.cpp delete mode 100644 NFServer/NFGameLogicPlugin/NFCGuildModule.h diff --git a/NFComm/NFPluginLoader/NFPluginLoader.vcxproj.user b/NFComm/NFPluginLoader/NFPluginLoader.vcxproj.user index 8b87f8616f..fa3f5761a3 100644 --- a/NFComm/NFPluginLoader/NFPluginLoader.vcxproj.user +++ b/NFComm/NFPluginLoader/NFPluginLoader.vcxproj.user @@ -5,4 +5,9 @@ WindowsLocalDebugger ..\..\_Out\Server\Debug + + Server=WorldServer ID=7 PluginX.xml + ..\..\_Out\Server\Debug + WindowsLocalDebugger + \ No newline at end of file diff --git a/NFServer/NFGameLogicPlugin/NFCGuildBroadcastModule.cpp b/NFServer/NFGameLogicPlugin/NFCGuildBroadcastModule.cpp deleted file mode 100644 index 0aa3b9a784..0000000000 --- a/NFServer/NFGameLogicPlugin/NFCGuildBroadcastModule.cpp +++ /dev/null @@ -1,441 +0,0 @@ -// ------------------------------------------------------------------------- -// @FileName : NFCGuildBroadcastModule.cpp -// @Author : Chuanbo.Guo -// @Date : 2015-05-24 08:51 -// @Module : NFCGuildBroadcastModule -// -// ------------------------------------------------------------------------- - -#include "NFCGuildBroadcastModule.h" -#include "NFComm/Config/NFConfig.h" -#include "NFComm/NFPluginModule/NFPlatform.h" -#include "NFComm/NFMessageDefine/NFMsgShare.pb.h" -#include "NFComm/NFPluginModule/NFINetModule.h" - -bool NFCGuildBroadcastModule::Init() -{ - return true; -} - -bool NFCGuildBroadcastModule::Shut() -{ - return true; -} - -bool NFCGuildBroadcastModule::Execute() -{ - return true; -} - -bool NFCGuildBroadcastModule::AfterInit() -{ - m_pKernelModule = pPluginManager->FindModule(); - m_pGuildModule = pPluginManager->FindModule(); - m_pGameServerNet_ServerModule = pPluginManager->FindModule(); - - m_pKernelModule->RegisterCommonPropertyEvent(this, &NFCGuildBroadcastModule::OnPropertyCommonEvent); - m_pKernelModule->RegisterCommonRecordEvent(this, &NFCGuildBroadcastModule::OnRecordCommonEvent); - - return true; -} - -int NFCGuildBroadcastModule::OnPropertyCommonEvent( const NFGUID& self, const std::string& strPropertyName, const NFIDataList::TData& oldVar, const NFIDataList::TData& newVar) -{ - if (NFrame::Guild::ThisName() != m_pKernelModule->GetPropertyString( self, NFrame::Guild::ClassName())) - { - return 0; - } - - NFCDataList valueBroadCaseList; - NFCDataList valueBroadCaseGameList; - - if (!m_pGuildModule->GetOnlineMember(NFGUID(), self, valueBroadCaseList, valueBroadCaseGameList)) - { - return 0; - } - - if ( valueBroadCaseList.GetCount() <= 0 || valueBroadCaseList.GetCount() != valueBroadCaseGameList.GetCount()) - { - return 0; - } - - switch ( oldVar.GetType() ) - { - case TDATA_INT: - { - NFMsg::ObjectPropertyInt xPropertyInt; - NFMsg::Ident* pIdent = xPropertyInt.mutable_player_id(); - *pIdent = NFINetModule::NFToPB(self); - - NFMsg::PropertyInt* pDataInt = xPropertyInt.add_property_list(); - pDataInt->set_property_name( strPropertyName ); - pDataInt->set_data( newVar.GetInt() ); - - - for (int i = 0; i < valueBroadCaseList.GetCount(); ++i) - { - const NFGUID& xPlayerID = valueBroadCaseList.Object(i); - m_pGameServerNet_ServerModule->SendMsgPBToGate(NFMsg::EGMI_ACK_PROPERTY_INT, xPropertyInt, xPlayerID); - } - - } - break; - - case TDATA_FLOAT: - { - NFMsg::ObjectPropertyFloat xPropertyFloat; - NFMsg::Ident* pIdent = xPropertyFloat.mutable_player_id(); - *pIdent = NFINetModule::NFToPB(self); - - NFMsg::PropertyFloat* pDataFloat = xPropertyFloat.add_property_list(); - pDataFloat->set_property_name( strPropertyName ); - pDataFloat->set_data( newVar.GetFloat() ); - - for (int i = 0; i < valueBroadCaseList.GetCount(); ++i) - { - const NFGUID& xPlayerID = valueBroadCaseList.Object(i); - m_pGameServerNet_ServerModule->SendMsgPBToGate(NFMsg::EGMI_ACK_PROPERTY_FLOAT, xPropertyFloat, xPlayerID); - } - } - break; - - case TDATA_STRING: - { - NFMsg::ObjectPropertyString xPropertyString; - NFMsg::Ident* pIdent = xPropertyString.mutable_player_id(); - *pIdent = NFINetModule::NFToPB(self); - - NFMsg::PropertyString* pDataString = xPropertyString.add_property_list(); - pDataString->set_property_name( strPropertyName ); - pDataString->set_data( newVar.GetString() ); - - for (int i = 0; i < valueBroadCaseList.GetCount(); ++i) - { - const NFGUID& xPlayerID = valueBroadCaseList.Object(i); - m_pGameServerNet_ServerModule->SendMsgPBToGate(NFMsg::EGMI_ACK_PROPERTY_STRING, xPropertyString, xPlayerID); - } - } - break; - - case TDATA_OBJECT: - { - NFMsg::ObjectPropertyObject xPropertyObject; - NFMsg::Ident* pIdent = xPropertyObject.mutable_player_id(); - *pIdent = NFINetModule::NFToPB(self); - - NFMsg::PropertyObject* pDataObject = xPropertyObject.add_property_list(); - pDataObject->set_property_name( strPropertyName ); - *pDataObject->mutable_data() = NFINetModule::NFToPB(newVar.GetObject()); - - for (int i = 0; i < valueBroadCaseList.GetCount(); ++i) - { - const NFGUID& xPlayerID = valueBroadCaseList.Object(i); - m_pGameServerNet_ServerModule->SendMsgPBToGate( NFMsg::EGMI_ACK_PROPERTY_OBJECT, xPropertyObject, xPlayerID); - } - - } - break; - - default: - break; - } - - - return 0; -} - - -int NFCGuildBroadcastModule::OnRecordCommonEvent( const NFGUID& self, const RECORD_EVENT_DATA& xEventData, const NFIDataList::TData& oldVar, const NFIDataList::TData& newVar ) -{ - const std::string& strRecordName = xEventData.strRecordName; - int nOpType = xEventData.nOpType; - int nRow = xEventData.nRow; - int nCol = xEventData.nCol; - - if ( NFrame::Guild::ThisName() != m_pKernelModule->GetPropertyString( self, NFrame::Guild::ClassName() )) - { - return 0; - } - - NFCDataList valueBroadCaseList; - NFCDataList valueBroadCaseGameList; - if (!m_pGuildModule->GetOnlineMember(NFGUID(), self, valueBroadCaseList, valueBroadCaseGameList)) - { - return 0; - } - - if (valueBroadCaseList.GetCount() <= 0 || valueBroadCaseList.GetCount() != valueBroadCaseGameList.GetCount()) - { - return 0; - } - - switch ( nOpType ) - { - case RECORD_EVENT_DATA::Add: - { - NFMsg::ObjectRecordAddRow xAddRecordRow; - NFMsg::Ident* pIdent = xAddRecordRow.mutable_player_id(); - *pIdent = NFINetModule::NFToPB(self); - - xAddRecordRow.set_record_name( strRecordName ); - - NFMsg::RecordAddRowStruct* pAddRowData = xAddRecordRow.add_row_data(); - pAddRowData->set_row(nRow); - - NF_SHARE_PTR pRecord =m_pKernelModule->FindRecord(self, strRecordName); - if (!pRecord.get()) - { - break; - } - - NFCDataList varRowData; - pRecord->QueryRow(nRow, varRowData); - //add row 需要完整的row - for ( int i = 0; i < varRowData.GetCount(); i++ ) - { - switch ( varRowData.Type( i ) ) - { - case TDATA_INT: - { - //添加的时候数据要全s - int nValue = varRowData.Int( i ); - //if ( 0 != nValue ) - { - NFMsg::RecordInt* pAddData = pAddRowData->add_record_int_list(); - pAddData->set_col( i ); - pAddData->set_row( nRow ); - pAddData->set_data( nValue ); - } - } - break; - case TDATA_FLOAT: - { - float fValue = varRowData.Float( i ); - //if ( fValue > 0.001f || fValue < -0.001f ) - { - NFMsg::RecordFloat* pAddData = pAddRowData->add_record_float_list(); - pAddData->set_col( i ); - pAddData->set_row( nRow ); - pAddData->set_data( fValue ); - } - } - break; - case TDATA_STRING: - { - const std::string& str = varRowData.String( i ); - //if (!str.empty()) - { - NFMsg::RecordString* pAddData = pAddRowData->add_record_string_list(); - pAddData->set_col( i ); - pAddData->set_row( nRow ); - pAddData->set_data( str ); - } - } - break; - case TDATA_OBJECT: - { - NFGUID identValue = varRowData.Object( i ); - //if (!identValue.IsNull()) - { - NFMsg::RecordObject* pAddData = pAddRowData->add_record_object_list(); - pAddData->set_col( i ); - pAddData->set_row( nRow ); - - *pAddData->mutable_data() = NFINetModule::NFToPB(identValue); - } - } - break; - default: - break; - } - } - - for (int i = 0; i < valueBroadCaseList.GetCount(); ++i) - { - const NFGUID& xPlayerID = valueBroadCaseList.Object(i); - m_pGameServerNet_ServerModule->SendMsgPBToGate( NFMsg::EGMI_ACK_ADD_ROW, xAddRecordRow, xPlayerID); - } - } - break; - case RECORD_EVENT_DATA::Del: - { - NFMsg::ObjectRecordRemove xReoveRecordRow; - - NFMsg::Ident* pIdent = xReoveRecordRow.mutable_player_id(); - *pIdent = NFINetModule::NFToPB(self); - - xReoveRecordRow.set_record_name( strRecordName ); - xReoveRecordRow.add_remove_row( nRow ); - - for (int i = 0; i < valueBroadCaseList.GetCount(); ++i) - { - const NFGUID& xPlayerID = valueBroadCaseList.Object(i); - m_pGameServerNet_ServerModule->SendMsgPBToGate( NFMsg::EGMI_ACK_REMOVE_ROW, xReoveRecordRow, xPlayerID); - } - - const int nCol = xEventData.nCol; - NF_SHARE_PTR pRecord = m_pKernelModule->FindRecord(self, strRecordName); - if (pRecord && strRecordName == NFrame::Guild::R_GuildMemberList()) - { - //add - const NFGUID& nPlayer = pRecord->GetObject(nRow, NFrame::Guild::GuildMemberList_GUID); - NFINT64 nGameID = pRecord->GetInt(nRow, NFrame::Guild::GuildMemberList_GameID); - - NFCDataList varSelf; - NFCDataList varGameID; - - varSelf << nPlayer; - varGameID << nGameID; - - NFCDataList varObject; - varObject << self; - m_pGameServerNet_ServerModule->OnObjectListLeave(varSelf, varObject); - - } - } - break; - case RECORD_EVENT_DATA::Swap: - { - //其实是2个row交换 - NFMsg::ObjectRecordSwap xSwapRecord; - *xSwapRecord.mutable_player_id() = NFINetModule::NFToPB(self); - - xSwapRecord.set_origin_record_name( strRecordName ); - xSwapRecord.set_target_record_name( strRecordName ); // 暂时没用 - xSwapRecord.set_row_origin( nRow ); - xSwapRecord.set_row_target( nCol ); - - for (int i = 0; i < valueBroadCaseList.GetCount(); ++i) - { - const NFGUID& xPlayerID = valueBroadCaseList.Object(i); - m_pGameServerNet_ServerModule->SendMsgPBToGate( NFMsg::EGMI_ACK_SWAP_ROW, xSwapRecord, xPlayerID); - } - } - break; - case RECORD_EVENT_DATA::Update: - { - //装备的过程中是不能更新的 - const int nCol = xEventData.nCol; - NF_SHARE_PTR pRecord = m_pKernelModule->FindRecord(self, strRecordName); - if (pRecord && strRecordName == NFrame::Guild::R_GuildMemberList()) - { - if (nCol == NFrame::Guild::GuildMemberList_Online && newVar.GetInt() > 0) - { - //add - const NFGUID& nPlayer = pRecord->GetObject(nRow, NFrame::Guild::GuildMemberList_GUID); - NFINT64 nGameID = pRecord->GetInt(nRow, NFrame::Guild::GuildMemberList_GameID); - - NFCDataList varSelf; - - varSelf << nPlayer; - - NFCDataList varObject; - varObject << self; - m_pGameServerNet_ServerModule->OnObjectListEnter(varSelf, varObject); - - - m_pGameServerNet_ServerModule->OnPropertyEnter(varSelf, self); - m_pGameServerNet_ServerModule->OnRecordEnter(varSelf, self); - } - } - - switch ( oldVar.GetType() ) - { - case TDATA_INT: - { - NFMsg::ObjectRecordInt xRecordChanged; - *xRecordChanged.mutable_player_id() = NFINetModule::NFToPB(self); - - xRecordChanged.set_record_name( strRecordName ); - NFMsg::RecordInt* recordProperty = xRecordChanged.add_property_list(); - recordProperty->set_row( nRow ); - recordProperty->set_col( nCol ); - int nData = newVar.GetInt(); - recordProperty->set_data( nData ); - - - for (int i = 0; i < valueBroadCaseList.GetCount(); ++i) - { - const NFGUID& xPlayerID = valueBroadCaseList.Object(i); - m_pGameServerNet_ServerModule->SendMsgPBToGate( NFMsg::EGMI_ACK_RECORD_INT, xRecordChanged, xPlayerID); - } - - } - break; - - case TDATA_FLOAT: - { - NFMsg::ObjectRecordFloat xRecordChanged; - *xRecordChanged.mutable_player_id() = NFINetModule::NFToPB(self); - - xRecordChanged.set_record_name( strRecordName ); - NFMsg::RecordFloat* recordProperty = xRecordChanged.add_property_list(); - recordProperty->set_row( nRow ); - recordProperty->set_col( nCol ); - recordProperty->set_data( newVar.GetFloat() ); - - for (int i = 0; i < valueBroadCaseList.GetCount(); ++i) - { - const NFGUID& xPlayerID = valueBroadCaseList.Object(i); - m_pGameServerNet_ServerModule->SendMsgPBToGate( NFMsg::EGMI_ACK_RECORD_FLOAT, xRecordChanged, xPlayerID); - } - - } - break; - case TDATA_STRING: - { - NFMsg::ObjectRecordString xRecordChanged; - *xRecordChanged.mutable_player_id() = NFINetModule::NFToPB(self); - - xRecordChanged.set_record_name( strRecordName ); - NFMsg::RecordString* recordProperty = xRecordChanged.add_property_list(); - recordProperty->set_row( nRow ); - recordProperty->set_col( nCol ); - recordProperty->set_data( newVar.GetString() ); - - - for (int i = 0; i < valueBroadCaseList.GetCount(); ++i) - { - const NFGUID& xPlayerID = valueBroadCaseList.Object(i); - m_pGameServerNet_ServerModule->SendMsgPBToGate( NFMsg::EGMI_ACK_RECORD_STRING, xRecordChanged, xPlayerID); - } - } - break; - case TDATA_OBJECT: - { - NFMsg::ObjectRecordObject xRecordChanged; - *xRecordChanged.mutable_player_id() = NFINetModule::NFToPB(self); - - xRecordChanged.set_record_name( strRecordName ); - NFMsg::RecordObject* recordProperty = xRecordChanged.add_property_list(); - recordProperty->set_row( nRow ); - recordProperty->set_col( nCol ); - *recordProperty->mutable_data() = NFINetModule::NFToPB(newVar.GetObject()); - - for (int i = 0; i < valueBroadCaseList.GetCount(); ++i) - { - const NFGUID& xPlayerID = valueBroadCaseList.Object(i); - m_pGameServerNet_ServerModule->SendMsgPBToGate( NFMsg::EGMI_ACK_RECORD_OBJECT, xRecordChanged, xPlayerID); - } - } - break; - - default: - return 0; - break; - } - } - break; - case RECORD_EVENT_DATA::Create: - return 0; - break; - case RECORD_EVENT_DATA::Cleared: - { - } - break; - default: - break; - } - - return 0; - } \ No newline at end of file diff --git a/NFServer/NFGameLogicPlugin/NFCGuildBroadcastModule.h b/NFServer/NFGameLogicPlugin/NFCGuildBroadcastModule.h deleted file mode 100644 index 7c655f4e23..0000000000 --- a/NFServer/NFGameLogicPlugin/NFCGuildBroadcastModule.h +++ /dev/null @@ -1,44 +0,0 @@ -// ------------------------------------------------------------------------- -// @FileName : NFIGuildBroadcastModule.h -// @Author : Chuanbo.Guo -// @Date : 2015-05-24 08:51 -// @Module : NFIGuildBroadcastModule -// -// ------------------------------------------------------------------------- - -#ifndef NFC_GUILD_BROADCAST_MODULE_H -#define NFC_GUILD_BROADCAST_MODULE_H - -#include "NFComm/NFCore/NFMap.h" -#include "NFComm/NFPluginModule/NFIKernelModule.h" -#include "NFComm/NFPluginModule/NFIGuildBroadcastModule.h" -#include "NFComm/NFPluginModule/NFIGuildDataModule.h" -#include "NFComm/NFPluginModule/NFIGuildModule.h" -#include "NFComm/NFPluginModule/NFIGameServerNet_ServerModule.h" - -class NFCGuildBroadcastModule - : public NFIGuildBroadcastModule -{ -public: - NFCGuildBroadcastModule(NFIPluginManager* p) - { - pPluginManager = p; - } - - virtual bool Init(); - virtual bool Shut(); - virtual bool Execute(); - virtual bool AfterInit(); - -protected: - //公会 - int OnPropertyCommonEvent( const NFGUID& self, const std::string& strPropertyName, const NFIDataList::TData& oldVar, const NFIDataList::TData& newVar); - int OnRecordCommonEvent( const NFGUID& self, const RECORD_EVENT_DATA& xEventData, const NFIDataList::TData& oldVar, const NFIDataList::TData& newVar ); - -protected: - NFIKernelModule* m_pKernelModule; - NFIGuildModule* m_pGuildModule; - NFIGameServerNet_ServerModule* m_pGameServerNet_ServerModule; -}; - -#endif \ No newline at end of file diff --git a/NFServer/NFGameLogicPlugin/NFCGuildDataModule.cpp b/NFServer/NFGameLogicPlugin/NFCGuildDataModule.cpp deleted file mode 100644 index a8bd28046e..0000000000 --- a/NFServer/NFGameLogicPlugin/NFCGuildDataModule.cpp +++ /dev/null @@ -1,350 +0,0 @@ -// ------------------------------------------------------------------------- -// @FileName : NFCGuildDataModule.cpp -// @Author : Chuanbo.Guo -// @Date : 2016-01-30 08:51 -// @Module : NFCGuildDataModule -// -// ------------------------------------------------------------------------- - -#include "NFGameLogicPlugin.h" -#include "NFCGuildDataModule.h" -#include "NFComm/Config/NFConfig.h" -#include "NFComm/NFPluginModule/NFPlatform.h" -#include "NFComm/NFMessageDefine/NFMsgShare.pb.h" -#include "NFComm/NFPluginModule/NFINetModule.h" -#include "NFComm/NFMessageDefine/NFProtocolDefine.hpp" - -bool NFCGuildDataModule::Init() -{ - return true; -} - -bool NFCGuildDataModule::Shut() -{ - return true; -} - -bool NFCGuildDataModule::Execute() -{ - return true; -} - -bool NFCGuildDataModule::AfterInit() -{ - m_pKernelModule = pPluginManager->FindModule(); - m_pMysqlModule = pPluginManager->FindModule(); - m_pPlayerMysqlModule = pPluginManager->FindModule(); - m_pCommonConfigModule = pPluginManager->FindModule(); - m_pScheduleModule = pPluginManager->FindModule(); - - m_pPlayerMysqlModule->RegisterAutoSave(NFrame::Guild::ThisName()); - m_pKernelModule->AddClassCallBack(NFrame::Guild::ThisName(), this, &NFCGuildDataModule::OnGuildClassEvent); - - int nScenceID = m_pCommonConfigModule->GetAttributeInt("GuildEctype", "GuildEctypeInfo", "ScenceID"); - if (nScenceID <=0) - { - nScenceID = 300; - m_pKernelModule->CreateScene(nScenceID); - } - - return true; -} - -bool NFCGuildDataModule::ExitGuild( const NFGUID& self, const std::string& strName, bool& bExit) -{ - if (!m_pMysqlModule->Exists(NFrame::GuildName::ThisName(), strName, bExit)) - { - return false; - } - - return true; -} - -void NFCGuildDataModule::CheckLoadGuild( const NFGUID& self, const NFGUID& xGuild ) -{ - NF_SHARE_PTR pObejct = m_pKernelModule->GetObject(xGuild); - if (!pObejct.get()) - { - m_pPlayerMysqlModule->LoadDataFormSqlAsy(xGuild, "Guild", this, &NFCGuildDataModule::HandleLoadGuildSuccess, ""); - } -} - -void NFCGuildDataModule::HandleLoadGuildSuccess(const NFGUID& xGuild, const int nResult, const std::string& strUseData) -{ - if (nResult == 0) - { - int nScenceID = m_pCommonConfigModule->GetAttributeInt("GuildEctype", "GuildEctypeInfo", "ScenceID"); - if (nScenceID <=0) - { - nScenceID = 300; - } - - m_pKernelModule->CreateObject(xGuild, nScenceID, 0, "Guild", "", NFCDataList()); - } -} - -int NFCGuildDataModule::OnGuildClassEvent( const NFGUID& self, const std::string& strClassName, const CLASS_OBJECT_EVENT eClassEvent, const NFIDataList& var ) -{ - if ( strClassName == "Guild" ) - { - if ( CLASS_OBJECT_EVENT::COE_CREATE_HASDATA == eClassEvent ) - { - m_pScheduleModule->AddSchedule(self, "OnSaveGuildheartEvent", this, &NFCGuildDataModule::OnSaveGuildheartEvent, 30, 99999); - } - } - - return 0; -} - - -const NFGUID NFCGuildDataModule::CreateGuild(const NFGUID& xPlayeID, const std::string& strName, const std::string& strRoleName, const int nLevel, const int nJob , const int nDonation , const int nVIP, const int nOffLine /*= 1*/, const int nPower/* = NFMsg::GUILD_POWER_TYPE_PRESIDENT*/) -{ - bool bExit = false; - if (!m_pMysqlModule->Exists(NFrame::GuildName::ThisName(), strName, bExit)) - { - return NULL_OBJECT; - } - - if (bExit) - { - return NULL_OBJECT; - } - - const NFGUID xGuidID = m_pKernelModule->CreateGUID(); - - //Guild - std::vector vGuildFieldVec; - std::vector vGuildValueVec; - - vGuildFieldVec.push_back("Name"); - vGuildValueVec.push_back(strName); - - vGuildFieldVec.push_back("GuildLevel"); - vGuildValueVec.push_back("1"); - - vGuildFieldVec.push_back("PresidentID"); - vGuildValueVec.push_back(xPlayeID.ToString()); - - vGuildFieldVec.push_back("PresidentName"); - vGuildValueVec.push_back(strRoleName); - - vGuildFieldVec.push_back("GuildMemeberMaxCount"); - vGuildValueVec.push_back("200"); - - if (!m_pMysqlModule->Updata(NFrame::Guild::ThisName(), xGuidID.ToString(), vGuildFieldVec, vGuildValueVec)) - { - return NULL_OBJECT; - } - - //Name - std::vector vFieldVec; - std::vector vValueVec; - - vFieldVec.push_back("GuildID"); - vValueVec.push_back(xGuidID.ToString()); - - m_pMysqlModule->Updata(NFrame::GuildName::ThisName(), strName, vFieldVec, vValueVec); - - return xGuidID; -} - -const bool NFCGuildDataModule::DeleteGuild(const NFGUID& xGuild ) -{ - NF_SHARE_PTR pGuilD = m_pKernelModule->GetObject(xGuild); - if (pGuilD.get()) - { - m_pKernelModule->DestroyObject(xGuild); - } - - bool bExit = false; - if (!m_pMysqlModule->Exists(NFrame::Guild::ThisName(), xGuild.ToString(), bExit) - || !bExit) - { - return false; - } - - std::vector vFieldVec; - std::vector vValueVec; - vFieldVec.push_back("Name"); - - if (!m_pMysqlModule->Query(NFrame::Guild::ThisName(), xGuild.ToString(), vFieldVec, vValueVec)) - { - return false; - } - - const std::string& strGuildName = vValueVec[0]; - bExit = false; - - if (!m_pMysqlModule->Exists(NFrame::GuildName::ThisName(), strGuildName, bExit) - || !bExit) - { - return false; - } - - if (!m_pMysqlModule->Delete(NFrame::Guild::ThisName(), xGuild.ToString())) - { - return false; - } - - return true; -} - -NF_SHARE_PTR NFCGuildDataModule::GetGuild( const NFGUID& xGuild ) -{ - CheckLoadGuild(NFGUID(), xGuild); - - return m_pKernelModule->GetObject(xGuild); -} - -bool NFCGuildDataModule::GetPlayerGuild( const NFGUID& self, NFGUID& xGuild ) -{ - std::vector vFieldVec; - std::vector vValueVec; - vFieldVec.push_back("GuildID"); - - if (!m_pMysqlModule->Query("Player", self.ToString(), vFieldVec, vValueVec)) - { - return false; - } - - const std::string& strGuildID = vValueVec[0]; - return xGuild.FromString(strGuildID); -} - -bool NFCGuildDataModule::SearchGuild( const NFGUID& self, const std::string& strName, std::vector& xList ) -{ - std::vector vValueName; - if (!m_pMysqlModule->Keys(NFrame::GuildName::ThisName(), strName, vValueName)) - { - return false; - } - - for (int i = 0; i < vValueName.size(); ++i) - { - const std::string& strGuildName = vValueName[i]; - - std::vector vFieldVec; - std::vector vValueVec; - - vFieldVec.push_back("GuildID"); - - if (!m_pMysqlModule->Query(NFrame::GuildName::ThisName(), strGuildName, vFieldVec, vValueVec)) - { - continue; - } - - NFGUID xGuild ; - xGuild.FromString(vValueVec[0]); - - SearchGuildObject xGuildInfo; - if (GetGuildInfo(self, xGuild, xGuildInfo)) - { - xList.push_back(xGuildInfo); - } - } - - return true; -} - -bool NFCGuildDataModule::GetGuildInfo( const NFGUID& self, const NFGUID& xGuild, SearchGuildObject& xGuildInfo ) -{ - std::vector vFieldVec; - std::vector vValueVec; - - vFieldVec.push_back("Name"); - vFieldVec.push_back("GuilIDIcon"); - vFieldVec.push_back("GuildMemeberCount"); - vFieldVec.push_back("GuildMemeberMaxCount"); - vFieldVec.push_back("GuildHonor"); - vFieldVec.push_back("Rank"); - - if (!m_pMysqlModule->Query(NFrame::Guild::ThisName(), xGuild.ToString(), vFieldVec, vValueVec)) - { - return false; - } - - const std::string& strGuildName = vValueVec[0]; - - int nGuildIconn = 0; - int nGuildMemeberCount = 0; - int nGuildMemeberMaxCount = 0; - int nGuildHonor = 0; - int nGuildRank = 0; - - NF_StrTo(vValueVec[1], nGuildIconn); - NF_StrTo(vValueVec[2], nGuildMemeberCount); - NF_StrTo(vValueVec[3], nGuildMemeberMaxCount); - NF_StrTo(vValueVec[4], nGuildHonor); - NF_StrTo(vValueVec[5], nGuildRank); - - xGuildInfo.mxGuildID = xGuild ; - xGuildInfo.mstrGuildName = strGuildName ; - xGuildInfo.mnGuildIcon = nGuildIconn ; - xGuildInfo.mnGuildMemberCount = nGuildMemeberCount ; - xGuildInfo.mnGuildMemberMaxCount = nGuildMemeberMaxCount ; - xGuildInfo.mnGuildHonor = nGuildHonor ; - xGuildInfo.mnGuildRank = nGuildRank ; - - return true; -} - -bool NFCGuildDataModule::GetPlayerInfo( const NFGUID& self, std::string& strRoleName, int& nLevel, int& nJob , int& nDonation , int& nVIP ) -{ - nDonation = 0;//这什么字段,还没加? - nVIP = 1; - std::vector vFieldVec; - std::vector vValueVec; - - vFieldVec.push_back("Name"); - vFieldVec.push_back("Level"); - vFieldVec.push_back("Job"); - - if (!m_pMysqlModule->Query( "Player", self.ToString(), vFieldVec, vValueVec)) - { - return false; - } - - if (!NF_StrTo(vValueVec[0], strRoleName)) - { - return false; - } - - if (!NF_StrTo(vValueVec[1], nLevel)) - { - return false; - } - - if (!NF_StrTo(vValueVec[2], nJob)) - { - return false; - } - - return true; -} - -bool NFCGuildDataModule::GetPlayerGameID( const NFGUID& self, int& nGameID ) -{ - std::vector xVecFeild; - std::vector xVecValue; - - xVecFeild.push_back("GameID"); - if (!m_pMysqlModule->Query("Player", self.ToString(), xVecFeild, xVecValue)) - { - return false; - } - - const std::string& strGameID = xVecValue[0]; - if (!NF_StrTo(strGameID, nGameID)) - { - return false; - } - - return true; -} - -int NFCGuildDataModule::OnSaveGuildheartEvent( const NFGUID& self , const std::string& strHeartName, const float fTime, const int nCount ) -{ - m_pPlayerMysqlModule->SaveDataToSql(self); - - return 0; -} diff --git a/NFServer/NFGameLogicPlugin/NFCGuildDataModule.h b/NFServer/NFGameLogicPlugin/NFCGuildDataModule.h deleted file mode 100644 index b1ec041c0c..0000000000 --- a/NFServer/NFGameLogicPlugin/NFCGuildDataModule.h +++ /dev/null @@ -1,66 +0,0 @@ -// ------------------------------------------------------------------------- -// @FileName : NFCGuildDataModule.h -// @Author : chuanbo.guo -// @Date : 2015-06-06 16:51 -// @Module : NFCGuildDataModule -// -// ------------------------------------------------------------------------- - -#ifndef NFC_GUILD_DATA_MODULE_H -#define NFC_GUILD_DATA_MODULE_H - -#include "NFComm/NFCore/NFMap.h" -#include "NFComm/NFPluginModule/NFIKernelModule.h" -#include "NFComm/NFPluginModule/NFIGuildDataModule.h" -#include "NFComm/NFPluginModule/NFIGameLogicModule.h" -#include "NFComm/NFMessageDefine/NFMsgBase.pb.h" -#include "NFComm/NFPluginModule/NFIPlayerMysqlModule.h" -#include "NFComm/NFPluginModule/NFICommonConfigModule.h" -#include "NFComm/NFPluginModule/NFIMysqlModule.h" -#include "NFComm/NFPluginModule/NFIScheduleModule.h" - -class NFCGuildDataModule - : public NFIGuildDataModule -{ -public: - NFCGuildDataModule(NFIPluginManager* p) - { - pPluginManager = p; - } - - virtual bool Init(); - virtual bool Shut(); - virtual bool Execute(); - - virtual bool AfterInit(); - - virtual bool ExitGuild(const NFGUID& self, const std::string& strName, bool& bExit); - virtual void CheckLoadGuild(const NFGUID& self, const NFGUID& xGuild); - virtual NF_SHARE_PTR GetGuild(const NFGUID& xGuild); - - virtual bool GetPlayerInfo(const NFGUID& self, std::string& strRoleName, int& nLevel, int& nJob , int& nDonation , int& nVIP); - virtual bool GetPlayerGuild(const NFGUID& self, NFGUID& xGuild); - virtual bool GetPlayerGameID( const NFGUID& self, int& nGameID ); - - virtual const NFGUID CreateGuild(const NFGUID& xPlayeID, const std::string& strName, const std::string& strRoleName, const int nLevel, const int nJob , const int nDonation , const int nVIP, const int nOffLine = 1, const int nPower = NFMsg::GUILD_POWER_TYPE_PRESIDENT); - virtual const bool DeleteGuild(const NFGUID& xGuild); - - virtual bool SearchGuild(const NFGUID& self, const std::string& strName, std::vector& xList); - virtual bool GetGuildInfo( const NFGUID& self, const NFGUID& xGuild, SearchGuildObject& xGuildInfo ); - -protected: - int OnGuildClassEvent( const NFGUID& self, const std::string& strClassName, const CLASS_OBJECT_EVENT eClassEvent, const NFIDataList& var ); - int OnSaveGuildheartEvent(const NFGUID& self , const std::string& strHeartName, const float fTime, const int nCount); - void HandleLoadGuildSuccess(const NFGUID& xGuild, const int nResult, const std::string& strUseData); - -protected: - NFIScheduleModule* m_pScheduleModule; - NFIKernelModule* m_pKernelModule; - NFIMysqlModule* m_pMysqlModule; - NFIPlayerMysqlModule* m_pPlayerMysqlModule; - NFICommonConfigModule* m_pCommonConfigModule; - -private: -}; - -#endif \ No newline at end of file diff --git a/NFServer/NFGameLogicPlugin/NFCGuildEctypeModule.cpp b/NFServer/NFGameLogicPlugin/NFCGuildEctypeModule.cpp deleted file mode 100644 index d293426790..0000000000 --- a/NFServer/NFGameLogicPlugin/NFCGuildEctypeModule.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// ------------------------------------------------------------------------- -// @FileName : NFCGuildEctypeModule.cpp -// @Author : LvSheng.Huang -// @Date : 2013-07-05 -// @Module : NFCGuildEctypeModule -// @Desc : -// ------------------------------------------------------------------------- - -#include "NFCGuildEctypeModule.h" -#include "Dependencies/RapidXML/rapidxml_utils.hpp" -#include "NFComm/NFMessageDefine/NFProtocolDefine.hpp" -#include "NFComm/NFPluginModule/NFINetModule.h" - -bool NFCGuildEctypeModule::Init() -{ - - return true; -} - - -bool NFCGuildEctypeModule::Shut() -{ - return true; -} - -bool NFCGuildEctypeModule::Execute() -{ - return true; -} - -bool NFCGuildEctypeModule::AfterInit() -{ - m_pSceneProcessModule = pPluginManager->FindModule(); - m_pGameServerNet_ServerModule = pPluginManager->FindModule(); - m_pKernelModule = pPluginManager->FindModule(); - m_pCommonConfigModule = pPluginManager->FindModule(); - m_pLogModule = pPluginManager->FindModule(); - m_pEventModule = pPluginManager->FindModule(); - - std::string strConfigPath = pPluginManager->GetConfigPath(); - - strConfigPath += "NFDataCfg/Ini/Common/GuildConfig.xml"; - m_pCommonConfigModule->LoadConfig(strConfigPath); - - if (!m_pGameServerNet_ServerModule->GetNetModule()->AddReceiveCallBack(NFMsg::EGMI_ReqEnterGuildEctype, this, &NFCGuildEctypeModule::OnApplyEnterGuilEctypeProcess)) { return false; } - - m_pKernelModule->AddClassCallBack(NFrame::Guild::ThisName(), this, &NFCGuildEctypeModule::OnGuildClassEvent); - - return true; -} - - -int NFCGuildEctypeModule::OnGuildClassEvent( const NFGUID& self, const std::string& strClassName, const CLASS_OBJECT_EVENT eClassEvent, const NFIDataList& var ) -{ - if ( strClassName == NFrame::Guild::ThisName() ) - { - if ( CLASS_OBJECT_EVENT::COE_CREATE_FINISH == eClassEvent ) - { - CreateGuilEctype(NFGUID(), self); - } - else if ( CLASS_OBJECT_EVENT::COE_BEFOREDESTROY == eClassEvent ) - { - DestroyGuildEctype(NFGUID(), self); - } - } - - return 0; -} - -bool NFCGuildEctypeModule::CreateGuilEctype(const NFGUID& self, const NFGUID& xGuild) -{ - if (xGuild.IsNull()) - { - return false; - } - - int nEctypeID = m_pCommonConfigModule->GetAttributeInt("GuildEctype", "GuildEctypeInfo", "EctypeID"); - int nNewGroupID = 0; - if (!m_pSceneProcessModule->ApplyCloneGroup(nEctypeID, nNewGroupID)) - { - return false; - } - - NF_SHARE_PTR pData(NF_NEW GuildEctypeInfo()); - pData->nEctypeID = m_pCommonConfigModule->GetAttributeInt("GuildEctype", "GuildEctypeInfo", "EctypeID"); - pData->nGroupID = nNewGroupID; - - if (!mmGuilEctype.AddElement(xGuild, pData)) - { - //Realse Clone - m_pKernelModule->ReleaseGroupScene(nEctypeID, nNewGroupID); - return false; - } - - NFCDataList varEntry; - varEntry << xGuild; - varEntry << NFINT64(0); - varEntry << pData->nEctypeID; - varEntry << pData->nGroupID; - m_pEventModule->DoEvent( xGuild, NFED_ON_CLIENT_ENTER_SCENE, varEntry ); - - return true; -} - -bool NFCGuildEctypeModule::ApplyEnterGuilEctype(const NFGUID& self, const NFGUID& guild) -{ - NF_SHARE_PTR pData = mmGuilEctype.GetElement(guild); - if (pData.get()) - { - NFCDataList varEntry; - varEntry << self; - varEntry << NFINT64(0); - varEntry << pData->nEctypeID; - varEntry << pData->nGroupID; - m_pEventModule->DoEvent( self, NFED_ON_CLIENT_ENTER_SCENE, varEntry ); - - return true; - } - - return false; -} - -bool NFCGuildEctypeModule::DestroyGuildEctype( const NFGUID& self, const NFGUID& xGuild ) -{ - if (xGuild.IsNull()) - { - return false; - } - - NF_SHARE_PTR pData = mmGuilEctype.GetElement(xGuild); - if (pData.get()) - { - //Realse Clone - m_pKernelModule->ReleaseGroupScene(pData->nEctypeID, pData->nGroupID); - - mmGuilEctype.RemoveElement(xGuild); - return true; - } - - return true; -} - -void NFCGuildEctypeModule::OnApplyEnterGuilEctypeProcess( const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen ) -{ - CLIENT_MSG_PROCESS_NO_OBJECT(nSockIndex, nMsgID, msg, nLen, NFMsg::ReqEnterGuildEctype); - - const NFGUID& xGuild = m_pKernelModule->GetPropertyObject(nPlayerID, NFrame::Player::GuildID()); - if (xGuild.IsNull()) - { - return ; - } - - if (!ApplyEnterGuilEctype(nPlayerID, xGuild)) - { - return; - } -} diff --git a/NFServer/NFGameLogicPlugin/NFCGuildEctypeModule.h b/NFServer/NFGameLogicPlugin/NFCGuildEctypeModule.h deleted file mode 100644 index b9d916829a..0000000000 --- a/NFServer/NFGameLogicPlugin/NFCGuildEctypeModule.h +++ /dev/null @@ -1,72 +0,0 @@ -// ------------------------------------------------------------------------- -// @FileName : NFCGuildEctypeModule.h -// @Author : LvSheng.Huang -// @Date : 2013-07-05 -// @Module : NFCGuildEctypeModule -// -// ------------------------------------------------------------------------- - -#ifndef NFC_GUILDECTYPE_MODULE_H -#define NFC_GUILDECTYPE_MODULE_H - -#include "NFComm/NFPluginModule/NFIGuildEctypeModule.h" -#include "NFComm/NFPluginModule/NFIPluginManager.h" -#include "NFComm/NFPluginModule/NFISceneProcessModule.h" -#include "NFComm/NFPluginModule/NFIGameServerToWorldModule.h" -#include "NFComm/NFPluginModule/NFIKernelModule.h" -#include "NFComm/NFPluginModule/NFICommonConfigModule.h" -#include "NFComm/NFPluginModule/NFIGameServerNet_ServerModule.h" -#include "NFComm/NFPluginModule/NFILogModule.h" -#include "NFComm/NFPluginModule/NFIEventModule.h" - -class NFCGuildEctypeModule - : public NFIGuildEctypeModule -{ -public: - struct GuildEctypeInfo - { - GuildEctypeInfo() - { - nEctypeID = 0; - nGroupID = 0; - } - - int nEctypeID; - int nGroupID; - }; -public: - NFCGuildEctypeModule( NFIPluginManager* p ) - { - pPluginManager = p; - } - virtual ~NFCGuildEctypeModule() {}; - - virtual bool Init(); - virtual bool Shut(); - virtual bool Execute(); - virtual bool AfterInit(); - - virtual bool CreateGuilEctype(const NFGUID& self, const NFGUID& guild); - virtual bool DestroyGuildEctype(const NFGUID& self, const NFGUID& guild); - virtual bool ApplyEnterGuilEctype(const NFGUID& self, const NFGUID& guild); - -protected: - int OnGuildClassEvent( const NFGUID& self, const std::string& strClassName, const CLASS_OBJECT_EVENT eClassEvent, const NFIDataList& var ); - -protected: - void OnApplyEnterGuilEctypeProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen); - -private: - NFISceneProcessModule* m_pSceneProcessModule; - NFIGameServerToWorldModule* m_pGameServerToWorldModule; - NFICommonConfigModule* m_pCommonConfigModule; - NFIGameServerNet_ServerModule* m_pGameServerNet_ServerModule; - NFILogModule* m_pLogModule; - - NFMapEx mmGuilEctype; - NFIKernelModule* m_pKernelModule; - NFIEventModule* m_pEventModule; -}; - - -#endif diff --git a/NFServer/NFGameLogicPlugin/NFCGuildModule.cpp b/NFServer/NFGameLogicPlugin/NFCGuildModule.cpp deleted file mode 100644 index 75a3dbdfaf..0000000000 --- a/NFServer/NFGameLogicPlugin/NFCGuildModule.cpp +++ /dev/null @@ -1,612 +0,0 @@ -// ------------------------------------------------------------------------- -// @FileName : NFCGuildModule.cpp -// @Author : chuanbo.guo -// @Date : 2015-05-24 08:51 -// @Module : NFCGuildModule -// -// ------------------------------------------------------------------------- - -#include "NFGameLogicPlugin.h" -#include "NFCGuildModule.h" -#include "NFComm/Config/NFConfig.h" -#include "NFComm/NFPluginModule/NFPlatform.h" -#include "NFComm/NFMessageDefine/NFMsgShare.pb.h" -#include "NFComm/NFPluginModule/NFINetModule.h" - -bool NFCGuildModule::Init() -{ - - - - return true; -} - -bool NFCGuildModule::Shut() -{ - return true; -} - -bool NFCGuildModule::Execute() -{ - return true; -} - -bool NFCGuildModule::AfterInit() -{ - m_pKernelModule = pPluginManager->FindModule(); - m_pGuildDataModule = pPluginManager->FindModule(); - m_pGameServerNet_ServerModule = pPluginManager->FindModule(); - m_pLogModule = pPluginManager->FindModule(); - m_pGameServerToWorldModule = pPluginManager->FindModule(); - - - m_pKernelModule->AddClassCallBack(NFrame::Player::ThisName(), this, &NFCGuildModule::OnPlayerClassEvent); - - if (!m_pGameServerNet_ServerModule->GetNetModule()->AddReceiveCallBack(NFMsg::EGMI_REQ_CREATE_GUILD, this, &NFCGuildModule::OnCreateGuildProcess)) { return false; } - if (!m_pGameServerNet_ServerModule->GetNetModule()->AddReceiveCallBack(NFMsg::EGMI_REQ_JOIN_GUILD, this, &NFCGuildModule::OnJoinGuildProcess)) { return false; } - if (!m_pGameServerNet_ServerModule->GetNetModule()->AddReceiveCallBack(NFMsg::EGMI_REQ_LEAVE_GUILD, this, &NFCGuildModule::OnLeaveGuildProcess)) { return false; } - if (!m_pGameServerNet_ServerModule->GetNetModule()->AddReceiveCallBack(NFMsg::EGMI_REQ_OPR_GUILD, this, &NFCGuildModule::OnOprGuildMemberProcess)) { return false; } - if (!m_pGameServerNet_ServerModule->GetNetModule()->AddReceiveCallBack(NFMsg::EGMI_REQ_SEARCH_GUILD, this, &NFCGuildModule::OnSearchGuildProcess)) { return false; } - - // - if (!m_pGameServerToWorldModule->GetClusterClientModule()->AddReceiveCallBack(NFMsg::EGMI_ACK_CREATE_GUILD, this, &NFCGuildModule::OnAckCreateGuildProcess)) { return false; } - if (!m_pGameServerToWorldModule->GetClusterClientModule()->AddReceiveCallBack(NFMsg::EGMI_ACK_JOIN_GUILD, this, &NFCGuildModule::OnAckJoinGuildProcess)) { return false; } - if (!m_pGameServerToWorldModule->GetClusterClientModule()->AddReceiveCallBack(NFMsg::EGMI_ACK_LEAVE_GUILD, this, &NFCGuildModule::OnAckLeaveGuildProcess)) { return false; } - - return true; -} - -const NFGUID& NFCGuildModule::CreateGuild( const NFGUID& self, const std::string& strName, const std::string& strRoleName, const int nLevel, const int nJob , const int nDonation , const int nVIP) -{ - if (strName.empty()) - { - return NULL_OBJECT; - } - - bool bExit = false; - if (!m_pGuildDataModule->ExitGuild(self, strName, bExit)) - { - return NULL_OBJECT; - } - - if (bExit) - { - return NULL_OBJECT; - } - - return m_pGuildDataModule->CreateGuild(self, strName, strRoleName, nLevel, nJob, nDonation, nVIP); -} - -bool NFCGuildModule::JoinGuild( const NFGUID& self, const NFGUID& xGuildID ) -{ - NF_SHARE_PTR pGuildObject = m_pGuildDataModule->GetGuild(xGuildID); - if (!pGuildObject.get()) - { - return false; - } - - NF_SHARE_PTR pMemberRecord = m_pKernelModule->FindRecord(xGuildID, "GuildMemberList"); - if (!pMemberRecord.get()) - { - return false; - } - - NFCDataList varList; - pMemberRecord->FindObject(NFrame::Guild::GuildMemberList_GUID, self, varList); - if (varList.GetCount() > 0) - { - return false; - } - - const NFINT64 nCount = m_pKernelModule->GetPropertyInt(xGuildID, "GuildMemeberCount"); - if (nCount >= m_pKernelModule->GetPropertyInt(xGuildID, "GuildMemeberMaxCount")) - { - //limit - return false; - } - - NFCDataList varData; - - std::string strName ; - int nLevel = 0; - int nJob = 0; - int nDonation = 0; - int nReceive = 0; - int nVIP = 0; - int nOnLine = 0; - int nPower = NFMsg::GUILD_POWER_TYPE_NORMAL; - - const NFGUID& xPresident = pGuildObject->GetPropertyObject("PresidentID"); - if (xPresident == self) - { - nPower = NFMsg::GUILD_POWER_TYPE_PRESIDENT; - } - - int nTitle = 0; - int nOnlineGameID = 0; - - m_pGuildDataModule->GetPlayerGameID(self, nOnlineGameID); - m_pGuildDataModule->GetPlayerInfo(self, strName, nLevel, nJob, nDonation, nVIP); - - varData << self << strName << (NFINT64)nLevel << (NFINT64)nJob << (NFINT64)nDonation << (NFINT64)nReceive << (NFINT64)nVIP << (NFINT64)nOnLine << (NFINT64)nPower << nTitle << nOnlineGameID ; - - if (pMemberRecord->AddRow(-1, varData) < 0) - { - return false; - } - - m_pKernelModule->SetPropertyInt(xGuildID, "GuildMemeberCount", nCount+1); - - return true; -} - -bool NFCGuildModule::LeaveGuild( const NFGUID& self, const NFGUID& xGuildID ) -{ - NF_SHARE_PTR pGuildObject = m_pGuildDataModule->GetGuild(xGuildID); - if (!pGuildObject.get()) - { - return false; - } - - NF_SHARE_PTR pMemberRecord = m_pKernelModule->FindRecord(xGuildID, "GuildMemberList"); - if (!pMemberRecord.get()) - { - return false; - } - - NFCDataList varList; - pMemberRecord->FindObject(NFrame::Guild::GuildMemberList_GUID, self, varList); - if (varList.GetCount() == 0) - { - return false; - } - - const int nRow = varList.Int(0); - - return pMemberRecord->Remove(nRow); -} - -bool NFCGuildModule::UpGuildMmember( const NFGUID& self, const NFGUID& xGuildID, const NFGUID& xMmember ) -{ - NF_SHARE_PTR pGuildObject = m_pGuildDataModule->GetGuild(xGuildID); - if (!pGuildObject.get()) - { - return false; - } - - NF_SHARE_PTR pMemberRecord = m_pKernelModule->FindRecord(xGuildID, "GuildMemberList"); - if (!pMemberRecord.get()) - { - return false; - } - - CheckPower(self, xGuildID, NFMsg::ReqAckOprGuildMember::EGAT_UP); - - NFCDataList varList; - pMemberRecord->FindObject(NFrame::Guild::GuildMemberList_GUID, self, varList); - if (varList.GetCount() == 0) - { - return false; - } - - const int nRow = varList.Int(0); - - const int nPower = pMemberRecord->GetInt(nRow, NFrame::Guild::GuildMemberList_Power); - - if (nPower >= NFMsg::GUILD_POWER_TYPE_PRESIDENT) - { - return false; - } - - pMemberRecord->SetInt(nRow, NFrame::Guild::GuildMemberList_Power, (nPower + 1)) ; - return true; -} - -bool NFCGuildModule::DownGuildMmember( const NFGUID& self, const NFGUID& xGuildID, const NFGUID& xMmember ) -{ - NF_SHARE_PTR pGuildObject = m_pGuildDataModule->GetGuild(xGuildID); - if (!pGuildObject.get()) - { - return false; - } - - NF_SHARE_PTR pMemberRecord = m_pKernelModule->FindRecord(xGuildID, "GuildMemberList"); - if (!pMemberRecord.get()) - { - return false; - } - - CheckPower(self, xGuildID, NFMsg::ReqAckOprGuildMember::EGAT_DOWN); - - NFCDataList varList; - pMemberRecord->FindObject(NFrame::Guild::GuildMemberList_GUID, self, varList); - if (varList.GetCount() == 0) - { - return false; - } - - const int nRow = varList.Int(0); - - const int nPower = pMemberRecord->GetInt(nRow, NFrame::Guild::GuildMemberList_Power); - if (nPower == 0) - { - return false; - } - - pMemberRecord->SetInt(nRow, NFrame::Guild::GuildMemberList_Power, (nPower - 1)); - return true; -} - -bool NFCGuildModule::KickGuildMmember( const NFGUID& self, const NFGUID& xGuildID, const NFGUID& xMmember ) -{ - NF_SHARE_PTR pGuildObject = m_pGuildDataModule->GetGuild(xGuildID); - if (!pGuildObject.get()) - { - return false; - } - - NF_SHARE_PTR pMemberRecord = m_pKernelModule->FindRecord(xGuildID, "GuildMemberList"); - if (!pMemberRecord.get()) - { - return false; - } - - if (self == xMmember) - { - return false; - } - - CheckPower(self, xGuildID, NFMsg::ReqAckOprGuildMember::EGAT_KICK); - - NFCDataList varList; - pMemberRecord->FindObject(NFrame::Guild::GuildMemberList_GUID, self, varList); - if (varList.GetCount() == 0) - { - return false; - } - - const int nRow = varList.Int(0); - pMemberRecord->Remove(nRow); - - return true; -} - -bool NFCGuildModule::CheckPower( const NFGUID& self, const NFGUID& xGuildID, int nPowerType ) -{ - NF_SHARE_PTR pGuildObject = m_pGuildDataModule->GetGuild(xGuildID); - if (pGuildObject.get()) - { - NF_SHARE_PTR pMemberRecord = m_pKernelModule->FindRecord(xGuildID, "GuildMemberList"); - if (pMemberRecord.get()) - { - NFCDataList varList; - pMemberRecord->FindObject(NFrame::Guild::GuildMemberList_GUID, self, varList); - if (varList.GetCount() == 1) - { - const int nRow = varList.Int(0); - const int nPower = pMemberRecord->GetInt(nRow, NFrame::Guild::GuildMemberList_Power); - if (nPower >= NFMsg::GUILD_POWER_TYPE_PRESIDENT) - { - return true; - } - } - } - } - - return false; -} - -bool NFCGuildModule::GetOnlineMember( const NFGUID& self, const NFGUID& xGuild, NFCDataList& varMemberList, NFCDataList& varGameList) -{ - NF_SHARE_PTR pGuildObject = m_pGuildDataModule->GetGuild(xGuild); - if (!pGuildObject.get()) - { - return false; - } - - NF_SHARE_PTR pMemberRecord = m_pKernelModule->FindRecord(xGuild, "GuildMemberList"); - if (!pMemberRecord.get()) - { - return false; - } - - for (int i = 0; i< pMemberRecord->GetRows(); i++) - { - if (!pMemberRecord->IsUsed(i)) - { - continue; - } - - const NFINT64 nOnline = pMemberRecord->GetInt(i, NFrame::Guild::GuildMemberList_Online); - const NFINT64 nGameID = pMemberRecord->GetInt(i, NFrame::Guild::GuildMemberList_GameID); - const NFGUID& xID = pMemberRecord->GetObject(i, NFrame::Guild::GuildMemberList_GUID); - if (nOnline > 0 && !xID.IsNull()) - { - - varMemberList.Add(xID); - varGameList.Add(nGameID); - } - } - - return true; -} - -bool NFCGuildModule::MemberOnline( const NFGUID& self, const NFGUID& xGuild , const int& nGameID) -{ - NF_SHARE_PTR pGuildObject = m_pGuildDataModule->GetGuild(xGuild); - if (!pGuildObject.get()) - { - return false; - } - - NF_SHARE_PTR pMemberRecord = m_pKernelModule->FindRecord(xGuild, "GuildMemberList"); - if (!pMemberRecord.get()) - { - return false; - } - - NFCDataList varList; - pMemberRecord->FindObject(NFrame::Guild::GuildMemberList_GUID, self, varList); - if (varList.GetCount() <= 0) - { - return false; - } - - const int nRow = varList.Int(0); - pMemberRecord->SetInt(nRow, NFrame::Guild::GuildMemberList_GameID, nGameID); - - pMemberRecord->SetInt(nRow, NFrame::Guild::GuildMemberList_Online, 1); - - return true; -} - -bool NFCGuildModule::MemberOffeline( const NFGUID& self, const NFGUID& xGuild ) -{ - NF_SHARE_PTR pGuildObject = m_pGuildDataModule->GetGuild(xGuild); - if (!pGuildObject.get()) - { - return false; - } - - - NF_SHARE_PTR pMemberRecord = m_pKernelModule->FindRecord(xGuild, "GuildMemberList"); - if (!pMemberRecord.get()) - { - return false; - } - - NFCDataList varList; - pMemberRecord->FindObject(NFrame::Guild::GuildMemberList_GUID, self, varList); - if (varList.GetCount() <= 0) - { - return false; - } - - const int nRow = varList.Int(0); - pMemberRecord->SetInt(nRow, NFrame::Guild::GuildMemberList_Online, 0); - pMemberRecord->SetInt(nRow, NFrame::Guild::GuildMemberList_GameID, 0); - return true; -} - - -void NFCGuildModule::OnCreateGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen) -{ - CLIENT_MSG_PROCESS_NO_OBJECT(nSockIndex, nMsgID, msg, nLen, NFMsg::ReqAckCreateGuild); - - std::string strRoleName ; - int nLevel = 0; - int nJob = 0; - int nDonation= 0; - int nVIP= 0; - - m_pGuildDataModule->GetPlayerInfo(nPlayerID, strRoleName, nLevel, nJob, nDonation, nVIP); - NFGUID xGuild = CreateGuild(nPlayerID, xMsg.guild_name(), strRoleName, nLevel, nJob, nDonation, nVIP); - - if (!xGuild.IsNull()) - { - NFMsg::ReqAckCreateGuild xAck; - *xAck.mutable_guild_id() = NFINetModule::NFToPB(xGuild); - xAck.set_guild_name(xMsg.guild_name()); - - m_pGameServerNet_ServerModule->GetNetModule()->SendMsgPB(NFMsg::EGMI_ACK_CREATE_GUILD, xAck, nSockIndex, nPlayerID); - } - else - { - NFMsg::ReqAckCreateGuild xAck; - *xAck.mutable_guild_id() = NFINetModule::NFToPB(xGuild); - xAck.set_guild_name(""); - - m_pGameServerNet_ServerModule->GetNetModule()->SendMsgPB(NFMsg::EGMI_ACK_CREATE_GUILD, xAck, nSockIndex, nPlayerID); - } -} - -void NFCGuildModule::OnJoinGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen) -{ - CLIENT_MSG_PROCESS_NO_OBJECT(nSockIndex, nMsgID, msg, nLen,NFMsg::ReqAckJoinGuild) - - if (JoinGuild(nPlayerID, NFINetModule::PBToNF(xMsg.guild_id()))) - { - NFMsg::ReqAckJoinGuild xAck; - *xAck.mutable_guild_id() = xMsg.guild_id(); - - NFGUID xGuild = NFINetModule::PBToNF(xMsg.guild_id()); - const std::string& strName = m_pKernelModule->GetPropertyString(xGuild, "Name"); - xAck.set_guild_name(strName); - - m_pGameServerNet_ServerModule->GetNetModule()->SendMsgPB(NFMsg::EGMI_ACK_JOIN_GUILD, xAck, nSockIndex, nPlayerID); - - int nGameID = 0; - if(m_pGuildDataModule->GetPlayerGameID(nPlayerID, nGameID)) - { - MemberOnline(nPlayerID, xGuild, nGameID); - } - } - else - { - NFMsg::ReqAckJoinGuild xAck; - *xAck.mutable_guild_id() = NFINetModule::NFToPB(NFGUID()); - xAck.set_guild_name(""); - - m_pGameServerNet_ServerModule->GetNetModule()->SendMsgPB(NFMsg::EGMI_ACK_JOIN_GUILD, xAck, nSockIndex, nPlayerID); - } -} - -void NFCGuildModule::OnLeaveGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen) -{ - CLIENT_MSG_PROCESS_NO_OBJECT(nSockIndex, nMsgID, msg, nLen,NFMsg::ReqAckLeaveGuild) - - if (LeaveGuild(nPlayerID, NFINetModule::PBToNF(xMsg.guild_id()))) - { - - NFMsg::ReqAckLeaveGuild xAck; - *xAck.mutable_guild_id() = xMsg.guild_id(); - xAck.set_guild_name(xMsg.guild_name()); - - m_pGameServerNet_ServerModule->GetNetModule()->SendMsgPB(NFMsg::EGMI_ACK_LEAVE_GUILD, xAck, nSockIndex, nPlayerID); - } - else - { - NFMsg::ReqAckLeaveGuild xAck; - *xAck.mutable_guild_id() = NFINetModule::NFToPB(NFGUID()); - xAck.set_guild_name(""); - - m_pGameServerNet_ServerModule->GetNetModule()->SendMsgPB(NFMsg::EGMI_ACK_LEAVE_GUILD, xAck, nSockIndex, nPlayerID); - } -} - -void NFCGuildModule::OnOprGuildMemberProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen) -{ - CLIENT_MSG_PROCESS_NO_OBJECT(nSockIndex, nMsgID, msg, nLen,NFMsg::ReqAckOprGuildMember) - - NFMsg::ReqAckOprGuildMember::EGGuildMemberOprType eOprType = xMsg.type(); - switch (eOprType) - { - case NFMsg::ReqAckOprGuildMember::EGGuildMemberOprType::ReqAckOprGuildMember_EGGuildMemberOprType_EGAT_UP: - UpGuildMmember(nPlayerID, NFINetModule::PBToNF(xMsg.guild_id()), NFINetModule::PBToNF(xMsg.member_id())); - break; - case NFMsg::ReqAckOprGuildMember::EGGuildMemberOprType::ReqAckOprGuildMember_EGGuildMemberOprType_EGAT_DOWN: - DownGuildMmember(nPlayerID, NFINetModule::PBToNF(xMsg.guild_id()), NFINetModule::PBToNF(xMsg.member_id())); - break; - case NFMsg::ReqAckOprGuildMember::EGGuildMemberOprType::ReqAckOprGuildMember_EGGuildMemberOprType_EGAT_KICK: - KickGuildMmember(nPlayerID, NFINetModule::PBToNF(xMsg.guild_id()), NFINetModule::PBToNF(xMsg.member_id())); - break; - default: - break; - } - -} - -void NFCGuildModule::OnSearchGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen) -{ - CLIENT_MSG_PROCESS_NO_OBJECT(nSockIndex, nMsgID, msg, nLen,NFMsg::ReqSearchGuild); - - std::vector xList; - m_pGuildDataModule->SearchGuild(nPlayerID, xMsg.guild_name(), xList); - - NFMsg::AckSearchGuild xAckMsg; - for (int i = 0; i < xList.size(); ++i) - { - NFMsg::AckSearchGuild::SearchGuildObject* pData = xAckMsg.add_guild_list(); - if (pData) - { - const NFIGuildDataModule::SearchGuildObject& xGuild = xList[i]; - *pData->mutable_guild_id() = NFINetModule::NFToPB(xGuild.mxGuildID); - pData->set_guild_name(xGuild.mstrGuildName); - pData->set_guild_icon(xGuild.mnGuildIcon); - - pData->set_guild_member_count(xGuild.mnGuildMemberCount); - pData->set_guild_member_max_count(xGuild.mnGuildMemberMaxCount); - pData->set_guild_honor(xGuild.mnGuildHonor); - pData->set_guild_rank(xGuild.mnGuildRank); - } - } - - m_pGameServerNet_ServerModule->GetNetModule()->SendMsgPB(NFMsg::EGMI_ACK_SEARCH_GUILD, xAckMsg, nSockIndex, nPlayerID); -} - - -void NFCGuildModule::OnAckCreateGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen) -{ - NFGUID nPlayerID; - NFMsg::ReqAckCreateGuild xData; - if (!NFINetModule::ReceivePB(nSockIndex, nMsgID, msg, nLen, xData, nPlayerID)) - { - return; - } - - NFGUID xGuild = NFINetModule::PBToNF(xData.guild_id()); - m_pKernelModule->SetPropertyObject(nPlayerID, "GuildID", xGuild); - - m_pGameServerNet_ServerModule->SendMsgPBToGate(nMsgID, xData, nPlayerID); - - // - NFMsg::ReqAckJoinGuild xJoinMsg; - *xJoinMsg.mutable_guild_id() = NFINetModule::NFToPB(xGuild); - xJoinMsg.set_guild_name(xData.guild_name()); - - m_pGameServerToWorldModule->GetClusterClientModule()->SendSuitByPB(xGuild.nData64, NFMsg::EGameMsgID::EGMI_REQ_JOIN_GUILD, xJoinMsg); -} - -void NFCGuildModule::OnAckJoinGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen) -{ - NFGUID nPlayerID; - NFMsg::ReqAckJoinGuild xData; - if (!NFINetModule::ReceivePB(nSockIndex, nMsgID, msg, nLen, xData, nPlayerID)) - { - return; - } - - NFGUID xGuild = NFINetModule::PBToNF(xData.guild_id()); - if (!xGuild.IsNull()) - { - m_pKernelModule->SetPropertyObject(nPlayerID, "GuildID", xGuild); - } - - m_pGameServerNet_ServerModule->SendMsgPBToGate(nMsgID, xData, nPlayerID); - -} - -void NFCGuildModule::OnAckLeaveGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen) -{ - NFGUID nPlayerID; - NFMsg::ReqAckLeaveGuild xData; - if (!NFINetModule::ReceivePB(nSockIndex, nMsgID, msg, nLen, xData, nPlayerID)) - { - return; - } - - m_pKernelModule->SetPropertyObject(nPlayerID, "GuildID", NFGUID()); - - m_pGameServerNet_ServerModule->SendMsgPBToGate(nMsgID, xData, nPlayerID); - -} - - -int NFCGuildModule::OnPlayerClassEvent( const NFGUID& self, const std::string& strClassName, const CLASS_OBJECT_EVENT eClassEvent, const NFIDataList& var ) -{ - if ( strClassName == NFrame::Guild::ThisName() ) - { - if ( CLASS_OBJECT_EVENT::COE_CREATE_FINISH == eClassEvent ) - { - const NFGUID xGuild = m_pKernelModule->GetPropertyObject(self, NFrame::Player::GuildID()); - if (xGuild.IsNull()) - { - mmNoneGuildPlayerList.AddElement(self, NF_SHARE_PTR(NF_NEW int(0))); - - m_pKernelModule->AddPropertyCallBack(self, NFrame::Player::GuildID(), this, &NFCGuildModule::OnObjectGuildIDEvent); - } - } - } - - return 0; -} - -int NFCGuildModule::OnObjectGuildIDEvent( const NFGUID& self, const std::string& strPropertyName, const NFIDataList::TData& oldVar, const NFIDataList::TData& newVar) -{ - if ( !newVar.GetObject().IsNull()) - { - mmNoneGuildPlayerList.RemoveElement(self); - } - - return 0; -} diff --git a/NFServer/NFGameLogicPlugin/NFCGuildModule.h b/NFServer/NFGameLogicPlugin/NFCGuildModule.h deleted file mode 100644 index 48df01942b..0000000000 --- a/NFServer/NFGameLogicPlugin/NFCGuildModule.h +++ /dev/null @@ -1,73 +0,0 @@ -// ------------------------------------------------------------------------- -// @FileName : NFCGuildModule.h -// @Author : Chuanbo.Guo -// @Date : 2016-01-30 08:51 -// @Module : NFCGuildModule -// -// ------------------------------------------------------------------------- - -#ifndef NFC_GUILD_MODULE_H -#define NFC_GUILD_MODULE_H - -#include "NFComm/NFCore/NFMap.h" -#include "NFComm/NFPluginModule/NFIKernelModule.h" -#include "NFComm/NFPluginModule/NFIGuildModule.h" -#include "NFComm/NFPluginModule/NFIGuildDataModule.h" -#include "NFComm/NFPluginModule/NFILogModule.h" -#include "NFComm/NFPluginModule/NFIGameServerNet_ServerModule.h" -#include "NFComm/NFPluginModule/NFIGuildRedisModule.h" -#include "NFComm/NFPluginModule/NFIGameServerToWorldModule.h" - -class NFCGuildModule - : public NFIGuildModule -{ -public: - NFCGuildModule(NFIPluginManager* p) - { - pPluginManager = p; - } - - virtual bool Init(); - virtual bool Shut(); - virtual bool Execute(); - - virtual bool AfterInit(); - - virtual const NFGUID& CreateGuild( const NFGUID& self, const std::string& strName, const std::string& strRoleName, const int nLevel, const int nJob , const int nDonation , const int nVIP); - virtual bool JoinGuild(const NFGUID& self, const NFGUID& xGuildID); - virtual bool LeaveGuild(const NFGUID& self, const NFGUID& xGuildID); - virtual bool UpGuildMmember(const NFGUID& self, const NFGUID& xGuildID, const NFGUID& xMmember); - virtual bool DownGuildMmember(const NFGUID& self, const NFGUID& xGuildID, const NFGUID& xMmember); - virtual bool KickGuildMmember(const NFGUID& self, const NFGUID& xGuildID, const NFGUID& xMmember); - - virtual bool GetOnlineMember(const NFGUID& self, const NFGUID& xGuild, NFCDataList& varMemberList, NFCDataList& varGameList); - virtual bool MemberOnline(const NFGUID& self, const NFGUID& xGuild, const int& nGameID); - virtual bool MemberOffeline(const NFGUID& self, const NFGUID& xGuild); - -protected: - void OnCreateGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen); - void OnJoinGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen); - void OnLeaveGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen); - void OnOprGuildMemberProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen); - void OnSearchGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen); - - void OnAckCreateGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen); - void OnAckJoinGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen); - void OnAckLeaveGuildProcess(const int nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen); - -protected: - bool CheckPower(const NFGUID& self, const NFGUID& xGuildID, int nPowerType); - int OnPlayerClassEvent( const NFGUID& self, const std::string& strClassName, const CLASS_OBJECT_EVENT eClassEvent, const NFIDataList& var ); - int OnObjectGuildIDEvent( const NFGUID& self, const std::string& strPropertyName, const NFIDataList::TData& oldVar, const NFIDataList::TData& newVar); -protected: - NFIKernelModule* m_pKernelModule; - NFIGuildDataModule* m_pGuildDataModule; - NFIGameServerNet_ServerModule* m_pGameServerNet_ServerModule; - NFIGameServerToWorldModule* m_pGameServerToWorldModule; - NFILogModule* m_pLogModule; - - NFMapEx mmNoneGuildPlayerList; - -}; - -#endif \ No newline at end of file diff --git a/NFServer/NFGameLogicPlugin/NFGameLogicPlugin.vcxproj b/NFServer/NFGameLogicPlugin/NFGameLogicPlugin.vcxproj index 53719b42ca..5230f4a2bd 100644 --- a/NFServer/NFGameLogicPlugin/NFGameLogicPlugin.vcxproj +++ b/NFServer/NFGameLogicPlugin/NFGameLogicPlugin.vcxproj @@ -113,10 +113,6 @@ - - - - @@ -156,10 +152,6 @@ - - - - diff --git a/NFServer/NFGameLogicPlugin/NFGameLogicPlugin.vcxproj.filters b/NFServer/NFGameLogicPlugin/NFGameLogicPlugin.vcxproj.filters index 92cc64d0c2..0dee829525 100644 --- a/NFServer/NFGameLogicPlugin/NFGameLogicPlugin.vcxproj.filters +++ b/NFServer/NFGameLogicPlugin/NFGameLogicPlugin.vcxproj.filters @@ -38,9 +38,6 @@ {15121c6f-c078-4629-81c4-7bac017e056f} - - {758bd285-309d-45a8-8950-aa2abb0a6d78} - {9c627c80-9536-4c28-8b31-2dc81cfd2d6e} @@ -96,18 +93,6 @@ NFCommonConfigModule - - NFGuildModule - - - NFGuildModule - - - NFGuildModule - - - NFGuildModule - NFGMModule @@ -194,18 +179,6 @@ NFCommonConfigModule - - NFGuildModule - - - NFGuildModule - - - NFGuildModule - - - NFGuildModule - NFGMModule diff --git a/NFServer/NFWorldLogicPlugin/NFCTeamModule.cpp b/NFServer/NFWorldLogicPlugin/NFCTeamModule.cpp index 1e1f427055..fee7ee017f 100644 --- a/NFServer/NFWorldLogicPlugin/NFCTeamModule.cpp +++ b/NFServer/NFWorldLogicPlugin/NFCTeamModule.cpp @@ -35,7 +35,6 @@ bool NFCTeamModule::AfterInit() { m_pKernelModule = pPluginManager->FindModule(); m_pCommonRedisModule = pPluginManager->FindModule(); - m_pMysqlModule = pPluginManager->FindModule(); m_pWorldNet_ServerModule = pPluginManager->FindModule(); m_pLogModule = pPluginManager->FindModule(); m_pPlayerRedisModule = pPluginManager->FindModule(); @@ -251,18 +250,9 @@ bool NFCTeamModule::GetPlayerGameID(const NFGUID& self, int& nGameID) std::vector xVecValue; xVecFeild.push_back("GameID"); - if (!m_pMysqlModule->Query("Player", self.ToString(), xVecFeild, xVecValue)) - { - return false; - } + nGameID = m_pPlayerRedisModule->GetPlayerCacheGameID(self); - const std::string& strGameID = xVecValue[0]; - if (!NF_StrTo(strGameID, nGameID)) - { - return false; - } - - return true; + return true; } diff --git a/NFServer/NFWorldLogicPlugin/NFCTeamModule.h b/NFServer/NFWorldLogicPlugin/NFCTeamModule.h index 2d076a0de1..959832498c 100644 --- a/NFServer/NFWorldLogicPlugin/NFCTeamModule.h +++ b/NFServer/NFWorldLogicPlugin/NFCTeamModule.h @@ -16,7 +16,6 @@ #include "NFComm/NFPluginModule/NFIGameServerNet_ServerModule.h" #include "NFComm/NFPluginModule/NFIWorldNet_ServerModule.h" #include "NFComm/NFPluginModule/NFICommonRedisModule.h" -#include "NFComm/NFPluginModule/NFIMysqlModule.h" #include "NFComm/NFPluginModule/NFIPlayerRedisModule.h" class NFCTeamModule @@ -59,7 +58,6 @@ class NFCTeamModule NFIWorldNet_ServerModule* m_pWorldNet_ServerModule; NFILogModule* m_pLogModule; NFICommonRedisModule* m_pCommonRedisModule; - NFIMysqlModule* m_pMysqlModule; NFIPlayerRedisModule* m_pPlayerRedisModule; };