Skip to content

Commit

Permalink
removed some re-draws, put in some slightly delayed redraws to bodge-…
Browse files Browse the repository at this point in the history
…fix some issues
  • Loading branch information
Holladiewal committed Dec 30, 2017
1 parent dd2653f commit 72ec441
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/LogHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ open class listener : TailerListenerAdapter(){



@Suppress("UNREACHABLE_CODE")
fun handleMessage(nick : String, message: String){
@Suppress("NAME_SHADOWING")
var message = message.strip().reduce()
Expand Down Expand Up @@ -212,6 +213,7 @@ open class listener : TailerListenerAdapter(){
}
} else {
if (message.startsWith(config.varMap["${entries.keyword}"]!!.toUpperCase())) {
return //ignore signals for now, but keep the active Code for now
//RATSIGNAL - CMDR killcrazycarl - System: COL 285 sector GM-V D2-110 (225.32 LY from Sothis) - Platform: XB - O2: OK - Language: English (en-US) (Case #1)
//RATSIGNAL - CMDR test - System: COL 285 sector GM-V D2-110 (225.32 LY from Sothis) - Platform: XB - O2: OK - Language: English (en-US) (Case #1)
//RATSIGNAL - CMDR Condor Aybarra - System: MN-t B3-6 Alrai Sector (not in EDDB) - Platform: PC - O2: OK - Language: English (en-US) - IRC Nickname: Condor_Aybarra (Case #3)
Expand Down
4 changes: 2 additions & 2 deletions src/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ class Rat(name : String, status : Status = Status(""), val uuid: String){

}


var rescues : WatchableMutableList<Rescue> = WatchableMutableList(::updateScreen)
fun noop() = Unit
var rescues : WatchableMutableList<Rescue> = WatchableMutableList(::noop)



Expand Down
10 changes: 5 additions & 5 deletions src/WebSocketHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

import com.google.gson.*
import kotlinx.coroutines.experimental.delay
import kotlinx.coroutines.experimental.launch
import org.java_websocket.handshake.ServerHandshake
import java.lang.Exception
Expand Down Expand Up @@ -215,11 +216,9 @@ fun parseRescueUpdate(meta: JsonObject, data: JsonArray){
.map { Rat(resolveRatName(it), Status(""), it)}
)*/

for (rat in ratsNow){
if (!rats.map { it.uuid }.contains(rat)){
rats.add(Rat(resolveRatName(rat), uuid=rat))
}
}
ratsNow
.filterNot { rat -> rats.map { it.uuid }.contains(rat) }
.forEach { rats.add(Rat(resolveRatName(it), uuid= it)) }
attributes.get("unidentifiedRats").asJsonArray.forEach { rats.add(Rat(it.asString, uuid="-1").setNameCorrectly())}

/*
Expand All @@ -245,6 +244,7 @@ fun parseRescueUpdate(meta: JsonObject, data: JsonArray){

}
updateScreen()
launch{ delay(255); updateScreen()}

}

Expand Down

0 comments on commit 72ec441

Please sign in to comment.