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)
{
// AchievementMessageHandler.
// AchievementController.
}
[NetEvent(MessageId.AchievementInfoRequest)]

View file

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

View file

@ -34,7 +34,7 @@ internal class EventSystem
_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>>();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -8,7 +8,7 @@ internal class ShopController : Controller
{
public ShopController(PlayerSession session) : base(session)
{
// ShopMessageHandler.
// ShopController.
}
[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)
{
// TowerMessageHandler.
// TowerController.
}
[NetEvent(MessageId.TowerChallengeRequest)]

View file

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

View file

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

View file

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