- 移除 common/data/socket 目录下的大部分文件 - 新增 service 目录,将 Player 和 Conn 结构体移至该目录 - 更新 LogicClient 中的方法签名,使用 service 包的类型 - 重构 Controller 中的方法,适应新的 service 包结构
16 lines
437 B
Go
16 lines
437 B
Go
package controller
|
|
|
|
import (
|
|
"blazing/common/socket/errorcode"
|
|
"blazing/logic/service"
|
|
"blazing/logic/service/login"
|
|
blservice "blazing/modules/blazing/service"
|
|
)
|
|
|
|
// 处理命令: 1001
|
|
func (h *Controller) CreatePlayer(data *login.CreatePlayerInboundInfo, c *service.Conn) (result *login.CreatePlayerOutInfo, err errorcode.ErrorCode) {
|
|
|
|
blservice.NewUserService(data.Head.UserID).Reg(data.Nickname, data.Color)
|
|
return result, 0
|
|
}
|