Add dummy handler for AceAntiDataPush (annoying)

This commit is contained in:
xeon 2024-02-10 14:51:20 +03:00
parent c1b5f11fe6
commit 13cfd2468f
18 changed files with 44 additions and 26 deletions

View file

@ -8,7 +8,7 @@ internal class AchievementController : Controller
{ {
public AchievementController(PlayerSession session) : base(session) public AchievementController(PlayerSession session) : base(session)
{ {
// AchievementMessageHandler. // AchievementController.
} }
[NetEvent(MessageId.AchievementInfoRequest)] [NetEvent(MessageId.AchievementInfoRequest)]

View file

@ -8,7 +8,7 @@ internal class DailyActivityController : Controller
{ {
public DailyActivityController(PlayerSession session) : base(session) public DailyActivityController(PlayerSession session) : base(session)
{ {
// DailyActivityMessageHandler. // DailyActivityController.
} }
[NetEvent(MessageId.ActivityRequest)] [NetEvent(MessageId.ActivityRequest)]

View file

@ -34,7 +34,7 @@ internal class EventSystem
_logger.LogInformation("Event {type} emitted", eventType); _logger.LogInformation("Event {type} emitted", eventType);
} }
public static ImmutableDictionary<GameEventType, Func<ModelManager, Task>> RegisterModelManagerEvents() private static ImmutableDictionary<GameEventType, Func<ModelManager, Task>> RegisterModelManagerEvents()
{ {
var builder = ImmutableDictionary.CreateBuilder<GameEventType, Func<ModelManager, Task>>(); var builder = ImmutableDictionary.CreateBuilder<GameEventType, Func<ModelManager, Task>>();

View file

@ -8,7 +8,7 @@ internal class ExchangeRewardController : Controller
{ {
public ExchangeRewardController(PlayerSession session) : base(session) public ExchangeRewardController(PlayerSession session) : base(session)
{ {
// ExchangeRewardMessageHandler. // ExchangeRewardController.
} }
[NetEvent(MessageId.ExchangeRewardInfoRequest)] [NetEvent(MessageId.ExchangeRewardInfoRequest)]

View file

@ -14,36 +14,36 @@ namespace GameServer.Controllers.Factory;
internal delegate Task GameEventHandler(IServiceProvider serviceProvider); internal delegate Task GameEventHandler(IServiceProvider serviceProvider);
internal class EventHandlerFactory internal class EventHandlerFactory
{ {
private readonly ImmutableDictionary<MessageId, RpcHandler> s_rpcHandlers; private readonly ImmutableDictionary<MessageId, RpcHandler> _rpcHandlers;
private readonly ImmutableDictionary<MessageId, PushHandler> s_pushHandlers; private readonly ImmutableDictionary<MessageId, PushHandler> _pushHandlers;
private readonly ImmutableDictionary<GameEventType, List<GameEventHandler>> s_eventHandlers; private readonly ImmutableDictionary<GameEventType, List<GameEventHandler>> _eventHandlers;
public EventHandlerFactory(ILogger<EventHandlerFactory> logger) public EventHandlerFactory(ILogger<EventHandlerFactory> logger)
{ {
IEnumerable<Type> controllerTypes = Assembly.GetExecutingAssembly().GetTypes() IEnumerable<Type> controllerTypes = Assembly.GetExecutingAssembly().GetTypes()
.Where(t => t.IsAssignableTo(typeof(Controller)) && !t.IsAbstract); .Where(t => t.IsAssignableTo(typeof(Controller)) && !t.IsAbstract);
s_rpcHandlers = RegisterRpcHandlers(controllerTypes); _rpcHandlers = RegisterRpcHandlers(controllerTypes);
s_pushHandlers = RegisterPushHandlers(controllerTypes); _pushHandlers = RegisterPushHandlers(controllerTypes);
s_eventHandlers = RegisterEventHandlers(controllerTypes); _eventHandlers = RegisterEventHandlers(controllerTypes);
logger.LogInformation("Registered {rpc_count} rpc handlers, {push_count} push handlers", s_rpcHandlers.Count, s_pushHandlers.Count); logger.LogInformation("Registered {rpc_count} rpc handlers, {push_count} push handlers", _rpcHandlers.Count, _pushHandlers.Count);
} }
public RpcHandler? GetRpcHandler(MessageId messageId) public RpcHandler? GetRpcHandler(MessageId messageId)
{ {
s_rpcHandlers.TryGetValue(messageId, out RpcHandler? handler); _rpcHandlers.TryGetValue(messageId, out RpcHandler? handler);
return handler; return handler;
} }
public PushHandler? GetPushHandler(MessageId messageId) public PushHandler? GetPushHandler(MessageId messageId)
{ {
s_pushHandlers.TryGetValue(messageId, out PushHandler? handler); _pushHandlers.TryGetValue(messageId, out PushHandler? handler);
return handler; return handler;
} }
public IEnumerable<GameEventHandler> GetEventHandlers(GameEventType eventType) public IEnumerable<GameEventHandler> GetEventHandlers(GameEventType eventType)
{ {
if (!s_eventHandlers.TryGetValue(eventType, out List<GameEventHandler>? handlers)) if (!_eventHandlers.TryGetValue(eventType, out List<GameEventHandler>? handlers))
return []; return [];
return handlers; return handlers;

View file

@ -8,7 +8,7 @@ internal class FriendSystemController : Controller
{ {
public FriendSystemController(PlayerSession session) : base(session) public FriendSystemController(PlayerSession session) : base(session)
{ {
// FriendMessageHandler. // FriendController.
} }
[NetEvent(MessageId.FriendAllRequest)] [NetEvent(MessageId.FriendAllRequest)]

View file

@ -8,7 +8,7 @@ internal class GachaController : Controller
{ {
public GachaController(PlayerSession session) : base(session) public GachaController(PlayerSession session) : base(session)
{ {
// GachaMessageHandler. // GachaController.
} }
[NetEvent(MessageId.GachaInfoRequest)] [NetEvent(MessageId.GachaInfoRequest)]

View file

@ -8,7 +8,7 @@ internal class InfluenceReputationController : Controller
{ {
public InfluenceReputationController(PlayerSession session) : base(session) public InfluenceReputationController(PlayerSession session) : base(session)
{ {
// InfluenceReputationMessageHandler. // InfluenceReputationController.
} }
[NetEvent(MessageId.InfluenceInfoRequest)] [NetEvent(MessageId.InfluenceInfoRequest)]

View file

@ -8,7 +8,7 @@ internal class InventoryController : Controller
{ {
public InventoryController(PlayerSession session) : base(session) public InventoryController(PlayerSession session) : base(session)
{ {
// InventoryMessageHandler. // InventoryController.
} }
[NetEvent(MessageId.NormalItemRequest)] [NetEvent(MessageId.NormalItemRequest)]

View file

@ -8,7 +8,7 @@ internal class LordGymController : Controller
{ {
public LordGymController(PlayerSession session) : base(session) public LordGymController(PlayerSession session) : base(session)
{ {
// LordGymMessageHandler. // LordGymController.
} }
[NetEvent(MessageId.LordGymInfoRequest)] [NetEvent(MessageId.LordGymInfoRequest)]

View file

@ -8,7 +8,7 @@ internal class RoguelikeController : Controller
{ {
public RoguelikeController(PlayerSession session) : base(session) public RoguelikeController(PlayerSession session) : base(session)
{ {
// RoguelikeMessageHandler. // RoguelikeController.
} }
[NetEvent(MessageId.RoguelikeSeasonDataRequest)] [NetEvent(MessageId.RoguelikeSeasonDataRequest)]

View file

@ -10,7 +10,7 @@ internal class RoleController : Controller
{ {
public RoleController(PlayerSession session) : base(session) public RoleController(PlayerSession session) : base(session)
{ {
// RoleMessageHandler. // RoleController.
} }
[GameEvent(GameEventType.EnterGame)] [GameEvent(GameEventType.EnterGame)]

View file

@ -8,7 +8,7 @@ internal class ShopController : Controller
{ {
public ShopController(PlayerSession session) : base(session) public ShopController(PlayerSession session) : base(session)
{ {
// ShopMessageHandler. // ShopController.
} }
[NetEvent(MessageId.PayShopInfoRequest)] [NetEvent(MessageId.PayShopInfoRequest)]

View file

@ -0,0 +1,18 @@
using GameServer.Controllers.Attributes;
using GameServer.Network;
using Protocol;
namespace GameServer.Controllers;
internal class ThirdPartySdkController : Controller
{
public ThirdPartySdkController(PlayerSession session) : base(session)
{
// ThirdPartySdkController.
}
[NetEvent(MessageId.AceAntiDataPush)]
public void OnAceAntiDataPush()
{
// This is just annoying.
}
}

View file

@ -8,7 +8,7 @@ internal class TowerController : Controller
{ {
public TowerController(PlayerSession session) : base(session) public TowerController(PlayerSession session) : base(session)
{ {
// TowerMessageHandler. // TowerController.
} }
[NetEvent(MessageId.TowerChallengeRequest)] [NetEvent(MessageId.TowerChallengeRequest)]

View file

@ -8,7 +8,7 @@ internal class TutorialController : Controller
{ {
public TutorialController(PlayerSession session) : base(session) public TutorialController(PlayerSession session) : base(session)
{ {
// TutorialMessageHandler. // TutorialController.
} }
[NetEvent(MessageId.TutorialInfoRequest)] [NetEvent(MessageId.TutorialInfoRequest)]

View file

@ -10,7 +10,7 @@ internal class WorldController : Controller
{ {
public WorldController(PlayerSession session) : base(session) public WorldController(PlayerSession session) : base(session)
{ {
// WorldMessageHandler. // WorldController.
} }
[GameEvent(GameEventType.EnterGame)] [GameEvent(GameEventType.EnterGame)]

View file

@ -8,7 +8,7 @@ internal class WorldMapController : Controller
{ {
public WorldMapController(PlayerSession session) : base(session) public WorldMapController(PlayerSession session) : base(session)
{ {
// WorldMapMessageHandler. // WorldMapController.
} }
[NetEvent(MessageId.MapTraceInfoRequest)] [NetEvent(MessageId.MapTraceInfoRequest)]