本文整理汇总了C++中CSteamID::ConvertToUint64方法的典型用法代码示例。如果您正苦于以下问题:C++ CSteamID::ConvertToUint64方法的具体用法?C++ CSteamID::ConvertToUint64怎么用?C++ CSteamID::ConvertToUint64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSteamID
的用法示例。
在下文中一共展示了CSteamID::ConvertToUint64方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getLuaSteamPlugin
static bgfx::TextureHandle* LUA_GetAvatar(lua_State* L, int friend_idx)
{
auto* that = getLuaSteamPlugin(L);
if (!that) return nullptr;
IAllocator& allocator = that->m_engine.getAllocator();
ISteamFriends* friends = SteamFriends();
if (!friends) return nullptr;
CSteamID id = friends->GetFriendByIndex(friend_idx, k_EFriendFlagAll);
auto iter = that->m_avatars.find(id.ConvertToUint64());
if (iter.isValid()) return &iter.value()->handle;
int avatar = friends->GetMediumFriendAvatar(id);
Lumix::u32 w, h;
SteamUtils()->GetImageSize(avatar, &w, &h);
if (w == 0 || h == 0) return nullptr;
Array<Lumix::u8> data(allocator);
data.resize(w * h * 4);
SteamUtils()->GetImageRGBA(avatar, &data[0], w * h * 4);
TextureManager* mng = static_cast<TextureManager*>(that->m_engine.getResourceManager().get(TEXTURE_TYPE));
Texture* tex = LUMIX_NEW(allocator, Texture)(Path("avatar"), *mng, allocator);
tex->create(w, h, &data[0]);
that->m_avatars.insert(id.ConvertToUint64(), tex);
return &tex->handle;
}
示例2: SteamMatchmaking
void Lobby2Client_Steam_Impl::OnLobbyMatchListCallback( LobbyMatchList_t *pCallback, bool bIOFailure )
{
(void) bIOFailure;
uint32_t i;
for (i=0; i < deferredCallbacks.GetSize(); i++)
{
// Get any instance of Console_SearchRooms
if (deferredCallbacks[i]->GetID()==L2MID_Console_SearchRooms)
{
Console_SearchRooms_Steam *callbackResult = (Console_SearchRooms_Steam *) deferredCallbacks[i];
// iterate the returned lobbies with GetLobbyByIndex(), from values 0 to m_nLobbiesMatching-1
// lobbies are returned in order of closeness to the user, so add them to the list in that order
for ( uint32 iLobby = 0; iLobby < pCallback->m_nLobbiesMatching; iLobby++ )
{
CSteamID steamId = SteamMatchmaking()->GetLobbyByIndex( iLobby );
callbackResult->roomIds.Push(steamId.ConvertToUint64(), _FILE_AND_LINE_ );
RakNet::RakString s = SteamMatchmaking()->GetLobbyData( steamId, "name" );
callbackResult->roomNames.Push(s, _FILE_AND_LINE_ );
}
CallCBWithResultCode(callbackResult, L2RC_SUCCESS);
msgFactory->Dealloc(callbackResult);
deferredCallbacks.RemoveAtIndex(i);
break;
}
}
}
示例3: FormatMessage
void CLogger::FormatMessage(wxString& string, CSteamID steamID, const char* cszMessage)
{
wxMutexLocker configLock(m_configLock);
wxArrayString tags, replacements;
tags.Add(_T("{SteamID}")); replacements.Add(wxString(steamID.SteamRender(), wxConvUTF8));
tags.Add(_T("{MySteamID}")); replacements.Add(wxString(m_pSteamUser->GetSteamID().SteamRender(), wxConvUTF8));
tags.Add(_T("{SteamID64}")); replacements.Add(wxString::Format(_T("%llu"), steamID.ConvertToUint64()));
tags.Add(_T("{MySteamID64}")); replacements.Add(wxString::Format(_T("%llu"), m_pSteamUser->GetSteamID().ConvertToUint64()));
tags.Add(_T("{Name}"));
wxString name = wxString(m_pSteamFriends->GetFriendPersonaName(steamID), wxConvUTF8);
const char* cszNickname = NULL;
if(m_pClientFriends && m_pGetPlayerNickname)
cszNickname = m_pGetPlayerNickname(m_pClientFriends, steamID);
if(cszNickname)
{
name += _T(" (") + wxString(cszNickname, wxConvUTF8) + _T(")");
}
replacements.Add(name);
tags.Add(_T("{MyName}")); replacements.Add(wxString(m_pSteamFriends->GetPersonaName(), wxConvUTF8));
tags.Add(_T("{Date}")); replacements.Add(wxDateTime::Now().Format(m_dateFormat));
tags.Add(_T("{Time}")); replacements.Add(wxDateTime::Now().Format(m_timeFormat));
tags.Add(_T("{UnixTime}")); replacements.Add(wxString::Format(_T("%lld"), (long long)wxDateTime::GetTimeNow()));
tags.Add(_T("{NewLine}")); replacements.Add(_T("\n"));
tags.Add(_T("{Tab}")); replacements.Add(_T("\t"));
tags.Add(_T("{Message}")); replacements.Add(wxString(cszMessage, wxConvUTF8));
string = TagsReplace(string, tags, replacements);
}
示例4: SendUserConnectAndAuthenticate
bool CGameServer::SendUserConnectAndAuthenticate( u32 ipClient, PConstantDataPointer authBlob, u32 authBlobSize, SteamID *steamIDUser )
{
CSteamID idUser;
bool results = gameServer->SendUserConnectAndAuthenticate(ipClient, authBlob, authBlobSize, &idUser);
*steamIDUser = idUser.ConvertToUint64();
return results;
}
示例5:
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
uint64 CBaseMultiplayerPlayer::GetSteamIDAsUInt64( void )
{
CSteamID steamIDForPlayer;
if ( GetSteamID( &steamIDForPlayer ) )
return steamIDForPlayer.ConvertToUint64();
return 0;
}
示例6: GetClanChatMessage
s32 CFriends::GetClanChatMessage(SteamID steamIDClanChat, s32 message, PUtf8String text, s32 textSize,
Enum *chatEntryType, SteamID *sender)
{
CSteamID senderId;
s32 result = friends->GetClanChatMessage(steamIDClanChat, message, text, textSize,
reinterpret_cast<EChatEntryType *>(chatEntryType), &senderId);
*sender = senderId.ConvertToUint64();
return result;
}
示例7: sizeof
int CSteamUser014::InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure )
{
if (!NP_GetUserTicket(pAuthBlob, cbMaxAuthBlob, steamIDGameServer.ConvertToUint64()))
{
return 0;
}
return sizeof(NPAuthenticateTicket);
}
示例8:
/* <ee327> ../engine/sv_steam3.cpp:578 */
bool CSteam3Server::NotifyBotConnect(client_t *client)
{
if (client == NULL || !m_bLoggedOn)
return false;
client->network_userid.idtype = AUTH_IDTYPE_LOCAL;
CSteamID steamId = CRehldsPlatformHolder::get()->SteamGameServer()->CreateUnauthenticatedUserConnection();
client->network_userid.m_SteamID = steamId.ConvertToUint64();
return true;
}
示例9: sizeof
SteamAPICall_t CSteamMatchmaking007::JoinLobby( CSteamID steamIDLobby ) {
SteamAPICall_t result = CSteamBase::RegisterCall();
LobbyEnter_t* retvals = (LobbyEnter_t*)malloc(sizeof(LobbyEnter_t));
retvals->m_bLocked = false;
retvals->m_EChatRoomEnterResponse = k_EChatRoomEnterResponseSuccess;
retvals->m_rgfChatPermissions = (EChatPermission)0xFFFFFFFF;
retvals->m_ulSteamIDLobby = steamIDLobby.ConvertToUint64();
CSteamBase::ReturnCall(retvals, sizeof(LobbyEnter_t), LobbyEnter_t::k_iCallback, result);
return result;
}
示例10: CSteamID
SteamAPICall_t CSteamMatchmaking007::CreateLobby( ELobbyType eLobbyType, int )
{
SteamAPICall_t result = CSteamBase::RegisterCall();
LobbyCreated_t* retvals = (LobbyCreated_t*)malloc(sizeof(LobbyCreated_t));
CSteamID id = CSteamID( 1337132, 0x40000, k_EUniversePublic, k_EAccountTypeChat );
retvals->m_eResult = k_EResultOK;
retvals->m_ulSteamIDLobby = id.ConvertToUint64();
CSteamBase::ReturnCall(retvals, sizeof(LobbyCreated_t), LobbyCreated_t::k_iCallback, result);
JoinLobby(id);
return result;
}
示例11: Steam_StringToSteamID
/* <f1e63> ../engine/sv_steam3.cpp:1054 */
uint64 Steam_StringToSteamID(const char *pStr)
{
CSteamID steamID;
if (Steam3Server())
{
CSteamID serverSteamId(Steam3Server()->GetSteamID());
steamID.SetFromSteam2String(pStr, serverSteamId.GetEUniverse());
}
else
{
steamID.SetFromSteam2String(pStr, k_EUniversePublic);
}
return steamID.ConvertToUint64();
}
示例12: SteamProxy_InitInternal
bool SteamProxy_InitInternal()
{
g_steamProxy.clientFactory = loader.Load();
if (g_steamProxy.clientFactory == NULL)
{
return false;
}
g_steamProxy.steamClient = (ISteamClient008*)g_steamProxy.clientFactory(STEAMCLIENT_INTERFACE_VERSION_008, NULL);
if (g_steamProxy.steamClient == NULL)
{
return false;
}
g_steamProxy.pipe = g_steamProxy.steamClient->CreateSteamPipe();
if (g_steamProxy.pipe == NULL)
{
return false;
}
g_steamProxy.user = g_steamProxy.steamClient->ConnectToGlobalUser(g_steamProxy.pipe);
if (g_steamProxy.user == NULL)
{
return false;
}
ISteamUtils005* steamUtils = (ISteamUtils005*)g_steamProxy.steamClient->GetISteamUtils(g_steamProxy.pipe, STEAMUTILS_INTERFACE_VERSION_005);
int appID = steamUtils->GetAppID();
if (appID == 0)
{
return false;
}
ISteamUser012* steamUser = (ISteamUser012*)g_steamProxy.steamClient->GetISteamUser(g_steamProxy.user, g_steamProxy.pipe, STEAMUSER_INTERFACE_VERSION_012);
CSteamID steamID = steamUser->GetSteamID();
NP_SetExternalSteamID(steamID.ConvertToUint64());
return true;
}
示例13: sizeof
int CSteamUser012::InitiateGameConnection(void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure)
{
#ifdef USE_NP
if (Legacy_IsLegacyMode())
{
#endif
unsigned int steamID = GetSteamID().GetAccountID();
memcpy(pAuthBlob, &steamID, 4);
return 4;
#ifdef USE_NP
}
//memset(pAuthBlob, 0xdd, cbMaxAuthBlob);
if (!NP_GetUserTicket(pAuthBlob, cbMaxAuthBlob, steamIDGameServer.ConvertToUint64()))
{
Com_Error(2, "Could not get NP user ticket.");
}
return sizeof(NPAuthenticateTicket);
#endif
}
示例14:
int Lobby2Client_Steam_Impl::RakNetRecvFrom( char dataOut[ MAXIMUM_MTU_SIZE ], SystemAddress *senderOut, bool calledFromMainThread)
{
(void) calledFromMainThread;
uint32 pcubMsgSize;
if (SteamNetworking() && SteamNetworking()->IsP2PPacketAvailable(&pcubMsgSize))
{
CSteamID psteamIDRemote;
if (SteamNetworking()->ReadP2PPacket(dataOut, MAXIMUM_MTU_SIZE, &pcubMsgSize, &psteamIDRemote))
{
uint64_t steamIDRemote64=psteamIDRemote.ConvertToUint64();
unsigned int i;
bool objectExists;
i = roomMembersById.GetIndexFromKey(steamIDRemote64, &objectExists);
if (objectExists)
{
*senderOut=roomMembersById[i].systemAddress;
}
return pcubMsgSize;
}
}
return 0;
}
示例15: FormatFilename
void CLogger::FormatFilename(wxString& string, CSteamID steamID)
{
wxMutexLocker configLock(m_configLock);
wxArrayString tags, replacements;
tags.Add(_T("{SteamID}")); replacements.Add(wxString(steamID.SteamRender(), wxConvUTF8));
tags.Add(_T("{MySteamID}")); replacements.Add(wxString(m_pSteamUser->GetSteamID().SteamRender(), wxConvUTF8));
tags.Add(_T("{SteamID64}")); replacements.Add(wxString::Format(_T("%llu"), steamID.ConvertToUint64()));
tags.Add(_T("{MySteamID64}")); replacements.Add(wxString::Format(_T("%llu"), m_pSteamUser->GetSteamID().ConvertToUint64()));
tags.Add(_T("{Name}"));
if(steamID.BIndividualAccount())
{
replacements.Add(wxString(m_pSteamFriends->GetFriendPersonaName(steamID), wxConvUTF8));
}
else
{
const char* cszChatRoomName = NULL;
if(m_pClientFriends && m_pGetChatRoomName)
cszChatRoomName = m_pGetChatRoomName(m_pClientFriends, steamID);
if(*cszChatRoomName)
{
replacements.Add(wxString(cszChatRoomName, wxConvUTF8));
}
else
{
wxString name;
for(int i = 0; i < m_pSteamFriends->GetFriendCountFromSource(steamID); i++)
{
name += wxString(m_pSteamFriends->GetFriendPersonaName(m_pSteamFriends->GetFriendFromSourceByIndex(steamID, i)), wxConvUTF8) + _T(" + ");
}
name.RemoveLast(3);
replacements.Add(name);
}
}
tags.Add(_T("{Nickname}"));
if(steamID.BIndividualAccount())
{
const char* cszNickname = NULL;
if(m_pClientFriends && m_pGetPlayerNickname)
cszNickname = m_pGetPlayerNickname(m_pClientFriends, steamID);
if(cszNickname)
{
replacements.Add(wxString(cszNickname, wxConvUTF8));
}
else
{
replacements.Add(wxString(m_pSteamFriends->GetFriendPersonaName(steamID), wxConvUTF8));
}
}
else
{
replacements.Add(replacements.Last());
}
tags.Add(_T("{MyName}")); replacements.Add(wxString(m_pSteamFriends->GetPersonaName(), wxConvUTF8));
tags.Add(_T("{Date}")); replacements.Add(wxDateTime::Now().Format(m_dateFormat));
tags.Add(_T("{Time}")); replacements.Add(wxDateTime::Now().Format(m_timeFormat));
tags.Add(_T("{UnixTime}")); replacements.Add(wxString::Format(_T("%lld"), (long long)wxDateTime::GetTimeNow()));
string = TagsReplace(string, tags, replacements);
static const wxChar* invalidChars[] = {_T("\\"), _T("/"), _T(":"), _T("*"), _T("?"), _T("\""), _T("<"), _T(">"), _T("|")};
for(int i = 0; i < sizeof(invalidChars) / sizeof(*invalidChars); i++)
{
string.Replace(invalidChars[i], m_replacementChar);
}
}