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.
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.

View File

@ -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()
}
}

View File

@ -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<ApiMessage>()
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 {

View File

@ -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()
}

View File

@ -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."