feat 协议移动到Public

This commit is contained in:
2025-12-15 11:22:59 +08:00
parent 6e19d93f5e
commit 3498cf158d
45 changed files with 2730 additions and 929 deletions

View File

@@ -2,9 +2,8 @@ package server
import (
"common/log"
"common/proto/gen/common"
"common/proto/gen/cs"
"common/proto/gen/grpc_pb"
"common/proto/sc/sc_pb"
"common/proto/ss/grpc_pb"
"gateway/handler/ws_handler"
"sync"
)
@@ -25,16 +24,16 @@ func (s *Server) ToClient(server grpc_pb.Gateway_ToClientServer) error {
} else {
if args.UID == -1 {
for _, client := range ws_handler.UserMgr.GetAll() {
client.WriteBytes(cs.MessageID(args.MessageID), args.Payload)
client.WriteBytes(sc_pb.MessageID(args.MessageID), args.Payload)
}
} else {
if client := ws_handler.UserMgr.GetByUID(int(args.UID)); client != nil {
client.WriteBytes(cs.MessageID(args.MessageID), args.Payload)
client.WriteBytes(sc_pb.MessageID(args.MessageID), args.Payload)
}
}
}
}
}()
wg.Wait()
return server.SendAndClose(&common.Empty{})
return server.SendAndClose(&grpc_pb.ToClientResp{})
}