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