초기커밋

This commit is contained in:
2025-05-01 07:20:41 +09:00
commit 98bb2e3c5c
2747 changed files with 646947 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
namespace ServerCommon;
public class CaliumContentAttrib : AttribBase
{
[JsonProperty("calium_content_id")]
public string ContentId { get; set; } = string.Empty;
[JsonProperty("calium")]
public double TotalCalium { get; set; } = 0.0;
public CaliumContentAttrib() : base(nameof(CaliumContentAttrib), false) {}
}
//=============================================================================================
// PK(Partition Key) : "calium#content"
// SK(Sort Key) : "contentId"
// DocType : CaliumEventDoc
// CaliumContentAttrib : {}
// ...
//=============================================================================================
public class CaliumContentDoc : DynamoDbDocBase
{
public static string pk = "calium#content";
private readonly string m_content_id;
private string getPrefixOfPK() => pk;
private string getPrefixOfSK() => m_content_id;
public CaliumContentDoc(string contentId) : base(nameof(CaliumContentDoc))
{
m_content_id = contentId;
setCombinationKeyForSK(contentId);
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
var doc_attrib = getAttrib<CaliumContentAttrib>();
NullReferenceCheckHelper.throwIfNull(doc_attrib, () => $"doc_attrib is null !!! - contentId:{contentId}");
doc_attrib.ContentId = contentId;
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<CaliumContentAttrib>());
}
protected override string onGetPrefixOfPK()
{
return getPrefixOfPK();
}
protected override string onGetPrefixOfSK()
{
return getPrefixOfSK();
}
protected override ServerErrorCode onCheckAndSetPK(string sortKey)
{
getPrimaryKey().fillUpPK(sortKey);
return ServerErrorCode.Success;
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
setCombinationKeyForSK(sortKey);
return ServerErrorCode.Success;
}
}

View File

@@ -0,0 +1,61 @@
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
using DYNAMO_DB_TABLE_FULL_NAME = System.String;
namespace ServerCommon;
public class CaliumConverterAttrib : AttribBase
{
[JsonProperty("cailum")] public double Calium { get; set; }
[JsonProperty("last_fill_up_date")] public string LastFillUpDate { get; set; } = string.Empty;
public CaliumConverterAttrib() : base(nameof(CaliumConverterAttrib), false)
{
}
}
//=============================================================================================
// Primary Key : Deprecated -> Migration 에서 쓰고 있음 ( 추후 삭제 필요 )
// PK(Partition Key) : "caliumconverter#total"
// SK(Sort Key) : ""
// DocType : CaliumConverterDoc
// Attrib : CaliumConverterAttrib
// ...
//=============================================================================================
public class CaliumConverterDoc : DynamoDbDocBase
{
public static string pk = "caliumconverter#total";
private static string getPrefixOfPK() => "";
private static string getPrefixOfSK() => "";
public CaliumConverterDoc() : base(nameof(CaliumConverterDoc))
{
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<CaliumConverterAttrib>());
}
protected override string onGetPrefixOfPK() => getPrefixOfPK();
protected override string onMakePK()
{
return pk;
}
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
}

View File

@@ -0,0 +1,77 @@
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
using USER_GUID = System.String;
namespace ServerCommon;
public class CaliumConverterForUserAttrib : AttribBase
{
[JsonProperty("data")] public Dictionary<USER_GUID, double> UserCalium { get; set; } = new();
public CaliumConverterForUserAttrib() : base(nameof(CaliumConverterForUserAttrib), false)
{
}
}
//=============================================================================================
// Primary Key : Deprecated -> Migration 에서 쓰고 있음 ( 추후 삭제 필요 )
// PK(Partition Key) : "caliumconverter#user"
// SK(Sort Key) : "dd"
// DocType : CaliumConverterForUserDoc
// Attrib : CaliumConverterForUserAttrib
// ...
//=============================================================================================
public class CaliumConverterForUserDoc : DynamoDbDocBase
{
public static string pk = "caliumconverter#user";
private static string getPrefixOfPK() => "";
private static string getPrefixOfSK() => "";
public CaliumConverterForUserDoc(int day, Int64 ttlSeconds) : base(nameof(CaliumConverterForUserDoc), ttlSeconds)
{
setCombinationKeyForSK(day.ToString());
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
}
public CaliumConverterForUserDoc() : base(nameof(CaliumConverterForUserDoc))
{
appendAttribWrapperAll();
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<CaliumConverterForUserAttrib>());
}
protected override string onGetPrefixOfPK() => getPrefixOfPK();
protected override string onMakePK()
{
return pk;
}
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
setCombinationKeyForSK(sortKey);
return ServerErrorCode.Success;
}
}

