- 在 Player 结构中添加登录状态标志和登录完成通知通道 - 实现 IsLoggedIn、WaitForLogin、WaitForLoginWithTimeout 和 WaitForLoginWithCtx 方法 - 在登录逻辑中使用 CompleteLogin 标记登录完成并通知等待者 - 在控制器中添加登录状态检查,确保处理已登录玩家的请求
14 lines
309 B
Go
14 lines
309 B
Go
package controller
|
|
|
|
import (
|
|
"blazing/common/data/entity"
|
|
"blazing/logic/service/maps"
|
|
)
|
|
|
|
func (h Controller) MapHot(data *maps.MapHotInboundInfo, c *entity.Player) {
|
|
|
|
data.Def()
|
|
//fmt.Println("登录成功")
|
|
//log.Printf("任务 %s 执行中,已登录状态: %v\n", , lw.IsLoggedIn())
|
|
}
|