各位大哥 我事新人大家帮我看看这段代码错在那里
编译时错误提示:error C2039: “szPassword” : 不是“CMD_GF_BankStorage”的成员 AttemperEngineSink.cpp 行3422就是下面代码中红色地方
------------------------------------------------------------------------------------------------------------------
//存储事件
bool CAttemperEngineSink::OnEventBankStorage(const void * pData, WORD wDataSize, DWORD dwSocketID)
{
//参数验证
ASSERT( sizeof(CMD_GF_BankStorage) == wDataSize );
if ( sizeof(CMD_GF_BankStorage) != wDataSize ) return false;
//获取玩家
IServerUserItem * pIServerUserItem=GetServerUserItem(LOWORD(dwSocketID));
ASSERT(pIServerUserItem!=NULL);
if(pIServerUserItem==NULL) return false;
tagServerUserData *pServerUserData = pIServerUserItem->GetUserData();
//判断状态
if(m_pGameServiceOption->wServerType==GAME_GENRE_GOLD)
{
if(pServerUserData->wTableID!=INVALID_TABLE)
{
SendRoomMessage(dwSocketID,TEXT("请退出游戏后,再进行存储操作!"),SMT_EJECT);
return true;
}
}
//类型转换
CMD_GF_BankStorage *pBankStorage= (CMD_GF_BankStorage*)pData;
LONG lGameGold = pServerUserData->UserScoreInfo.lGameGold;
//效验数据
ASSERT(pBankStorage->lStorageValue>0 && pBankStorage->lStorageValue<=lGameGold);
if(!(pBankStorage->lStorageValue>0 && pBankStorage->lStorageValue<=lGameGold))return false;
//密码效验
if (lstrcmp(pIServerUserItem->GetPassword(),pBankStorage->szPassword)!=0)
{
SendRoomMessage(dwSocketID,TEXT("密码有误,请查证后再次尝试操作!"),SMT_EJECT);
return true;
}
//修改金币
ModifyGameGold(pIServerUserItem,-pBankStorage->lStorageValue);
//修改帐款
ModifyBankStorageGold(pIServerUserItem,pBankStorage->lStorageValue);
SendRoomMessage(dwSocketID,TEXT("存储成功!"),SMT_EJECT);
//变量定义
DBR_GR_BankStorage BankStorage;
ZeroMemory(&BankStorage, sizeof(BankStorage));
BankStorage.lStorageCount = pBankStorage->lStorageValue;
BankStorage.dwUserID = pServerUserData->dwUserID;
BankStorage.dwClientIP = pIServerUserItem->GetClientIP();
//投递请求
m_pIDataBaseEngine->PostDataBaseRequest(DBR_GR_BANK_STORAGE_GOLD,0,&BankStorage, sizeof(BankStorage));
return true;
}
[ 本帖最后由 longwanyun 于 2011-11-3 11:14 编辑 ]