diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/repository/MysqlAccountRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/account/repository/MysqlAccountRepository.java index cf1962af4..4721d3a54 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/repository/MysqlAccountRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/repository/MysqlAccountRepository.java @@ -6,7 +6,7 @@ import mineplex.core.mysql.RepositoryBase; public class MysqlAccountRepository extends RepositoryBase { - private static String CREATE_ACCOUNT_TABLE = "CREATE TABLE IF NOT EXISTS Accounts (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(40), gems INT, rank VARCHAR(40), rankPerm BOOL, rankExpire LONG, lastLogin LONG, totalPlayTime LONG, PRIMARY KEY (id));"; + private static String CREATE_ACCOUNT_TABLE = "CREATE TABLE IF NOT EXISTS Accounts (id INT NOT NULL AUTO_INCREMENT, uuid VARCHAR(100), name VARCHAR(40), gems INT, rank VARCHAR(40), rankPerm BOOL, rankExpire LONG, lastLogin LONG, totalPlayTime LONG, PRIMARY KEY (id), );"; public MysqlAccountRepository(JavaPlugin plugin) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java new file mode 100644 index 000000000..3d4f82cf2 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java @@ -0,0 +1,19 @@ +package mineplex.core.friend; + +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.MiniPlugin; +import mineplex.core.friend.data.FriendRepository; + +public class FriendManager extends MiniPlugin +{ + private FriendRepository _repository; + + public FriendManager(JavaPlugin plugin) + { + super("Friends", plugin); + + _repository = new FriendRepository(); + _repository.initialize(); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/data/FriendRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/data/FriendRepository.java new file mode 100644 index 000000000..f7b5f4d82 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/data/FriendRepository.java @@ -0,0 +1,33 @@ +package mineplex.core.friend.data; + +import java.util.ArrayList; +import java.util.List; + +public class FriendRepository +{ + public void initialize() + { + + } + + public boolean addFriend(String name) + { + boolean success = true; + + return success; + } + + public boolean removeFriend(String name) + { + boolean success = true; + + return success; + } + + public List getFriends(String uuid) + { + List friends = new ArrayList(); + + return friends; + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/data/FriendStatus.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/data/FriendStatus.java new file mode 100644 index 000000000..e5e600833 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/data/FriendStatus.java @@ -0,0 +1,8 @@ +package mineplex.core.friend.data; + +public class FriendStatus +{ + public String Name; + public String ServerName; + public long LastSeenOnline; +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendPage.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendPage.java new file mode 100644 index 000000000..21d0f5501 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendPage.java @@ -0,0 +1,6 @@ +package mineplex.core.friend.ui; + +public class FriendPage +{ + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendShop.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendShop.java new file mode 100644 index 000000000..180cfa08c --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendShop.java @@ -0,0 +1,6 @@ +package mineplex.core.friend.ui; + +public class FriendShop +{ + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/InvitesPage.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/InvitesPage.java new file mode 100644 index 000000000..f9ee9d93b --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/InvitesPage.java @@ -0,0 +1,6 @@ +package mineplex.core.friend.ui; + +public class InvitesPage +{ + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/playerTracker/PlayerTracker.java b/Plugins/Mineplex.Core/src/mineplex/core/playerTracker/PlayerTracker.java index 615521e89..28fcd7976 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/playerTracker/PlayerTracker.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/playerTracker/PlayerTracker.java @@ -1,5 +1,6 @@ package mineplex.core.playerTracker; +import org.bukkit.Bukkit; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.plugin.java.JavaPlugin; @@ -20,14 +21,26 @@ public class PlayerTracker extends MiniPlugin } @EventHandler - public void trackPlayer(PlayerJoinEvent event) + public void trackPlayer(final PlayerJoinEvent event) { - _repository.updatePlayerServer(event.getPlayer().getName()); + Bukkit.getServer().getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable() + { + public void run() + { + _repository.updatePlayerServer(event.getPlayer().getName()); + } + }); } @EventHandler - public void untrackPlayer(ClientUnloadEvent event) + public void untrackPlayer(final ClientUnloadEvent event) { - _repository.deleteServerTransfers(event.GetName()); + Bukkit.getServer().getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable() + { + public void run() + { + _repository.deleteServerTransfers(event.GetName()); + } + }); } } diff --git a/Website/LOC.Website.Common/Models/AccountAdministrator.cs b/Website/LOC.Website.Common/Models/AccountAdministrator.cs index 2e7543c43..a9f4d8da5 100644 --- a/Website/LOC.Website.Common/Models/AccountAdministrator.cs +++ b/Website/LOC.Website.Common/Models/AccountAdministrator.cs @@ -88,6 +88,13 @@ edited = true; } + // Update account name if changed + if (!String.Equals(account.Name, loginToken.Name)) + { + account.Name = loginToken.Name; + edited = true; + } + // Expire ranks if ((account.Rank.Name == "ULTRA") && !account.RankPerm && DateTime.Now.CompareTo(account.RankExpire) >= 0) { diff --git a/Website/LOCWebsite.suo b/Website/LOCWebsite.suo index c0ee1bc8b..4ac012ac5 100644 Binary files a/Website/LOCWebsite.suo and b/Website/LOCWebsite.suo differ