コード例 #1
0
ファイル: network.cpp プロジェクト: INait/NetworkEngine
void Server::Accept()
{
	auto new_client_session = std::make_shared< ClientSession >(*this);

	acceptor_.async_accept(new_client_session->GetSocket(),
		[this, new_client_session](const boost::system::error_code& ec)
		{
			if (!ec)
			{
				new_client_session->StartRead();
				sessions_.insert(new_client_session.get());
				std::cout << "client connected, id = " << new_client_session->GetClientId() << std::endl;

			}
			Accept();
		}
	);
}
コード例 #2
0
ファイル: FriendItem.cpp プロジェクト: PickUpSU/UnrealEngine4
const FString FFriendItem::GetClientName() const
{
	FString Result;
	FString ClientId = GetClientId();

	if (!ClientId.IsEmpty())
	{
		// hardcoded for now, need a generic way to receive client names or map client ids to names
		if (ClientId == FFriendItem::FortniteClientId)
		{
			Result = TEXT("Fortnite");
		}
		else if (ClientId == FFriendItem::UnrealTournamentClientId)
		{
			Result = TEXT("Unreal Tournament");
		}
		else if (FFriendItem::LauncherClientIds.Contains(ClientId))
		{
			Result = TEXT("Epic Games Launcher");
		}
	}
	return Result;
}
コード例 #3
0
	virtual bool CanPerformAction(const EFriendActionType::Type ActionType) override
	{
		switch (ActionType)
		{
			case EFriendActionType::JoinGame:
			{
				return FriendsAndChatManager.Pin()->JoinGameAllowed(GetClientId());
			}
			case EFriendActionType::AcceptFriendRequest:
			case EFriendActionType::RemoveFriend:
			case EFriendActionType::IgnoreFriendRequest:
			case EFriendActionType::BlockFriend:
			case EFriendActionType::RejectFriendRequest:
			case EFriendActionType::CancelFriendRequest:
			case EFriendActionType::SendFriendRequest:
			case EFriendActionType::InviteToGame:
			case EFriendActionType::RejectGame:
			case EFriendActionType::Chat:
			default:
			{
				return true;
			}
		}
	}
コード例 #4
0
ファイル: FriendItem.cpp プロジェクト: PickUpSU/UnrealEngine4
bool FFriendItem::CanInvite() const
{
	FString FriendsClientID = GetClientId();
	return FriendsClientID == FriendsAndChatManager.Pin()->GetUserClientId() || FFriendItem::LauncherClientIds.Contains(FriendsClientID);
}
コード例 #5
0
ファイル: FriendItem.cpp プロジェクト: kidaa/UnrealEngineVR
bool FFriendItem::CanInvite() const
{
	FString FriendsClientID = GetClientId();
	return FriendsClientID == FFriendsAndChatManager::Get()->GetUserClientId() || FriendsClientID == FFriendItem::LauncherClientId;
}
コード例 #6
0
bool FFriendPartyInviteItem::CanInvite() const
{
	FString FriendsClientID = GetClientId();
	return FriendsClientID == GameAndPartyService->GetUserClientId() || FFriendItem::LauncherClientIds.Contains(FriendsClientID);
}