コンテンツ閲覧のための高度なフィルターを設定する
注釈:本資料はAI技術を用いて翻訳されています。
概要
開発者による公式コンテンツ、あるいはプレイヤーによるユーザー生成コンテンツ (UGC) など、多くのコンテンツが作成される中で、コンテンツの閲覧は困難で時間のかかる作業になりがちです。AccelByte Gaming Services (AGS) では、プレイヤーが自分のニーズに合わせてコンテンツを選択・フィルタリングできる仕組みを提供しており、これによりプレイヤーは自分の個性、好み、スタイルを反映したコンテンツを選ぶことができます。
このガイドでは、コンテンツにタグ、タイプ、サブタイプを実装する方法、およびそれらを使ってゲームクライアントからコンテンツをフィルタリングする方法を学びます。

目標
このガイドの目標は、以下の方法を説明することです。
- 事前定義されたタグ、タイプ、サブタイプを設定する。
- コンテンツにタグ、タイプ、サブタイプを追加する。
- コンテンツフィルタリングを実装する。
前提条件
以下へのアクセスが必要です。
- AGS Admin Portal
- AccelByte Unreal または Unity SDK
- 参考資料としての AccelByte UGC API ドキュメント
コンテンツのタグ、タイプ、サブタイプを設定する
UGC を分類するために使用できるタイプとタグを作成できます。例えば、車のカスタムデザインでは、タイプとしてVehicle、サブタイプとしてBodyやWheelsを設定できます。タグにはCar、Vehicle、Bodyなどを含めることができます。
事前定義されたタグを設定する
-
ゲームの名前空間で、Engagement > UGC > Tags に移動します。
-
Tags ページで、+ New Tag ボタンをクリックします。

-
Add New Tag フォームで、新しいタグの名前を入力し、Add をクリックします。
新しいタグがタグリストに追加されます。
事前定義されたタイプを設定する
-
ゲームの名前空間で、Engagement > UGC > Types に移動します。
-
Types ページで、+ New Type ボタンをクリックします。

-
Add New Type フォームで、新しいタイプの名前を入力し、Add をクリックします。新しいタイプがリストに追加されます。
-
タイプの Action メニューにある View をクリックすることで、サブタイプを追加することもできます。
事前定義されたサブタイプを設定する
-
ゲームの名前空間で、Engagement > UGC > Types に移動します。Types ページが表示されます。
-
タイプのリストから、サブタイプを追加したいタイプを見つけ、その横にある View オプションをクリックします。

