Fixed login speeds.

Implemented Tasks for Tutorial
Removed compiled files for website.
This commit is contained in:
Jonathan Williams 2013-09-03 11:34:28 -07:00
parent cec476c72d
commit b894aea72a
39 changed files with 42 additions and 58768 deletions

View File

@ -1,5 +1,6 @@
package mineplex.core.task; package mineplex.core.task;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class TaskClient public class TaskClient
@ -10,5 +11,11 @@ public class TaskClient
public TaskClient(String name) public TaskClient(String name)
{ {
Name = name; Name = name;
TasksCompleted = new ArrayList<String>();
}
public String toString()
{
return Name + " Tasks: {" + TasksCompleted.toString() + "}";
} }
} }

View File

@ -19,6 +19,7 @@ import mineplex.core.projectile.ProjectileManager;
import mineplex.core.punish.Punish; import mineplex.core.punish.Punish;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import mineplex.core.spawn.Spawn; import mineplex.core.spawn.Spawn;
import mineplex.core.task.TaskManager;
import mineplex.core.teleport.Teleport; import mineplex.core.teleport.Teleport;
import mineplex.core.updater.FileUpdater; import mineplex.core.updater.FileUpdater;
import mineplex.core.updater.Updater; import mineplex.core.updater.Updater;
@ -71,7 +72,7 @@ public class Hub extends JavaPlugin implements INautilusPlugin, IRelation
//Main Modules //Main Modules
PacketHandler packetHandler = new PacketHandler(this); PacketHandler packetHandler = new PacketHandler(this);
Portal portal = new Portal(this); Portal portal = new Portal(this);
new HubManager(this, clientManager, donationManager, new DisguiseManager(this, packetHandler)); new HubManager(this, clientManager, donationManager, new DisguiseManager(this, packetHandler), new TaskManager(this, GetWebServerAddress()));
new Stacker(this); new Stacker(this);
new ServerManager(this, clientManager, donationManager, portal); new ServerManager(this, clientManager, donationManager, portal);
new MemoryFix(this); new MemoryFix(this);

View File

@ -62,6 +62,7 @@ import mineplex.core.common.util.UtilWorld;
import mineplex.core.disguise.DisguiseManager; import mineplex.core.disguise.DisguiseManager;
import mineplex.core.disguise.disguises.DisguisePlayer; import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.donation.DonationManager; import mineplex.core.donation.DonationManager;
import mineplex.core.task.TaskManager;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.tutorial.Tutorial; import mineplex.hub.tutorial.Tutorial;
@ -85,7 +86,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
private HashSet<LivingEntity> _mobs = new HashSet<LivingEntity>(); private HashSet<LivingEntity> _mobs = new HashSet<LivingEntity>();
public HubManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, DisguiseManager disguiseManager) public HubManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, DisguiseManager disguiseManager, TaskManager taskManager)
{ {
super("Hub Manager", plugin); super("Hub Manager", plugin);
@ -99,7 +100,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
new Dragon(this); new Dragon(this);
_tutorial = new Tutorial(this, _textCreator); _tutorial = new Tutorial(this, _textCreator, donationManager, taskManager);
DragonTextB = GetDragonText(); DragonTextB = GetDragonText();
} }

View File

