-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Guild Information Lookup Menu - Implemented guild information lookup feature - Added UI elements for viewing guild members - Created window pop-up for guild interactions - Integrated new dialog factory methods for guild UI - Updated resource IDs for localization * Add EOResources and warning for short guild tag * Apply PR suggestions * Guild dialog code structure cleanup * Wire up information item to state transitions * Handle packet data for Guild Lookup and Member List menu actions --------- Co-authored-by: Ethan Moffat <[email protected]>
- Loading branch information
1 parent
3e09fb0
commit 985c8e4
Showing
9 changed files
with
368 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Amadevus.RecordGenerator; | ||
using Moffat.EndlessOnline.SDK.Protocol.Net.Server; | ||
|
||
namespace EOLib.Domain.Interact.Guild | ||
{ | ||
[Record(Features.Default | Features.ObjectEquals | Features.EquatableEquals)] | ||
public sealed partial class GuildInfo | ||
{ | ||
public string Name { get; } | ||
|
||
public string Tag { get; } | ||
|
||
public DateTime CreateDate { get; } | ||
|
||
public string Description { get; } | ||
|
||
public string Wealth { get; } | ||
|
||
public IReadOnlyList<string> Ranks { get; } | ||
|
||
public IReadOnlyList<GuildStaff> Staff { get; } | ||
|
||
public static GuildInfo FromPacket(GuildReportServerPacket packet) | ||
{ | ||
return new Builder | ||
{ | ||
Name = packet.Name, | ||
Tag = packet.Tag, | ||
CreateDate = DateTime.TryParse(packet.CreateDate, out var created) ? created : new DateTime(0, DateTimeKind.Utc), | ||
Description = packet.Description, | ||
Wealth = packet.Wealth, | ||
Ranks = packet.Ranks, | ||
Staff = packet.Staff | ||
}.ToImmutable(); | ||
} | ||
|
||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using AutomaticTypeMapper; | ||
using EOLib.Domain.Interact.Guild; | ||
using EOLib.Domain.Login; | ||
using EOLib.Net.Handlers; | ||
using Moffat.EndlessOnline.SDK.Protocol.Net; | ||
using Moffat.EndlessOnline.SDK.Protocol.Net.Server; | ||
using Optional; | ||
|
||
namespace EOLib.PacketHandlers.Guild | ||
{ | ||
[AutoMappedType] | ||
|
||
public class GuildReportHandler : InGameOnlyPacketHandler<GuildReportServerPacket> | ||
{ | ||
private readonly IGuildSessionRepository _guildSessionRepository; | ||
|
||
public override PacketFamily Family => PacketFamily.Guild; | ||
|
||
public override PacketAction Action => PacketAction.Report; | ||
|
||
public GuildReportHandler(IPlayerInfoProvider playerInfoProvider, | ||
IGuildSessionRepository guildSessionRepository) | ||
: base(playerInfoProvider) | ||
{ | ||
_guildSessionRepository = guildSessionRepository; | ||
} | ||
|
||
public override bool HandlePacket(GuildReportServerPacket packet) | ||
{ | ||
_guildSessionRepository.GuildInfo = Option.Some(GuildInfo.FromPacket(packet)); | ||
return true; | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Collections.Generic; | ||
using AutomaticTypeMapper; | ||
using EOLib.Domain.Interact.Guild; | ||
using EOLib.Domain.Login; | ||
using EOLib.Net.Handlers; | ||
using Moffat.EndlessOnline.SDK.Protocol.Net; | ||
using Moffat.EndlessOnline.SDK.Protocol.Net.Server; | ||
|
||
namespace EOLib.PacketHandlers.Guild | ||
{ | ||
[AutoMappedType] | ||
|
||
public class GuildTellHandler : InGameOnlyPacketHandler<GuildTellServerPacket> | ||
{ | ||
private readonly IGuildSessionRepository _guildSessionRepository; | ||
|
||
public override PacketFamily Family => PacketFamily.Guild; | ||
|
||
public override PacketAction Action => PacketAction.Tell; | ||
|
||
public GuildTellHandler(IPlayerInfoProvider playerInfoProvider, | ||
IGuildSessionRepository guildSessionRepository) | ||
: base(playerInfoProvider) | ||
{ | ||
_guildSessionRepository = guildSessionRepository; | ||
} | ||
|
||
public override bool HandlePacket(GuildTellServerPacket packet) | ||
{ | ||
_guildSessionRepository.GuildMembers = new List<GuildMember>(packet.Members); | ||
return true; | ||
} | ||
} | ||
} |
Oops, something went wrong.