View File

@@ -0,0 +1,143 @@
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
using USER_GUID = System.String;
namespace ServerCommon;
public enum CaliumEventStatus
{
None = 0,
Regist = 1,
Sending = 2,
Failed = 4,
Success = 5
}
public class CaliumEventData
{
// Event Id
[JsonProperty("event_id")]
public string m_event_id { get; set; } = Guid.NewGuid().ToString();
// 서버 타입
[JsonProperty("server_type")]
public string m_server_type { get; set; } = string.Empty;
// 이벤트 타입 : calium_get(교환소 칼리움 획득) , extra_get(교환소 외 사파이어 소각) , calium_burn(칼리움 소각)
[JsonProperty("event_type")]
public string m_event_type { get; set; } = string.Empty;
// 하위타입 (위치구분)
[JsonProperty("sub_type")]
public string m_sub_type { get; set; } = string.Empty;
// 대상 구분 타입 : "user_nickname" 고정값
[JsonProperty("div_type")]
public string m_div_type { get; set; } = "user_nickname";
// 대상 구분 ID (유저 Nickname)
[JsonProperty("div_id")]
public string m_div_id { get; set; } = string.Empty;
// 칼리움 변경량 ( 양수 : 획득 / 음수 : 소모 )
[JsonProperty("calium_change_volume")]
public double m_calium_delta { get; set; }
// 사파이어 변경량 ( 양수 : 획득 / 음수 : 소모 )
[JsonProperty("sapphire_change_volume")]
public double m_sapphire_delta { get; set; }
// 이벤트 해당일의 epoch
[JsonProperty("seq")]
public int m_current_epoch { get; set; }
// 이벤트 해당일의 인플레이션 가중치
[JsonProperty("swap_rate")]
public double m_current_inflation_rate { get; set; }
// 이벤트 전송 시간
[JsonProperty("event_time")]
public string? m_event_time { get; set; } = string.Empty;
}
public class CaliumEventAttrib : AttribBase
{
[JsonProperty("user_guid")] public USER_GUID UserGuid { get; set; } = string.Empty;
[JsonProperty("status")] public CaliumEventStatus Status { get; set; }
[JsonProperty("update_date")] public DateTime UpdateTime { get; set; } = DateTimeHelper.Current;
[JsonProperty("calium_event")] public CaliumEventData EventData { get; set; } = new();
public CaliumEventAttrib() : base(nameof(CaliumEventAttrib), false) {}
}
//=============================================================================================
// PK(Partition Key) : "calium#event"
// SK(Sort Key) : "event_guid"
// DocType : CaliumEventDoc
// CaliumEventAttrib : {}
// ...
//=============================================================================================
public class CaliumEventDoc : DynamoDbDocBase
{
public static string pk = "calium#event";
private readonly string m_event_guid;
private string getPrefixOfPK() => "";
private string getPrefixOfSK() => "";
public CaliumEventDoc(string? eventGuid) : base(nameof(CaliumEventDoc))
{
m_event_guid = eventGuid ?? Guid.NewGuid().ToString();
setCombinationKeyForSK(m_event_guid);
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
}
public CaliumEventDoc() : base(nameof(CaliumEventDoc))
{
m_event_guid = Guid.NewGuid().ToString();
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<CaliumEventAttrib>());
}
protected override string onMakePK()
{
return pk;
}
protected override string onGetPrefixOfPK()
{
return getPrefixOfPK();
}
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
protected override string onGetPrefixOfSK()
{
return getPrefixOfSK();
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
setCombinationKeyForSK(sortKey);
return ServerErrorCode.Success;
}
}

View File

