fix(rpc): 修复日志输出格式并修正logic服务器注册逻辑

修复了rpc模块中日志输出时参数拼接错误的问题,同时修正了RegisterLogic函数中端口映射的逻辑错误。

feat(socket): 替换错误处理方式为panic

在ServerEvent.go中将网络启动失败的返回错误改为panic处理,提高错误可见性。

feat(fight): 增加战斗加载进度控制

在LoadPercent函数中增加对FightC非
This commit is contained in:
2025-11-01 00:40:19 +08:00
parent 06c30c6113
commit eac1d41043
16 changed files with 92 additions and 76 deletions

View File

@@ -29,8 +29,8 @@ type ServerHandler struct{}
// 实现踢人
func (h *ServerHandler) Kick(ctx context.Context, userid uint32) error {
cool.Loger.Info(context.TODO(),"服务器收到踢人" )
cool.Loger.Info(context.TODO(), "服务器收到踢人")
useid1, err := share.ShareManager.GetUserOnline(userid)
if err != nil {
@@ -48,13 +48,14 @@ func (h *ServerHandler) Kick(ctx context.Context, userid uint32) error {
// 注册logic服务器
func (h *ServerHandler) RegisterLogic(ctx context.Context, id, port uint16) error {
cool.Loger.Debug(context.Background(), "注册logic服务器", id, port)
//TODO 待修复滚动更新可能导致的玩家可以同时在旧服务器和新服务器同时在线的bug
revClient, ok := jsonrpc.ExtractReverseClient[ClientHandler](ctx)
if !ok {
return fmt.Errorf("no reverse client")
}
blservice.NewLoginServiceService().GetServerID(id)
aa, ok := clientmap[port]
t, _ := blservice.NewLoginServiceService().GetServerID(id)
aa, ok := clientmap[t]
if ok { //如果已经存在且这个端口已经被存过
aa.QuitSelf(0)
}