mirror of
https://github.com/Risensy/Steam.git
synced 2025-10-23 16:34:07 +00:00
Steam Voice Chat
Added Steam Voice Chat
This commit is contained in:
23
Source/Steam/Private/VOIPLIB.cpp
Normal file
23
Source/Steam/Private/VOIPLIB.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "VOIPLIB.h"
|
||||
|
||||
void UVOIPLIB::ClearVoicePackets(UObject* WorldContextObject)
|
||||
{
|
||||
UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
|
||||
if (!IsValid(World))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(World);
|
||||
|
||||
if (!VoiceInterface.IsValid())
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("Clear voice packets couldn't get the voice interface!"));
|
||||
}
|
||||
|
||||
VoiceInterface->ClearVoicePackets();
|
||||
|
||||
}
|
26
Source/Steam/Public/VOIPLIB.h
Normal file
26
Source/Steam/Public/VOIPLIB.h
Normal file
@@ -0,0 +1,26 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "BlueprintDataDefinitions.h"
|
||||
#include "Online.h"
|
||||
#include "OnlineSubsystem.h"
|
||||
#include "Interfaces/VoiceInterface.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "UObject/UObjectIterator.h"
|
||||
#include "VOIPLIB.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class STEAM_API UVOIPLIB : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable, Category = "VOIPLIB")
|
||||
static void ClearVoicePackets(UObject* WorldContextObject);
|
||||
};
|
@@ -8,7 +8,7 @@ public class Steam : ModuleRules
|
||||
{
|
||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem", "AdvancedSessions" });
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(new string[] { });
|
||||
|
||||
|
Reference in New Issue
Block a user