----------------------------------------------------------------------------------------------------------------------------------------------------------------------
服务器体系结构图:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
客户端交互LoginServer获取Gateway连接信息的时序:
Client LoginServer CenterServer GatewayServer
| (UserID, ServerID) | | |
| ----------------LoginReq--------------->| | |
| Auth (UserID) | |
| | -------------UserLoginReq-----------> | |
| | Get Best Gateway |
| | | |
| | CreateUser |
| | | |
| | SetUserState(WantLogin) |
| | | |
| | Gen CryptoCode |
| | | |
| | (Gateway Info, CryptoCode) | |
| |<-------------UserLoginAck-------------| |
| (Gateway Info, CryptoCode) | | (UserID, CryptoCode) |
|<---------------LoginAck-----------------| |-------------UserWantLoginNtf---------->|
| | | |
| | | Create ClientObject(UserID, CryptoCode)
| | | |
| | | Waiting For Client(UserId, CryptoCode) Connect
| | | |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
客户端连接到Gateway后验证的时序:(网关结点要做到尽可能少的分配服务器资源)
Client GatewayServer
| (UserID, CryptoCode) |
|---------------ConnectReq-------------->|
| On Accept
| |
| Auth(UserID, CryptoCode)
| |
| <-------------ConnectAck---------------|
| |
Connect Success |
| |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
客户端真正登录游戏的时序:
Client CenterServer GameServer DBServer
| | | |
|--------------------------------------------------------EnterGameReq-------------------------------------------------> |
| | | |
| | | Register[UserID, GatewayID]
| | | |
| | | User Data Exist?(LRU)
| | | |
| <------------------------------------------------------EnterGameAck-------------------------------------------------->|
| | | |
阅读(521) | 评论(0) | 转发(0) |