"refactor(player): 添加错误检查方法并迁移任务测试代码到独立文件"
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type Player struct {
|
||||
@@ -50,6 +52,12 @@ func (p *Player) SendPack(b []byte) error {
|
||||
err := p.MainConn.SendPack(b)
|
||||
return err
|
||||
}
|
||||
func (p *Player) Cheak(b error) {
|
||||
if b != nil {
|
||||
g.Log().Error(context.Background(), "出现错误", p.UserID, b.Error())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// IsLoggedIn 检查是否已登录
|
||||
func (lw *Player) IsLoggedIn() bool {
|
||||
|
||||
1
common/data/entity/task.go
Normal file
1
common/data/entity/task.go
Normal file
@@ -0,0 +1 @@
|
||||
package entity
|
||||
Reference in New Issue
Block a user