3907 lines
146 KiB
C#
3907 lines
146 KiB
C#
// <copyright file="ClientToServerPacketTests.cs" company="MUnique">
|
|
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
|
// </copyright>
|
|
|
|
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This source code was auto-generated by an XSL transformation.
|
|
// Do not change this file. Instead, change the XML data which contains
|
|
// the packet definitions and re-run the transformation (rebuild this project).
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace MUnique.OpenMU.Network.Packets.Tests.ClientToServer;
|
|
|
|
using System;
|
|
using System.Text;
|
|
using NUnit.Framework;
|
|
using MUnique.OpenMU.Network.Packets.ClientToServer;
|
|
|
|
/// <summary>
|
|
/// Auto-generated tests for packet structures to validate packet definitions.
|
|
/// </summary>
|
|
[TestFixture]
|
|
public class PacketStructureTests
|
|
{
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for Ping.
|
|
/// </summary>
|
|
[Test]
|
|
public void Ping_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 12;
|
|
var actualLength = PingRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'TickCount' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TickCount' exceeds packet boundary");
|
|
|
|
// Validate field 'AttackSpeed' boundary
|
|
Assert.That(8 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'AttackSpeed' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ChecksumResponse.
|
|
/// </summary>
|
|
[Test]
|
|
public void ChecksumResponse_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = ChecksumResponseRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Checksum' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Checksum' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PublicChatMessage.
|
|
/// </summary>
|
|
[Test]
|
|
public void PublicChatMessage_PacketSizeValidation()
|
|
{
|
|
// Variable-length packet validation
|
|
// Test GetRequiredSize method with sample data
|
|
const string testString = "TestData";
|
|
var calculatedSize = PublicChatMessageRef.GetRequiredSize(testString);
|
|
var expectedMinSize = Encoding.UTF8.GetByteCount(testString) + 1 + 13;
|
|
|
|
Assert.That(calculatedSize, Is.GreaterThanOrEqualTo(expectedMinSize),
|
|
"GetRequiredSize calculation incorrect for string field");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for WhisperMessage.
|
|
/// </summary>
|
|
[Test]
|
|
public void WhisperMessage_PacketSizeValidation()
|
|
{
|
|
// Variable-length packet validation
|
|
// Test GetRequiredSize method with sample data
|
|
const string testString = "TestData";
|
|
var calculatedSize = WhisperMessageRef.GetRequiredSize(testString);
|
|
var expectedMinSize = Encoding.UTF8.GetByteCount(testString) + 1 + 13;
|
|
|
|
Assert.That(calculatedSize, Is.GreaterThanOrEqualTo(expectedMinSize),
|
|
"GetRequiredSize calculation incorrect for string field");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LoginLongPassword.
|
|
/// </summary>
|
|
[Test]
|
|
public void LoginLongPassword_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 60;
|
|
var actualLength = LoginLongPasswordRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Username' boundary
|
|
Assert.That(4 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Username' exceeds packet boundary");
|
|
|
|
// Validate field 'Password' boundary
|
|
Assert.That(14 + 20, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Password' exceeds packet boundary");
|
|
|
|
// Validate field 'TickCount' boundary
|
|
Assert.That(34 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TickCount' exceeds packet boundary");
|
|
|
|
// Validate field 'ClientVersion' boundary
|
|
Assert.That(38 + 5, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ClientVersion' exceeds packet boundary");
|
|
|
|
// Validate field 'ClientSerial' boundary
|
|
Assert.That(43 + 16, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ClientSerial' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LoginShortPassword.
|
|
/// </summary>
|
|
[Test]
|
|
public void LoginShortPassword_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 50;
|
|
var actualLength = LoginShortPasswordRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Username' boundary
|
|
Assert.That(4 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Username' exceeds packet boundary");
|
|
|
|
// Validate field 'Password' boundary
|
|
Assert.That(14 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Password' exceeds packet boundary");
|
|
|
|
// Validate field 'TickCount' boundary
|
|
Assert.That(24 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TickCount' exceeds packet boundary");
|
|
|
|
// Validate field 'ClientVersion' boundary
|
|
Assert.That(28 + 5, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ClientVersion' exceeds packet boundary");
|
|
|
|
// Validate field 'ClientSerial' boundary
|
|
Assert.That(33 + 16, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ClientSerial' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for Login075.
|
|
/// </summary>
|
|
[Test]
|
|
public void Login075_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 48;
|
|
var actualLength = Login075Ref.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Username' boundary
|
|
Assert.That(4 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Username' exceeds packet boundary");
|
|
|
|
// Validate field 'Password' boundary
|
|
Assert.That(14 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Password' exceeds packet boundary");
|
|
|
|
// Validate field 'TickCount' boundary
|
|
Assert.That(24 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TickCount' exceeds packet boundary");
|
|
|
|
// Validate field 'ClientVersion' boundary
|
|
Assert.That(28 + 3, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ClientVersion' exceeds packet boundary");
|
|
|
|
// Validate field 'ClientSerial' boundary
|
|
Assert.That(31 + 16, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ClientSerial' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LogOut.
|
|
/// </summary>
|
|
[Test]
|
|
public void LogOut_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = LogOutRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Type' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Type' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LogOutByCheatDetection.
|
|
/// </summary>
|
|
[Test]
|
|
public void LogOutByCheatDetection_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = LogOutByCheatDetectionRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Type' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Type' exceeds packet boundary");
|
|
|
|
// Validate field 'Param' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Param' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ResetCharacterPointRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void ResetCharacterPointRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = ResetCharacterPointRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PlayerShopSetItemPrice.
|
|
/// </summary>
|
|
[Test]
|
|
public void PlayerShopSetItemPrice_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 9;
|
|
var actualLength = PlayerShopSetItemPriceRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ItemSlot' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemSlot' exceeds packet boundary");
|
|
|
|
// Validate field 'Price' boundary
|
|
Assert.That(5 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Price' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PlayerShopOpen.
|
|
/// </summary>
|
|
[Test]
|
|
public void PlayerShopOpen_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 30;
|
|
var actualLength = PlayerShopOpenRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'StoreName' boundary
|
|
Assert.That(4 + 26, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'StoreName' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PlayerShopClose.
|
|
/// </summary>
|
|
[Test]
|
|
public void PlayerShopClose_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = PlayerShopCloseRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PlayerShopItemListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void PlayerShopItemListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 16;
|
|
var actualLength = PlayerShopItemListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PlayerId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerId' exceeds packet boundary");
|
|
|
|
// Validate field 'PlayerName' boundary
|
|
Assert.That(6 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerName' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PlayerShopItemBuyRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void PlayerShopItemBuyRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 17;
|
|
var actualLength = PlayerShopItemBuyRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PlayerId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerId' exceeds packet boundary");
|
|
|
|
// Validate field 'PlayerName' boundary
|
|
Assert.That(6 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerName' exceeds packet boundary");
|
|
|
|
// Validate field 'ItemSlot' boundary
|
|
Assert.That(16 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PlayerShopCloseOther.
|
|
/// </summary>
|
|
[Test]
|
|
public void PlayerShopCloseOther_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 16;
|
|
var actualLength = PlayerShopCloseOtherRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PlayerId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerId' exceeds packet boundary");
|
|
|
|
// Validate field 'PlayerName' boundary
|
|
Assert.That(6 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerName' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PickupItemRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void PickupItemRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = PickupItemRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ItemId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PickupItemRequest075.
|
|
/// </summary>
|
|
[Test]
|
|
public void PickupItemRequest075_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = PickupItemRequest075Ref.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ItemId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for DropItemRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void DropItemRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = DropItemRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'TargetX' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetX' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetY' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetY' exceeds packet boundary");
|
|
|
|
// Validate field 'ItemSlot' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ItemMoveRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void ItemMoveRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 19;
|
|
var actualLength = ItemMoveRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'FromStorage' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'FromStorage' exceeds packet boundary");
|
|
|
|
// Validate field 'FromSlot' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'FromSlot' exceeds packet boundary");
|
|
|
|
// Validate field 'ItemData' boundary
|
|
Assert.That(5 + 12, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemData' exceeds packet boundary");
|
|
|
|
// Validate field 'ToStorage' boundary
|
|
Assert.That(17 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ToStorage' exceeds packet boundary");
|
|
|
|
// Validate field 'ToSlot' boundary
|
|
Assert.That(18 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ToSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ItemMoveRequestExtended.
|
|
/// </summary>
|
|
[Test]
|
|
public void ItemMoveRequestExtended_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = ItemMoveRequestExtendedRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'FromStorage' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'FromStorage' exceeds packet boundary");
|
|
|
|
// Validate field 'FromSlot' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'FromSlot' exceeds packet boundary");
|
|
|
|
// Validate field 'ToStorage' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ToStorage' exceeds packet boundary");
|
|
|
|
// Validate field 'ToSlot' boundary
|
|
Assert.That(6 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ToSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ConsumeItemRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void ConsumeItemRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = ConsumeItemRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ItemSlot' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemSlot' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetSlot' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetSlot' exceeds packet boundary");
|
|
|
|
// Validate field 'FruitConsumption' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'FruitConsumption' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ConsumeItemRequest075.
|
|
/// </summary>
|
|
[Test]
|
|
public void ConsumeItemRequest075_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = ConsumeItemRequest075Ref.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ItemSlot' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemSlot' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetSlot' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for TalkToNpcRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void TalkToNpcRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = TalkToNpcRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'NpcId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'NpcId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CloseNpcRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CloseNpcRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = CloseNpcRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for BuyItemFromNpcRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void BuyItemFromNpcRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = BuyItemFromNpcRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ItemSlot' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for SellItemToNpcRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void SellItemToNpcRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = SellItemToNpcRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ItemSlot' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for RepairItemRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void RepairItemRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = RepairItemRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ItemSlot' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemSlot' exceeds packet boundary");
|
|
|
|
// Validate field 'IsSelfRepair' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'IsSelfRepair' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for WarpCommandRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void WarpCommandRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 10;
|
|
var actualLength = WarpCommandRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'CommandKey' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CommandKey' exceeds packet boundary");
|
|
|
|
// Validate field 'WarpInfoIndex' boundary
|
|
Assert.That(8 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'WarpInfoIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for EnterGateRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void EnterGateRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = EnterGateRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'GateNumber' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GateNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'TeleportTargetX' boundary
|
|
Assert.That(6 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TeleportTargetX' exceeds packet boundary");
|
|
|
|
// Validate field 'TeleportTargetY' boundary
|
|
Assert.That(7 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TeleportTargetY' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for EnterGateRequest075.
|
|
/// </summary>
|
|
[Test]
|
|
public void EnterGateRequest075_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = EnterGateRequest075Ref.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'GateNumber' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GateNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'TeleportTargetX' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TeleportTargetX' exceeds packet boundary");
|
|
|
|
// Validate field 'TeleportTargetY' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TeleportTargetY' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for TeleportTarget.
|
|
/// </summary>
|
|
[Test]
|
|
public void TeleportTarget_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = TeleportTargetRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'TargetId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetId' exceeds packet boundary");
|
|
|
|
// Validate field 'TeleportTargetX' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TeleportTargetX' exceeds packet boundary");
|
|
|
|
// Validate field 'TeleportTargetY' boundary
|
|
Assert.That(6 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TeleportTargetY' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ServerChangeAuthentication.
|
|
/// </summary>
|
|
[Test]
|
|
public void ServerChangeAuthentication_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 69;
|
|
var actualLength = ServerChangeAuthenticationRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'AccountXor3' boundary
|
|
Assert.That(4 + 12, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'AccountXor3' exceeds packet boundary");
|
|
|
|
// Validate field 'CharacterNameXor3' boundary
|
|
Assert.That(16 + 12, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CharacterNameXor3' exceeds packet boundary");
|
|
|
|
// Validate field 'AuthCode1' boundary
|
|
Assert.That(28 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'AuthCode1' exceeds packet boundary");
|
|
|
|
// Validate field 'AuthCode2' boundary
|
|
Assert.That(32 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'AuthCode2' exceeds packet boundary");
|
|
|
|
// Validate field 'AuthCode3' boundary
|
|
Assert.That(36 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'AuthCode3' exceeds packet boundary");
|
|
|
|
// Validate field 'AuthCode4' boundary
|
|
Assert.That(40 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'AuthCode4' exceeds packet boundary");
|
|
|
|
// Validate field 'TickCount' boundary
|
|
Assert.That(44 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TickCount' exceeds packet boundary");
|
|
|
|
// Validate field 'ClientVersion' boundary
|
|
Assert.That(48 + 5, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ClientVersion' exceeds packet boundary");
|
|
|
|
// Validate field 'ClientSerial' boundary
|
|
Assert.That(53 + 16, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ClientSerial' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeStatusRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeStatusRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = CastleSiegeStatusRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeRegistrationRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeRegistrationRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = CastleSiegeRegistrationRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeUnregisterRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeUnregisterRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = CastleSiegeUnregisterRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'IsGivingUp' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'IsGivingUp' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeRegistrationStateRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeRegistrationStateRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = CastleSiegeRegistrationStateRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeMarkRegistration.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeMarkRegistration_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = CastleSiegeMarkRegistrationRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ItemIndex' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeDefenseBuyRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeDefenseBuyRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 12;
|
|
var actualLength = CastleSiegeDefenseBuyRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'NpcNumber' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'NpcNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'NpcIndex' boundary
|
|
Assert.That(8 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'NpcIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeDefenseRepairRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeDefenseRepairRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 12;
|
|
var actualLength = CastleSiegeDefenseRepairRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'NpcNumber' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'NpcNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'NpcIndex' boundary
|
|
Assert.That(8 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'NpcIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeDefenseUpgradeRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeDefenseUpgradeRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 20;
|
|
var actualLength = CastleSiegeDefenseUpgradeRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'NpcNumber' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'NpcNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'NpcIndex' boundary
|
|
Assert.That(8 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'NpcIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'NpcUpgradeType' boundary
|
|
Assert.That(12 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'NpcUpgradeType' exceeds packet boundary");
|
|
|
|
// Validate field 'NpcUpgradeValue' boundary
|
|
Assert.That(16 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'NpcUpgradeValue' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeTaxInfoRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeTaxInfoRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = CastleSiegeTaxInfoRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeTaxChangeRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeTaxChangeRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 9;
|
|
var actualLength = CastleSiegeTaxChangeRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'TaxType' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TaxType' exceeds packet boundary");
|
|
|
|
// Validate field 'TaxRate' boundary
|
|
Assert.That(5 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TaxRate' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeTaxMoneyWithdraw.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeTaxMoneyWithdraw_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = CastleSiegeTaxMoneyWithdrawRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Amount' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Amount' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ToggleCastleGateRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void ToggleCastleGateRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = ToggleCastleGateRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'CloseState' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CloseState' exceeds packet boundary");
|
|
|
|
// Validate field 'GateId' boundary
|
|
Assert.That(5 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GateId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleGuildCommand.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleGuildCommand_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = CastleGuildCommandRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Team' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Team' exceeds packet boundary");
|
|
|
|
// Validate field 'PositionX' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PositionX' exceeds packet boundary");
|
|
|
|
// Validate field 'PositionY' boundary
|
|
Assert.That(6 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PositionY' exceeds packet boundary");
|
|
|
|
// Validate field 'Command' boundary
|
|
Assert.That(7 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Command' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeHuntingZoneEntranceSetting.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeHuntingZoneEntranceSetting_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = CastleSiegeHuntingZoneEntranceSettingRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'IsPublic' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'IsPublic' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeGateListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeGateListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = CastleSiegeGateListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeStatueListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeStatueListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = CastleSiegeStatueListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeRegisteredGuildsListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeRegisteredGuildsListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = CastleSiegeRegisteredGuildsListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleOwnerListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleOwnerListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = CastleOwnerListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for FireCatapultRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void FireCatapultRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = FireCatapultRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'CatapultId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CatapultId' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetAreaIndex' boundary
|
|
Assert.That(6 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetAreaIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for WeaponExplosionRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void WeaponExplosionRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = WeaponExplosionRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'CatapultId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CatapultId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildLogoOfCastleOwnerRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildLogoOfCastleOwnerRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = GuildLogoOfCastleOwnerRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CastleSiegeHuntingZoneEnterRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CastleSiegeHuntingZoneEnterRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = CastleSiegeHuntingZoneEnterRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Money' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Money' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CrywolfInfoRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CrywolfInfoRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = CrywolfInfoRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CrywolfContractRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CrywolfContractRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = CrywolfContractRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'StatueId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'StatueId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CrywolfChaosRateBenefitRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CrywolfChaosRateBenefitRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = CrywolfChaosRateBenefitRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for WhiteAngelItemRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void WhiteAngelItemRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = WhiteAngelItemRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for EnterOnWerewolfRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void EnterOnWerewolfRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = EnterOnWerewolfRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for EnterOnGatekeeperRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void EnterOnGatekeeperRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = EnterOnGatekeeperRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LeoHelperItemRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LeoHelperItemRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = LeoHelperItemRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for MoveToDeviasBySnowmanRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void MoveToDeviasBySnowmanRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = MoveToDeviasBySnowmanRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for SantaClausItemRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void SantaClausItemRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = SantaClausItemRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for KanturuInfoRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void KanturuInfoRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = KanturuInfoRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for KanturuEnterRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void KanturuEnterRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = KanturuEnterRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for RaklionStateInfoRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void RaklionStateInfoRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = RaklionStateInfoRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CashShopPointInfoRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CashShopPointInfoRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = CashShopPointInfoRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CashShopOpenState.
|
|
/// </summary>
|
|
[Test]
|
|
public void CashShopOpenState_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = CashShopOpenStateRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'IsClosed' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'IsClosed' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CashShopItemBuyRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CashShopItemBuyRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 23;
|
|
var actualLength = CashShopItemBuyRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PackageMainIndex' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PackageMainIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'Category' boundary
|
|
Assert.That(8 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Category' exceeds packet boundary");
|
|
|
|
// Validate field 'ProductMainIndex' boundary
|
|
Assert.That(12 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ProductMainIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'ItemIndex' boundary
|
|
Assert.That(16 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'CoinIndex' boundary
|
|
Assert.That(18 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CoinIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'MileageFlag' boundary
|
|
Assert.That(22 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'MileageFlag' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CashShopItemGiftRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CashShopItemGiftRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 234;
|
|
var actualLength = CashShopItemGiftRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PackageMainIndex' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PackageMainIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'Category' boundary
|
|
Assert.That(8 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Category' exceeds packet boundary");
|
|
|
|
// Validate field 'ProductMainIndex' boundary
|
|
Assert.That(12 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ProductMainIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'ItemIndex' boundary
|
|
Assert.That(16 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'CoinIndex' boundary
|
|
Assert.That(18 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CoinIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'MileageFlag' boundary
|
|
Assert.That(22 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'MileageFlag' exceeds packet boundary");
|
|
|
|
// Validate field 'GiftReceiverName' boundary
|
|
Assert.That(23 + 11, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GiftReceiverName' exceeds packet boundary");
|
|
|
|
// Validate field 'GiftText' boundary
|
|
Assert.That(34 + 200, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GiftText' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CashShopStorageListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CashShopStorageListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 10;
|
|
var actualLength = CashShopStorageListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PageIndex' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PageIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'InventoryType' boundary
|
|
Assert.That(8 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'InventoryType' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CashShopDeleteStorageItemRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CashShopDeleteStorageItemRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 234;
|
|
var actualLength = CashShopDeleteStorageItemRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'BaseItemCode' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'BaseItemCode' exceeds packet boundary");
|
|
|
|
// Validate field 'MainItemCode' boundary
|
|
Assert.That(8 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'MainItemCode' exceeds packet boundary");
|
|
|
|
// Validate field 'ProductType' boundary
|
|
Assert.That(12 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ProductType' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CashShopStorageItemConsumeRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CashShopStorageItemConsumeRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 15;
|
|
var actualLength = CashShopStorageItemConsumeRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'BaseItemCode' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'BaseItemCode' exceeds packet boundary");
|
|
|
|
// Validate field 'MainItemCode' boundary
|
|
Assert.That(8 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'MainItemCode' exceeds packet boundary");
|
|
|
|
// Validate field 'ItemIndex' boundary
|
|
Assert.That(12 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'ProductType' boundary
|
|
Assert.That(14 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ProductType' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CashShopEventItemListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CashShopEventItemListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = CashShopEventItemListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'CategoryIndex' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CategoryIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for UnlockVault.
|
|
/// </summary>
|
|
[Test]
|
|
public void UnlockVault_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = UnlockVaultRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Pin' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Pin' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for SetVaultPin.
|
|
/// </summary>
|
|
[Test]
|
|
public void SetVaultPin_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 27;
|
|
var actualLength = SetVaultPinRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Pin' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Pin' exceeds packet boundary");
|
|
|
|
// Validate field 'Password' boundary
|
|
Assert.That(6 + 20, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Password' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for RemoveVaultPin.
|
|
/// </summary>
|
|
[Test]
|
|
public void RemoveVaultPin_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 27;
|
|
var actualLength = RemoveVaultPinRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Password' boundary
|
|
Assert.That(6 + 20, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Password' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for VaultClosed.
|
|
/// </summary>
|
|
[Test]
|
|
public void VaultClosed_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = VaultClosedRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for VaultMoveMoneyRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void VaultMoveMoneyRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = VaultMoveMoneyRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Direction' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Direction' exceeds packet boundary");
|
|
|
|
// Validate field 'Amount' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Amount' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LahapJewelMixRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LahapJewelMixRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = LahapJewelMixRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Operation' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Operation' exceeds packet boundary");
|
|
|
|
// Validate field 'Item' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Item' exceeds packet boundary");
|
|
|
|
// Validate field 'MixingStackSize' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'MixingStackSize' exceeds packet boundary");
|
|
|
|
// Validate field 'UnmixingSourceSlot' boundary
|
|
Assert.That(6 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'UnmixingSourceSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PartyListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void PartyListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = PartyListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PartyPlayerKickRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void PartyPlayerKickRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = PartyPlayerKickRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PlayerIndex' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PartyInviteRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void PartyInviteRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = PartyInviteRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'TargetPlayerId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetPlayerId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PartyInviteResponse.
|
|
/// </summary>
|
|
[Test]
|
|
public void PartyInviteResponse_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = PartyInviteResponseRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Accepted' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Accepted' exceeds packet boundary");
|
|
|
|
// Validate field 'RequesterId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'RequesterId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for WalkRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void WalkRequest_PacketSizeValidation()
|
|
{
|
|
// Variable-length packet validation
|
|
// Test GetRequiredSize method with sample data
|
|
const int testBinaryLength = 10;
|
|
var calculatedSize = WalkRequestRef.GetRequiredSize(testBinaryLength);
|
|
var expectedMinSize = testBinaryLength + 6;
|
|
|
|
Assert.That(calculatedSize, Is.GreaterThanOrEqualTo(expectedMinSize),
|
|
"GetRequiredSize calculation incorrect for binary field");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for WalkRequest075.
|
|
/// </summary>
|
|
[Test]
|
|
public void WalkRequest075_PacketSizeValidation()
|
|
{
|
|
// Variable-length packet validation
|
|
// Test GetRequiredSize method with sample data
|
|
const int testBinaryLength = 10;
|
|
var calculatedSize = WalkRequest075Ref.GetRequiredSize(testBinaryLength);
|
|
var expectedMinSize = testBinaryLength + 6;
|
|
|
|
Assert.That(calculatedSize, Is.GreaterThanOrEqualTo(expectedMinSize),
|
|
"GetRequiredSize calculation incorrect for binary field");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for InstantMoveRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void InstantMoveRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = InstantMoveRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'TargetX' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetX' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetY' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetY' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for AnimationRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void AnimationRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = AnimationRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Rotation' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Rotation' exceeds packet boundary");
|
|
|
|
// Validate field 'AnimationNumber' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'AnimationNumber' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for RequestCharacterList.
|
|
/// </summary>
|
|
[Test]
|
|
public void RequestCharacterList_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = RequestCharacterListRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Language' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Language' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CreateCharacter.
|
|
/// </summary>
|
|
[Test]
|
|
public void CreateCharacter_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 15;
|
|
var actualLength = CreateCharacterRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Name' boundary
|
|
Assert.That(4 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Name' exceeds packet boundary");
|
|
|
|
// Validate field 'Class' boundary
|
|
Assert.That(14 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Class' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for DeleteCharacter.
|
|
/// </summary>
|
|
[Test]
|
|
public void DeleteCharacter_PacketSizeValidation()
|
|
{
|
|
// Variable-length packet validation
|
|
// Test GetRequiredSize method with sample data
|
|
const string testString = "TestData";
|
|
var calculatedSize = DeleteCharacterRef.GetRequiredSize(testString);
|
|
var expectedMinSize = Encoding.UTF8.GetByteCount(testString) + 1 + 14;
|
|
|
|
Assert.That(calculatedSize, Is.GreaterThanOrEqualTo(expectedMinSize),
|
|
"GetRequiredSize calculation incorrect for string field");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for SelectCharacter.
|
|
/// </summary>
|
|
[Test]
|
|
public void SelectCharacter_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 14;
|
|
var actualLength = SelectCharacterRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Name' boundary
|
|
Assert.That(4 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Name' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for FocusCharacter.
|
|
/// </summary>
|
|
[Test]
|
|
public void FocusCharacter_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 14;
|
|
var actualLength = FocusCharacterRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Name' boundary
|
|
Assert.That(4 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Name' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for IncreaseCharacterStatPoint.
|
|
/// </summary>
|
|
[Test]
|
|
public void IncreaseCharacterStatPoint_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = IncreaseCharacterStatPointRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'StatType' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'StatType' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for InventoryRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void InventoryRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = InventoryRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ClientReadyAfterMapChange.
|
|
/// </summary>
|
|
[Test]
|
|
public void ClientReadyAfterMapChange_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = ClientReadyAfterMapChangeRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for SaveKeyConfiguration.
|
|
/// </summary>
|
|
[Test]
|
|
public void SaveKeyConfiguration_PacketSizeValidation()
|
|
{
|
|
// Variable-length packet validation
|
|
// Test GetRequiredSize method with sample data
|
|
const int testBinaryLength = 10;
|
|
var calculatedSize = SaveKeyConfigurationRef.GetRequiredSize(testBinaryLength);
|
|
var expectedMinSize = testBinaryLength + 4;
|
|
|
|
Assert.That(calculatedSize, Is.GreaterThanOrEqualTo(expectedMinSize),
|
|
"GetRequiredSize calculation incorrect for binary field");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for AddMasterSkillPoint.
|
|
/// </summary>
|
|
[Test]
|
|
public void AddMasterSkillPoint_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = AddMasterSkillPointRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SkillId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SkillId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for HitRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void HitRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = HitRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'TargetId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetId' exceeds packet boundary");
|
|
|
|
// Validate field 'AttackAnimation' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'AttackAnimation' exceeds packet boundary");
|
|
|
|
// Validate field 'LookingDirection' boundary
|
|
Assert.That(6 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'LookingDirection' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for TargetedSkill.
|
|
/// </summary>
|
|
[Test]
|
|
public void TargetedSkill_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = TargetedSkillRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SkillId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SkillId' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetId' boundary
|
|
Assert.That(5 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for TargetedSkill075.
|
|
/// </summary>
|
|
[Test]
|
|
public void TargetedSkill075_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = TargetedSkill075Ref.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SkillIndex' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SkillIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for TargetedSkill095.
|
|
/// </summary>
|
|
[Test]
|
|
public void TargetedSkill095_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = TargetedSkill095Ref.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SkillIndex' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SkillIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for MagicEffectCancelRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void MagicEffectCancelRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = MagicEffectCancelRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SkillId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SkillId' exceeds packet boundary");
|
|
|
|
// Validate field 'PlayerId' boundary
|
|
Assert.That(5 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for AreaSkill.
|
|
/// </summary>
|
|
[Test]
|
|
public void AreaSkill_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 13;
|
|
var actualLength = AreaSkillRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SkillId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SkillId' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetX' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetX' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetY' boundary
|
|
Assert.That(6 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetY' exceeds packet boundary");
|
|
|
|
// Validate field 'Rotation' boundary
|
|
Assert.That(7 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Rotation' exceeds packet boundary");
|
|
|
|
// Validate field 'ExtraTargetId' boundary
|
|
Assert.That(10 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ExtraTargetId' exceeds packet boundary");
|
|
|
|
// Validate field 'AnimationCounter' boundary
|
|
Assert.That(12 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'AnimationCounter' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for AreaSkillHit.
|
|
/// </summary>
|
|
[Test]
|
|
public void AreaSkillHit_PacketSizeValidation()
|
|
{
|
|
// Basic packet validation
|
|
// Validate header type and field boundaries
|
|
|
|
// Field 'SkillId' starts at index 3 with size 2
|
|
Assert.That(3, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'SkillId' has invalid negative index");
|
|
|
|
// Field 'TargetX' starts at index 5 with size 1
|
|
Assert.That(5, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'TargetX' has invalid negative index");
|
|
|
|
// Field 'TargetY' starts at index 6 with size 1
|
|
Assert.That(6, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'TargetY' has invalid negative index");
|
|
|
|
// Field 'HitCounter' starts at index 7 with size 1
|
|
Assert.That(7, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'HitCounter' has invalid negative index");
|
|
|
|
// Field 'TargetCount' starts at index 8 with size 1
|
|
Assert.That(8, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'TargetCount' has invalid negative index");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for AreaSkill075.
|
|
/// </summary>
|
|
[Test]
|
|
public void AreaSkill075_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = AreaSkill075Ref.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SkillIndex' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SkillIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetX' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetX' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetY' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetY' exceeds packet boundary");
|
|
|
|
// Validate field 'Rotation' boundary
|
|
Assert.That(6 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Rotation' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for AreaSkillHit075.
|
|
/// </summary>
|
|
[Test]
|
|
public void AreaSkillHit075_PacketSizeValidation()
|
|
{
|
|
// Basic packet validation
|
|
// Validate header type and field boundaries
|
|
|
|
// Field 'SkillIndex' starts at index 3 with size 1
|
|
Assert.That(3, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'SkillIndex' has invalid negative index");
|
|
|
|
// Field 'TargetX' starts at index 4 with size 1
|
|
Assert.That(4, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'TargetX' has invalid negative index");
|
|
|
|
// Field 'TargetY' starts at index 5 with size 1
|
|
Assert.That(5, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'TargetY' has invalid negative index");
|
|
|
|
// Field 'TargetCount' starts at index 6 with size 1
|
|
Assert.That(6, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'TargetCount' has invalid negative index");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for AreaSkill095.
|
|
/// </summary>
|
|
[Test]
|
|
public void AreaSkill095_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = AreaSkill095Ref.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SkillIndex' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SkillIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetX' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetX' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetY' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetY' exceeds packet boundary");
|
|
|
|
// Validate field 'Rotation' boundary
|
|
Assert.That(6 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Rotation' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for AreaSkillHit095.
|
|
/// </summary>
|
|
[Test]
|
|
public void AreaSkillHit095_PacketSizeValidation()
|
|
{
|
|
// Basic packet validation
|
|
// Validate header type and field boundaries
|
|
|
|
// Field 'SkillIndex' starts at index 3 with size 1
|
|
Assert.That(3, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'SkillIndex' has invalid negative index");
|
|
|
|
// Field 'TargetX' starts at index 4 with size 1
|
|
Assert.That(4, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'TargetX' has invalid negative index");
|
|
|
|
// Field 'TargetY' starts at index 5 with size 1
|
|
Assert.That(5, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'TargetY' has invalid negative index");
|
|
|
|
// Field 'Counter' starts at index 6 with size 1
|
|
Assert.That(6, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'Counter' has invalid negative index");
|
|
|
|
// Field 'TargetCount' starts at index 7 with size 1
|
|
Assert.That(7, Is.GreaterThanOrEqualTo(0),
|
|
"Field 'TargetCount' has invalid negative index");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for RageAttackRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void RageAttackRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = RageAttackRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SkillId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SkillId' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetId' boundary
|
|
Assert.That(6 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for RageAttackRangeRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void RageAttackRangeRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = RageAttackRangeRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SkillId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SkillId' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetId' boundary
|
|
Assert.That(5 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for TradeCancel.
|
|
/// </summary>
|
|
[Test]
|
|
public void TradeCancel_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = TradeCancelRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for TradeButtonStateChange.
|
|
/// </summary>
|
|
[Test]
|
|
public void TradeButtonStateChange_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = TradeButtonStateChangeRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'NewState' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'NewState' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for TradeRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void TradeRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = TradeRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PlayerId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for TradeRequestResponse.
|
|
/// </summary>
|
|
[Test]
|
|
public void TradeRequestResponse_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = TradeRequestResponseRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'TradeAccepted' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TradeAccepted' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for SetTradeMoney.
|
|
/// </summary>
|
|
[Test]
|
|
public void SetTradeMoney_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = SetTradeMoneyRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Amount' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Amount' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LetterDeleteRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LetterDeleteRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = LetterDeleteRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'LetterIndex' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'LetterIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LetterListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LetterListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = LetterListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LetterSendRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LetterSendRequest_PacketSizeValidation()
|
|
{
|
|
// Variable-length packet validation
|
|
// Test GetRequiredSize method with sample data
|
|
const string testString = "TestData";
|
|
var calculatedSize = LetterSendRequestRef.GetRequiredSize(testString);
|
|
var expectedMinSize = Encoding.UTF8.GetByteCount(testString) + 1 + 82;
|
|
|
|
Assert.That(calculatedSize, Is.GreaterThanOrEqualTo(expectedMinSize),
|
|
"GetRequiredSize calculation incorrect for string field");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LetterReadRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LetterReadRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = LetterReadRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'LetterIndex' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'LetterIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildKickPlayerRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildKickPlayerRequest_PacketSizeValidation()
|
|
{
|
|
// Variable-length packet validation
|
|
// Test GetRequiredSize method with sample data
|
|
const string testString = "TestData";
|
|
var calculatedSize = GuildKickPlayerRequestRef.GetRequiredSize(testString);
|
|
var expectedMinSize = Encoding.UTF8.GetByteCount(testString) + 1 + 13;
|
|
|
|
Assert.That(calculatedSize, Is.GreaterThanOrEqualTo(expectedMinSize),
|
|
"GetRequiredSize calculation incorrect for string field");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildJoinRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildJoinRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = GuildJoinRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'GuildMasterPlayerId' boundary
|
|
Assert.That(3 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GuildMasterPlayerId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildJoinResponse.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildJoinResponse_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = GuildJoinResponseRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Accepted' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Accepted' exceeds packet boundary");
|
|
|
|
// Validate field 'RequesterId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'RequesterId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = GuildListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildCreateRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildCreateRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 44;
|
|
var actualLength = GuildCreateRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'GuildName' boundary
|
|
Assert.That(4 + 8, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GuildName' exceeds packet boundary");
|
|
|
|
// Validate field 'GuildEmblem' boundary
|
|
Assert.That(12 + 32, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GuildEmblem' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildCreateRequest075.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildCreateRequest075_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 43;
|
|
var actualLength = GuildCreateRequest075Ref.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'GuildName' boundary
|
|
Assert.That(3 + 8, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GuildName' exceeds packet boundary");
|
|
|
|
// Validate field 'GuildEmblem' boundary
|
|
Assert.That(11 + 32, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GuildEmblem' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildMasterAnswer.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildMasterAnswer_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = GuildMasterAnswerRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ShowCreationDialog' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ShowCreationDialog' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CancelGuildCreation.
|
|
/// </summary>
|
|
[Test]
|
|
public void CancelGuildCreation_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = CancelGuildCreationRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildWarResponse.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildWarResponse_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = GuildWarResponseRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Accepted' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Accepted' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildInfoRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildInfoRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = GuildInfoRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'GuildId' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GuildId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildRoleAssignRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildRoleAssignRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 15;
|
|
var actualLength = GuildRoleAssignRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Type' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Type' exceeds packet boundary");
|
|
|
|
// Validate field 'Role' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Role' exceeds packet boundary");
|
|
|
|
// Validate field 'PlayerName' boundary
|
|
Assert.That(5 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerName' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildTypeChangeRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildTypeChangeRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = GuildTypeChangeRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'GuildType' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GuildType' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildRelationshipChangeRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildRelationshipChangeRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = GuildRelationshipChangeRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'RelationshipType' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'RelationshipType' exceeds packet boundary");
|
|
|
|
// Validate field 'RequestType' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'RequestType' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetPlayerId' boundary
|
|
Assert.That(5 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetPlayerId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GuildRelationshipChangeResponse.
|
|
/// </summary>
|
|
[Test]
|
|
public void GuildRelationshipChangeResponse_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = GuildRelationshipChangeResponseRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'RelationshipType' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'RelationshipType' exceeds packet boundary");
|
|
|
|
// Validate field 'RequestType' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'RequestType' exceeds packet boundary");
|
|
|
|
// Validate field 'Response' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Response' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetPlayerId' boundary
|
|
Assert.That(6 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetPlayerId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for RequestAllianceList.
|
|
/// </summary>
|
|
[Test]
|
|
public void RequestAllianceList_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = RequestAllianceListRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for RemoveAllianceGuildRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void RemoveAllianceGuildRequest_PacketSizeValidation()
|
|
{
|
|
// Variable-length packet validation
|
|
// Test GetRequiredSize method with sample data
|
|
const string testString = "TestData";
|
|
var calculatedSize = RemoveAllianceGuildRequestRef.GetRequiredSize(testString);
|
|
var expectedMinSize = Encoding.UTF8.GetByteCount(testString) + 1 + 4;
|
|
|
|
Assert.That(calculatedSize, Is.GreaterThanOrEqualTo(expectedMinSize),
|
|
"GetRequiredSize calculation incorrect for string field");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PingResponse.
|
|
/// </summary>
|
|
[Test]
|
|
public void PingResponse_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = PingResponseRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ItemRepair.
|
|
/// </summary>
|
|
[Test]
|
|
public void ItemRepair_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = ItemRepairRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'InventoryItemSlot' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'InventoryItemSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ChaosMachineMixRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void ChaosMachineMixRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = ChaosMachineMixRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'MixType' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'MixType' exceeds packet boundary");
|
|
|
|
// Validate field 'SocketSlot' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SocketSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for CraftingDialogCloseRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void CraftingDialogCloseRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = CraftingDialogCloseRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for FriendListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void FriendListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = FriendListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for FriendAddRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void FriendAddRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 13;
|
|
var actualLength = FriendAddRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'FriendName' boundary
|
|
Assert.That(3 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'FriendName' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for FriendDelete.
|
|
/// </summary>
|
|
[Test]
|
|
public void FriendDelete_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 13;
|
|
var actualLength = FriendDeleteRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'FriendName' boundary
|
|
Assert.That(3 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'FriendName' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ChatRoomCreateRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void ChatRoomCreateRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 13;
|
|
var actualLength = ChatRoomCreateRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'FriendName' boundary
|
|
Assert.That(3 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'FriendName' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for FriendAddResponse.
|
|
/// </summary>
|
|
[Test]
|
|
public void FriendAddResponse_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 14;
|
|
var actualLength = FriendAddResponseRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Accepted' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Accepted' exceeds packet boundary");
|
|
|
|
// Validate field 'FriendRequesterName' boundary
|
|
Assert.That(4 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'FriendRequesterName' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for SetFriendOnlineState.
|
|
/// </summary>
|
|
[Test]
|
|
public void SetFriendOnlineState_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = SetFriendOnlineStateRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'OnlineState' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'OnlineState' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ChatRoomInvitationRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void ChatRoomInvitationRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 19;
|
|
var actualLength = ChatRoomInvitationRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'FriendName' boundary
|
|
Assert.That(3 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'FriendName' exceeds packet boundary");
|
|
|
|
// Validate field 'RoomId' boundary
|
|
Assert.That(13 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'RoomId' exceeds packet boundary");
|
|
|
|
// Validate field 'RequestId' boundary
|
|
Assert.That(15 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'RequestId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LegacyQuestStateRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LegacyQuestStateRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = LegacyQuestStateRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LegacyQuestStateSetRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LegacyQuestStateSetRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = LegacyQuestStateSetRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'QuestNumber' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'NewState' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'NewState' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PetCommandRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void PetCommandRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 7;
|
|
var actualLength = PetCommandRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PetType' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PetType' exceeds packet boundary");
|
|
|
|
// Validate field 'CommandMode' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CommandMode' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetId' boundary
|
|
Assert.That(5 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for PetInfoRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void PetInfoRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = PetInfoRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Pet' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Pet' exceeds packet boundary");
|
|
|
|
// Validate field 'Storage' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Storage' exceeds packet boundary");
|
|
|
|
// Validate field 'ItemSlot' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for IllusionTempleEnterRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void IllusionTempleEnterRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = IllusionTempleEnterRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'MapNumber' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'MapNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'ItemSlot' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for IllusionTempleSkillRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void IllusionTempleSkillRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = IllusionTempleSkillRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SkillNumber' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SkillNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'TargetObjectIndex' boundary
|
|
Assert.That(6 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TargetObjectIndex' exceeds packet boundary");
|
|
|
|
// Validate field 'Distance' boundary
|
|
Assert.That(7 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Distance' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for IllusionTempleRewardRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void IllusionTempleRewardRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = IllusionTempleRewardRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LuckyCoinCountRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LuckyCoinCountRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = LuckyCoinCountRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LuckyCoinRegistrationRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LuckyCoinRegistrationRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = LuckyCoinRegistrationRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LuckyCoinExchangeRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LuckyCoinExchangeRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = LuckyCoinExchangeRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'CoinCount' boundary
|
|
Assert.That(4 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CoinCount' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for DoppelgangerEnterRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void DoppelgangerEnterRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = DoppelgangerEnterRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'TicketItemSlot' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TicketItemSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for EnterMarketPlaceRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void EnterMarketPlaceRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = EnterMarketPlaceRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for MuHelperStatusChangeRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void MuHelperStatusChangeRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = MuHelperStatusChangeRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PauseStatus' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PauseStatus' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for MuHelperSaveDataRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void MuHelperSaveDataRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 261;
|
|
var actualLength = MuHelperSaveDataRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'HelperData' boundary
|
|
Assert.That(4 + 257, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'HelperData' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for QuestSelectRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void QuestSelectRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 9;
|
|
var actualLength = QuestSelectRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'QuestNumber' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'QuestGroup' boundary
|
|
Assert.That(6 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestGroup' exceeds packet boundary");
|
|
|
|
// Validate field 'SelectedTextIndex' boundary
|
|
Assert.That(8 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SelectedTextIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for QuestProceedRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void QuestProceedRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 9;
|
|
var actualLength = QuestProceedRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'QuestNumber' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'QuestGroup' boundary
|
|
Assert.That(6 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestGroup' exceeds packet boundary");
|
|
|
|
// Validate field 'ProceedAction' boundary
|
|
Assert.That(8 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ProceedAction' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for QuestCompletionRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void QuestCompletionRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = QuestCompletionRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'QuestNumber' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'QuestGroup' boundary
|
|
Assert.That(6 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestGroup' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for QuestCancelRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void QuestCancelRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = QuestCancelRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'QuestNumber' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'QuestGroup' boundary
|
|
Assert.That(6 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestGroup' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for QuestClientActionRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void QuestClientActionRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = QuestClientActionRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'QuestNumber' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'QuestGroup' boundary
|
|
Assert.That(6 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestGroup' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ActiveQuestListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void ActiveQuestListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = ActiveQuestListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for QuestStateRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void QuestStateRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 8;
|
|
var actualLength = QuestStateRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'QuestNumber' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestNumber' exceeds packet boundary");
|
|
|
|
// Validate field 'QuestGroup' boundary
|
|
Assert.That(6 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'QuestGroup' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for EventQuestStateListRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void EventQuestStateListRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = EventQuestStateListRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for AvailableQuestsRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void AvailableQuestsRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = AvailableQuestsRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for NpcBuffRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void NpcBuffRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = NpcBuffRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for EnterEmpireGuardianEvent.
|
|
/// </summary>
|
|
[Test]
|
|
public void EnterEmpireGuardianEvent_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = EnterEmpireGuardianEventRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ItemSlot' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemSlot' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GensJoinRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GensJoinRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = GensJoinRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'GensType' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GensType' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GensLeaveRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GensLeaveRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = GensLeaveRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GensRewardRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GensRewardRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = GensRewardRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'GensType' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'GensType' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for GensRankingRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void GensRankingRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = GensRankingRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for DevilSquareEnterRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void DevilSquareEnterRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = DevilSquareEnterRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'SquareLevel' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'SquareLevel' exceeds packet boundary");
|
|
|
|
// Validate field 'TicketItemInventoryIndex' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TicketItemInventoryIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for MiniGameOpeningStateRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void MiniGameOpeningStateRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = MiniGameOpeningStateRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'EventType' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'EventType' exceeds packet boundary");
|
|
|
|
// Validate field 'EventLevel' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'EventLevel' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for EventChipRegistrationRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void EventChipRegistrationRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = EventChipRegistrationRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Type' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Type' exceeds packet boundary");
|
|
|
|
// Validate field 'ItemIndex' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ItemIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for MutoNumberRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void MutoNumberRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = MutoNumberRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for EventChipExitDialog.
|
|
/// </summary>
|
|
[Test]
|
|
public void EventChipExitDialog_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 3;
|
|
var actualLength = EventChipExitDialogRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for EventChipExchangeRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void EventChipExchangeRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = EventChipExchangeRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Type' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Type' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ServerImmigrationRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void ServerImmigrationRequest_PacketSizeValidation()
|
|
{
|
|
// Variable-length packet validation
|
|
// Test GetRequiredSize method with sample data
|
|
const string testString = "TestData";
|
|
var calculatedSize = ServerImmigrationRequestRef.GetRequiredSize(testString);
|
|
var expectedMinSize = Encoding.UTF8.GetByteCount(testString) + 1 + 3;
|
|
|
|
Assert.That(calculatedSize, Is.GreaterThanOrEqualTo(expectedMinSize),
|
|
"GetRequiredSize calculation incorrect for string field");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for LuckyNumberRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void LuckyNumberRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 18;
|
|
var actualLength = LuckyNumberRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Serial1' boundary
|
|
Assert.That(3 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Serial1' exceeds packet boundary");
|
|
|
|
// Validate field 'Serial2' boundary
|
|
Assert.That(8 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Serial2' exceeds packet boundary");
|
|
|
|
// Validate field 'Serial3' boundary
|
|
Assert.That(13 + 4, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Serial3' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for BloodCastleEnterRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void BloodCastleEnterRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = BloodCastleEnterRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'CastleLevel' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CastleLevel' exceeds packet boundary");
|
|
|
|
// Validate field 'TicketItemInventoryIndex' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TicketItemInventoryIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for MiniGameEventCountRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void MiniGameEventCountRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = MiniGameEventCountRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'MiniGame' boundary
|
|
Assert.That(3 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'MiniGame' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ChaosCastleEnterRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void ChaosCastleEnterRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = ChaosCastleEnterRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'CastleLevel' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'CastleLevel' exceeds packet boundary");
|
|
|
|
// Validate field 'TicketItemInventoryIndex' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'TicketItemInventoryIndex' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for ChaosCastlePositionSet.
|
|
/// </summary>
|
|
[Test]
|
|
public void ChaosCastlePositionSet_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 6;
|
|
var actualLength = ChaosCastlePositionSetRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PositionX' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PositionX' exceeds packet boundary");
|
|
|
|
// Validate field 'PositionY' boundary
|
|
Assert.That(5 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PositionY' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for DuelStartRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void DuelStartRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 16;
|
|
var actualLength = DuelStartRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'PlayerId' boundary
|
|
Assert.That(4 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerId' exceeds packet boundary");
|
|
|
|
// Validate field 'PlayerName' boundary
|
|
Assert.That(6 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerName' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for DuelStartResponse.
|
|
/// </summary>
|
|
[Test]
|
|
public void DuelStartResponse_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 17;
|
|
var actualLength = DuelStartResponseRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'Response' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'Response' exceeds packet boundary");
|
|
|
|
// Validate field 'PlayerId' boundary
|
|
Assert.That(5 + 2, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerId' exceeds packet boundary");
|
|
|
|
// Validate field 'PlayerName' boundary
|
|
Assert.That(7 + 10, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'PlayerName' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for DuelStopRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void DuelStopRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = DuelStopRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for DuelChannelJoinRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void DuelChannelJoinRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 5;
|
|
var actualLength = DuelChannelJoinRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
|
|
// Validate field 'ChannelId' boundary
|
|
Assert.That(4 + 1, Is.LessThanOrEqualTo(expectedLength),
|
|
"Field 'ChannelId' exceeds packet boundary");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tests the packet size calculation for DuelChannelQuitRequest.
|
|
/// </summary>
|
|
[Test]
|
|
public void DuelChannelQuitRequest_PacketSizeValidation()
|
|
{
|
|
// Fixed-length packet validation
|
|
const int expectedLength = 4;
|
|
var actualLength = DuelChannelQuitRequestRef.Length;
|
|
|
|
Assert.That(actualLength, Is.EqualTo(expectedLength),
|
|
"Packet length mismatch: declared length does not match calculated size");
|
|
}
|
|
}
|