Skip to content

Commit

Permalink
Fix crash issues with the SDK Functions
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshmishrabetide committed Aug 22, 2024
1 parent 8bc6521 commit cb590e3
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 101 deletions.
2 changes: 1 addition & 1 deletion EOSIntegrationKit.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"DocsURL": "https://eik.betide.studio/",
"MarketplaceURL": "com.epicgames.launcher://ue/marketplace/product/dba0aa05bdd144e69405653a387ad63e",
"SupportURL": "https://discord.gg/betidestudio",
"EngineVersion": "5.3.0",
"EngineVersion": "5.2.0",
"CanContainContent": true,
"Installed": true,
"Modules": [
Expand Down
63 changes: 28 additions & 35 deletions Source/OnlineSubsystemEIK/SdkFunctions/EIK_SharedFunctionFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ THIRD_PARTY_INCLUDES_START
#include "eos_ui_types.h"
#include "eos_userinfo.h"
#include "eos_userinfo_types.h"
#include "eos_sessions_types.h"
THIRD_PARTY_INCLUDES_END
#include "UObject/Object.h"
#include "EIK_SharedFunctionFile.generated.h"
Expand Down Expand Up @@ -1657,17 +1658,17 @@ struct FEIK_Ecom_HTransaction
{
GENERATED_BODY()

EOS_Ecom_HTransaction* Ref;
EOS_Ecom_HTransaction Ref;

FEIK_Ecom_HTransaction(): Ref(nullptr)
{
}

FEIK_Ecom_HTransaction(EOS_Ecom_HTransaction* InHTransaction)
FEIK_Ecom_HTransaction(EOS_Ecom_HTransaction InHTransaction)
{
Ref = InHTransaction;
}
EOS_Ecom_HTransaction* GetReference()
EOS_Ecom_HTransaction GetReference()
{
return Ref;
}
Expand Down Expand Up @@ -2079,17 +2080,16 @@ struct FEIK_Lobby_Attribute
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EOS Integration Kit | SDK Functions | Lobby Interface")
TEnumAsByte<EEIK_ELobbyAttributeVisibility> Visibility;

EOS_Lobby_Attribute* Ref;
FEIK_Lobby_Attribute(): Visibility()
EOS_Lobby_Attribute Ref;
FEIK_Lobby_Attribute(): Visibility(), Ref()
{
Ref = nullptr;
}

FEIK_Lobby_Attribute(EOS_Lobby_Attribute* InLobbyAttribute)
FEIK_Lobby_Attribute(EOS_Lobby_Attribute InLobbyAttribute)
{
Ref = InLobbyAttribute;
Data = *InLobbyAttribute->Data;
Visibility = static_cast<EEIK_ELobbyAttributeVisibility>(InLobbyAttribute->Visibility);
Data = *InLobbyAttribute.Data;
Visibility = static_cast<EEIK_ELobbyAttributeVisibility>(InLobbyAttribute.Visibility);
}
};

Expand All @@ -2098,12 +2098,12 @@ struct FEIK_HLobbySearch
{
GENERATED_BODY()

EOS_HLobbySearch* Ref;
EOS_HLobbySearch Ref;

FEIK_HLobbySearch(): Ref(nullptr)
{
}
FEIK_HLobbySearch(EOS_HLobbySearch* InHLobbySearch)
FEIK_HLobbySearch(EOS_HLobbySearch InHLobbySearch)
{
Ref = InHLobbySearch;
}
Expand Down Expand Up @@ -2133,12 +2133,12 @@ struct FEIK_HLobbyDetails
{
GENERATED_BODY()

EOS_HLobbyDetails* Ref;
EOS_HLobbyDetails Ref;

FEIK_HLobbyDetails(): Ref(nullptr)
{
}
FEIK_HLobbyDetails(EOS_HLobbyDetails* InHLobbyDetails)
FEIK_HLobbyDetails(EOS_HLobbyDetails InHLobbyDetails)
{
Ref = InHLobbyDetails;
}
Expand Down Expand Up @@ -2474,23 +2474,16 @@ struct FEIK_Presence_DataRecord
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EOS Integration Kit | SDK Functions | Presence Interface")
FString Value;

EOS_Presence_DataRecord* Ref;
FEIK_Presence_DataRecord(): Key(), Value(), Ref(nullptr)
EOS_Presence_DataRecord Ref;
FEIK_Presence_DataRecord(): Key(), Value(), Ref()
{
}

FEIK_Presence_DataRecord(EOS_Presence_DataRecord* InPresenceDataRecord)
{
Ref = InPresenceDataRecord;
Key = UTF8_TO_TCHAR(InPresenceDataRecord->Key);
Value = UTF8_TO_TCHAR(InPresenceDataRecord->Value);
}
FEIK_Presence_DataRecord(EOS_Presence_DataRecord InPresenceDataRecord)
{
EOS_Presence_DataRecord* InPresenceDataRecordPtr = &InPresenceDataRecord;
Ref = InPresenceDataRecordPtr;
Key = FString(UTF8_TO_TCHAR(InPresenceDataRecord.Key));
Value = FString(UTF8_TO_TCHAR(InPresenceDataRecord.Value));
Ref = InPresenceDataRecord;
Key = UTF8_TO_TCHAR(InPresenceDataRecord.Key);
Value = UTF8_TO_TCHAR(InPresenceDataRecord.Value);
}
};

Expand Down Expand Up @@ -2576,12 +2569,12 @@ struct FEIK_HPresenceModification
{
GENERATED_BODY()

EOS_HPresenceModification* Ref;
EOS_HPresenceModification Ref;

FEIK_HPresenceModification(): Ref(nullptr)
{
}
FEIK_HPresenceModification(EOS_HPresenceModification* InHPresenceModification)
FEIK_HPresenceModification(EOS_HPresenceModification InHPresenceModification)
{
Ref = InHPresenceModification;
}
Expand All @@ -2596,16 +2589,16 @@ struct FEIK_PresenceModification_DataRecordId
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "EOS Integration Kit | SDK Functions | Presence Interface")
FString Key;

EOS_PresenceModification_DataRecordId* Ref;
EOS_PresenceModification_DataRecordId Ref;

FEIK_PresenceModification_DataRecordId(): Key(), Ref()
{
}

FEIK_PresenceModification_DataRecordId(EOS_PresenceModification_DataRecordId* InPresenceModificationDataRecordId)
FEIK_PresenceModification_DataRecordId(EOS_PresenceModification_DataRecordId InPresenceModificationDataRecordId)
{
Ref = InPresenceModificationDataRecordId;
Key = FString(UTF8_TO_TCHAR(InPresenceModificationDataRecordId->Key));
Key = FString(UTF8_TO_TCHAR(InPresenceModificationDataRecordId.Key));
}
};

Expand Down Expand Up @@ -2885,12 +2878,12 @@ struct FEIK_HActiveSession
{
GENERATED_BODY()

EOS_HActiveSession* Ref;
EOS_HActiveSession Ref;

FEIK_HActiveSession(): Ref(nullptr)
{
}
FEIK_HActiveSession(EOS_HActiveSession* InHActiveSession)
FEIK_HActiveSession(EOS_HActiveSession InHActiveSession)
{
Ref = InHActiveSession;
}
Expand All @@ -2901,12 +2894,12 @@ struct FEIK_HSessionDetails
{
GENERATED_BODY()

EOS_HSessionDetails* Ref;
EOS_HSessionDetails Ref;

FEIK_HSessionDetails(): Ref(nullptr)
FEIK_HSessionDetails(): Ref()
{
}
FEIK_HSessionDetails(EOS_HSessionDetails* InHSessionDetails)
FEIK_HSessionDetails(EOS_HSessionDetails InHSessionDetails)
{
Ref = InHSessionDetails;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ TEnumAsByte<EEIK_Result> UEIK_EcomSubsystem::EIK_Ecom_CopyTransactionById(FEIK_E
CopyTransactionByIdOptions.TransactionId = TCHAR_TO_ANSI(*TransactionId);
EOS_Ecom_HTransaction LocalRef;
auto Result = EOS_Ecom_CopyTransactionById(EOSRef->EcomHandle, &CopyTransactionByIdOptions, &LocalRef);
OutTransaction = &LocalRef;
if(Result == EOS_EResult::EOS_Success)
{
OutTransaction = LocalRef;
}
return static_cast<EEIK_Result>(Result);
}
}
Expand All @@ -294,7 +297,10 @@ TEnumAsByte<EEIK_Result> UEIK_EcomSubsystem::EIK_Ecom_CopyTransactionByIndex(FEI
CopyTransactionByIndexOptions.TransactionIndex = TransactionIndex;
EOS_Ecom_HTransaction LocalRef;
auto Result = EOS_Ecom_CopyTransactionByIndex(EOSRef->EcomHandle, &CopyTransactionByIndexOptions, &LocalRef);
OutTransaction = &LocalRef;
if(Result == EOS_EResult::EOS_Success)
{
OutTransaction = LocalRef;
}
return static_cast<EEIK_Result>(Result);
}
}
Expand Down Expand Up @@ -482,8 +488,11 @@ TEnumAsByte<EEIK_Result> UEIK_EcomSubsystem::EIK_Ecom_Transaction_CopyEntitlemen
CopyEntitlementByIndexOptions.ApiVersion = EOS_ECOM_TRANSACTION_COPYENTITLEMENTBYINDEX_API_LATEST;
CopyEntitlementByIndexOptions.EntitlementIndex = EntitlementIndex;
EOS_Ecom_Entitlement* LocalRef;
auto Result = EOS_Ecom_Transaction_CopyEntitlementByIndex(*Transaction.Ref, &CopyEntitlementByIndexOptions, &LocalRef);
OutEntitlement = FEIK_Ecom_Entitlement(*LocalRef);
auto Result = EOS_Ecom_Transaction_CopyEntitlementByIndex(Transaction.Ref, &CopyEntitlementByIndexOptions, &LocalRef);
if(Result == EOS_EResult::EOS_Success)
{
OutEntitlement = FEIK_Ecom_Entitlement(*LocalRef);
}
return static_cast<EEIK_Result>(Result);
}
}
Expand All @@ -500,7 +509,7 @@ int32 UEIK_EcomSubsystem::EIK_Ecom_Transaction_GetEntitlementsCount(FEIK_Ecom_HT
}
EOS_Ecom_Transaction_GetEntitlementsCountOptions GetEntitlementsCountOptions = { };
GetEntitlementsCountOptions.ApiVersion = EOS_ECOM_TRANSACTION_GETENTITLEMENTSCOUNT_API_LATEST;
return EOS_Ecom_Transaction_GetEntitlementsCount(*Transaction.Ref, &GetEntitlementsCountOptions);
return EOS_Ecom_Transaction_GetEntitlementsCount(Transaction.Ref, &GetEntitlementsCountOptions);
}

