Callback Function
The callback function for the login event is onLogin
. It does not take any parameters or return any values and is called only when the user successfully logs in.
Invocation Timing
- It is invoked when the game login is successful and whenever the game reconnects at any time.
- If it is the first time logging into the game, the callback is triggered before entering the lobby. Please note that you cannot operate any lobby functions before entering the lobby.
Example Code
package main
import (
"fmt"
)
func onLogin() {
fmt.Println("Login successful")
}