@@ -0,0 +1,129 @@
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
namespace ServerCommon;
public class CaliumConverterInfo
{
// 잔여 수량
[JsonProperty("converter_total_calium")]
public double TotalCalium { get; set; } = 0.0;
// 마지막 누적 시간
[JsonProperty("converter_last_fill_up_date")]
public DateTime LastFillUpDate { get; set; } = DateTimeHelper.MinTime;
// Daily 누적 Calium 수
[JsonProperty("converter_daily_fill_up_standard_calium")]
public double DailyFillUpStandardCalium { get; set; } = 0.0;
// 컨버터 칼리움 전환 비율
[JsonProperty("converter_daily_convert_rate")]
public double DailyConvertRate { get; set; } = 0.0;
// 누적 총량
[JsonProperty("converter_cumulative_calium")]
public double ConverterCumulativeCalium { get; set; } = 0.0;
}
public class CaliumExchangerInfo
{
// 인플레이션 가중치
[JsonProperty("exchanger_daily_inflation_rate")]
public double DailyInflationRate { get; set; } = 0.0;
}
public class CaliumOperatorInfo
{
// 운영 승인 누적량
[JsonProperty("operator_total_calium")]
public double TotalCalium { get; set; } = 0.0;
// 운영 승인 누적 날짜
[JsonProperty("operator_calium_fill_up_date")]
public DateTime FillUpDate { get; set; } = DateTimeHelper.MinTime;
// 운영용 사용 가능량
[JsonProperty("operator_calium")]
public double OperatorCalium { get; set; } = 0.0;
}
public class CaliumStorageAttrib : AttribBase
{
// RollUp 순번
[JsonProperty("daily_epoch")]
public int DailyEpoch { get; set; } = 0;
// RollUp 실패 Epoch Count
[JsonProperty("mis_epoch")]
public int MisEpoch { get; set; } = 0;
// RollUp Check 시작
[JsonProperty("daily_rollup_check_date")]
public DateTime DailyRollUpCheckDate { get; set; } = DateTimeHelper.MinTime;
// RollUp 시간
[JsonProperty("daily_pivot_date")]
public DateTime DailyPivotDate { get; set; } = DateTimeHelper.MinTime;
// 컨버터 저장 정보
[JsonProperty("calium_converter_storage")]
public CaliumConverterInfo ConverterStorage { get; set; } = new();
// 교환소 저장 정보
[JsonProperty("calium_exchanger_storage")]
public CaliumExchangerInfo ExchangerStorage { get; set; } = new();
// 운영 저장 정보
[JsonProperty("calium_operator_storage")]
public CaliumOperatorInfo OperatorStorage { get; set; } = new();
public CaliumStorageAttrib() : base(nameof(CaliumStorageAttrib), false) {}
}
//=============================================================================================
// PK(Partition Key) : "calium#storage"
// SK(Sort Key) : ""
// DocType : CaliumStorageDoc
// CaliumStorageAttrib : {}
// ...
//=============================================================================================
public class CaliumStorageDoc : DynamoDbDocBase
{
public static string pk = "calium#storage";
private static string getPrefixOfPK() { return ""; }
private static string getPrefixOfSK() { return ""; }
public CaliumStorageDoc() : base(nameof(CaliumStorageDoc))
{
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<CaliumStorageAttrib>());
}
protected override string onGetPrefixOfPK()
{
return getPrefixOfPK();
}
protected override string onMakePK()
{
return pk;
}
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
}

View File

@@ -0,0 +1,84 @@
using System;
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
namespace ServerCommon;
using META_ID = System.UInt32;
using LAND_AUCTION_NUMBER = System.Int32;
public class LandAuctionActivityAttrib : AttribBase
{
[JsonProperty("land_meta_id")]
public META_ID LandMetaId { get; set; } = 0; // 경매 대상 LandData Meta Id
[JsonProperty("auction_number")]
public LAND_AUCTION_NUMBER AuctionNumber { get; set; } = 0; // 경매 번호
public LandAuctionActivityAttrib()
: base(nameof(LandAuctionActivityAttrib), false)
{
}
}
//=============================================================================================
// Desc : 활성화중인 랜드 경매별 등록 정보
// Primary Key
// PK(Partition Key) : land_auction_activity#global
// SK(Sort Key) : "{land_meta_id}"
// DocType : LandAuctionActiveDoc
// Attrib : LandAuctionActiveAttrib
// ...
//=============================================================================================
public class LandAuctionActivityDoc : DynamoDbDocBase
{
private static string getPrefixOfPK() => "land_auction_activity#";
public LandAuctionActivityDoc() :
base(nameof(LandAuctionActivityDoc))
{
appendAttribWrapperAll();
}
public LandAuctionActivityDoc(META_ID landMetaId)
: base(nameof(LandAuctionActivityDoc))
{
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
setCombinationKeyForSK(landMetaId.ToString());
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
var land_auction_activity_attrib = getAttrib<LandAuctionActivityAttrib>();
NullReferenceCheckHelper.throwIfNull(land_auction_activity_attrib, () => $"land_auction_activity_attrib is null !!!");
land_auction_activity_attrib.LandMetaId = landMetaId;
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<LandAuctionActivityAttrib>());
}
protected override string onGetPrefixOfPK() => getPrefixOfPK();
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
setCombinationKeyForSK(sortKey);
return ServerErrorCode.Success;
}
}

