Add dummy handler for AceAntiDataPush (annoying)
This commit is contained in:
parent
c1b5f11fe6
commit
13cfd2468f
18 changed files with 44 additions and 26 deletions
|
@ -8,7 +8,7 @@ internal class AchievementController : Controller
|
|||
{
|
||||
public AchievementController(PlayerSession session) : base(session)
|
||||
{
|
||||
// AchievementMessageHandler.
|
||||
// AchievementController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.AchievementInfoRequest)]
|
||||
|
|
|
@ -8,7 +8,7 @@ internal class DailyActivityController : Controller
|
|||
{
|
||||
public DailyActivityController(PlayerSession session) : base(session)
|
||||
{
|
||||
// DailyActivityMessageHandler.
|
||||
// DailyActivityController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.ActivityRequest)]
|
||||
|
|
|
@ -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>>();
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ internal class ExchangeRewardController : Controller
|
|||
{
|
||||
public ExchangeRewardController(PlayerSession session) : base(session)
|
||||
{
|
||||
// ExchangeRewardMessageHandler.
|
||||
// ExchangeRewardController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.ExchangeRewardInfoRequest)]
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -8,7 +8,7 @@ internal class FriendSystemController : Controller
|
|||
{
|
||||
public FriendSystemController(PlayerSession session) : base(session)
|
||||
{
|
||||
// FriendMessageHandler.
|
||||
// FriendController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.FriendAllRequest)]
|
||||
|
|
|
@ -8,7 +8,7 @@ internal class GachaController : Controller
|
|||
{
|
||||
public GachaController(PlayerSession session) : base(session)
|
||||
{
|
||||
// GachaMessageHandler.
|
||||
// GachaController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.GachaInfoRequest)]
|
||||
|
|
|
@ -8,7 +8,7 @@ internal class InfluenceReputationController : Controller
|
|||
{
|
||||
public InfluenceReputationController(PlayerSession session) : base(session)
|
||||
{
|
||||
// InfluenceReputationMessageHandler.
|
||||
// InfluenceReputationController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.InfluenceInfoRequest)]
|
||||
|
|
|
@ -8,7 +8,7 @@ internal class InventoryController : Controller
|
|||
{
|
||||
public InventoryController(PlayerSession session) : base(session)
|
||||
{
|
||||
// InventoryMessageHandler.
|
||||
// InventoryController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.NormalItemRequest)]
|
||||
|
|
|
@ -8,7 +8,7 @@ internal class LordGymController : Controller
|
|||
{
|
||||
public LordGymController(PlayerSession session) : base(session)
|
||||
{
|
||||
// LordGymMessageHandler.
|
||||
// LordGymController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.LordGymInfoRequest)]
|
||||
|
|
|
@ -8,7 +8,7 @@ internal class RoguelikeController : Controller
|
|||
{
|
||||
public RoguelikeController(PlayerSession session) : base(session)
|
||||
{
|
||||
// RoguelikeMessageHandler.
|
||||
// RoguelikeController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.RoguelikeSeasonDataRequest)]
|
||||
|
|
|
@ -10,7 +10,7 @@ internal class RoleController : Controller
|
|||
{
|
||||
public RoleController(PlayerSession session) : base(session)
|
||||
{
|
||||
// RoleMessageHandler.
|
||||
// RoleController.
|
||||
}
|
||||
|
||||
[GameEvent(GameEventType.EnterGame)]
|
||||
|
|
|
@ -8,7 +8,7 @@ internal class ShopController : Controller
|
|||
{
|
||||
public ShopController(PlayerSession session) : base(session)
|
||||
{
|
||||
// ShopMessageHandler.
|
||||
// ShopController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.PayShopInfoRequest)]
|
||||
|
|
18
GameServer/Controllers/ThirdPartySdkController.cs
Normal file
18
GameServer/Controllers/ThirdPartySdkController.cs
Normal 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.
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ internal class TowerController : Controller
|
|||
{
|
||||
public TowerController(PlayerSession session) : base(session)
|
||||
{
|
||||
// TowerMessageHandler.
|
||||
// TowerController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.TowerChallengeRequest)]
|
||||
|
|
|
@ -8,7 +8,7 @@ internal class TutorialController : Controller
|
|||
{
|
||||
public TutorialController(PlayerSession session) : base(session)
|
||||
{
|
||||
// TutorialMessageHandler.
|
||||
// TutorialController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.TutorialInfoRequest)]
|
||||
|
|
|
@ -10,7 +10,7 @@ internal class WorldController : Controller
|
|||
{
|
||||
public WorldController(PlayerSession session) : base(session)
|
||||
{
|
||||
// WorldMessageHandler.
|
||||
// WorldController.
|
||||
}
|
||||
|
||||
[GameEvent(GameEventType.EnterGame)]
|
||||
|
|
|
@ -8,7 +8,7 @@ internal class WorldMapController : Controller
|
|||
{
|
||||
public WorldMapController(PlayerSession session) : base(session)
|
||||
{
|
||||
// WorldMapMessageHandler.
|
||||
// WorldMapController.
|
||||
}
|
||||
|
||||
[NetEvent(MessageId.MapTraceInfoRequest)]
|
||||
|
|
Loading…
Reference in a new issue