Add Castle Siege ServerToClient packet definitions#736
Draft
Add Castle Siege ServerToClient packet definitions#736
Conversation
Co-authored-by: sven-n <5238610+sven-n@users.noreply.github.com> Agent-Logs-Url: https://github.com/MUnique/OpenMU/sessions/e54e4799-894b-41f7-9cb1-9ecf15b0e759
…oClientPackets.xml Co-authored-by: sven-n <5238610+sven-n@users.noreply.github.com> Agent-Logs-Url: https://github.com/MUnique/OpenMU/sessions/e54e4799-894b-41f7-9cb1-9ecf15b0e759
Copilot
AI
changed the title
[WIP] Define all Castle Siege and Guild Alliance network packet structures
Add Castle Siege & Guild Alliance ServerToClient packet definitions
Mar 24, 2026
Member
- Keep guild alliance packets from master (#737) unchanged (validated by sven-n) - Remove duplicate E6/E9 packets and global enum definitions added by this branch - The GuildRelationshipChangeResult (E6), AllianceList (E9), GuildRelationshipRequest (E5), and RemoveAllianceGuildResult (EB-01) from master are retained as-is Co-authored-by: sven-n <5238610+sven-n@users.noreply.github.com>
Contributor
Author
Done in commit |
Copilot
AI
changed the title
Add Castle Siege & Guild Alliance ServerToClient packet definitions
Add Castle Siege ServerToClient packet definitions
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All C→S Castle Siege packets were already defined; this PR fills the gap by adding all Castle Siege S→C packet definitions to
ServerToClientPackets.xmlso the XSLT source generator produces the corresponding C# structs.The guild alliance packets (E5
GuildRelationshipRequest, E6GuildRelationshipChangeResult, E9AllianceList, EB-01RemoveAllianceGuildResult) were added and validated in #737 and are included here via a merge ofmaster.S→C Packets Added
B2 subcode group (
C1HeaderWithSubCode) — direct responses mirror request subcodes:00–07: Status, Registration, Unregister, RegistrationState, MarkRegistration, DefenseBuy, DefenseRepair, DefenseUpgrade responses08–10: TaxInfo, TaxChange, TributeWithdraw responses11–19: JoinSideNotification, GateOperateResponse, CrownStateUpdate, CrownAccessState, SwitchInfo, OwnershipChangeNotification, BattleStartEnd, RemainingTime, GateOperateStateB2 subcode group (
C2HeaderWithSubCode) — variable-length list notifications:1A:CastleSiegeMiniMapPlayerPositions—{ x, y }[]1B:CastleSiegeMiniMapNpcPositions—{ npcType, x, y }[]Other groups:
B3-00:CastleSiegeGateStateC2-B3-02:CastleSiegeNpcList—{ npcNumber, npcIndex, defenseLevel, regenLevel, maxHp, hp, x, y, isAlive }[]C2-B4:CastleSiegeRegisteredGuildList—{ guildName, markCount, registrationId, isCastleOwner }[]C2-B5:CastleSiegeGuildList—{ side, isInvolved, guildName, score }[]B7-01–03, 05: MachineUseResult, MachineRegionNotify, MachineInterface, LifeStoneStateB9-02:CastleOwnerLogo(32-byte binary logo)B9-03:HuntingZoneGuardInfoGuild Alliance packets (from master / #737, validated by sven-n):
E5:GuildRelationshipRequest—{ relationshipType, requestType, senderId }E6:GuildRelationshipChangeResult—{ relationshipType, requestType, result, guildMasterId }with full result enumC2-E9:AllianceList—{ memberCount, logo[32], guildName }[]with success/rival/union count fieldsEB-01:RemoveAllianceGuildResult—{ result, requestType, relationshipType }Field Layout Conventions Used
LongBigEndian(int64)<Length>matching protocol byte widthsIntegerBigEndiancount fieldsGenerated Artifacts
The XSLT pre-build regenerated
ServerToClientPackets.cs,ServerToClientPacketsRef.cs,ConnectionExtensions.cs, and the correspondingdocs/Packets/C*-by-server.mdfiles.Original prompt
This section details on the original issue you should resolve
<issue_title>Castle Siege Network Packets</issue_title>
<issue_description>## Summary
Define all Castle Siege and Guild Alliance network packet structures in the XML packet definition files. These definitions are used by the source generator to produce C# packet structs for both client→server and server→client communication.
Prerequisites
None — this phase is needed incrementally by all other phases. Can be done in parallel.
Background
OpenMU defines packets in XML files:
Network/Packets/ClientToServer/ClientToServerPackets.xmlNetwork/Packets/ServerToClient/ServerToClientPackets.xmlThe source generator in
Network/Packets/MUnique.OpenMU.Network.Packets.csprojreads these XML files and produces C# structs (e.g.,CastleSiegeStatusRequest,CastleSiegeRegistrationResponse).Existing Castle Siege packet documentation in
docs/Packets/C1-B2-*provides field layouts.Requirements
1. Verify/Complete Client→Server Packets
The following packets already exist in
ClientToServerPackets.xml— verify they have complete field definitions matching the C++ reference:C1-B2-00CastleSiegeStatusRequestC1-B2-01CastleSiegeRegistrationRequestC1-B2-02CastleSiegeUnregisterRequestC1-B2-03CastleSiegeRegistrationStateRequestC1-B2-04CastleSiegeMarkRegistrationslot: byte(inventory slot)C1-B2-05CastleSiegeDefenseBuyRequestnpcType: int32,npcId: int32C1-B2-06CastleSiegeDefenseRepairRequestnpcType: int32,npcId: int32C1-B2-07CastleSiegeDefenseUpgradeRequestnpcType: int32,npcId: int32,upgradeType: int32C1-B2-08CastleSiegeTaxInfoRequestC1-B2-09CastleSiegeTaxChangeRequesttaxType: byte,taxRate: int32(big-endian)C1-B2-10CastleSiegeTaxMoneyWithdrawmoney: int32(big-endian)C1-B2-12ToggleCastleGateRequestoperation: byte,gateIndex: uint16C1-B2-1DCastleGuildCommandteam: byte,x: byte,y: byte,command: byteC1-B2-1FCastleSiegeHuntingZoneEntranceSettingenabled: byteC1-B3-01CastleSiegeGateListRequestC1-B3-02CastleSiegeStatueListRequestC1-B4CastleSiegeRegisteredGuildsListRequestC1-B5CastleOwnerListRequestC1-B9-02GuildLogoOfCastleOwnerRequestC1-B9-05CastleSiegeHuntingZoneEnterRequestC1-E6GuildRelationshipChangeRequesttargetGuildId: uint32,relationshipType: byte,requestType: byteC1-E9RequestAllianceListC1-EB-01RemoveAllianceGuildRequestguildName: stringAdd if missing:
C1-B7-??CastleSiegeMachineUseRequestnpcIndex: uint16,targetZone: byteC1-B7-??CastleSiegeMachineDamageCallback2. Define Server→Client Packets
Add full XML definitions for all S→C packets in
ServerToClientPackets.xml:CastleSiegeStatusResponseresult: byte,state: byte,startYear/Month/Day/Hour/Minute,endYear/Month/Day/Hour/Minute,siegeStartYear/Month/Day/Hour/Minute,guildName: string[8],guildMasterName: string[10],remainTime: int32CastleSiegeRegistrationResponseresult: byte,guildName: string[8]CastleSiegeUnregisterResponseresult: byteCastleSiegeRegistrationStateResponseguildName: string[8],marks: uint32,registrationId: int32CastleSiegeMarkRegistrationResponseresult: byte,guildName: string[8],marks: uint32CastleSiegeDefenseBuyResponseresult: byte,npcType: int32,npcId: int32CastleSiegeDefenseRepairResponseresult: byte,npcType: int32,npcId: int32CastleSiegeDefenseUpgradeResponseresult: byte,npcType: int32,npcId: int32,upgradeType: int32,upgradeValue: int32CastleSiegeTaxInfoResponsetaxChaos: byte,taxStore: byte,taxHunt: int32,huntAllowed: byte,money: int64CastleSiegeTaxChangeResponseresult: byte,taxType: byte,taxRate: int32CastleSiegeTributeWithdrawResponseresult: byte,money: int64CastleSiegeJoinSideNotificationside: byteCastleSiegeCrownStateUpdatestate: byte(0=locked, 1=available)CastleSiegeCrownAccessStatestate: byte,accumulatedTimeMs: uint32CastleSiegeSwitchInfoswitchIndex: uint16,switchId: byte,state: byte,joinSide: byte,guildName: string[9],userName: string[11]CastleSiegeOwnershipChangeNotificationguildName: string[8]⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.