当前位置: 首页>>代码示例>>C++>>正文


C++ CSteamID::ConvertToUint64方法代码示例

本文整理汇总了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;
	}
开发者ID:gunsafighter,项目名称:LumixEngine,代码行数:29,代码来源:steam.cpp

示例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;
		}
	}
}
开发者ID:dream7w,项目名称:ZRKServer,代码行数:28,代码来源:Lobby2Client_Steam_Impl.cpp

示例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);
}
开发者ID:Moggers,项目名称:open-steamworks,代码行数:35,代码来源:Logger.cpp

示例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;
	}
开发者ID:das-etwas,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:7,代码来源:GameServer.cpp

示例5:

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
uint64 CBaseMultiplayerPlayer::GetSteamIDAsUInt64( void )
{
	CSteamID steamIDForPlayer;
	if ( GetSteamID( &steamIDForPlayer ) )
		return steamIDForPlayer.ConvertToUint64();
	return 0;
}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:10,代码来源:basemultiplayerplayer.cpp

示例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;
	}
开发者ID:HoggeL,项目名称:Ludosity-s-Steamworks-Wrapper,代码行数:9,代码来源:Friends.cpp

示例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);
}
开发者ID:Call-of-Duty-Scripts,项目名称:Back-Ops-AlterIWnet,代码行数:9,代码来源:SteamUser014.cpp

示例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;
}
开发者ID:vlad-slick,项目名称:rehlds,代码行数:11,代码来源:sv_steam3.cpp

示例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;
}
开发者ID:Call-of-Duty-Scripts,项目名称:fourdeltaone,代码行数:12,代码来源:SteamMatchmaking007.cpp

示例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;
}
开发者ID:JohannesHei,项目名称:iw4m-lan,代码行数:15,代码来源:SteamMatchmaking007.cpp

示例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();
}
开发者ID:vlad-slick,项目名称:rehlds,代码行数:16,代码来源:sv_steam3.cpp

示例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;
}
开发者ID:Call-of-Duty-Scripts,项目名称:fourdeltaone,代码行数:45,代码来源:SteamProxy.cpp

示例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
}
开发者ID:snitchedits,项目名称:cod-mod,代码行数:22,代码来源:SteamUser012.cpp

示例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;
}
开发者ID:dream7w,项目名称:ZRKServer,代码行数:23,代码来源:Lobby2Client_Steam_Impl.cpp

示例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);
	}
}
开发者ID:Moggers,项目名称:open-steamworks,代码行数:76,代码来源:Logger.cpp


注:本文中的CSteamID::ConvertToUint64方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。