void droppet(Tree * pt) { Pet temp; if (TreeIsEmpty(pt)) { printf("No entries!\n"); return; } puts("Please enter name of pet you wish to delete:"); get(temp.name, STRLEN); puts("Please enter type of pet:"); get(temp.type, STRLEN); uppercase(temp.name); uppercase(temp.type); printf("%s the %s ", temp.name, temp.type); if (DeletePet(&temp, pt)) printf("is dropped from the club.\n"); else printf("is not a member.\n"); }
void PetStash::RecvPetStashMessage(CNetworkMessage* istr) { CUIManager* pUImanager = CUIManager::getSingleton(); CUIPetStash* pStash = pUImanager->GetPetStash(); CUIPetStashSelectEffect* pEffect = pUImanager->GetPetStashSelectEffect(); pTypeBase* pBase = reinterpret_cast<pTypeBase*>(istr->GetBuffer()); switch (pBase->subType) { case MSG_PET_STASH_LIST_UPDATE: { UpdateClient::PetStashList* pRecv = reinterpret_cast<UpdateClient::PetStashList*>(istr->GetBuffer()); if (m_nPetCount != 0) { // 팻 창고 클리어 ClearPetList(); // UI 클리어 if (pStash) pStash->ClearUI(); } m_nProxyPetIndex = pRecv->proxyPetItemVIndex; m_nPetCount = pRecv->count; if ( m_nPetCount <= 0 ) { // 펫 창고 클리어 ClearPetList(); // UI 클리어 if (pStash) pStash->ClearUI(); } else { PetStashData* pPetStashList = new PetStashData[m_nPetCount]; memcpy( pPetStashList, &pRecv->petStashData[0], sizeof(PetStashData) * m_nPetCount ); for (int i = 0; i < pRecv->count; i++) { m_vecPetStashList.push_back(&pPetStashList[i]); } UpdatePetInfo(); } } break; case MSG_PET_STASH_PET_UPDATE: { UpdateClient::PetStashPetData* pRecv = reinterpret_cast<UpdateClient::PetStashPetData*>(istr->GetBuffer()); PetStashData* pPetData = new PetStashData; memcpy( pPetData, &pRecv->petStashData, sizeof(PetStashData) ); _UpdatePet(pPetData); SAFE_DELETE(pPetData); } break; case MSG_PET_STASH_TAKE: { ResponseClient::PetStashTake* pRecv = reinterpret_cast<ResponseClient::PetStashTake*>(istr->GetBuffer()); if (pRecv->result != ERROR_PET_STASH_TAKE_SUCCESS) { _PetErrorSystemMessage(pRecv->result); } } break; case MSG_PET_STASH_TAKE_UPDATE: { UpdateClient::PetStashTake* pRecv = reinterpret_cast<UpdateClient::PetStashTake*>(istr->GetBuffer()); DeletePet(pRecv->petItemVIndex); } break; case MSG_PET_STASH_KEEP: { ResponseClient::PetStashKeep* pRecv = reinterpret_cast<ResponseClient::PetStashKeep*>(istr->GetBuffer()); if (pRecv->result != ERROR_PET_STASH_KEEP_SUCCESS) { _PetErrorSystemMessage(pRecv->result); } } break; case MSG_PET_STASH_KEEP_UPDATE: { UpdateClient::PetStashKeep* pRecv = reinterpret_cast<UpdateClient::PetStashKeep*>(istr->GetBuffer()); PetStashData* pPetData = new PetStashData; memcpy( pPetData, &pRecv->petStashData, sizeof(PetStashData) ); AddPet(pPetData); } break; case MSG_PET_STASH_PROXY: { ResponseClient::PetStashProxyReg* pRecv = reinterpret_cast<ResponseClient::PetStashProxyReg*>(istr->GetBuffer()); if (pRecv->result != ERROR_PET_STASH_PROXY_SUCCESS) { _PetErrorSystemMessage(pRecv->result); } } break; case MSG_PET_STASH_PROXY_CANCEL: { ResponseClient::PetStashProxyCancel* pRecv = reinterpret_cast<ResponseClient::PetStashProxyCancel*>(istr->GetBuffer()); if (pRecv->result != ERROR_PET_STASH_PROXY_CANCEL_SUCCESS) { _PetErrorSystemMessage(pRecv->result); } } break; case MSG_PET_STASH_EFFECT: { UpdateClient::PetStashEffect* pRecv = reinterpret_cast<UpdateClient::PetStashEffect*>(istr->GetBuffer()); m_nEffectModelNo = pRecv->effectNo; if (pRecv->effectNo >= 0) { pUImanager->GetPetStashSelectEffect()->OpenPetStashSelectEffect(); } } break; case MSG_PET_STASH_EFFECT_BY_INMAP: // 인맵, 기간만료시 제거 { UpdateClient::PetStashEffectByInMap* pRecv = reinterpret_cast<UpdateClient::PetStashEffectByInMap*>(istr->GetBuffer()); SetEffectModelNo(pRecv->effectNo); } break; case MSG_PET_STASH_EFFECT_BROAD_CAST: { UpdateClient::PetStashEffectBr* pRecv = reinterpret_cast<UpdateClient::PetStashEffectBr*>(istr->GetBuffer()); int charIndex = pRecv->charIndex; int EffectNo = pRecv->effectNo; if (charIndex == _pNetwork->MyCharacterInfo.index) return; ObjectBase* pObject = ACTORMGR()->GetObject(eOBJ_CHARACTER, charIndex); if (pObject != NULL) { CCharacterTarget* pTarget = static_cast< CCharacterTarget* >(pObject); pTarget->cha_itemEffect.AddPetStashEffect( EffectNo, &(pTarget->m_pEntity->en_pmiModelInstance->m_tmSkaTagManager) ); } } break; case MSG_PET_STASH_ERROR: { ResponseClient::PetStashError* pRecv = reinterpret_cast<ResponseClient::PetStashError*>(istr->GetBuffer()); int errorCode = pRecv->errorCode; _PetErrorSystemMessage(errorCode); } break; case MSG_PET_STASH_PROXY_UPDATE: { UpdateClient::PetStashProxyReg* pRecv = reinterpret_cast<UpdateClient::PetStashProxyReg*>(istr->GetBuffer()); m_nProxyPetIndex = pRecv->virtualIndex; } break; case MSG_PET_STASH_PROXY_CANCEL_UPDATE: { UpdateClient::PetStashProxyCancel* pRecv = reinterpret_cast<UpdateClient::PetStashProxyCancel*>(istr->GetBuffer()); m_nProxyPetIndex = pRecv->virtualIndex; } break; } if (pStash->IsVisible() != FALSE) pStash->UpdateUI(); }