2019-06-18 22:55:32 -04:00
|
|
|
|
/*
|
|
|
|
|
===========================================================================
|
|
|
|
|
Copyright (C) 2015-2019 Project Meteor Dev Team
|
|
|
|
|
|
|
|
|
|
This file is part of Project Meteor Server.
|
|
|
|
|
|
|
|
|
|
Project Meteor Server is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
Project Meteor Server is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
|
|
|
|
===========================================================================
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using FFXIVClassic.Common;
|
2016-08-22 10:43:04 -04:00
|
|
|
|
using System;
|
2015-09-03 22:20:53 -04:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Lobby_Server.packets
|
|
|
|
|
{
|
|
|
|
|
class ErrorPacket
|
|
|
|
|
{
|
|
|
|
|
private const ushort OPCODE = 0x02;
|
|
|
|
|
|
|
|
|
|
private UInt64 sequence;
|
|
|
|
|
private uint errorCode;
|
|
|
|
|
private uint statusCode;
|
|
|
|
|
private uint textId;
|
|
|
|
|
private string message;
|
|
|
|
|
|
|
|
|
|
public ErrorPacket(UInt64 sequence, uint errorCode, uint statusCode, uint textId, string message)
|
|
|
|
|
{
|
|
|
|
|
this.sequence = sequence;
|
|
|
|
|
this.errorCode = errorCode;
|
|
|
|
|
this.statusCode = statusCode;
|
|
|
|
|
this.textId = textId;
|
|
|
|
|
this.message = message;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-14 21:29:10 +01:00
|
|
|
|
public SubPacket BuildPacket()
|
2015-09-03 22:20:53 -04:00
|
|
|
|
{
|
|
|
|
|
MemoryStream memStream = new MemoryStream(0x210);
|
|
|
|
|
BinaryWriter binWriter = new BinaryWriter(memStream);
|
|
|
|
|
|
|
|
|
|
binWriter.Write(sequence);
|
|
|
|
|
binWriter.Write(errorCode);
|
|
|
|
|
binWriter.Write(statusCode);
|
|
|
|
|
binWriter.Write(textId);
|
2015-09-08 00:42:02 -04:00
|
|
|
|
binWriter.Write(Encoding.ASCII.GetBytes(message));
|
2015-09-03 22:20:53 -04:00
|
|
|
|
|
|
|
|
|
byte[] data = memStream.GetBuffer();
|
|
|
|
|
binWriter.Dispose();
|
|
|
|
|
memStream.Dispose();
|
2017-06-29 11:38:28 -04:00
|
|
|
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
|
|
|
|
subpacket.SetTargetId(0xe0006868);
|
2015-09-03 22:20:53 -04:00
|
|
|
|
return subpacket;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|