Exception fixes
Fixed a bug that could occasionally cause the sandwich lady interface to become unresponsive Fixed an issue that could cause shade random events to not spawn for max-level players Fixed an issue that could cause zombie random events to not spawn for max-level players Fixed a widespread book issue that resulted from not resetting the current page index when closing a book, and then trying to open another book with less pages. Converted bogrog pouch swap to the generic item select interface, and removed relevant code from the grand exchange code Fixed an issue that could occasionally prevent exchange of item sets Fixed an issue with Diango's reclaim interface that could result in items other than the ones you clicked being claimed Made incubation moderately more reliable, and incubation timers now pass even while offline Fixed an issue that prevented the leather crafting dialogue from accepting tokenized amounts (e.g. 100k) Fixed an issue that prevented the tool leprechaun interface from allowing tokenized amounts Fixed an issue that prevented players from using tokenized amounts in the ogleroot purchase dialogue for vinesweeper Fixed an issue that prevented Zaff's batttlestaff dialogue from accepting tokenized amounts Fixed an issue that prevented shop buy-x options from accepting tokenized amounts Various shop-related exception fixes Added some ingame player messages for when a Hunter "catch" option isn't being handled properly Fixed some exceptions being thrown by lunar spells Pyramid Plunder is now better at detecting when a player is in the minigame erroneously and kicking them out Fixed an issue that would lead to incorrect Kalphite Queen behavior when killing her with multiple players in the room Fixed an issue that could cause the Bedabin Nomad's dialogue to hang during Tourist Trap Fixed several more issues with Fight Arena cutscenes Fixed an issue that could prevent the dwarf dialogue from opening while trying to enter the mountain shortcut before finishing Fishing Contest Fixed an issue that could cause dialogue option hangs in certain unusual circumstances Fixed an issue that could result in non-movement for interactions where the override location was the same as the target node's location and there was no destination flag set Fixed an issue where setting invalid node data could cause issues with NPC rendering Server can now detect when a session is sending up multiple invalid packets and automatically disconnect the player Fixed an issue that could lead to unintended saving of varps/varbits Fixed an issue that could cause some interactions in shops to silently fail. The user will now receive a relevant message when these situations occur Users may now find they could occasionally receive a very snarky response when incorrectly using commands Users now receive messages when they try to make use of unimplemented friends/clan/etc features. Errors in string parsing will no longer result in "dead" inputs when attempting to add friends/update clan ranks/etc Fixed an issue that could lead to loss of some alerts in the Discord integration. Discord integration will now detect problems and queue the failed messages to be resent later. Added more safety checks to item-on-grounditem packet handling to prevent throwing exceptions Exceptions in string parsing for command packets will now inform the user that something went wrong, and ask them to try again. Improved drop table parsing and fixed incorrect drop tables
This commit is contained in:
@@ -92,6 +92,9 @@ public final class MSPacketRepository {
|
||||
buffer.put(publicSetting);
|
||||
buffer.put(privateSetting);
|
||||
buffer.put(tradeSetting);
|
||||
WorldCommunicator.getSession().write(buffer);
|
||||
if (WorldCommunicator.getSession() != null)
|
||||
WorldCommunicator.getSession().write(buffer);
|
||||
else
|
||||
player.sendMessage("Privacy settings unavailable at the moment. Please try again later.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ public final class GameReadEvent extends IoReadEvent {
|
||||
size = getPacketSize(buffer, opcode, header, last);
|
||||
}
|
||||
if (size == -1) {
|
||||
session.getPlayer().incrementInvalidPacketCount();
|
||||
break;
|
||||
}
|
||||
if (buffer.remaining() < size) {
|
||||
@@ -136,11 +137,7 @@ public final class GameReadEvent extends IoReadEvent {
|
||||
}
|
||||
return buffer.getShort() & 0xFFFF;
|
||||
}
|
||||
if(header == -3){
|
||||
|
||||
}
|
||||
log(this.getClass(), Log.ERR, "Invalid packet [opcode=" + opcode + ", last=" + last + ", queued=" + usedQueuedBuffer + "], header=" + header+"!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,8 +88,7 @@ public final class MSReadEvent extends IoReadEvent {
|
||||
}
|
||||
return buffer.getShort() & 0xFFFF;
|
||||
}
|
||||
log(this.getClass(), Log.ERR, "Invalid packet [opcode=" + opcode + ", last=" + last + ", queued=" + usedQueuedBuffer + "]!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,6 +158,10 @@ object PacketProcessor {
|
||||
}
|
||||
}
|
||||
is Packet.ReportAbuse -> {
|
||||
if (pkt.target.isNullOrEmpty()) {
|
||||
sendMessage(pkt.player, "Invalid player name.")
|
||||
return
|
||||
}
|
||||
if (!GameWorld.accountStorage.checkUsernameTaken(pkt.target.lowercase())) {
|
||||
sendMessage(pkt.player, "Invalid player name.")
|
||||
return
|
||||
@@ -571,9 +575,9 @@ object PacketProcessor {
|
||||
player = pkt.player
|
||||
} else if (pkt is Packet.UseWithGroundItem) {
|
||||
val container = getLikelyContainerForIface(pkt.player, pkt.iface) ?: return
|
||||
item = container[pkt.slot]
|
||||
item = container[pkt.slot] ?: return
|
||||
itemId = pkt.usedId
|
||||
node = GroundItemManager.get(pkt.withId, Location.create(pkt.x, pkt.y, pkt.player.location.z), pkt.player)
|
||||
node = GroundItemManager.get(pkt.withId, Location.create(pkt.x, pkt.y, pkt.player.location.z), pkt.player) ?: return
|
||||
nodeId = pkt.withId
|
||||
type = IntType.GROUNDITEM
|
||||
player = pkt.player
|
||||
|
||||
@@ -9,6 +9,7 @@ import core.tools.StringUtils
|
||||
import core.tools.SystemLogger
|
||||
import java.io.PrintWriter
|
||||
import java.io.StringWriter
|
||||
import java.nio.BufferUnderflowException
|
||||
|
||||
enum class Decoders530(val opcode: Int) {
|
||||
/******************************************
|
||||
@@ -635,8 +636,13 @@ enum class Decoders530(val opcode: Int) {
|
||||
COMMAND(44) {
|
||||
override fun decode(player: Player, buffer: IoBuffer): Packet {
|
||||
if (buffer.toByteBuffer().remaining() > 1) {
|
||||
val message = buffer.string.lowercase()
|
||||
return Packet.Command(player, message)
|
||||
try {
|
||||
val message = buffer.string.lowercase()
|
||||
return Packet.Command(player, message)
|
||||
} catch (e: BufferUnderflowException) {
|
||||
player.sendMessage("Something went wrong there! Please try again.")
|
||||
return Packet.NoProcess()
|
||||
}
|
||||
}
|
||||
return Packet.NoProcess()
|
||||
}
|
||||
@@ -795,4 +801,4 @@ enum class Decoders530(val opcode: Int) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +89,9 @@ object Login {
|
||||
}
|
||||
|
||||
return Pair(AuthResponse.Success, info)
|
||||
} catch (buf: BufferUnderflowException) {
|
||||
//some issue in either the data they sent us or how we read it, either way out of scope of this class's handling.
|
||||
return Pair(AuthResponse.UnexpectedError, null)
|
||||
} catch (e: Exception) {
|
||||
log(this::class.java, Log.ERR, "Exception encountered during login packet parsing! See stack trace below.")
|
||||
e.printStackTrace()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package core.net.packet.`in`
|
||||
|
||||
import core.api.sendDialogue
|
||||
import core.api.*
|
||||
import core.game.node.entity.player.Player
|
||||
|
||||
/**
|
||||
@@ -12,6 +12,8 @@ object RunScript {
|
||||
|
||||
fun processInput(player: Player, value: Any, script: ((Any) -> Boolean)) {
|
||||
if (value is Int && value <= 0) return
|
||||
|
||||
val type = player.getAttribute("input-type", InputType.NUMERIC)
|
||||
|
||||
var input = value
|
||||
|
||||
@@ -26,10 +28,18 @@ object RunScript {
|
||||
input = input.replace("k", "000").replace("m", "000000")
|
||||
}
|
||||
|
||||
if (type == InputType.NUMERIC || type == InputType.AMOUNT)
|
||||
input = input.toString().toIntOrNull() ?: input
|
||||
|
||||
try {
|
||||
script(input)
|
||||
} catch (_: NumberFormatException) {
|
||||
sendDialogue(player, "That number's a bit large, don't you think?")
|
||||
} catch (_: ClassCastException) {
|
||||
sendDialogue(player, "Something went wrong here. Try again.")
|
||||
} finally {
|
||||
removeAttribute(player, "runscript")
|
||||
removeAttribute(player, "input-type")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user