@ -17,6 +17,8 @@ import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.donation.DonationManager;
import mineplex.core.task.TaskManager;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.HubManager; import mineplex.hub.HubManager;
@ -25,6 +27,8 @@ import mineplex.hub.TextCreator;
public class Tutorial extends MiniPlugin public class Tutorial extends MiniPlugin
{ {
private TextCreator HubText; private TextCreator HubText;
private DonationManager _donationManager;
private TaskManager _taskManager;
private ArrayList<TutorialPhase> phases = new ArrayList<TutorialPhase>(); private ArrayList<TutorialPhase> phases = new ArrayList<TutorialPhase>();
private HashMap<Player, TutorialData> tute = new HashMap<Player, TutorialData>(); private HashMap<Player, TutorialData> tute = new HashMap<Player, TutorialData>();
@ -32,11 +36,13 @@ public class Tutorial extends MiniPlugin
private String main = ChatColor.RESET + ""; private String main = ChatColor.RESET + "";
private String elem = C.cYellow + C.Bold; private String elem = C.cYellow + C.Bold;
public Tutorial(HubManager manager, TextCreator text) public Tutorial(HubManager manager, TextCreator text, DonationManager donationManager, TaskManager taskManager)
{ {
super("Hub Tutorial", manager.GetPlugin()); super("Hub Tutorial", manager.GetPlugin());
HubText = text; HubText = text;
_donationManager = donationManager;
_taskManager = taskManager;
double y = -manager.GetSpawn().getY(); double y = -manager.GetSpawn().getY();
@ -131,7 +137,7 @@ public class Tutorial extends MiniPlugin
"", "",
"Each class can be customised with unlockable skills.", "Each class can be customised with unlockable skills.",
"", "",
"Fight with other in three different game types!" "Fight with others in three different game types!"
} }
)); ));
@ -156,7 +162,7 @@ public class Tutorial extends MiniPlugin
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void PlayerJoin(PlayerJoinEvent event) public void PlayerJoin(PlayerJoinEvent event)
{ {
//XXX IF BLA BLA BLA JOINED if (!_taskManager.hasCompletedTask(event.getPlayer(), "Hub_JoinTutorial"))
tute.put(event.getPlayer(), new TutorialData(event.getPlayer(), phases.get(0))); tute.put(event.getPlayer(), new TutorialData(event.getPlayer(), phases.get(0)));
} }
@ -203,10 +209,8 @@ public class Tutorial extends MiniPlugin
{ {
tuteIterator.remove(); tuteIterator.remove();
System.out.println("Completed Tutorial: " + player.getName()); _taskManager.completedTask(player, "Hub_JoinTutorial");
_donationManager.RewardGems(player.getName(), 5000);
//XXX SET BLA BLA BLA FINISHED
//XXX Give 5000 Gems
UtilPlayer.message(player, C.cAqua + C.Bold + "You completed the Tutorial."); UtilPlayer.message(player, C.cAqua + C.Bold + "You completed the Tutorial.");
UtilPlayer.message(player, C.cGreen + C.Bold + "You received 5000 Gems."); UtilPlayer.message(player, C.cGreen + C.Bold + "You received 5000 Gems.");

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=.\SQLEXPRESS; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=.\SQLEXPRESS; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Debug\LOC.Core.dll.config
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Debug\LOC.Core.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Debug\LOC.Core.pdb
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Debug\EntityFramework.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Debug\LinqKit.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Debug\Newtonsoft.Json.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Debug\StructureMap.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Debug\EntityFramework.xml
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Debug\Newtonsoft.Json.xml
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Debug\StructureMap.pdb
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Debug\StructureMap.xml
C:\Work\Nautilus\Minecraft\Website\LOC.Core\obj\Debug\LOC.Core.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\obj\Debug\LOC.Core.pdb
C:\Work\Nautilus\Minecraft\Website\LOC.Core\obj\Debug\LOC.Core.csprojResolveAssemblyReference.cache

View File

@ -1,13 +0,0 @@
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Release\LOC.Core.dll.config
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Release\LOC.Core.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Release\LOC.Core.pdb
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Release\EntityFramework.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Release\LinqKit.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Release\Newtonsoft.Json.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Release\StructureMap.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Release\EntityFramework.xml
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Release\Newtonsoft.Json.xml
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Release\StructureMap.pdb
C:\Work\Nautilus\Minecraft\Website\LOC.Core\bin\Release\StructureMap.xml
C:\Work\Nautilus\Minecraft\Website\LOC.Core\obj\Release\LOC.Core.dll
C:\Work\Nautilus\Minecraft\Website\LOC.Core\obj\Release\LOC.Core.pdb

View File

@ -18,13 +18,15 @@
{ {
private readonly INautilusRepositoryFactory _repositoryFactory; private readonly INautilusRepositoryFactory _repositoryFactory;
private readonly IGameServerMonitor _gameServerMonitor; private readonly IGameServerMonitor _gameServerMonitor;
private readonly ILogger _logger;
private readonly object _transactionLock = new object(); private readonly object _transactionLock = new object();
public AccountAdministrator(INautilusRepositoryFactory nautilusRepositoryFactory) public AccountAdministrator(INautilusRepositoryFactory nautilusRepositoryFactory, ILogger logger)
{ {
_repositoryFactory = nautilusRepositoryFactory; _repositoryFactory = nautilusRepositoryFactory;
_gameServerMonitor = GameServerMonitor.Instance; _gameServerMonitor = GameServerMonitor.Instance;
_logger = logger;
} }
public List<String> GetAccountNames() public List<String> GetAccountNames()
@ -63,20 +65,9 @@
{ {
using (var repository = _repositoryFactory.CreateRepository()) using (var repository = _repositoryFactory.CreateRepository())
{ {
var account = var account = repository.Where<Account>(x => x.Name == loginToken.Name).FirstOrDefault() ?? CreateAccount(loginToken, repository);
repository.Where<Account>(x => x.Name == loginToken.Name) account.LoadNavigationProperties(repository.Context);
.Include(x => x.Rank) var edited = false;
.Include(x => x.Clan)
.Include(x => x.ClanRole)
.Include(x => x.CustomBuilds)
.Include(x => x.FishCatches)
.Include(x => x.IpAddresses)
.Include(x => x.PvpTransactions)
.Include(x => x.AccountTransactions)
.Include(x => x.Pets)
.Include(x => x.Punishments)
.Include(x => x.Tasks)
.FirstOrDefault() ?? CreateAccount(loginToken, repository);
// Expire punishments // Expire punishments
if (account.Punishments != null) if (account.Punishments != null)
@ -84,6 +75,7 @@
foreach (var expiredPunishment in account.Punishments.Where(x => x.Active && (x.Duration - 0d) > 0 && TimeUtil.GetCurrentMilliseconds() > (x.Time + (x.Duration * 3600000)))) foreach (var expiredPunishment in account.Punishments.Where(x => x.Active && (x.Duration - 0d) > 0 && TimeUtil.GetCurrentMilliseconds() > (x.Time + (x.Duration * 3600000))))
{ {
expiredPunishment.Active = false; expiredPunishment.Active = false;
edited = true;
} }
} }
@ -92,19 +84,13 @@
{ {
account.Rank = repository.Where<Rank>(x => x.Name == "ALL").First(); account.Rank = repository.Where<Rank>(x => x.Name == "ALL").First();
repository.Attach(account.Rank); repository.Attach(account.Rank);
edited = true;
} }
var loginAddress = repository.Where<LoginAddress>(x => x.Address == loginToken.IpAddress).FirstOrDefault() ?? CreateIpAddress(loginToken, repository); if (edited)
{
repository.Attach(loginAddress);
repository.Attach(account);
repository.Edit(account);
account.IpAddresses.Add(loginAddress);
repository.CommitChanges(); repository.CommitChanges();
}
// _gameServerMonitor.PlayerLoggedIn(account, loginToken.Server.ServerId);
return account; return account;
} }
@ -187,7 +173,7 @@
var task = new GameTask var task = new GameTask
{ {
Account = account, Account = account,
TaskName = token.Name, TaskName = token.NewTaskCompleted,
}; };
account.Tasks.Add(task); account.Tasks.Add(task);

View File

@ -51,7 +51,7 @@
{ {
long time = Environment.TickCount; long time = Environment.TickCount;
var json = JsonConvert.SerializeObject(new ClientToken(_accountAdministrator.Login(loginRequest))); var json = JsonConvert.SerializeObject(new ClientToken(_accountAdministrator.Login(loginRequest)));
_logger.Log("Debug", Environment.TickCount - time + "ms"); _logger.Log("Login Debug", "Total Login : " + (Environment.TickCount - time) + "ms");
return Content(json, "application/json"); return Content(json, "application/json");
} }

View File

@ -263,7 +263,7 @@
<file relUrl="Content/themes/techno/portfolio.html" publishTime="11/27/2012 17:05:50" /> <file relUrl="Content/themes/techno/portfolio.html" publishTime="11/27/2012 17:05:50" />
<file relUrl="Areas/Manage/Views/_ViewStart.cshtml" publishTime="11/27/2012 17:05:50" /> <file relUrl="Areas/Manage/Views/_ViewStart.cshtml" publishTime="11/27/2012 17:05:50" />
</publishProfile> </publishProfile>
<publishProfile publishUrl="ftp://192.95.29.103/inetpub/wwwroot/mineplexTemp" deleteExistingFiles="False" ftpAnonymousLogin="False" ftpPassiveMode="True" msdeploySite="" msdeploySiteID="" msdeployRemoteSitePhysicalPath="" msdeployAllowUntrustedCertificate="False" msdeploySkipExtraFilesOnServer="True" msdeployMarkAsApp="False" profileName="Profile2" publishMethod="FTP" replaceMatchingFiles="True" userName="root" savePWD="False" userPWD="" SelectedForPublish="True"> <publishProfile publishUrl="ftp://192.95.29.103/inetpub/wwwroot/MineplexDev" deleteExistingFiles="False" ftpAnonymousLogin="False" ftpPassiveMode="True" msdeploySite="" msdeploySiteID="" msdeployRemoteSitePhysicalPath="" msdeployAllowUntrustedCertificate="False" msdeploySkipExtraFilesOnServer="True" msdeployMarkAsApp="False" profileName="Profile2" publishMethod="FTP" replaceMatchingFiles="True" userName="root" savePWD="True" userPWD="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAoKC1eHkUgUKnJNl79F3lpAAAAAACAAAAAAADZgAAwAAAABAAAADtcqRkU0++iUotnqx/QjuTAAAAAASAAACgAAAAEAAAAInFuRtPvC7O4jNhSKtxix8YAAAAZCcXYHQb1Rq8/FIV2lFZJ5vMbQXxr5OVFAAAAP+irmrT5ZwxQ6jyCCVKU+zahE3b" SelectedForPublish="True">
<file relUrl="Content/Images/Wiki/SkillBook.png" publishTime="04/19/2013 03:44:52" /> <file relUrl="Content/Images/Wiki/SkillBook.png" publishTime="04/19/2013 03:44:52" />
<file relUrl="Areas/Manage/Views/Log/_CreateOrEdit.cshtml" publishTime="11/27/2012 17:05:50" /> <file relUrl="Areas/Manage/Views/Log/_CreateOrEdit.cshtml" publishTime="11/27/2012 17:05:50" />
<file relUrl="Scripts/MicrosoftAjax.js" publishTime="11/27/2012 17:05:51" /> <file relUrl="Scripts/MicrosoftAjax.js" publishTime="11/27/2012 17:05:51" />
@ -360,7 +360,7 @@
<file relUrl="Content/themes/techno/images/templatemo_image_02.png" publishTime="11/27/2012 17:05:50" /> <file relUrl="Content/themes/techno/images/templatemo_image_02.png" publishTime="11/27/2012 17:05:50" />
<file relUrl="Content/Images/Wiki/Ranger.png" publishTime="04/19/2013 03:35:02" /> <file relUrl="Content/Images/Wiki/Ranger.png" publishTime="04/19/2013 03:35:02" />
<file relUrl="Scripts/jquery-1.8.2.js" publishTime="11/27/2012 17:05:51" /> <file relUrl="Scripts/jquery-1.8.2.js" publishTime="11/27/2012 17:05:51" />
<file relUrl="bin/LOC.Website.Common.pdb" publishTime="09/02/2013 19:25:32" /> <file relUrl="bin/LOC.Website.Common.pdb" publishTime="09/03/2013 11:31:14" />
<file relUrl="bin/LOC.Core.pdb" publishTime="09/02/2013 19:25:31" /> <file relUrl="bin/LOC.Core.pdb" publishTime="09/02/2013 19:25:31" />
<file relUrl="Content/Images/Wiki/red_dye.jpg" publishTime="04/19/2013 03:12:21" /> <file relUrl="Content/Images/Wiki/red_dye.jpg" publishTime="04/19/2013 03:12:21" />
<file relUrl="Scripts/MicrosoftMvcValidation.js" publishTime="11/27/2012 17:05:51" /> <file relUrl="Scripts/MicrosoftMvcValidation.js" publishTime="11/27/2012 17:05:51" />
@ -433,9 +433,9 @@
<file relUrl="Views/Store/_WritePackage.cshtml" publishTime="04/19/2013 17:36:49" /> <file relUrl="Views/Store/_WritePackage.cshtml" publishTime="04/19/2013 17:36:49" />
<file relUrl="Content/css/bootstrap-responsive.min.css" publishTime="11/27/2012 17:05:50" /> <file relUrl="Content/css/bootstrap-responsive.min.css" publishTime="11/27/2012 17:05:50" />
<file relUrl="Views/Servers/Index.cshtml" publishTime="05/08/2013 10:15:36" /> <file relUrl="Views/Servers/Index.cshtml" publishTime="05/08/2013 10:15:36" />
<file relUrl="bin/LOC.Website.Web.dll" publishTime="09/02/2013 19:25:33" /> <file relUrl="bin/LOC.Website.Web.dll" publishTime="09/03/2013 11:31:15" />
<file relUrl="Views/Shared/_FrontLayout.cshtml" publishTime="11/27/2012 17:05:51" /> <file relUrl="Views/Shared/_FrontLayout.cshtml" publishTime="11/27/2012 17:05:51" />
<file relUrl="bin/LOC.Website.Web.pdb" publishTime="09/02/2013 19:25:33" /> <file relUrl="bin/LOC.Website.Web.pdb" publishTime="09/03/2013 11:31:15" />
<file relUrl="Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png" publishTime="11/27/2012 17:05:50" /> <file relUrl="Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png" publishTime="11/27/2012 17:05:50" />
<file relUrl="Views/Profile/Index.cshtml" publishTime="11/27/2012 17:05:51" /> <file relUrl="Views/Profile/Index.cshtml" publishTime="11/27/2012 17:05:51" />
<file relUrl="bin/WebMatrix.WebData.xml" publishTime="11/27/2012 17:05:51" /> <file relUrl="bin/WebMatrix.WebData.xml" publishTime="11/27/2012 17:05:51" />
@ -483,7 +483,7 @@
<file relUrl="Content/themes/techno/images/templatemo_home_header.jpg" publishTime="11/27/2012 17:05:50" /> <file relUrl="Content/themes/techno/images/templatemo_home_header.jpg" publishTime="11/27/2012 17:05:50" />
<file relUrl="Content/themes/techno/images/blog/03.jpg" publishTime="11/27/2012 17:05:50" /> <file relUrl="Content/themes/techno/images/blog/03.jpg" publishTime="11/27/2012 17:05:50" />
<file relUrl="Content/themes/techno/images/slider/ss.png" publishTime="11/27/2012 17:05:50" /> <file relUrl="Content/themes/techno/images/slider/ss.png" publishTime="11/27/2012 17:05:50" />
<file relUrl="bin/LOC.Website.Common.dll" publishTime="09/02/2013 19:25:32" /> <file relUrl="bin/LOC.Website.Common.dll" publishTime="09/03/2013 11:31:14" />
<file relUrl="Content/themes/techno/images/prevlabel.gif" publishTime="11/27/2012 17:05:50" /> <file relUrl="Content/themes/techno/images/prevlabel.gif" publishTime="11/27/2012 17:05:50" />
<file relUrl="Content/themes/techno/images/templatemo_subpage_bg.jpg" publishTime="11/27/2012 17:05:50" /> <file relUrl="Content/themes/techno/images/templatemo_subpage_bg.jpg" publishTime="11/27/2012 17:05:50" />
<file relUrl="bin/LOC.Core.dll" publishTime="09/02/2013 19:25:31" /> <file relUrl="bin/LOC.Core.dll" publishTime="09/02/2013 19:25:31" />

Binary file not shown.