feat sc改名ss

This commit is contained in:
2026-01-12 12:20:09 +08:00
parent 151517de9b
commit 7f16b94f9c
7 changed files with 41 additions and 38 deletions

View File

@@ -4,7 +4,7 @@ import (
"context"
"git.hlsq.asia/mmorpg/service-common/log"
"git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb"
"git.hlsq.asia/mmorpg/service-common/proto/sc/sc_pb"
"git.hlsq.asia/mmorpg/service-common/proto/ss/ss_pb"
"git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/client"
"google.golang.org/protobuf/proto"
"sync"
@@ -28,11 +28,11 @@ func (s *Server) ToClient(server grpc_pb.Gateway_ToClientServer) error {
//utils.WorkerPool(ws_handler.UserMgr.GetAllInterface(), func(task interface{}) {
// client := task.(*ws_handler.Client)
// client.WriteBytes(sc_pb.MessageID(args.MessageID), args.Payload)
// client.WriteBytes(ss_pb.MessageID(args.MessageID), args.Payload)
//})
data, err := proto.Marshal(&sc_pb.Message{
ID: sc_pb.MessageID(args.MessageID),
data, err := proto.Marshal(&ss_pb.Message{
ID: ss_pb.MessageID(args.MessageID),
Payload: args.Payload,
})
if err != nil {
@@ -44,11 +44,11 @@ func (s *Server) ToClient(server grpc_pb.Gateway_ToClientServer) error {
}
//for _, client := range ws_handler.UserMgr.GetAll() {
// client.WriteBytes(sc_pb.MessageID(args.MessageID), args.Payload)
// client.WriteBytes(ss_pb.MessageID(args.MessageID), args.Payload)
//}
} else {
if cli := client.UserMgr.GetByUSN(args.USN); cli != nil {
cli.WriteBytes(sc_pb.MessageID(args.MessageID), args.Payload)
cli.WriteBytes(ss_pb.MessageID(args.MessageID), args.Payload)
}
}
}