Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

Commit

Permalink
Interop for online session functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeltris committed Aug 21, 2019
1 parent 0bed112 commit e6cbbc9
Show file tree
Hide file tree
Showing 28 changed files with 1,757 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Managed/CodeGenerator.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5
6
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public partial class CodeGenerator
"/Script/Engine.HitResult:Component",
"/Script/Engine.HitResult:BoneName",
"/Script/Engine.HitResult:MyBoneName",

"/Script/Engine.GameModeBase:GameSession",
"/Script/Engine.GameModeBase:GameState",
};
private static HashSet<string> forceHideProperties = new HashSet<string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ static Dictionary<string, ProjectDefinedType> GetProjectDefinedTypes()
{ "/Script/GameplayTasks.EGameplayTaskState", ProjectDefinedType.Enum },
{ "/Script/GameplayTasks.ETaskResourceOverlapPolicy", ProjectDefinedType.Enum },
{ "/Script/GameplayTasks.GameplayResourceSet", ProjectDefinedType.BlittableStruct },

{ "/Script/OnlineSubsystemUtils.BlueprintSessionResult", ProjectDefinedType.Struct },
};

foreach (Type type in System.Reflection.Assembly.GetExecutingAssembly().GetTypes())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,16 @@ private void ProcessDelegateSignature(ManagedUnrealTypeInfo typeInfo, Type type)
functionInfo.Flags |= EFunctionFlags.MulticastDelegate;
}

var attributes = type.GetCustomAttributes<ManagedUnrealAttributeBase>(false);
if (attributes != null)
{
foreach (ManagedUnrealAttributeBase attribute in attributes)
{
attribute.ProcessFunction(functionInfo);
attribute.ProcessFunctionParams(functionInfo);
}
}

functionInfo.Name = GetUniqueMemberName(typeInfo, functionInfo, method);
functionInfo.Path = typeInfo.Path + ":" + functionInfo.Name;
typeInfo.Functions.Add(functionInfo);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

#pragma warning disable 649 // Field is never assigned

