use of org.spongepowered.common.service.sql.SqlServiceImpl in project SpongeCommon by SpongePowered.
the class SpongeBootstrap method initializeServices.
public static void initializeServices() {
registerService(SqlService.class, new SqlServiceImpl());
registerService(PaginationService.class, new SpongePaginationService());
if (SpongeImpl.getGame().getPlatform().getType() == Platform.Type.SERVER) {
registerService(RconService.class, new MinecraftRconService((DedicatedServer) Sponge.getServer()));
}
registerService(UserStorageService.class, new SpongeUserStorageService());
registerService(BanService.class, new SpongeBanService());
registerService(WhitelistService.class, new SpongeWhitelistService());
SpongeInternalListeners.getInstance().registerServiceCallback(PermissionService.class, input -> {
if (Sponge.isServerAvailable()) {
Sponge.getServer().getConsole().getContainingCollection();
}
});
SpongeUsernameCache.load();
}
use of org.spongepowered.common.service.sql.SqlServiceImpl in project SpongeForge by SpongePowered.
the class SpongeMod method onServerStopped.
@Subscribe
public void onServerStopped(FMLServerStoppedEvent event) throws IOException {
try {
CommandManager service = this.game.getCommandManager();
service.getCommands().stream().filter(mapping -> mapping.getCallable() instanceof MinecraftCommandWrapper).forEach(service::removeMapping);
((SqlServiceImpl) this.game.getServiceManager().provideUnchecked(SqlService.class)).close();
} catch (Throwable t) {
this.controller.errorOccurred(this, t);
}
// used by client
WorldManager.unregisterAllWorldSettings();
}
Aggregations