From 9514f6391e41585600c2674b6f8af106e6ecdd6c Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Tue, 1 Jul 2014 21:42:00 -0700 Subject: [PATCH] Fixed bug in Arcade with client manager. --- .../src/nautilus/game/arcade/Arcade.java | 8 +- Website/LOC.Core/Model/Account/Account.cs | 1 + .../Models/AccountAdministrator.cs | 10 +- .../LOC.Website.Web.Publish.xml | 446 +++++++++--------- 4 files changed, 235 insertions(+), 230 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java index c32faf13b..fcdf8ca96 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java @@ -69,19 +69,19 @@ public class Arcade extends JavaPlugin //Static Modules CommandCenter.Initialize(this); - CoreClientManager clientManager = new CoreClientManager(this, webServerAddress); - CommandCenter.Instance.setClientManager(clientManager); + _clientManager = new CoreClientManager(this, webServerAddress); + CommandCenter.Instance.setClientManager(_clientManager); ItemStackFactory.Initialize(this, false); Recharge.Initialize(this); - _donationManager = new DonationManager(this, webServerAddress); + _donationManager = new DonationManager(this, webServerAddress); PreferencesManager preferenceManager = new PreferencesManager(this, _clientManager, _donationManager); new MessageManager(this, _clientManager, preferenceManager); AntiStack antistack = new AntiStack(this); - Portal portal = new Portal(this, clientManager); + Portal portal = new Portal(this, _clientManager); Creature creature = new Creature(this); Spawn spawn = new Spawn(this); Teleport teleport = new Teleport(this, _clientManager, spawn); diff --git a/Website/LOC.Core/Model/Account/Account.cs b/Website/LOC.Core/Model/Account/Account.cs index 2318fd11d..4f99c5a1a 100644 --- a/Website/LOC.Core/Model/Account/Account.cs +++ b/Website/LOC.Core/Model/Account/Account.cs @@ -17,6 +17,7 @@ [StringLength(40)] public string Name { get; set; } + [StringLength(100)] public string Uuid { get; set; } public Rank Rank { get; set; } diff --git a/Website/LOC.Website.Common/Models/AccountAdministrator.cs b/Website/LOC.Website.Common/Models/AccountAdministrator.cs index 82ff2b519..edc78e5ba 100644 --- a/Website/LOC.Website.Common/Models/AccountAdministrator.cs +++ b/Website/LOC.Website.Common/Models/AccountAdministrator.cs @@ -69,7 +69,7 @@ { var account = repository.Where(x => x.Uuid == loginToken.Uuid).FirstOrDefault() ?? CreateAccount(loginToken, repository); account.LoadNavigationProperties(repository.Context); - account.LastLogin = (long)TimeUtil.GetCurrentMilliseconds(); + bool edited = false; // Expire punishments if (account.Punishments != null) @@ -77,6 +77,7 @@ foreach (var expiredPunishment in account.Punishments.Where(x => x.Active && (x.Duration - 0d) > 0 && TimeUtil.GetCurrentMilliseconds() > (x.Time + (x.Duration * 3600000)))) { expiredPunishment.Active = false; + edited = true; } } @@ -84,6 +85,7 @@ if (String.IsNullOrEmpty(account.Uuid) && !String.IsNullOrEmpty(loginToken.Uuid)) { account.Uuid = loginToken.Uuid; + edited = true; } // Expire ranks @@ -91,9 +93,11 @@ { account.Rank = repository.Where(x => x.Name == "ALL").First(); repository.Attach(account.Rank); + edited = true; } - repository.CommitChanges(); + if (edited) + repository.CommitChanges(); return account; } @@ -511,7 +515,7 @@ repository.CommitChanges(); - return rank.Name; + return rank.Name.ToString(); } } diff --git a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml index 0f55f49a2..9d0471067 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,15 +19,16 @@ - + + - + @@ -41,7 +42,7 @@ - + @@ -49,7 +50,9 @@ + + @@ -58,8 +61,7 @@ - - + @@ -70,23 +72,23 @@ - + + - + - - - + + @@ -94,7 +96,7 @@ - + @@ -102,42 +104,45 @@ - + - + - + - + + + - + + - - + + - + @@ -148,52 +153,47 @@ - + - - - - + - - - + + - - + - + - - + + @@ -203,72 +203,74 @@ - - + + - + - + - - + - + - + + - + - + - - + + - + - - + + - - + + - + + + @@ -281,16 +283,13 @@ - - + - - @@ -304,25 +303,26 @@ - + + - + - + @@ -333,29 +333,29 @@ - - + - - + + - + + @@ -363,43 +363,42 @@ - + - + + - + - + - - - + + - - - + + @@ -410,31 +409,34 @@ - + - + + + + + + - - - + + - @@ -442,29 +444,29 @@ - + - - + + - - + + - + @@ -472,66 +474,66 @@ - - + + - + - + - - + - + - - + - - + + - - + + - + - - - - - + + + + + - + - + + + @@ -542,9 +544,9 @@ - + - + @@ -552,7 +554,6 @@ - @@ -563,18 +564,20 @@ + + + - @@ -583,9 +586,8 @@ - - + @@ -596,43 +598,43 @@ - - - + - - - + + + - - - - + + + + - + + + @@ -645,24 +647,23 @@ + - + - + - - - + @@ -673,128 +674,129 @@ - + - + - + + + + + + - - - - - + + + - - - + - + - - + - + - + - + - - + + - + - - - - + + + - + - + - - + - - + + + - - + + - + - - - - - + + + + + - + + + @@ -805,9 +807,9 @@ - + - + @@ -815,7 +817,6 @@ - @@ -826,18 +827,20 @@ + + + - @@ -846,9 +849,8 @@ - - + @@ -859,43 +861,43 @@ - - - + - - - + + + - - + + - + + + @@ -908,24 +910,23 @@ + - + - + - - - + @@ -936,120 +937,119 @@ - + - + - + + + + + + - - - + - - - + - + - - + - + - + - + - - + + - + - - - - + + + - + - - + - - + + + - - + + - + - - - - - + + + + + - + \ No newline at end of file