use prim ctor and fixed warnings: LocationCallbacks, MatchCallbacks

This commit is contained in:
CWX
2025-01-18 13:36:04 +00:00
parent b23735bb94
commit 42e964c60b
2 changed files with 10 additions and 39 deletions
+4 -16
View File
@@ -1,29 +1,17 @@
using Core.Annotations;
using Core.Controllers;
using Core.Models.Eft.Common;
using Core.Models.Eft.Common.Tables;
using Core.Models.Eft.HttpResponse;
using Core.Models.Eft.Location;
using Core.Utils;
namespace Core.Callbacks;
[Injectable]
public class LocationCallbacks
public class LocationCallbacks(
HttpResponseUtil _httpResponseUtil,
LocationController _locationController
)
{
protected HttpResponseUtil _httpResponseUtil;
protected LocationController _locationController;
public LocationCallbacks
(
HttpResponseUtil httpResponseUtil,
LocationController locationController
)
{
_httpResponseUtil = httpResponseUtil;
_locationController = locationController;
}
/// <summary>
/// Handle client/locations
/// </summary>
+6 -23
View File
@@ -1,8 +1,6 @@
using Core.Annotations;
using Core.Controllers;
using Core.Models.Eft.Common;
using Core.Models.Eft.Common.Tables;
using Core.Models.Eft.HttpResponse;
using Core.Models.Eft.Match;
using Core.Services;
using Core.Utils;
@@ -10,27 +8,12 @@ using Core.Utils;
namespace Core.Callbacks;
[Injectable]
public class MatchCallbacks
public class MatchCallbacks(
HttpResponseUtil _httpResponseUtil,
MatchController _matchController,
DatabaseService _databaseService
)
{
protected HttpResponseUtil _httpResponseUtil;
protected JsonUtil _jsonUtil;
protected MatchController _matchController;
protected DatabaseService _databaseService;
public MatchCallbacks
(
HttpResponseUtil httpResponseUtil,
JsonUtil jsonUtil,
MatchController matchController,
DatabaseService databaseService
)
{
_httpResponseUtil = httpResponseUtil;
_jsonUtil = jsonUtil;
_matchController = matchController;
_databaseService = databaseService;
}
/// <summary>
/// Handle client/match/updatePing
/// </summary>
@@ -76,7 +59,7 @@ public class MatchCallbacks
/// <returns></returns>
public string GroupCurrent(string url, EmptyRequestData info, string sessionID)
{
return _httpResponseUtil.GetBody(new MatchGroupCurrentResponse() { Squad = new() });
return _httpResponseUtil.GetBody(new MatchGroupCurrentResponse { Squad = [] });
}
/// <summary>