|
|
@@ -23,18 +23,18 @@ namespace Ryujinx.HLE.HOS.Services
|
|
|
|
|
|
public IpcService(ServerBase server = null)
|
|
|
{
|
|
|
- CmifCommands = typeof(IpcService).Assembly.GetTypes()
|
|
|
+ CmifCommands = GetType().Assembly.GetTypes()
|
|
|
.Where(type => type == GetType())
|
|
|
.SelectMany(type => type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public))
|
|
|
- .SelectMany(methodInfo => methodInfo.GetCustomAttributes(typeof(CommandCmifAttribute))
|
|
|
- .Select(command => (((CommandCmifAttribute)command).Id, methodInfo)))
|
|
|
+ .SelectMany(methodInfo => methodInfo.GetCustomAttributes<CommandCmifAttribute>()
|
|
|
+ .Select(command => (command.Id, methodInfo)))
|
|
|
.ToDictionary(command => command.Id, command => command.methodInfo);
|
|
|
|
|
|
- TipcCommands = typeof(IpcService).Assembly.GetTypes()
|
|
|
+ TipcCommands = GetType().Assembly.GetTypes()
|
|
|
.Where(type => type == GetType())
|
|
|
.SelectMany(type => type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public))
|
|
|
- .SelectMany(methodInfo => methodInfo.GetCustomAttributes(typeof(CommandTipcAttribute))
|
|
|
- .Select(command => (((CommandTipcAttribute)command).Id, methodInfo)))
|
|
|
+ .SelectMany(methodInfo => methodInfo.GetCustomAttributes<CommandTipcAttribute>()
|
|
|
+ .Select(command => (command.Id, methodInfo)))
|
|
|
.ToDictionary(command => command.Id, command => command.methodInfo);
|
|
|
|
|
|
Server = server;
|