mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-09-25 08:45:32 -05:00
GPCM: Fix login command order
This commit is contained in:
16
gpcm/main.go
16
gpcm/main.go
@@ -104,12 +104,12 @@ func handleRequest(conn net.Conn) {
|
||||
|
||||
err := conn.(*net.TCPConn).SetKeepAlive(true)
|
||||
if err != nil {
|
||||
logging.Notice(session.ModuleName, "Unable to set keepalive:", err.Error())
|
||||
logging.Notice(session.ModuleName, "Unable to set keepalive (1):", err.Error())
|
||||
}
|
||||
|
||||
err = conn.(*net.TCPConn).SetKeepAlivePeriod(time.Hour * 1000)
|
||||
if err != nil {
|
||||
logging.Notice(session.ModuleName, "Unable to set keepalive:", err.Error())
|
||||
logging.Notice(session.ModuleName, "Unable to set keepalive (2):", err.Error())
|
||||
}
|
||||
|
||||
conn.Write([]byte(fmt.Sprintf(`\lc\1\challenge\%s\id\1\final\`, challenge)))
|
||||
@@ -141,17 +141,17 @@ func handleRequest(conn net.Conn) {
|
||||
for _, command := range commands {
|
||||
logging.Notice(session.ModuleName, "Command:", aurora.Yellow(command.Command))
|
||||
|
||||
if session.LoggedIn == false {
|
||||
if command.Command != "login" {
|
||||
logging.Notice(session.ModuleName, "Attempt to run command before login!")
|
||||
return
|
||||
}
|
||||
|
||||
if command.Command == "login" {
|
||||
payload, _ := session.Login(pool, ctx, command, challenge)
|
||||
conn.Write([]byte(payload))
|
||||
}
|
||||
}
|
||||
|
||||
if session.LoggedIn == false {
|
||||
logging.Notice(session.ModuleName, "Attempt to run command before login!")
|
||||
return
|
||||
}
|
||||
|
||||
// Make sure commands that update the profile run before getprofile
|
||||
for _, command := range commands {
|
||||
switch command.Command {
|
||||
|
||||
Reference in New Issue
Block a user