mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-06 03:27:28 +08:00
[-] Remove broadcast to reduce abuse
This commit is contained in:
@@ -64,11 +64,6 @@ fun ActiveClient.handle(msg: Msg) {
|
|||||||
lastHeartbeat = millis()
|
lastHeartbeat = millis()
|
||||||
send(ctlMsg(Command.CTL_HEARTBEAT))
|
send(ctlMsg(Command.CTL_HEARTBEAT))
|
||||||
}
|
}
|
||||||
Command.DATA_BROADCAST -> {
|
|
||||||
// Broadcast to all clients. This is only used in UDP so SID is always 0
|
|
||||||
if (msg.proto != Proto.UDP) return log.warn("TCP Broadcast received, something is wrong.")
|
|
||||||
clients.values.forEach { it.send(msg.copy(src = stubIp)) }
|
|
||||||
}
|
|
||||||
Command.DATA_SEND, Command.CTL_TCP_ACCEPT_ACK -> {
|
Command.DATA_SEND, Command.CTL_TCP_ACCEPT_ACK -> {
|
||||||
target ?: return log.warn("Send: Target not found: ${msg.dst}")
|
target ?: return log.warn("Send: Target not found: ${msg.dst}")
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,9 @@ import ext.str
|
|||||||
object Command {
|
object Command {
|
||||||
// Control plane
|
// Control plane
|
||||||
const val CTL_START = 1u
|
const val CTL_START = 1u
|
||||||
const val CTL_BIND = 2u
|
|
||||||
const val CTL_HEARTBEAT = 3u
|
const val CTL_HEARTBEAT = 3u
|
||||||
const val CTL_TCP_CONNECT = 4u // Accept a new multiplexed TCP stream
|
const val CTL_TCP_CONNECT = 4u // Accept a new multiplexed TCP stream
|
||||||
const val CTL_TCP_ACCEPT = 5u
|
const val CTL_TCP_ACCEPT = 5u
|
||||||
const val CTL_TCP_ACCEPT_ACK = 6u
|
|
||||||
const val CTL_TCP_CLOSE = 7u
|
const val CTL_TCP_CLOSE = 7u
|
||||||
|
|
||||||
// Data plane
|
// Data plane
|
||||||
|
|||||||
Reference in New Issue
Block a user