namespace UnrealEngine.Runtime.Native
{
static class Native_FOnlineSession
{
public delegate void Del_Get_OwningUserId(IntPtr instance, ref FSharedPtr result);
public delegate void Del_Set_OwningUserId(IntPtr instance, ref FSharedPtr value);
public delegate void Del_Get_OwningUserName(IntPtr instance, ref FScriptArray result);
public delegate void Del_Set_OwningUserName(IntPtr instance, ref FScriptArray value);
public delegate IntPtr Del_Get_SessionSettings(IntPtr instance);
public delegate void Del_Get_SessionInfo(IntPtr instance, ref FSharedPtr result);
public delegate void Del_Set_SessionInfo(IntPtr instance, ref FSharedPtr value);
public delegate int Del_Get_NumOpenPrivateConnections(IntPtr instance);
public delegate void Del_Set_NumOpenPrivateConnections(IntPtr instance, int value);
public delegate int Del_Get_NumOpenPublicConnections(IntPtr instance);
public delegate void Del_Set_NumOpenPublicConnections(IntPtr instance, int value);

public static Del_Get_OwningUserId Get_OwningUserId;
public static Del_Set_OwningUserId Set_OwningUserId;
public static Del_Get_OwningUserName Get_OwningUserName;
public static Del_Set_OwningUserName Set_OwningUserName;
public static Del_Get_SessionSettings Get_SessionSettings;
public static Del_Get_SessionInfo Get_SessionInfo;
public static Del_Set_SessionInfo Set_SessionInfo;
public static Del_Get_NumOpenPrivateConnections Get_NumOpenPrivateConnections;
public static Del_Set_NumOpenPrivateConnections Set_NumOpenPrivateConnections;
public static Del_Get_NumOpenPublicConnections Get_NumOpenPublicConnections;
public static Del_Set_NumOpenPublicConnections Set_NumOpenPublicConnections;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

#pragma warning disable 649 // Field is never assigned

namespace UnrealEngine.Runtime.Native
{
static class Native_FOnlineSessionSearchResult
{
public delegate IntPtr Del_Get_Session(IntPtr instance);
public delegate int Del_Get_PingInMs(IntPtr instance);
public delegate void Del_Set_PingInMs(IntPtr instance, int value);

public static Del_Get_Session Get_Session;
public static Del_Get_PingInMs Get_PingInMs;
public static Del_Set_PingInMs Set_PingInMs;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

#pragma warning disable 649 // Field is never assigned

namespace UnrealEngine.Runtime.Native
{
static class Native_FOnlineSessionSetting
{
public delegate IntPtr Del_Get_Data(IntPtr instance);
public delegate int Del_Get_AdvertisementType(IntPtr instance);
public delegate void Del_Set_AdvertisementType(IntPtr instance, int value);
public delegate int Del_Get_ID(IntPtr instance);
public delegate void Del_Set_ID(IntPtr instance, int value);

public static Del_Get_Data Get_Data;
public static Del_Get_AdvertisementType Get_AdvertisementType;
public static Del_Set_AdvertisementType Set_AdvertisementType;
public static Del_Get_ID Get_ID;
public static Del_Set_ID Set_ID;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

#pragma warning disable 649 // Field is never assigned

namespace UnrealEngine.Runtime.Native
{
static class Native_FOnlineSessionSettings
{
public delegate int Del_Get_NumPublicConnections(IntPtr instance);
public delegate void Del_Set_NumPublicConnections(IntPtr instance, int value);
public delegate int Del_Get_NumPrivateConnections(IntPtr instance);
public delegate void Del_Set_NumPrivateConnections(IntPtr instance, int value);
public delegate csbool Del_Get_bShouldAdvertise(IntPtr instance);
public delegate void Del_Set_bShouldAdvertise(IntPtr instance, csbool value);
public delegate csbool Del_Get_bAllowJoinInProgress(IntPtr instance);
public delegate void Del_Set_bAllowJoinInProgress(IntPtr instance, csbool value);
public delegate csbool Del_Get_bIsLANMatch(IntPtr instance);
public delegate void Del_Set_bIsLANMatch(IntPtr instance, csbool value);
public delegate csbool Del_Get_bIsDedicated(IntPtr instance);
public delegate void Del_Set_bIsDedicated(IntPtr instance, csbool value);
public delegate csbool Del_Get_bUsesStats(IntPtr instance);
public delegate void Del_Set_bUsesStats(IntPtr instance, csbool value);
public delegate csbool Del_Get_bAllowInvites(IntPtr instance);
public delegate void Del_Set_bAllowInvites(IntPtr instance, csbool value);
public delegate csbool Del_Get_bUsesPresence(IntPtr instance);
public delegate void Del_Set_bUsesPresence(IntPtr instance, csbool value);
public delegate csbool Del_Get_bAllowJoinViaPresence(IntPtr instance);
public delegate void Del_Set_bAllowJoinViaPresence(IntPtr instance, csbool value);
public delegate csbool Del_Get_bAllowJoinViaPresenceFriendsOnly(IntPtr instance);
public delegate void Del_Set_bAllowJoinViaPresenceFriendsOnly(IntPtr instance, csbool value);
public delegate csbool Del_Get_bAntiCheatProtected(IntPtr instance);
public delegate void Del_Set_bAntiCheatProtected(IntPtr instance, csbool value);
public delegate int Del_Get_BuildUniqueId(IntPtr instance);
public delegate void Del_Set_BuildUniqueId(IntPtr instance, int value);
public delegate void Del_Get_Settings(IntPtr instance, IntPtr keys, IntPtr values);
public delegate void Del_Set_Settings(IntPtr instance, IntPtr keys, IntPtr values);

public static Del_Get_NumPublicConnections Get_NumPublicConnections;
public static Del_Set_NumPublicConnections Set_NumPublicConnections;
public static Del_Get_NumPrivateConnections Get_NumPrivateConnections;
public static Del_Set_NumPrivateConnections Set_NumPrivateConnections;
public static Del_Get_bShouldAdvertise Get_bShouldAdvertise;
public static Del_Set_bShouldAdvertise Set_bShouldAdvertise;
public static Del_Get_bAllowJoinInProgress Get_bAllowJoinInProgress;
public static Del_Set_bAllowJoinInProgress Set_bAllowJoinInProgress;
public static Del_Get_bIsLANMatch Get_bIsLANMatch;
public static Del_Set_bIsLANMatch Set_bIsLANMatch;
public static Del_Get_bIsDedicated Get_bIsDedicated;
public static Del_Set_bIsDedicated Set_bIsDedicated;
public static Del_Get_bUsesStats Get_bUsesStats;
public static Del_Set_bUsesStats Set_bUsesStats;
public static Del_Get_bAllowInvites Get_bAllowInvites;
public static Del_Set_bAllowInvites Set_bAllowInvites;
public static Del_Get_bUsesPresence Get_bUsesPresence;
public static Del_Set_bUsesPresence Set_bUsesPresence;
public static Del_Get_bAllowJoinViaPresence Get_bAllowJoinViaPresence;
public static Del_Set_bAllowJoinViaPresence Set_bAllowJoinViaPresence;
public static Del_Get_bAllowJoinViaPresenceFriendsOnly Get_bAllowJoinViaPresenceFriendsOnly;
public static Del_Set_bAllowJoinViaPresenceFriendsOnly Set_bAllowJoinViaPresenceFriendsOnly;
public static Del_Get_bAntiCheatProtected Get_bAntiCheatProtected;
public static Del_Set_bAntiCheatProtected Set_bAntiCheatProtected;
public static Del_Get_BuildUniqueId Get_BuildUniqueId;
public static Del_Set_BuildUniqueId Set_BuildUniqueId;
public static Del_Get_Settings Get_Settings;
public static Del_Set_Settings Set_Settings;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

#pragma warning disable 649 // Field is never assigned

namespace UnrealEngine.Runtime.Native
{
static class Native_FSessionUtils
{
public delegate int Del_GetSessionState(ref FName sessionName);
public delegate csbool Del_CancelFindSessions();
public delegate int Del_GetNumSessions();

public static Del_GetSessionState GetSessionState;
public static Del_CancelFindSessions CancelFindSessions;
public static Del_GetNumSessions GetNumSessions;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

#pragma warning disable 649 // Field is never assigned
#pragma warning disable 108 // ToString hiding base virtual function

namespace UnrealEngine.Runtime.Native
{
static class Native_FVariantData
{
public delegate void Del_FromStringEx(IntPtr instance, ref FScriptArray str);
public delegate void Del_ToStringEx(IntPtr instance, ref FScriptArray str);

public static Del_FromStringEx FromStringEx;
public static Del_ToStringEx ToStringEx;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UnrealEngine.Plugins.OnlineSubsystem
{
public enum EOnlineDataAdvertisementType
{
/// <summary>
/// Don't advertise via the online service or QoS data
/// </summary>
DontAdvertise,
/// <summary>
/// Advertise via the server ping data only
/// </summary>
ViaPingOnly,
/// <summary>
/// Advertise via the online service only
/// </summary>
ViaOnlineService,
/// <summary>
/// Advertise via the online service and via the ping data
/// </summary>
ViaOnlineServiceAndPing
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UnrealEngine.Plugins.OnlineSubsystem
{
public enum EOnlineKeyValuePairDataType
{
/// <summary>
/// Means the data in the OnlineData value fields should be ignored
/// </summary>
Empty,
/// <summary>
/// 32 bit integer
/// </summary>
Int32,
/// <summary>
/// 32 bit unsigned integer
/// </summary>
UInt32,
/// <summary>
/// 64 bit integer
/// </summary>
Int64,
/// <summary>
/// 64 bit unsigned integer
/// </summary>
UInt64,
/// <summary>
/// Double (8 byte)
/// </summary>
Double,
/// <summary>
/// Unicode string
/// </summary>
String,
/// <summary>
/// Float (4 byte)
/// </summary>
Float,
/// <summary>
/// Binary data
/// </summary>
Blob,
/// <summary>
/// bool data (1 byte)
/// </summary>
Bool,
/// <summary>
/// Serialized json text
/// </summary>
Json
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UnrealEngine.Plugins.OnlineSubsystem
{
/// <summary>
/// Enum indicating the current state of the online session (in progress, ended, etc.)
/// </summary>
public enum EOnlineSessionState
{
/// <summary>
/// An online session has not been created yet
/// </summary>
NoSession,
/// <summary>
/// An online session is in the process of being created
/// </summary>
Creating,
/// <summary>
/// Session has been created but the session hasn't started (pre match lobby)
/// </summary>
Pending,
/// <summary>
/// Session has been asked to start (may take time due to communication with backend)
/// </summary>
Starting,
/// <summary>
/// The current session has started. Sessions with join in progress disabled are no longer joinable
/// </summary>
InProgress,
/// <summary>
/// The session is still valid, but the session is no longer being played (post match lobby)
/// </summary>
Ending,
/// <summary>
/// The session is closed and any stats committed
/// </summary>
Ended,
/// <summary>
/// The session is being destroyed
/// </summary>
Destroying
}
}
Loading

0 comments on commit e6cbbc9

Please sign in to comment.