#include "StdAfx.h" #include "PythonNetworkStream.h" #include "PythonItem.h" #include "PythonShop.h" #include "PythonExchange.h" #include "PythonSafeBox.h" #include "PythonCharacterManager.h" #include "AbstractPlayer.h" ////////////////////////////////////////////////////////////////////////// // SafeBox bool CPythonNetworkStream::SendSafeBoxMoneyPacket(BYTE byState, DWORD dwMoney) { assert(!"CPythonNetworkStream::SendSafeBoxMoneyPacket - »ç¿ëÇÏÁö ¾Ê´Â ÇÔ¼ö"); return false; // TPacketCGSafeboxMoney kSafeboxMoney; // kSafeboxMoney.bHeader = HEADER_CG_SAFEBOX_MONEY; // kSafeboxMoney.bState = byState; // kSafeboxMoney.dwMoney = dwMoney; // if (!Send(sizeof(kSafeboxMoney), &kSafeboxMoney)) // return false; // // return SendSequence(); } bool CPythonNetworkStream::SendSafeBoxCheckinPacket(TItemPos InventoryPos, BYTE bySafeBoxPos) { __PlayInventoryItemDropSound(InventoryPos); TPacketCGSafeboxCheckin kSafeboxCheckin; kSafeboxCheckin.bHeader = HEADER_CG_SAFEBOX_CHECKIN; kSafeboxCheckin.ItemPos = InventoryPos; kSafeboxCheckin.bSafePos = bySafeBoxPos; if (!Send(sizeof(kSafeboxCheckin), &kSafeboxCheckin)) return false; return SendSequence(); } bool CPythonNetworkStream::SendSafeBoxCheckoutPacket(BYTE bySafeBoxPos, TItemPos InventoryPos) { __PlaySafeBoxItemDropSound(bySafeBoxPos); TPacketCGSafeboxCheckout kSafeboxCheckout; kSafeboxCheckout.bHeader = HEADER_CG_SAFEBOX_CHECKOUT; kSafeboxCheckout.bSafePos = bySafeBoxPos; kSafeboxCheckout.ItemPos = InventoryPos; if (!Send(sizeof(kSafeboxCheckout), &kSafeboxCheckout)) return false; return SendSequence(); } bool CPythonNetworkStream::SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, BYTE byCount) { __PlaySafeBoxItemDropSound(bySourcePos); TPacketCGItemMove kItemMove; kItemMove.header = HEADER_CG_SAFEBOX_ITEM_MOVE; kItemMove.pos = TItemPos(INVENTORY, bySourcePos); kItemMove.num = byCount; kItemMove.change_pos = TItemPos(INVENTORY, byTargetPos); if (!Send(sizeof(kItemMove), &kItemMove)) return false; return SendSequence(); } bool CPythonNetworkStream::RecvSafeBoxSetPacket() { TPacketGCItemSet2 kItemSet; if (!Recv(sizeof(kItemSet), &kItemSet)) return false; TItemData kItemData; kItemData.vnum = kItemSet.vnum; kItemData.count = kItemSet.count; kItemData.flags = kItemSet.flags; kItemData.anti_flags = kItemSet.anti_flags; for (int isocket=0; isocket> CPythonNetworkStream::RecvMallItemDelPacket\n"); return true; } // Mall ////////////////////////////////////////////////////////////////////////// // Item // Recieve bool CPythonNetworkStream::RecvItemSetPacket() { TPacketGCItemSet packet_item_set; if (!Recv(sizeof(TPacketGCItemSet), &packet_item_set)) return false; TItemData kItemData; kItemData.vnum = packet_item_set.vnum; kItemData.count = packet_item_set.count; kItemData.flags = 0; for (int i=0; iAttachSpecialEffect(effect); else pInstance->CreateSpecialEffect(effect); } } return true; } bool CPythonNetworkStream::RecvSpecificEffect() { TPacketGCSpecificEffect kSpecificEffect; if (!Recv(sizeof(kSpecificEffect), &kSpecificEffect)) return false; CInstanceBase * pInstance = CPythonCharacterManager::Instance().GetInstancePtr(kSpecificEffect.vid); //EFFECT_TEMP if (pInstance) { CInstanceBase::RegisterEffect(CInstanceBase::EFFECT_TEMP, "", kSpecificEffect.effect_file, false); pInstance->AttachSpecialEffect(CInstanceBase::EFFECT_TEMP); } return true; } bool CPythonNetworkStream::RecvDragonSoulRefine() { TPacketGCDragonSoulRefine kDragonSoul; if (!Recv(sizeof(kDragonSoul), &kDragonSoul)) return false; switch (kDragonSoul.bSubType) { case DS_SUB_HEADER_OPEN: PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_DragonSoulRefineWindow_Open", Py_BuildValue("()")); break; case DS_SUB_HEADER_REFINE_FAIL: case DS_SUB_HEADER_REFINE_FAIL_MAX_REFINE: case DS_SUB_HEADER_REFINE_FAIL_INVALID_MATERIAL: case DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MONEY: case DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MATERIAL: case DS_SUB_HEADER_REFINE_FAIL_TOO_MUCH_MATERIAL: PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_DragonSoulRefineWindow_RefineFail", Py_BuildValue("(iii)", kDragonSoul.bSubType, kDragonSoul.Pos.window_type, kDragonSoul.Pos.cell)); break; case DS_SUB_HEADER_REFINE_SUCCEED: PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_DragonSoulRefineWindow_RefineSucceed", Py_BuildValue("(ii)", kDragonSoul.Pos.window_type, kDragonSoul.Pos.cell)); break; } return true; }