FString UEIK_EcomSubsystem::EIK_Ecom_Transaction_GetTransactionId(FEIK_Ecom_HTransaction Transaction)
Expand All @@ -512,11 +521,11 @@ FString UEIK_EcomSubsystem::EIK_Ecom_Transaction_GetTransactionId(FEIK_Ecom_HTra
}
char* OutBuffer = nullptr;
int32_t* InOutBufferLength = nullptr;
auto Result = EOS_Ecom_Transaction_GetTransactionId(*Transaction.Ref, OutBuffer, InOutBufferLength);
auto Result = EOS_Ecom_Transaction_GetTransactionId(Transaction.Ref, OutBuffer, InOutBufferLength);
if(Result == EOS_EResult::EOS_Success)
{
FString OutString = FString(OutBuffer);
EOS_Ecom_Transaction_Release(*Transaction.Ref);
EOS_Ecom_Transaction_Release(Transaction.Ref);
return OutString;
}
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void UEIK_LobbySearch_Find::Activate()
EOS_LobbySearch_FindOptions Options = { };
Options.ApiVersion = EOS_LOBBYSEARCH_FIND_API_LATEST;
Options.LocalUserId = Var_LocalUserId.GetValueAsEosType();
EOS_LobbySearch_Find(*Var_Handle.Ref, &Options, this, &UEIK_LobbySearch_Find::OnFindComplete);
EOS_LobbySearch_Find(Var_Handle.Ref, &Options, this, &UEIK_LobbySearch_Find::OnFindComplete);
return;
}
}
Expand Down
Loading

0 comments on commit cb590e3

Please sign in to comment.