2024-09-10 00:31:40 +08:00
|
|
|
|
using System;
|
2024-09-10 01:13:20 +08:00
|
|
|
|
using PSO2SERVER.Models;
|
2024-09-10 00:31:40 +08:00
|
|
|
|
|
2024-11-27 18:05:53 +08:00
|
|
|
|
namespace PSO2SERVER.Protocol.Packets
|
2024-09-10 00:31:40 +08:00
|
|
|
|
{
|
|
|
|
|
public class SystemMessagePacket : Packet
|
|
|
|
|
{
|
2024-09-22 00:08:44 +08:00
|
|
|
|
public enum MessageType : UInt32
|
2024-09-10 00:31:40 +08:00
|
|
|
|
{
|
|
|
|
|
GoldenTicker = 0,
|
|
|
|
|
AdminMessage,
|
|
|
|
|
AdminMessageInstant,
|
|
|
|
|
SystemMessage,
|
2024-09-22 00:08:44 +08:00
|
|
|
|
GenericMessage,
|
|
|
|
|
EventInformationYellow,
|
|
|
|
|
EventInformationGreen,
|
|
|
|
|
ImportantMessage,
|
|
|
|
|
PopupMessage,
|
|
|
|
|
Undefined = 0xFFFFFFFF,
|
2024-09-10 00:31:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private readonly string _message;
|
2024-09-22 11:14:48 +08:00
|
|
|
|
//private string _unk;
|
2024-09-10 00:31:40 +08:00
|
|
|
|
private readonly MessageType _type;
|
2024-09-22 11:14:48 +08:00
|
|
|
|
//private uint _msg_num;
|
2024-09-10 00:31:40 +08:00
|
|
|
|
|
|
|
|
|
public SystemMessagePacket(string message, MessageType type)
|
|
|
|
|
{
|
|
|
|
|
_message = message;
|
|
|
|
|
_type = type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region implemented abstract members of Packet
|
|
|
|
|
|
|
|
|
|
public override byte[] Build()
|
|
|
|
|
{
|
|
|
|
|
var writer = new PacketWriter();
|
|
|
|
|
writer.WriteUtf16(_message, 0x78F7, 0xA2);
|
|
|
|
|
writer.Write((UInt32) _type);
|
|
|
|
|
|
|
|
|
|
return writer.ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override PacketHeader GetHeader()
|
|
|
|
|
{
|
2024-09-22 00:08:44 +08:00
|
|
|
|
return new PacketHeader(0x19, 0x01, PacketFlags.PACKED);
|
2024-09-10 00:31:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|