PSO2SERVER/Server/Protocol/Packets/19-LobbyPacket/19-09-SetLobbyEventPacket.cs

53 lines
1.6 KiB
C#
Raw Normal View History

2024-09-16 17:09:36 +08:00
using PSO2SERVER.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Protocol.Packets
2024-09-16 17:09:36 +08:00
{
public class SetLobbyEventPacket : Packet
2024-09-16 17:09:36 +08:00
{
2024-12-07 01:44:49 +08:00
/// Event string ID.
public string event_name { get; set; } //Ascii
/// Voice line string ID.
public string voice_line { get; set; } //Ascii
/// Event start timestamp.
public Duration start_time { get; set; }
/// Event end timestamp.
public Duration end_time { get; set; }
public uint repeat_secs { get; set; }
public ulong unk4 { get; set; }
2024-09-16 17:09:36 +08:00
2024-12-07 01:44:49 +08:00
public SetLobbyEventPacket(string eventname, string voiceline, Duration starttime, Duration endtime, uint repeatsecs, ulong unk4)
2024-09-16 17:09:36 +08:00
{
2024-12-07 01:44:49 +08:00
this.event_name = eventname;
this.voice_line = voiceline;
this.start_time = starttime;
this.end_time = endtime;
this.repeat_secs = repeatsecs;
this.unk4 = unk4;
2024-09-16 17:09:36 +08:00
}
#region implemented abstract members of Packet
public override byte[] Build()
{
2024-09-17 11:29:41 +08:00
var pkt = new PacketWriter();
2024-12-07 01:44:49 +08:00
pkt.WriteAscii(event_name, 0xA6E4, 0xFB);
pkt.WriteAscii(voice_line, 0xA6E4, 0xFB);
pkt.WriteStruct(start_time);
pkt.WriteStruct(end_time);
pkt.Write(repeat_secs);
pkt.Write(unk4);
2024-09-17 11:29:41 +08:00
return pkt.ToArray();
2024-09-16 17:09:36 +08:00
}
public override PacketHeader GetHeader()
{
2024-12-07 01:44:49 +08:00
return new PacketHeader(0x19, 0x09, PacketFlags.PACKED);
2024-09-16 17:09:36 +08:00
}
#endregion
}
}