feat 修改usn类型为string
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user