feat config

This commit is contained in:
2025-12-11 11:12:36 +08:00
parent d6f770fbb3
commit 71d4e593c7
19 changed files with 229 additions and 326 deletions

View File

@@ -20,7 +20,7 @@ func init() {
sceneServerM = make(map[int64]map[SceneFun]grpc.ClientStream)
}
func FindSceneBySID(sid int64, fun SceneFun) (grpc.ClientStream, error) {
func findSceneBySID(sid int64, fun SceneFun) (grpc.ClientStream, error) {
g := sceneServerM[sid]
if g == nil {
g = make(map[SceneFun]grpc.ClientStream)
@@ -39,7 +39,7 @@ func FindSceneBySID(sid int64, fun SceneFun) (grpc.ClientStream, error) {
link, err = sceneClient.Action(context.Background())
}
if err != nil {
log.Errorf("FindSceneBySID %v err: %v, sid: %v", fun, err, sid)
log.Errorf("findSceneBySID %v err: %v, sid: %v", fun, err, sid)
return nil, err
}
g[fun] = link
@@ -49,7 +49,7 @@ func FindSceneBySID(sid int64, fun SceneFun) (grpc.ClientStream, error) {
}
func SendMessageToScene(sid int64, fun SceneFun, msg proto.Message, re ...bool) error {
stream, err := FindSceneBySID(sid, fun)
stream, err := findSceneBySID(sid, fun)
if err != nil {
return err
}