本文整理汇总了C++中GetCaptain函数的典型用法代码示例。如果您正苦于以下问题:C++ GetCaptain函数的具体用法?C++ GetCaptain怎么用?C++ GetCaptain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetCaptain函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SetCaptain
void ArenaTeam::SetCaptain(uint64 guid)
{
// Disable remove/promote buttons
Player* oldCaptain = ObjectAccessor::FindPlayer(GetCaptain());
if (oldCaptain)
oldCaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);
// Set new captain
CaptainGuid = guid;
// Update database
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_CAPTAIN);
stmt->setUInt32(0, GUID_LOPART(guid));
stmt->setUInt32(1, GetId());
CharacterDatabase.Execute(stmt);
// Enable remove/promote buttons
if (Player* newCaptain = ObjectAccessor::FindPlayer(guid))
{
newCaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0);
if (oldCaptain)
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].",
oldCaptain->GetName().c_str(), oldCaptain->GetGUIDLow(), newCaptain->GetName().c_str(),
newCaptain->GetGUIDLow(), GetId(), GetType());
}
}
}
开发者ID:Alexdeath,项目名称:FaceCore,代码行数:28,代码来源:ArenaTeam.cpp
示例2: data
void ArenaTeam::Roster(WorldSession *session)
{
Player *pl = NULL;
WorldPacket data(SMSG_ARENA_TEAM_ROSTER, 100);
data << uint32(GetId()); // arena team id
data << uint32(GetMembersSize()); // members count
data << uint32(GetType()); // arena team type?
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
pl = sObjectMgr->GetPlayer(itr->guid);
data << uint64(itr->guid); // guid
data << uint8((pl ? 1 : 0)); // online flag
data << itr->name; // member name
data << uint32((itr->guid == GetCaptain() ? 0 : 1));// captain flag 0 captain 1 member
data << uint8((pl ? pl->getLevel() : 0)); // unknown, level?
data << uint8(itr->Class); // class
data << uint32(itr->games_week); // played this week
data << uint32(itr->wins_week); // wins this week
data << uint32(itr->games_season); // played this season
data << uint32(itr->wins_season); // wins this season
data << uint32(itr->personal_rating); // personal rating
}
session->SendPacket(&data);
sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_ROSTER");
}
开发者ID:Blumfield,项目名称:TBCPvP,代码行数:29,代码来源:ArenaTeam.cpp
示例3: MAKE_NEW_GUID
bool ArenaTeam::LoadMembersFromDB(QueryResult result)
{
if (!result)
return false;
bool captainPresentInTeam = false;
do
{
Field* fields = result->Fetch();
// Prevent crash if db records are broken when all members in result are already processed and current team doesn't have any members
if (!fields)
break;
uint32 arenaTeamId = fields[0].GetUInt32();
// We loaded all members for this arena_team already, break cycle
if (arenaTeamId > TeamId)
break;
ArenaTeamMember newMember;
newMember.Guid = MAKE_NEW_GUID(fields[1].GetUInt32(), 0, HIGHGUID_PLAYER);
newMember.WeekGames = fields[2].GetUInt16();
newMember.WeekWins = fields[3].GetUInt16();
newMember.SeasonGames = fields[4].GetUInt16();
newMember.SeasonWins = fields[5].GetUInt16();
//newMember.Name = fields[6].GetString();
newMember.Class = fields[7].GetUInt8();
newMember.PersonalRating = fields[8].GetUInt16();
newMember.MatchMakerRating = fields[9].GetUInt16() > 0 ? fields[9].GetUInt16() : sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING);;
newMember.MaxMMR = std::max(fields[10].GetUInt16(), newMember.MatchMakerRating);
// Delete member if character information is missing
if (fields[6].GetString().empty())
{
sLog->outErrorDb("ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newMember.Guid));
this->DelMember(newMember.Guid, true);
continue;
}
// Check if team team has a valid captain
if (newMember.Guid == GetCaptain())
captainPresentInTeam = true;
// Put the player in the team
Members.push_back(newMember);
sWorld->UpdateGlobalPlayerArenaTeam(GUID_LOPART(newMember.Guid), GetSlot(), GetId());
}
while (result->NextRow());
if (Empty() || !captainPresentInTeam)
{
// Arena team is empty or captain is not in team, delete from db
;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId);
return false;
}
return true;
}
开发者ID:AzerothShard-Dev,项目名称:azerothcore,代码行数:60,代码来源:ArenaTeam.cpp
示例4: MAKE_NEW_GUID
bool ArenaTeam::LoadMembersFromDB(QueryResult_AutoPtr arenaTeamMembersResult)
{
if (!arenaTeamMembersResult)
return false;
bool captainPresentInTeam = false;
do
{
Field* fields = arenaTeamMembersResult->Fetch();
// prevent crash if db records are broken, when all members in result are already processed and current team hasn't got any members
if (!fields)
break;
uint32 arenaTeamId = fields[0].GetUInt32();
if (arenaTeamId < m_TeamId)
{
// there is in table arena_team_member record which doesn't have arenateamid in arena_team table, report error
sLog.outErrorDb("ArenaTeam %u does not exist but it has record in arena_team_member table, deleting it!", arenaTeamId);
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", arenaTeamId);
continue;
}
if (arenaTeamId > m_TeamId)
// we loaded all members for this arena_team already, break cycle
break;
ArenaTeamMember newmember;
newmember.guid = MAKE_NEW_GUID(fields[1].GetUInt32(), 0, HIGHGUID_PLAYER);
newmember.games_week = fields[2].GetUInt32();
newmember.wins_week = fields[3].GetUInt32();
newmember.games_season = fields[4].GetUInt32();
newmember.wins_season = fields[5].GetUInt32();
newmember.personal_rating = fields[6].GetUInt32();
newmember.name = fields[7].GetCppString();
newmember.Class = fields[8].GetUInt8();
//check if member exists in characters table
if (newmember.name.empty())
{
sLog.outErrorDb("ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newmember.guid));
this->DelMember(newmember.guid);
continue;
}
if (newmember.guid == GetCaptain())
captainPresentInTeam = true;
m_members.push_back(newmember);
}
while (arenaTeamMembersResult->NextRow());
if (Empty() || !captainPresentInTeam)
{
// arena team is empty or captain is not in team, delete from db
sLog.outErrorDb("ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", m_TeamId);
return false;
}
return true;
}
开发者ID:Phentora,项目名称:OregonCore,代码行数:60,代码来源:ArenaTeam.cpp
示例5: SetCaptain
void ArenaTeam::SetCaptain(ObjectGuid guid)
{
// Disable remove/promote buttons
Player* oldCaptain = ObjectAccessor::FindPlayer(GetCaptain());
if (oldCaptain)
oldCaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);
// Set new captain
CaptainGuid = guid;
// Update database
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_CAPTAIN);
stmt->setUInt32(0, guid.GetCounter());
stmt->setUInt32(1, GetId());
CharacterDatabase.Execute(stmt);
// Enable remove/promote buttons
if (Player* newCaptain = ObjectAccessor::FindPlayer(guid))
{
newCaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0);
if (oldCaptain)
{
TC_LOG_DEBUG("bg.arena", "Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u, Name: %s] [Type: %u].",
oldCaptain->GetName().c_str(), oldCaptain->GetGUID().GetCounter(), newCaptain->GetName().c_str(),
newCaptain->GetGUID().GetCounter(), GetId(), GetName().c_str(), GetType());
}
}
}
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:28,代码来源:ArenaTeam.cpp
示例6: SetCaptain
void ArenaTeam::SetCaptain(const uint64& guid)
{
// Disable remove/promote buttons
Player* oldCaptain = ObjectAccessor::FindPlayer(GetCaptain());
if (oldCaptain)
oldCaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);
// Set new captain
CaptainGuid = guid;
// Update database
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHARACTER_UPDATE_ARENA_TEAM_CAPTAIN);
stmt->setUInt32(0, GUID_LOPART(guid));
stmt->setUInt32(1, GetId());
CharacterDatabase.Execute(stmt);
// Enable remove/promote buttons
Player* newCaptain = ObjectAccessor::FindPlayer(guid);
if (newCaptain)
{
newCaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0);
char const* oldCaptainName = oldCaptain ? oldCaptain->GetName() : "";
uint32 oldCaptainLowGuid = oldCaptain ? oldCaptain->GetGUIDLow() : 0;
sLog->outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].",
oldCaptainName, oldCaptainLowGuid, newCaptain->GetName(), newCaptain->GetGUIDLow(), GetId(), GetType());
}
}
开发者ID:Crash911,项目名称:RaptoredSkyFire,代码行数:27,代码来源:ArenaTeam.cpp
示例7: ObjectGuid
bool ArenaTeam::LoadMembersFromDB(QueryResult result)
{
if (!result)
return false;
bool captainPresentInTeam = false;
do
{
Field* fields = result->Fetch();
// Prevent crash if db records are broken when all members in result are already processed and current team doesn't have any members
if (!fields)
break;
uint32 arenaTeamId = fields[0].GetUInt32();
// We loaded all members for this arena_team already, break cycle
if (arenaTeamId > TeamId)
break;
ArenaTeamMember newMember;
newMember.Guid = ObjectGuid(HighGuid::Player, fields[1].GetUInt32());
newMember.WeekGames = fields[2].GetUInt16();
newMember.WeekWins = fields[3].GetUInt16();
newMember.SeasonGames = fields[4].GetUInt16();
newMember.SeasonWins = fields[5].GetUInt16();
newMember.Name = fields[6].GetString();
newMember.Class = fields[7].GetUInt8();
newMember.PersonalRating = fields[8].GetUInt16();
newMember.MatchMakerRating = fields[9].GetUInt16() > 0 ? fields[9].GetUInt16() : sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING);
// Delete member if character information is missing
if (newMember.Name.empty())
{
TC_LOG_ERROR("sql.sql", "ArenaTeam %u has member with empty name - probably %s doesn't exist, deleting him from memberlist!", arenaTeamId, newMember.Guid.ToString().c_str());
DelMember(newMember.Guid, true);
continue;
}
// Check if team team has a valid captain
if (newMember.Guid == GetCaptain())
captainPresentInTeam = true;
// Put the player in the team
Members.push_back(newMember);
sCharacterCache->UpdateCharacterArenaTeamId(newMember.Guid, GetSlot(), GetId());
}
while (result->NextRow());
if (Empty() || !captainPresentInTeam)
{
// Arena team is empty or captain is not in team, delete from db
TC_LOG_DEBUG("bg.arena", "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId);
return false;
}
return true;
}
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:59,代码来源:ArenaTeam.cpp
示例8: MAKE_NEW_GUID
bool ArenaTeam::LoadMembersFromDB(QueryResult result)
{
if (!result)
return false;
bool captainPresentInTeam = false;
do
{
Field* fields = result->Fetch();
// Prevent crash if db records are broken when all members in result are already processed and current team doesn't have any members
if (!fields)
break;
uint32 arenaTeamId = fields[0].GetUInt32();
// We loaded all members for this arena_team already, break cycle
if (arenaTeamId > TeamId)
break;
ArenaTeamMember newMember;
newMember.Guid = MAKE_NEW_GUID(fields[1].GetUInt32(), 0, HIGHGUID_PLAYER);
newMember.WeekGames = fields[2].GetUInt16();
newMember.WeekWins = fields[3].GetUInt16();
newMember.SeasonGames = fields[4].GetUInt16();
newMember.SeasonWins = fields[5].GetUInt16();
newMember.Name = fields[6].GetString();
newMember.Class = fields[7].GetUInt8();
newMember.PersonalRating = fields[8].GetUInt16();
newMember.MatchMakerRating = fields[9].GetUInt16() > 0 ? fields[9].GetUInt16() : 1500;
// Delete member if character information is missing
if (newMember.Name.empty())
{
TC_LOG_ERROR(LOG_FILTER_SQL, "ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newMember.Guid));
DelMember(newMember.Guid, true);
continue;
}
// Check if team team has a valid captain
if (newMember.Guid == GetCaptain())
captainPresentInTeam = true;
// Put the player in the team
Members.push_back(newMember);
}
while (result->NextRow());
if (Empty() || !captainPresentInTeam)
{
// Arena team is empty or captain is not in team, delete from db
TC_LOG_DEBUG(LOG_FILTER_ARENAS, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId);
return false;
}
return true;
}
开发者ID:Brokentrojan,项目名称:TrinityCore,代码行数:58,代码来源:ArenaTeam.cpp
示例9: data
void ArenaTeam::Roster(WorldSession *session)
{
Player *pl = NULL;
WorldPacket data(SMSG_ARENA_TEAM_ROSTER, 100);
data << uint32(GetId()); // arena team id
data << uint32(GetMembersSize()); // members count
data << uint32(GetType()); // arena team type?
for (MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
{
pl = objmgr.GetPlayer(itr->guid);
if(pl)
{
data << uint64(pl->GetGUID()); // guid
data << uint8(1); // online flag
data << pl->GetName(); // member name
data << uint32(itr->guid == GetCaptain() ? 0 : 1);// unknown
data << uint8(pl->getLevel()); // unknown, probably level
data << uint8(pl->getClass()); // class
data << uint32(itr->games_week); // played this week
data << uint32(itr->wins_week); // wins this week
data << uint32(itr->games_season); // played this season
data << uint32(itr->wins_season); // wins this season
data << uint32(itr->personal_rating); // personal rating
}
else
{
data << uint64(itr->guid); // guid
data << uint8(0); // online flag
data << itr->name; // member name
data << uint32(itr->guid == GetCaptain() ? 0 : 1);// unknown
data << uint8(0); // unknown, level?
data << uint8(itr->Class); // class
data << uint32(itr->games_week); // played this week
data << uint32(itr->wins_week); // wins this week
data << uint32(itr->games_season); // played this season
data << uint32(itr->wins_season); // wins this season
data << uint32(itr->personal_rating); // personal rating
}
}
session->SendPacket(&data);
sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_ROSTER");
}
开发者ID:Cha0Sxx,项目名称:mangos,代码行数:44,代码来源:ArenaTeam.cpp
示例10: Execute
private func Execute()
{
// Alle Spieler überprüfen
var iPlrCnt, iPlr = 0;
for (iPlrCnt = GetPlayerCount(); iPlrCnt; iPlr++)
if (GetPlayerName(iPlr))
{
iPlrCnt--;
if (GetPlayerTeam(iPlr) != -1) if (!GetCaptain(iPlr))
EliminatePlayer(iPlr);
}
}
开发者ID:clonkspot,项目名称:cr-content,代码行数:12,代码来源:Script.c
示例11: SetCaptain
void ArenaTeam::SetCaptain(const uint64& guid)
{
// disable remove/promote buttons
Player *oldcaptain = sObjectMgr.GetPlayer(GetCaptain());
if (oldcaptain)
oldcaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);
// set new captain
m_CaptainGuid = guid;
// update database
CharacterDatabase.PExecute("UPDATE arena_team SET captainguid = '%u' WHERE arenateamid = '%u'", GUID_LOPART(guid), m_TeamId);
// enable remove/promote buttons
Player *newcaptain = sObjectMgr.GetPlayer(guid);
if (newcaptain)
newcaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0);
}
开发者ID:Archives,项目名称:try,代码行数:18,代码来源:ArenaTeam.cpp
示例12: SetCaptain
void ArenaTeam::SetCaptain(const uint64& guid)
{
// disable remove/promote buttons
Player *oldcaptain = objmgr.GetPlayer(GetCaptain());
if(oldcaptain)
oldcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * ARENA_TEAM_END) + ARENA_TEAM_MEMBER, 1);
// set new captain
m_CaptainGuid = guid;
// update database
CharacterDatabase.PExecute("UPDATE arena_team SET captainguid = '%u' WHERE arenateamid = '%u'", GUID_LOPART(guid), m_TeamId);
// enable remove/promote buttons
Player *newcaptain = objmgr.GetPlayer(guid);
if(newcaptain)
newcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * ARENA_TEAM_END) + ARENA_TEAM_MEMBER, 0);
}
开发者ID:1thew,项目名称:mangos,代码行数:18,代码来源:ArenaTeam.cpp
示例13: data
void ArenaTeam::Roster(WorldSession* session)
{
Player* player = NULL;
uint8 unk308 = 0;
std::string tempName;
WorldPacket data(SMSG_ARENA_TEAM_ROSTER, 100);
data << uint32(GetId()); // team id
data << uint8(unk308); // 308 unknown value but affect packet structure
data << uint32(GetMembersSize()); // members count
data << uint32(GetType()); // arena team type?
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
player = ObjectAccessor::FindPlayerInOrOutOfWorld(itr->Guid);
data << uint64(itr->Guid); // guid
data << uint8((player ? 1 : 0)); // online flag
tempName = "";
sObjectMgr->GetPlayerNameByGUID(itr->Guid, tempName);
data << tempName; // member name
data << uint32((itr->Guid == GetCaptain() ? 0 : 1));// captain flag 0 captain 1 member
data << uint8((player ? player->getLevel() : 0)); // unknown, level?
data << uint8(itr->Class); // class
data << uint32(itr->WeekGames); // played this week
data << uint32(itr->WeekWins); // wins this week
data << uint32(itr->SeasonGames); // played this season
data << uint32(itr->SeasonWins); // wins this season
data << uint32(itr->PersonalRating); // personal rating
if (unk308)
{
data << float(0.0f); // 308 unk
data << float(0.0f); // 308 unk
}
}
session->SendPacket(&data);
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_ROSTER");
#endif
}
开发者ID:Helias,项目名称:azerothcore-wotlk,代码行数:42,代码来源:ArenaTeam.cpp
示例14: SetCaptain
void ArenaTeam::SetCaptain(const uint64& guid)
{
// disable remove/promote buttons
Player *oldcaptain = sObjectMgr->GetPlayer(GetCaptain());
if (oldcaptain)
oldcaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);
// set new captain
m_CaptainGuid = guid;
// update database
CharacterDatabase.PExecute("UPDATE arena_team SET captainguid = '%u' WHERE arenateamid = '%u'", GUID_LOPART(guid), GetId());
// enable remove/promote buttons
if (Player *newcaptain = sObjectMgr->GetPlayer(guid))
{
newcaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0);
sLog->outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", oldcaptain->GetName(), oldcaptain->GetGUIDLow(), newcaptain->GetName(), newcaptain->GetGUIDLow(), GetId(), GetType());
}
}
开发者ID:Blumfield,项目名称:TBCPvP,代码行数:20,代码来源:ArenaTeam.cpp
示例15: SetCaptain
void ArenaTeam::SetCaptain(const uint64& guid)
{
// disable remove/promote buttons
Player *oldcaptain = objmgr.GetPlayer(GetCaptain());
if (oldcaptain)
oldcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 6), 1);
// set new captain
m_CaptainGuid = guid;
// update database
CharacterDatabase.PExecute("UPDATE arena_team SET captainguid = '%u' WHERE arenateamid = '%u'", GUID_LOPART(guid), GetId());
// enable remove/promote buttons
Player *newcaptain = objmgr.GetPlayer(guid);
if (newcaptain)
{
newcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 6), 0);
sLog.outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", oldcaptain->GetName(), oldcaptain->GetGUIDLow(), newcaptain->GetName(), newcaptain->GetGUID(), GetId(), GetType());
}
}
开发者ID:Zekom,项目名称:NeoCore,代码行数:21,代码来源:ArenaTeam.cpp
示例16: GetCaptain
void ArenaTeam::SetCaptain(uint64 guid)
{
// disable remove/promote buttons
Player *oldcaptain = objmgr.GetPlayer(GetCaptain());
if(oldcaptain)
oldcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 6), 1);
else
Player::SetUInt32ValueInDB(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 6), 1, GetCaptain());
// set new captain
CaptainGuid = guid;
// update database
CharacterDatabase.PExecute("UPDATE arena_team SET captainguid = '%u' WHERE arenateamid = '%u'", GUID_LOPART(guid), Id);
// enable remove/promote buttons
Player *newcaptain = objmgr.GetPlayer(guid);
if(newcaptain)
newcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 6), 0);
else
Player::SetUInt32ValueInDB(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 6), 0, guid);
}
开发者ID:Cha0Sxx,项目名称:mangos,代码行数:22,代码来源:ArenaTeam.cpp
示例17: data
void ArenaTeam::Roster(WorldSession* session)
{
Player* player = nullptr;
uint8 unk308 = 0;
WorldPacket data(SMSG_ARENA_TEAM_ROSTER, 100);
data << uint32(GetId()); // team id
data << uint8(unk308); // 3.0.8 unknown value but affect packet structure
data << uint32(GetMembersSize()); // members count
data << uint32(GetType()); // arena team type?
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
player = ObjectAccessor::FindConnectedPlayer(itr->Guid);
data << uint64(itr->Guid); // guid
data << uint8((player ? 1 : 0)); // online flag
data << itr->Name; // member name
data << uint32((itr->Guid == GetCaptain() ? 0 : 1)); // captain flag 0 captain 1 member
data << uint8((player ? player->getLevel() : 0)); // unknown, level?
data << uint8(itr->Class); // class
data << uint32(itr->WeekGames); // played this week
data << uint32(itr->WeekWins); // wins this week
data << uint32(itr->SeasonGames); // played this season
data << uint32(itr->SeasonWins); // wins this season
data << uint32(itr->PersonalRating); // personal rating
//if (unk308)
//{
// data << float(0.0f); // 308 unk
// data << float(0.0f); // 308 unk
//}
}
session->SendPacket(&data);
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_ARENA_TEAM_ROSTER");
}
开发者ID:ElunaLuaEngine,项目名称:ElunaTrinityWotlk,代码行数:37,代码来源:ArenaTeam.cpp
示例18: data
void ArenaTeam::Roster(WorldSession* session)
{
Player* pl = NULL;
uint8 unk308 = 0;
WorldPacket data(SMSG_ARENA_TEAM_ROSTER, 100);
data << uint32(GetId()); // team id
data << uint8(unk308); // 308 unknown value but affect packet structure
data << uint32(GetMembersSize()); // members count
data << uint32(GetType()); // arena team type?
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
pl = sObjectMgr->GetPlayer(itr->Guid);
data << uint64(itr->Guid); // guid
data << uint8((pl ? 1 : 0)); // online flag
data << itr->Name; // member name
data << uint32((itr->Guid == GetCaptain() ? 0 : 1));// captain flag 0 captain 1 member
data << uint8((pl ? pl->getLevel() : 0)); // unknown, level?
data << uint8(itr->Class); // class
data << uint32(itr->WeekGames); // played this week
data << uint32(itr->WeekWins); // wins this week
data << uint32(itr->SeasonGames); // played this season
data << uint32(itr->SeasonWins); // wins this season
data << uint32(itr->PersonalRating); // personal rating
if (unk308)
{
data << float(0.0); // 308 unk
data << float(0.0); // 308 unk
}
}
session->SendPacket(&data);
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_ROSTER");
}
开发者ID:hodobaj,项目名称:ChaosCore,代码行数:37,代码来源:ArenaTeam.cpp
示例19: GUID_LOPART
bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string arenaTeamName, bool skipChecks)
{
if (!skipChecks)
{
if (!sObjectMgr->GetPlayer(captainGuid)) // player not exist
return false;
if (sObjectMgr->GetArenaTeamByName(arenaTeamName)) // arena team with this name already exist
return false;
}
sLog->outDebug("GUILD: creating arena team %s to leader: %u", arenaTeamName.c_str(), GUID_LOPART(captainGuid));
m_CaptainGuid = captainGuid;
m_Name = arenaTeamName;
m_Type = type;
m_TeamId = sObjectMgr->GenerateArenaTeamId();
// ArenaTeamName already assigned to ArenaTeam::name, use it to encode string for DB
CharacterDatabase.EscapeString(arenaTeamName);
CharacterDatabase.BeginTransaction();
// CharacterDatabase.PExecute("DELETE FROM arena_team WHERE arenateamid='%u'", m_TeamId); - MAX(arenateam)+1 not exist
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid='%u'", m_TeamId);
CharacterDatabase.PExecute("INSERT INTO arena_team (arenateamid, name, captainguid, type, BackgroundColor, EmblemStyle, EmblemColor, BorderStyle, BorderColor) "
"VALUES('%u', '%s', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')",
m_TeamId, arenaTeamName.c_str(), GUID_LOPART(m_CaptainGuid), m_Type, m_BackgroundColor, m_EmblemStyle, m_EmblemColor, m_BorderStyle, m_BorderColor);
CharacterDatabase.PExecute("INSERT INTO arena_team_stats (arenateamid, rating, games, wins, played, wins2, rank) VALUES "
"('%u', '%u', '%u', '%u', '%u', '%u', '%u')", m_TeamId, m_stats.rating, m_stats.games_week, m_stats.wins_week, m_stats.games_season, m_stats.wins_season, m_stats.rank);
CharacterDatabase.CommitTransaction();
AddMember(m_CaptainGuid);
sLog->outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain GUID: %u]", GetId(), GetType(), GetCaptain());
return true;
}
开发者ID:Blumfield,项目名称:TBCPvP,代码行数:36,代码来源:ArenaTeam.cpp
注:本文中的GetCaptain函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论