View File

@@ -0,0 +1,122 @@
using System;
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
using META_ID = System.UInt32;
using LAND_AUCTION_NUMBER = System.Int32;
namespace ServerCommon;
public class LandAuctionHighestBidUserAttrib : AttribBase
{
[JsonProperty("land_meta_id")]
public META_ID LandMetaId { get; set; } = 0; // 경매 대상 LandData Meta Id
[JsonProperty("auction_number")]
public LAND_AUCTION_NUMBER AuctionNumber { get; set; } = 0; // 경매 번호
[JsonProperty("bid_currency_type")]
public CurrencyType BidCurrencyType { get; set; } = 0; // 입찰 재화의 종류
//=============================================================================================
// 현재 최고 입찰자 정보
//=============================================================================================
[JsonProperty("highest_bid_price")]
public double HighestBidPrice { get; set; } = 0; // 입찰 최고가
[JsonProperty("highest_user_guid")]
public string HighestBidUserGuid { get; set; } = string.Empty; // 입찰 최고가 유저 식별키
[JsonProperty("highest_user_nickname")]
public string HighestBidUserNickname { get; set; } = string.Empty; // 입찰 최고가 유저 닉네임
//=============================================================================================
// 일반 입찰 최고 입찰자 정보
//=============================================================================================
[JsonProperty("normal_highest_bid_price")]
public double NormalHighestBidPrice { get; set; } = 0; // 일반 입찰 최고가
[JsonProperty("normal_highest_user_guid")]
public string NormalHighestBidUserGuid { get; set; } = string.Empty; // 일반 입찰 최고가 유저 식별키
[JsonProperty("normal_highest_user_nickname")]
public string NormalHighestBidUserNickname { get; set; } = string.Empty; // 일반 입찰 최고가 유저 닉네임
[JsonProperty("highest_rank_version_time")]
public DateTime HighestRankVersionTime { get; set; } = DateTimeHelper.MinTime; // 최고 입찰자 순위 버전 정보
public LandAuctionHighestBidUserAttrib()
: base(nameof(LandAuctionHighestBidUserAttrib), false)
{
}
}
//=============================================================================================
// Desc : 랜드 경매별 입찰 최고가 유저
// Primary Key
// PK(Partition Key) : land_auction_highest_bid_user#global
// SK(Sort Key) : {land_meta_id}#{auction_number}"
// DocType : LandAuctionHighestBidUserDoc
// Attrib : LandAuctionHighestBidUserAttrib
// ...
//=============================================================================================
public class LandAuctionHighestBidUserDoc : DynamoDbDocBase
{
private static string getPrefixOfPK() => "land_auction_highest_bid_user#";
public LandAuctionHighestBidUserDoc()
: base(nameof(LandAuctionHighestBidUserDoc))
{
appendAttribWrapperAll();
}
public LandAuctionHighestBidUserDoc(META_ID landMetaId, LAND_AUCTION_NUMBER landAuctionNumber)
: base(nameof(LandAuctionHighestBidUserDoc))
{
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
setCombinationKeyForSK(makeCombinationKeyForSK(landMetaId, landAuctionNumber));
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
var land_auction_highest_bid_user_attrib = getAttrib<LandAuctionHighestBidUserAttrib>();
NullReferenceCheckHelper.throwIfNull(land_auction_highest_bid_user_attrib, () => $"land_auction_highest_bid_user_attrib is null !!!");
land_auction_highest_bid_user_attrib.LandMetaId = landMetaId;
land_auction_highest_bid_user_attrib.AuctionNumber = landAuctionNumber;
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<LandAuctionHighestBidUserAttrib>());
}
protected override string onGetPrefixOfPK() => getPrefixOfPK();
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
setCombinationKeyForSK(sortKey);
return ServerErrorCode.Success;
}
public static string makeCombinationKeyForSK(META_ID landMetaId, LAND_AUCTION_NUMBER landAuctionNumber)
{
return $"{landMetaId}#{landAuctionNumber}";
}
}

View File

