diff --git a/Website/LOC.Core/LOC.Core.csproj b/Website/LOC.Core/LOC.Core.csproj index b1fdf484f..a52e4b798 100644 --- a/Website/LOC.Core/LOC.Core.csproj +++ b/Website/LOC.Core/LOC.Core.csproj @@ -78,6 +78,7 @@ + diff --git a/Website/LOC.Core/Tokens/AccountTask.cs b/Website/LOC.Core/Tokens/AccountTask.cs new file mode 100644 index 000000000..85dd2914e --- /dev/null +++ b/Website/LOC.Core/Tokens/AccountTask.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace LOC.Core.Tokens +{ + public class AccountTask + { + public string Task { get; set; } + public string UUID { get; set; } + } +} diff --git a/Website/LOC.Website.Common/Models/AccountAdministrator.cs b/Website/LOC.Website.Common/Models/AccountAdministrator.cs index 5aa571908..8d0c23f74 100644 --- a/Website/LOC.Website.Common/Models/AccountAdministrator.cs +++ b/Website/LOC.Website.Common/Models/AccountAdministrator.cs @@ -72,6 +72,27 @@ return accounts; } + public List GetTasksByCount(int count) + { + var tasks = new List(); + + using (var repository = _repositoryFactory.CreateRepository()) + { + var gameTasks = repository.GetAll().OrderBy(x => x.GameTaskId).Take(count).Include(x => x.Account).ToList(); + + foreach (var task in gameTasks) + { + AccountTask accountTask = new AccountTask(); + accountTask.Task = task.TaskName; + accountTask.UUID = task.Account.Uuid; + + tasks.Add(accountTask); + } + } + + return tasks; + } + private object getAccountLock(string name) { object lockObject = null; diff --git a/Website/LOC.Website.Common/Models/IAccountAdministrator.cs b/Website/LOC.Website.Common/Models/IAccountAdministrator.cs index a79c19552..afcb11d4e 100644 --- a/Website/LOC.Website.Common/Models/IAccountAdministrator.cs +++ b/Website/LOC.Website.Common/Models/IAccountAdministrator.cs @@ -41,5 +41,7 @@ bool CoinReward(GemRewardToken token); ClientToken GetAccountByUUID(string uuid); + + List GetTasksByCount(int count); } } diff --git a/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs b/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs index 820a8212a..1f6e02b55 100644 --- a/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs +++ b/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs @@ -39,6 +39,15 @@ return Content(json, "application/json"); } + [HttpPost] + public ActionResult GetTasksByCount(int count) + { + var tasks = _accountAdministrator.GetTasksByCount(count); + + var json = JsonConvert.SerializeObject(tasks); + return Content(json, "application/json"); + } + [HttpPost] public ActionResult GetAccountByUUID(string uuid) { diff --git a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml index 2d91aaa08..72e6fb292 100644 --- a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml +++ b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml @@ -1,12 +1,12 @@  - + @@ -19,51 +19,48 @@ - - + + - - - + - + - + - - - + - - + + + @@ -74,24 +71,24 @@ - - + - - + + + + - @@ -99,7 +96,7 @@ - + @@ -107,19 +104,18 @@ - + - + - - + @@ -128,20 +124,20 @@ - + - - + - + + - + @@ -155,43 +151,49 @@ - + + + + + + - + + - + - + - + + - @@ -201,7 +203,7 @@ - + @@ -209,65 +211,61 @@ - + - + - + + - + - + - - + - - + + - - + - + - + - - + + - - + + - - + - - @@ -281,38 +279,42 @@ - + - + + + - + - + - + + + - + @@ -322,7 +324,7 @@ - + @@ -333,20 +335,22 @@ + - + + + - - + @@ -354,8 +358,6 @@ - - @@ -363,44 +365,40 @@ - - + + - - - - + + - - + + - - @@ -411,126 +409,126 @@ - + - - - - + - - + - + + - + - + - + + - + + - + + - + - + - - + + - + - + + - + - + + - - + + - + - - + + - + - - - - - + + + + + - + - - @@ -546,48 +544,49 @@ - + + - + - + - + - + - + - + - + - + @@ -598,32 +597,34 @@ + - + + - + + - - + - - + + @@ -631,39 +632,36 @@ - + - - - + - - + - - + + + - - + @@ -674,33 +672,32 @@ - + - - - - + - - + - - - + + + + + + @@ -708,92 +705,93 @@ - + + - + + - + - + - - + + - + - + - - + + - + - + - + + - - + + - + - - + + - + - - - - - + + + + + - + - - @@ -809,38 +807,39 @@ - + + - + - + - + - + - + - + @@ -850,7 +849,7 @@ - + @@ -861,28 +860,30 @@ + - + + - + + - - + @@ -894,39 +895,36 @@ - + - - - + - - + - - + + + - - + @@ -937,33 +935,32 @@ - + - - - - + - - + - + + + + @@ -971,85 +968,88 @@ - + + - + + - + - + - - + + - + - + - - + + - + - + + - - + + - + - - + + - + - - - - - + + + + + - + \ No newline at end of file diff --git a/Website/LOCWebsite.suo b/Website/LOCWebsite.suo index 082599a52..2fd6e5bcf 100644 Binary files a/Website/LOCWebsite.suo and b/Website/LOCWebsite.suo differ