135 lines
5.2 KiB
C#
135 lines
5.2 KiB
C#
//using System;
|
|
//using System.Collections.Generic;
|
|
//using System.Linq;
|
|
//using System.Text;
|
|
//using System.Threading.Tasks;
|
|
//using Amazon.DynamoDBv2;
|
|
//using Amazon.DynamoDBv2.Model;
|
|
//using Amazon.DynamoDBv2.DocumentModel;
|
|
//using Newtonsoft.Json;
|
|
//using ServerCore; using ServerBase;
|
|
//using StackExchange.Redis;
|
|
//using Microsoft.OpenApi.Extensions;
|
|
|
|
//namespace ServerCommon.DB
|
|
//{
|
|
// public class CharEntity
|
|
// {
|
|
// public string PK_Guid { get; set; } = string.Empty;
|
|
// public string SK_Guid { get; private set; } = string.Empty;
|
|
|
|
// public string Id { get; set; } = string.Empty;
|
|
|
|
// public string eoa { get; set; } = string.Empty;
|
|
|
|
// public CharInfo CharInfo { get; set; } = new CharInfo(); //{ Level = 1, Gold = 100L, BlueCali = 0L, RedCali = 0L, BlackCali = 0L, Exp = 0 };
|
|
|
|
// public AvatarInfo AvatarInfo { get; set; } = new AvatarInfo()
|
|
// {
|
|
// AvatarId = 1,
|
|
// BASICSTYLE = 10001,
|
|
// BODYSHAPE = 20001,
|
|
// HAIRSTYLE = 30001,
|
|
// Init = 1
|
|
// };
|
|
// public ClothInfo ClothInfo { get; set; } = new ClothInfo()
|
|
// {
|
|
// ClothAvatar = 0,
|
|
// ClothHeadwear = 0,
|
|
// ClothMask = 0,
|
|
// ClothBag = 0,
|
|
// ClothShoes = 0,
|
|
// ClothOuter = 0,
|
|
// ClothTops = 0,
|
|
// ClothBottoms = 0,
|
|
// ClothGloves = 0,
|
|
// ClothEarrings = 0,
|
|
// ClothNeckless = 0,
|
|
// ClothSocks = 0,
|
|
// };
|
|
|
|
// public EquipInfo EquipInfo { get; set; } = new EquipInfo();
|
|
|
|
|
|
// public CharPos CharPos { get; set; } = new CharPos();
|
|
|
|
// public CharPos LastGameServerPos { get; set; } = new CharPos();
|
|
|
|
// public List<string> m_auth_admin_levels { get; set; } = new() { AuthAdminLevelType.None.ToString() };
|
|
|
|
|
|
// //public Dictionary<int, Buff> BuffInfo = new ();
|
|
|
|
// public CharEntity()
|
|
// {
|
|
// CharPos.MapId = 1;
|
|
// CharPos.Pos = new Pos() { X = 0.0F, Y = 0.0F, Z = 0.0F, Angle = 0 };
|
|
|
|
// LastGameServerPos.MapId = 1;
|
|
// LastGameServerPos.Pos = new Pos() { X = 0.0F, Y = 0.0F, Z = 0.0F, Angle = 0 };
|
|
// }
|
|
// public CharEntity(Document document)
|
|
// {
|
|
// CharPos.MapId = 1;
|
|
// CharPos.Pos = new Pos() { X = 0.0F, Y = 0.0F, Z = 0.0F, Angle = 0 };
|
|
|
|
// LastGameServerPos.MapId = 1;
|
|
// LastGameServerPos.Pos = new Pos() { X = 0.0F, Y = 0.0F, Z = 0.0F, Angle = 0 };
|
|
|
|
// ReadFrom(document);
|
|
// }
|
|
|
|
// public void ReadFrom(Document document)
|
|
// {
|
|
// //PK_Guid = document["PK"].AsString().Replace(MainDB.GetPKPrefix(EEntityType.Character), "");
|
|
// //SK_Guid = document["SK"].AsString().Replace(MainDB.GetSKPrefix(EEntityType.Character), "");
|
|
|
|
// if (false == document.Contains("CharInfo"))
|
|
// {
|
|
// //TODO: 에러처리
|
|
// }
|
|
// try
|
|
// {
|
|
// CharInfo = JsonConvert.DeserializeObject<CharInfo>(document["CharInfo"].AsString()) ?? new();
|
|
// AvatarInfo = JsonConvert.DeserializeObject<AvatarInfo>(document["AvatarInfo"].AsString()) ?? new();
|
|
// ClothInfo = JsonConvert.DeserializeObject<ClothInfo>(document["ClothInfo"].AsString()) ?? new();
|
|
// CharPos = JsonConvert.DeserializeObject<CharPos>(document["CharPos"].AsString()) ?? new();
|
|
// EquipInfo = JsonConvert.DeserializeObject<EquipInfo>(document["EquipInfo"].AsString()) ?? new();
|
|
// LastGameServerPos = JsonConvert.DeserializeObject<CharPos>(document["LastGameServerPos"].AsString()) ?? new();
|
|
// m_auth_admin_levels = JsonConvert.DeserializeObject<List<string>>(document["AuthAdminLevel"].AsString()) ?? new();
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// Log.getLogger().error(ex.ToString());
|
|
// }
|
|
|
|
// }
|
|
|
|
// public Document DocumentForUpdate()
|
|
// {
|
|
// var document = new Document();
|
|
// //document["PK"] = MainDB.MakePK(EEntityType.Character, PK_Guid);
|
|
// //document["SK"] = MainDB.MakeSK(EEntityType.Character, PK_Guid);
|
|
// //document["Type"] = EEntityType.Character.ToString();
|
|
// document["CharInfo"] = JsonConvert.SerializeObject(CharInfo);
|
|
// document["AvatarInfo"] = JsonConvert.SerializeObject(AvatarInfo);
|
|
// document["ClothInfo"] = JsonConvert.SerializeObject(ClothInfo);
|
|
// document["CharPos"] = JsonConvert.SerializeObject(CharPos);
|
|
// document["EquipInfo"] = JsonConvert.SerializeObject(EquipInfo);
|
|
// document["LastGameServerPos"] = JsonConvert.SerializeObject(LastGameServerPos);
|
|
// document["AuthAdminLevel"] = JsonConvert.SerializeObject(m_auth_admin_levels);
|
|
// return document;
|
|
// }
|
|
|
|
// public void UpdateCharacterToMemory(Document document)
|
|
// {
|
|
// ReadFrom(document);
|
|
// }
|
|
|
|
// public void CopyCharacterEntityForTransaction(out CharEntity newcharEntity)
|
|
// {
|
|
// newcharEntity = new(DocumentForUpdate());
|
|
// }
|
|
// }
|
|
//}
|