@@ -0,0 +1,85 @@
using System;
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
using META_ID = System.UInt32;
using LAND_AUCTION_NUMBER = System.Int32;
namespace ServerCommon;
public class LandAuctionRecordAttrib : AttribBase
{
[JsonProperty("land_meta_id")]
public META_ID LandMetaId { get; set; } = 0; // 경매 대상 LandData Meta Id
[JsonProperty("auction_number")]
public LAND_AUCTION_NUMBER AuctionNumber { get; set; } = 0; // 경매 번호
public LandAuctionRecordAttrib()
: base(nameof(LandAuctionRecordAttrib), false)
{
}
}
//=============================================================================================
// Desc : 랜드별 LandAuctionResult.Successed (낙찰)된 경매 정보
// Primary Key
// PK(Partition Key) : land_auction_record#global
// SK(Sort Key) : "{land_meta_id}"
// DocType : LandAuctionRecordDoc
// Attrib : LandAuctionRecordAttrib
// ...
//=============================================================================================
public class LandAuctionRecordDoc : DynamoDbDocBase
{
private static string getPrefixOfPK() => "land_auction_record#";
public LandAuctionRecordDoc()
: base(nameof(LandAuctionRecordDoc))
{
appendAttribWrapperAll();
}
public LandAuctionRecordDoc(META_ID landMetaId, LAND_AUCTION_NUMBER auctionNumber)
: base(nameof(LandAuctionRecordDoc))
{
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
setCombinationKeyForSK(landMetaId.ToString());
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
var land_auction_record_attrib = getAttrib<LandAuctionRecordAttrib>();
NullReferenceCheckHelper.throwIfNull(land_auction_record_attrib, () => $"land_auction_record_attrib is null !!!");
land_auction_record_attrib.LandMetaId = landMetaId;
land_auction_record_attrib.AuctionNumber = auctionNumber;
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<LandAuctionRecordAttrib>());
}
protected override string onGetPrefixOfPK() => getPrefixOfPK();
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
setCombinationKeyForSK(sortKey);
return ServerErrorCode.Success;
}
}

View File

@@ -0,0 +1,133 @@
using System;
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
using META_ID = System.UInt32;
using LAND_AUCTION_NUMBER = System.Int32;
namespace ServerCommon;
public class LandAuctionRegistryAttrib : AttribBase
{
//=============================================================================================
// 랜드 경매 식별 정보
//=============================================================================================
[JsonProperty("land_meta_id")]
public META_ID LandMetaId { get; set; } = 0; // 경매 대상 LandData Meta Id
[JsonProperty("auction_number")]
public LAND_AUCTION_NUMBER AuctionNumber { get; set; } = 0; // 경매 번호
//=============================================================================================
// 랜드 경매 등록 정보
//=============================================================================================
[JsonProperty("auction_reservation_notice_start_time")]
public DateTime AuctionReservationNoticeStartTime { get; set; } = DateTimeHelper.MinTime; // 경매 예약 공지 시작 시간
[JsonProperty("bid_currency_type")]
public CurrencyType BidCurrencyType { get; set; } = 0; // 입찰 재화의 종류
[JsonProperty("auction_start_time")]
public DateTime AuctionStartTime { get; set; } = DateTimeHelper.MinTime; // 경매 시작 시간
[JsonProperty("auction_end_time")]
public DateTime AuctionEndTime { get; set; } = DateTimeHelper.MinTime; // 경매 종료 시간
[JsonProperty("bid_start_price")]
public double BidStartPrice { get; set; } = 0; // 입찰 시작가
[JsonProperty("is_cancel_auction")]
public bool IsCancelAuction { get; set; } = false; // 경매 취소 여부 (취소:true, 미취소:false)
[JsonProperty("registered_version_time")]
public DateTime RegisteredVersionTime { get; set; } = DateTimeHelper.MinTime; // 경매 등록 버전 정보 (시간), 랜드 경매 등록 정보가 변경되면 등록 버전 정보도 갱신 되어야 한다. !!!
//=============================================================================================
// 랜드 경매 진행 정보
//=============================================================================================
[JsonProperty("auction_state")]
public LandAuctionState LandAuctionState { get; set; } = LandAuctionState.None; // 경매 상태
[JsonProperty("auction_result")]
public LandAuctionResult LandAuctionResult { get; set; } = LandAuctionResult.None; // 경매 결과
[JsonProperty("process_version_time")]
public DateTime ProcessVersionTime { get; set; } = DateTimeHelper.MinTime; // 경매 진행 버전 정보 (시간), 랜드 경매 진행 정보가 변경되면 진행 버전 정보도 갱신되어야 한다. !!!
public LandAuctionRegistryAttrib()
: base(nameof(LandAuctionRegistryAttrib), false)
{
}
}
//=============================================================================================
// Desc : 등록된 랜드 경매별 등록 정보
// Primary Key
// PK(Partition Key) : land_auction_registry#global
// SK(Sort Key) : "{land_meta_id}#{auction_number}"
// DocType : LandAuctionRegistryDoc
// Attrib : LandAuctionRegistryAttrib
// ...
//=============================================================================================
public class LandAuctionRegistryDoc : DynamoDbDocBase
{
private static string getPrefixOfPK() => "land_auction_registry#";
public LandAuctionRegistryDoc()
: base(nameof(LandAuctionRegistryDoc))
{
appendAttribWrapperAll();
}
public LandAuctionRegistryDoc(META_ID landMetaId, LAND_AUCTION_NUMBER landAuctionNumber, DateTime registeredVersionTime)
: base(nameof(LandAuctionRegistryDoc))
{
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
setCombinationKeyForSK(makeCombinationKeyForSK(landMetaId, landAuctionNumber));
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
var land_auction_registry_attrib = getAttrib<LandAuctionRegistryAttrib>();
NullReferenceCheckHelper.throwIfNull(land_auction_registry_attrib, () => $"land_auction_registry_attrib is null !!!");
land_auction_registry_attrib.LandMetaId = landMetaId;
land_auction_registry_attrib.AuctionNumber = landAuctionNumber;
land_auction_registry_attrib.RegisteredVersionTime = registeredVersionTime;
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<LandAuctionRegistryAttrib>());
}
protected override string onGetPrefixOfPK() => getPrefixOfPK();
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
setCombinationKeyForSK(sortKey);
return ServerErrorCode.Success;
}
public static string makeCombinationKeyForSK(META_ID landMetaId, LAND_AUCTION_NUMBER landAuctionNumber)
{
return $"{landMetaId}#{landAuctionNumber}";
}
}

