本文整理汇总了C++中GetAccountData函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAccountData函数的具体用法?C++ GetAccountData怎么用?C++ GetAccountData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetAccountData函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: data
void WorldSession::SendAccountDataTimes(uint32 mask) {
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4 + 1 + 4 + 8 * 4); // changed in WotLK
data << uint32(time(NULL)); // unix time of something
data << uint8(1);
data << uint32(mask); // type mask
for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
if (mask & (1 << i))
data << uint32(GetAccountData(AccountDataType(i))->Time); // also unix time
SendPacket(&data);
}
开发者ID:dsstest,项目名称:ArkCORE,代码行数:10,代码来源:WorldSession.cpp
示例2: data
void WorldSession::SendAccountDataTimes(uint32 mask)
{
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4+1+4+NUM_ACCOUNT_DATA_TYPES*4);
data << uint32(time(NULL)); // Server time
data << uint8(0);
data << uint32(mask); // type mask
for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
if (mask & (1 << i))
data << uint32(GetAccountData(AccountDataType(i))->Time);// also unix time
SendPacket(&data);
}
开发者ID:RezolveX,项目名称:MistCore_Eluna,代码行数:11,代码来源:WorldSession.cpp
示例3: data
void WorldSession::SendAccountDataTimes(uint32 mask)
{
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4 + 1 + 4 + NUM_ACCOUNT_DATA_TYPES * 4);
data << uint32(mask); // type mask
data << uint32(time(NULL)); // unix time of something
for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
data << uint32(GetAccountData(AccountDataType(i))->Time);// also unix time
data.WriteBit(1);
SendPacket(&data);
}
开发者ID:Chuck5ta,项目名称:server-4,代码行数:13,代码来源:WorldSession.cpp
示例4: data
void WorldSession::SendAccountDataTimes(uint32 mask)
{
#if VERSION_STRING == TBC
StackWorldPacket<128> data(SMSG_ACCOUNT_DATA_TIMES);
for (auto i = 0; i < 32; ++i)
data << uint32(0);
SendPacket(&data);
return;
MD5Hash md5hash;
for (int i = 0; i < 8; ++i)
{
AccountDataEntry* acct_data = GetAccountData(i);
if (!acct_data->data)
{
data << uint64(0) << uint64(0);
continue;
}
md5hash.Initialize();
md5hash.UpdateData((const uint8*)acct_data->data, acct_data->sz);
md5hash.Finalize();
data.Write(md5hash.GetDigest(), MD5_DIGEST_LENGTH);
}
#else
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4 + 1 + 4 + 8 * 4); // changed in WotLK
data << uint32(UNIXTIME); // unix time of something
data << uint8(1);
data << uint32(mask); // type mask
for (uint8 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
{
if (mask & (1 << i))
{
// data << uint32(GetAccountData(AccountDataType(i))->Time);
// also unix time
data << uint32(0);
}
}
#endif
SendPacket(&data);
}
开发者ID:armm77,项目名称:AscEmu,代码行数:42,代码来源:WorldSession.cpp
示例5: data
void WorldSession::SendAccountDataTimes(uint32 mask)
{
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4 + 1 + 4 + NUM_ACCOUNT_DATA_TYPES * 4);
data << uint32(time(NULL)); // Server time
data << uint8(1);
data << uint32(mask); // type mask
for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
if (mask & (1 << i))
data << uint32(GetAccountData(AccountDataType(i))->Time);// also unix time
SendPacket(&data);
std::string l_TimeZone1 = "Europe/Paris";
std::string l_TimeZone2 = "Europe/Paris";
WorldPacket data2(SMSG_SET_TIME_ZONE);
data2.WriteBits(l_TimeZone1.length(), 9);
data2.WriteBits(l_TimeZone2.length(), 9);
data2.FlushBits();
data2.WriteString(l_TimeZone1);
data2.WriteString(l_TimeZone2);
SendPacket(&data2);
}
开发者ID:Adeer,项目名称:Patchs,代码行数:24,代码来源:WorldSession.cpp
示例6: Player
void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
{
uint64 playerGuid = holder->GetGuid();
Player* pCurrChar = new Player(this);
pCurrChar->GetMotionMaster()->Initialize();
// "GetAccountId()==db stored account id" checked in LoadFromDB (prevent login not own character using cheating tools)
if(!pCurrChar->LoadFromDB(GUID_LOPART(playerGuid), holder))
{
KickPlayer(); // disconnect client, player no set to session and it will not deleted or saved at kick
delete pCurrChar; // delete it manually
delete holder; // delete all unprocessed queries
m_playerLoading = false;
return;
}
SetPlayer(pCurrChar);
pCurrChar->SendDungeonDifficulty(false);
WorldPacket data( SMSG_LOGIN_VERIFY_WORLD, 20 );
data << pCurrChar->GetMapId();
data << pCurrChar->GetPositionX();
data << pCurrChar->GetPositionY();
data << pCurrChar->GetPositionZ();
data << pCurrChar->GetOrientation();
SendPacket(&data);
data.Initialize( SMSG_ACCOUNT_DATA_TIMES, 4+1+8*4 ); // changed in WotLK
data << uint32(time(NULL)); // unix time of something
data << uint8(1);
for(int i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
data << uint32(GetAccountData(i)->Time); // also unix time
SendPacket(&data);
data.Initialize(SMSG_FEATURE_SYSTEM_STATUS, 2); // added in 2.2.0
data << uint8(2); // unknown value
data << uint8(0); // enable(1)/disable(0) voice chat interface in client
SendPacket(&data);
// Send MOTD
{
data.Initialize(SMSG_MOTD, 50); // new in 2.0.1
data << (uint32)0;
uint32 linecount=0;
std::string str_motd = sWorld.GetMotd();
std::string::size_type pos, nextpos;
pos = 0;
while ( (nextpos= str_motd.find('@',pos)) != std::string::npos )
{
if (nextpos != pos)
{
data << str_motd.substr(pos,nextpos-pos);
++linecount;
}
pos = nextpos+1;
}
if (pos<str_motd.length())
{
data << str_motd.substr(pos);
++linecount;
}
data.put(0, linecount);
SendPacket( &data );
DEBUG_LOG( "WORLD: Sent motd (SMSG_MOTD)" );
}
data.Initialize(SMSG_LEARNED_DANCE_MOVES, 4+4);
data << uint32(0);
data << uint32(0);
SendPacket(&data);
//QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow());
QueryResult *resultGuild = holder->GetResult(PLAYER_LOGIN_QUERY_LOADGUILD);
if(resultGuild)
{
Field *fields = resultGuild->Fetch();
pCurrChar->SetInGuild(fields[0].GetUInt32());
pCurrChar->SetRank(fields[1].GetUInt32());
delete resultGuild;
}
else if(pCurrChar->GetGuildId()) // clear guild related fields in case wrong data about non existed membership
{
pCurrChar->SetInGuild(0);
pCurrChar->SetRank(0);
}
if(pCurrChar->GetGuildId() != 0)
{
Guild* guild = objmgr.GetGuildById(pCurrChar->GetGuildId());
if(guild)
{
data.Initialize(SMSG_GUILD_EVENT, (2+guild->GetMOTD().size()+1));
//.........这里部分代码省略.........
开发者ID:Nerador,项目名称:mangos,代码行数:101,代码来源:CharacterHandler.cpp
示例7: DEBUG_LOG
//.........这里部分代码省略.........
info->race = plr->getRace();
info->team = plr->GetTeam();
objmgr.AddPlayerInfo(info);
}
plr->m_playerInfo = info;
if(plr->m_playerInfo->guild)
{
plr->m_uint32Values[PLAYER_GUILDID] = plr->m_playerInfo->guild->GetGuildId();
plr->m_uint32Values[PLAYER_GUILDRANK] = plr->m_playerInfo->guildRank->iId;
}
for(uint32 z = 0; z < NUM_ARENA_TEAM_TYPES; ++z)
{
if(_player->m_playerInfo->arenaTeam[z] != NULL)
{
_player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (z*7), _player->m_playerInfo->arenaTeam[z]->m_id);
if(_player->m_playerInfo->arenaTeam[z]->m_leader == _player->GetLowGUID())
_player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (z*7) + 1, 0);
else
_player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (z*7) + 1, 1);
}
}
info->m_loggedInPlayer = plr;
// account data == UI config
if(sWorld.m_useAccountData)
{
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4+1+4+8*4);
MD5Hash md5hash;
data << uint32(UNIXTIME) << uint8(1) << uint32(0xEA);
for (int i = 0; i < 8; i++)
{
AccountDataEntry* acct_data = GetAccountData(i);
if(0xEA & (1 << i))
data << uint32(acct_data->Time);
md5hash.Initialize();
md5hash.UpdateData((const uint8*)acct_data->data, acct_data->sz);
md5hash.Finalize();
}
SendPacket(&data);
}
else
{
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4+1+4+8*4);
MD5Hash md5hash;
data << uint32(UNIXTIME) << uint8(1) << uint32(0xEA);
for (int i = 0; i < 8; i++)
{
if(0xEA & (1 << i))
data << uint32(0);
AccountDataEntry* acct_data = GetAccountData(i);
if(acct_data)
{
md5hash.Initialize();
md5hash.UpdateData((const uint8*)acct_data->data, acct_data->sz);
md5hash.Finalize();
}
}
SendPacket(&data);
}
// Set TIME OF LOGIN
CharacterDatabase.Execute("UPDATE characters SET online = 1 WHERE guid = %u" , plr->GetLowGUID());
_player->ResetTitansGrip();
开发者ID:Refuge89,项目名称:Arc_Mind,代码行数:67,代码来源:CharacterHandler.cpp
示例8: SetPlayer
void WorldSession::FullLogin(Player * plr)
{
Log.Debug("WorldSession", "Fully loading player %u", plr->GetLowGUID());
SetPlayer(plr);
m_MoverWoWGuid.Init(plr->GetGUID());
// copy to movement array
movement_packet[0] = m_MoverWoWGuid.GetNewGuidMask();
memcpy(&movement_packet[1], m_MoverWoWGuid.GetNewGuid(), m_MoverWoWGuid.GetNewGuidLen());
#ifndef USING_BIG_ENDIAN
StackWorldPacket<20> datab(CMSG_DUNGEON_DIFFICULTY);
#else
WorldPacket datab(CMSG_DUNGEON_DIFFICULTY, 20);
#endif
datab << plr->iInstanceType;
datab << uint32(0x01);
datab << uint32(0x00);
SendPacket(&datab);
/* world preload */
packetSMSG_LOGIN_VERIFY_WORLD vwpck;
vwpck.MapId = plr->GetMapId();
vwpck.O = plr->GetOrientation();
vwpck.X = plr->GetPositionX();
vwpck.Y = plr->GetPositionY();
vwpck.Z = plr->GetPositionZ();
OutPacket( SMSG_LOGIN_VERIFY_WORLD, sizeof(packetSMSG_LOGIN_VERIFY_WORLD), &vwpck );
// send voicechat state - active/inactive
/*
{SERVER} Packet: (0x03C7) UNKNOWN PacketSize = 2
|------------------------------------------------|----------------|
|00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |0123456789ABCDEF|
|------------------------------------------------|----------------|
|02 01 |.. |
-------------------------------------------------------------------
*/
#ifdef VOICE_CHAT
datab.Initialize(SMSG_VOICE_SYSTEM_STATUS);
datab << uint8(2) << uint8(sVoiceChatHandler.CanUseVoiceChat() ? 1 : 0);
SendPacket(&datab);
#else
datab.Initialize(SMSG_VOICE_SYSTEM_STATUS);
datab << uint8(2) << uint8(0);
#endif
plr->UpdateAttackSpeed();
/*if(plr->getLevel()>70)
plr->SetUInt32Value(UNIT_FIELD_LEVEL,70);*/
// enable trigger cheat by default
plr->triggerpass_cheat = HasGMPermissions();
// Make sure our name exists (for premade system)
PlayerInfo * info = objmgr.GetPlayerInfo(plr->GetLowGUID());
if(info == 0)
{
info = new PlayerInfo;
info->cl = plr->getClass();
info->gender = plr->getGender();
info->guid = plr->GetLowGUID();
info->name = strdup(plr->GetName());
info->lastLevel = plr->getLevel();
info->lastOnline = UNIXTIME;
info->lastZone = plr->GetZoneId();
info->race = plr->getRace();
info->team = plr->GetTeam();
info->guild=NULL;
info->guildRank=NULL;
info->guildMember=NULL;
info->m_Group=0;
info->subGroup=0;
objmgr.AddPlayerInfo(info);
}
plr->m_playerInfo = info;
if(plr->m_playerInfo->guild)
{
plr->m_uint32Values[PLAYER_GUILDID] = plr->m_playerInfo->guild->GetGuildId();
plr->m_uint32Values[PLAYER_GUILDRANK] = plr->m_playerInfo->guildRank->iId;
}
info->m_loggedInPlayer = plr;
// account data == UI config
#ifndef USING_BIG_ENDIAN
StackWorldPacket<128> data(SMSG_ACCOUNT_DATA_MD5);
#else
WorldPacket data(SMSG_ACCOUNT_DATA_MD5, 128);
#endif
MD5Hash md5hash;
for (int i = 0; i < 8; i++)
{
AccountDataEntry* acct_data = GetAccountData(i);
if (!acct_data->data)
{
//.........这里部分代码省略.........
开发者ID:AwkwardDev,项目名称:ascent_classic,代码行数:101,代码来源:CharacterHandler.cpp
示例9: SetPlayer
//.........这里部分代码省略.........
info->name = strdup(plr->GetName());
info->lastLevel = plr->getLevel();
info->lastOnline = UNIXTIME;
info->lastZone = plr->GetZoneId();
info->race = plr->getRace();
info->team = plr->GetTeam();
info->guild=NULL;
info->guildRank=NULL;
info->guildMember=NULL;
info->m_Group=0;
info->subGroup=0;
objmgr.AddPlayerInfo(info);
}
plr->m_playerInfo = info;
if(plr->m_playerInfo->guild)
{
plr->m_uint32Values[PLAYER_GUILDID] = plr->m_playerInfo->guild->GetGuildId();
plr->m_uint32Values[PLAYER_GUILDRANK] = plr->m_playerInfo->guildRank->iId;
}
info->m_loggedInPlayer = plr;
// account data == UI config
#ifndef USING_BIG_ENDIAN
StackWorldPacket<128> data(SMSG_ACCOUNT_DATA_MD5);
#else
WorldPacket data(SMSG_ACCOUNT_DATA_MD5, 128);
#endif
MD5Hash md5hash;
for (int i = 0; i < 8; i++)
{
AccountDataEntry* acct_data = GetAccountData(i);
if (!acct_data->data)
{
data << uint64(0) << uint64(0); // Nothing.
continue;
}
md5hash.Initialize();
md5hash.UpdateData((const uint8*)acct_data->data, acct_data->sz);
md5hash.Finalize();
#ifndef USING_BIG_ENDIAN
data.Write(md5hash.GetDigest(), MD5_DIGEST_LENGTH);
#else
data.append(md5hash.GetDigest(), MD5_DIGEST_LENGTH);
#endif
}
SendPacket(&data);
// Set TIME OF LOGIN
CharacterDatabase.Execute("UPDATE characters SET online = 1 WHERE guid = %u" , plr->GetLowGUID());
bool enter_world = true;
#ifndef CLUSTERING
// Find our transporter and add us if we're on one.
if(plr->m_TransporterGUID != 0)
{
Transporter * pTrans = objmgr.GetTransporter(GUID_LOPART(plr->m_TransporterGUID));
if(pTrans)
{
if(plr->isDead())
{
plr->ResurrectPlayer();
开发者ID:Naqvamp,项目名称:Sandbox,代码行数:67,代码来源:CharacterHandler.cpp
示例10: SetPlayer
//.........这里部分代码省略.........
info->team = plr->GetTeam();
objmgr.AddPlayerInfo(info);
}
plr->m_playerInfo = info;
if(plr->m_playerInfo->GuildId)
{
plr->m_uint32Values[PLAYER_GUILDID] = plr->m_playerInfo->GuildId;
plr->m_uint32Values[PLAYER_GUILDRANK] = plr->m_playerInfo->GuildRank;
}
for(uint32 z = 0; z < NUM_ARENA_TEAM_TYPES; ++z)
{
if(plr->m_playerInfo->arenaTeam[z] != NULL)
{
plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (z*6), plr->m_playerInfo->arenaTeam[z]->m_id);
if(plr->m_playerInfo->arenaTeam[z]->m_leader == plr->GetLowGUID())
plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (z*6) + 1, 0);
else
plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (z*6) + 1, 1);
}
}
info->m_loggedInPlayer = plr;
// account data == UI config
if(sWorld.m_useAccountData)
{
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4+1+4+8*4);
MD5Hash md5hash;
data << uint32(UNIXTIME) << uint8(1) << uint32(0xEA);
for (int i = 0; i < 8; i++)
{
AccountDataEntry* acct_data = GetAccountData(i);
if(0xEA & (1 << i))
data << uint32(acct_data->Time);
md5hash.Initialize();
md5hash.UpdateData((const uint8*)acct_data->data, acct_data->sz);
md5hash.Finalize();
}
SendPacket(&data);
}
else
{
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4+1+4+8*4);
MD5Hash md5hash;
data << uint32(UNIXTIME) << uint8(1) << uint32(0xEA);
for (int i = 0; i < 8; i++)
{
if(0xEA & (1 << i))
data << uint32(0);
AccountDataEntry* acct_data = GetAccountData(i);
if(acct_data)
{
md5hash.Initialize();
md5hash.UpdateData((const uint8*)acct_data->data, acct_data->sz);
md5hash.Finalize();
}
}
SendPacket(&data);
}
// Set TIME OF LOGIN
CharacterDatabase.Execute("UPDATE characters SET online = 1 WHERE guid = %u" , plr->GetLowGUID());
bool enter_world = true;
开发者ID:Sandshroud,项目名称:Sandshroud-Prodigy,代码行数:67,代码来源:CharacterHandler.cpp
示例11: GetAccountData
bool FOnlineFriendFacebook::GetUserAttribute(const FString& AttrName, FString& OutAttrValue) const
{
return GetAccountData(AttrName, OutAttrValue);
}
开发者ID:johndpope,项目名称:UE4,代码行数:4,代码来源:OnlineFriendsFacebook.cpp
示例12: DEBUG_LOG
//.........这里部分代码省略.........
info->race = plr->getRace();
info->team = plr->GetTeam();
objmgr.AddPlayerInfo(info);
}
plr->m_playerInfo = info;
if(plr->m_playerInfo->guild)
{
plr->m_uint32Values[PLAYER_GUILDID] = plr->m_playerInfo->guild->GetGuildId();
plr->m_uint32Values[PLAYER_GUILDRANK] = plr->m_playerInfo->guildRank->iId;
}
for(uint32 z = 0; z < NUM_ARENA_TEAM_TYPES; ++z)
{
if(plr->m_playerInfo->arenaTeam[z] != NULL)
{
plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (z*6), plr->m_playerInfo->arenaTeam[z]->m_id);
if(plr->m_playerInfo->arenaTeam[z]->m_leader == plr->GetLowGUID())
plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (z*6) + 1, 0);
else
plr->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (z*6) + 1, 1);
}
}
info->m_loggedInPlayer = plr;
// account data == UI config
if(sWorld.m_useAccountData)
{
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4+1+4+8*4);
MD5Hash md5hash;
data << uint32(UNIXTIME) << uint8(1) << uint32(0xEA);
for (int i = 0; i < 8; i++)
{
AccountDataEntry* acct_data = GetAccountData(i);
if(0xEA & (1 << i))
data << uint32(acct_data->Time);
md5hash.Initialize();
md5hash.UpdateData((const uint8*)acct_data->data, acct_data->sz);
md5hash.Finalize();
}
SendPacket(&data);
}
else
{
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4+1+4+8*4);
MD5Hash md5hash;
data << uint32(UNIXTIME) << uint8(1) << uint32(0xEA);
for (int i = 0; i < 8; i++)
{
if(0xEA & (1 << i))
data << uint32(0);
AccountDataEntry* acct_data = GetAccountData(i);
if(acct_data)
{
md5hash.Initialize();
md5hash.UpdateData((const uint8*)acct_data->data, acct_data->sz);
md5hash.Finalize();
}
}
SendPacket(&data);
}
// Set TIME OF LOGIN
CharacterDatabase.Execute ("UPDATE characters SET online = 1 WHERE guid = %u" , plr->GetLowGUID());
bool enter_world = true;
开发者ID:SkyFire,项目名称:sandshroud,代码行数:67,代码来源:CharacterHandler.cpp
注:本文中的GetAccountData函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论