Skip to content

Commit

Permalink
Merge pull request #22 from yukonisen/bukkit
Browse files Browse the repository at this point in the history
Fix PlayerLoginEvent address
  • Loading branch information
yukonisen authored Apr 10, 2024
2 parents c77390f + 88aff3d commit 05372c1
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,10 @@ class PlayerJoinListener : Listener {

object : BukkitRunnable() {
override fun run() {
val playerAddress = event.realAddress.hostAddress
val playerAddress = event.address.hostAddress
val playerName = event.player.name
val ipParse = IpParseFactory.getIpParse(playerAddress)
var result = ipParse.getProvince()

if (result == "未知" || result == "") {
result = ipParse.getCity()
if (result == "未知" || result == "") {
result = ipParse.getCountry()
}
}

val result = ipParse.getFallback()
IpAttributeMap.playerIpAttributeMap[playerName] = result
plugin.log("Player named $playerName connect to proxy from ${ipParse.getProvince()}${ipParse.getCity()} ${ipParse.getISP()}")
}
Expand Down

0 comments on commit 05372c1

Please sign in to comment.