초기커밋
This commit is contained in:
95
GameServer/Entity/LandAuction/LandAuction.cs
Normal file
95
GameServer/Entity/LandAuction/LandAuction.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
using ServerCommon;
|
||||
|
||||
|
||||
using META_ID = System.String;
|
||||
using MASTER_GUID = System.String;
|
||||
using REQUESTOR_ID = System.String;
|
||||
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class LandAuction : EntityBase, IWithLogActor
|
||||
{
|
||||
public LandAuction()
|
||||
: base(EntityType.LandAuction)
|
||||
{
|
||||
}
|
||||
|
||||
public override async Task<Result> onInit()
|
||||
{
|
||||
addEntityAttribute(new LandAuctionRegistryAttribute(this));
|
||||
addEntityAttribute(new LandAuctionHighestBidUserAttribute(this));
|
||||
addEntityAttribute(new LandAuctionRecordAttribute(this));
|
||||
|
||||
addEntityAttribute(new LandAuctionActivityAttribute(this));
|
||||
|
||||
addEntityAction(new LandAuctionAction(this));
|
||||
|
||||
return await base.onInit();
|
||||
}
|
||||
|
||||
public override EntityBase? onGetMasterEntity()
|
||||
{
|
||||
if (false == hasMasterGuid())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var err_msg = string.Empty;
|
||||
|
||||
var master_guid = getMasterGuid();
|
||||
|
||||
var server_logc = GameServerApp.getServerLogic();
|
||||
var player_manager = server_logc.getPlayerManager();
|
||||
|
||||
if (false == player_manager.tryGetUserByPrimaryKey(master_guid, out var found_player))
|
||||
{
|
||||
// 별도 Task로 처리해주는 처리자가 있다면 해당 처리자를 반환 한다. !!! - kangms
|
||||
|
||||
err_msg = $"Failed to player_manager.tryGetUserByPrimaryKey() !!!, Not found MasterEntity : MasterGuid:{master_guid} - {toBasicString()}";
|
||||
Log.getLogger().error(err_msg);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return found_player;
|
||||
}
|
||||
|
||||
public ILogActor toLogActor()
|
||||
{
|
||||
var server_logic = ServerLogicApp.getServerLogicApp();
|
||||
|
||||
var log_info = new LandAuctionActorLog();
|
||||
if (server_logic == null)
|
||||
return log_info;
|
||||
|
||||
log_info.initLogInfo(
|
||||
// 서버 정보
|
||||
server_logic.getServerConfig().getRegionId()
|
||||
, server_logic.getServerConfig().getWorldId()
|
||||
, server_logic.getServerType().toServerType()
|
||||
);
|
||||
|
||||
return log_info;
|
||||
}
|
||||
|
||||
public override string toBasicString()
|
||||
{
|
||||
return $"{this.getTypeName()}"
|
||||
+ $", {getOriginEntityAttribute<LandAuctionActivityAttribute>()?.toBasicString()}, {getOriginEntityAttribute<LandAuctionRegistryAttribute>()?.toBasicString()}";
|
||||
}
|
||||
|
||||
public override string toSummaryString()
|
||||
{
|
||||
return $"{this.getTypeName()}, {getEntityAttribute<LandAuctionRegistryAttribute>()?.toSummaryString()}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user