초기커밋
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user