-
タイプの詳細ページで、+ New Subtype ボタンをクリックします。
-
Add New Subtype フォームで、新しいサブタイプの名前を入力し、Add をクリックします。
新しい Subtype がリストに追加されます。
コンテンツのタグ、タイプ、サブタイプを更新する
-
Admin Portal のサイドバーで、Engagement > UGC > Lookup UGC に移動します。
-
Lookup UGC ページでは、コンテンツ名、ID、タイプ、サブタイプ、タグ、共有コード、ユーザー ID を使ってコンテンツを検索できます。
-
検索結果から、更新したいコンテンツを見つけて開きます。
-
コンテンツの詳細ページで、以下のようにコンテンツを更新できます。
-
タイプとサブタイプを変更する。Type または Subtype フィールドの横にある編集(鉛筆)アイコンをクリックします。
Edit Type and Subtype フォームで、必要に応じて値を変更し、Add をクリックして変更を保存します。
-
タグを追加する。Tag フィールドの Add More オプションをクリックします。
Add New Tag フォームで、追加したいタグを作成するか、事前定義されたタグリストから選択します。その後、Save をクリックします。
-
クライアント SDK を使ってコンテンツにタグ、タイプ、サブタイプを追加する
以下の関数を使うと、コンテンツを作成する際にタグ、タイプ、サブタイプなどのプレイヤーコンテンツメタデータを設定できます。
- Unreal Engine
- Unity
- C# Extend SDK
- Go Extend SDK
- Java Extend SDK
- Python Extend SDK
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FString ChannelId = "YourChannelId";
FAccelByteModelsCreateUGCRequestV2 UGCRequest = {};
UGCRequest.ContentType = "application/octet-stream";
UGCRequest.FileExtension = "bin";
UGCRequest.Name = "Custom sports body";
UGCRequest.Type = "Vehicle";
UGCRequest.SubType = "Body";
UGCRequest.Tags = { "Red", "Sporty"};
ApiClient->UGC.CreateV2Content(ChannelId, UGCRequest, THandler<FAccelByteModelsUGCCreateUGCResponseV2>::CreateLambda([](const FAccelByteModelsUGCCreateUGCResponseV2& Result)
{
// Do something if CreateV2Content succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if CreateV2Content fails
}));
string channelId = "YourChannelId";
CreateUGCRequestV2 createRequest = new CreateUGCRequestV2
{
ContentType = "application/octet-stream",
FileExtension = "bin",
Name = "Custom sports body",
Type = "Vehicle",
Tags = new[] { "Red", "Sporty" },
CustomAttributes = new Dictionary<string, object>()
};
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.CreateContentV2(channelId, createRequest, result =>
{
if (result.IsError)
{
// Do something if CreateContentV2 fails
Debug.Log($"Error CreateContentV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if CreateContentV2 succeeds
});
string channelId = "<YourUGCChannelId>";
string userId = "<user-id>";
var response = sdk.Ugc.PublicContentV2.PublicCreateContentV2Op
.Execute(new ModelsContentRequestV2()
{
ContentType = "application/octet-stream",
FileExtension = "bin",
Name = "Custom sports body",
Type = "Vehicle",
Tags = new List<string>() { "Red", "Sporty" },
CustomAttributes = new Dictionary<string, object>()
}, channelId, sdk.Namespace, userId);
if (response != null)
{
//do something when success
}
publicContentV2Service := &ugc.PublicContentV2Service{
Client: factory.NewUgcClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
contentName := "Custom sports body"
body := ugcclientmodels.ModelsContentRequestV2 {
ContentType: "application/octet-stream",
FileExtension: "bin",
Name: &contentName,
Type: "Vehicle",
Tags: []string{"Red", "Sporty"},
CustomAttributes: map[string]interface{}{},
}
channelId := "mychannelid"
namespace := "mygame"
userId := "myuserid"
input := &public_content_v2.PublicCreateContentV2Params{
Body: &body,
ChannelID: channelId,
Namespace: namespace,
UserID: userId,
}
result, err := publicContentV2Service.PublicCreateContentV2Short(input)
final PublicContentV2 publicContentV2Wrapper = new PublicContentV2(sdk);
String channelId = "<YourUGCChannelId>";
String userId = "<user-id>";
ModelsCreateContentResponseV2 response;
try {
ModelsContentRequestV2 reqBody = ModelsContentRequestV2.builder()
.contentType("application/octet-stream")
.fileExtension("bin")
.name("Custom sports body")
.type("Vehicle")
.tags(Arrays.asList("Red", "Sporty"))
.customAttributes(Collections.emptyMap())
.build();
response = publicContentV2Wrapper.publicCreateContentV2(PublicCreateContentV2.builder()
.namespace("<namespace>")
.userId(userId)
.channelId(channelId)
.body(reqBody)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something when success
}
import accelbyte_py_sdk.api.ugc as ugc_service
import accelbyte_py_sdk.api.ugc.models as ugc_models
result, error = ugc_service.public_create_content_v2(
body=ugc_models.ModelsContentRequestV2()
.with_content_type("application/octet-stream")
.with_file_extension("bin")
.with_name("Custom Sports Body")
.with_type("Vehicle")
.with_sub_type("Body")
.with_tags(["Red", "Sporty"]),
channel_id="YourChannelId",
user_id="********************************",
namespace=namespace, # optional, gets the value from the global instance if unspecified
sdk=sdk, # optional, gets the global instance if unspecified
)
if error:
exit(error)
以下の関数を使うと、タグ、タイプ、サブタイプなどのプレイヤーコンテンツメタデータを更新できます。
- Unreal Engine
- Unity
- C# Extend SDK
- Go Extend SDK
- Java Extend SDK
- Python Extend SDK
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FString ChannelId = "YourChannelId";
FString ContentId = "YourContentId";
FAccelByteModelsModifyUGCRequestV2 ModifyRequest = {};
ModifyRequest.Name = "Custom sports body";
ModifyRequest.Type = "Vehicle";
ModifyRequest.SubType = "Body";
ModifyRequest.Tags = { "Blue", "Sporty", "Body"};
ApiClient->UGC.ModifyV2Content(ChannelId, ContentId, ModifyRequest, THandler<FAccelByteModelsUGCModifyUGCResponseV2>::CreateLambda([](const FAccelByteModelsUGCModifyUGCResponseV2& Result)
{
// Do something if ModifyV2Content succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if ModifyV2Content fails
}));
string channelId = "YourChannelId";
string contentId = "YourContentId";
ModifyUGCRequestV2 ModifyRequest = new ModifyUGCRequestV2
{
Name = "Custom sports body",
Type = "Vehicle",
SubType = "Body",
Tags = new[] { "Blue", "Sporty", "Body" },
CustomAttributes = new Dictionary<string, object>()
};
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.ModifyContentV2(channelId, contentId, ModifyRequest, result =>
{
if (result.IsError)
{
// Do something if ModifyContentV2 fails
Debug.Log($"Error ModifyContentV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if ModifyContentV2 succeeds
});
string channelId = "<YourUGCChannelId>";
string contentId = "<YourUGCContentId>";
string userId = "<user-id>";
var response = sdk.Ugc.PublicContentV2.PublicUpdateContentV2Op
.Execute(new ModelsUpdateContentRequestV2()
{
Name = "Custom sports body",
Type = "Vehicle",
SubType = "Body",
Tags = new List<string>() { "Blue", "Body", "Sporty" },
CustomAttributes = new Dictionary<string, object>()
}, channelId, contentId, sdk.Namespace, userId);
if (response != null)
{
//do something when success
}
publicContentV2Service := &ugc.PublicContentV2Service{
Client: factory.NewUgcClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
body := ugcclientmodels.ModelsUpdateContentRequestV2 {
Name: "Custom sports body",
Type: "Vehicle",
SubType: "Body",
Tags: []string{"Blue","Body","Sporty"},
CustomAttributes: map[string]interface{}{},
}
channelId := "mychannelid"
contentId := "mycontentid"
namespace := "mygame"
userId := "myuserid"
input := &public_content_v2.PublicUpdateContentV2Params{
Body: &body,
ChannelID: channelId,
ContentID: contentId,
Namespace: namespace,
UserID: userId,
}
result, err := publicContentV2Service.PublicUpdateContentV2Short(input)
final PublicContentV2 publicContentV2Wrapper = new PublicContentV2(sdk);
String channelId = "<YourUGCChannelId>";
String contentId = "<YourUGCContentId>";
String userId = "<user-id>";
ModelsUpdateContentResponseV2 response;
try {
ModelsUpdateContentRequestV2 reqBody = ModelsUpdateContentRequestV2.builder()
.name("Custom sports body")
.type("Vehicle")
.subType("Body")
.tags(Arrays.asList("Blue", "Body", "Sporty"))
.customAttributes(Collections.emptyMap())
.build();
response = publicContentV2Wrapper.publicUpdateContentV2(PublicUpdateContentV2.builder()
.namespace("<namespace>")
.userId(userId)
.channelId(channelId)
.contentId(contentId)
.body(reqBody)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something when success
}
import accelbyte_py_sdk.api.ugc as ugc_service
import accelbyte_py_sdk.api.ugc.models as ugc_models
result, error = ugc_service.public_update_content_v2(
body=ugc_models.ModelsUpdateContentRequestV2()
.with_name("Custom Sports Body")
.with_type("Vehicle")
.with_sub_type("Body")
.with_tags(["Blue", "Sporty", "Body"]),
channel_id="YourChannelId",
content_id="YourContentId",
user_id="********************************",
namespace=namespace, # optional, gets the value from the global instance if unspecified
sdk=sdk, # optional, gets the global instance if unspecified
)
if error:
exit(error)
コンテンツフィルタリング
コンテンツフィルタリングとは、タグ、キーワード、タイプなどのさまざまな条件に基づいて UGC を検索、並べ替え、表示するプロセスです。コンテンツフィルタリングは、プレイヤーが自分の好み、興味、スキルレベルに合った UGC を見つけて楽しむ助けにもなります。
コンテンツ名でコンテンツを検索する
コンテンツ名を使ってコンテンツをフィルタリングするには、次の関数を使用します。
- Unreal Engine
- Unity
- C# Extend SDK
- Go Extend SDK
- Java Extend SDK
- Python Extend SDK
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FAccelByteModelsUGCFilterRequest Filter = {};
Filter.Name = "Content Name";
ApiClient->UGC.SearchV2Contents(Filter,
THandler<FAccelByteModelsUGCGetPaginatedUGCContentsResponse>::CreateLambda([](const FAccelByteModelsUGCGetPaginatedUGCContentsResponse& Result)
{
// Do something if SearchV2Contents succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if SearchV2Contents fails
}));
UGCGetContentFilterRequestV2 filterRequest = new UGCGetContentFilterRequestV2()
{
Name = "Content Name",
SubType = "Content Subtype",
Tags = new[] { "UGC Tag1", "UGC Tag2" },
Type = "Content Type"
};
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.SearchContentsV2(filterRequest, result =>
{
if (result.IsError)
{
// Do something if SearchContentsV2 fails
Debug.Log($"Error SearchContentsV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if SearchContentsV2 succeeds
});
var response = sdk.Ugc.PublicContentV2.PublicListContentV2Op
.SetName("Content Name")
.SetSubType("Content Subtype")
.SetTags(new List<string>() { "UGC Tag1", "UGC Tag2" })
.SetType("Content Type")
.Execute(sdk.Namespace);
if (response != null)
{
//do something when success
}
publicContentV2Service := &ugc.PublicContentV2Service{
Client: factory.NewUgcClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
namespace := "mygame"
name := "mycontentname"
subType := "mycontentsubtype"
tags := []string{"UGC Tag1", "UGC Tag2"}
type_ := "mycontenttype"
input := &public_content_v2.PublicListContentV2Params{
Namespace: namespace,
Name: &name,
SubType: &subType,
Type: &type_,
Tags: tags,
}
result, err := publicContentV2Service.PublicListContentV2Short(input)
final PublicContentV2 publicContentV2Wrapper = new PublicContentV2(sdk);
ModelsPaginatedContentDownloadResponseV2 response;
try {
response = publicContentV2Wrapper.publicListContentV2(PublicListContentV2.builder()
.namespace("<namespace>")
.name("Content Name")
.subType("Content Subtype")
.tags(Arrays.asList("UGC Tag1", "UGC Tag2"))
.type("Content Type")
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something when success
}
import accelbyte_py_sdk.api.ugc as ugc_service
result, error = ugc_service.public_list_content_v2(
name="Content Name",
type_="Content Type",
sub_type="Content Subtype",
tags=["UGC Tag1", "UGC Tag2"],
namespace=namespace, # optional, gets the value from the global instance if unspecified
sdk=sdk, # optional, gets the global instance if unspecified
)
if error:
exit(error)
タグを使ってコンテンツをフィルタリングする
高度なタグフィルタリングでは、AND 演算子として &、OR 演算子として |、優先順位を示すために括弧 () を使用できます。例:
tags=sporty
tags=sporty&red
tags=sporty|red
tags=sporty&red|classic
tags=sporty&(red|classic)
論理演算子の優先順位は AND > OR であるため、括弧がない場合は AND 論理演算子が先に実行されます。
オペランドで使用できる文字: 英数字、アンダースコア _、ダッシュ -
演算子で使用できる文字: & | ( )
tags=sporty&red|classic は次と等価です: tags=sporty,red|classic および tags=sporty&tags=red|classic
タグを使ってコンテンツをフィルタリングするには、次の関数を使用します。
- Unreal Engine
- Unity
- C# Extend SDK
- Go Extend SDK
- Java Extend SDK
- Python Extend SDK
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FAccelByteModelsUGCFilterRequest Filter = {};
Filter.Tags = { "Sporty", "Red|Classic" };
ApiClient->UGC.SearchV2Contents(Filter,
THandler<FAccelByteModelsUGCGetPaginatedUGCContentsResponse>::CreateLambda([](const FAccelByteModelsUGCGetPaginatedUGCContentsResponse& Result)
{
// Do something if SearchV2Contents succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if SearchV2Contents fails
}));
UGCGetContentFilterRequestV2 filterRequest = new UGCGetContentFilterRequestV2()
{
Name = "Content Name",
SubType = "Content Subtype",
Tags = new[] { "UGC Tag1", "UGC Tag2" },
Type = "Content Type"
};
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.SearchContentsV2(filterRequest, result =>
{
if (result.IsError)
{
// Do something if SearchContentsV2 fails
Debug.Log($"Error SearchContentsV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if SearchV2Contents succeeds
});
var response = sdk.Ugc.PublicContentV2.PublicListContentV2Op
.SetName("Content Name")
.SetSubType("Content Subtype")
.SetTags(new List<string>() { "UGC Tag1", "UGC Tag2" })
.SetType("Content Type")
.Execute(sdk.Namespace);
if (response != null)
{
//do something when success
}
publicContentV2Service := &ugc.PublicContentV2Service{
Client: factory.NewUgcClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
namespace := "mygame"
name := "mycontentname"
subType := "mycontentsubtype"
tags := []string{"UGC Tag1", "UGC Tag2"}
type_ := "mycontenttype"
input := &public_content_v2.PublicListContentV2Params{
Namespace: namespace,
Name: &name,
SubType: &subType,
Type: &type_,
Tags: tags,
}
result, err := publicContentV2Service.PublicListContentV2Short(input)
final PublicContentV2 publicContentV2Wrapper = new PublicContentV2(sdk);
ModelsPaginatedContentDownloadResponseV2 response;
try {
response = publicContentV2Wrapper.publicListContentV2(PublicListContentV2.builder()
.namespace("<namespace>")
.name("Content Name")
.subType("Content Subtype")
.tags(Arrays.asList("UGC Tag1", "UGC Tag2"))
.type("Content Type")
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something when success
}
import accelbyte_py_sdk.api.ugc as ugc_service
result, error = ugc_service.public_list_content_v2(
tags=["Sporty", "Red|Classic"],
namespace=namespace, # optional, gets the value from the global instance if unspecified
sdk=sdk, # optional, gets the global instance if unspecified
)
if error:
exit(error)
タイプとサブタイプを使ってコンテンツをフィルタリングする
タイプとサブタイプを使ってコンテンツをフィルタリングするには、次の関数を使用します。
- Unreal Engine
- Unity
- C# Extend SDK
- Go Extend SDK
- Java Extend SDK
- Python Extend SDK
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FAccelByteModelsUGCFilterRequest Filter = {};
Filter.Type = "Content Type";
Filter.SubType = "Content Subtype";
int32 Limit = 1000;
int32 Offset = 0;
EAccelByteUGCContentSortBy SortBy = EAccelByteUGCContentSortBy::CREATED_TIME_DESC;
ApiClient->UGC.SearchV2Contents(Filter,
THandler<FAccelByteModelsUGCGetPaginatedUGCContentsResponse>::CreateLambda([](const FAccelByteModelsUGCGetPaginatedUGCContentsResponse& Result)
{
// Do something if SearchV2Contents succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if SearchV2Contents fails
}), Limit, Offset, SortBy);
UGCGetContentFilterRequestV2 filterRequest = new UGCGetContentFilterRequestV2()
{
Name = "Content Name",
SubType = "Content Subtype",
Tags = new[] { "UGC Tag1", "UGC Tag2" },
Type = "Content Type"
};
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.SearchContentsV2(filterRequest, result =>
{
if (result.IsError)
{
// Do something if SearchContentsV2 fails
Debug.Log($"Error SearchContentsV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if SearchV2Contents succeeds
});
var response = sdk.Ugc.PublicContentV2.PublicListContentV2Op
.SetName("Content Name")
.SetSubType("Content Subtype")
.SetTags(new List<string>() { "UGC Tag1", "UGC Tag2" })
.SetType("Content Type")
.Execute(sdk.Namespace);
if (response != null)
{
//do something when success
}
publicContentV2Service := &ugc.PublicContentV2Service{
Client: factory.NewUgcClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
namespace := "mygame"
name := "mycontentname"
subType := "mycontentsubtype"
tags := []string{"UGC Tag1", "UGC Tag2"}
type_ := "mycontenttype"
input := &public_content_v2.PublicListContentV2Params{
Namespace: namespace,
Name: &name,
SubType: &subType,
Type: &type_,
Tags: tags,
}
result, err := publicContentV2Service.PublicListContentV2Short(input)
final PublicContentV2 publicContentV2Wrapper = new PublicContentV2(sdk);
ModelsPaginatedContentDownloadResponseV2 response;
try {
response = publicContentV2Wrapper.publicListContentV2(PublicListContentV2.builder()
.namespace("<namespace>")
.name("Content Name")
.subType("Content Subtype")
.tags(Arrays.asList("UGC Tag1", "UGC Tag2"))
.type("Content Type")
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something when success
}
import accelbyte_py_sdk.api.ugc as ugc_service
result, error = ugc_service.public_list_content_v2(
type_="Content Type",
sub_type="Content Subtype",
limit=1000,
offset=0,
sort_by="createdTime:desc",
namespace=namespace, # optional, gets the value from the global instance if unspecified
sdk=sdk, # optional, gets the global instance if unspecified
)
if error:
exit(error)
コンテンツを並べ替える
並べ替えフィールドを使用して、ゲーム内で UGC を表示する方法をカスタマイズできます。AGS は、いいね数、作成日時、ダウンロード数、コンテンツ名に基づくコンテンツリストの並べ替えに対応しています。
サポートされている並べ替えオプションは以下の通りです。
createdTime、createdTime:desc、createdTime:ascdownload、download:desc、download:asclike、like:desc、like:ascname、name:desc、name:asc
例えば、最新の UGC を確認したい場合は createdTime:desc を使用して作成日を降順で並べ替えることができます。最も人気のある UGC を確認したい場合は like:desc を使用していいね数を降順で並べ替えることができます。UGC をアルファベット順に表示したい場合は name:asc を使用して名前を昇順で並べ替えることができます。ダウンロード数で並べ替えるには download を使用することもできます。
コンテンツを並べ替えるには、次の関数を使用します。
- Unreal Engine
- Unity
- C# Extend SDK
- Go Extend SDK
- Java Extend SDK
- Python Extend SDK
FApiClientPtr ApiClient = AccelByteOnlineSubsystemPtr->GetApiClient();
FAccelByteModelsUGCFilterRequest Filter = {};
Filter.Name = "Content Name";
Filter.Type = "Content Type";
Filter.SubType = "Content Subtype";
Filter.Tags = { "Sporty", "Red|Brown" };
int32 Limit = 1000;
int32 Offset = 0;
EAccelByteUGCContentSortBy SortBy = EAccelByteUGCContentSortBy::CREATED_TIME_DESC;
ApiClient->UGC.SearchV2Contents(Filter,
THandler<FAccelByteModelsUGCGetPaginatedUGCContentsResponse>::CreateLambda([](const FAccelByteModelsUGCGetPaginatedUGCContentsResponse& Result)
{
// Do something if SearchV2Contents succeeds
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if SearchV2Contents fails
}), Limit, Offset, SortBy);
int limit = 1000;
int offset = 0;
UGCContentSortBy sortBy = UGCContentSortBy.CreatedTimeDesc;
UGCGetContentFilterRequest filterRequest = new UGCGetContentFilterRequest()
{
Name = "Content Name",
Type = "Content Type",
SubType = "Content Subtype",
Tags = new[] { "Sporty", "Red|Brown" }
};
UGC ugc = AccelByteSDK.GetClientRegistry().GetApi().GetUgc();
ugc.SearchContentsV2(filterRequest, result =>
{
if (result.IsError)
{
// Do something if SearchContentsV2 fails
Debug.Log($"Error SearchContentsV2, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
return;
}
// Do something if SearchContentsV2 succeeds
}, limit, offset, sortBy);
var response = sdk.Ugc.PublicContentV2.PublicListContentV2Op
.SetName("Content Name")
.SetSubType("Content Subtype")
.SetTags(new List<string>() { "UGC Tag1", "UGC Tag2" })
.SetType("Content Type")
.SetSortBy("createdTime:desc")
.SetOffset(0)
.SetLimit(1000)
.Execute(sdk.Namespace);
if (response != null)
{
//do something when success
}
publicContentV2Service := &ugc.PublicContentV2Service{
Client: factory.NewUgcClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
namespace := "mygame"
name := "mycontentname"
subType := "mycontentsubtype"
tags := []string{"UGC Tag1", "UGC Tag2"}
type_ := "mycontenttype"
sortBy := "createdTime:desc"
input := &public_content_v2.PublicListContentV2Params{
Namespace: namespace,
Name: &name,
SubType: &subType,
Type: &type_,
Tags: tags,
SortBy: &sortBy,
}
result, err := publicContentV2Service.PublicListContentV2Short(input)
final PublicContentV2 publicContentV2Wrapper = new PublicContentV2(sdk);
ModelsPaginatedContentDownloadResponseV2 response;
try {
response = publicContentV2Wrapper.publicListContentV2(PublicListContentV2.builder()
.namespace("<namespace>")
.name("Content Name")
.subType("Content Subtype")
.tags(Arrays.asList("UGC Tag1", "UGC Tag2"))
.type("Content Type")
.sortBy("createdTime:desc")
.offset(0)
.limit(1000)
.build());
} catch (Exception e) {
// Do something when failed
return;
}
if (response == null) {
// Null response from server
} else {
// Do something when success
}
import accelbyte_py_sdk.api.ugc as ugc_service
result, error = ugc_service.public_list_content_v2(
name="Content Name",
type_="Content Type",
sub_type="Content Subtype",
tags=["Sporty", "Red|Brown"],
limit=1000,
offset=0,
sort_by="createdTime:desc",
namespace=namespace, # optional, gets the value from the global instance if unspecified
sdk=sdk, # optional, gets the global instance if unspecified
)
if error:
exit(error)