本文整理汇总了C++中LPCHARACTER::GetVID方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::GetVID方法的具体用法?C++ LPCHARACTER::GetVID怎么用?C++ LPCHARACTER::GetVID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::GetVID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Insert
void CPVPManager::Insert(LPCHARACTER pkChr, LPCHARACTER pkVictim)
{
if (pkChr->IsDead() || pkVictim->IsDead())
return;
CPVP kPVP(pkChr->GetPlayerID(), pkVictim->GetPlayerID());
CPVP * pkPVP;
if ((pkPVP = Find(kPVP.m_dwCRC)))
{
// 복수할 수 있으면 바로 싸움!
if (pkPVP->Agree(pkChr->GetPlayerID()))
{
pkVictim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s님과의 대결 시작!"), pkChr->GetName());
pkChr->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s님과의 대결 시작!"), pkVictim->GetName());
}
return;
}
pkPVP = M2_NEW CPVP(kPVP);
pkPVP->SetVID(pkChr->GetPlayerID(), pkChr->GetVID());
pkPVP->SetVID(pkVictim->GetPlayerID(), pkVictim->GetVID());
m_map_pkPVP.insert(map<DWORD, CPVP *>::value_type(pkPVP->m_dwCRC, pkPVP));
m_map_pkPVPSetByID[pkChr->GetPlayerID()].insert(pkPVP);
m_map_pkPVPSetByID[pkVictim->GetPlayerID()].insert(pkPVP);
pkPVP->Packet();
char msg[CHAT_MAX_LEN + 1];
snprintf(msg, sizeof(msg), LC_TEXT("%s님이 대결신청을 했습니다. 승낙하려면 대결동의를 하세요."), pkChr->GetName());
pkVictim->ChatPacket(CHAT_TYPE_INFO, msg);
pkChr->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s에게 대결신청을 했습니다."), pkVictim->GetName());
// NOTIFY_PVP_MESSAGE
LPDESC pkVictimDesc = pkVictim->GetDesc();
if (pkVictimDesc)
{
TPacketGCWhisper pack;
int len = MIN(CHAT_MAX_LEN, strlen(msg) + 1);
pack.bHeader = HEADER_GC_WHISPER;
pack.wSize = sizeof(TPacketGCWhisper) + len;
pack.bType = WHISPER_TYPE_SYSTEM;
strlcpy(pack.szNameFrom, pkChr->GetName(), sizeof(pack.szNameFrom));
TEMP_BUFFER buf;
buf.write(&pack, sizeof(TPacketGCWhisper));
buf.write(msg, len);
pkVictimDesc->Packet(buf.read_peek(), buf.size());
}
// END_OF_NOTIFY_PVP_MESSAGE
}
示例2: UsePacketEncode
void CItem::UsePacketEncode(LPCHARACTER ch, LPCHARACTER victim, struct packet_item_use *packet)
{
if (!GetVnum())
return;
packet->header = HEADER_GC_ITEM_USE;
packet->ch_vid = ch->GetVID();
packet->victim_vid = victim->GetVID();
packet->Cell = TItemPos(GetWindow(), m_wCell);
packet->vnum = GetVnum();
}
示例3: CreatePCShop
LPSHOP CShopManager::CreatePCShop(LPCHARACTER ch, TShopItemTable * pTable, BYTE bItemCount)
{
if (FindPCShop(ch->GetVID()))
return NULL;
LPSHOP pkShop = M2_NEW CShop;
pkShop->SetPCShop(ch);
pkShop->SetShopItems(pTable, bItemCount);
m_map_pkShopByPC.insert(TShopMap::value_type(ch->GetVID(), pkShop));
return pkShop;
}
示例4: DestroyPCShop
void CShopManager::DestroyPCShop(LPCHARACTER ch)
{
LPSHOP pkShop = FindPCShop(ch->GetVID());
if (!pkShop)
return;
//PREVENT_ITEM_COPY;
ch->SetMyShopTime();
//END_PREVENT_ITEM_COPY
m_map_pkShopByPC.erase(ch->GetVID());
M2_DELETE(pkShop);
}
示例5: CreateParty
LPPARTY CPartyManager::CreateParty(LPCHARACTER pLeader)
{
if (pLeader->GetParty())
return pLeader->GetParty();
LPPARTY pParty = M2_NEW CParty;
if (pLeader->IsPC())
{
//TPacketGGParty p;
//p.header = HEADER_GG_PARTY;
//p.subheader = PARTY_SUBHEADER_GG_CREATE;
//p.pid = pLeader->GetPlayerID();
//P2P_MANAGER::instance().Send(&p, sizeof(p));
TPacketPartyCreate p;
p.dwLeaderPID = pLeader->GetPlayerID();
db_clientdesc->DBPacket(HEADER_GD_PARTY_CREATE, 0, &p, sizeof(TPacketPartyCreate));
sys_log(0, "PARTY: Create %s pid %u", pLeader->GetName(), pLeader->GetPlayerID());
pParty->SetPCParty(true);
pParty->Join(pLeader->GetPlayerID());
m_set_pkPCParty.insert(pParty);
}
else
{
pParty->SetPCParty(false);
pParty->Join(pLeader->GetVID());
}
pParty->Link(pLeader);
return (pParty);
}
示例6: IS_SPEED_HACK
bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
{
if (ch->m_kAttackLog.dwVID == victim->GetVID())
{
if (current_time - ch->m_kAttackLog.dwTime < GET_ATTACK_SPEED(ch))
{
INCREASE_SPEED_HACK_COUNT(ch);
if (test_server)
{
sys_log(0, "%s attack hack! time (delta, limit)=(%u, %u) hack_count %d",
ch->GetName(),
current_time - ch->m_kAttackLog.dwTime,
GET_ATTACK_SPEED(ch),
ch->m_speed_hack_count);
ch->ChatPacket(CHAT_TYPE_INFO, "%s attack hack! time (delta, limit)=(%u, %u) hack_count %d",
ch->GetName(),
current_time - ch->m_kAttackLog.dwTime,
GET_ATTACK_SPEED(ch),
ch->m_speed_hack_count);
}
SET_ATTACK_TIME(ch, victim, current_time);
SET_ATTACKED_TIME(ch, victim, current_time);
return true;
}
}
SET_ATTACK_TIME(ch, victim, current_time);
if (victim->m_AttackedLog.dwPID == ch->GetPlayerID())
{
if (current_time - victim->m_AttackedLog.dwAttackedTime < GET_ATTACK_SPEED(ch))
{
INCREASE_SPEED_HACK_COUNT(ch);
if (test_server)
{
sys_log(0, "%s Attack Speed HACK! time (delta, limit)=(%u, %u), hack_count = %d",
ch->GetName(),
current_time - victim->m_AttackedLog.dwAttackedTime,
GET_ATTACK_SPEED(ch),
ch->m_speed_hack_count);
ch->ChatPacket(CHAT_TYPE_INFO, "Attack Speed Hack(%s), (delta, limit)=(%u, %u)",
ch->GetName(),
current_time - victim->m_AttackedLog.dwAttackedTime,
GET_ATTACK_SPEED(ch));
}
SET_ATTACKED_TIME(ch, victim, current_time);
return true;
}
}
SET_ATTACKED_TIME(ch, victim, current_time);
return false;
}
示例7: Link
void CParty::Link(LPCHARACTER pkChr)
{
TMemberMap::iterator it;
if (pkChr->IsPC())
it = m_memberMap.find(pkChr->GetPlayerID());
else
it = m_memberMap.find(pkChr->GetVID());
if (it == m_memberMap.end())
{
sys_err("%s is not member of this party", pkChr->GetName());
return;
}
// 플레이어 파티일 경우 업데이트 이벤트 생성
if (m_bPCParty && !m_eventUpdate)
{
party_update_event_info* info = AllocEventInfo<party_update_event_info>();
info->pid = m_dwLeaderPID;
m_eventUpdate = event_create(party_update_event, info, PASSES_PER_SEC(3));
}
if (it->second.bRole == PARTY_ROLE_LEADER)
m_pkChrLeader = pkChr;
sys_log(2, "PARTY[%d] %s linked to party", GetLeaderPID(), pkChr->GetName());
it->second.pCharacter = pkChr;
pkChr->SetParty(this);
if (pkChr->IsPC())
{
if (it->second.strName.empty())
{
it->second.strName = pkChr->GetName();
}
SendPartyJoinOneToAll(pkChr->GetPlayerID());
SendPartyJoinAllToOne(pkChr);
SendPartyLinkOneToAll(pkChr);
SendPartyLinkAllToOne(pkChr);
SendPartyInfoAllToOne(pkChr);
SendPartyInfoOneToAll(pkChr);
SendParameter(pkChr);
//sys_log(0, "PARTY-DUNGEON connect %p %p", this, GetDungeon());
if (GetDungeon() && GetDungeon()->GetMapIndex() == pkChr->GetMapIndex())
{
pkChr->SetDungeon(GetDungeon());
}
RequestSetMemberLevel(pkChr->GetPlayerID(), pkChr->GetLevel());
}
}
示例8: SET_ATTACK_TIME
void SET_ATTACK_TIME(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
{
if (NULL == ch || NULL == victim)
return;
if (!ch->IsPC())
return;
ch->m_kAttackLog.dwVID = victim->GetVID();
ch->m_kAttackLog.dwTime = current_time;
}
示例9: marriage_find_married_vid
int marriage_find_married_vid(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
marriage::TMarriage* pMarriage = marriage::CManager::instance().Get(ch->GetPlayerID());
DWORD vid = 0;
if (pMarriage)
{
LPCHARACTER you = CHARACTER_MANAGER::instance().FindByPID(pMarriage->GetOther(ch->GetPlayerID()));
if (you)
vid = you->GetVID();
}
lua_pushnumber(L, vid);
return 1;
}
示例10: StartShopping
// 상점 거래를 시작
bool CShopManager::StartShopping(LPCHARACTER pkChr, LPCHARACTER pkChrShopKeeper, int iShopVnum)
{
if (pkChr->GetShopOwner() == pkChrShopKeeper)
return false;
// this method is only for NPC
if (pkChrShopKeeper->IsPC())
return false;
//PREVENT_TRADE_WINDOW
if (pkChr->IsOpenSafebox() || pkChr->GetExchange() || pkChr->GetMyShop() || pkChr->IsCubeOpen())
{
pkChr->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("다른 거래창이 열린상태에서는 상점거래를 할수 가 없습니다."));
return false;
}
//END_PREVENT_TRADE_WINDOW
long distance = DISTANCE_APPROX(pkChr->GetX() - pkChrShopKeeper->GetX(), pkChr->GetY() - pkChrShopKeeper->GetY());
if (distance >= SHOP_MAX_DISTANCE)
{
sys_log(1, "SHOP: TOO_FAR: %s distance %d", pkChr->GetName(), distance);
return false;
}
LPSHOP pkShop;
if (iShopVnum)
pkShop = Get(iShopVnum);
else
pkShop = GetByNPCVnum(pkChrShopKeeper->GetRaceNum());
if (!pkShop)
{
sys_log(1, "SHOP: NO SHOP");
return false;
}
bool bOtherEmpire = false;
if (pkChr->GetEmpire() != pkChrShopKeeper->GetEmpire())
bOtherEmpire = true;
pkShop->AddGuest(pkChr, pkChrShopKeeper->GetVID(), bOtherEmpire);
pkChr->SetShopOwner(pkChrShopKeeper);
sys_log(0, "SHOP: START: %s", pkChr->GetName());
return true;
}
示例11: ConnectEx
void CPVPManager::ConnectEx(LPCHARACTER pkChr, bool bDisconnect)
{
CPVPSetMap::iterator it = m_map_pkPVPSetByID.find(pkChr->GetPlayerID());
if (it == m_map_pkPVPSetByID.end())
return;
DWORD dwVID = bDisconnect ? 0 : pkChr->GetVID();
TR1_NS::unordered_set<CPVP*>::iterator it2 = it->second.begin();
while (it2 != it->second.end())
{
CPVP * pkPVP = *it2++;
pkPVP->SetVID(pkChr->GetPlayerID(), dwVID);
}
}
示例12: SendPartyInfoOneToAll
void CParty::SendPartyInfoOneToAll(LPCHARACTER ch)
{
if (!ch->GetDesc())
return;
TMemberMap::iterator it;
// Data Building
TPacketGCPartyUpdate p;
ch->BuildUpdatePartyPacket(p);
for (it = m_memberMap.begin();it!= m_memberMap.end(); ++it)
{
if ((it->second.pCharacter) && (it->second.pCharacter->GetDesc()))
{
sys_log(2, "PARTY send info %s[%d] to %s[%d]", ch->GetName(), (DWORD)ch->GetVID(), it->second.pCharacter->GetName(), (DWORD)it->second.pCharacter->GetVID());
it->second.pCharacter->GetDesc()->Packet(&p, sizeof(p));
}
}
}
示例13: SendPartyLinkOneToAll
void CParty::SendPartyLinkOneToAll(LPCHARACTER ch)
{
if (!ch->GetDesc())
return;
TMemberMap::iterator it;
TPacketGCPartyLink p;
p.header = HEADER_GC_PARTY_LINK;
p.vid = ch->GetVID();
p.pid = ch->GetPlayerID();
for (it = m_memberMap.begin();it!= m_memberMap.end(); ++it)
{
if (it->second.pCharacter && it->second.pCharacter->GetDesc())
{
it->second.pCharacter->GetDesc()->Packet(&p, sizeof(p));
}
}
}
示例14: Unlink
void CParty::Unlink(LPCHARACTER pkChr)
{
TMemberMap::iterator it;
if (pkChr->IsPC())
it = m_memberMap.find(pkChr->GetPlayerID());
else
it = m_memberMap.find(pkChr->GetVID());
if (it == m_memberMap.end())
{
sys_err("%s is not member of this party", pkChr->GetName());
return;
}
if (pkChr->IsPC())
{
SendPartyUnlinkOneToAll(pkChr);
//SendPartyUnlinkAllToOne(pkChr); // 끊기는 것이므로 구지 Unlink 패킷을 보낼 필요 없다.
if (it->second.bRole == PARTY_ROLE_LEADER)
{
RemoveBonus();
if (it->second.pCharacter->GetDungeon())
{
// TODO: 던젼에 있으면 나머지도 나간다
FExitDungeon f;
ForEachNearMember(f);
}
}
}
if (it->second.bRole == PARTY_ROLE_LEADER)
m_pkChrLeader = NULL;
it->second.pCharacter = NULL;
pkChr->SetParty(NULL);
}
示例15: SendPartyInfoAllToOne
void CParty::SendPartyInfoAllToOne(LPCHARACTER ch)
{
TMemberMap::iterator it;
TPacketGCPartyUpdate p;
for (it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
{
if (!it->second.pCharacter)
{
DWORD pid = it->first;
memset(&p, 0, sizeof(p));
p.header = HEADER_GC_PARTY_UPDATE;
p.pid = pid;
p.percent_hp = 255;
p.role = it->second.bRole;
ch->GetDesc()->Packet(&p, sizeof(p));
continue;
}
it->second.pCharacter->BuildUpdatePartyPacket(p);
sys_log(2, "PARTY send info %s[%d] to %s[%d]", it->second.pCharacter->GetName(), (DWORD)it->second.pCharacter->GetVID(), ch->GetName(), (DWORD)ch->GetVID());
ch->GetDesc()->Packet(&p, sizeof(p));
}
}