Mineplex2018-withcommit/Website/LOC.Website.Web/Controllers/CaptureThePigController.cs

30 lines
925 B
C#
Raw Normal View History

2013-08-27 17:14:08 +02:00
namespace LOC.Website.Web.Controllers
{
using System.Web.Mvc;
using Common.Models;
using Core.Model.Server.GameServer.CaptureThePig.Stats;
using Newtonsoft.Json;
public class CaptureThePigController : PvpController
{
private readonly ICaptureThePigAdministrator _captureThePigAdministrator;
public CaptureThePigController(ICaptureThePigAdministrator captureThePigAdministrator)
{
_captureThePigAdministrator = captureThePigAdministrator;
}
protected override IPvpAdministrator GetAdministrator()
{
return _captureThePigAdministrator;
}
[HttpPost]
public ContentResult UploadStats(CaptureThePigGameStatsToken token)
{
var json = JsonConvert.SerializeObject(_captureThePigAdministrator.UploadStats(token));
return Content(json, "application/json");
}
}
}