View File

@@ -0,0 +1,110 @@
using Google.Protobuf.WellKnownTypes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
using SESSION_ID = System.Int32;
using META_ID = System.UInt32;
using ENTITY_GUID = System.String;
using ACCOUNT_ID = System.String;
using OWNER_GUID = System.String;
using USER_GUID = System.String;
using CHARACTER_GUID = System.String;
using ITEM_GUID = System.String;
using MAIL_GUID = System.String;
namespace ServerCommon;
public class NoticeChatDetail
{
[JsonProperty]
public LanguageType Languagetype { get; set; } = LanguageType.None;
[JsonProperty]
public string ChatMessage { get; set; } = string.Empty;
}
public class NoticeChatAttrib : AttribBase
{
[JsonProperty("chat_id")]
public Int32 ChatId { get; set; } = 0;
[JsonProperty("next_notice_time")]
public DateTime NextNoticeTime { get; set; } = new();
[JsonProperty("repeat_minute_time")]
public Int32 RepeatMinuteTime { get; set; } = 0;
[JsonProperty("repeat_count")]
public Int32 RepeatCount { get; set; } = 0;
[JsonProperty("sender")]
public string Sender { get; set; } = string.Empty;
[JsonProperty("message_type")]
public Int32 MessageType { get; set; } = 0;
[JsonProperty("detail_list")]
public List<NoticeChatDetail> DetailList { get; set; } = new();
public NoticeChatAttrib()
: base(typeof(NoticeChatAttrib).Name)
{ }
}
//=============================================================================================
// PK(Partition Key) : "management_notice_chat#"
// SK(Sort Key) : "notice_chat_id"
// DocType : NoticeChatDoc
// NoticeChatAttrib : {}
// ...
//=============================================================================================
public class NoticeChatDoc : DynamoDbDocBase
{
public NoticeChatDoc()
: base(typeof(NoticeChatDoc).Name)
{
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
appendAttribWrapperAll();
fillUpPrimaryKey(onMakePK(), onMakeSK());
}
public NoticeChatDoc(string chat_id)
: base(typeof(NoticeChatDoc).Name)
{
setCombinationKeyForPKSK(DynamoDbClient.PK_GLOBAL, chat_id);
appendAttribWrapperAll();
fillUpPrimaryKey(onMakePK(), onMakeSK());
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<NoticeChatAttrib>());
}
protected override string onGetPrefixOfPK()
{
return "management_notice_chat#";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
setCombinationKeyForSK(sortKey);
return ServerErrorCode.Success;
}
}

