Files
DanhengServer-OpenSource/GameServer/Server/Packet/Send/Raid/PacketGetSaveRaidScRsp.cs
Somebody 87d228eb79 Feature:Asynchronous Operation & Formatting Code
- Now the async operation is enabled!
- Code formatted by Resharper plugin <3
2024-07-22 17:12:03 +08:00

33 lines
1.0 KiB
C#

using EggLink.DanhengServer.Game.Player;
using EggLink.DanhengServer.Proto;
using EggLink.DanhengServer.Server.Packet;
namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.Raid;
public class PacketGetSaveRaidScRsp : BasePacket
{
public PacketGetSaveRaidScRsp(PlayerInstance player, int raidId, int worldLevel) : base(CmdIds.GetSaveRaidScRsp)
{
var proto = new GetSaveRaidScRsp();
if (player.RaidManager!.RaidData.RaidRecordDatas.TryGetValue(raidId, out var dict))
{
if (dict.TryGetValue(worldLevel, out var record))
{
proto.RaidId = (uint)record.RaidId;
proto.WorldLevel = (uint)record.WorldLevel;
proto.IsSave = record.Status != RaidStatus.Finish && record.Status != RaidStatus.None;
}
else
{
proto.Retcode = (uint)Retcode.RetRaidNoSave;
}
}
else
{
proto.Retcode = (uint)Retcode.RetRaidNoSave;
}
SetData(proto);
}
}