# define __CASH_SHOP_H
# ifdef __NPCCASHSHOP
Typedef struct _CashItem
{
U_long nId;//in the database id
U_long dwId;//item id
Int dwPrice;//property prices, mall currency
Unsigned short nNum;//item number
Unsigned short nMax;//a single purchase at most how many pieces of
Byte discount;//discount 10 to 1 fold 50 to fold 100 5 to 10 fold (that is, don't discount)
Unsigned short limit;//set limit to sell how many pieces. 0 for unlimited
Unsigned short remain;//set limit to how many pieces of remaining defaults to 0
Byte empty1;//standby
Byte empty2;//standby
Byte empty3;//standby
_CashItem ()
{
NNum=1;//the original item number 1
NMax=1;//initial single purchase limit 1 piece
Discount=100;//initial discount for discounted prices
Limit=0;//the initial limited number for unlimited
Remain=0;//the initial surplus is 0
Empty1=empty2=empty3=0;
}
} CashItem;
Typedef struct _CashPage
{
Unsigned short nCount;//how many props
Bool bLoaded; Have//read the current page
Char szName [61].//the name of the current page
Int nType;//charge type 0 for mall COINS COINS
1 for feifeiCashItem szItem [MAX_CASHSHOP_TAB_ITEM];
_CashPage ()
{
BLoaded=false;//whether the initialization has read false
NType=0;
}
} CashPage;
Typedef struct _CashShop
{
Unsigned short nItemCount;//a total of how many items
Bool bOpen;//whether the mall open
Byte nPage;//how many pages in total props
Int nCash;//player mall currency
CashPage szPage [MAX_CASHSHOP_TAB];
_CashShop ()
{
BOpen=true;//initialize the mall to open
NCash=0;//initialize the role mall currency of 0
}
} CashShop;
The class CCashShop
{
Public:
CCashShop ();
~ CCashShop ();
CashShop m_Shop;
# ifdef __CLIENT
CItemElem * m_CashItemElem [MAX_CASHSHOP_TAB * MAX_CASHSHOP_TAB_ITEM];
Void Init (CAr & amp; Ar);//initialization data
Void LoadPage (CAr & amp; Ar);//load a page item data
//void LoadItem (CAr & amp; Ar);//load the item data
CItemElem * the GetItem (DWORD dwItemId);
# endif//__CLIENT
Void the Clear () {memset ((void *) & amp; M_Shop, 0, sizeof (CashShop)); }//empty
Bool IsOpen () {return m_Shop. BOpen; }//mall open
# ifdef __SERVER
# # ifndef __NEW_CASH_SYSTEM//new CASH system
BOOL m_IsConnected;
CQuery m_Query;
BOOL ConnectDB ();
Int GetUserCash (DWORD UserId);
BOOL UpdateUserCash (DWORD UserId, int dwCash);
# endif//__NEW_CASH_SYSTEM//new CASH system
BOOL Init (LPCTSTR lpszFileName);//initialize the mall data from the file
Int GetItemCash (DWORD dwItemId);
# endif//__SERVER
};
# endif//__NPCCASHSHOP
# ifdef __NEW_CASH_SYSTEM//new CASH system
# ifdef __SERVER
# include "Public h"
The class CCashSystem: public Singleton
{
Public:
CCashSystem ();
~ CCashSystem ();
BOOL m_IsConnected;
CQuery m_Query;//it says unknown rewrite specifiers I don't know how to solve, I've included a Query. H header file,
BOOL ConnectDB ();
Int GetUserCash (DWORD UserId);
BOOL UpdateUserCash (DWORD UserId, int nCash);
};
# endif//__SERVER
# endif//__NEW_CASH_SYSTEM//new CASH system
# endif//__CASH_SHOP_H
1> -- -- -- -- -- - has started to regenerate: all projects: WorldServer, configuration, Release the Win32 -- -- -- -- -- --
1> StdAfx. CPP
1> E: \ nuoyayuanshi \ source \ _common \ consignment h (110) : error C3646: "m_Query" : unknown rewrite specifiers
1> E: \ nuoyayuanshi \ source \ _common \ consignment h (110) : error C4430: lack of type specifier - is assumed to be int, note: c + + does not support default int
1> E: \ nuoyayuanshi \ source \ _common \ cashshop h (95) : error C3646: "m_Query" : unknown rewrite specifiers
1> E: \ nuoyayuanshi \ source \ _common \ cashshop h (95) : error C4430: lack of type specifier - is assumed to be int, note: c + + does not support default int
1> Generating project has been completed "WorldServer. Vcxproj" operations - failure,
==========all regenerated: zero success, failure, skip 0==========
CodePudding user response:
The original poster can be# # ifndef __CASH_SHOP_H
# define __CASH_SHOP_H
# ifdef __NPCCASHSHOP
Add back the class CQuery; Try that CQuery the declaration of a class
CodePudding user response: