1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

Seperated the application back into a seperate project

webfront is just a library now
This commit is contained in:
RaidMax
2018-04-08 13:48:40 -05:00
parent ff756f9288
commit 599027c4b6
20 changed files with 133 additions and 57 deletions

View File

@ -2,7 +2,6 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using WebfrontCore.Application.API;
namespace WebfrontCore.Controllers.API
{
@ -12,7 +11,7 @@ namespace WebfrontCore.Controllers.API
[Route("event")]
public ActionResult Index()
{
var events = EventAPI.Events;
var events = Manager.GetEventApi().GetEvents();
var eventsDto = new List<EventInfo>();
while (events.Count > 0)
eventsDto.Add(events.Dequeue());

View File

@ -19,7 +19,7 @@ namespace WebfrontCore.Controllers
try
{
var client = IW4MAdmin.Program.ServerManager.PrivilegedClients[clientId];
var client = Manager.GetPrivilegedClients()[clientId];
string[] hashedPassword = await Task.FromResult(SharedLibraryCore.Helpers.Hashing.Hash(password, client.PasswordSalt));
if (hashedPassword[0] == client.Password)

View File

@ -1,20 +1,19 @@
using IW4MAdmin;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using SharedLibraryCore;
using SharedLibraryCore.Database;
using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Objects;
using System;
using System.Collections.Generic;
using System;
using System.Linq;
using System.Security.Claims;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using SharedLibraryCore.Database;
using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Interfaces;
using SharedLibraryCore.Objects;
namespace WebfrontCore.Controllers
{
public class BaseController : Controller
{
protected ApplicationManager Manager;
protected IManager Manager;
protected readonly DatabaseContext Context;
protected bool Authorized { get; private set; }
protected EFClient User { get; private set; }
@ -26,7 +25,7 @@ namespace WebfrontCore.Controllers
public override void OnActionExecuting(ActionExecutingContext context)
{
Manager = IW4MAdmin.Program.ServerManager;
Manager = Program.Manager;
User = new EFClient()
{

View File

@ -13,7 +13,7 @@ namespace WebfrontCore.Controllers
{
public IActionResult Index()
{
var activeServers = Manager.Servers.Select(s => new ServerInfo()
var activeServers = Manager.GetServers().Select(s => new ServerInfo()
{
Name = s.Hostname,
ID = s.GetHashCode(),
@ -29,7 +29,7 @@ namespace WebfrontCore.Controllers
public async Task<IActionResult> ExecuteAsync(int serverId, string command)
{
var server = Manager.Servers.First(s => s.GetHashCode() == serverId);
var server = Manager.GetServers().First(s => s.GetHashCode() == serverId);
var client = new Player()
{
ClientId = User.ClientId,