#ifndef AUTHSERVER_INTEGRATIONBILLINGSERVERADAPTOR_H #define AUTHSERVER_INTEGRATIONBILLINGSERVERADAPTOR_H #pragma once #ifdef __NA_20100201_INTERGRATEDBILLING_ //libcmtd.lib; //#pragma comment(linker, "/nodefaultlib:libcmtd.lib") //#pragma comment(linker, "/nodefaultlib:libcmt.lib") #include #include #include "IntegratedBillingServerSessionLib.h" #include "IntegratedBillingServerSessionOb.h" #include "BillingServerCommonImpl.h" #include "PCRoomUserManager.h" //============================================================================== struct BillingMsg : public util::WX_INTER_MSG_HEADER { enum eBillingMsgProtocol { eBillingMsg_None = 0, eBillingMsg_OnDisconnectLib, eBillingMsg_OnConnectLib, eBillingMsg_OnUserStatus, eBillingMsg_OnInquirePCRoomPoint, eBillingMsg_OnInquirePersonDeduct, eBillingMsg_OnCheckLoginUser, eBillingMsg_OnPCRoomIPUpdate, // eBillingMsg_Counts }; union { struct { } OnDisconnectLib; struct { bool success; } OnConnectLib; struct { DWORD dwAccountGUID; long dwBillingGUID; DWORD RealEndDate; DWORD EndDate; double dRestPoint; double dRestTime; short nDeductType; short nAccessCheck; short nResultCode; } OnUserStatus; struct { long AccountID; long CompAccountSeq; long ResultCode; } OnInquirePCRoomPoint; struct { long AccountGUID; long ResultCode; } OnInquirePersonDeduct; struct { long AccountID; long BillingGUID; } OnCheckLoginUser; struct { long RoomGUID; long GameCode; } OnPCRoomIPUpdate; }; }; //============================================================================== class IntegratedBillingServerSession : public ServerSession , public IntegratedBillingServerSessionInterface // CHANGES: f110830.4L, detach the main thread context // from CBillEventHandler worker thread contexts , public util::IWxMainMessageHandler { public: IntegratedBillingServerSession(void); ~IntegratedBillingServerSession(void); inline virtual eSERVER_TYPE GetServerType() { return BILLING_SERVER; } //¼­¹ö¿¡ ¿¬°áÇÑ´Ù. void Connect(); //¶óÀ̺귯¸®¸¦ ÀÌ¿ëÇϱâ À§ÇØ ÃʱâÈ­ÇÑ´Ù. void DoInit(); //¶óÀ̺귯¸®ÀÇ ³×Æ®¿÷ ¿À·ù¸¦ ¹Þ±â À§ÇÑ ÄÝ¹é ¸Þ¼Òµå static void ErrorHandler( DWORD lastError, char* desc ); //»ç¿ëÀÚ°¡ ·Î±×ÀÎ ÇÏ¸é ºô¸µ¼­¹ö¿¡ ¾Ë¸°´Ù. void SendLogin(AccountInfo& info); //»ç¿ëÀÚ°¡ ·Î±×¾Æ¿ô ÇÏ¸é ºô¸µ¼­¹ö¿¡ ¾Ë¸°´Ù. void SendLogout(AccountInfo& info); void SendLogout(long intergratebilling_guid); //»ç¿ëÀÚÀÇ ÀÜ¿©Æ÷ÀÎÆ®¸¦ Á¶È¸ ÇÑ´Ù. void QueryRestPoint(AccountInfo* account); //°³ÀÎ Á¤·® Á¤¾×À» È®ÀÎÇÑ´Ù. void InquirePersonDeduct(AccountInfo& account); void InquireMultiUser(AccountInfo& account); #ifdef _NA_005011_20120621_MULTICLIENTS bool CheckMultiUserTypeAndLogin(AccountInfo& info); void CheckIn(AccountInfo& info); void CheckOut(AccountInfo& info); PCRoomUserManager pcroom_user_manager_; #endif //_NA_005011_20120621_MULTICLIENTS public: // util::IWxMainMessageHandler interface // CHANGES: f110830.4L, detach the main thread context // from CBillEventHandler worker thread contexts // NOTE: this handler is worked in the main thread context virtual bool OnReceive( util::WxMessageIpc::MainLogicHandler* const handler, const util::WX_INTER_MSG_HEADER* msg_base, size_t msg_size); // WARNING: IntegratedBillingServerSessionInterface interface, thread#n //ºô¸µ¼­¹ö¿Í ¿¬°áÀÌ ²÷°åÀ»¶§ virtual void OnDisconnectLib(); // WARNING: IntegratedBillingServerSessionInterface interface, thread#n //ºô¸µ¼­¹ö¿Í ¿¬°áÀÌ ¼º°øÇßÀ»¶§ virtual void OnConnectLib(bool success); // WARNING: IntegratedBillingServerSessionInterface interface, thread#n //PC¹æ ÀÜ¾× Á¶È¸ °á°ú virtual void OnInquirePCRoomPoint(long AccountID, long CompAccountSeq, long ResultCode); // WARNING: IntegratedBillingServerSessionInterface interface, thread#n // °ñµå ä³Î¿¡¼­ °³ÀÎ Á¤·® Á¤¾× È®ÀÎ °á°ú. virtual void OnInquirePersonDeduct(long AccountGUID, long ResultCode); // WARNING: IntegratedBillingServerSessionInterface interface, thread#n //»ç¿ëÀÚÀÇ »óŰ¡ º¯°æµÇ¾úÀ»¶§ virtual void OnUserStatus( DWORD dwAccountGUID, long dwBillingGUID, DWORD RealEndDate, DWORD EndDate, double dRestPoint, double dRestTime, short nDeductType, short nAccessCheck, short nResultCode); // WARNING: IntegratedBillingServerSessionInterface interface, thread#n // 2010.09.07 ºô¸µ¿¡ ·Î±×ÀÎÇÑ À¯Àú Á¤º¸¸¦ ÀÎÁõ¼­¹ö¿¡ Àü¼Û // ½ÇÁ¦·Î ÀÎÁõ¼­¹ö¿¡ ·Î±×ÀÎ Çß´ÂÁö üũÇϵµ·Ï ¾Ë·ÁÁÖ´Â ÀÎÅÍÆäÀ̽ºÀÌ´Ù. // ·Î±×ÀÎ ÈÄ 3ºÐ¿¡ Çѹø¾¿ Àü¼Û µÈ´Ù. // »óǰÀÌ º¯°æµÇ´Â ½ÃÁ¡°ú, ·Î±×¾Æ¿ô µÇ¸é Àü¼ÛµÇÁö ¾Ê´Â´Ù. virtual void OnCheckLoginUser(long AccountID, long BillingGUID); // WARNING: IntegratedBillingServerSessionInterface interface, thread#n //PC¹æ ¾ÆÀÌÇÇ Á¤º¸°¡ º¯°æµÇ¸é Å뺸µÈ´Ù. virtual void OnPCRoomIPUpdate(long RoomGUID, long GameCode); // WARNING: IntegratedBillingServerSessionInterface interface, thread#n //PC¹æ ¾ÆÀÌÇÇ Á¤º¸°¡ º¯°æµÇ¸é Å뺸µÈ´Ù. virtual void OnInquireMultiUser(long AccountGUID, long RoomGUID, long Result); private: enum {DEDUCT_TYPE_GOLDCHANNEL = 1, DEDUCT_TYPE_COLOR = 3, DEDUCT_TYPE_NORMAL = 6}; // CHANGES: f110617.1L, the sub-sessions can control first_contact_msg as the needs virtual void OnRedirect(DWORD session_index, MSG_SERVER_TYPE* const first_contact_msg); //½ã¿¡¼­ »ç¿ëµÇ´Â ¿ä±ÝÁ¦´Â Ä÷¯¿ä±ÝÁ¦¿Í ÇǾ¾¹æ ÀÏ¹Ý Á¤·®Á¦ÀÌ´Ù. //Ä÷¯¿ä±ÝÁ¦´Â ÀϹæ Á¤·®Á¦¿Í µ¿ÀÏÇÏÁö¸¸ ±â°£Á¦ÇÑÀÌ ÀÖ´Ù. BOOL IsLibInit; IntegratedBillingServerSessionLib BillingLib; BillingServerCommonImpl BillingCommonImpl; enum eBILLING_SERVER_TYPE { eBILLING_SERVER_TYPE_TEST = 697, eBILLING_SERVER_TYPE_LIVE = 696, }; eBILLING_SERVER_TYPE ServerType; #ifdef _AUTH_KOREA static const int INTERGRATEDBILLING_GAMECODE = 113; #elif defined(_AUTH_GLOBAL) || defined(_AUTH_RUSSIA) static const int INTERGRATEDBILLING_GAMECODE = 503; #else #error "Impossible Build!! - Reason: Not Define Intergrated Billing GameCode" #endif }; // CHANGES: f110617.1L, the sub-sessions can control first_contact_msg as the needs inline void IntegratedBillingServerSession::OnRedirect(DWORD, MSG_SERVER_TYPE* const) { assert(!"this session can't use this method"); } #endif //__NA_20100201_INTERGRATEDBILLING_ #endif //AUTHSERVER_INTEGRATIONBILLINGSERVERADAPTOR_H