초기커밋
This commit is contained in:
103
ServerCommon/Doc/UserBase/LocationDoc.cs
Normal file
103
ServerCommon/Doc/UserBase/LocationDoc.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Numerics;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
using SESSION_ID = System.Int32;
|
||||
using META_ID = System.UInt32;
|
||||
using ENTITY_GUID = System.String;
|
||||
using ACCOUNT_ID = System.String;
|
||||
using OWNER_GUID = System.String;
|
||||
using USER_GUID = System.String;
|
||||
using CHARACTER_GUID = System.String;
|
||||
using ITEM_GUID = System.String;
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
namespace ServerCommon
|
||||
{
|
||||
public class BaseLoaction
|
||||
{
|
||||
[JsonProperty]
|
||||
public Vector3 SpawnPos { get; set; } = Vector3.Zero;
|
||||
|
||||
[JsonProperty]
|
||||
public float ForwardAngle { get; set; } = 0.0f;
|
||||
}
|
||||
|
||||
public class ChannelServerLocation : BaseLoaction
|
||||
{
|
||||
[JsonProperty]
|
||||
public string ServerName { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty]
|
||||
public int WorldMetaId { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class IndunLocation : BaseLoaction
|
||||
{
|
||||
[JsonProperty]
|
||||
public string InstanceRoomId { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty]
|
||||
public int InstanceMetaId { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class LocationAttrib : AttribBase
|
||||
{
|
||||
[JsonProperty]
|
||||
public ChannelServerLocation LastConnectedChannelServerLocation { get; set; } = new();
|
||||
|
||||
[JsonProperty]
|
||||
public IndunLocation ReJoinIndunLocation { get; set; } = new();
|
||||
|
||||
public LocationAttrib()
|
||||
: base(typeof(LocationAttrib).Name)
|
||||
{ }
|
||||
}
|
||||
|
||||
//=============================================================================================
|
||||
// PK(Partition Key) : "location#user_guid"
|
||||
// SK(Sort Key) : ""
|
||||
// DocType : LocationDoc
|
||||
// LocationAttrib : {}
|
||||
// ...
|
||||
//=============================================================================================
|
||||
public class LocationDoc : DynamoDbDocBase
|
||||
{
|
||||
private static string getPrefixOfPK() { return "location#"; }
|
||||
private static string getPrefixOfSK() { return ""; }
|
||||
|
||||
public LocationDoc()
|
||||
: base(typeof(LocationDoc).Name)
|
||||
{
|
||||
appendAttribWrapperAll();
|
||||
}
|
||||
|
||||
public LocationDoc(string userGuid)
|
||||
: base(typeof(LocationDoc).Name)
|
||||
{
|
||||
setCombinationKeyForPK(userGuid);
|
||||
|
||||
appendAttribWrapperAll();
|
||||
|
||||
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
||||
}
|
||||
|
||||
private void appendAttribWrapperAll()
|
||||
{
|
||||
appendAttribWrapper(new AttribWrapper<LocationAttrib>());
|
||||
}
|
||||
|
||||
protected override string onGetPrefixOfPK()
|
||||
{
|
||||
return getPrefixOfPK();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user