?? channel.cpp
字號:
pZone->AddUser( pUser->GetGUID(), pUser );
MessageOut( eFULL_LOG, "UserEnterBattleZone(%s:%u)", pUser->GetCharName().c_str(), pUser->GetGUID() );
}
*/
VOID Channel::UserEnterLobby( User *pUser, DWORD dwNewZoneKey )
{
if( pUser->GetStatus() >= eZONETYPE_LOBBY && pUser->GetStatus() < eZONETYPE_MAX )
{
MessageOut( eCRITICAL_LOG, "User Leave 絕撈 LobbyEnter Error[%s][Guid:%u][CharGuid:%u][ZT:%u][ZK:%u]", pUser->GetCharName().c_str(),
pUser->GetGUID(),
pUser->GetCharGuid(),
pUser->GetStatus(),
dwNewZoneKey );
UserLeavePrevZone( pUser ); // 趣矯扼檔 巢籃 惑怕老 薦 樂欄聰 昏力
}
pUser->SetStatus( eZONETYPE_LOBBY );
// 秦寸 虐肺 硅撇糧闌 茫酒焊絆 絕欄擱 硅撇糧 眠啊 饒 蠟廉 眠啊
Zone *pZone = FindLobby( dwNewZoneKey );
if( !pZone )
{
pZone = AddLobby( dwNewZoneKey );
}
if( pZone->AddUser( pUser->GetGUID(), pUser ) )
{
IncLobbyUserNum();
}
MessageOut( eMIDDLE_LOG, "UserEnterLobby[Guid:%u][CharGuid:%u][ZK:%u]", pUser->GetGUID(), pUser->GetCharGuid(), dwNewZoneKey );
}
VOID Channel::UserEnterMissionZone( User *pUser, DWORD dwNewZoneKey )
{
if( pUser->GetStatus() >= eZONETYPE_LOBBY && pUser->GetStatus() < eZONETYPE_MAX )
{
MessageOut( eCRITICAL_LOG, "User Leave 絕撈 MissionEnter Error[%s][Guid:%u][CharGuid:%u]", pUser->GetCharName().c_str(),
pUser->GetGUID(),
pUser->GetCharGuid() );
UserLeavePrevZone( pUser ); // 趣矯扼檔 巢籃 惑怕老 薦 樂欄聰 昏力
}
pUser->SetStatus( eZONETYPE_MISSION );
// 秦寸 虐肺 硅撇糧闌 茫酒焊絆 絕欄擱 硅撇糧 眠啊 饒 蠟廉 眠啊
Zone *pZone = FindMissionZone( dwNewZoneKey );
if( !pZone )
{
pZone = AddMissionZone( dwNewZoneKey );
}
if( pZone->AddUser( pUser->GetGUID(), pUser ) )
{
IncMissionUserNum();
}
MessageOut( eMIDDLE_LOG, "UserEnterMissionZone[Guid:%u][CharGuid:%u][ZK:%u]", pUser->GetGUID(), pUser->GetCharGuid(), dwNewZoneKey );
}
VOID Channel::UserEnterHuntingZone( User *pUser, DWORD dwNewZoneKey )
{
if( pUser->GetStatus() >= eZONETYPE_LOBBY && pUser->GetStatus() < eZONETYPE_MAX )
{
MessageOut( eCRITICAL_LOG, "User Leave 絕撈 HuntingEnter Error[%s][Guid:%u][CharGuid:%u]", pUser->GetCharName().c_str(),
pUser->GetGUID(),
pUser->GetCharGuid() );
UserLeavePrevZone( pUser ); // 趣矯扼檔 巢籃 惑怕老 薦 樂欄聰 昏力
}
pUser->SetStatus( eZONETYPE_HUNTING );
// 秦寸 虐肺 硅撇糧闌 茫酒焊絆 絕欄擱 硅撇糧 眠啊 饒 蠟廉 眠啊
Zone *pZone = FindHuntingZone( dwNewZoneKey );
if( !pZone )
{
pZone = AddHuntingZone( dwNewZoneKey );
}
if( pZone->AddUser( pUser->GetGUID(), pUser ) )
{
IncHuntingUserNum();
}
MessageOut( eMIDDLE_LOG, "UserEnterHuntingZone[Guid:%u][CharGuid:%u][ZK:%u]", pUser->GetGUID(), pUser->GetCharGuid(), dwNewZoneKey );
}
VOID Channel::UserEnterQuestZone( User *pUser, DWORD dwNewZoneKey )
{
if( pUser->GetStatus() >= eZONETYPE_LOBBY && pUser->GetStatus() < eZONETYPE_MAX )
{
MessageOut( eCRITICAL_LOG, "User Leave 絕撈 QuestEnter Error[%s][Guid:%u][CharGuid:%u]", pUser->GetCharName().c_str(),
pUser->GetGUID(),
pUser->GetCharGuid() );
UserLeavePrevZone( pUser ); // 趣矯扼檔 巢籃 惑怕老 薦 樂欄聰 昏力
}
pUser->SetStatus( eZONETYPE_QUEST );
// 秦寸 虐肺 硅撇糧闌 茫酒焊絆 絕欄擱 硅撇糧 眠啊 饒 蠟廉 眠啊
Zone *pZone = FindQuestZone( dwNewZoneKey );
if( !pZone )
{
pZone = AddQuestZone( dwNewZoneKey );
}
if( pZone->AddUser( pUser->GetGUID(), pUser ) )
{
IncQuestUserNum();
}
MessageOut( eMIDDLE_LOG, "UserEnterQuestZone[Guid:%u][CharGuid:%u]", pUser->GetGUID(), pUser->GetCharGuid() );
}
VOID Channel::UserEnterPVPZone( User *pUser, DWORD dwNewZoneKey )
{
if( pUser->GetStatus() >= eZONETYPE_LOBBY && pUser->GetStatus() < eZONETYPE_MAX )
{
MessageOut( eCRITICAL_LOG, "User Leave 絕撈 PVP Enter Error[%s][Guid:%u][CharGuid:%u]", pUser->GetCharName().c_str(),
pUser->GetGUID(),
pUser->GetCharGuid() );
UserLeavePrevZone( pUser ); // 趣矯扼檔 巢籃 惑怕老 薦 樂欄聰 昏力
}
pUser->SetStatus( eZONETYPE_PVP );
// 秦寸 虐肺 硅撇糧闌 茫酒焊絆 絕欄擱 硅撇糧 眠啊 饒 蠟廉 眠啊
Zone *pZone = FindPVPZone( dwNewZoneKey );
if( !pZone )
{
pZone = AddPVPZone( dwNewZoneKey );
}
if( pZone->AddUser( pUser->GetGUID(), pUser ) )
{
IncPVPUserNum();
}
MessageOut( eMIDDLE_LOG, "UserEnterPVPZone[Guid:%u][CharGuid:%u]", pUser->GetGUID(), pUser->GetCharGuid() );
}
VOID Channel::UserEnterEventZone( User *pUser, DWORD dwNewZoneKey )
{
if( pUser->GetStatus() >= eZONETYPE_LOBBY && pUser->GetStatus() < eZONETYPE_MAX )
{
MessageOut( eCRITICAL_LOG, "User Leave 絕撈 Enter Error[%s][Guid:%u][CharGuid:%u]", pUser->GetCharName().c_str(),
pUser->GetGUID(),
pUser->GetCharGuid() );
UserLeavePrevZone( pUser ); // 趣矯扼檔 巢籃 惑怕老 薦 樂欄聰 昏力
}
pUser->SetStatus( eZONETYPE_EVENT );
// 秦寸 虐肺 硅撇糧闌 茫酒焊絆 絕欄擱 硅撇糧 眠啊 饒 蠟廉 眠啊
Zone *pZone = FindEventZone( dwNewZoneKey );
if( !pZone )
{
pZone = AddEventZone( dwNewZoneKey );
}
if( pZone->AddUser( pUser->GetGUID(), pUser ) )
{
IncEventUserNum();
}
MessageOut( eMIDDLE_LOG, "UserEnterEventZone[Guid:%u][CharGuid:%u]", pUser->GetGUID(), pUser->GetCharGuid() );
}
VOID Channel::UserEnterGuildZone( User *pUser, DWORD dwNewZoneKey )
{
if( pUser->GetStatus() >= eZONETYPE_LOBBY && pUser->GetStatus() < eZONETYPE_MAX )
{
MessageOut( eCRITICAL_LOG, "User Leave 絕撈 Enter Error[%s][Guid:%u][CharGuid:%u]", pUser->GetCharName().c_str(),
pUser->GetGUID(),
pUser->GetCharGuid() );
UserLeavePrevZone( pUser ); // 趣矯扼檔 巢籃 惑怕老 薦 樂欄聰 昏力
}
pUser->SetStatus( eZONETYPE_GUILD );
// 秦寸 虐肺 硅撇糧闌 茫酒焊絆 絕欄擱 硅撇糧 眠啊 饒 蠟廉 眠啊
Zone *pZone = FindGuildZone( dwNewZoneKey );
if( !pZone )
{
pZone = AddGuildZone( dwNewZoneKey );
}
if( pZone->AddUser( pUser->GetGUID(), pUser ) )
{
IncGuildUserNum();
}
MessageOut( eMIDDLE_LOG, "UserEnterGuildZone[Guid:%u][CharGuid:%u]", pUser->GetGUID(), pUser->GetCharGuid() );
}
VOID Channel::UserEnterSiegeZone( User *pUser, DWORD dwNewZoneKey )
{
if( pUser->GetStatus() >= eZONETYPE_LOBBY && pUser->GetStatus() < eZONETYPE_MAX )
{
MessageOut( eCRITICAL_LOG, "User Leave 絕撈 Enter Error[%s][Guid:%u][CharGuid:%u]", pUser->GetCharName().c_str(),
pUser->GetGUID(),
pUser->GetCharGuid() );
UserLeavePrevZone( pUser ); // 趣矯扼檔 巢籃 惑怕老 薦 樂欄聰 昏力
}
pUser->SetStatus( eZONETYPE_SIEGE );
// 秦寸 虐肺 硅撇糧闌 茫酒焊絆 絕欄擱 硅撇糧 眠啊 饒 蠟廉 眠啊
Zone *pZone = FindSiegeZone( dwNewZoneKey );
if( !pZone )
{
pZone = AddSiegeZone( dwNewZoneKey );
}
if( pZone->AddUser( pUser->GetGUID(), pUser ) )
{
IncSiegeUserNum();
}
MessageOut( eMIDDLE_LOG, "UserEnterSiegeZone[Guid:%u][CharGuid:%u]", pUser->GetGUID(), pUser->GetCharGuid() );
}
VOID Channel::UserEnterFriendChat( User *pUser, DWORD dwNewZoneKey )
{
// 秦寸 虐肺 模備 盲潑規 茫酒焊絆 絕欄擱 眠啊 饒 蠟廉 眠啊
Zone *pZone = FindFriendChat( dwNewZoneKey );
if( !pZone )
{
KEYTYPE zoneKey = AllocKey(); // 盲潑規 虐甫 撈錠 眠啊
pZone = AddFriendChat( zoneKey );
}
pZone->AddUser( pUser->GetGUID(), pUser );
MessageOut( eMIDDLE_LOG, "UserEnterFriendChat[Guid:%u][CharGuid:%u]", pUser->GetGUID(), pUser->GetCharGuid() );
}
VOID Channel::SendToAll( BYTE *pMsg, WORD wSize )
{
USER_MAP_ITER it;
User *pUser;
for( it = m_mapUsers.begin(); it !=m_mapUsers.end(); ++it )
{
pUser = it->second;
pUser->Send( pMsg, wSize );
}
}
BOOL Channel::SendToOneVillage( DWORD dwFieldCode, BYTE* pMsg, WORD wSize )
{
return m_pViewPortManager->SendToAll( dwFieldCode, pMsg, wSize );
}
VOID Channel::SendToVillages( BYTE *pMsg, WORD wSize )
{
ZONE_MAP_ITER it;
Zone *pZone;
for( it = m_mapVillageZones.begin(); it != m_mapVillageZones.end(); ++it )
{
pZone = it->second;
if( pZone )
pZone->SendToAll( pMsg, wSize );
}
}
/*
VOID Channel::SendToBattleZones( BYTE *pMsg, WORD wSize )
{
ZONE_MAP_ITER it;
Zone *pZone;
for( it = m_mapBattleZones.begin(); it != m_mapBattleZones.end(); ++it )
{
pZone = it->second;
pZone->SendToAll( pMsg, wSize );
}
}
*/
VOID Channel::SendToLobby( BYTE *pMsg, WORD wSize )
{
ZONE_MAP_ITER it;
Zone *pZone;
for( it = m_mapLobby.begin(); it != m_mapLobby.end(); ++it )
{
pZone = it->second;
if( pZone )
pZone->SendToAll( pMsg, wSize );
}
MessageOut(eFULL_LOG, "SendToLobby");
}
VOID Channel::SendToMissionZones( BYTE *pMsg, WORD wSize )
{
ZONE_MAP_ITER it;
Zone *pZone;
for( it = m_mapMissionZones.begin(); it != m_mapMissionZones.end(); ++it )
{
pZone = it->second;
if( pZone )
pZone->SendToAll( pMsg, wSize );
}
MessageOut(eFULL_LOG, "SendToMissionZones");
}
VOID Channel::SendToHuntingZones( BYTE *pMsg, WORD wSize )
{
ZONE_MAP_ITER it;
Zone *pZone;
for( it = m_mapHuntingZones.begin(); it != m_mapHuntingZones.end(); ++it )
{
pZone = it->second;
if( pZone )
pZone->SendToAll( pMsg, wSize );
}
MessageOut(eFULL_LOG, "SendToHuntingZones");
}
VOID Channel::SendToQuestZones( BYTE *pMsg, WORD wSize )
{
ZONE_MAP_ITER it;
Zone *pZone;
for( it = m_mapQuestZones.begin(); it != m_mapQuestZones.end(); ++it )
{
pZone = it->second;
if( pZone )
pZone->SendToAll( pMsg, wSize );
}
MessageOut(eFULL_LOG, "SendToQuestZones");
}
VOID Channel::SendToPVPZones( BYTE *pMsg, WORD wSize )
{
ZONE_MAP_ITER it;
Zone *pZone;
for( it = m_mapPVPZones.begin(); it != m_mapPVPZones.end(); ++it )
{
pZone = it->second;
if( pZone )
pZone->SendToAll( pMsg, wSize );
}
MessageOut(eFULL_LOG, "SendToPVPZones");
}
VOID Channel::SendToEventZones( BYTE *pMsg, WORD wSize )
{
ZONE_MAP_ITER it;
Zone *pZone;
for( it = m_mapEventZones.begin(); it != m_mapEventZones.end(); ++it )
{
pZone = it->second;
if( pZone )
pZone->SendToAll( pMsg, wSize );
}
MessageOut(eFULL_LOG, "SendToEventZones");
}
VOID Channel::SendToGuildZones( BYTE *pMsg, WORD wSize )
{
ZONE_MAP_ITER it;
Zone *pZone;
for( it = m_mapGuildZones.begin(); it != m_mapGuildZones.end(); ++it )
{
pZone = it->second;
if( pZone )
pZone->SendToAll( pMsg, wSize );
}
MessageOut(eFULL_LOG, "SendToGuildZones");
}
VOID Channel::SendToSiegeZones( BYTE *pMsg, WORD wSize )
{
ZONE_MAP_ITER it;
Zone *pZone;
for( it = m_mapSiegeZones.begin(); it != m_mapSiegeZones.end(); ++it )
{
pZone = it->second;
if( pZone )
pZone->SendToAll( pMsg, wSize );
}
MessageOut(eFULL_LOG, "SendToSiegeZones");
}
BOOL Channel::SendToViewPort( User *pUser, BYTE *pMsg, WORD wSize )
{
return m_pViewPortManager->SendViewPort( pUser, pMsg, wSize );
}
VOID Channel::DisplayInfo()
{
DWORD dwNumberOfVillageUsers = 0;
// DWORD dwNumberOfBattleZoneUsers = 0;
DWORD dwNumberOfLobbyUsers = 0;
DWORD dwNumberOfMissionZoneUsers = 0;
DWORD dwNumberOfHuntingZoneUsers = 0;
DWORD dwNumberOfQuestZoneUsers = 0;
DWORD dwNumberOfPVPZoneUsers = 0;
DWORD dwNumberOfEventZoneUsers = 0;
DWORD dwNumberOfGuildZoneUsers = 0;
DWORD dwNumberOfSiegeZoneUsers = 0;
ZONE_MAP_ITER it;
Zone *pZone;
for( it = m_mapVillageZones.begin(); it != m_mapVillageZones.end(); ++it )
{
pZone = it->second;
dwNumberOfVillageUsers += pZone->GetNumberOfUsers();
}
/*
for( it = m_mapBattleZones.begin(); it != m_mapBattleZones.end(); ++it )
{
pZone = it->second;
dwNumberOfBattleZoneUsers += pZone->GetNumberOfUsers();
}
*/
for( it = m_mapLobby.begin(); it != m_mapLobby.end(); ++it )
{
pZone = it->second;
dwNumberOfLobbyUsers += pZone->GetNumberOfUsers();
}
for( it = m_mapMissionZones.begin(); it != m_mapMissionZones.end(); ++it )
{
pZone = it->second;
dwNumberOfMissionZoneUsers += pZone->GetNumberOfUsers();
}
for( it = m_mapHuntingZones.begin(); it != m_mapHuntingZones.end(); ++it )
{
pZone = it->second;
dwNumberOfHuntingZoneUsers += pZone->GetNumberOfUsers();
}
for( it = m_mapQuestZones.begin(); it != m_mapQuestZones.end(); ++it )
{
pZone = it->second;
dwNumberOfQuestZoneUsers += pZone->GetNumberOfUsers();
}
for( it = m_mapPVPZones.begin(); it != m_mapPVPZones.end(); ++it )
{
pZone = it->second;
dwNumberOfPVPZoneUsers += pZone->GetNumberOfUsers();
}
for( it = m_mapEventZones.begin(); it != m_mapEventZones.end(); ++it )
{
pZone = it->second;
dwNumberOfEventZoneUsers += pZone->GetNumberOfUsers();
}
for( it = m_mapGuildZones.begin(); it != m_mapGuildZones.end(); ++it )
{
pZone = it->second;
dwNumberOfGuildZoneUsers += pZone->GetNumberOfUsers();
}
for( it = m_mapSiegeZones.begin(); it != m_mapSiegeZones.end(); ++it )
{
pZone = it->second;
dwNumberOfSiegeZoneUsers += pZone->GetNumberOfUsers();
}
MessageOut(eCRITICAL_LOG, "⒐ Channel No.%d: ", GetChannelID() );
MessageOut(eCRITICAL_LOG, "Total(%d) CharScene(%d) Village(%d) Battle(%d)",
m_mapUsers.size(), m_pCharSceneZone->GetNumberOfUsers(), dwNumberOfVillageUsers, dwNumberOfMissionZoneUsers +
dwNumberOfMissionZoneUsers + dwNumberOfHuntingZoneUsers + dwNumberOfQuestZoneUsers + dwNumberOfPVPZoneUsers +
dwNumberOfEventZoneUsers + dwNumberOfGuildZoneUsers + dwNumberOfSiegeZoneUsers );
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -