Skip to content

Commit

Permalink
refactor: improve toString in multiple packets
Browse files Browse the repository at this point in the history
  • Loading branch information
Z-Kris committed May 5, 2024
1 parent 98eab37 commit c731bd8
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public class NpcInfoLarge(buffer: ByteBuf) : DefaultByteBufHolder(buffer), Outgo
}

override fun toString(): String {
return "NpcInfoLarge() ${super.toString()}"
return super.toString()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public class NpcInfoSmall(buffer: ByteBuf) : DefaultByteBufHolder(buffer), Outgo
}

override fun toString(): String {
return "NpcInfoSmall() ${super.toString()}"
return super.toString()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public class PlayerInfoPacket(
}

override fun toString(): String {
return "PlayerInfoPacket() ${super.toString()}"
return super.toString()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,36 @@ public class IfSetEvents private constructor(
get() = _end.toInt()
override val category: ServerProtCategory
get() = GameServerProtCategory.LOW_PRIORITY_PROT

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false

other as IfSetEvents

if (combinedId != other.combinedId) return false
if (_start != other._start) return false
if (_end != other._end) return false
if (events != other.events) return false

return true
}

override fun hashCode(): Int {
var result = combinedId.hashCode()
result = 31 * result + _start.hashCode()
result = 31 * result + _end.hashCode()
result = 31 * result + events
return result
}

override fun toString(): String {
return "IfSetEvents(" +
"events=$events, " +
"interfaceId=$interfaceId, " +
"componentId=$componentId, " +
"start=$start, " +
"end=$end" +
")"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class RebuildLogin private constructor(
}

override fun toString(): String {
return "RebuildNormal(" +
return "RebuildLogin(" +
"zoneX=$zoneX, " +
"zoneZ=$zoneZ, " +
"keys=$keys, " +
Expand Down

0 comments on commit c731bd8

Please sign in to comment.