Files
bl/logic/service/systemtime/System.go
昔念 621a9d3858 refactor(socket): 重构 socket 模块
- 移除 common/data/socket 目录下的大部分文件
- 新增 service 目录,将 Player 和 Conn 结构体移至该目录
- 更新 LogicClient 中的方法签名,使用 service 包的类型
- 重构 Controller 中的方法,适应新的 service 包结构
2025-09-04 02:00:57 +08:00

25 lines
606 B
Go

package systemtime
import (
"blazing/logic/service"
"time"
)
// LoginSidInfo 登录携带的凭证结构体
type InInfo struct { //这里直接使用组合来实现将传入的原始头部数据和结构体参数序列化
Head service.TomeeHeader `cmd:"1002" struc:"[0]pad"` //玩家登录
}
// OutInfo 表示系统时间的出站消息
type OutInfo struct {
SystemTime uint32 `json:"systemTime"` // @UInt long类型
}
// NewOutInfo 创建新的系统时间消息实例
func NewOutInfo() *OutInfo {
return &OutInfo{
SystemTime: uint32(time.Now().Unix()), // 获取当前时间戳(秒)
}
}