feat 修改usn类型为string

This commit is contained in:
2026-01-11 16:16:16 +08:00
parent 5af027b35c
commit 9e1889b956
13 changed files with 34 additions and 36 deletions

View File

@@ -24,7 +24,7 @@ func (s *Server) ToClient(server grpc_pb.Gateway_ToClientServer) error {
if args, err := server.Recv(); err != nil {
return
} else {
if args.USN == -1 {
if args.USN == "" {
//utils.WorkerPool(ws_handler.UserMgr.GetAllInterface(), func(task interface{}) {
// client := task.(*ws_handler.Client)

View File

@@ -23,7 +23,7 @@ type sceneStream struct {
stream grpc.ClientStream
}
func findSceneBySID(sid int64, fun SceneFun) (*sceneStream, error) {
func findSceneBySID(sid string, fun SceneFun) (*sceneStream, error) {
key := sceneKey(sid, fun)
if v, ok := sceneServer.Load(key); ok {
@@ -54,7 +54,7 @@ func findSceneBySID(sid int64, fun SceneFun) (*sceneStream, error) {
return ss, nil
}
func SendMessageToScene(sid int64, fun SceneFun, msg proto.Message, re ...bool) error {
func SendMessageToScene(sid string, fun SceneFun, msg proto.Message, re ...bool) error {
ss, err := findSceneBySID(sid, fun)
if err != nil {
return err
@@ -79,6 +79,6 @@ func SendMessageToScene(sid int64, fun SceneFun, msg proto.Message, re ...bool)
return nil
}
func sceneKey(sid int64, fun SceneFun) string {
return strconv.FormatInt(sid, 10) + "-" + strconv.Itoa(int(fun))
func sceneKey(sid string, fun SceneFun) string {
return sid + "-" + strconv.Itoa(int(fun))
}