Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
#ifndef _DEPOSIT_CONTAINER_H_
|
||||
#define _DEPOSIT_CONTAINER_H_
|
||||
|
||||
#include <climits>
|
||||
#include "ItemContainer.h"
|
||||
#include <Network/Packet/PacketStruct/CharItemPacket.h>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
class CSendStream;
|
||||
class CCharacter;
|
||||
|
||||
namespace Item
|
||||
{
|
||||
class CDepositContainer : public CItemContainer
|
||||
{
|
||||
public:
|
||||
|
||||
CDepositContainer();
|
||||
virtual ~CDepositContainer();
|
||||
bool Initialize(CCharacter* lpCharacter,
|
||||
unsigned char nXSize, unsigned char nYSize, unsigned char nTabNum);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Լ<EFBFBD>
|
||||
virtual CItem* GetItem(ItemPos itemPos);
|
||||
virtual bool SetItem(ItemPos itemPos, CItem* lpItem);
|
||||
virtual bool RemoveItem(ItemPos itemPos);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD>
|
||||
inline bool Login(const char* szPassword, size_t nPasswordLength, char bSavePassword);
|
||||
inline bool IsLogin() { return m_bLoginSuccess; }
|
||||
inline void Logout() { if(m_bLoginSuccess) { m_bLoginSuccess = false; } }
|
||||
|
||||
inline bool IsPasswordSaved() { return (0 != (m_dwTabFlag & PktDepositUpdateDB::SAVED_PASSWORD)); }
|
||||
inline void SetPassword(const char* szPassword, size_t nPasswordLength);
|
||||
bool ChangePassword(const char* szCurrentPassword, size_t nCurrentPasswordLength,
|
||||
const char* szChangePassword, size_t nChangePasswordLength);
|
||||
|
||||
// NULL-Terminated<65><64> <20>ƴ<EFBFBD>!
|
||||
inline const unsigned char* GetPassword() const { return m_szPassword; }
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD>
|
||||
inline unsigned long GetGold() const { return m_dwGold; }
|
||||
bool AddGold(unsigned long dwGold);
|
||||
bool DeductGold(unsigned long dwGold);
|
||||
|
||||
// Flag<61><67><EFBFBD><EFBFBD> <20>Լ<EFBFBD>. Tab1<62><31> <20><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
inline void SetTabFlag(unsigned long dwTabFlag);
|
||||
inline unsigned long GetTabFlag() const { return m_dwTabFlag; }
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD>.
|
||||
inline bool BuyTab(unsigned char cTabNum);
|
||||
|
||||
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Լ<EFBFBD>
|
||||
inline CItemContainer* GetTab(unsigned char nTabNum);
|
||||
inline unsigned char GetMaxTabNum() const { return m_nTabNum; }
|
||||
|
||||
// Serialize In.
|
||||
virtual bool SerializeIn(const char* szItemBuffer_In, unsigned long dwBufferSize_In);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
virtual void DumpItemInfo();
|
||||
|
||||
// â<><C3A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ
|
||||
bool ClientUpdate(CSendStream& ClientSendStream);
|
||||
bool DBUpdate(CSendStream& AgentSendStream);
|
||||
bool LogUpdate(char* szLogBuffer_Out, unsigned long& dwBufferSize_InOut);
|
||||
|
||||
private:
|
||||
|
||||
bool Update(CSendStream& SendStream);
|
||||
|
||||
void DestroyDepositContainer();
|
||||
|
||||
// Serialize Out<75><74> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>, <20>Ǻ<EFBFBD><C7BA><EFBFBD> SerializeOut<75>Ѵ<EFBFBD>.
|
||||
virtual bool SerializeOut(char* szItemBuffer_Out, unsigned long& dwBufferSize_InOut) const { return false; }
|
||||
|
||||
CArrayContainer* m_lpArrayContainer;
|
||||
CCharacter* m_lpOwner;
|
||||
|
||||
unsigned long m_dwTabFlag;
|
||||
unsigned long m_dwGold;
|
||||
|
||||
unsigned char m_szPassword[Deposit::PASSWORD_LENGTH];
|
||||
|
||||
unsigned char m_nXSize;
|
||||
unsigned char m_nYSize;
|
||||
unsigned char m_nTabNum;
|
||||
bool m_bLoginSuccess;
|
||||
};
|
||||
};
|
||||
|
||||
Item::CItemContainer* Item::CDepositContainer::GetTab(unsigned char nTabNum)
|
||||
{
|
||||
return (nTabNum < m_nTabNum && NULL != m_lpArrayContainer) ?
|
||||
&m_lpArrayContainer[nTabNum] : NULL;
|
||||
}
|
||||
|
||||
|
||||
inline void Item::CDepositContainer::SetTabFlag(unsigned long dwTabFlag)
|
||||
{
|
||||
m_dwTabFlag = dwTabFlag | PktDepositUpdateDB::ITEM_TAB1;
|
||||
|
||||
if(0 == memcmp(m_szPassword, "0000", Deposit::PASSWORD_LENGTH) && 0 == (m_dwTabFlag & PktDepositUpdateDB::USED_DEPOSIT))
|
||||
{
|
||||
m_dwTabFlag &= ~PktDepositUpdateDB::USED_DEPOSIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dwTabFlag |= PktDepositUpdateDB::USED_DEPOSIT;
|
||||
}
|
||||
}
|
||||
|
||||
inline void Item::CDepositContainer::SetPassword(const char* szPassword, size_t nPasswordLength)
|
||||
{
|
||||
memcpy(m_szPassword, szPassword,
|
||||
(Deposit::PASSWORD_LENGTH < nPasswordLength) ? Deposit::PASSWORD_LENGTH : nPasswordLength);
|
||||
}
|
||||
|
||||
inline bool Item::CDepositContainer::Login(const char* szPassword, size_t nPasswordLength, char bSavePassword)
|
||||
{
|
||||
if(0 == memcmp(m_szPassword, szPassword,
|
||||
(Deposit::PASSWORD_LENGTH < nPasswordLength) ? Deposit::PASSWORD_LENGTH : nPasswordLength))
|
||||
{
|
||||
m_bLoginSuccess = true;
|
||||
if(0 != bSavePassword)
|
||||
{
|
||||
m_dwTabFlag |= PktDepositUpdateDB::SAVED_PASSWORD;
|
||||
}
|
||||
|
||||
m_dwTabFlag |= PktDepositUpdateDB::USED_DEPOSIT;
|
||||
}
|
||||
|
||||
return m_bLoginSuccess;
|
||||
}
|
||||
|
||||
inline bool Item::CDepositContainer::BuyTab(unsigned char cTabNum)
|
||||
{
|
||||
if(cTabNum < m_nTabNum)
|
||||
{
|
||||
m_dwTabFlag |= (1 << cTabNum);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user