-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adds disconnect packets that can be used to send the client a disconnect reason - Adds connection states. Depending on the connection state, a different kick packet is used - Adds `connection.disconnect` optional reason (sent as a kick packet) - When server is shutting down, the configured kick message is sent to all connections in a valid state. By default, `Server closed`
- Loading branch information
Showing
16 changed files
with
192 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"port": "25565" | ||
"port": "25565", | ||
"shutdownKickReason": "Server closed" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import ServerPacket from "../../ServerPacket.js"; | ||
|
||
export default class DisconnectLoginPacket extends ServerPacket { | ||
public static readonly id = 0x00; | ||
|
||
public constructor(reason: ChatComponent) { | ||
super(Buffer.concat([ | ||
ServerPacket.writeVarInt(DisconnectLoginPacket.id), | ||
ServerPacket.writeChat(reason) | ||
])); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import ServerPacket from "../../ServerPacket.js"; | ||
|
||
export default class DisconnectPlayPacket extends ServerPacket { | ||
public static readonly id = 0x1a; | ||
|
||
public constructor(reason: ChatComponent) { | ||
super(Buffer.concat([ | ||
ServerPacket.writeVarInt(DisconnectPlayPacket.id), | ||
ServerPacket.writeChat(reason) | ||
])); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
type ChatComponent = { | ||
bold?: boolean; | ||
italic?: boolean; | ||
underlined?: boolean; | ||
strikethrough?: boolean; | ||
obfuscated?: boolean; | ||
font?: string; | ||
color?: string; | ||
insertion?: string; | ||
clickEvent?: { | ||
action: "open_url" | "open_file" | "run_command" | "suggest_command" | "change_page" | "copy_to_clipboard"; | ||
value: string; | ||
} | ||
hoverEvent?: { | ||
action: "show_text" | "show_item" | "show_entity"; | ||
} | ||
text?: string; | ||
extra?: [ChatComponent, ...ChatComponent[]]; | ||
} | {translate: string; with?: ChatComponent[]} | {keybind: string} | { | ||
score: { | ||
name: string; | ||
objective: string; | ||
value?: string; | ||
} | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters