mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-28 02:23:37 +01:00
feat(protbot): add headless MHF protocol bot as cmd/protbot
Copy MHBridge into the Erupe module as cmd/protbot/ so it can be built, tested, and maintained alongside the server. The bot implements the full sign → entrance → channel login flow and supports lobby entry, chat, session setup, and quest enumeration. The conn/ package keeps its own Blowfish crypto primitives to avoid importing erupe-ce/config (which requires a config file at init).
This commit is contained in:
17
cmd/protbot/scenario/logout.go
Normal file
17
cmd/protbot/scenario/logout.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package scenario
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"erupe-ce/cmd/protbot/protocol"
|
||||
)
|
||||
|
||||
// Logout sends MSG_SYS_LOGOUT and closes the channel connection.
|
||||
func Logout(ch *protocol.ChannelConn) error {
|
||||
fmt.Println("[logout] Sending MSG_SYS_LOGOUT...")
|
||||
if err := ch.SendPacket(protocol.BuildLogoutPacket()); err != nil {
|
||||
ch.Close()
|
||||
return fmt.Errorf("logout send: %w", err)
|
||||
}
|
||||
return ch.Close()
|
||||
}
|
||||
Reference in New Issue
Block a user