This commit is contained in:
1
2025-08-28 21:35:56 +00:00
parent 00f38b8c53
commit 79361e68cd
29 changed files with 253 additions and 232 deletions

View File

@@ -1,7 +1,7 @@
package controller
import (
"blazing/common/data/entity"
"blazing/common/data/socket"
"blazing/common/socket/errorcode"
"blazing/common/socket/handler"
"blazing/cool"
@@ -50,9 +50,9 @@ func (h *LogicClient) QuitSelf(a int) error {
for {
//entity.ConutPlayer()
fmt.Println("当前在线人数", cool.ConutPlayer())
fmt.Println("当前在线人数", socket.ConutPlayer())
if cool.ConutPlayer() <= 0 {
if socket.ConutPlayer() <= 0 {
//执行退出逻辑
os.Exit(1)
}
@@ -158,7 +158,7 @@ func getcmd(t reflect.Type) []uint32 {
}
// 遍历结构体方法并执行RECV_cmd
func Recv(c *entity.Conn, data handler.TomeeHeader) {
func Recv(c *socket.Conn, data handler.TomeeHeader) {
cmdlister, ok := cool.CmdCache.Load(data.CMD)
if !ok {
@@ -189,7 +189,7 @@ func Recv(c *entity.Conn, data handler.TomeeHeader) {
if nameField.IsValid() && nameField.CanSet() {
nameField.Set(reflect.ValueOf(data))
}
if cmdlister.Type().In(1) == reflect.TypeOf(&entity.Player{}) {
if cmdlister.Type().In(1) == reflect.TypeOf(&socket.Player{}) {
c1 := service.GetPlayer(c, data.UserID)
err := c1.WaitForLoginWithCtx(context.Background())
if err != nil {