71 lines
1.6 KiB
C#
71 lines
1.6 KiB
C#
using Google.Protobuf;
|
|
using Google.Protobuf.WellKnownTypes;
|
|
|
|
|
|
using ServerCore;
|
|
using ServerBase;
|
|
using ServerCommon;
|
|
using ServerCommon.BusinessLogDomain;
|
|
using MetaAssets;
|
|
|
|
|
|
namespace GameServer;
|
|
|
|
|
|
public class RoomContentAction : EntityActionBase
|
|
{
|
|
public RoomContentAction(Room owner) : base(owner)
|
|
{
|
|
}
|
|
|
|
public override async Task<Result> onInit()
|
|
{
|
|
await Task.CompletedTask;
|
|
|
|
var result = new Result();
|
|
|
|
return result;
|
|
}
|
|
|
|
public override void onClear()
|
|
{
|
|
return;
|
|
}
|
|
|
|
public RoomInfo? toRoomData4Client()
|
|
{
|
|
var attribute = getOwner().getEntityAttribute<RoomAttribute>();
|
|
if (null == attribute)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
var data = new RoomInfo
|
|
{
|
|
Id = attribute.RoomId,
|
|
Owner = attribute.Owner,
|
|
Name = attribute.Name,
|
|
Description = attribute.Description
|
|
};
|
|
|
|
foreach (var info in attribute.PropInfo)
|
|
{
|
|
var prop = new PropInfo();
|
|
prop.AnchorGuid = info.Key;
|
|
prop.TableId = info.Value.TableId;
|
|
|
|
data.PropList.Add(prop);
|
|
}
|
|
|
|
return data;
|
|
}
|
|
|
|
public async Task<Result> notifyChangeRoomToClientAndServers()
|
|
{
|
|
// todo (sangyeob.kim) : 값이 변경되면, 해당 데이터를 참조하는 곳에 notify 를 해줘야 한다.
|
|
// Client, 타 Servers , Building Contents 에서 관리하고 있는 Rooms
|
|
// ....
|
|
|
|
return await Task.FromResult(new Result());
|
|
}
|
|
} |