-
Notifications
You must be signed in to change notification settings - Fork 28
/
AgentToGame.go
45 lines (39 loc) · 1.39 KB
/
AgentToGame.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package service
/* Server
type AgentToGameServer interface {
// SessionManager
CreateSession(context.Context, *SessionInfo) (*Success, error)
GetGameServerInfo(context.Context, *SessionKey) (*ServerInfo, error)
GetRoomList(context.Context, *SessionKey) (*RoomList, error)
}
*/
type ATGServer struct {
}
func (s *ATGServer) CreateSession(context.Context, *SessionInfo) (*Success, error) {
return nil, nil
}
func (s *ATGServer) GetGameServerInfo(context.Context, *SessionKey) (*ServerInfo, error) {
return nil, nil
}
func (s *ATGServer) GetRoomList(context.Context, *SessionKey) (*RoomList, error) {
return nil, nil
}
/*Client
type AgentToGameClient interface {
// SessionManager
CreateSession(ctx context.Context, in *SessionInfo, opts ...grpc.CallOption) (*Success, error)
GetGameServerInfo(ctx context.Context, in *SessionKey, opts ...grpc.CallOption) (*ServerInfo, error)
GetRoomList(ctx context.Context, in *SessionKey, opts ...grpc.CallOption) (*RoomList, error)
}
*/
type ATGClient struct {
}
func (c *ATGClient) CreateSession(ctx context.Context, in *SessionInfo, opts ...grpc.CallOption) (*Success, error) {
return nil, nil
}
func (c *ATGClient) GetGameServerInfo(ctx context.Context, in *SessionKey, opts ...grpc.CallOption) (*ServerInfo, error) {
return nil, nil
}
func (c *ATGClient) GetRoomList(ctx context.Context, in *SessionKey, opts ...grpc.CallOption) (*RoomList, error) {
return nil, nil
}