temp
This commit is contained in:
24
Server/common/discover/service/client_gateway.go
Normal file
24
Server/common/discover/service/client_gateway.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"common/discover"
|
||||
"common/discover/common"
|
||||
"common/discover/service/game/game_pb"
|
||||
)
|
||||
|
||||
func GatewayNewClient(sid ...string) (game_pb.GameClient, error) {
|
||||
c, err := discover.FindServer(common.KeyDiscoverGateway, sid...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return game_pb.NewGameClient(c), nil
|
||||
}
|
||||
|
||||
func GatewayNewBroadcastClient() map[string]game_pb.GameClient {
|
||||
clientM := make(map[string]game_pb.GameClient)
|
||||
connM := discover.FindServerAll(common.KeyDiscoverGateway)
|
||||
for sid, conn := range connM {
|
||||
clientM[sid] = game_pb.NewGameClient(conn)
|
||||
}
|
||||
return clientM
|
||||
}
|
||||
Reference in New Issue
Block a user