초기커밋
This commit is contained in:
241
ServerCommon/Doc/AccountBase/AccountBaseDoc.cs
Normal file
241
ServerCommon/Doc/AccountBase/AccountBaseDoc.cs
Normal file
@@ -0,0 +1,241 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Xml.Schema;
|
||||
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Amazon.DynamoDBv2;
|
||||
using Amazon.DynamoDBv2.Model;
|
||||
using Amazon.DynamoDBv2.DocumentModel;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
using MetaAssets;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class AccountBaseAttrib : AttribBase
|
||||
{
|
||||
// Account Id 값 (사용자 입력 Id or 통합인증 Id)
|
||||
[JsonProperty("account_id")]
|
||||
public ACCOUNT_ID AccountId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("user_guid")]
|
||||
public USER_GUID UserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("password")]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("account_type")]
|
||||
public AccountType AccountType { get; set; } = AccountType.None;
|
||||
|
||||
[JsonProperty("language_type")]
|
||||
public LanguageType LanguageType { get; set; } = LanguageType.None;
|
||||
|
||||
[JsonProperty("auth_amdin_level_type")]
|
||||
public AuthAdminLevelType AuthAdminLevelType { get; set; } = AuthAdminLevelType.None;
|
||||
|
||||
[JsonProperty("account_creation_type")]
|
||||
public AccountCreationType AccountCreationType { get; set; } = AccountCreationType.None;
|
||||
|
||||
[JsonProperty("account_creation_meta_id")]
|
||||
public META_ID AccountCreationMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("login_datetime")]
|
||||
public DateTime LoginDateTime = DateTime.MinValue;
|
||||
|
||||
[JsonProperty("logout_datetime")]
|
||||
public DateTime LogoutDateTime = DateTime.MinValue;
|
||||
|
||||
[JsonProperty("created_datetime")]
|
||||
public DateTime CreatedDateTime = DateTime.MinValue;
|
||||
|
||||
[JsonProperty("block_start_datetime")]
|
||||
public DateTime BlockStartDateTime { get; set; } = DateTime.MaxValue;
|
||||
|
||||
[JsonProperty("block_end_datetime")]
|
||||
public DateTime BlockEndDateTime { get; set; } = DateTime.MaxValue;
|
||||
|
||||
[JsonProperty("block_policy")]
|
||||
public List<string> BlockPolicy { get; set; } = new();
|
||||
|
||||
[JsonProperty("block_reason")]
|
||||
public string BlockReason { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("access_token")]
|
||||
public UInt64 AccessToken { get; set; } = 0;
|
||||
|
||||
[JsonProperty("sso_account_auth_jwt")]
|
||||
public string SsoAccountAuthJWT { get; set; } = string.Empty;
|
||||
|
||||
public AccountBaseAttrib()
|
||||
: base(typeof(AccountBaseAttrib).Name)
|
||||
{}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "account_base#login_account_id"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : AccountBaseDoc
|
||||
// Attrib : AccountBaseAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class AccountBaseDoc : DynamoDbDocBase, ICopyDocFromMeta
|
||||
{
|
||||
private static string getPrefixOfPK() { return "account_base#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
|
||||
public AccountBaseDoc()
|
||||
: base(typeof(AccountBaseDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public AccountBaseDoc(string loginAccountId)
|
||||
: base(typeof(AccountBaseDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(loginAccountId);
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<AccountBaseAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
public bool copyDocFromMeta(MetaAssets.IMetaData customMeta)
|
||||
{
|
||||
var err_msg = string.Empty;
|
||||
|
||||
bool is_success = false;
|
||||
|
||||
if( null != customMeta as TestUserCreateMetaData
|
||||
&& true == copyDocFromTestUserCreateMetaData(customMeta as TestUserCreateMetaData) )
|
||||
{ is_success = true; }
|
||||
|
||||
if( null != customMeta as UserCreateMetaData
|
||||
&& true == copyDocFromUserCreateMetaData(customMeta as UserCreateMetaData))
|
||||
{ is_success = true; }
|
||||
|
||||
if (false == is_success)
|
||||
{
|
||||
err_msg = $"Failed to copyDocFromMeta() !!!, no successful data copies !!! : {customMeta.getTypeName()}";
|
||||
Log.getLogger().error(err_msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool copyDocFromTestUserCreateMetaData(TestUserCreateMetaData? customMeta)
|
||||
{
|
||||
var err_msg = string.Empty;
|
||||
|
||||
var to_cast_string = typeof(TestUserCreateMetaData).Name;
|
||||
if (null == customMeta)
|
||||
{
|
||||
err_msg = $"Failed to copyDocFromTestUserCreateMetaData() !!!, customMeta is null : {to_cast_string}";
|
||||
Log.getLogger().warn(err_msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
var attrib = getAttrib<AccountBaseAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(attrib, () => $"attrib is null !!!");
|
||||
|
||||
attrib.Password = customMeta.Password;
|
||||
attrib.LanguageType = customMeta.Language;
|
||||
attrib.AccountCreationType = AccountCreationType.Test;
|
||||
attrib.AccountCreationMetaId = (UInt32)customMeta.MetaId;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool copyDocFromUserCreateMetaData(UserCreateMetaData? customMeta)
|
||||
{
|
||||
var err_msg = string.Empty;
|
||||
|
||||
var to_cast_string = typeof(UserCreateMetaData).Name;
|
||||
if (null == customMeta)
|
||||
{
|
||||
err_msg = $"Failed to copyDocFromUserCreateMetaData() !!!, customMeta is null : {to_cast_string}";
|
||||
Log.getLogger().warn(err_msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
var attrib = getAttrib<AccountBaseAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(attrib, () => $"attrib is null !!!");
|
||||
|
||||
attrib.LanguageType = LanguageType.Ko;
|
||||
attrib.AccountCreationType = AccountCreationType.Normal;
|
||||
attrib.AccountCreationMetaId = (UInt32)customMeta.MetaId;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static async Task<(Result, AccountBaseDoc?)> findUserGuidFromAccountId(string accountId)
|
||||
{
|
||||
var result = new Result();
|
||||
var err_msg = string.Empty;
|
||||
|
||||
var server_logic = ServerLogicApp.getServerLogicApp();
|
||||
NullReferenceCheckHelper.throwIfNull(server_logic, () => $"server_logic is null !!!");
|
||||
var dynamo_db_client = server_logic.getDynamoDbClient();
|
||||
NullReferenceCheckHelper.throwIfNull(dynamo_db_client, () => $"dynamo_db_client is null !!!");
|
||||
|
||||
return await findUserGuidFromAccountId(dynamo_db_client, accountId);
|
||||
}
|
||||
|
||||
public static async Task<(Result, AccountBaseDoc?)> findUserGuidFromAccountId(DynamoDbClient dynamoDbClient, string accountId)
|
||||
{
|
||||
var result = new Result();
|
||||
var err_msg = string.Empty;
|
||||
|
||||
(result, var make_primary_key) = await DynamoDBDocBaseHelper.makePrimaryKey<AccountBaseDoc>(accountId);
|
||||
NullReferenceCheckHelper.throwIfNull(make_primary_key, () => $"make_primary_key is null !!! -");
|
||||
if (result.isFail())
|
||||
{
|
||||
return (result, null);
|
||||
}
|
||||
var query_config = dynamoDbClient.makeQueryConfigForReadByPKOnly(make_primary_key.PK);
|
||||
|
||||
(result, var found_account_base_doc) = await dynamoDbClient.simpleQueryDocTypeWithQueryOperationConfig<AccountBaseDoc>(query_config);
|
||||
if (result.isFail())
|
||||
{
|
||||
err_msg = $"Failed to simpleQueryDocTypeWithQueryOperationConfig() !!! : {result.toBasicString()}, {make_primary_key.toBasicString()}";
|
||||
Log.getLogger().error(err_msg);
|
||||
|
||||
return (result, null);
|
||||
}
|
||||
|
||||
return (result, found_account_base_doc);
|
||||
}
|
||||
}
|
||||
81
ServerCommon/Doc/Backup/BackupDoc.cs
Normal file
81
ServerCommon/Doc/Backup/BackupDoc.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using WORLD_ID = System.UInt32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class DeleteDocAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("doc")]
|
||||
public DynamoDbDocBase? m_deleted_doc_nullable;
|
||||
|
||||
public DeleteDocAttrib()
|
||||
: base(typeof(DeleteDocAttrib).Name)
|
||||
{}
|
||||
|
||||
public void setDeletedDoc(DynamoDbDocBase doc) => m_deleted_doc_nullable = doc;
|
||||
|
||||
public override string toJsonString()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "backup#[Deleted DocType PK]"
|
||||
// SK(Sort Key) : "[Deleted DocType SK]"
|
||||
// DocType : BackupDoc
|
||||
// DeleteDocAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class BackupDoc : DynamoDbDocBase, ICopyBackupDocFromDoc
|
||||
{
|
||||
private static string getPrefixOfPK() { return "backup#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public BackupDoc(DynamoDbDocBase deletedDoc)
|
||||
: base(typeof(BackupDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(deletedDoc.getPK());
|
||||
setCombinationKeyForSK(deletedDoc.getSK());
|
||||
|
||||
appendAttribWrapper(new AttribWrapper<DeleteDocAttrib>());
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
public bool copyBackupDocFromDoc(DynamoDbDocBase doc)
|
||||
{
|
||||
var found_attrib = getAttrib<DeleteDocAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(found_attrib, () => $"found_attrib is null !!!");
|
||||
|
||||
found_attrib.setDeletedDoc(doc);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
95
ServerCommon/Doc/BuildingBase/BuildingDoc.cs
Normal file
95
ServerCommon/Doc/BuildingBase/BuildingDoc.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
using OWNER_GUID = System.String;
|
||||
using BUILDING_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class BuildingAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("building_guid")]
|
||||
public BUILDING_GUID BuildingGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("building_meta_id")]
|
||||
public META_ID BuildingMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("building_name")]
|
||||
public string BuildingName { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_user_guid")]
|
||||
public string OwnerUserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty]
|
||||
public CurrencyType RentalCurrencyType { get; set; } = CurrencyType.None;
|
||||
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringToDoubleEpsilonRoundConverter))]
|
||||
public double RentalCurrencyAmount { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public bool IsRentalOpen { get; set; } = false;
|
||||
|
||||
|
||||
public BuildingAttrib()
|
||||
: base(typeof(BuildingAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "building#building_meta_id"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : BuildingDoc
|
||||
// BuildingAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class BuildingDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "building#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public BuildingDoc()
|
||||
: base(typeof(BuildingDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public BuildingDoc(META_ID buildingMetaId)
|
||||
: base(typeof(BuildingDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(buildingMetaId.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<BuildingAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
120
ServerCommon/Doc/BuildingBase/BuildingFloorDoc.cs
Normal file
120
ServerCommon/Doc/BuildingBase/BuildingFloorDoc.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class BuildingFloorAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("land_meta_id")]
|
||||
public int LandMetaId { get; set; }
|
||||
|
||||
[JsonProperty("building_meta_id")]
|
||||
public int BuildingMetaId { get; set; }
|
||||
|
||||
[JsonProperty("floor")]
|
||||
public int Floor { get; set; }
|
||||
|
||||
[JsonProperty("owner_guid")]
|
||||
public string OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("myhome_guid")]
|
||||
public string MyhomeGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("instance_name")]
|
||||
public string InstanceName { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("thumbnail_image_id")]
|
||||
public int ThumbnailImageId { get; set; }
|
||||
|
||||
[JsonProperty("list_image_id")]
|
||||
public int ListImageId { get; set; }
|
||||
|
||||
[JsonProperty("enter_player_count")]
|
||||
public int EnterPlayerCount { get; set; }
|
||||
|
||||
[JsonProperty("rental_period")]
|
||||
public TimeSpan RentalPeriod { get; set; } = new();
|
||||
|
||||
[JsonProperty("rental_start_time")]
|
||||
public DateTime RentalStartTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("rental_finish_time")]
|
||||
public DateTime RentalFinishTime { get; set; } = new();
|
||||
|
||||
public BuildingFloorAttrib()
|
||||
: base(typeof(BuildingFloorAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "building#building_meta_id"
|
||||
// SK(Sort Key) : "floor#층넘버"
|
||||
// DocType : BuildingFloorDoc
|
||||
// MyHomeAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class BuildingFloorDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "building#"; }
|
||||
|
||||
public static string getPrefixOfSK() { return "floor#"; }
|
||||
public BuildingFloorDoc()
|
||||
: base(typeof(BuildingFloorDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public BuildingFloorDoc(int buildingMetaId, int floor)
|
||||
: base(typeof(BuildingFloorDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(buildingMetaId.ToString());
|
||||
setCombinationKeyForSK(floor.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
public BuildingFloorDoc(int buildingMetaId, int floor, long ttlSeconds)
|
||||
: base(typeof(BuildingFloorDoc).Name, ttlSeconds)
|
||||
{
|
||||
setCombinationKeyForPK(buildingMetaId.ToString());
|
||||
setCombinationKeyForSK(floor.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<BuildingFloorAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
92
ServerCommon/Doc/BuildingBase/BuildingProfitDoc.cs
Normal file
92
ServerCommon/Doc/BuildingBase/BuildingProfitDoc.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class BuildingProfitAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("building_meta_id")]
|
||||
public int BuildingMetaId { get; set; }
|
||||
|
||||
[JsonProperty("floor")]
|
||||
public int Floor { get; set; }
|
||||
|
||||
[JsonProperty("profit")]
|
||||
public Dictionary<CurrencyType, double> Profits { get; set; } = new();
|
||||
|
||||
|
||||
public BuildingProfitAttrib()
|
||||
: base(typeof(BuildingProfitAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "building#building_meta_id"
|
||||
// SK(Sort Key) : "profit#floor"
|
||||
// DocType : BuildingProfitDoc
|
||||
// BuildingAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class BuildingProfitDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "building#"; }
|
||||
|
||||
public static string getPrefixOfSK() { return "profit#"; }
|
||||
|
||||
|
||||
public BuildingProfitDoc()
|
||||
: base(typeof(BuildingProfitAttrib).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public BuildingProfitDoc(int buildingMetaId, int floor)
|
||||
: base(typeof(BuildingProfitAttrib).Name)
|
||||
{
|
||||
setCombinationKeyForPK(buildingMetaId.ToString());
|
||||
setCombinationKeyForSK(floor.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<BuildingProfitAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
100
ServerCommon/Doc/BuildingBase/BuildingProfitHistoryDoc.cs
Normal file
100
ServerCommon/Doc/BuildingBase/BuildingProfitHistoryDoc.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class BuildingProfitHistoryAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("building_meta_id")]
|
||||
public int BuildingMetaId { get; set; }
|
||||
|
||||
[JsonProperty("floor")]
|
||||
public int Floor { get; set; } = 0;
|
||||
|
||||
[JsonProperty("profit_time")]
|
||||
public DateTime ProfitTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("profit_history_type")]
|
||||
public ProfitHistoryType ProfitHistoryType { get; set; } = ProfitHistoryType.None;
|
||||
|
||||
[JsonProperty("profit")]
|
||||
public Dictionary<CurrencyType, double> Profits { get; set; } = new();
|
||||
|
||||
|
||||
public BuildingProfitHistoryAttrib()
|
||||
: base(typeof(BuildingProfitHistoryAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "building#building_meta_id"
|
||||
// SK(Sort Key) : "profit_history#timestamp"
|
||||
// DocType : BuildingProfitHistoryDoc
|
||||
// BuildingAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class BuildingProfitHistoryDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "building#"; }
|
||||
|
||||
public static string getPrefixOfSK() { return "profit_history#"; }
|
||||
|
||||
|
||||
public BuildingProfitHistoryDoc()
|
||||
: base(typeof(BuildingProfitHistoryAttrib).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public BuildingProfitHistoryDoc(int buildingMetaId, Timestamp timestamp)
|
||||
: base(typeof(BuildingProfitHistoryAttrib).Name)
|
||||
{
|
||||
setCombinationKeyForPK(buildingMetaId.ToString());
|
||||
setCombinationKeyForSK(timestamp.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<BuildingProfitHistoryAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
101
ServerCommon/Doc/BuildingBase/BuildingRentalHistoryDoc.cs
Normal file
101
ServerCommon/Doc/BuildingBase/BuildingRentalHistoryDoc.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class BuildingRentalHistoryAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public int BuildingMetaId { get; set; }
|
||||
|
||||
[JsonProperty("floor")]
|
||||
public int Floor { get; set; } = 0;
|
||||
|
||||
[JsonProperty("rentee_user_guid")]
|
||||
public string RenteeUserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("rental_time")]
|
||||
public DateTime RentalTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("rental_period")]
|
||||
public int RentalPeriod { get; set; } = 0;
|
||||
|
||||
|
||||
public BuildingRentalHistoryAttrib()
|
||||
: base(typeof(BuildingRentalHistoryAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "building#building_meta_id"
|
||||
// SK(Sort Key) : "rental_history#timestamp"
|
||||
// DocType : BuildingRentalHistoryDoc
|
||||
// BuildingAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class BuildingRentalHistoryDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "building#"; }
|
||||
|
||||
public static string getPrefixOfSK() { return "rental_history#"; }
|
||||
|
||||
|
||||
public BuildingRentalHistoryDoc()
|
||||
: base(typeof(BuildingRentalHistoryAttrib).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public BuildingRentalHistoryDoc(int buildingMetaId, Timestamp timestamp)
|
||||
: base(typeof(BuildingRentalHistoryAttrib).Name)
|
||||
{
|
||||
setCombinationKeyForPK(buildingMetaId.ToString());
|
||||
setCombinationKeyForSK(timestamp.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<BuildingRentalHistoryAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
130
ServerCommon/Doc/GameZone/FarmingEffectLocationInTargetDoc.cs
Normal file
130
ServerCommon/Doc/GameZone/FarmingEffectLocationInTargetDoc.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using WORLD_ID = System.UInt32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using USER_NICKNAME = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using ENTITY_UNIQUE_ID = System.String;
|
||||
using ANCHOR_META_GUID = System.String;
|
||||
using LOCATION_UNIQUE_ID = System.String;
|
||||
using NPC_UNIQUE_ID = System.String;
|
||||
using FARMING_ENTITY_GUID = System.String;
|
||||
using FARMING_EFFECT_DOC_LINK_PKSK = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class FarmingEffectLocationInTargetAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("location_unique_id")] //[PK 참조]
|
||||
public LOCATION_UNIQUE_ID LocationUniqueId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("anchor_meta_guid")]
|
||||
public ANCHOR_META_GUID AnchorMetaGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_user_guid")]
|
||||
public USER_GUID UserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_user_nickname")]
|
||||
public USER_NICKNAME UserNickname { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("farming_effect_doc_link_pk_sk")]
|
||||
public FARMING_EFFECT_DOC_LINK_PKSK FarmingEffectDocLinkPKSK { get; set; } = string.Empty;
|
||||
|
||||
public FarmingEffectLocationInTargetAttrib()
|
||||
: base(typeof(FarmingEffectLocationInTargetAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "farming_effect_location#{LOCATION_UNIQUE_ID}" [LOCATION_UNIQUE_ID.InstanceNumber: ChannelNo, RoomId]
|
||||
// SK(Sort Key) : "FARMING_EFFECT_DOC_LINK_PKSK"
|
||||
// DocType : "FarmingEffectLocationInTargetDoc"
|
||||
// FarmingLocationInTargetAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class FarmingEffectLocationInTargetDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getDocTypeName() { return typeof(FarmingEffectLocationInTargetDoc).Name; }
|
||||
private string getPrefixOfPK() { return $"farming_effect_location#"; }
|
||||
private string getPrefixOfSK() { return ""; }
|
||||
|
||||
public FarmingEffectLocationInTargetDoc()
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public FarmingEffectLocationInTargetDoc(LOCATION_UNIQUE_ID locationUniqueId, FARMING_EFFECT_DOC_LINK_PKSK farmingEffectDocLinkPKSK = "")
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(locationUniqueId);
|
||||
setCombinationKeyForSK(farmingEffectDocLinkPKSK);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
public FarmingEffectLocationInTargetDoc( LOCATION_UNIQUE_ID locationUniqueId
|
||||
, ANCHOR_META_GUID anchorMetaGuid, USER_GUID userGuid, USER_NICKNAME userNickname
|
||||
, FARMING_EFFECT_DOC_LINK_PKSK farmingEffectDocLinkPKSK )
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(locationUniqueId);
|
||||
setCombinationKeyForSK(farmingEffectDocLinkPKSK);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var farming_effect_location_in_target_attrib = getAttrib<FarmingEffectLocationInTargetAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(farming_effect_location_in_target_attrib, () => $"farming_effect_location_in_target_attrib is null !!!");
|
||||
|
||||
farming_effect_location_in_target_attrib.LocationUniqueId = locationUniqueId;
|
||||
farming_effect_location_in_target_attrib.AnchorMetaGuid = anchorMetaGuid;
|
||||
farming_effect_location_in_target_attrib.UserGuid = userGuid;
|
||||
farming_effect_location_in_target_attrib.UserNickname = userNickname;
|
||||
farming_effect_location_in_target_attrib.FarmingEffectDocLinkPKSK = farmingEffectDocLinkPKSK;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<FarmingEffectLocationInTargetAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
136
ServerCommon/Doc/GameZone/NpcLocationInTargetDoc.cs
Normal file
136
ServerCommon/Doc/GameZone/NpcLocationInTargetDoc.cs
Normal file
@@ -0,0 +1,136 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using ENTITY_UNIQUE_ID = System.String;
|
||||
using ANCHOR_META_GUID = System.String;
|
||||
using LOCATION_UNIQUE_ID = System.String;
|
||||
using NPC_UNIQUE_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class NpcLocationInTargetAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("location_unique_id")] //[PK 참조]
|
||||
public LOCATION_UNIQUE_ID LocationUniqueId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("anchor_meta_guid")] //[SK 참조]
|
||||
public ANCHOR_META_GUID AnchorMetaGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("npc_type")]
|
||||
public EntityType NpcType { get; set; } = 0;
|
||||
|
||||
[JsonProperty("npc_unique_id")] //[EntityType.Beacon: UgcNpcMetaGuid]
|
||||
public NPC_UNIQUE_ID NpcUniqueId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("npc_location")]
|
||||
public NpcLocation NpcLocation { get; set; } = new NpcLocation();
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
public NpcLocationInTargetAttrib()
|
||||
: base(typeof(NpcLocationInTargetAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "npc_location#{LOCATION_UNIQUE_ID}" [LOCATION_UNIQUE_ID.InstanceNumber: MyHomeMetaGuid, RoomId]
|
||||
// SK(Sort Key) : "anchor_meta_guid"
|
||||
// DocType : "NpcLocationInTargetDoc"
|
||||
// NpcLocationInTargetAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class NpcLocationInTargetDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getDocTypeName() { return typeof(NpcLocationInTargetDoc).Name; }
|
||||
private string getPrefixOfPK() { return $"npc_location#"; }
|
||||
private string getPrefixOfSK() { return ""; }
|
||||
|
||||
public NpcLocationInTargetDoc()
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public NpcLocationInTargetDoc(LOCATION_UNIQUE_ID locationUniqueId)
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(locationUniqueId);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
public NpcLocationInTargetDoc(LOCATION_UNIQUE_ID locationUniqueId, ANCHOR_META_GUID anchorMetaGuid)
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(locationUniqueId);
|
||||
setCombinationKeyForSK(anchorMetaGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
public NpcLocationInTargetDoc( LOCATION_UNIQUE_ID locationUniqueId, ANCHOR_META_GUID anchorMetaGuid
|
||||
, EntityType npcType, NPC_UNIQUE_ID npcUniqueId, NpcLocation npcLocation
|
||||
, OwnerEntityType ownerEntityType, OWNER_GUID ownerGuid )
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(locationUniqueId);
|
||||
setCombinationKeyForSK(anchorMetaGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var npc_location_in_target_attrib = getAttrib<NpcLocationInTargetAttrib>();
|
||||
ArgumentNullException.ThrowIfNull(npc_location_in_target_attrib, $"npc_location_in_target_attrib is null !!!");
|
||||
|
||||
npc_location_in_target_attrib.LocationUniqueId = locationUniqueId;
|
||||
npc_location_in_target_attrib.AnchorMetaGuid = anchorMetaGuid;
|
||||
npc_location_in_target_attrib.NpcType = npcType;
|
||||
npc_location_in_target_attrib.NpcUniqueId = npcUniqueId;
|
||||
npc_location_in_target_attrib.NpcLocation = npcLocation;
|
||||
npc_location_in_target_attrib.OwnerEntityType = ownerEntityType;
|
||||
npc_location_in_target_attrib.OwnerGuid = ownerGuid;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<NpcLocationInTargetAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
77
ServerCommon/Doc/Global/CaliumContentDoc.cs
Normal file
77
ServerCommon/Doc/Global/CaliumContentDoc.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CaliumContentAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("calium_content_id")]
|
||||
public string ContentId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("calium")]
|
||||
public double TotalCalium { get; set; } = 0.0;
|
||||
|
||||
public CaliumContentAttrib() : base(nameof(CaliumContentAttrib), false) {}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "calium#content"
|
||||
// SK(Sort Key) : "contentId"
|
||||
// DocType : CaliumEventDoc
|
||||
// CaliumContentAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CaliumContentDoc : DynamoDbDocBase
|
||||
{
|
||||
public static string pk = "calium#content";
|
||||
private readonly string m_content_id;
|
||||
|
||||
private string getPrefixOfPK() => pk;
|
||||
private string getPrefixOfSK() => m_content_id;
|
||||
|
||||
public CaliumContentDoc(string contentId) : base(nameof(CaliumContentDoc))
|
||||
{
|
||||
m_content_id = contentId;
|
||||
setCombinationKeyForSK(contentId);
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
var doc_attrib = getAttrib<CaliumContentAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_attrib, () => $"doc_attrib is null !!! - contentId:{contentId}");
|
||||
doc_attrib.ContentId = contentId;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CaliumContentAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
61
ServerCommon/Doc/Global/CaliumConverterDoc.cs
Normal file
61
ServerCommon/Doc/Global/CaliumConverterDoc.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using DYNAMO_DB_TABLE_FULL_NAME = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CaliumConverterAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("cailum")] public double Calium { get; set; }
|
||||
[JsonProperty("last_fill_up_date")] public string LastFillUpDate { get; set; } = string.Empty;
|
||||
|
||||
public CaliumConverterAttrib() : base(nameof(CaliumConverterAttrib), false)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key : Deprecated -> Migration 에서 쓰고 있음 ( 추후 삭제 필요 )
|
||||
// PK(Partition Key) : "caliumconverter#total"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : CaliumConverterDoc
|
||||
// Attrib : CaliumConverterAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CaliumConverterDoc : DynamoDbDocBase
|
||||
{
|
||||
public static string pk = "caliumconverter#total";
|
||||
|
||||
private static string getPrefixOfPK() => "";
|
||||
private static string getPrefixOfSK() => "";
|
||||
|
||||
public CaliumConverterDoc() : base(nameof(CaliumConverterDoc))
|
||||
{
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CaliumConverterAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK() => getPrefixOfPK();
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return pk;
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
}
|
||||
77
ServerCommon/Doc/Global/CaliumConverterForUserDoc.cs
Normal file
77
ServerCommon/Doc/Global/CaliumConverterForUserDoc.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using USER_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CaliumConverterForUserAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("data")] public Dictionary<USER_GUID, double> UserCalium { get; set; } = new();
|
||||
|
||||
public CaliumConverterForUserAttrib() : base(nameof(CaliumConverterForUserAttrib), false)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key : Deprecated -> Migration 에서 쓰고 있음 ( 추후 삭제 필요 )
|
||||
// PK(Partition Key) : "caliumconverter#user"
|
||||
// SK(Sort Key) : "dd"
|
||||
// DocType : CaliumConverterForUserDoc
|
||||
// Attrib : CaliumConverterForUserAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CaliumConverterForUserDoc : DynamoDbDocBase
|
||||
{
|
||||
public static string pk = "caliumconverter#user";
|
||||
|
||||
private static string getPrefixOfPK() => "";
|
||||
private static string getPrefixOfSK() => "";
|
||||
|
||||
public CaliumConverterForUserDoc(int day, Int64 ttlSeconds) : base(nameof(CaliumConverterForUserDoc), ttlSeconds)
|
||||
{
|
||||
setCombinationKeyForSK(day.ToString());
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CaliumConverterForUserDoc() : base(nameof(CaliumConverterForUserDoc))
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CaliumConverterForUserAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK() => getPrefixOfPK();
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return pk;
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
143
ServerCommon/Doc/Global/CaliumEventDoc.cs
Normal file
143
ServerCommon/Doc/Global/CaliumEventDoc.cs
Normal file
@@ -0,0 +1,143 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using USER_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public enum CaliumEventStatus
|
||||
{
|
||||
None = 0,
|
||||
Regist = 1,
|
||||
Sending = 2,
|
||||
Failed = 4,
|
||||
Success = 5
|
||||
}
|
||||
|
||||
public class CaliumEventData
|
||||
{
|
||||
// Event Id
|
||||
[JsonProperty("event_id")]
|
||||
public string m_event_id { get; set; } = Guid.NewGuid().ToString();
|
||||
|
||||
// 서버 타입
|
||||
[JsonProperty("server_type")]
|
||||
public string m_server_type { get; set; } = string.Empty;
|
||||
|
||||
// 이벤트 타입 : calium_get(교환소 칼리움 획득) , extra_get(교환소 외 사파이어 소각) , calium_burn(칼리움 소각)
|
||||
[JsonProperty("event_type")]
|
||||
public string m_event_type { get; set; } = string.Empty;
|
||||
|
||||
// 하위타입 (위치구분)
|
||||
[JsonProperty("sub_type")]
|
||||
public string m_sub_type { get; set; } = string.Empty;
|
||||
|
||||
// 대상 구분 타입 : "user_nickname" 고정값
|
||||
[JsonProperty("div_type")]
|
||||
public string m_div_type { get; set; } = "user_nickname";
|
||||
|
||||
// 대상 구분 ID (유저 Nickname)
|
||||
[JsonProperty("div_id")]
|
||||
public string m_div_id { get; set; } = string.Empty;
|
||||
|
||||
// 칼리움 변경량 ( 양수 : 획득 / 음수 : 소모 )
|
||||
[JsonProperty("calium_change_volume")]
|
||||
public double m_calium_delta { get; set; }
|
||||
|
||||
// 사파이어 변경량 ( 양수 : 획득 / 음수 : 소모 )
|
||||
[JsonProperty("sapphire_change_volume")]
|
||||
public double m_sapphire_delta { get; set; }
|
||||
|
||||
// 이벤트 해당일의 epoch
|
||||
[JsonProperty("seq")]
|
||||
public int m_current_epoch { get; set; }
|
||||
|
||||
// 이벤트 해당일의 인플레이션 가중치
|
||||
[JsonProperty("swap_rate")]
|
||||
public double m_current_inflation_rate { get; set; }
|
||||
|
||||
// 이벤트 전송 시간
|
||||
[JsonProperty("event_time")]
|
||||
public string? m_event_time { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class CaliumEventAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("user_guid")] public USER_GUID UserGuid { get; set; } = string.Empty;
|
||||
[JsonProperty("status")] public CaliumEventStatus Status { get; set; }
|
||||
[JsonProperty("update_date")] public DateTime UpdateTime { get; set; } = DateTimeHelper.Current;
|
||||
[JsonProperty("calium_event")] public CaliumEventData EventData { get; set; } = new();
|
||||
public CaliumEventAttrib() : base(nameof(CaliumEventAttrib), false) {}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "calium#event"
|
||||
// SK(Sort Key) : "event_guid"
|
||||
// DocType : CaliumEventDoc
|
||||
// CaliumEventAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CaliumEventDoc : DynamoDbDocBase
|
||||
{
|
||||
public static string pk = "calium#event";
|
||||
private readonly string m_event_guid;
|
||||
|
||||
private string getPrefixOfPK() => "";
|
||||
private string getPrefixOfSK() => "";
|
||||
|
||||
public CaliumEventDoc(string? eventGuid) : base(nameof(CaliumEventDoc))
|
||||
{
|
||||
m_event_guid = eventGuid ?? Guid.NewGuid().ToString();
|
||||
setCombinationKeyForSK(m_event_guid);
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CaliumEventDoc() : base(nameof(CaliumEventDoc))
|
||||
{
|
||||
m_event_guid = Guid.NewGuid().ToString();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CaliumEventAttrib>());
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return pk;
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
129
ServerCommon/Doc/Global/CaliumStorageDoc.cs
Normal file
129
ServerCommon/Doc/Global/CaliumStorageDoc.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public class CaliumConverterInfo
|
||||
{
|
||||
// 잔여 수량
|
||||
[JsonProperty("converter_total_calium")]
|
||||
public double TotalCalium { get; set; } = 0.0;
|
||||
|
||||
// 마지막 누적 시간
|
||||
[JsonProperty("converter_last_fill_up_date")]
|
||||
public DateTime LastFillUpDate { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
// Daily 누적 Calium 수
|
||||
[JsonProperty("converter_daily_fill_up_standard_calium")]
|
||||
public double DailyFillUpStandardCalium { get; set; } = 0.0;
|
||||
|
||||
// 컨버터 칼리움 전환 비율
|
||||
[JsonProperty("converter_daily_convert_rate")]
|
||||
public double DailyConvertRate { get; set; } = 0.0;
|
||||
|
||||
// 누적 총량
|
||||
[JsonProperty("converter_cumulative_calium")]
|
||||
public double ConverterCumulativeCalium { get; set; } = 0.0;
|
||||
}
|
||||
|
||||
public class CaliumExchangerInfo
|
||||
{
|
||||
// 인플레이션 가중치
|
||||
[JsonProperty("exchanger_daily_inflation_rate")]
|
||||
public double DailyInflationRate { get; set; } = 0.0;
|
||||
}
|
||||
|
||||
public class CaliumOperatorInfo
|
||||
{
|
||||
// 운영 승인 누적량
|
||||
[JsonProperty("operator_total_calium")]
|
||||
public double TotalCalium { get; set; } = 0.0;
|
||||
|
||||
// 운영 승인 누적 날짜
|
||||
[JsonProperty("operator_calium_fill_up_date")]
|
||||
public DateTime FillUpDate { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
// 운영용 사용 가능량
|
||||
[JsonProperty("operator_calium")]
|
||||
public double OperatorCalium { get; set; } = 0.0;
|
||||
}
|
||||
|
||||
public class CaliumStorageAttrib : AttribBase
|
||||
{
|
||||
// RollUp 순번
|
||||
[JsonProperty("daily_epoch")]
|
||||
public int DailyEpoch { get; set; } = 0;
|
||||
|
||||
// RollUp 실패 Epoch Count
|
||||
[JsonProperty("mis_epoch")]
|
||||
public int MisEpoch { get; set; } = 0;
|
||||
|
||||
// RollUp Check 시작
|
||||
[JsonProperty("daily_rollup_check_date")]
|
||||
public DateTime DailyRollUpCheckDate { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
// RollUp 시간
|
||||
[JsonProperty("daily_pivot_date")]
|
||||
public DateTime DailyPivotDate { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
// 컨버터 저장 정보
|
||||
[JsonProperty("calium_converter_storage")]
|
||||
public CaliumConverterInfo ConverterStorage { get; set; } = new();
|
||||
|
||||
// 교환소 저장 정보
|
||||
[JsonProperty("calium_exchanger_storage")]
|
||||
public CaliumExchangerInfo ExchangerStorage { get; set; } = new();
|
||||
|
||||
// 운영 저장 정보
|
||||
[JsonProperty("calium_operator_storage")]
|
||||
public CaliumOperatorInfo OperatorStorage { get; set; } = new();
|
||||
|
||||
public CaliumStorageAttrib() : base(nameof(CaliumStorageAttrib), false) {}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "calium#storage"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : CaliumStorageDoc
|
||||
// CaliumStorageAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CaliumStorageDoc : DynamoDbDocBase
|
||||
{
|
||||
public static string pk = "calium#storage";
|
||||
|
||||
private static string getPrefixOfPK() { return ""; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public CaliumStorageDoc() : base(nameof(CaliumStorageDoc))
|
||||
{
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CaliumStorageAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return pk;
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
}
|
||||
84
ServerCommon/Doc/Global/LandAuctionActivityDoc.cs
Normal file
84
ServerCommon/Doc/Global/LandAuctionActivityDoc.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
using LAND_AUCTION_NUMBER = System.Int32;
|
||||
|
||||
|
||||
public class LandAuctionActivityAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("land_meta_id")]
|
||||
public META_ID LandMetaId { get; set; } = 0; // 경매 대상 LandData Meta Id
|
||||
|
||||
[JsonProperty("auction_number")]
|
||||
public LAND_AUCTION_NUMBER AuctionNumber { get; set; } = 0; // 경매 번호
|
||||
|
||||
public LandAuctionActivityAttrib()
|
||||
: base(nameof(LandAuctionActivityAttrib), false)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Desc : 활성화중인 랜드 경매별 등록 정보
|
||||
// Primary Key
|
||||
// PK(Partition Key) : land_auction_activity#global
|
||||
// SK(Sort Key) : "{land_meta_id}"
|
||||
// DocType : LandAuctionActiveDoc
|
||||
// Attrib : LandAuctionActiveAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class LandAuctionActivityDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() => "land_auction_activity#";
|
||||
|
||||
public LandAuctionActivityDoc() :
|
||||
base(nameof(LandAuctionActivityDoc))
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public LandAuctionActivityDoc(META_ID landMetaId)
|
||||
: base(nameof(LandAuctionActivityDoc))
|
||||
{
|
||||
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
|
||||
setCombinationKeyForSK(landMetaId.ToString());
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
var land_auction_activity_attrib = getAttrib<LandAuctionActivityAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(land_auction_activity_attrib, () => $"land_auction_activity_attrib is null !!!");
|
||||
|
||||
land_auction_activity_attrib.LandMetaId = landMetaId;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<LandAuctionActivityAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK() => getPrefixOfPK();
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
122
ServerCommon/Doc/Global/LandAuctionHighestBidUserDoc.cs
Normal file
122
ServerCommon/Doc/Global/LandAuctionHighestBidUserDoc.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
using LAND_AUCTION_NUMBER = System.Int32;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public class LandAuctionHighestBidUserAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("land_meta_id")]
|
||||
public META_ID LandMetaId { get; set; } = 0; // 경매 대상 LandData Meta Id
|
||||
|
||||
[JsonProperty("auction_number")]
|
||||
public LAND_AUCTION_NUMBER AuctionNumber { get; set; } = 0; // 경매 번호
|
||||
|
||||
[JsonProperty("bid_currency_type")]
|
||||
public CurrencyType BidCurrencyType { get; set; } = 0; // 입찰 재화의 종류
|
||||
|
||||
//=============================================================================================
|
||||
// 현재 최고 입찰자 정보
|
||||
//=============================================================================================
|
||||
[JsonProperty("highest_bid_price")]
|
||||
public double HighestBidPrice { get; set; } = 0; // 입찰 최고가
|
||||
|
||||
[JsonProperty("highest_user_guid")]
|
||||
public string HighestBidUserGuid { get; set; } = string.Empty; // 입찰 최고가 유저 식별키
|
||||
|
||||
[JsonProperty("highest_user_nickname")]
|
||||
public string HighestBidUserNickname { get; set; } = string.Empty; // 입찰 최고가 유저 닉네임
|
||||
|
||||
//=============================================================================================
|
||||
// 일반 입찰 최고 입찰자 정보
|
||||
//=============================================================================================
|
||||
[JsonProperty("normal_highest_bid_price")]
|
||||
public double NormalHighestBidPrice { get; set; } = 0; // 일반 입찰 최고가
|
||||
|
||||
[JsonProperty("normal_highest_user_guid")]
|
||||
public string NormalHighestBidUserGuid { get; set; } = string.Empty; // 일반 입찰 최고가 유저 식별키
|
||||
|
||||
[JsonProperty("normal_highest_user_nickname")]
|
||||
public string NormalHighestBidUserNickname { get; set; } = string.Empty; // 일반 입찰 최고가 유저 닉네임
|
||||
|
||||
|
||||
|
||||
[JsonProperty("highest_rank_version_time")]
|
||||
public DateTime HighestRankVersionTime { get; set; } = DateTimeHelper.MinTime; // 최고 입찰자 순위 버전 정보
|
||||
|
||||
public LandAuctionHighestBidUserAttrib()
|
||||
: base(nameof(LandAuctionHighestBidUserAttrib), false)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Desc : 랜드 경매별 입찰 최고가 유저
|
||||
// Primary Key
|
||||
// PK(Partition Key) : land_auction_highest_bid_user#global
|
||||
// SK(Sort Key) : {land_meta_id}#{auction_number}"
|
||||
// DocType : LandAuctionHighestBidUserDoc
|
||||
// Attrib : LandAuctionHighestBidUserAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class LandAuctionHighestBidUserDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() => "land_auction_highest_bid_user#";
|
||||
|
||||
public LandAuctionHighestBidUserDoc()
|
||||
: base(nameof(LandAuctionHighestBidUserDoc))
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public LandAuctionHighestBidUserDoc(META_ID landMetaId, LAND_AUCTION_NUMBER landAuctionNumber)
|
||||
: base(nameof(LandAuctionHighestBidUserDoc))
|
||||
{
|
||||
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
|
||||
setCombinationKeyForSK(makeCombinationKeyForSK(landMetaId, landAuctionNumber));
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
var land_auction_highest_bid_user_attrib = getAttrib<LandAuctionHighestBidUserAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(land_auction_highest_bid_user_attrib, () => $"land_auction_highest_bid_user_attrib is null !!!");
|
||||
|
||||
land_auction_highest_bid_user_attrib.LandMetaId = landMetaId;
|
||||
land_auction_highest_bid_user_attrib.AuctionNumber = landAuctionNumber;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<LandAuctionHighestBidUserAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK() => getPrefixOfPK();
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
public static string makeCombinationKeyForSK(META_ID landMetaId, LAND_AUCTION_NUMBER landAuctionNumber)
|
||||
{
|
||||
return $"{landMetaId}#{landAuctionNumber}";
|
||||
}
|
||||
}
|
||||
85
ServerCommon/Doc/Global/LandAuctionRecordDoc.cs
Normal file
85
ServerCommon/Doc/Global/LandAuctionRecordDoc.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
using LAND_AUCTION_NUMBER = System.Int32;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public class LandAuctionRecordAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("land_meta_id")]
|
||||
public META_ID LandMetaId { get; set; } = 0; // 경매 대상 LandData Meta Id
|
||||
|
||||
[JsonProperty("auction_number")]
|
||||
public LAND_AUCTION_NUMBER AuctionNumber { get; set; } = 0; // 경매 번호
|
||||
|
||||
public LandAuctionRecordAttrib()
|
||||
: base(nameof(LandAuctionRecordAttrib), false)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Desc : 랜드별 LandAuctionResult.Successed (낙찰)된 경매 정보
|
||||
// Primary Key
|
||||
// PK(Partition Key) : land_auction_record#global
|
||||
// SK(Sort Key) : "{land_meta_id}"
|
||||
// DocType : LandAuctionRecordDoc
|
||||
// Attrib : LandAuctionRecordAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class LandAuctionRecordDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() => "land_auction_record#";
|
||||
|
||||
public LandAuctionRecordDoc()
|
||||
: base(nameof(LandAuctionRecordDoc))
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public LandAuctionRecordDoc(META_ID landMetaId, LAND_AUCTION_NUMBER auctionNumber)
|
||||
: base(nameof(LandAuctionRecordDoc))
|
||||
{
|
||||
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
|
||||
setCombinationKeyForSK(landMetaId.ToString());
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
var land_auction_record_attrib = getAttrib<LandAuctionRecordAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(land_auction_record_attrib, () => $"land_auction_record_attrib is null !!!");
|
||||
|
||||
land_auction_record_attrib.LandMetaId = landMetaId;
|
||||
land_auction_record_attrib.AuctionNumber = auctionNumber;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<LandAuctionRecordAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK() => getPrefixOfPK();
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
133
ServerCommon/Doc/Global/LandAuctionRegistryDoc.cs
Normal file
133
ServerCommon/Doc/Global/LandAuctionRegistryDoc.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
using System;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
using LAND_AUCTION_NUMBER = System.Int32;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public class LandAuctionRegistryAttrib : AttribBase
|
||||
{
|
||||
//=============================================================================================
|
||||
// 랜드 경매 식별 정보
|
||||
//=============================================================================================
|
||||
[JsonProperty("land_meta_id")]
|
||||
public META_ID LandMetaId { get; set; } = 0; // 경매 대상 LandData Meta Id
|
||||
|
||||
[JsonProperty("auction_number")]
|
||||
public LAND_AUCTION_NUMBER AuctionNumber { get; set; } = 0; // 경매 번호
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// 랜드 경매 등록 정보
|
||||
//=============================================================================================
|
||||
[JsonProperty("auction_reservation_notice_start_time")]
|
||||
public DateTime AuctionReservationNoticeStartTime { get; set; } = DateTimeHelper.MinTime; // 경매 예약 공지 시작 시간
|
||||
|
||||
[JsonProperty("bid_currency_type")]
|
||||
public CurrencyType BidCurrencyType { get; set; } = 0; // 입찰 재화의 종류
|
||||
|
||||
[JsonProperty("auction_start_time")]
|
||||
public DateTime AuctionStartTime { get; set; } = DateTimeHelper.MinTime; // 경매 시작 시간
|
||||
|
||||
[JsonProperty("auction_end_time")]
|
||||
public DateTime AuctionEndTime { get; set; } = DateTimeHelper.MinTime; // 경매 종료 시간
|
||||
|
||||
[JsonProperty("bid_start_price")]
|
||||
public double BidStartPrice { get; set; } = 0; // 입찰 시작가
|
||||
|
||||
[JsonProperty("is_cancel_auction")]
|
||||
public bool IsCancelAuction { get; set; } = false; // 경매 취소 여부 (취소:true, 미취소:false)
|
||||
|
||||
[JsonProperty("registered_version_time")]
|
||||
public DateTime RegisteredVersionTime { get; set; } = DateTimeHelper.MinTime; // 경매 등록 버전 정보 (시간), 랜드 경매 등록 정보가 변경되면 등록 버전 정보도 갱신 되어야 한다. !!!
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// 랜드 경매 진행 정보
|
||||
//=============================================================================================
|
||||
[JsonProperty("auction_state")]
|
||||
public LandAuctionState LandAuctionState { get; set; } = LandAuctionState.None; // 경매 상태
|
||||
|
||||
[JsonProperty("auction_result")]
|
||||
public LandAuctionResult LandAuctionResult { get; set; } = LandAuctionResult.None; // 경매 결과
|
||||
|
||||
[JsonProperty("process_version_time")]
|
||||
public DateTime ProcessVersionTime { get; set; } = DateTimeHelper.MinTime; // 경매 진행 버전 정보 (시간), 랜드 경매 진행 정보가 변경되면 진행 버전 정보도 갱신되어야 한다. !!!
|
||||
|
||||
public LandAuctionRegistryAttrib()
|
||||
: base(nameof(LandAuctionRegistryAttrib), false)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Desc : 등록된 랜드 경매별 등록 정보
|
||||
// Primary Key
|
||||
// PK(Partition Key) : land_auction_registry#global
|
||||
// SK(Sort Key) : "{land_meta_id}#{auction_number}"
|
||||
// DocType : LandAuctionRegistryDoc
|
||||
// Attrib : LandAuctionRegistryAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class LandAuctionRegistryDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() => "land_auction_registry#";
|
||||
|
||||
public LandAuctionRegistryDoc()
|
||||
: base(nameof(LandAuctionRegistryDoc))
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public LandAuctionRegistryDoc(META_ID landMetaId, LAND_AUCTION_NUMBER landAuctionNumber, DateTime registeredVersionTime)
|
||||
: base(nameof(LandAuctionRegistryDoc))
|
||||
{
|
||||
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
|
||||
setCombinationKeyForSK(makeCombinationKeyForSK(landMetaId, landAuctionNumber));
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
var land_auction_registry_attrib = getAttrib<LandAuctionRegistryAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(land_auction_registry_attrib, () => $"land_auction_registry_attrib is null !!!");
|
||||
|
||||
land_auction_registry_attrib.LandMetaId = landMetaId;
|
||||
land_auction_registry_attrib.AuctionNumber = landAuctionNumber;
|
||||
|
||||
land_auction_registry_attrib.RegisteredVersionTime = registeredVersionTime;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<LandAuctionRegistryAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK() => getPrefixOfPK();
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
public static string makeCombinationKeyForSK(META_ID landMetaId, LAND_AUCTION_NUMBER landAuctionNumber)
|
||||
{
|
||||
return $"{landMetaId}#{landAuctionNumber}";
|
||||
}
|
||||
}
|
||||
110
ServerCommon/Doc/Global/NoticeChatDoc.cs
Normal file
110
ServerCommon/Doc/Global/NoticeChatDoc.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using MAIL_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class NoticeChatDetail
|
||||
{
|
||||
[JsonProperty]
|
||||
public LanguageType Languagetype { get; set; } = LanguageType.None;
|
||||
|
||||
[JsonProperty]
|
||||
public string ChatMessage { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class NoticeChatAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("chat_id")]
|
||||
public Int32 ChatId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("next_notice_time")]
|
||||
public DateTime NextNoticeTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("repeat_minute_time")]
|
||||
public Int32 RepeatMinuteTime { get; set; } = 0;
|
||||
|
||||
[JsonProperty("repeat_count")]
|
||||
public Int32 RepeatCount { get; set; } = 0;
|
||||
|
||||
[JsonProperty("sender")]
|
||||
public string Sender { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("message_type")]
|
||||
public Int32 MessageType { get; set; } = 0;
|
||||
|
||||
[JsonProperty("detail_list")]
|
||||
public List<NoticeChatDetail> DetailList { get; set; } = new();
|
||||
|
||||
public NoticeChatAttrib()
|
||||
: base(typeof(NoticeChatAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "management_notice_chat#"
|
||||
// SK(Sort Key) : "notice_chat_id"
|
||||
// DocType : NoticeChatDoc
|
||||
// NoticeChatAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class NoticeChatDoc : DynamoDbDocBase
|
||||
{
|
||||
public NoticeChatDoc()
|
||||
: base(typeof(NoticeChatDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
|
||||
appendAttribWrapperAll();
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
public NoticeChatDoc(string chat_id)
|
||||
: base(typeof(NoticeChatDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(DynamoDbClient.PK_GLOBAL, chat_id);
|
||||
appendAttribWrapperAll();
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<NoticeChatAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "management_notice_chat#";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
107
ServerCommon/Doc/Global/SystemMetaMailDoc.cs
Normal file
107
ServerCommon/Doc/Global/SystemMetaMailDoc.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using MAIL_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
// public class SystemMetaMailText
|
||||
// {
|
||||
// public LanguageType languageType { get; set; } = LanguageType.None;
|
||||
// public string text { get; set; } = string.Empty;
|
||||
// }
|
||||
|
||||
public class SystemMetaMailAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("mail_id")]
|
||||
public Int32 MailId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("sender_nickname")]
|
||||
public List<OperationSystemMessage> SenderNickName { get; set; } = new();
|
||||
|
||||
[JsonProperty("title")]
|
||||
public List<OperationSystemMessage> Title { get; set; } = new();
|
||||
|
||||
[JsonProperty("text")]
|
||||
public List<OperationSystemMessage> Text { get; set; } = new();
|
||||
|
||||
[JsonProperty("start_time")]
|
||||
public DateTime StartTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("end_time")]
|
||||
public DateTime EndTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("item_list")]
|
||||
public List<MailItem> ItemList { get; set; } = new();
|
||||
|
||||
public SystemMetaMailAttrib()
|
||||
: base(typeof(SystemMetaMailAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "management_system_meta_mail#"
|
||||
// SK(Sort Key) : "sequence_id"
|
||||
// DocType : SystemMailDoc
|
||||
// SystemMailAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class SystemMetaMailDoc : DynamoDbDocBase
|
||||
{
|
||||
public SystemMetaMailDoc()
|
||||
: base(typeof(SystemMetaMailDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
|
||||
appendAttribWrapperAll();
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
public SystemMetaMailDoc(string mail_id)
|
||||
: base(typeof(SystemMetaMailDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(DynamoDbClient.PK_GLOBAL, mail_id);
|
||||
appendAttribWrapperAll();
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<SystemMetaMailAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "management_system_meta_mail#";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
81
ServerCommon/Doc/Global/UgcNpcRankDoc.cs
Normal file
81
ServerCommon/Doc/Global/UgcNpcRankDoc.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class UgcNpcRankAttrib : AttribBase
|
||||
{
|
||||
/// <summary>
|
||||
/// rank 정보
|
||||
/// key: {ownerGuid}_{ugcnpcMetaGuid}
|
||||
/// value: score
|
||||
/// </summary>
|
||||
/// <remarks> UgcNpcRankHelper.makeRankKey() </remarks>
|
||||
[JsonProperty("data")] public Dictionary<string, long> ranks { get; set; } = new();
|
||||
|
||||
public UgcNpcRankAttrib() : base(nameof(UgcNpcRankAttrib), false)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : ugcnpcrank#{state}
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : UgcNpcRankDoc
|
||||
// Attrib : UgcNpcRankAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class UgcNpcRankDoc : DynamoDbDocBase
|
||||
{
|
||||
public static string getPrefixOfPK() => "ugcnpcrank#";
|
||||
|
||||
public UgcNpcRankDoc() : base(nameof(UgcNpcRankDoc))
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public UgcNpcRankDoc(UgcNpcRankState state, UgcNpcRankType type, string? rankDate) : base(nameof(UgcNpcRankDoc))
|
||||
{
|
||||
setCombinationKeyForPK(state.ToString());
|
||||
|
||||
var sk = null == rankDate ? type.ToString() : $"{type}#{rankDate}";
|
||||
setCombinationKeyForSK(sk);
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public UgcNpcRankDoc(UgcNpcRankState state, UgcNpcRankType type, string? rankDate, Int64 ttlSeconds) : base(nameof(UgcNpcRankDoc), ttlSeconds)
|
||||
{
|
||||
setCombinationKeyForPK(state.ToString());
|
||||
|
||||
var sk = null == rankDate ? type.ToString() : $"{type}#{rankDate}";
|
||||
setCombinationKeyForSK(sk);
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<UgcNpcRankAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK() => getPrefixOfPK();
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
54
ServerCommon/Doc/Global/UgcNpcRankManageDoc.cs
Normal file
54
ServerCommon/Doc/Global/UgcNpcRankManageDoc.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class UgcNpcRankManageAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("last_running_date")] public List<string> LastRunningDates { get; set; } = new();
|
||||
|
||||
public UgcNpcRankManageAttrib() : base(nameof(UgcNpcRankManageAttrib), false)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key : Deprecated -> Migration 에서 쓰고 있음 ( 추후 삭제 필요 )
|
||||
// PK(Partition Key) : ugcnpcrank#manage
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : UgcNpcRankManageDoc
|
||||
// Attrib : UgcNpcRankManageAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class UgcNpcRankManageDoc : DynamoDbDocBase
|
||||
{
|
||||
public static string pk = "ugcnpcrank#manage";
|
||||
public UgcNpcRankManageDoc() : base(nameof(UgcNpcRankManageDoc))
|
||||
{
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<UgcNpcRankManageAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK() => string.Empty;
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return pk;
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
}
|
||||
97
ServerCommon/Doc/Global/UserNicknameRegistryDoc.cs
Normal file
97
ServerCommon/Doc/Global/UserNicknameRegistryDoc.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
using ServerControlCenter;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class UserNicknameRegistryAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("nickname")]
|
||||
public string Nickname { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("user_guid")]
|
||||
public USER_GUID UserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("account_id")]
|
||||
public ACCOUNT_ID AccountId { get; set; } = string.Empty;
|
||||
|
||||
public UserNicknameRegistryAttrib()
|
||||
: base(typeof(UserNicknameRegistryAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "user_nickname_registry#"
|
||||
// SK(Sort Key) : "user_nickname"
|
||||
// DocType : UserNicknameRegistryDoc
|
||||
// UserNicknameRegistryAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class UserNicknameRegistryDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "user_nickname_registry#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public UserNicknameRegistryDoc()
|
||||
: base(typeof(UserNicknameRegistryDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public UserNicknameRegistryDoc(string userNickname)
|
||||
: base(typeof(UserNicknameRegistryDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(DynamoDbClient.PK_GLOBAL, userNickname.ToLower());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var user_nickname_registry_attrib = getAttrib<UserNicknameRegistryAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(user_nickname_registry_attrib, () => $"user_nickname_registry_attrib is null !!!");
|
||||
user_nickname_registry_attrib.Nickname = userNickname;
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.UserNicknameDuplicated));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<UserNicknameRegistryAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
196
ServerCommon/Doc/Info/FarmingEffectDoc.cs
Normal file
196
ServerCommon/Doc/Info/FarmingEffectDoc.cs
Normal file
@@ -0,0 +1,196 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using WORLD_ID = System.UInt32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using ENTITY_UNIQUE_ID = System.String;
|
||||
using ANCHOR_META_GUID = System.String;
|
||||
using NPC_UNIQUE_ID = System.String;
|
||||
using FARMING_ENTITY_GUID = System.String;
|
||||
using LOCATION_UNIQUE_ID = System.String;
|
||||
using FARMING_EFFECT_DOC_LINK_PKSK = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class FarmingEffectAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("anchor_meta_guid")] //[PK 참조]
|
||||
public ANCHOR_META_GUID AnchorMetaGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("location_unique_id")] //[SK 참조]
|
||||
public LOCATION_UNIQUE_ID LocationUniqueId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("farming_prop_meta_id")]
|
||||
public META_ID FarmingPropMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("farming_summoned_enity_type")]
|
||||
public FarmingSummonedEntityType FarmingSummonedEntityType { get; set; } = FarmingSummonedEntityType.None;
|
||||
|
||||
[JsonProperty("farming_entity_guid")] // FarmingSummonedEntityType.User: UserGuid, FarmingSummonedEntityType.Beacon: UgcNpcMetaGuid:
|
||||
public FARMING_ENTITY_GUID FarmingEntityGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("farming_state")]
|
||||
public FarmingStateType FarmingState { get; set; } = FarmingStateType.None;
|
||||
|
||||
[JsonProperty("farming_action_req_try_count")]
|
||||
public Int16 FarmingActionReqTryCount { get; set; } = 0;
|
||||
|
||||
[JsonProperty("completed_reward_count")]
|
||||
public Int16 CompletedRewardCount { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public DateTime FarmingLastUpdateTime { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
[JsonProperty("farming_start_time")]
|
||||
public DateTime FarmingStartTime { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
[JsonProperty("farming_end_time")]
|
||||
public DateTime FarmingEndTime { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
[JsonProperty("farming_respawn_time")]
|
||||
public DateTime FarmingRespawnTime { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
public FarmingEffectAttrib()
|
||||
: base(typeof(FarmingEffectAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "farming_effect#anchor_meta_guid"
|
||||
// SK(Sort Key) : "{LOCATION_UNIQUE_ID}"
|
||||
// DocType : "FarmingEffectDoc"
|
||||
// FarmingEffectAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class FarmingEffectDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getDocTypeName() { return typeof(FarmingEffectDoc).Name; }
|
||||
private string getPrefixOfPK() { return $"farming_effect#"; }
|
||||
private string getPrefixOfSK() { return $""; }
|
||||
|
||||
public static FARMING_EFFECT_DOC_LINK_PKSK makeLINK_PKSK(ANCHOR_META_GUID anchorMetaGuid, LOCATION_UNIQUE_ID locationUniqueId)
|
||||
{
|
||||
return $"farming_effect#{anchorMetaGuid}-{locationUniqueId}";
|
||||
}
|
||||
|
||||
public FarmingEffectDoc()
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public FarmingEffectDoc(ANCHOR_META_GUID anchorMetaGuid, LOCATION_UNIQUE_ID locationUniqueId)
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(anchorMetaGuid);
|
||||
setCombinationKeyForSK(locationUniqueId);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var to_set_farming_effect_attrib = getAttrib<FarmingEffectAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(to_set_farming_effect_attrib, () => $"to_set_farming_effect_attrib is null !!!");
|
||||
|
||||
to_set_farming_effect_attrib.AnchorMetaGuid = anchorMetaGuid;
|
||||
to_set_farming_effect_attrib.LocationUniqueId = locationUniqueId;
|
||||
}
|
||||
|
||||
public FarmingEffectDoc( ANCHOR_META_GUID anchorMetaGuid, LOCATION_UNIQUE_ID locationUniqueId
|
||||
, META_ID farmingPropMetaId
|
||||
, FarmingSummonedEntityType farmingSummonedEntityType, FARMING_ENTITY_GUID farmingEntityGuid
|
||||
, FarmingStateType farmingState
|
||||
, Int16 farmingActionReqTryCount
|
||||
, DateTime farmingStartTime, DateTime farmingEndTime )
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(anchorMetaGuid);
|
||||
setCombinationKeyForSK(locationUniqueId);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var to_set_farming_effect_attrib = getAttrib<FarmingEffectAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(to_set_farming_effect_attrib, () => $"to_set_farming_effect_attrib is null !!!");
|
||||
|
||||
to_set_farming_effect_attrib.AnchorMetaGuid = anchorMetaGuid;
|
||||
to_set_farming_effect_attrib.LocationUniqueId = locationUniqueId;
|
||||
to_set_farming_effect_attrib.FarmingPropMetaId = farmingPropMetaId;
|
||||
to_set_farming_effect_attrib.FarmingSummonedEntityType = farmingSummonedEntityType;
|
||||
to_set_farming_effect_attrib.FarmingEntityGuid = farmingEntityGuid;
|
||||
to_set_farming_effect_attrib.FarmingState = farmingState;
|
||||
|
||||
to_set_farming_effect_attrib.FarmingActionReqTryCount = farmingActionReqTryCount;
|
||||
|
||||
to_set_farming_effect_attrib.FarmingStartTime = farmingStartTime;
|
||||
to_set_farming_effect_attrib.FarmingEndTime = farmingEndTime;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<FarmingEffectAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
var error_code = onFillupCombinationKeyForSK(sortKey, out var fillup_key);
|
||||
if (error_code.isFail())
|
||||
{
|
||||
return error_code;
|
||||
}
|
||||
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(fillup_key);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
public FarmingSummary toFarmingSummary(USER_GUID userGuid)
|
||||
{
|
||||
var farming_effect_attrib = getAttrib<FarmingEffectAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(farming_effect_attrib, () => $"farming_effect_attrib is null !!!");
|
||||
|
||||
var farming_summary = new FarmingSummary();
|
||||
farming_summary.FarmingAnchorMetaId = farming_effect_attrib.AnchorMetaGuid;
|
||||
farming_summary.FarmingPropMetaId = (Int32)farming_effect_attrib.FarmingPropMetaId;
|
||||
farming_summary.FarmingUserGuid = userGuid;
|
||||
|
||||
farming_summary.FarmingSummonType = farming_effect_attrib.FarmingSummonedEntityType;
|
||||
farming_summary.FarmingEntityGuid = farming_effect_attrib.FarmingEntityGuid;
|
||||
|
||||
farming_summary.FarmingState = farming_effect_attrib.FarmingState;
|
||||
farming_summary.StartTime = farming_effect_attrib.FarmingStartTime.toSpecifyKindOnly(DateTimeKind.Utc).ToTimestamp();
|
||||
farming_summary.EndTime = farming_effect_attrib.FarmingEndTime.toSpecifyKindOnly(DateTimeKind.Utc).ToTimestamp();
|
||||
|
||||
return farming_summary;
|
||||
}
|
||||
}
|
||||
70
ServerCommon/Doc/LandBase/LandDoc.cs
Normal file
70
ServerCommon/Doc/LandBase/LandDoc.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
using OWNER_GUID = System.String;
|
||||
|
||||
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class LandAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("land_meta_id")]
|
||||
public META_ID LandMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("land_name")]
|
||||
public string LandName { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_user_guid")]
|
||||
public string OwnerUserGuid { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public LandAttrib()
|
||||
: base(typeof(LandAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "land#land_meta_id"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : LandDoc
|
||||
// LandAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class LandDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "land#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public LandDoc()
|
||||
: base(typeof(LandDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public LandDoc(META_ID landMetaId)
|
||||
: base(typeof(LandDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(landMetaId.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<LandAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
61
ServerCommon/Doc/OwnerContents/AiChatDoc.cs
Normal file
61
ServerCommon/Doc/OwnerContents/AiChatDoc.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class AiChatAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public DateTime LastIncentiveProvideTime { get; set; } = new();
|
||||
|
||||
public AiChatAttrib()
|
||||
: base(typeof(AiChatAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "aichat#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : AiChatDoc
|
||||
// Attrib : AiChatAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class AiChatDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "aichat#"; }
|
||||
|
||||
public AiChatDoc()
|
||||
: base(typeof(AiChatDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public AiChatDoc(string ownerGuid)
|
||||
: base(typeof(AiChatDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.AiChatDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<AiChatAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
134
ServerCommon/Doc/OwnerContents/AppearanceCustomizeDoc.cs
Normal file
134
ServerCommon/Doc/OwnerContents/AppearanceCustomizeDoc.cs
Normal file
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Microsoft.AspNetCore.DataProtection.KeyManagement;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class AppearanceCustomizeAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("basic_style")]
|
||||
public Int32 BasicStyle { get; set; } = 0;
|
||||
|
||||
[JsonProperty("body_style")]
|
||||
public Int32 BodyShape { get; set; } = 0;
|
||||
|
||||
[JsonProperty("hair_style")]
|
||||
public Int32 HairStyle { get; set; } = 0;
|
||||
|
||||
[JsonProperty("custom_values")]
|
||||
public List<Int32> CustomValues { get; set; } = new();
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
public AppearanceCustomizeAttrib()
|
||||
: base(typeof(AppearanceCustomizeAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "appearance_customize#owner_guid" [owner_guid : user_guid, ugc_npc_meta_guid]
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : ItemDoc
|
||||
// ItemAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class AppearanceCustomizeDoc : DynamoDbDocBase, ICopyDocFromEntityAttribute
|
||||
{
|
||||
private static string getPrefixOfPK() { return "appearance_customize#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public AppearanceCustomizeDoc()
|
||||
: base(typeof(AppearanceCustomizeDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public AppearanceCustomizeDoc(OwnerEntityType ownerEntityType, string ownerGuid)
|
||||
: base(typeof(AppearanceCustomizeDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var doc_appearance_customize_attrib = getAttrib<AppearanceCustomizeAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_appearance_customize_attrib, () => $"doc_appearance_customize_attrib is null !!! - ownerGuid:{ownerGuid}, ownerEntityType:{ownerEntityType}");
|
||||
|
||||
doc_appearance_customize_attrib.OwnerEntityType = ownerEntityType;
|
||||
doc_appearance_customize_attrib.OwnerGuid = ownerGuid;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<AppearanceCustomizeAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
// override ICopyDocFromEntityAttribute
|
||||
public bool copyDocFromEntityAttribute(EntityAttributeBase entityAttributeBase)
|
||||
{
|
||||
NullReferenceCheckHelper.throwIfNull(entityAttributeBase, () => $"entityAttributeBase is null !!! - {toBasicString()}");
|
||||
|
||||
var appearance_customize_attribute = entityAttributeBase as AppearanceCustomizeAttribute;
|
||||
if (null == appearance_customize_attribute)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var to_copy_doc_appearance_customize_attrib = getAttrib<AppearanceCustomizeAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(to_copy_doc_appearance_customize_attrib, () => $"to_copy_doc_appearance_customize_attrib is null !!! - {toBasicString()}");
|
||||
|
||||
to_copy_doc_appearance_customize_attrib.BasicStyle = appearance_customize_attribute.BasicStyle;
|
||||
to_copy_doc_appearance_customize_attrib.BodyShape = appearance_customize_attribute.BodyShape;
|
||||
to_copy_doc_appearance_customize_attrib.HairStyle = appearance_customize_attribute.HairStyle;
|
||||
to_copy_doc_appearance_customize_attrib.CustomValues = appearance_customize_attribute.CustomValues.ToList();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
92
ServerCommon/Doc/OwnerContents/BeaconShopItemDoc.cs
Normal file
92
ServerCommon/Doc/OwnerContents/BeaconShopItemDoc.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using BEACON_GUID = System.String;
|
||||
using META_ID = System.UInt32;
|
||||
using USER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using ServerCore; using ServerBase;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class BeaconShopItemAttrib : ItemAttrib
|
||||
{
|
||||
[JsonProperty("user_guid")]
|
||||
public USER_GUID UserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("beacon_guid")]
|
||||
public BEACON_GUID BeaconGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("selling_finish_time")]
|
||||
public DateTime SellingFinishTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("price_for_unit")]
|
||||
public double PriceForUnit { get; set; } = 0;
|
||||
|
||||
public BeaconShopItemAttrib()
|
||||
: base(typeof(BeaconShopItemAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "beacon_shop_item#beacon_guid"
|
||||
// SK(Sort Key) : "item_guid"
|
||||
// DocType : BeaconShopItemDoc
|
||||
// Attrib : BeaconShopItemAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class BeaconShopItemDoc : ItemDoc
|
||||
{
|
||||
private static string getPrefixOfPK() { return "beacon_shop_item#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public BeaconShopItemDoc()
|
||||
: base(typeof(BeaconShopItemDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public BeaconShopItemDoc(OwnerEntityType ownerEntityType, string beaconGuid, string userGuid, ITEM_GUID itemGuid)
|
||||
: base(typeof(BeaconShopItemDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(beaconGuid, itemGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.BeaconShopException));
|
||||
|
||||
var doc_beacon_shop_item_attrib = getAttrib<BeaconShopItemAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_beacon_shop_item_attrib, () => $"doc_beacon_shop_item_attrib is null !!! - beaconGuid:{beaconGuid}, itemGuid:{itemGuid}, userGuid:{userGuid}, ownerEntityType:{ownerEntityType}");
|
||||
|
||||
doc_beacon_shop_item_attrib.BeaconGuid = beaconGuid;
|
||||
doc_beacon_shop_item_attrib.UserGuid = userGuid;
|
||||
doc_beacon_shop_item_attrib.OwnerGuid = beaconGuid;
|
||||
doc_beacon_shop_item_attrib.OwnerEntityType = ownerEntityType;
|
||||
doc_beacon_shop_item_attrib.ItemGuid = itemGuid;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<BeaconShopItemAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
76
ServerCommon/Doc/OwnerContents/BeaconShopProfileDoc.cs
Normal file
76
ServerCommon/Doc/OwnerContents/BeaconShopProfileDoc.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using BEACON_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public class BeaconShopProfileAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("beacon_guid")]
|
||||
public BEACON_GUID BeaconGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("daily_register_count")]
|
||||
public Int32 DailyRegisterCount { get; set; } = 0;
|
||||
|
||||
[JsonProperty("register_update_day")]
|
||||
public DateTime RegisterUpdateDay { get; set; } = new();
|
||||
|
||||
public BeaconShopProfileAttrib()
|
||||
: base(typeof(BeaconShopProfileAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "beacon_shop_profile#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : BeaconShopProfileDoc
|
||||
// Attrib : BeaconShopProfileAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class BeaconShopProfileDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "beacon_shop_profile#"; }
|
||||
|
||||
public BeaconShopProfileDoc()
|
||||
: base(typeof(BeaconShopProfileDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public BeaconShopProfileDoc(string ownerGuid)
|
||||
: base(typeof(BeaconShopProfileDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.BeaconShopProfileException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<BeaconShopProfileAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
101
ServerCommon/Doc/OwnerContents/BeaconShopSoldPriceDoc.cs
Normal file
101
ServerCommon/Doc/OwnerContents/BeaconShopSoldPriceDoc.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using BEACON_GUID = System.String;
|
||||
using META_ID = System.UInt32;
|
||||
using USER_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class BeaconShopSoldPriceAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("user_guid")]
|
||||
public USER_GUID UserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("beacon_guid")]
|
||||
public BEACON_GUID BeaconGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("given_price")]
|
||||
public double GivenPrice { get; set; } = 0;
|
||||
|
||||
[JsonProperty("tax_price")]
|
||||
public double TaxPrice { get; set; } = 0;
|
||||
|
||||
[JsonProperty("num_of_receipt_not_received")]
|
||||
public int NumOfReceiptNotReceived { get; set; } = 0;
|
||||
|
||||
public BeaconShopSoldPriceAttrib()
|
||||
: base(typeof(BeaconShopSoldPriceAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
// 해당 doc은 타유저가 insert 해당 유저가 조회 및 삭제
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "beacon_shop_sold_price#user_guid"
|
||||
// SK(Sort Key) : "beacon_guid"
|
||||
// DocType : BeaconShopSoldPriceDoc
|
||||
// Attrib : BeaconShopSoldPriceAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class BeaconShopSoldPriceDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "beacon_shop_sold_price#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public BeaconShopSoldPriceDoc()
|
||||
: base(typeof(BeaconShopSoldPriceDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public BeaconShopSoldPriceDoc(string userGuid)
|
||||
: base(typeof(BeaconShopSoldPriceDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.BeaconShopSoldPriceException));
|
||||
}
|
||||
|
||||
public BeaconShopSoldPriceDoc(string userGuid, string beaconGuid)
|
||||
: base(typeof(BeaconShopSoldPriceDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(userGuid, beaconGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.BeaconShopSoldPriceException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<BeaconShopSoldPriceAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
132
ServerCommon/Doc/OwnerContents/BeaconShopSoldRecordDoc.cs
Normal file
132
ServerCommon/Doc/OwnerContents/BeaconShopSoldRecordDoc.cs
Normal file
@@ -0,0 +1,132 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using BEACON_GUID = System.String;
|
||||
using META_ID = System.UInt32;
|
||||
using USER_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class BeaconShopSoldRecordAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("user_guid")]
|
||||
public USER_GUID UserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("beacon_guid")]
|
||||
public BEACON_GUID BeaconGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("item_meta_id")]
|
||||
public META_ID ItemMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("buyer_nickname")]
|
||||
public string BuyerNickName { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("price_for_unit")]
|
||||
public double PriceForUnit { get; set; } = 0;
|
||||
|
||||
[JsonProperty("amount")]
|
||||
public int Amount { get; set; } = 0;
|
||||
|
||||
[JsonProperty("sales_time")]
|
||||
public DateTime SalesTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("sold_price")]
|
||||
public double SoldPrice { get; set; } = 0;
|
||||
|
||||
[JsonProperty("tax_price")]
|
||||
public double TaxPrice { get; set; } = 0;
|
||||
|
||||
[JsonProperty("given_price")]
|
||||
public double GivenPrice { get; set; } = 0;
|
||||
|
||||
public BeaconShopSoldRecordAttrib()
|
||||
: base(typeof(BeaconShopSoldRecordAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
// 해당 doc은 타유저가 insert 해당 유저가 조회 및 삭제
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "beacon_shop_sold_record#user_guid"
|
||||
// SK(Sort Key) : "sales_history#timestamp"
|
||||
// DocType : BeaconShopSoldRecordDoc
|
||||
// Attrib : BeaconShopSoldRecordAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class BeaconShopSoldRecordDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "beacon_shop_sold_record#"; }
|
||||
private static string getPrefixOfSK() { return "sales_history#"; }
|
||||
public BeaconShopSoldRecordDoc()
|
||||
: base(typeof(BeaconShopSoldRecordDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public BeaconShopSoldRecordDoc(string userGuid)
|
||||
: base(typeof(BeaconShopSoldRecordDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.BeaconShopSoldRecordException));
|
||||
}
|
||||
|
||||
public BeaconShopSoldRecordDoc(string userGuid, DateTime soldTime)
|
||||
: base(typeof(BeaconShopSoldRecordDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(userGuid, soldTime.toStringWithUtcIso8601());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.BeaconShopSoldRecordException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<BeaconShopSoldRecordAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
//public BeaconShopInfo toBeaconShopInfo4Client()
|
||||
//{
|
||||
// var beacon_shop_4_client = new BeaconShopInfo();
|
||||
|
||||
// var beacon_shop_item_attrib = getAttrib<BeaconShopSoldRecordAttrib>();
|
||||
// NullReferenceCheckHelper.throwIfNull(beacon_shop_item_attrib, () => $"beacon_shop_item_attrib is null !!!");
|
||||
|
||||
// beacon_shop_4_client.BeaconGuid = beacon_shop_item_attrib.BeaconGuid;
|
||||
// beacon_shop_4_client.ItemGuid = beacon_shop_item_attrib.ItemGuid;
|
||||
// beacon_shop_4_client.ItemMetaid = (int)beacon_shop_item_attrib.ItemMetaId;
|
||||
// beacon_shop_4_client.SellingFinishTime = Timestamp.FromDateTime(beacon_shop_item_attrib.SellingFinishTime);
|
||||
// beacon_shop_4_client.PriceForUnit = beacon_shop_item_attrib.PriceForUnit;
|
||||
// beacon_shop_4_client.ItemStackCount = beacon_shop_item_attrib.ItemStackCount;
|
||||
|
||||
// return beacon_shop_4_client;
|
||||
//}
|
||||
}
|
||||
115
ServerCommon/Doc/OwnerContents/BlockUserDoc.cs
Normal file
115
ServerCommon/Doc/OwnerContents/BlockUserDoc.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class BlockUserAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("guid")]
|
||||
public string BlockGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("is_new")]
|
||||
public Int32 IsNew { get; set; } = 0;
|
||||
|
||||
public void cloneAttrib(ref BlockUserAttrib attrib)
|
||||
{
|
||||
attrib.BlockGuid = BlockGuid;
|
||||
attrib.IsNew = IsNew;
|
||||
}
|
||||
|
||||
public BlockUserAttrib()
|
||||
: base(typeof(BlockUserAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "block#owner_guid"
|
||||
// SK(Sort Key) : "block_user_guid"
|
||||
// DocType : BlockUserDoc
|
||||
// BlockUserAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class BlockUserDoc : DynamoDbDocBase
|
||||
{
|
||||
public BlockUserDoc()
|
||||
: base(typeof(BlockUserDoc).Name)
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<BlockUserAttrib>());
|
||||
}
|
||||
|
||||
public BlockUserDoc(string userGuid, string blockGuid)
|
||||
: base(typeof(BlockUserDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(blockGuid);
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
appendAttribWrapper(new AttribWrapper<BlockUserAttrib>());
|
||||
}
|
||||
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "block#";
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
|
||||
public static async Task<(Result, List<BlockUserDoc>)> findBlockUserFromGuid(string ownerGuid, string otherGuid)
|
||||
{
|
||||
var result = new Result();
|
||||
var block_docs = new List<BlockUserDoc>();
|
||||
|
||||
var server_logic = ServerLogicApp.getServerLogicApp();
|
||||
var dynamo_db_client = server_logic.getDynamoDbClient();
|
||||
|
||||
(result, var make_primary_key) = await DynamoDBDocBaseHelper.makePrimaryKey<BlockUserDoc>(ownerGuid, otherGuid);
|
||||
NullReferenceCheckHelper.throwIfNull(make_primary_key, () => $"make_primary_key is null !!!");
|
||||
if (result.isFail())
|
||||
{
|
||||
return (result, block_docs);
|
||||
}
|
||||
|
||||
var query_config = dynamo_db_client.makeQueryConfigForReadByPKSK(make_primary_key.PK, make_primary_key.SK);
|
||||
|
||||
(result, block_docs) = await dynamo_db_client.simpleQueryDocTypesWithQueryOperationConfig<BlockUserDoc>(query_config);
|
||||
if (result.isFail())
|
||||
{
|
||||
return (result, block_docs);
|
||||
}
|
||||
|
||||
return (result, block_docs);
|
||||
}
|
||||
}
|
||||
61
ServerCommon/Doc/OwnerContents/CartDoc.cs
Normal file
61
ServerCommon/Doc/OwnerContents/CartDoc.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CartAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("cart_items")]
|
||||
public Dictionary<CurrencyType, Dictionary<META_ID/*ItemMetaID*/, Int32/*Count*/>> CartItems { get; set; } = new();
|
||||
|
||||
public CartAttrib()
|
||||
: base(typeof(CartAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "cart#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : CartDoc
|
||||
// CartAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CartDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "cart#"; }
|
||||
|
||||
public CartDoc()
|
||||
: base(typeof(CartDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CartDoc(string ownerGuid)
|
||||
: base(typeof(CartDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.CartDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CartAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
66
ServerCommon/Doc/OwnerContents/CharacterProfileDoc.cs
Normal file
66
ServerCommon/Doc/OwnerContents/CharacterProfileDoc.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CharacterProfileAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public string SNSLick { get; set; } = string.Empty;
|
||||
[JsonProperty]
|
||||
public string Message { get; set; } = string.Empty;
|
||||
|
||||
public CharacterProfileAttrib()
|
||||
: base(typeof(CharacterProfileAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "character_profile#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : CharacterProfileDoc
|
||||
// CharacterProfileAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CharacterProfileDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "character_profile#"; }
|
||||
|
||||
public CharacterProfileDoc()
|
||||
: base(typeof(CharacterProfileDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CharacterProfileDoc(string ownerGuid)
|
||||
: base(typeof(CharacterProfileDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CharacterProfileAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
111
ServerCommon/Doc/OwnerContents/ClaimDoc.cs
Normal file
111
ServerCommon/Doc/OwnerContents/ClaimDoc.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class ClaimAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("claim_type")]
|
||||
public MetaAssets.ClaimType ClaimType { get; set; } = MetaAssets.ClaimType.None;
|
||||
|
||||
[JsonProperty("claim_id")]
|
||||
public int ClaimId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("active_reward_idx")]
|
||||
public int ActiveRewardIdx { get; set; } = 0;
|
||||
|
||||
[JsonProperty("active_time")]
|
||||
public DateTime ActiveTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("create_time")]
|
||||
public DateTime CreateTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("complete_time")]
|
||||
public DateTime CompleteTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("is_complete")]
|
||||
public int IsComplete { get; set; } = 0;
|
||||
|
||||
public ClaimAttrib()
|
||||
: base(typeof(ClaimAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "claim#owner_guid"
|
||||
// SK(Sort Key) : "normal#claim_meta_id"
|
||||
// DocType : ClaimDoc
|
||||
// ClaimAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class ClaimDoc : DynamoDbDocBase
|
||||
{
|
||||
public ClaimDoc()
|
||||
: base(typeof(ClaimDoc).Name)
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<ClaimAttrib>());
|
||||
}
|
||||
|
||||
public ClaimDoc(string userGuid)
|
||||
: base(typeof(ClaimDoc).Name)
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<ClaimAttrib>());
|
||||
setCombinationKeyForPK(userGuid);
|
||||
}
|
||||
|
||||
public ClaimDoc(string userGuid, MetaAssets.ClaimType type, Int32 claimId)
|
||||
: base(typeof(ClaimDoc).Name)
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<ClaimAttrib>());
|
||||
var attrib = getAttrib<ClaimAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(attrib, () => $"attrib is null !!!");
|
||||
attrib.ClaimType = type;
|
||||
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(claimId.ToString());
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "claim#";
|
||||
}
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
var attrib = getAttrib<ClaimAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(attrib, () => $"attrib is null !!!");
|
||||
return $"{attrib.ClaimType.ToString().ToLower()}#";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
86
ServerCommon/Doc/OwnerContents/CraftDoc.cs
Normal file
86
ServerCommon/Doc/OwnerContents/CraftDoc.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
using ANCHOR_GUID = System.String;
|
||||
using BEACON_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CraftAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("anchor_guid")]
|
||||
public ANCHOR_GUID AnchorGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("craft_meta_id")]
|
||||
public META_ID CraftMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("craft_start_time")]
|
||||
public DateTime CraftStartTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("craft_finish_time")]
|
||||
public DateTime CraftFinishTime { get; set; } = new();
|
||||
|
||||
[JsonProperty("beacon_guid")]
|
||||
public BEACON_GUID BeaconGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("craft_count")]
|
||||
public int CraftCount { get; set; } = 1;
|
||||
|
||||
public CraftAttrib()
|
||||
: base(typeof(CraftAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "craft#user_guid"
|
||||
// SK(Sort Key) : "anchor_guid"
|
||||
// DocType : CraftDoc
|
||||
// Attrib : CraftAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CraftDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "craft#"; }
|
||||
|
||||
public CraftDoc()
|
||||
: base(typeof(CraftDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CraftDoc(string ownerGuid, ANCHOR_GUID anchorGuid)
|
||||
: base(typeof(CraftDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(ownerGuid, anchorGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.CraftDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CraftAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
67
ServerCommon/Doc/OwnerContents/CraftHelpDoc.cs
Normal file
67
ServerCommon/Doc/OwnerContents/CraftHelpDoc.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using USER_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CraftHelpAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("help_user_guids")]
|
||||
public List<USER_GUID> HelpUserGuids { get; set; } = new();
|
||||
|
||||
[JsonProperty("helped_user_guids")]
|
||||
public List<USER_GUID> HelpedUserGuids { get; set; } = new();
|
||||
|
||||
[JsonProperty("craft_help_updateday")]
|
||||
public DateTime CraftHelpUpdateDay { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public CraftHelpAttrib()
|
||||
: base(typeof(CraftHelpAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "crafthelp#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : CraftHelpDoc
|
||||
// Attrib : CraftHelpAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CraftHelpDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "crafthelp#"; }
|
||||
|
||||
public CraftHelpDoc()
|
||||
: base(typeof(CraftHelpDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CraftHelpDoc(string ownerGuid)
|
||||
: base(typeof(CraftHelpDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.CraftHelpDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CraftHelpAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
69
ServerCommon/Doc/OwnerContents/CraftRecipeDoc.cs
Normal file
69
ServerCommon/Doc/OwnerContents/CraftRecipeDoc.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CraftRecipeAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("craft_meta_id")]
|
||||
public META_ID CraftMetaId { get; set; } = 0;
|
||||
|
||||
public CraftRecipeAttrib()
|
||||
: base(typeof(CraftRecipeAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "craftrecipe#user_guid"
|
||||
// SK(Sort Key) : "craft_meta_id"
|
||||
// DocType : CraftRecipeDoc
|
||||
// CraftRecipeAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CraftRecipeDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "craftrecipe#"; }
|
||||
|
||||
public CraftRecipeDoc()
|
||||
: base(typeof(CraftRecipeDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CraftRecipeDoc(string ownerGuid, META_ID craftMetaId)
|
||||
: base(typeof(CraftRecipeDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(ownerGuid, craftMetaId.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.CraftRecipeDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CraftRecipeAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
109
ServerCommon/Doc/OwnerContents/CustomDefinedDataDoc.cs
Normal file
109
ServerCommon/Doc/OwnerContents/CustomDefinedDataDoc.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CustomDefinedDataAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("owner_guid")]
|
||||
public string OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("data_key")]
|
||||
public string DataKey { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("custom_defined_data")]
|
||||
public string CustomDefinedData { get; set; } = string.Empty;
|
||||
|
||||
public CustomDefinedDataAttrib()
|
||||
: base(typeof(CustomDefinedDataAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "custom_defined_data#owner_guid" [owner_guid : user_guid]
|
||||
// SK(Sort Key) : "data_key#custom_data_key"
|
||||
// DocType : CustomDefinedDataDoc
|
||||
// CustomDefinedDataAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CustomDefinedDataDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "custom_defined_data#"; }
|
||||
private static string getPrefixOfSK() { return "data_key#"; }
|
||||
|
||||
public CustomDefinedDataDoc()
|
||||
: base(typeof(CustomDefinedDataDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CustomDefinedDataDoc(OwnerEntityType ownerEntityType, string ownerGuid, string customDataKey)
|
||||
: base(typeof(CustomDefinedDataDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(customDataKey);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var doc_custom_defined_data_attrib = getAttrib<CustomDefinedDataAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_custom_defined_data_attrib, () => $"doc_custom_defined_data_attrib is null !!!");
|
||||
|
||||
doc_custom_defined_data_attrib.OwnerGuid = ownerGuid;
|
||||
doc_custom_defined_data_attrib.OwnerEntityType = ownerEntityType;
|
||||
doc_custom_defined_data_attrib.DataKey = customDataKey;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CustomDefinedDataAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
109
ServerCommon/Doc/OwnerContents/CustomDefinedUiDoc.cs
Normal file
109
ServerCommon/Doc/OwnerContents/CustomDefinedUiDoc.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CustomDefinedUiAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("ui_key")]
|
||||
public string UiKey { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("custom_defined_ui")]
|
||||
public string CustomDefinedUi { get; set; } = string.Empty;
|
||||
|
||||
public CustomDefinedUiAttrib()
|
||||
: base(typeof(CustomDefinedUiAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "custom_defined_ui#owner_guid" [owner_guid : user_guid, ugc_npc_meta_guid]
|
||||
// SK(Sort Key) : "ui_key#custom_ui_key"
|
||||
// DocType : CustomDefinedUiDoc
|
||||
// CustomDefinedUiAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CustomDefinedUiDoc : DynamoDbDocBase
|
||||
{
|
||||
public static string getPrefixOfPK() { return "custom_defined_ui#"; }
|
||||
public static string getPrefixOfSK() { return "ui_key#"; }
|
||||
|
||||
public CustomDefinedUiDoc()
|
||||
: base(typeof(CustomDefinedUiDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CustomDefinedUiDoc(OwnerEntityType ownerEntityType, string guidOfOwnerEntityType, string uiKey)
|
||||
: base(typeof(CustomDefinedUiDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(guidOfOwnerEntityType);
|
||||
setCombinationKeyForSK(uiKey);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var doc_custom_defined_ui_attrib = getAttrib<CustomDefinedUiAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_custom_defined_ui_attrib, () => $"doc_custom_defined_ui_attrib is null !!!");
|
||||
|
||||
doc_custom_defined_ui_attrib.OwnerEntityType = ownerEntityType;
|
||||
doc_custom_defined_ui_attrib.OwnerGuid = guidOfOwnerEntityType;
|
||||
doc_custom_defined_ui_attrib.UiKey = uiKey;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CustomDefinedUiAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
69
ServerCommon/Doc/OwnerContents/DailyQuestCheckDoc.cs
Normal file
69
ServerCommon/Doc/OwnerContents/DailyQuestCheckDoc.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using MetaAssets;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public class DailyQuestCheckAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("daily_sended_quest")]
|
||||
public HashSet<UInt32> m_daily_sended_quest { get; set; } = new();
|
||||
|
||||
[JsonProperty("next_refresh_time")]
|
||||
public DateTime m_next_refresh_time { get; set; } = DateTime.Now;
|
||||
|
||||
public DailyQuestCheckAttrib()
|
||||
: base(typeof(DailyQuestCheckAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "daily_quest_check#owner_guid"
|
||||
// SK(Sort Key) :
|
||||
// DocType : DailyQuestCheckDoc
|
||||
//=============================================================================================
|
||||
public class DailyQuestCheckDoc : DynamoDbDocBase
|
||||
{
|
||||
public DailyQuestCheckDoc()
|
||||
: base(typeof(DailyQuestCheckDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public DailyQuestCheckDoc(string guid)
|
||||
: base(typeof(DailyQuestCheckDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(guid);
|
||||
appendAttribWrapperAll();
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<DailyQuestCheckAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "daily_quest_check#";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
96
ServerCommon/Doc/OwnerContents/EndQuestDoc.cs
Normal file
96
ServerCommon/Doc/OwnerContents/EndQuestDoc.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public class EndQuestAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("quest_id")]
|
||||
public UInt32 m_quest_id { get; set; } = 0;
|
||||
[JsonProperty("quest_revision")]
|
||||
public UInt32 m_quest_revision { get; set; } = 0;
|
||||
|
||||
[JsonProperty("end_count")]
|
||||
public Int32 m_end_count { get; set; } = 0;
|
||||
[JsonProperty("last_end_time")]
|
||||
public DateTime m_last_end_time { get; set; } = new();
|
||||
|
||||
public EndQuestAttrib()
|
||||
: base(typeof(EndQuestAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "end_quest#owner_guid"
|
||||
// SK(Sort Key) : "quest_id"
|
||||
// DocType : EndQuestDoc
|
||||
// EndQuestAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class EndQuestDoc : DynamoDbDocBase
|
||||
{
|
||||
public EndQuestDoc(string ownerGuid, UInt32 questId, UInt32 questRevision)
|
||||
: base(typeof(EndQuestDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(maskEndQuestSKString(questId, questRevision));
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
appendAttribWrapper(new AttribWrapper<EndQuestAttrib>());
|
||||
}
|
||||
|
||||
public EndQuestDoc()
|
||||
: base(typeof(EndQuestDoc).Name)
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<EndQuestAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "end_quest#";
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
public static string maskEndQuestSKString(UInt32 questId, UInt32 questRevision)
|
||||
{
|
||||
return $"{questId}#{questRevision}";
|
||||
}
|
||||
}
|
||||
139
ServerCommon/Doc/OwnerContents/EntityAlertRecordDoc.cs
Normal file
139
ServerCommon/Doc/OwnerContents/EntityAlertRecordDoc.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using ALERT_KEY = System.String;
|
||||
using META_ID = System.UInt32;
|
||||
using OWNER_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class EntityAlertRecordAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("alert_key")]
|
||||
public ALERT_KEY AlertKey { get; set; } = string.Empty;
|
||||
[JsonProperty("alerted_time")]
|
||||
public DateTime AlertedTime { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("entity_alert_type")]
|
||||
public EntityAlertTriggerType EntityAlertTriggerType { get; set; } = EntityAlertTriggerType.None;
|
||||
[JsonProperty("meta_id")]
|
||||
public META_ID MetaId { get; set; } = 0;
|
||||
|
||||
public EntityAlertRecordAttrib()
|
||||
: base(typeof(EntityAlertRecordAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "entity_alert_record#{owner_guid}" [owner_guid : item_guid, ]
|
||||
// SK(Sort Key) : "{entity_alert_type}#{alert_key}"
|
||||
// DocType : EntityAlertRecordDoc
|
||||
// EntityAlertRecordAttrib :
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class EntityAlertRecordDoc : DynamoDbDocBase, ICopyDocFromEntityAttribute
|
||||
{
|
||||
private static string getPrefixOfPK() { return "entity_alert_record#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public EntityAlertRecordDoc()
|
||||
: base(typeof(EntityAlertRecordDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public EntityAlertRecordDoc( OWNER_GUID ownerGuid, ALERT_KEY alertKey, DateTime alertedTime
|
||||
, OwnerEntityType ownerEntityType
|
||||
, EntityAlertTriggerType triggerType, META_ID metaId )
|
||||
: base(typeof(EntityAlertRecordDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(makeALERT_KEY(triggerType, metaId));
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var doc_entity_alert_record_attrib = getAttrib<EntityAlertRecordAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull( doc_entity_alert_record_attrib
|
||||
, () => $"doc_entity_alert_record_attrib is null !!! - ownerGuid:{ownerGuid}, alertKey:{alertKey}, ownerEntityType:{ownerEntityType}, alertTriggerType:{triggerType}, metaId:{metaId}");
|
||||
|
||||
doc_entity_alert_record_attrib.AlertKey = alertKey;
|
||||
doc_entity_alert_record_attrib.AlertedTime = alertedTime;
|
||||
doc_entity_alert_record_attrib.OwnerEntityType = ownerEntityType;
|
||||
doc_entity_alert_record_attrib.OwnerGuid = ownerGuid;
|
||||
doc_entity_alert_record_attrib.EntityAlertTriggerType = triggerType;
|
||||
doc_entity_alert_record_attrib.MetaId = metaId;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<EntityAlertRecordAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(ALERT_KEY sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
// override ICopyDocFromEntityAttribute
|
||||
public bool copyDocFromEntityAttribute(EntityAttributeBase entityAttributeBase)
|
||||
{
|
||||
ArgumentNullReferenceCheckHelper.throwIfNull(entityAttributeBase, () => $"entityAttributeBase is null !!! - {toBasicString()}");
|
||||
|
||||
var entity_alert_record_attribute = entityAttributeBase as EntityAlertRecordAttribute;
|
||||
if (null == entity_alert_record_attribute)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var to_copy_doc_entity_alert_record_attrib = getAttrib<EntityAlertRecordAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(to_copy_doc_entity_alert_record_attrib, () => $"to_copy_doc_entity_alert_record_attrib is null !!! - {toBasicString()}");
|
||||
|
||||
to_copy_doc_entity_alert_record_attrib.AlertKey = entity_alert_record_attribute.AlertKey;
|
||||
to_copy_doc_entity_alert_record_attrib.AlertedTime = entity_alert_record_attribute.AlertedTime;
|
||||
to_copy_doc_entity_alert_record_attrib.OwnerEntityType = entity_alert_record_attribute.OwnerEntityType;
|
||||
to_copy_doc_entity_alert_record_attrib.OwnerGuid = entity_alert_record_attribute.OwnerGuid;
|
||||
to_copy_doc_entity_alert_record_attrib.EntityAlertTriggerType = entity_alert_record_attribute.EntityAlertTriggerType;
|
||||
to_copy_doc_entity_alert_record_attrib.MetaId = entity_alert_record_attribute.MetaId;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static ALERT_KEY makeALERT_KEY(EntityAlertTriggerType entityAlertyTriggerType, META_ID metaId)
|
||||
{
|
||||
return $"{entityAlertyTriggerType}#{metaId}";
|
||||
}
|
||||
}
|
||||
74
ServerCommon/Doc/OwnerContents/EscapePositionDoc.cs
Normal file
74
ServerCommon/Doc/OwnerContents/EscapePositionDoc.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class EscapePositionAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("AvailableTime")]
|
||||
public DateTime escape_available_time = new();
|
||||
|
||||
public EscapePositionAttrib()
|
||||
: base(typeof(EscapePositionAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "escape_position#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : EscapePositionDoc
|
||||
// EscapePositionAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class EscapePositionDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "escape_position#"; }
|
||||
|
||||
public EscapePositionDoc()
|
||||
: base(typeof(EscapePositionDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public EscapePositionDoc(string ownerGuid)
|
||||
: base(typeof(EscapePositionDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<EscapePositionAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
}
|
||||
126
ServerCommon/Doc/OwnerContents/FarmingEffectOwnerDoc.cs
Normal file
126
ServerCommon/Doc/OwnerContents/FarmingEffectOwnerDoc.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using WORLD_ID = System.UInt32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using ENTITY_UNIQUE_ID = System.String;
|
||||
using ANCHOR_META_GUID = System.String;
|
||||
using NPC_UNIQUE_ID = System.String;
|
||||
using FARMING_ENTITY_GUID = System.String;
|
||||
using LOCATION_UNIQUE_ID = System.String;
|
||||
using FARMING_EFFECT_DOC_LINK_PKSK = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class FarmingEffectOwnerAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("farming_effect_doc_link_pk_sk")]
|
||||
public FARMING_EFFECT_DOC_LINK_PKSK FarmingEffectDocLinkPKSK { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public FarmingEffectOwnerAttrib()
|
||||
: base(typeof(FarmingEffectOwnerAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "farming_effect_owner#owner_guid" [owner_guid: user_guid, npc_ugc_meta_guid]
|
||||
// SK(Sort Key) : "FARMING_EFFECT_DOC_LINK_PKSK"
|
||||
// DocType : "FarmingEffectOwnerDoc"
|
||||
// FarmingAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class FarmingEffectOwnerDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getDocTypeName() { return typeof(FarmingEffectOwnerDoc).Name; }
|
||||
private string getPrefixOfPK() { return $"farming_effect_owner#"; }
|
||||
private string getPrefixOfSK() { return $""; }
|
||||
|
||||
public FarmingEffectOwnerDoc()
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public FarmingEffectOwnerDoc(OWNER_GUID ownerGuid, FARMING_EFFECT_DOC_LINK_PKSK farmingEffectDocLinkPKSK)
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(farmingEffectDocLinkPKSK);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
public FarmingEffectOwnerDoc( OwnerEntityType ownerEntityType, OWNER_GUID ownerGuid
|
||||
, FARMING_EFFECT_DOC_LINK_PKSK farmingEffectDocLinkPKSK )
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(farmingEffectDocLinkPKSK);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var to_set_farming_effect_owner_attrib = getAttrib<FarmingEffectOwnerAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(to_set_farming_effect_owner_attrib, () => $"to_set_farming_effect_owner_attrib is null !!!");
|
||||
|
||||
to_set_farming_effect_owner_attrib.OwnerEntityType = ownerEntityType;
|
||||
to_set_farming_effect_owner_attrib.OwnerGuid = ownerGuid;
|
||||
to_set_farming_effect_owner_attrib.FarmingEffectDocLinkPKSK = farmingEffectDocLinkPKSK;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<FarmingEffectOwnerAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
var error_code = onFillupCombinationKeyForSK(sortKey, out var fillup_key);
|
||||
if (error_code.isFail())
|
||||
{
|
||||
return error_code;
|
||||
}
|
||||
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(fillup_key);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
111
ServerCommon/Doc/OwnerContents/FriendDoc.cs
Normal file
111
ServerCommon/Doc/OwnerContents/FriendDoc.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Globalization;
|
||||
|
||||
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class FriendAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("friend_guid")]
|
||||
public string FriendGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("folder_name")]
|
||||
public string FolderName { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("is_new")]
|
||||
public Int32 IsNew { get; set; } = 0;
|
||||
|
||||
[JsonProperty("create_time")]
|
||||
public DateTime CreateTime { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
public void cloenAttrib(ref FriendAttrib attrib)
|
||||
{
|
||||
attrib.FriendGuid = FriendGuid;
|
||||
attrib.FolderName = FolderName;
|
||||
attrib.IsNew = IsNew;
|
||||
attrib.CreateTime = CreateTime;
|
||||
}
|
||||
|
||||
public FriendAttrib()
|
||||
: base(typeof(FriendAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "friend#owner_guid"
|
||||
// SK(Sort Key) : "friend_guid"
|
||||
// DocType : FriendInfoDoc
|
||||
// FriendAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class FriendDoc : DynamoDbDocBase
|
||||
{
|
||||
public FriendDoc()
|
||||
: base(typeof(FriendDoc).Name)
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<FriendAttrib>());
|
||||
}
|
||||
|
||||
public FriendDoc(string ownerGuid, string friendGuid)
|
||||
: base(typeof(FriendDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(friendGuid);
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapper(new AttribWrapper<FriendAttrib>());
|
||||
}
|
||||
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "friend#";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
|
||||
}
|
||||
|
||||
// protected override string onGetPrefixOfSK()
|
||||
// {
|
||||
// return "";
|
||||
// }
|
||||
|
||||
|
||||
//onCopyFromDocument(document)
|
||||
|
||||
|
||||
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
105
ServerCommon/Doc/OwnerContents/FriendFolderDoc.cs
Normal file
105
ServerCommon/Doc/OwnerContents/FriendFolderDoc.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
|
||||
using Axion.Collections.Concurrent;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class FriendFolder
|
||||
{
|
||||
[JsonProperty("folder_name")]
|
||||
public string FolderName { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("is_hold")]
|
||||
public Int16 IsHold { get; set; } = 0;
|
||||
|
||||
[JsonProperty("hold_time")]
|
||||
public DateTime HoldTime { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
[JsonProperty("create_time")]
|
||||
public DateTime CreateTime { get; set; } = DateTimeHelper.MinTime;
|
||||
}
|
||||
|
||||
|
||||
public class FriendFolderAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("folder_order_type")]
|
||||
public Int16 FolderOrderType { get; set; } = 1; //1 : ALPHABETICAL, 2: STATEFUL
|
||||
|
||||
[JsonProperty("friend_folders")]
|
||||
public ConcurrentDictionary<string, FriendFolder> Folders { get; set; } = new ConcurrentDictionary<string, FriendFolder>();
|
||||
|
||||
public void cloneAttrib(ref FriendFolderAttrib attrib)
|
||||
{
|
||||
attrib.FolderOrderType = FolderOrderType;
|
||||
attrib.Folders = new();
|
||||
foreach (var folder in Folders)
|
||||
{
|
||||
FriendFolder clone_folder = new FriendFolder();
|
||||
clone_folder.FolderName = folder.Value.FolderName;
|
||||
clone_folder.IsHold = folder.Value.IsHold;
|
||||
clone_folder.HoldTime = folder.Value.HoldTime;
|
||||
clone_folder.CreateTime = folder.Value.CreateTime;
|
||||
|
||||
attrib.Folders.TryAdd(folder.Key, clone_folder);
|
||||
}
|
||||
}
|
||||
|
||||
public FriendFolderAttrib()
|
||||
: base(typeof(FriendFolderAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "friendfolder#owner_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : FriendFolderDoc
|
||||
// FriendFolderAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class FriendFolderDoc : DynamoDbDocBase
|
||||
{
|
||||
public FriendFolderDoc()
|
||||
: base(typeof(FriendFolderDoc).Name)
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<FriendFolderAttrib>());
|
||||
}
|
||||
|
||||
public FriendFolderDoc(string ownerGuid)
|
||||
: base(typeof(FriendFolderDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
appendAttribWrapper(new AttribWrapper<FriendFolderAttrib>());
|
||||
}
|
||||
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "friend_folder#";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
}
|
||||
66
ServerCommon/Doc/OwnerContents/GameOptionDoc.cs
Normal file
66
ServerCommon/Doc/OwnerContents/GameOptionDoc.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class GameOptionAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public string options { get; set; } = string.Empty;
|
||||
|
||||
public GameOptionAttrib()
|
||||
: base(typeof(GameOptionAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "game_option#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : GameOptionDoc
|
||||
// GameOptionAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class GameOptionDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "game_option#"; }
|
||||
|
||||
public GameOptionDoc()
|
||||
: base(typeof(GameOptionDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public GameOptionDoc(string ownerGuid)
|
||||
: base(typeof(GameOptionDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.GameOptionDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<GameOptionAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
159
ServerCommon/Doc/OwnerContents/ItemDoc.cs
Normal file
159
ServerCommon/Doc/OwnerContents/ItemDoc.cs
Normal file
@@ -0,0 +1,159 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System.Xml.Linq;
|
||||
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class ItemAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("item_guid")]
|
||||
public ITEM_GUID ItemGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("item_meta_id")]
|
||||
public META_ID ItemMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("item_stack_count")]
|
||||
public UInt16 ItemStackCount { get; set; } = 0;
|
||||
|
||||
[JsonProperty("level")]
|
||||
public UInt16 Level { get; set; } = 0;
|
||||
|
||||
[JsonProperty("attributes")]
|
||||
public List<UInt16> Attributes { get; set; } = new();
|
||||
|
||||
[JsonProperty("equiped_inven_type")]
|
||||
public InvenEquipType EquipedIvenType { get; set; } = InvenEquipType.None;
|
||||
|
||||
[JsonProperty("equiped_pos")]
|
||||
public UInt16 EquipedPos { get; set; } = 0;
|
||||
|
||||
public ItemAttrib()
|
||||
: base(typeof(ItemAttrib).Name)
|
||||
{ }
|
||||
|
||||
public ItemAttrib(string docType, bool isSaveToJsonInDb = true)
|
||||
: base(docType, isSaveToJsonInDb)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "item#owner_guid" [owner_guid : user_guid, ugc_npc_meta_guid]
|
||||
// SK(Sort Key) : "item_guid"
|
||||
// DocType : ItemDoc
|
||||
// ItemAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class ItemDoc : DynamoDbDocBase, ICopyDocFromEntityAttribute
|
||||
{
|
||||
private static string getPrefixOfPK() { return "item#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public ItemDoc()
|
||||
: base(typeof(ItemDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public ItemDoc(string docType)
|
||||
: base(docType)
|
||||
{
|
||||
}
|
||||
|
||||
public ItemDoc(OwnerEntityType ownerEntityType, string ownerGuid, string itemGuid)
|
||||
: base(typeof(ItemDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(itemGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var doc_item_attrib = getAttrib<ItemAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_item_attrib, () => $"doc_item_attrib is null !!! - itemGuid:{itemGuid}, ownerGuid:{ownerGuid}, ownerEntityType:{ownerEntityType}");
|
||||
|
||||
doc_item_attrib.OwnerGuid = ownerGuid;
|
||||
doc_item_attrib.OwnerEntityType = ownerEntityType;
|
||||
doc_item_attrib.ItemGuid = itemGuid;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<ItemAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
// override ICopyDocFromEntityAttribute
|
||||
public bool copyDocFromEntityAttribute(EntityAttributeBase entityAttributeBase)
|
||||
{
|
||||
ArgumentNullReferenceCheckHelper.throwIfNull(entityAttributeBase, () => $"entityAttributeBase is null !!! - {toBasicString()}");
|
||||
|
||||
var item_attribute = entityAttributeBase as ItemAttributeBase;
|
||||
if(null == item_attribute)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var to_copy_doc_item_attrib = getAttrib<ItemAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(to_copy_doc_item_attrib, () => $"to_copy_doc_item_attrib is null !!! - {toBasicString()}");
|
||||
|
||||
to_copy_doc_item_attrib.ItemGuid = item_attribute.ItemGuid;
|
||||
to_copy_doc_item_attrib.ItemMetaId = item_attribute.ItemMetaId;
|
||||
to_copy_doc_item_attrib.ItemStackCount = item_attribute.ItemStackCount;
|
||||
to_copy_doc_item_attrib.Level = item_attribute.Level;
|
||||
to_copy_doc_item_attrib.Attributes = item_attribute.Attributes.Select(x => x).ToList();
|
||||
to_copy_doc_item_attrib.EquipedIvenType = item_attribute.EquipedIvenType;
|
||||
to_copy_doc_item_attrib.EquipedPos = item_attribute.EquipedPos;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
91
ServerCommon/Doc/OwnerContents/LevelDoc.cs
Normal file
91
ServerCommon/Doc/OwnerContents/LevelDoc.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class LevelAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("exp")]
|
||||
public UInt64 Exp { get; set; } = 0;
|
||||
|
||||
[JsonProperty("level")]
|
||||
public UInt32 Level { get; set; } = 1; // Constant.Default.UserLevel
|
||||
|
||||
public LevelAttrib()
|
||||
: base(typeof(LevelAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "level#owner_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : LevelDoc
|
||||
// LevelAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class LevelDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "level#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public LevelDoc()
|
||||
: base(typeof(LevelDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public LevelDoc(OwnerEntityType ownerEntityType, string ownerGuid)
|
||||
: base(typeof(LevelDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var attr = getAttrib<LevelAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(attr, () => "LevelAttrib is null !!!");
|
||||
|
||||
attr.OwnerGuid = ownerGuid;
|
||||
attr.OwnerEntityType = ownerEntityType;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<LevelAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
243
ServerCommon/Doc/OwnerContents/MailDoc.cs
Normal file
243
ServerCommon/Doc/OwnerContents/MailDoc.cs
Normal file
@@ -0,0 +1,243 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using MAIL_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class MailItem
|
||||
{
|
||||
[JsonProperty]
|
||||
public META_ID ItemId { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public double Count { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public META_ID ProductId { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public bool isRepeatProduct { get; set; } = false;
|
||||
}
|
||||
|
||||
public class MailAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("mail_guid")]
|
||||
public MAIL_GUID MailGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("is_read")]
|
||||
public bool IsRead { get; set; } = false;
|
||||
|
||||
[JsonProperty("is_get_item")]
|
||||
public bool IsGetItem { get; set; } = false;
|
||||
|
||||
[JsonProperty("is_system_mail")]
|
||||
public bool IsSystemMail { get; set; } = false;
|
||||
|
||||
[JsonProperty("sender_nickname")]
|
||||
public string SenderNickName { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("sender_guid")]
|
||||
public string SenderGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("receiver_nickname")]
|
||||
public string ReceiverNickName { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("receiver_guid")]
|
||||
public string ReceiverGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("text")]
|
||||
public string Text { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("create_time")]
|
||||
public DateTime CreateTime { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
[JsonProperty("expire_time")]
|
||||
public DateTime ExpireTime { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
[JsonProperty("is_text_by_meta_data")]
|
||||
public bool IsTextByMetaData { get; set; } = false;
|
||||
|
||||
[JsonProperty("item_list")]
|
||||
public List<MailItem> ItemList { get; set; } = new();
|
||||
|
||||
[JsonProperty("package_order_id")]
|
||||
public string packageOrderId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("contents_arguments")]
|
||||
public List<string> ContentsArguments { get; set; } = new();
|
||||
|
||||
public MailAttrib()
|
||||
: base(typeof(MailAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : ""
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : MailDoc
|
||||
// MailAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public abstract class MailDoc : DynamoDbDocBase
|
||||
{
|
||||
public MailDoc()
|
||||
: base(typeof(MailDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public MailDoc(OWNER_GUID ownerGuid)
|
||||
: base(typeof(MailDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.MailDocException));
|
||||
}
|
||||
|
||||
public MailDoc(OWNER_GUID ownerGuid, MAIL_GUID mailGuid)
|
||||
: base(typeof(MailDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(ownerGuid, mailGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.MailDocException));
|
||||
}
|
||||
|
||||
public MailDoc(OWNER_GUID ownerGuid, MAIL_GUID mailGuid, Int64 ttlSeconds)
|
||||
: base(typeof(MailDoc).Name, ttlSeconds)
|
||||
{
|
||||
setCombinationKeyForPKSK(ownerGuid, mailGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.MailDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<MailAttrib>());
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "recv_mail#user_guid"
|
||||
// SK(Sort Key) : "mail_guid"
|
||||
// DocType : ReceivedMailDoc
|
||||
// Attrib : MailAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class ReceivedMailDoc : MailDoc
|
||||
{
|
||||
public ReceivedMailDoc()
|
||||
: base()
|
||||
{
|
||||
|
||||
}
|
||||
public ReceivedMailDoc(OWNER_GUID ownerGuid)
|
||||
: base(ownerGuid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ReceivedMailDoc(OWNER_GUID ownerGuid, MAIL_GUID mailGuid)
|
||||
: base(ownerGuid, mailGuid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ReceivedMailDoc(OWNER_GUID ownerGuid, MAIL_GUID mailGuid, Int64 ttlSeconds)
|
||||
: base(ownerGuid, mailGuid, ttlSeconds)
|
||||
{
|
||||
|
||||
}
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "recv_mail#";
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "sent_mail#user_guid"
|
||||
// SK(Sort Key) : "mail_guid"
|
||||
// DocType : SentMailDoc
|
||||
// Attrib : MailAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class SentMailDoc : MailDoc
|
||||
{
|
||||
public SentMailDoc()
|
||||
: base()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SentMailDoc(OWNER_GUID ownerGuid)
|
||||
: base(ownerGuid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SentMailDoc(OWNER_GUID ownerGuid, MAIL_GUID mailGuid)
|
||||
: base(ownerGuid, mailGuid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SentMailDoc(OWNER_GUID ownerGuid, MAIL_GUID mailGuid, Int64 ttlSeconds)
|
||||
: base(ownerGuid, mailGuid, ttlSeconds)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "sent_mail#";
|
||||
}
|
||||
}
|
||||
87
ServerCommon/Doc/OwnerContents/MailProfileDoc.cs
Normal file
87
ServerCommon/Doc/OwnerContents/MailProfileDoc.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class MailProfileAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("send_mail_count")]
|
||||
public Int32 SendMailCount { get; set; } = 0;
|
||||
|
||||
[JsonProperty("send_mail_updateday")]
|
||||
public Int64 SendMailUpdateDay { get; set; } = 0;
|
||||
|
||||
[JsonProperty("last_systemmail_id")]
|
||||
public Int32 LastSystemMailId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("received_system_mails")]
|
||||
public Dictionary<Int32, DateTime> ReceivedSystemMails { get; set; } = new();
|
||||
|
||||
public MailProfileAttrib()
|
||||
: base(typeof(MailProfileAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "mail_profile#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : MailProfileDoc
|
||||
// MailProfileAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class MailProfileDoc : DynamoDbDocBase
|
||||
{
|
||||
public MailProfileDoc()
|
||||
: base(typeof(MailProfileDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public MailProfileDoc(string ownerGuid)
|
||||
: base(typeof(MailProfileDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.MailProfileDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<MailProfileAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "mail_profile#";
|
||||
}
|
||||
}
|
||||
168
ServerCommon/Doc/OwnerContents/MoneyDoc.cs
Normal file
168
ServerCommon/Doc/OwnerContents/MoneyDoc.cs
Normal file
@@ -0,0 +1,168 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public static class MoneyAttribExtensions
|
||||
{
|
||||
public static double getCurrencyFromType(this MoneyAttrib attrib, CurrencyType type)
|
||||
{
|
||||
var currency = type switch
|
||||
{
|
||||
CurrencyType.Gold => attrib.Gold,
|
||||
CurrencyType.Sapphire => attrib.Sapphire,
|
||||
CurrencyType.Calium => attrib.Calium,
|
||||
CurrencyType.Ruby => attrib.Ruby,
|
||||
_ => 0
|
||||
};
|
||||
|
||||
return currency;
|
||||
}
|
||||
|
||||
public static void setCurrencyFromType(this MoneyAttrib attrib, CurrencyType type, double currency)
|
||||
{
|
||||
var result = type switch
|
||||
{
|
||||
CurrencyType.Gold => attrib.Gold = currency,
|
||||
CurrencyType.Sapphire => attrib.Sapphire = currency,
|
||||
CurrencyType.Calium => attrib.Calium = currency,
|
||||
CurrencyType.Ruby => attrib.Ruby = currency,
|
||||
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
|
||||
};
|
||||
}
|
||||
|
||||
public static string getKeyNameFromType(CurrencyType type)
|
||||
{
|
||||
var result = type switch
|
||||
{
|
||||
CurrencyType.Gold => nameof(MoneyAttrib.Gold),
|
||||
CurrencyType.Sapphire => nameof(MoneyAttrib.Sapphire),
|
||||
CurrencyType.Calium => nameof(MoneyAttrib.Calium),
|
||||
CurrencyType.Ruby => nameof(MoneyAttrib.Ruby),
|
||||
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public class MoneyAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("gold")]
|
||||
public double Gold { get; set; } = 0;
|
||||
|
||||
[JsonProperty("sapphire")]
|
||||
public double Sapphire { get; set; } = 0;
|
||||
|
||||
[JsonProperty("calium")]
|
||||
public double Calium { get; set; } = 0;
|
||||
|
||||
[JsonProperty("ruby")]
|
||||
public double Ruby { get; set; } = 0;
|
||||
|
||||
public MoneyAttrib()
|
||||
: base(typeof(MoneyAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "money#owner_guid" [owner_guid : user_guid]
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : MoneyDoc
|
||||
// MoneyAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class MoneyDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "money#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public MoneyDoc()
|
||||
: base(typeof(MoneyDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public MoneyDoc(OwnerEntityType ownerEntityType, string ownerGuid)
|
||||
: base(typeof(MoneyDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var doc_attrib = getAttrib<MoneyAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_attrib, () => "MoneyAttrib is null !!");
|
||||
|
||||
doc_attrib.OwnerGuid = ownerGuid;
|
||||
doc_attrib.OwnerEntityType = ownerEntityType;
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<MoneyAttrib>());
|
||||
}
|
||||
|
||||
public static async Task<(Result result, MoneyAttrib? attrib)> findMoneyFromGuid(DynamoDbClient dynamoDbClient, string ownerGuid)
|
||||
{
|
||||
var result = new Result();
|
||||
var money_docs = new List<MoneyDoc>();
|
||||
|
||||
(result, var make_primary_key) = await DynamoDBDocBaseHelper.makePrimaryKey<MoneyDoc>(ownerGuid);
|
||||
if (result.isFail() || null == make_primary_key)
|
||||
{
|
||||
return (result, null);
|
||||
}
|
||||
var query_config = dynamoDbClient.makeQueryConfigForReadByPKSK(make_primary_key.PK, make_primary_key.SK);
|
||||
|
||||
(result, money_docs) = await dynamoDbClient.simpleQueryDocTypesWithQueryOperationConfig<MoneyDoc>(query_config);
|
||||
if (result.isFail())
|
||||
{
|
||||
return (result, null);
|
||||
}
|
||||
|
||||
var attrib = money_docs[0].getAttrib<MoneyAttrib>();
|
||||
if (attrib == null) return (result, null);
|
||||
|
||||
return (result, attrib);
|
||||
}
|
||||
}
|
||||
126
ServerCommon/Doc/OwnerContents/NicknameDoc.cs
Normal file
126
ServerCommon/Doc/OwnerContents/NicknameDoc.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using NICKNAME = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class NicknameAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("nickname")]
|
||||
public string Nickname { get; set; } = string.Empty;
|
||||
|
||||
public NicknameAttrib()
|
||||
: base(typeof(NicknameAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "nickname#owner_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : NicknameDoc
|
||||
// NicknameAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class NicknameDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "nickname#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public NicknameDoc()
|
||||
: base(typeof(NicknameDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public NicknameDoc(OwnerEntityType ownerEntityType, OWNER_GUID ownerGuid, NICKNAME nickname)
|
||||
: base(typeof(NicknameDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var nickname_attrib = getAttrib<NicknameAttrib>();
|
||||
ArgumentNullException.ThrowIfNull(nickname_attrib, $"nickname_attrib is null !!! - ownerEntityType:{ownerEntityType}, ownerGuid:{ownerGuid}, nickname:{nickname}");
|
||||
|
||||
nickname_attrib.OwnerEntityType = ownerEntityType;
|
||||
nickname_attrib.OwnerGuid = ownerGuid;
|
||||
nickname_attrib.Nickname = nickname;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<NicknameAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
public static async Task<(Result result, NicknameAttrib? attrib)> findNicknameFromGuid(string ownerGuid)
|
||||
{
|
||||
var server_logic = ServerLogicApp.getServerLogicApp();
|
||||
NullReferenceCheckHelper.throwIfNull(server_logic, () => $"server_logic is null !!!");
|
||||
var dynamo_db_client = server_logic.getDynamoDbClient();
|
||||
NullReferenceCheckHelper.throwIfNull(dynamo_db_client, () => $"dynamo_db_client is null !!!");
|
||||
|
||||
return await findNicknameFromGuid(dynamo_db_client, ownerGuid);
|
||||
}
|
||||
|
||||
public static async Task<(Result result, NicknameAttrib? attrib)> findNicknameFromGuid(DynamoDbClient dynamoDbClient, string ownerGuid)
|
||||
{
|
||||
var result = new Result();
|
||||
var nickname_docs = new List<NicknameDoc>();
|
||||
|
||||
(result, var make_primary_key) = await DynamoDBDocBaseHelper.makePrimaryKey<NicknameDoc>(ownerGuid);
|
||||
if (result.isFail())
|
||||
{
|
||||
return (result, null);
|
||||
}
|
||||
ArgumentNullReferenceCheckHelper.throwIfNull(make_primary_key, () => $"make_primary_key is null !!!");
|
||||
var query_config = dynamoDbClient.makeQueryConfigForReadByPKSK(make_primary_key.PK, make_primary_key.SK);
|
||||
|
||||
(result, nickname_docs) = await dynamoDbClient.simpleQueryDocTypesWithQueryOperationConfig<NicknameDoc>(query_config, true);
|
||||
if (result.isFail())
|
||||
{
|
||||
return (result, null);
|
||||
}
|
||||
|
||||
var attrib = nickname_docs[0].getAttrib<NicknameAttrib>();
|
||||
if (attrib == null) return (result, null);
|
||||
|
||||
return (result, attrib);
|
||||
}
|
||||
}
|
||||
63
ServerCommon/Doc/OwnerContents/PackageLastOrderRecodeDoc.cs
Normal file
63
ServerCommon/Doc/OwnerContents/PackageLastOrderRecodeDoc.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class PackageLastOrderRecodeAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public string LastOrderGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty]
|
||||
public DateTime LastBuyTime { get; set; } = new();
|
||||
|
||||
public PackageLastOrderRecodeAttrib()
|
||||
: base(typeof(PackageLastOrderRecodeAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "package_lastorder_recode#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : PackageLastOrderRecodeDoc
|
||||
// Attrib : PackageLastOrderRecodeAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class PackageLastOrderRecodeDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "package_lastorder_recode#"; }
|
||||
|
||||
public PackageLastOrderRecodeDoc()
|
||||
: base(typeof(PackageLastOrderRecodeDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public PackageLastOrderRecodeDoc(string ownerGuid)
|
||||
: base(typeof(PackageLastOrderRecodeDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.PackageLastOrderRecodeDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<PackageLastOrderRecodeAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
77
ServerCommon/Doc/OwnerContents/PackageRepeatDoc.cs
Normal file
77
ServerCommon/Doc/OwnerContents/PackageRepeatDoc.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class PackageRepeatAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public string OrderGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty]
|
||||
public META_ID ProductMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public int LeftCount { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public DateTime NextGiveTime { get; set; } = new();
|
||||
|
||||
public PackageRepeatAttrib()
|
||||
: base(typeof(PackageRepeatAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "package_repeat#user_guid"
|
||||
// SK(Sort Key) : "order_guid"
|
||||
// DocType : PackageRepeatDoc
|
||||
// Attrib : PackageRepeatAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class PackageRepeatDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "package_repeat#"; }
|
||||
|
||||
public PackageRepeatDoc()
|
||||
: base(typeof(PackageRepeatDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public PackageRepeatDoc(string ownerGuid, string orderGuid)
|
||||
: base(typeof(PackageRepeatDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(ownerGuid, orderGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.PackageRepeatDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<PackageRepeatAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
144
ServerCommon/Doc/OwnerContents/QuestDoc.cs
Normal file
144
ServerCommon/Doc/OwnerContents/QuestDoc.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
using MetaAssets;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class QuestAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("quest_id")]
|
||||
public UInt32 m_quest_id { get; set; } = 0;
|
||||
|
||||
[JsonProperty("quest_type")]
|
||||
public EQuestType m_quest_type { get; set; } = EQuestType.NONE;
|
||||
|
||||
[JsonProperty("ugq_quest_info")]
|
||||
public UgqQuestInfo m_ugq_quest_info { get; set; } = new();
|
||||
|
||||
[JsonProperty("quest_assign_time")]
|
||||
public DateTime m_quest_assign_time { get; set; } = DateTimeHelper.Current;
|
||||
|
||||
[JsonProperty("current_task_num")]
|
||||
public Int32 m_current_task_num { get; set; } = 0;
|
||||
|
||||
[JsonProperty("task_start_time")]
|
||||
public DateTime m_task_start_time { get; set; } = DateTimeHelper.Current;
|
||||
|
||||
[JsonProperty("quest_complete_time")]
|
||||
public DateTime m_quest_complete_time { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
[JsonProperty("active_events")]
|
||||
public List<string> m_active_events { get; set; } = new();
|
||||
|
||||
[JsonProperty("has_counter")]
|
||||
public Int32 m_has_counter { get; set; } = 0;
|
||||
|
||||
[JsonProperty("min_counter")]
|
||||
public Int32 m_min_counter { get; set; } = 0;
|
||||
|
||||
[JsonProperty("max_counter")]
|
||||
public Int32 m_max_counter { get; set; } = 0;
|
||||
|
||||
[JsonProperty("current_counter")]
|
||||
public Int32 m_current_counter { get; set; } = 0;
|
||||
|
||||
[JsonProperty("is_complete")]
|
||||
public Int32 m_is_complete { get; set; } = 0;
|
||||
|
||||
[JsonProperty("replaced_reward_groupId")]
|
||||
public Int32 m_replaced_reward_group_id { get; set; } = 0;
|
||||
|
||||
[JsonProperty("has_timer")]
|
||||
public Int32 m_has_timer { get; set; } = 0;
|
||||
|
||||
[JsonProperty("timer_complete_time")]
|
||||
public DateTime m_timer_complete_time { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
[JsonProperty("is_current_task_complete")]
|
||||
public Int32 m_is_current_task_complete { get; set; } = 0;
|
||||
|
||||
[JsonProperty("completed_idx_strings")]
|
||||
public List<string> m_completed_idx_strings { get; set; } = new();
|
||||
|
||||
public QuestAttrib()
|
||||
: base(typeof(QuestAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "quest#owner_guid"
|
||||
// SK(Sort Key) : "quest_id"
|
||||
// DocType : QuestDoc
|
||||
// QuestAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class QuestDoc : DynamoDbDocBase
|
||||
{
|
||||
public QuestDoc()
|
||||
: base(typeof(QuestDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
|
||||
public QuestDoc(string ownerGuid, UInt32 questId, UInt32 questRevision)
|
||||
: base(typeof(QuestDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(makeQuestSKString(questId, questRevision));
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<QuestAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "quest#";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
public static string makeQuestSKString(UInt32 questId, UInt32 questRevision)
|
||||
{
|
||||
return $"{questId}#{questRevision}";
|
||||
}
|
||||
}
|
||||
115
ServerCommon/Doc/OwnerContents/QuestMailDoc.cs
Normal file
115
ServerCommon/Doc/OwnerContents/QuestMailDoc.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
|
||||
|
||||
using Amazon.DynamoDBv2.Model;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
using OWNER_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class QuestMailAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("is_read")]
|
||||
public Int32 IsRead { get; set; } = 0;
|
||||
|
||||
[JsonProperty("quest_id")]
|
||||
public UInt32 QuestId { get; set; } = 0;
|
||||
[JsonProperty("quest_revision")]
|
||||
public UInt32 QuestRevision { get; set; } = 0;
|
||||
|
||||
[JsonProperty("ugq_state")]
|
||||
public UgqStateType UgqState { get; set; } = UgqStateType.None;
|
||||
[JsonProperty("create_time")] public DateTime CreateTime { get; set; } = DateTimeHelper.Current;
|
||||
|
||||
[JsonProperty("expire_time")] public DateTime? ExpireTime { get; set; }
|
||||
|
||||
public void cloneAttrib(ref QuestMailAttrib attrib)
|
||||
{
|
||||
attrib.IsRead = IsRead;
|
||||
attrib.QuestId = QuestId;
|
||||
attrib.CreateTime = CreateTime;
|
||||
attrib.ExpireTime = ExpireTime;
|
||||
attrib.UgqState = UgqState;
|
||||
}
|
||||
|
||||
public QuestMailAttrib()
|
||||
: base(typeof(QuestMailAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "quest_mail#owner_guid"
|
||||
// SK(Sort Key) : "quest_meta_id"
|
||||
// DocType : QuestMailDoc
|
||||
// Attrib : QuestMailAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class QuestMailDoc : DynamoDbDocBase
|
||||
{
|
||||
|
||||
public QuestMailDoc(string userGuid, UInt32 questId, UInt32 questRevision)
|
||||
: base(typeof(QuestMailDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(makeQuestMailSKString(questId, questRevision));
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public QuestMailDoc(string userGuid, UInt32 questId, UInt32 questRevision, Int64 quest_mail_ttl_seconds)
|
||||
: base(typeof(QuestMailDoc).Name, quest_mail_ttl_seconds)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(makeQuestMailSKString(questId, questRevision));
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public QuestMailDoc()
|
||||
: base(typeof(QuestMailDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<QuestMailAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "quest_mail#";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
public static string makeQuestMailSKString(UInt32 questId, UInt32 questRevision)
|
||||
{
|
||||
return $"{questId}#{questRevision}";
|
||||
}
|
||||
}
|
||||
77
ServerCommon/Doc/OwnerContents/QuestPeriodRepeatCheckDoc.cs
Normal file
77
ServerCommon/Doc/OwnerContents/QuestPeriodRepeatCheckDoc.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
using MetaAssets;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class QuestPeriodRepeatInfo
|
||||
{
|
||||
[JsonProperty("sended_quest")]
|
||||
public ConcurrentDictionary<UInt32, DateTime> m_sended_quest { get; set; } = new();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class QuestPeriodRepeatAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("period_repeat_quests")]
|
||||
public ConcurrentDictionary<OncePeriodRangeType, QuestPeriodRepeatInfo> m_period_repeat_quests = new();
|
||||
|
||||
|
||||
public QuestPeriodRepeatAttrib() : base(typeof(QuestPeriodRepeatAttrib).Name)
|
||||
{ }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "quest_period_repeat#owner_guid"
|
||||
// SK(Sort Key) :
|
||||
// DocType : QuestPeriodRepeatCheckDoc
|
||||
//=============================================================================================
|
||||
public class QuestPeriodRepeatCheckDoc : DynamoDbDocBase
|
||||
{
|
||||
public QuestPeriodRepeatCheckDoc()
|
||||
: base(typeof(QuestPeriodRepeatCheckDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public QuestPeriodRepeatCheckDoc(string guid)
|
||||
: base(typeof(QuestPeriodRepeatCheckDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(guid);
|
||||
appendAttribWrapperAll();
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<QuestPeriodRepeatAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "quest_period_repeat#";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
68
ServerCommon/Doc/OwnerContents/RentalInstanceVisitDoc.cs
Normal file
68
ServerCommon/Doc/OwnerContents/RentalInstanceVisitDoc.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
|
||||
public class RentalInstanceVisitAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("rental_guid")]
|
||||
public Dictionary<string, DateTime> m_rental_instance_visit_guid { get; set; } = new();
|
||||
|
||||
[JsonProperty("next_refresh_time")]
|
||||
public DateTime m_next_refresh_time { get; set; } = DateTime.Now;
|
||||
|
||||
public RentalInstanceVisitAttrib()
|
||||
: base(typeof(RentalInstanceVisitAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "rental_instance_visit#owner_guid"
|
||||
// SK(Sort Key) :
|
||||
// DocType : RentalInstanceVisitDoc
|
||||
//=============================================================================================
|
||||
public class RentalInstanceVisitDoc : DynamoDbDocBase
|
||||
{
|
||||
public RentalInstanceVisitDoc()
|
||||
: base(typeof(RentalInstanceVisitDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public RentalInstanceVisitDoc(string guid)
|
||||
: base(typeof(RentalInstanceVisitDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(guid);
|
||||
appendAttribWrapperAll();
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<RentalInstanceVisitAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "rental_instance_visit#";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
61
ServerCommon/Doc/OwnerContents/RepeatQuestDoc.cs
Normal file
61
ServerCommon/Doc/OwnerContents/RepeatQuestDoc.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class RepeatQuestAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("next_allocate_time")]
|
||||
public DateTime m_next_allocate_time { get; set; } = new();
|
||||
[JsonProperty("is_checking")]
|
||||
public Int32 m_is_checking { get; set; } = 0;
|
||||
|
||||
public RepeatQuestAttrib()
|
||||
: base(typeof(RepeatQuestAttrib).Name)
|
||||
{}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "repeat_quest#owner_guid"
|
||||
// SK(Sort Key) :
|
||||
// DocType : RepeatQuestDoc
|
||||
// RepeatQuestAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class RepeatQuestDoc : DynamoDbDocBase
|
||||
{
|
||||
public RepeatQuestDoc()
|
||||
: base(typeof(RepeatQuestDoc).Name)
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<RepeatQuestAttrib>());
|
||||
}
|
||||
|
||||
public RepeatQuestDoc(string guid)
|
||||
: base(typeof(RepeatQuestDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(guid);
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
appendAttribWrapper(new AttribWrapper<RepeatQuestAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "repeat_quest#";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
67
ServerCommon/Doc/OwnerContents/RoomDoc.cs
Normal file
67
ServerCommon/Doc/OwnerContents/RoomDoc.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class RoomAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("room_id")] public int RoomId { get; set; }
|
||||
[JsonProperty("owner")] public string Owner { get; set; } = string.Empty;
|
||||
[JsonProperty("name")] public string Name { get; set; } = string.Empty;
|
||||
[JsonProperty("description")] public string Description { get; set; } = string.Empty;
|
||||
[JsonProperty("prop_info")] public Dictionary<string, AnchorProp> PropInfo = new();
|
||||
|
||||
public RoomAttrib()
|
||||
: base(typeof(RoomAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "room#owner_guid"
|
||||
// SK(Sort Key) : "room_id"
|
||||
// DocType : IndividualRoomDoc
|
||||
// RoomAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class RoomDoc : DynamoDbDocBase
|
||||
{
|
||||
public RoomDoc() : base(nameof(RoomDoc))
|
||||
{
|
||||
}
|
||||
|
||||
public RoomDoc(string owner_guid, int room_id) : base(nameof(RoomDoc))
|
||||
{
|
||||
onInit(owner_guid, room_id);
|
||||
}
|
||||
|
||||
public void onInit(string owner_guid, int room_id)
|
||||
{
|
||||
setCombinationKeyForPK(owner_guid);
|
||||
setCombinationKeyForSK(room_id.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<RoomAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "room#";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
74
ServerCommon/Doc/OwnerContents/SeasonPassDoc.cs
Normal file
74
ServerCommon/Doc/OwnerContents/SeasonPassDoc.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class SeasonPassAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public META_ID SeasonPassMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public UInt32 Exp { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public Int32 Grade { get; set; } = 0;
|
||||
|
||||
[JsonProperty]
|
||||
public List<Int32> takenRewards { get; set; } = new();
|
||||
|
||||
[JsonProperty]
|
||||
public bool IsChargedPass { get; set; } = false;
|
||||
|
||||
public SeasonPassAttrib()
|
||||
: base(typeof(SeasonPassAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "season_pass#owner_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : SeasonPassDoc
|
||||
// Attrib : SeasonPassAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class SeasonPassDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "season_pass#"; }
|
||||
|
||||
public SeasonPassDoc()
|
||||
: base(typeof(SeasonPassDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public SeasonPassDoc(string ownerGuid)
|
||||
: base(typeof(SeasonPassDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.SeasonPassDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<SeasonPassAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
99
ServerCommon/Doc/OwnerContents/SocialActionDoc.cs
Normal file
99
ServerCommon/Doc/OwnerContents/SocialActionDoc.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class SocialActionAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("social_action_meta_id")]
|
||||
public META_ID SocialActionMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("equiped_pos")]
|
||||
public UInt16 EquipedPos { get; set; } = 0;
|
||||
|
||||
public SocialActionAttrib()
|
||||
: base(typeof(SocialActionAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "social_action#owner_guid"
|
||||
// SK(Sort Key) : "social_action_meta_id"
|
||||
// DocType : SocialActionDoc
|
||||
// SocialActionAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class SocialActionDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "social_action#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public SocialActionDoc()
|
||||
: base(typeof(SocialActionDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public SocialActionDoc(OwnerEntityType ownerEntityType, string ownerGuid, META_ID socialActionMetaId)
|
||||
: base(typeof(SocialActionDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(socialActionMetaId.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var social_action_attrib = getAttrib<SocialActionAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(social_action_attrib, () => $"social_action_attrib is null !!!");
|
||||
|
||||
social_action_attrib.OwnerGuid = ownerGuid;
|
||||
social_action_attrib.OwnerEntityType = ownerEntityType;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<SocialActionAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
63
ServerCommon/Doc/OwnerContents/SwitchingPropDoc.cs
Normal file
63
ServerCommon/Doc/OwnerContents/SwitchingPropDoc.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class SwitchingPropAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("switching_props")]
|
||||
public ConcurrentDictionary<Int32,Int32> m_switching_props { get; set; } = new();
|
||||
|
||||
public SwitchingPropAttrib()
|
||||
: base(typeof(SwitchingPropAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "switching_prop#owner_guid"
|
||||
// SK(Sort Key) : empty
|
||||
// DocType : SwitchingPropDoc
|
||||
//=============================================================================================
|
||||
public class SwitchingPropDoc : DynamoDbDocBase
|
||||
{
|
||||
public SwitchingPropDoc() : base(typeof(SwitchingPropDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public SwitchingPropDoc(string guid) : base(typeof(SwitchingPropDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(guid);
|
||||
appendAttribWrapperAll();
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<SwitchingPropAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "switching_prop#";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
72
ServerCommon/Doc/OwnerContents/TaskReservationDoc.cs
Normal file
72
ServerCommon/Doc/OwnerContents/TaskReservationDoc.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using RESERVATION_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class TaskReservationAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public RESERVATION_GUID ReservationGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty]
|
||||
public TaskReservationActionType ReservationType { get; set; } = TaskReservationActionType.None;
|
||||
|
||||
[JsonProperty]
|
||||
public string JsonValue { get; set; } = string.Empty;
|
||||
|
||||
public TaskReservationAttrib()
|
||||
: base(typeof(TaskReservationAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "taskReservation#owner_guid"
|
||||
// SK(Sort Key) : "reservation_guid"
|
||||
// DocType : TaskReservationDoc
|
||||
// Attrib : TaskReservationAttrib
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class TaskReservationDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "taskReservation#"; }
|
||||
|
||||
public TaskReservationDoc()
|
||||
: base(typeof(TaskReservationDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public TaskReservationDoc(string ownerGuid, RESERVATION_GUID reservationGuid)
|
||||
: base(typeof(TaskReservationDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(ownerGuid, reservationGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<TaskReservationAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
115
ServerCommon/Doc/OwnerContents/ToolActionDoc.cs
Normal file
115
ServerCommon/Doc/OwnerContents/ToolActionDoc.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class ToolActionAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("item_guid")]
|
||||
public ITEM_GUID ItemGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("item_meta_id")]
|
||||
public META_ID ItemMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("step")]
|
||||
public Int32 Step { get; set; } = 0;
|
||||
|
||||
[JsonProperty("random_state")]
|
||||
public Int32 RandomState { get; set; } = 0;
|
||||
|
||||
[JsonProperty("action_start_date_time")]
|
||||
public Int64 ActionStartDateTime { get; set; } = 0;
|
||||
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
public ToolActionAttrib()
|
||||
: base(typeof(ToolActionAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "tool_action#owner_guid" [owner_guid : user_guid]
|
||||
// SK(Sort Key) : "tool_item_meta_id"
|
||||
// DocType : ToolActionDoc
|
||||
// ToolActionAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class ToolActionDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "tool_action#"; }
|
||||
private static string getPrefixOfSK() { return $""; }
|
||||
|
||||
public ToolActionDoc()
|
||||
: base(typeof(ToolActionDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public ToolActionDoc(OwnerEntityType owneEntityType, string ownerGuid, UInt32 toolItemMetaId)
|
||||
: base(typeof(ToolActionDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(toolItemMetaId.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var tool_action_attrib = getAttrib<ToolActionAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(tool_action_attrib, () => $"tool_action_attrib is null !!!");
|
||||
|
||||
tool_action_attrib.OwnerEntityType = owneEntityType;
|
||||
tool_action_attrib.OwnerGuid = ownerGuid;
|
||||
tool_action_attrib.ItemMetaId = toolItemMetaId;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<ToolActionAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
195
ServerCommon/Doc/OwnerContents/UgcNpcDoc.cs
Normal file
195
ServerCommon/Doc/OwnerContents/UgcNpcDoc.cs
Normal file
@@ -0,0 +1,195 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using UGC_NPC_META_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using ANCHOR_META_GUID = System.String;
|
||||
using LOCATED_INSTANCE_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class UgcNpcAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("ugc_npc_meta_guid")]
|
||||
public UGC_NPC_META_GUID UgcNpcMetaGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("nickname")]
|
||||
public string Nickname { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("title")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("greeting")]
|
||||
public string Greeting { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("introduction")]
|
||||
public string Introduction { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("Description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("WorldScenario")]
|
||||
public string WorldScenario { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("default_social_action_meta_id")]
|
||||
public META_ID DefaultSocialActionMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("habit_social_action_meta_ids")]
|
||||
public List<META_ID> HabitSocialActionMetaIds { get; set; } = new List<META_ID>();
|
||||
|
||||
[JsonProperty("dialogue_social_action_meta_ids")]
|
||||
public List<META_ID> DialogueSocialActionMetaIds { get; set; } = new List<META_ID>() { 110054 };
|
||||
|
||||
[JsonProperty("body_item_meta_id")]
|
||||
public META_ID BodyItemMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("hash_tag_meta_ids")]
|
||||
public List<META_ID> HashTagMetaIds { get; set; } = new List<META_ID>();
|
||||
|
||||
[JsonProperty("language_type")]
|
||||
public LanguageType LanguageType { get; set; } = LanguageType.None;
|
||||
|
||||
[JsonProperty("state")]
|
||||
public EntityStateType State { get; set; } = EntityStateType.None;
|
||||
|
||||
[JsonProperty("anchor_meta_guid")]
|
||||
public ANCHOR_META_GUID AnchorMetaGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("meat_id_of_entity_state_type")]
|
||||
public META_ID MetaIdOfEntityStateType { get; set; } = 0;
|
||||
|
||||
[JsonProperty("located_instance_guid")]
|
||||
public LOCATED_INSTANCE_GUID LocatedInstanceGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("located_instance_meta_id")]
|
||||
public META_ID LocatedInstanceMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("is_registered_ai_chat_server")]
|
||||
public bool IsRegisteredAiChatServer { get; set; } = false;
|
||||
|
||||
public UgcNpcAttrib()
|
||||
: base(typeof(UgcNpcAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "ugc_npc#owner_guid" [owner_guid : user_guid]
|
||||
// SK(Sort Key) : "ugc_npc_meta_guid"
|
||||
// DocType : UgcNpcDoc
|
||||
// UgcNpcAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class UgcNpcDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getDocTypeName() { return typeof(UgcNpcDoc).Name; }
|
||||
private static string getPrefixOfPK() { return "ugc_npc#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public UgcNpcDoc()
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public UgcNpcDoc(OwnerEntityType ownerEntityType, string ownerGuid, string ugcNpcMetaGuid)
|
||||
: base(getDocTypeName())
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(ugcNpcMetaGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var doc_ugc_npc_attrib = getAttrib<UgcNpcAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_ugc_npc_attrib, () => $"doc_ugc_npc_attrib is null !!!");
|
||||
|
||||
doc_ugc_npc_attrib.OwnerEntityType = ownerEntityType;
|
||||
doc_ugc_npc_attrib.OwnerGuid = ownerGuid;
|
||||
doc_ugc_npc_attrib.UgcNpcMetaGuid = ugcNpcMetaGuid;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<UgcNpcAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
public static async Task<(Result result, UgcNpcAttrib? attrib)> findUgcNpc(string ownerGuid, string ugqNpcMetaGuid)
|
||||
{
|
||||
var result = new Result();
|
||||
var ugc_npc_docs = new List<UgcNpcDoc>();
|
||||
|
||||
(result, var make_primary_key) = await DynamoDBDocBaseHelper.makePrimaryKey<UgcNpcDoc>(ownerGuid);
|
||||
if (result.isFail())
|
||||
{
|
||||
return (result, null);
|
||||
}
|
||||
NullReferenceCheckHelper.throwIfNull(make_primary_key, () => $"make_primary_key is null !!! - ownerGuid:{ownerGuid}, ugqNpcMetaGuid:{ugqNpcMetaGuid}");
|
||||
|
||||
var server_logic = ServerLogicApp.getServerLogicApp();
|
||||
var dynamo_db_client = server_logic.getDynamoDbClient();
|
||||
|
||||
var query_config = dynamo_db_client.makeQueryConfigForReadByPKSK(make_primary_key.PK, ugqNpcMetaGuid);
|
||||
|
||||
(result, ugc_npc_docs) = await dynamo_db_client.simpleQueryDocTypesWithQueryOperationConfig<UgcNpcDoc>(query_config);
|
||||
if (result.isFail())
|
||||
{
|
||||
var err_msg = $"Failed to simpleQueryDocTypesWithQueryOperationConfig() !!! : {result.toBasicString()} - ownerGuid:{ownerGuid}, ugqNpcMetaGuid:{ugqNpcMetaGuid}";
|
||||
Log.getLogger().error(err_msg);
|
||||
return (result, null);
|
||||
}
|
||||
if (0 >= ugc_npc_docs.Count)
|
||||
{
|
||||
var err_msg = $"ugc npc info not exist !!! ownerGuid:{ownerGuid}, ugqNpcMetaGuid:{ugqNpcMetaGuid}";
|
||||
result.setFail(ServerErrorCode.UgcNpcNotFound, err_msg);
|
||||
return (result, null);
|
||||
}
|
||||
|
||||
var ugc_npc_attrib = ugc_npc_docs[0].getAttrib<UgcNpcAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(ugc_npc_attrib, () => $"ugc_npc_attrib is null !!! - ownerGuid:{ownerGuid}, ugqNpcMetaGuid:{ugqNpcMetaGuid}");
|
||||
|
||||
return (result, ugc_npc_attrib);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
127
ServerCommon/Doc/OwnerContents/UgcNpcLikeSelectedFlagDoc.cs
Normal file
127
ServerCommon/Doc/OwnerContents/UgcNpcLikeSelectedFlagDoc.cs
Normal file
@@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using UGC_NPC_META_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class UgcNpcLikeSelectedFlagAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("ugc_npc_meta_guid")]
|
||||
public UGC_NPC_META_GUID UgcNpcMetaGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("is_selected_flag")]
|
||||
public bool IsSelectedFlag { get; set; } = false;
|
||||
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("last_check_date")] public DateTime LastCheckDate { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
public UgcNpcLikeSelectedFlagAttrib()
|
||||
: base(typeof(UgcNpcLikeSelectedFlagAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "ugc_npc_like_selected_flag#owner_guid" [owner_guid : user_guid]
|
||||
// SK(Sort Key) : "ugc_npc_meta_guid"
|
||||
// DocType : UgcNpcLikeSelectedFlagDoc
|
||||
// ItemAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class UgcNpcLikeSelectedFlagDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "ugc_npc_like_selected_flag#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public UgcNpcLikeSelectedFlagDoc()
|
||||
: base(typeof(UgcNpcLikeSelectedFlagDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public UgcNpcLikeSelectedFlagDoc(OwnerEntityType ownerEntityType, string ownerGuid, UGC_NPC_META_GUID ugcNpcMetaGuid)
|
||||
: base(typeof(UgcNpcLikeSelectedFlagDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(ugcNpcMetaGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var doc_ugc_npc_like_selected_flag_attrib = getAttrib<UgcNpcLikeSelectedFlagAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_ugc_npc_like_selected_flag_attrib, () => $"doc_ugc_npc_like_selected_flag_attrib is null !!! - ownerGuid:{ownerGuid}, ownerEntityType:{ownerEntityType}");
|
||||
|
||||
doc_ugc_npc_like_selected_flag_attrib.OwnerGuid = ownerGuid;
|
||||
doc_ugc_npc_like_selected_flag_attrib.OwnerEntityType = ownerEntityType;
|
||||
doc_ugc_npc_like_selected_flag_attrib.UgcNpcMetaGuid = ugcNpcMetaGuid;
|
||||
}
|
||||
|
||||
public UgcNpcLikeSelectedFlagDoc(OwnerEntityType ownerEntityType, string ownerGuid, UGC_NPC_META_GUID ugcNpcMetaGuid, bool isSelectedFlag)
|
||||
: base(typeof(UgcNpcLikeSelectedFlagDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(ugcNpcMetaGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var doc_ugc_npc_like_selected_flag_attrib = getAttrib<UgcNpcLikeSelectedFlagAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_ugc_npc_like_selected_flag_attrib, () => $"doc_ugc_npc_like_selected_flag_attrib is null !!! - ownerGuid:{ownerGuid}, ownerEntityType:{ownerEntityType}");
|
||||
|
||||
doc_ugc_npc_like_selected_flag_attrib.OwnerGuid = ownerGuid;
|
||||
doc_ugc_npc_like_selected_flag_attrib.OwnerEntityType = ownerEntityType;
|
||||
doc_ugc_npc_like_selected_flag_attrib.UgcNpcMetaGuid = ugcNpcMetaGuid;
|
||||
doc_ugc_npc_like_selected_flag_attrib.IsSelectedFlag = isSelectedFlag;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<UgcNpcLikeSelectedFlagAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
97
ServerCommon/Doc/OwnerContents/UgcNpcLikeSelecteeCountDoc.cs
Normal file
97
ServerCommon/Doc/OwnerContents/UgcNpcLikeSelecteeCountDoc.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using UGC_NPC_META_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class UgcNpcLikeSelecteeCountAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
[JsonProperty("like_count")]
|
||||
public Int32 LikeCount { get; set; } = 0;
|
||||
|
||||
public UgcNpcLikeSelecteeCountAttrib()
|
||||
: base(typeof(UgcNpcLikeSelecteeCountAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "ugc_npc_like_selectee_count#owner_guid" [owner_guid : ugc_npc_meta_guid]
|
||||
// SK(Sort Key) : "empty"
|
||||
// DocType : UgcNpcLikeCountDoc
|
||||
// ItemAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class UgcNpcLikeSelecteeCountDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "ugc_npc_like_selectee_count#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public UgcNpcLikeSelecteeCountDoc()
|
||||
: base(typeof(UgcNpcLikeSelecteeCountDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public UgcNpcLikeSelecteeCountDoc(OwnerEntityType ownerEntityType, string ownerGuid)
|
||||
: base(typeof(UgcNpcLikeSelecteeCountDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var doc_ugc_npc_like_selectee_count_attrib = getAttrib<UgcNpcLikeSelecteeCountAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_ugc_npc_like_selectee_count_attrib, () => $"doc_ugc_npc_like_selectee_count_attrib is null !!! - ownerGuid:{ownerGuid}, ownerEntityType:{ownerEntityType}");
|
||||
|
||||
setQueryType(QueryType.Insert);
|
||||
|
||||
doc_ugc_npc_like_selectee_count_attrib.OwnerGuid = ownerGuid;
|
||||
doc_ugc_npc_like_selectee_count_attrib.OwnerEntityType = ownerEntityType;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<UgcNpcLikeSelecteeCountAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
}
|
||||
142
ServerCommon/Doc/OwnerContents/UgcNpcNicknameRegistryDoc.cs
Normal file
142
ServerCommon/Doc/OwnerContents/UgcNpcNicknameRegistryDoc.cs
Normal file
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using UGC_NPC_META_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class UgcNpcNicknameRegistryAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("nickname")]
|
||||
public string Nickname { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("ugc_npc_meta_guid")]
|
||||
public UGC_NPC_META_GUID UgcNpcMetaGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_guid")]
|
||||
public OWNER_GUID OwnerGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("owner_entity_type")]
|
||||
public OwnerEntityType OwnerEntityType { get; set; } = OwnerEntityType.None;
|
||||
|
||||
public UgcNpcNicknameRegistryAttrib()
|
||||
: base(typeof(UgcNpcNicknameRegistryAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "ugc_npc_nickname_registry#owner_guid" [owner_guid : user_guid]
|
||||
// SK(Sort Key) : "ugc_npc_nickname"
|
||||
// DocType : UgcNpcNicknameRegistryDoc
|
||||
// UgcNpcNicknameRegistryAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class UgcNpcNicknameRegistryDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "ugc_npc_nickname_registry#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public UgcNpcNicknameRegistryDoc()
|
||||
: base(typeof(UgcNpcNicknameRegistryDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public UgcNpcNicknameRegistryDoc(OwnerEntityType ownerEntityType, OWNER_GUID ownerGuid, string ugcNpcNickname, UGC_NPC_META_GUID ugcNpcMetaGuid)
|
||||
: base(typeof(UgcNpcNicknameRegistryDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(ownerGuid);
|
||||
setCombinationKeyForSK(ugcNpcNickname);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var doc_ugc_npc_nickname_registry_attrib = getAttrib<UgcNpcNicknameRegistryAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(doc_ugc_npc_nickname_registry_attrib, () => $"doc_ugc_npc_nickname_registry_attrib is null !!! - ugcNpcNickname:{ugcNpcNickname}, ugcNpcMetaGuid:{ugcNpcMetaGuid}, ownerGuid:{ownerGuid}");
|
||||
|
||||
doc_ugc_npc_nickname_registry_attrib.Nickname = ugcNpcNickname;
|
||||
doc_ugc_npc_nickname_registry_attrib.UgcNpcMetaGuid = ugcNpcMetaGuid;
|
||||
doc_ugc_npc_nickname_registry_attrib.OwnerEntityType = ownerEntityType;
|
||||
doc_ugc_npc_nickname_registry_attrib.OwnerGuid = ownerGuid;
|
||||
|
||||
setQueryType(QueryType.Insert);
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.UgcNpcNicknameDuplicated));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<UgcNpcNicknameRegistryAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
|
||||
}
|
||||
public static async Task<(Result, UgcNpcNicknameRegistryAttrib?)> findNickname(OWNER_GUID ownerGuid, string toCheckNickname)
|
||||
{
|
||||
var result = new Result();
|
||||
|
||||
var server_logic = ServerLogicApp.getServerLogicApp();
|
||||
var dynamo_db_client = server_logic.getDynamoDbClient();
|
||||
|
||||
(result, var make_primary_key) = await DynamoDBDocBaseHelper.makePrimaryKey<UgcNpcNicknameRegistryDoc>(ownerGuid, toCheckNickname);
|
||||
if(result.isFail())
|
||||
{
|
||||
return (result, null);
|
||||
}
|
||||
NullReferenceCheckHelper.throwIfNull(make_primary_key, () => $"make_primary_key is null !!! - toCheckNickname:{toCheckNickname}, ownerGuid:{ownerGuid}");
|
||||
var query_config = dynamo_db_client.makeQueryConfigForReadByPKSK(make_primary_key.PK, make_primary_key.SK);
|
||||
|
||||
(result, var found_nicknames) = await dynamo_db_client.simpleQueryDocTypesWithQueryOperationConfig<UgcNpcNicknameRegistryDoc>(query_config);
|
||||
if (result.isFail())
|
||||
{
|
||||
return (result, null);
|
||||
}
|
||||
|
||||
if(found_nicknames.Count == 0)
|
||||
{
|
||||
result.setFail(ServerErrorCode.TargetUserNotFound);
|
||||
return (result, null);
|
||||
}
|
||||
|
||||
var nickname_attrib = found_nicknames[0].getAttrib<UgcNpcNicknameRegistryAttrib>();
|
||||
if (nickname_attrib == null)
|
||||
{
|
||||
result.setFail(ServerErrorCode.AttribNotFound);
|
||||
return (result, null);
|
||||
}
|
||||
|
||||
return (result, nickname_attrib);
|
||||
}
|
||||
}
|
||||
66
ServerCommon/Doc/OwnerContents/UgqDailyRewardCountDoc.cs
Normal file
66
ServerCommon/Doc/OwnerContents/UgqDailyRewardCountDoc.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class UgqDailyRewardCountAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("daily_reward_count")]
|
||||
public Dictionary<UgqGradeType, Int32> m_ugq_daily_reward_count { get; set; } = new();
|
||||
|
||||
[JsonProperty("next_refresh_time")]
|
||||
public DateTime m_next_refresh_time { get; set; } = DateTime.Now;
|
||||
|
||||
public UgqDailyRewardCountAttrib()
|
||||
: base(typeof(UgqDailyRewardCountAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "ugq_daily_reward_count#owner_guid"
|
||||
// SK(Sort Key) :
|
||||
// DocType : UgqDailyRewardCountDoc
|
||||
//=============================================================================================
|
||||
|
||||
public class UgqDailyRewardCountDoc : DynamoDbDocBase
|
||||
{
|
||||
public UgqDailyRewardCountDoc()
|
||||
: base(typeof(UgqDailyRewardCountDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public UgqDailyRewardCountDoc(string guid)
|
||||
: base(typeof(UgqDailyRewardCountDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(guid);
|
||||
appendAttribWrapperAll();
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<UgqDailyRewardCountAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "ugq_daily_reward_count#";
|
||||
}
|
||||
|
||||
protected override string onMakePK()
|
||||
{
|
||||
return $"{onGetPrefixOfPK()}{getCombinationKeyForPK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetPK(string pk)
|
||||
{
|
||||
getPrimaryKey().fillUpPK(pk);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
94
ServerCommon/Doc/OwnerContents/UserReportDoc.cs
Normal file
94
ServerCommon/Doc/OwnerContents/UserReportDoc.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class UserReportAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public string ReporterGuid = string.Empty;
|
||||
[JsonProperty]
|
||||
public string ReporterNickName = string.Empty;
|
||||
[JsonProperty]
|
||||
public string TargetGuid = string.Empty;
|
||||
[JsonProperty]
|
||||
public string TargetNickName = string.Empty;
|
||||
[JsonProperty]
|
||||
public string Reason = string.Empty;
|
||||
[JsonProperty]
|
||||
public string Title = string.Empty;
|
||||
[JsonProperty]
|
||||
public string Detail = string.Empty;
|
||||
[JsonProperty]
|
||||
public int State = 0;
|
||||
[JsonProperty]
|
||||
public DateTime CreateTime = new();
|
||||
[JsonProperty]
|
||||
public DateTime ResolutionTime = new();
|
||||
|
||||
public UserReportAttrib()
|
||||
: base(typeof(UserReportAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "management_user_report#owner_guid"
|
||||
// SK(Sort Key) : "date"
|
||||
// DocType : UserReportDoc
|
||||
// UserReportAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class UserReportDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "management_user_report#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public UserReportDoc()
|
||||
: base(typeof(UserReportDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public UserReportDoc(string ownerGuid, string date)
|
||||
: base(typeof(UserReportDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPKSK(ownerGuid, date);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.UserReportDocException));
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<UserReportAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
56
ServerCommon/Doc/UserBase/CaliumDoc.cs
Normal file
56
ServerCommon/Doc/UserBase/CaliumDoc.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
using USER_GUID = System.String;
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class CaliumAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("daily_calium")]
|
||||
[JsonConverter(typeof(StringToDoubleEpsilonRoundConverter))]
|
||||
public double DailyCalium { get; set; } = 0.0;
|
||||
|
||||
[JsonProperty("provided_date")]
|
||||
public DateTime ProvidedDate { get; set; } = DateTimeHelper.MinTime;
|
||||
|
||||
public CaliumAttrib() : base(nameof(CaliumAttrib), false) {}
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "calium#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : CaliumDoc
|
||||
// CaliumAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CaliumDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "calium#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public CaliumDoc() : base(nameof(CaliumDoc))
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CaliumDoc(USER_GUID userGuid) : base(nameof(CaliumDoc))
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
appendAttribWrapperAll();
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CaliumAttrib>());
|
||||
}
|
||||
}
|
||||
142
ServerCommon/Doc/UserBase/CharacterBaseDoc.cs
Normal file
142
ServerCommon/Doc/UserBase/CharacterBaseDoc.cs
Normal file
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class CharacterBaseAttrib : AttribBase
|
||||
{
|
||||
public class AppearanceProfile
|
||||
{
|
||||
[JsonProperty("basic_style")]
|
||||
public UInt32 BasicStyle { get; set; } = 0;
|
||||
|
||||
[JsonProperty("body_shape")]
|
||||
public UInt32 BodyShape { get; set; } = 0;
|
||||
|
||||
[JsonProperty("hair_style")]
|
||||
public UInt32 HairStyle { get; set; } = 0;
|
||||
|
||||
[JsonProperty("custom_values")]
|
||||
public List<int> CustomValues { get; set; } = new();
|
||||
|
||||
[JsonProperty("is_custom_completed")]
|
||||
public bool IsCustomCompleted { get; set; } = false;
|
||||
|
||||
public void reset()
|
||||
{
|
||||
BasicStyle = 0;
|
||||
BodyShape = 0;
|
||||
HairStyle = 0;
|
||||
CustomValues.Clear();
|
||||
IsCustomCompleted = false;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
var clone = new AppearanceProfile();
|
||||
clone.BasicStyle = BasicStyle;
|
||||
clone.BodyShape = BodyShape;
|
||||
clone.HairStyle = HairStyle;
|
||||
clone.CustomValues = CustomValues.Select(x => x).ToList();
|
||||
clone.IsCustomCompleted = IsCustomCompleted;
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
public void copyFromAppearanceProfile(CharacterAttribute.AppearanceProfile attribute)
|
||||
{
|
||||
BasicStyle = attribute.BasicStyle;
|
||||
BodyShape = attribute.BodyShape;
|
||||
HairStyle = attribute.HairStyle;
|
||||
CustomValues = attribute.CustomValues.Select(x => x).ToList();
|
||||
IsCustomCompleted = attribute.IsCustomCompleted;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("character_guid")]
|
||||
public CHARACTER_GUID CharacterGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("user_guid")]
|
||||
public USER_GUID UserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("state_info")]
|
||||
public EntityStateInfo StateInfo { get; set; } = new EntityStateInfo();
|
||||
|
||||
[JsonProperty("appearance_profile")]
|
||||
public AppearanceProfile ApperanceProfileValue { get; set; } = new();
|
||||
|
||||
|
||||
public CharacterBaseAttrib()
|
||||
: base(typeof(CharacterBaseAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "character_base#user_guid"
|
||||
// SK(Sort Key) : "character_guid"
|
||||
// CharacterBaseAttrib :
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class CharacterBaseDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "character_base#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public CharacterBaseDoc()
|
||||
: base(typeof(CharacterBaseDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public CharacterBaseDoc(USER_GUID userGuid, CHARACTER_GUID characterGuid)
|
||||
: base(typeof(CharacterBaseDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(characterGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<CharacterBaseAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
81
ServerCommon/Doc/UserBase/ItemFirstPurchaseHistoryDoc.cs
Normal file
81
ServerCommon/Doc/UserBase/ItemFirstPurchaseHistoryDoc.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
using OWNER_GUID = System.String;
|
||||
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class ItemFirstPurchaseHistoryAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("item_meta_id")]
|
||||
public META_ID ItemMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("first_purchase_time")]
|
||||
public DateTime FirstPurchaseTime { get; set; } = new();
|
||||
|
||||
public ItemFirstPurchaseHistoryAttrib()
|
||||
: base(typeof(ItemFirstPurchaseHistoryAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "item_first_purchase_history#user_guid"
|
||||
// SK(Sort Key) : "item_meta_id"
|
||||
// DocType : ItemFirstPurchaseHistoryDoc
|
||||
// ItemFirstPurchaseHistoryAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class ItemFirstPurchaseHistoryDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "item_first_purchase_history#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public ItemFirstPurchaseHistoryDoc()
|
||||
: base(typeof(ItemFirstPurchaseHistoryDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public ItemFirstPurchaseHistoryDoc(string userGuid, META_ID socialActionMetaId)
|
||||
: base(typeof(ItemFirstPurchaseHistoryDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(socialActionMetaId.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<ItemFirstPurchaseHistoryAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
147
ServerCommon/Doc/UserBase/LandAuctionRefundBidPriceDoc.cs
Normal file
147
ServerCommon/Doc/UserBase/LandAuctionRefundBidPriceDoc.cs
Normal file
@@ -0,0 +1,147 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Amazon.DynamoDBv2;
|
||||
using Amazon.DynamoDBv2.Model;
|
||||
using Amazon.DynamoDBv2.DocumentModel;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using WORLD_ID = System.UInt32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class LandAuctionRefundBidPriceAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("land_meta_id")]
|
||||
public META_ID LandMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("auction_number")]
|
||||
public Int32 AuctionNumber { get; set; } = 0;
|
||||
|
||||
[JsonProperty("bid_user_guid")]
|
||||
public USER_GUID BidUserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("last_bid_type")]
|
||||
public LandAuctionBidType LastBidType { get; set; } = LandAuctionBidType.None; // 마지막 입찰의 종류
|
||||
|
||||
[JsonProperty("bid_currency_type")]
|
||||
public CurrencyType BidCurrencyType { get; set; } = CurrencyType.None;
|
||||
|
||||
[JsonProperty("last_bid_price")]
|
||||
public double LastBidPrice { get; set; } = 0; // 마지막 입찰금
|
||||
|
||||
[JsonProperty("refundable_normal_bid_price")]
|
||||
public double RefundableNormalBidPrice { get; set; } = 0; // 본인의 일반 환급 가능한 입찰금
|
||||
|
||||
[JsonProperty("refundable_blind_bid_price")]
|
||||
public double RefundableBlindBidPrice { get; set; } = 0; // 본인의 블라인드 환급 가능한 입찰금
|
||||
|
||||
public LandAuctionRefundBidPriceAttrib()
|
||||
: base(typeof(LandAuctionRefundBidPriceAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// Desc : 랜드 경매별 환급 입찰 비용
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "land_auction_refund_bid_price#{user_guid}"
|
||||
// SK(Sort Key) : "{land_meta_id}#{auction_number}"
|
||||
// UserBaseAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class LandAuctionRefundBidPriceDoc : DynamoDbDocBase, ICopyDocFromEntityAttribute
|
||||
{
|
||||
private static string getPrefixOfPK() { return "land_auction_refund_bid_price#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public LandAuctionRefundBidPriceDoc()
|
||||
: base(typeof(LandAuctionRefundBidPriceDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public LandAuctionRefundBidPriceDoc( USER_GUID bidUserGuid, META_ID landMetaId, Int32 auctionNumber )
|
||||
: base(typeof(LandAuctionRefundBidPriceDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(bidUserGuid);
|
||||
setCombinationKeyForSK(makeCombinationKeyForSK(landMetaId, auctionNumber));
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
|
||||
var refund_bid_price_attrib = getAttrib<LandAuctionRefundBidPriceAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(refund_bid_price_attrib, () => $"refund_bid_price_attrib is null !!!");
|
||||
|
||||
refund_bid_price_attrib.BidUserGuid = bidUserGuid;
|
||||
refund_bid_price_attrib.LandMetaId = landMetaId;
|
||||
refund_bid_price_attrib.AuctionNumber = auctionNumber;
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<LandAuctionRefundBidPriceAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
|
||||
// override ICopyDocFromEntityAttribute
|
||||
public bool copyDocFromEntityAttribute(EntityAttributeBase entityAttributeBase)
|
||||
{
|
||||
var refund_bid_price_attribute = entityAttributeBase as LandAuctionRefundBidPriceAttribute;
|
||||
if (null == refund_bid_price_attribute)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var refund_bid_price_attrib = getAttrib<LandAuctionRefundBidPriceAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(refund_bid_price_attrib, () => $"refund_bid_price_attrib is null !!! - {toBasicString()}");
|
||||
|
||||
refund_bid_price_attrib.BidUserGuid = refund_bid_price_attribute.BidUserGuid;
|
||||
refund_bid_price_attrib.LandMetaId = refund_bid_price_attribute.LandMetaId;
|
||||
refund_bid_price_attrib.AuctionNumber = refund_bid_price_attribute.AuctionNumber;
|
||||
|
||||
refund_bid_price_attrib.LastBidType = refund_bid_price_attribute.LastBidType;
|
||||
refund_bid_price_attrib.BidCurrencyType = refund_bid_price_attribute.BidCurrencyType;
|
||||
refund_bid_price_attrib.LastBidPrice = refund_bid_price_attribute.LastBidPrice;
|
||||
|
||||
refund_bid_price_attrib.RefundableNormalBidPrice = refund_bid_price_attribute.RefundableNormalBidPrice;
|
||||
refund_bid_price_attrib.RefundableBlindBidPrice = refund_bid_price_attribute.RefundableBlindBidPrice;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static string makeCombinationKeyForSK(META_ID landMetaId, Int32 auctionNumber)
|
||||
{
|
||||
return $"{landMetaId}#{auctionNumber}";
|
||||
}
|
||||
}
|
||||
103
ServerCommon/Doc/UserBase/LocationDoc.cs
Normal file
103
ServerCommon/Doc/UserBase/LocationDoc.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Numerics;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class BaseLoaction
|
||||
{
|
||||
[JsonProperty]
|
||||
public Vector3 SpawnPos { get; set; } = Vector3.Zero;
|
||||
|
||||
[JsonProperty]
|
||||
public float ForwardAngle { get; set; } = 0.0f;
|
||||
}
|
||||
|
||||
public class ChannelServerLocation : BaseLoaction
|
||||
{
|
||||
[JsonProperty]
|
||||
public string ServerName { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty]
|
||||
public int WorldMetaId { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class IndunLocation : BaseLoaction
|
||||
{
|
||||
[JsonProperty]
|
||||
public string InstanceRoomId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty]
|
||||
public int InstanceMetaId { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class LocationAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public ChannelServerLocation LastConnectedChannelServerLocation { get; set; } = new();
|
||||
|
||||
[JsonProperty]
|
||||
public IndunLocation ReJoinIndunLocation { get; set; } = new();
|
||||
|
||||
public LocationAttrib()
|
||||
: base(typeof(LocationAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "location#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : LocationDoc
|
||||
// LocationAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class LocationDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "location#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public LocationDoc()
|
||||
: base(typeof(LocationDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public LocationDoc(string userGuid)
|
||||
: base(typeof(LocationDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<LocationAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
}
|
||||
82
ServerCommon/Doc/UserBase/MinimapMarkerDoc.cs
Normal file
82
ServerCommon/Doc/UserBase/MinimapMarkerDoc.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
using OWNER_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class MinimapMarkerAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("world_meta_id")]
|
||||
public META_ID WorldMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("marker_pos")]
|
||||
public Vector3 MarkerPos { get; set; } = new();
|
||||
|
||||
public MinimapMarkerAttrib()
|
||||
: base(typeof(MinimapMarkerAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "minimap_marker#user_guid"
|
||||
// SK(Sort Key) : "world_meta_id"
|
||||
// DocType : MinimapMarkerDoc
|
||||
// MinimapMarkerAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class MinimapMarkerDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "minimap_marker#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public MinimapMarkerDoc()
|
||||
: base(typeof(MinimapMarkerDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public MinimapMarkerDoc(string userGuid, META_ID worldMetaId)
|
||||
: base(typeof(MinimapMarkerDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(worldMetaId.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<MinimapMarkerAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
83
ServerCommon/Doc/UserBase/MyHomeDoc.cs
Normal file
83
ServerCommon/Doc/UserBase/MyHomeDoc.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ServerCore; using ServerBase;
|
||||
using META_ID = System.UInt32;
|
||||
using OWNER_GUID = System.String;
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class MyHomeAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("myhome_guid")]
|
||||
public string MyhomeGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("myhome_meta_id")]
|
||||
public META_ID MyHomeMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("myhome_name")]
|
||||
public string MyhomeName { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("selected_flag")]
|
||||
public UInt16 SelectedFlag { get; set; } = 0;
|
||||
|
||||
[JsonProperty("myhome_ugc_info_s3_key")]
|
||||
public string MyhomeUgcInfoS3FileName { get; set; } = string.Empty;
|
||||
|
||||
public MyHomeAttrib()
|
||||
: base(typeof(MyHomeAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "my_home#user_guid"
|
||||
// SK(Sort Key) : "my_home_guid"
|
||||
// DocType : MyHomeDoc
|
||||
// MyHomeAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class MyhomeDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "my_home#"; }
|
||||
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
public MyhomeDoc()
|
||||
: base(typeof(MyhomeDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public MyhomeDoc(string userGuid, string myhomeGuid)
|
||||
: base(typeof(MyhomeDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(myhomeGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<MyHomeAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
72
ServerCommon/Doc/UserBase/OwnedBuildingDoc.cs
Normal file
72
ServerCommon/Doc/UserBase/OwnedBuildingDoc.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class OwnedBuildingAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("building_meta_id")]
|
||||
public META_ID BuildingMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("owned_type")]
|
||||
public OwnedType OwnedType { get; set; } = OwnedType.None;
|
||||
|
||||
public OwnedBuildingAttrib()
|
||||
: base(typeof(OwnedBuildingAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "owned_building#user_guid"
|
||||
// SK(Sort Key) : "building_meta_id"
|
||||
// DocType : OwnedBuildingDoc
|
||||
// OwnedBuildingAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class OwnedBuildingDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "owned_building#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public OwnedBuildingDoc()
|
||||
: base(typeof(OwnedBuildingDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public OwnedBuildingDoc(string userGuid, META_ID buildingMetaId)
|
||||
: base(typeof(OwnedBuildingDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(buildingMetaId.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<OwnedBuildingAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
72
ServerCommon/Doc/UserBase/OwnedLandDoc.cs
Normal file
72
ServerCommon/Doc/UserBase/OwnedLandDoc.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
|
||||
|
||||
using META_ID = System.UInt32;
|
||||
|
||||
|
||||
namespace ServerCommon;
|
||||
|
||||
public class OwnedLandAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("land_meta_id")]
|
||||
public META_ID LandMetaId { get; set; } = 0;
|
||||
|
||||
[JsonProperty("owned_type")]
|
||||
public OwnedType OwnedType { get; set; } = OwnedType.None;
|
||||
|
||||
public OwnedLandAttrib()
|
||||
: base(typeof(OwnedLandAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "owned_land#user_guid"
|
||||
// SK(Sort Key) : "land_meta_id"
|
||||
// DocType : OwnedLandDoc
|
||||
// OwnedLandAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class OwnedLandDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "owned_land#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public OwnedLandDoc()
|
||||
: base(typeof(OwnedLandDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public OwnedLandDoc(string userGuid, META_ID landMetaId)
|
||||
: base(typeof(OwnedLandDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(landMetaId.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<OwnedLandAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
104
ServerCommon/Doc/UserBase/RentalDoc.cs
Normal file
104
ServerCommon/Doc/UserBase/RentalDoc.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
using Newtonsoft.Json;
|
||||
using ServerCore; using ServerBase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using OWNER_GUID = System.String;
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class RentalAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("land_meta_id")]
|
||||
public int LandMetaId { get; set; }
|
||||
|
||||
[JsonProperty("building_meta_id")]
|
||||
public int BuildingMetaId { get; set; }
|
||||
|
||||
[JsonProperty("floor")]
|
||||
public int Floor { get; set; }
|
||||
|
||||
[JsonProperty("myhome_guid")]
|
||||
public string MyhomeGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("rental_finish_time")]
|
||||
public DateTime RentalFinishTime { get; set; } = new();
|
||||
|
||||
public RentalAttrib()
|
||||
: base(typeof(RentalAttrib).Name, false)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "rental#user_guid"
|
||||
// SK(Sort Key) : "address#landId#buidlingId#floor"
|
||||
// DocType : RentalDoc
|
||||
// RentalAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class RentalDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "rental#"; }
|
||||
|
||||
private static string getPrefixOfSK() { return "address#"; }
|
||||
public RentalDoc()
|
||||
: base(typeof(RentalDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public RentalDoc(string userGuid, string address)
|
||||
: base(typeof(RentalDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(address);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
public RentalDoc(string userGuid, string address, long ttlSeconds)
|
||||
: base(typeof(RentalDoc).Name, ttlSeconds)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(address);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<RentalAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfSK()
|
||||
{
|
||||
return getPrefixOfSK();
|
||||
}
|
||||
|
||||
protected override string onMakeSK()
|
||||
{
|
||||
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
92
ServerCommon/Doc/UserBase/ShopProductTradingMeterDoc.cs
Normal file
92
ServerCommon/Doc/UserBase/ShopProductTradingMeterDoc.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Newtonsoft.Json;
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
using USER_GUID = System.String;
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class ShopProductTradingMeterSubAttrib
|
||||
{
|
||||
[JsonProperty("product_id")]
|
||||
public int ProductId { get; set; }
|
||||
|
||||
[JsonProperty("left_count")]
|
||||
public double LeftCount { get; set; }
|
||||
}
|
||||
|
||||
public class ShopProductTradingMeterAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("shop_id")]
|
||||
public int ShopId { get; set; }
|
||||
|
||||
[JsonProperty("shop_product_trading_meter_subs")]
|
||||
public List<ShopProductTradingMeterSubAttrib> ShopProductTradingMeterSubs { get; set; }= new();
|
||||
|
||||
[JsonProperty("end_time")]
|
||||
public Timestamp EndTime { get; set; } = DateTimeHelper.MinTime.ToTimestamp();
|
||||
|
||||
[JsonProperty("current_renewal_count")]
|
||||
public Int32 CurrentRenewalCount { get; set; } = 0;
|
||||
|
||||
public void onClear()
|
||||
{
|
||||
ShopId = 0;
|
||||
EndTime = DateTimeHelper.MinTime.ToTimestamp();
|
||||
CurrentRenewalCount = 0;
|
||||
ShopProductTradingMeterSubs.Clear();
|
||||
}
|
||||
|
||||
public ShopProductTradingMeterAttrib()
|
||||
: base(typeof(ShopProductTradingMeterAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "shop_product_trading_meter#user_guid"
|
||||
// SK(Sort Key) : "shop_id"
|
||||
// DocType : ShopProductTradingMeterDoc
|
||||
// ShopProductTradingMeterAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class ShopProductTradingMeterDoc : DynamoDbDocBase
|
||||
{
|
||||
public ShopProductTradingMeterDoc() : base(nameof(ShopProductTradingMeterDoc))
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public ShopProductTradingMeterDoc(USER_GUID userGuid, int shop_id) : base(nameof(ShopProductTradingMeterDoc))
|
||||
{
|
||||
onCustomCreate(userGuid, shop_id);
|
||||
}
|
||||
|
||||
private void onCustomCreate(USER_GUID userGuid, int shop_id)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
setCombinationKeyForSK(shop_id.ToString());
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<ShopProductTradingMeterAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return "shop_product_trading_meter#";
|
||||
}
|
||||
|
||||
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
||||
{
|
||||
getPrimaryKey().fillUpSK(sortKey);
|
||||
setCombinationKeyForSK(sortKey);
|
||||
|
||||
return ServerErrorCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
ServerCommon/Doc/UserBase/UserBaseDoc.cs
Normal file
120
ServerCommon/Doc/UserBase/UserBaseDoc.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Amazon.DynamoDBv2;
|
||||
using Amazon.DynamoDBv2.Model;
|
||||
using Amazon.DynamoDBv2.DocumentModel;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using WORLD_ID = System.UInt32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class UserBaseAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("user_guid")]
|
||||
public USER_GUID UserGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("account_id")]
|
||||
public ACCOUNT_ID AccountId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("eoa")]
|
||||
public string EOA { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("selected_character_guid")]
|
||||
public CHARACTER_GUID SelectedCharacterGuid { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("is_intro_completed")]
|
||||
public bool IsIntroCompleted { get; set; } = false;
|
||||
|
||||
[JsonProperty("game_login_datetime")]
|
||||
public DateTime GameLoginDateTime = DateTime.MinValue;
|
||||
|
||||
[JsonProperty("game_logout_datetime")]
|
||||
public DateTime GameLogoutDateTime = DateTime.MinValue;
|
||||
|
||||
public UserBaseAttrib()
|
||||
: base(typeof(UserBaseAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================================
|
||||
// Primary Key
|
||||
// PK(Partition Key) : "user_base#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// UserBaseAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class UserBaseDoc : DynamoDbDocBase, ICopyDocFromEntityAttribute
|
||||
{
|
||||
private static string getPrefixOfPK() { return "user_base#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public UserBaseDoc()
|
||||
: base(typeof(UserBaseDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public UserBaseDoc(USER_GUID userGuid)
|
||||
: base(typeof(UserBaseDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<UserBaseAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
|
||||
// override ICopyDocFromEntityAttribute
|
||||
public bool copyDocFromEntityAttribute(EntityAttributeBase entityAttributeBase)
|
||||
{
|
||||
var user_attribute = entityAttributeBase as UserAttribute;
|
||||
if (null == user_attribute)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var user_base_attrib = getAttrib<UserBaseAttrib>();
|
||||
NullReferenceCheckHelper.throwIfNull(user_base_attrib, () => $"user_base_attrib is null !!! - {toBasicString()}");
|
||||
|
||||
user_base_attrib.UserGuid = user_attribute.UserGuid;
|
||||
user_base_attrib.AccountId = user_attribute.AccountId;
|
||||
user_base_attrib.EOA = user_attribute.EOA;
|
||||
user_base_attrib.SelectedCharacterGuid = user_attribute.SelectedCharacterGuid;
|
||||
user_base_attrib.IsIntroCompleted = user_attribute.IsIntroCompleted;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
71
ServerCommon/Doc/UserBase/UserContentsSettingDoc.cs
Normal file
71
ServerCommon/Doc/UserBase/UserContentsSettingDoc.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
using OWNER_GUID = System.String;
|
||||
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class UserContentsSettingAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty("myhome_slot_open_count")]
|
||||
public int MyhomeSlotOpenCount { get; set; } = 0;
|
||||
|
||||
[JsonProperty("beacon_app_profile_upload_time")]
|
||||
public DateTime BeaconAppProfileUploadTime { get; set; } = new();
|
||||
|
||||
public UserContentsSettingAttrib()
|
||||
: base(typeof(UserContentsSettingAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "user_contents_setting#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : UserContentsSettingDoc
|
||||
// UserContentsSettingAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
|
||||
public class UserContentsSettingDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "user_contents_setting#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public UserContentsSettingDoc()
|
||||
: base(typeof(UserContentsSettingDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public UserContentsSettingDoc(string userGuid)
|
||||
: base(typeof(UserContentsSettingDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<UserContentsSettingAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user