View File

@@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using SESSION_ID = System.Int32;
using META_ID = System.UInt32;
using ENTITY_GUID = System.String;
using ACCOUNT_ID = System.String;
using OWNER_GUID = System.String;
using USER_GUID = System.String;
using CHARACTER_GUID = System.String;
using ITEM_GUID = System.String;
using MAIL_GUID = System.String;
namespace ServerCommon;
// public class SystemMetaMailText
// {
// public LanguageType languageType { get; set; } = LanguageType.None;
// public string text { get; set; } = string.Empty;
// }
public class SystemMetaMailAttrib : AttribBase
{
[JsonProperty("mail_id")]
public Int32 MailId { get; set; } = 0;
[JsonProperty("sender_nickname")]
public List<OperationSystemMessage> SenderNickName { get; set; } = new();
[JsonProperty("title")]
public List<OperationSystemMessage> Title { get; set; } = new();
[JsonProperty("text")]
public List<OperationSystemMessage> Text { get; set; } = new();
[JsonProperty("start_time")]
public DateTime StartTime { get; set; } = new();
[JsonProperty("end_time")]
public DateTime EndTime { get; set; } = new();
[JsonProperty("item_list")]
public List<MailItem> ItemList { get; set; } = new();
public SystemMetaMailAttrib()
: base(typeof(SystemMetaMailAttrib).Name)
{ }
}
//=============================================================================================
// PK(Partition Key) : "management_system_meta_mail#"
// SK(Sort Key) : "sequence_id"
// DocType : SystemMailDoc
// SystemMailAttrib : {}
// ...
//=============================================================================================
public class SystemMetaMailDoc : DynamoDbDocBase
{
public SystemMetaMailDoc()
: base(typeof(SystemMetaMailDoc).Name)
{
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
appendAttribWrapperAll();
fillUpPrimaryKey(onMakePK(), onMakeSK());
}
public SystemMetaMailDoc(string mail_id)
: base(typeof(SystemMetaMailDoc).Name)
{
setCombinationKeyForPKSK(DynamoDbClient.PK_GLOBAL, mail_id);
appendAttribWrapperAll();
fillUpPrimaryKey(onMakePK(), onMakeSK());
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<SystemMetaMailAttrib>());
}
protected override string onGetPrefixOfPK()
{
return "management_system_meta_mail#";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
setCombinationKeyForSK(sortKey);
return ServerErrorCode.Success;
}
}

View File

@@ -0,0 +1,81 @@
using Newtonsoft.Json;
using ServerBase;
namespace ServerCommon;
public class UgcNpcRankAttrib : AttribBase
{
/// <summary>
/// rank 정보
/// key: {ownerGuid}_{ugcnpcMetaGuid}
/// value: score
/// </summary>
/// <remarks> UgcNpcRankHelper.makeRankKey() </remarks>
[JsonProperty("data")] public Dictionary<string, long> ranks { get; set; } = new();
public UgcNpcRankAttrib() : base(nameof(UgcNpcRankAttrib), false)
{
}
}
//=============================================================================================
// Primary Key
// PK(Partition Key) : ugcnpcrank#{state}
// SK(Sort Key) : ""
// DocType : UgcNpcRankDoc
// Attrib : UgcNpcRankAttrib
// ...
//=============================================================================================
public class UgcNpcRankDoc : DynamoDbDocBase
{
public static string getPrefixOfPK() => "ugcnpcrank#";
public UgcNpcRankDoc() : base(nameof(UgcNpcRankDoc))
{
appendAttribWrapperAll();
}
public UgcNpcRankDoc(UgcNpcRankState state, UgcNpcRankType type, string? rankDate) : base(nameof(UgcNpcRankDoc))
{
setCombinationKeyForPK(state.ToString());
var sk = null == rankDate ? type.ToString() : $"{type}#{rankDate}";
setCombinationKeyForSK(sk);
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
}
public UgcNpcRankDoc(UgcNpcRankState state, UgcNpcRankType type, string? rankDate, Int64 ttlSeconds) : base(nameof(UgcNpcRankDoc), ttlSeconds)
{
setCombinationKeyForPK(state.ToString());
var sk = null == rankDate ? type.ToString() : $"{type}#{rankDate}";
setCombinationKeyForSK(sk);
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<UgcNpcRankAttrib>());
}
protected override string onGetPrefixOfPK() => getPrefixOfPK();
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
setCombinationKeyForSK(sortKey);
return ServerErrorCode.Success;
}
}

