From 59fffab908b87f68a103ccb2a9effe29fb2a265e Mon Sep 17 00:00:00 2001 From: DaMachinator Date: Tue, 23 Jan 2018 08:22:38 -0500 Subject: [PATCH] clean up for release candidate --- build.gradle | 4 ++-- src/main/kotlin/civilengineering/CivilEngineering.kt | 12 +++--------- .../kotlin/civilengineering/bridge/MessageHandler.kt | 10 +++++----- .../kotlin/civilengineering/command/BridgeCommand.kt | 4 ++-- src/main/resources/mcmod.info | 2 +- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index 417fdca..76904c1 100644 --- a/build.gradle +++ b/build.gradle @@ -17,8 +17,8 @@ apply plugin: 'com.github.johnrengelman.shadow' //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. -version = "0.0.1" -group = "ivilengineering" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +version = "0.1.1" +group = "civilengineering" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "CivilEngineering" sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. diff --git a/src/main/kotlin/civilengineering/CivilEngineering.kt b/src/main/kotlin/civilengineering/CivilEngineering.kt index b4cff88..ff1744d 100644 --- a/src/main/kotlin/civilengineering/CivilEngineering.kt +++ b/src/main/kotlin/civilengineering/CivilEngineering.kt @@ -18,7 +18,7 @@ import java.util.* const val MODID = "civilengineering" const val NAME = "Civil Engineering" -const val VERSION = "0.0.1" +const val VERSION = "0.1.1" @Mod( modid = MODID, @@ -44,16 +44,11 @@ object CivilEngineering { @Mod.EventHandler fun preInit(event: FMLPreInitializationEvent) { logger = event.modLog - logger.info("loading logger") + logger.info("Building bridge!") CivilEngineeringConfig(event.modConfigurationDirectory) } - @Mod.EventHandler - fun init(event: FMLInitializationEvent) { - logger.info("Bridge building init.") - } - @Mod.EventHandler fun postInit(event: FMLPostInitializationEvent) { // MinecraftForge.EVENT_BUS.register(ServerChatHelper::class.java) @@ -62,8 +57,8 @@ object CivilEngineering { @Mod.EventHandler fun serverStarting(event: FMLServerStartingEvent) { + logger.debug("Registering bridge commands") event.registerServerCommand(BridgeCommand()) - logger.info("Bridge building starting.") MessageHandler.start() //maybe try registering them manually @@ -75,7 +70,6 @@ object CivilEngineering { @Mod.EventHandler fun serverStopping(event: FMLServerStoppingEvent) { - logger.info("Bridge shutting down.") MessageHandler.stop() } } diff --git a/src/main/kotlin/civilengineering/bridge/MessageHandler.kt b/src/main/kotlin/civilengineering/bridge/MessageHandler.kt index 91342b2..62ef6bb 100644 --- a/src/main/kotlin/civilengineering/bridge/MessageHandler.kt +++ b/src/main/kotlin/civilengineering/bridge/MessageHandler.kt @@ -20,7 +20,7 @@ object MessageHandler { } private fun createThread(): HttpStreamConnection { - CivilEngineering.logger.info("building bridge") + CivilEngineering.logger.info("Attempting to open bridge connection.") return HttpStreamConnection( { HttpGet(cfg!!.connect.url + "/api/stream").apply { @@ -31,7 +31,7 @@ object MessageHandler { rcvQueue.add( ApiMessage.decode(it) ) - CivilEngineering.logger.info("received: " + it) + CivilEngineering.logger.debug("Received: " + it) } ) } @@ -41,16 +41,16 @@ object MessageHandler { var rcvQueue = ConcurrentLinkedQueue() fun transmit(msg: ApiMessage) { - CivilEngineering.logger.info("transmitting " + msg) + CivilEngineering.logger.debug("Transmitting: " + msg) transmitMessage(msg) } fun stop() { - CivilEngineering.logger.info("bridge closing") + CivilEngineering.logger.info("Closing bridge connection...") // MessageHandler.transmit(ApiMessage(text="bridge closing", username="Server")) streamConnection.close() - CivilEngineering.logger.info("bridge closed") + CivilEngineering.logger.info("Bridge connection closed!") } fun start(): Boolean { diff --git a/src/main/kotlin/civilengineering/command/BridgeCommand.kt b/src/main/kotlin/civilengineering/command/BridgeCommand.kt index 621cedb..20a7486 100644 --- a/src/main/kotlin/civilengineering/command/BridgeCommand.kt +++ b/src/main/kotlin/civilengineering/command/BridgeCommand.kt @@ -39,9 +39,9 @@ class BridgeCommand : CommandBase() { val cmd = args[0].toLowerCase() when (cmd) { "connect" -> if (MessageHandler.start()) { - logger.info("connected to matterbridge") + logger.info("Connected to matterbridge relay") } else { - logger.error("connection to matterbridge failed") + logger.error("Connection to matterbridge relay failed.") } "disconnect" -> MessageHandler.stop() } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 9fd36b6..0848682 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -2,7 +2,7 @@ "modid": "civilengineering", "name": "Civil Engineering", "description": "Minecraft Server Matterbridge link", - "version": "0.0.1", + "version": "0.1.1", "mcversion": "1.12.2", "authorList":["Arcanitor", "NikkyAi"], "credits": "Blame Nikky for talking me into this."