clean up for release candidate

This commit is contained in:
DaMachinator 2018-01-23 08:22:38 -05:00 committed by Arcanitor
parent 652f786064
commit 59fffab908
5 changed files with 13 additions and 19 deletions

View File

@ -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. //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = "0.0.1" version = "0.1.1"
group = "ivilengineering" // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = "civilengineering" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "CivilEngineering" archivesBaseName = "CivilEngineering"
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.

View File

@ -18,7 +18,7 @@ import java.util.*
const val MODID = "civilengineering" const val MODID = "civilengineering"
const val NAME = "Civil Engineering" const val NAME = "Civil Engineering"
const val VERSION = "0.0.1" const val VERSION = "0.1.1"
@Mod( @Mod(
modid = MODID, modid = MODID,
@ -44,16 +44,11 @@ object CivilEngineering {
@Mod.EventHandler @Mod.EventHandler
fun preInit(event: FMLPreInitializationEvent) { fun preInit(event: FMLPreInitializationEvent) {
logger = event.modLog logger = event.modLog
logger.info("loading logger") logger.info("Building bridge!")
CivilEngineeringConfig(event.modConfigurationDirectory) CivilEngineeringConfig(event.modConfigurationDirectory)
} }
@Mod.EventHandler
fun init(event: FMLInitializationEvent) {
logger.info("Bridge building init.")
}
@Mod.EventHandler @Mod.EventHandler
fun postInit(event: FMLPostInitializationEvent) { fun postInit(event: FMLPostInitializationEvent) {
// MinecraftForge.EVENT_BUS.register(ServerChatHelper::class.java) // MinecraftForge.EVENT_BUS.register(ServerChatHelper::class.java)
@ -62,8 +57,8 @@ object CivilEngineering {
@Mod.EventHandler @Mod.EventHandler
fun serverStarting(event: FMLServerStartingEvent) { fun serverStarting(event: FMLServerStartingEvent) {
logger.debug("Registering bridge commands")
event.registerServerCommand(BridgeCommand()) event.registerServerCommand(BridgeCommand())
logger.info("Bridge building starting.")
MessageHandler.start() MessageHandler.start()
//maybe try registering them manually //maybe try registering them manually
@ -75,7 +70,6 @@ object CivilEngineering {
@Mod.EventHandler @Mod.EventHandler
fun serverStopping(event: FMLServerStoppingEvent) { fun serverStopping(event: FMLServerStoppingEvent) {
logger.info("Bridge shutting down.")
MessageHandler.stop() MessageHandler.stop()
} }
} }

View File

@ -20,7 +20,7 @@ object MessageHandler {
} }
private fun createThread(): HttpStreamConnection { private fun createThread(): HttpStreamConnection {
CivilEngineering.logger.info("building bridge") CivilEngineering.logger.info("Attempting to open bridge connection.")
return HttpStreamConnection( return HttpStreamConnection(
{ {
HttpGet(cfg!!.connect.url + "/api/stream").apply { HttpGet(cfg!!.connect.url + "/api/stream").apply {
@ -31,7 +31,7 @@ object MessageHandler {
rcvQueue.add( rcvQueue.add(
ApiMessage.decode(it) ApiMessage.decode(it)
) )
CivilEngineering.logger.info("received: " + it) CivilEngineering.logger.debug("Received: " + it)
} }
) )
} }
@ -41,16 +41,16 @@ object MessageHandler {
var rcvQueue = ConcurrentLinkedQueue<ApiMessage>() var rcvQueue = ConcurrentLinkedQueue<ApiMessage>()
fun transmit(msg: ApiMessage) { fun transmit(msg: ApiMessage) {
CivilEngineering.logger.info("transmitting " + msg) CivilEngineering.logger.debug("Transmitting: " + msg)
transmitMessage(msg) transmitMessage(msg)
} }
fun stop() { fun stop() {
CivilEngineering.logger.info("bridge closing") CivilEngineering.logger.info("Closing bridge connection...")
// MessageHandler.transmit(ApiMessage(text="bridge closing", username="Server")) // MessageHandler.transmit(ApiMessage(text="bridge closing", username="Server"))
streamConnection.close() streamConnection.close()
CivilEngineering.logger.info("bridge closed") CivilEngineering.logger.info("Bridge connection closed!")
} }
fun start(): Boolean { fun start(): Boolean {

View File

@ -39,9 +39,9 @@ class BridgeCommand : CommandBase() {
val cmd = args[0].toLowerCase() val cmd = args[0].toLowerCase()
when (cmd) { when (cmd) {
"connect" -> if (MessageHandler.start()) { "connect" -> if (MessageHandler.start()) {
logger.info("connected to matterbridge") logger.info("Connected to matterbridge relay")
} else { } else {
logger.error("connection to matterbridge failed") logger.error("Connection to matterbridge relay failed.")
} }
"disconnect" -> MessageHandler.stop() "disconnect" -> MessageHandler.stop()
} }

View File

@ -2,7 +2,7 @@
"modid": "civilengineering", "modid": "civilengineering",
"name": "Civil Engineering", "name": "Civil Engineering",
"description": "Minecraft Server Matterbridge link", "description": "Minecraft Server Matterbridge link",
"version": "0.0.1", "version": "0.1.1",
"mcversion": "1.12.2", "mcversion": "1.12.2",
"authorList":["Arcanitor", "NikkyAi"], "authorList":["Arcanitor", "NikkyAi"],
"credits": "Blame Nikky for talking me into this." "credits": "Blame Nikky for talking me into this."