View File

@@ -0,0 +1,54 @@
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
namespace ServerCommon;
public class UgcNpcRankManageAttrib : AttribBase
{
[JsonProperty("last_running_date")] public List<string> LastRunningDates { get; set; } = new();
public UgcNpcRankManageAttrib() : base(nameof(UgcNpcRankManageAttrib), false)
{
}
}
//=============================================================================================
// Primary Key : Deprecated -> Migration 에서 쓰고 있음 ( 추후 삭제 필요 )
// PK(Partition Key) : ugcnpcrank#manage
// SK(Sort Key) : ""
// DocType : UgcNpcRankManageDoc
// Attrib : UgcNpcRankManageAttrib
// ...
//=============================================================================================
public class UgcNpcRankManageDoc : DynamoDbDocBase
{
public static string pk = "ugcnpcrank#manage";
public UgcNpcRankManageDoc() : base(nameof(UgcNpcRankManageDoc))
{
fillUpPrimaryKey(onMakePK(), onMakeSK());
appendAttribWrapperAll();
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<UgcNpcRankManageAttrib>());
}
protected override string onGetPrefixOfPK() => string.Empty;
protected override string onMakePK()
{
return pk;
}
protected override string onMakeSK()
{
return $"{onGetPrefixOfSK()}{getCombinationKeyForSK()}";
}
}

View File

@@ -0,0 +1,97 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using ServerCore; using ServerBase;
using ServerControlCenter;
using SESSION_ID = System.Int32;
using META_ID = System.UInt32;
using ENTITY_GUID = System.String;
using ACCOUNT_ID = System.String;
using OWNER_GUID = System.String;
using USER_GUID = System.String;
using CHARACTER_GUID = System.String;
using ITEM_GUID = System.String;
namespace ServerCommon
{
public class UserNicknameRegistryAttrib : AttribBase
{
[JsonProperty("nickname")]
public string Nickname { get; set; } = string.Empty;
[JsonProperty("user_guid")]
public USER_GUID UserGuid { get; set; } = string.Empty;
[JsonProperty("account_id")]
public ACCOUNT_ID AccountId { get; set; } = string.Empty;
public UserNicknameRegistryAttrib()
: base(typeof(UserNicknameRegistryAttrib).Name)
{ }
}
//=============================================================================================
// PK(Partition Key) : "user_nickname_registry#"
// SK(Sort Key) : "user_nickname"
// DocType : UserNicknameRegistryDoc
// UserNicknameRegistryAttrib : {}
// ...
//=============================================================================================
public class UserNicknameRegistryDoc : DynamoDbDocBase
{
private static string getPrefixOfPK() { return "user_nickname_registry#"; }
private static string getPrefixOfSK() { return ""; }
public UserNicknameRegistryDoc()
: base(typeof(UserNicknameRegistryDoc).Name)
{
appendAttribWrapperAll();
}
public UserNicknameRegistryDoc(string userNickname)
: base(typeof(UserNicknameRegistryDoc).Name)
{
setCombinationKeyForPKSK(DynamoDbClient.PK_GLOBAL, userNickname.ToLower());
appendAttribWrapperAll();
fillUpPrimaryKey(onMakePK(), onMakeSK());
var user_nickname_registry_attrib = getAttrib<UserNicknameRegistryAttrib>();
NullReferenceCheckHelper.throwIfNull(user_nickname_registry_attrib, () => $"user_nickname_registry_attrib is null !!!");
user_nickname_registry_attrib.Nickname = userNickname;
setExceptionHandler(new DynamoDbQueryExceptionNotifier.ExceptionHandler(DynamoDbQueryExceptionNotifier.ConditionalCheckFailed, ServerErrorCode.UserNicknameDuplicated));
}
private void appendAttribWrapperAll()
{
appendAttribWrapper(new AttribWrapper<UserNicknameRegistryAttrib>());
}
protected override string onGetPrefixOfPK()
{
return getPrefixOfPK();
}
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
{
getPrimaryKey().fillUpSK(sortKey);
setCombinationKeyForSK(sortKey);
return ServerErrorCode.Success;
}
}
}