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

@@ -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))
}