mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 23:54:33 +01:00
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).
18 lines
384 B
Go
18 lines
384 B
Go
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()
|
|
}
|