Fixed bug in Arcade with client manager.

This commit is contained in:
Jonathan Williams 2014-07-01 21:42:00 -07:00
parent 41c4d5a0a8
commit 9514f6391e
4 changed files with 235 additions and 230 deletions

View File

@ -69,8 +69,8 @@ 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);
@ -81,7 +81,7 @@ public class Arcade extends JavaPlugin
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);

View File

@ -17,6 +17,7 @@
[StringLength(40)]
public string Name { get; set; }
[StringLength(100)]
public string Uuid { get; set; }
public Rank Rank { get; set; }

View File

@ -69,7 +69,7 @@
{
var account = repository.Where<Account>(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<Rank>(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();
}
}

File diff suppressed because it is too large Load Diff