GuildBroadcasts - jimdroberts/FishMMO GitHub Wiki
Defines broadcast structures for guild actions, including creation, invitations, membership changes, rank changes, and operation results. Used for networked communication of guild-related events between client and server.
-
public struct GuildCreateBroadcast : IBroadcast
Broadcast for creating a new guild. Contains the name of the guild to be created.
- string GuildName: Name of the guild to create.
-
public struct GuildInviteBroadcast : IBroadcast
Broadcast for inviting a character to a guild. Contains the inviter and target character IDs.
- long InviterCharacterID: Character ID of the player sending the invite.
- long TargetCharacterID: Character ID of the player being invited.
-
public struct GuildAcceptInviteBroadcast : IBroadcast
Broadcast for accepting a guild invitation. No additional data required.
-
public struct GuildDeclineInviteBroadcast : IBroadcast
Broadcast for declining a guild invitation. No additional data required.
-
public struct GuildAddBroadcast : IBroadcast
Broadcast for adding a member to a guild. Contains guild ID, character ID, rank, and location.
- long GuildID: ID of the guild the member is being added to.
- long CharacterID: Character ID of the member being added.
- GuildRank Rank: Rank of the member within the guild.
- string Location: Location of the member (may be used for online status or region).\n
-
public struct GuildAddMultipleBroadcast : IBroadcast
Broadcast for adding multiple members to a guild at once. Used for bulk member addition or synchronization.
- List Members: List of members to add to the guild.
-
public struct GuildLeaveBroadcast : IBroadcast
Broadcast for a member leaving a guild. No additional data required.
-
public struct GuildRemoveBroadcast : IBroadcast
Broadcast for removing a member from a guild. Contains the guild member ID to be removed.
- long GuildMemberID: Guild member ID of the member to remove.
-
public struct GuildChangeRankBroadcast : IBroadcast
Broadcast for changing a member's rank within a guild. Contains the guild member ID and the new rank.
- long GuildMemberID: Guild member ID of the member whose rank is changing.
- GuildRank Rank: New rank to assign to the member.
-
public struct GuildResultBroadcast : IBroadcast
Broadcast for sending the result of a guild operation. Contains the result type indicating success or failure reason.
- GuildResultType Result: Result of the guild operation.
-
public enum GuildResultType : byte
Result types for guild operations, indicating success or specific failure reasons.
- Success = 0: Operation succeeded.
- InvalidGuildName: Guild name is invalid.
- NameAlreadyExists: Guild name already exists.
- AlreadyInGuild: Character is already in a guild.
- Use these broadcast structs to send and receive guild actions between client and server.
- Populate the fields as required for each guild operation (create, invite, add, remove, rank change, etc.).
// Example 1: Creating a guild
GuildCreateBroadcast create = new GuildCreateBroadcast {
GuildName = "KnightsOfUnity"
};
networkManager.ClientManager.Broadcast(create);
// Example 2: Changing a member's rank
GuildChangeRankBroadcast changeRank = new GuildChangeRankBroadcast {
GuildMemberID = 12345,
Rank = GuildRank.Officer
};
networkManager.ClientManager.Broadcast(changeRank);
- Always validate guild names, member IDs, and ranks before sending or processing broadcasts.
- Use bulk updates for efficient synchronization of large guilds.
- Keep guild logic modular and well-documented for maintainability.
- Use the provided broadcast structs and enums for clear, type-safe network communication.