1
0

stop hardcoding webserver address 🔥🔥

This commit is contained in:
labalityowo
2023-05-21 19:30:45 +07:00
parent 9be271d703
commit e7b02fc9d1
6 changed files with 67 additions and 3 deletions

View File

@ -18,7 +18,7 @@ import mineplex.serverdata.database.DatabaseRunnable;
@Deprecated
public class BasicMSSQLProvider implements MSSQLProvider
{
private final String _webAddress = Constants.WEB_ADDRESS;
public static String _webAddress = Constants.WEB_ADDRESS;
// Queue for failed processes
private final Object QUEUE_LOCK = new Object();

View File

@ -2,6 +2,7 @@ package mineplex.game.nano;
import static mineplex.core.Managers.require;
import mineplex.core.database.BasicMSSQLProvider;
import org.bukkit.Bukkit;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@ -100,6 +101,12 @@ public class NanoGames extends JavaPlugin
getConfig().set(Constants.WEB_CONFIG_KEY, getConfig().getString(Constants.WEB_CONFIG_KEY));
saveConfig();
Bukkit.getWorld("world").getEntities().forEach(entity -> {
entity.remove();
});
BasicMSSQLProvider._webAddress = getConfig().getString(Constants.WEB_CONFIG_KEY);
require(ProfileCacheManager.class);
CommandCenter.Initialize(this);
CoreClientManager clientManager = new CoreClientManager(this);
@ -154,7 +161,7 @@ public class NanoGames extends JavaPlugin
new MessageManager(this, incognito, clientManager, preferenceManager, ignoreManager, punish, friendManager, require(Chat.class));
new MemoryFix(this);
new MenuManager(this);
new FileUpdater(GenericServer.HUB);
//new FileUpdater(GenericServer.HUB);
new CustomTagFix(this, packetHandler);
new PacketsInteractionFix(this, packetHandler);

View File

@ -1,5 +1,6 @@
package mineplex.hub;
import mineplex.core.database.BasicMSSQLProvider;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
@ -93,6 +94,13 @@ public class Hub extends JavaPlugin implements IRelation
getConfig().set(Constants.WEB_CONFIG_KEY, getConfig().getString(Constants.WEB_CONFIG_KEY));
saveConfig();
Bukkit.getWorld("world").getEntities().forEach(entity -> {
entity.remove();
});
//workaround: i have no way of doing this better
BasicMSSQLProvider._webAddress = getConfig().getString(Constants.WEB_CONFIG_KEY);
//Static Modules
require(ProfileCacheManager.class);
CommandCenter.Initialize(this);

View File

@ -2,6 +2,7 @@ package mineplex.staffServer;
import java.util.UUID;
import mineplex.core.database.BasicMSSQLProvider;
import net.minecraft.server.v1_8_R3.MinecraftServer;
import org.bukkit.Bukkit;
@ -50,6 +51,12 @@ public class StaffServer extends JavaPlugin
getConfig().set(Constants.WEB_CONFIG_KEY, getConfig().getString(Constants.WEB_CONFIG_KEY));
saveConfig();
Bukkit.getWorld("world").getEntities().forEach(entity -> {
entity.remove();
});
BasicMSSQLProvider._webAddress = getConfig().getString(Constants.WEB_CONFIG_KEY);
//Static Modules
CommandCenter.Initialize(this);
CoreClientManager clientManager = new CoreClientManager(this);
@ -70,7 +77,7 @@ public class StaffServer extends JavaPlugin
BonusRepository bonusRepository = new BonusRepository(this, null, donationManager);
new AchievementManager(statsManager, clientManager, donationManager, null, eloManager);
new MemoryFix(this);
new FileUpdater(GenericServer.HUB);
//new FileUpdater(GenericServer.HUB);
require(PacketHandler.class);
require(DisguiseManager.class);

View File

@ -3,6 +3,7 @@ package nautilus.game.arcade;
import java.io.File;
//import mineplex.core.TwitchIntegrationFix;
import mineplex.core.database.BasicMSSQLProvider;
import net.minecraft.server.v1_8_R3.MinecraftServer;
import org.bukkit.Bukkit;
@ -106,6 +107,10 @@ public class Arcade extends JavaPlugin
}, this, ServicePriority.Normal);
*/
Bukkit.setSpawnRadius(0);
Bukkit.getWorld("world").getEntities().forEach(entity -> {
entity.remove();
});
//Delete Old Games Folders
DeleteFolders();
@ -114,6 +119,9 @@ public class Arcade extends JavaPlugin
getConfig().set(Constants.WEB_CONFIG_KEY, getConfig().getString(Constants.WEB_CONFIG_KEY));
saveConfig();
//workaround: i have no way of doing this better
BasicMSSQLProvider._webAddress = getConfig().getString(Constants.WEB_CONFIG_KEY);
//Logger.initialize(this);
//Static Modules

View File

@ -723,6 +723,40 @@ CREATE TABLE `youtube` (
`clicktime` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Table structure for table `salesannouncements`
--
CREATE TABLE `salesannouncements` (
`id` int(11) NOT NULL,
`ranks` varchar(250) DEFAULT NULL,
`message` varchar(256) DEFAULT NULL,
`enabled` tinyint(1) DEFAULT NULL,
`clans` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `salesannouncements`
--
ALTER TABLE `salesannouncements`
ADD PRIMARY KEY (`id`),
ADD KEY `typeIndex` (`clans`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `salesannouncements`
--
ALTER TABLE `salesannouncements`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
--
-- Indexes for dumped tables
--