Public Types | |
typedef function< void(const string &, bool)> | Callback |
typedef function< void(size_t, bool)> | GlobalAccountsNumberCallback |
typedef function< void(const string &, const Rpc::PeerId &)> | LocateCallback |
typedef function< void(const string &, const Ptr< Session > &, bool)> | LoginCallback |
typedef function< void(const string &, const Ptr< Session > &, bool)> | LogoutCallback |
typedef function< void(const Ptr< Session > &, const Rpc::PeerId &, const string &, RedirectClientResult)> | RedirectClientCallback |
enum | RedirectClientResult { kSuccess = 0, kNoRpcPeer, kNotLoggedIn, kNoTransport, kError = 1000 } |
typedef function< void(const string &, const Ptr< Session > &, bool, const string &)> | RedirectionCallback |
typedef function< void(const string &, const Ptr< Session > &)> | RemoteLogoutCallback |
Static Public Member Functions | |
static void | BroadcastGlobally (const string &msg_type, const Ptr< FunMessage > &msg, const Rpc::Tag &server_tag, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a protobuf message to all the logged-in sessions of the given RPC servers. More... | |
static void | BroadcastGlobally (int32_t msg_type, const Ptr< FunMessage > &msg, const Rpc::Tag &server_tag, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a protobuf message to all the logged-in sessions of the given RPC servers. More... | |
static void | BroadcastGlobally (const ProtobufExtensionIdentifier &msg_type, const Ptr< FunMessage > &msg, const Rpc::Tag &server_tag, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a protobuf message to all the logged-in sessions of the given RPC servers. More... | |
static void | BroadcastGlobally (const string &msg_type, const Json &msg, const Rpc::Tag &server_tag, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a Json message to all the logged-in sessions of the given RPC servers. More... | |
static void | BroadcastGlobally (const string &msg_type, const Ptr< FunMessage > &msg, const Rpc::PeerMap &servers, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a protobuf message to all the logged-in sessions of the given RPC servers. More... | |
static void | BroadcastGlobally (int32_t msg_type, const Ptr< FunMessage > &msg, const Rpc::PeerMap &servers, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a protobuf message to all the logged-in sessions of the given RPC servers. More... | |
static void | BroadcastGlobally (const ProtobufExtensionIdentifier &msg_type, const Ptr< FunMessage > &msg, const Rpc::PeerMap &servers, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a protobuf message to all the logged-in sessions of the given RPC servers. More... | |
static void | BroadcastGlobally (const string &msg_type, const Json &msg, const Rpc::PeerMap &servers, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a Json message to all the logged-in sessions of the given RPC servers. More... | |
static void | BroadcastLocally (const string &msg_type, const Ptr< FunMessage > &msg, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a protobuf message to all the logged-in local sessions. More... | |
static void | BroadcastLocally (int32_t msg_type, const Ptr< FunMessage > &msg, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a protobuf message to all the logged-in local sessions. More... | |
static void | BroadcastLocally (const ProtobufExtensionIdentifier &msg_type, const Ptr< FunMessage > &msg, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a protobuf message to all the logged-in local sessions. More... | |
static void | BroadcastLocally (const string &msg_type, const Json &msg, const Encryption &enc, const TransportProtocol &protocol) ASSERT_NO_ROLLBACK |
Broadcasts a Json message to all the the logged-in local sessions. More... | |
static bool | CheckAndSetLoggedIn (const string &account_id, const Ptr< Session > &session) ASSERT_NO_ROLLBACK |
Marks the given account logged in this server node. More... | |
static void | CheckAndSetLoggedInAsync (const string &account_id, const Ptr< Session > &session, const LoginCallback &callback) ASSERT_NO_ROLLBACK |
Marks the given account logged in this server node. More... | |
static void | CheckAndSetLoggedInAsync (const string &account_id, const Ptr< Session > &session, const size_t &max_retry, const LoginCallback &login_callback, const LogoutCallback &logout_callback) ASSERT_NO_ROLLBACK |
Marks the given account logged in this server node. More... | |
static string | FindLocalAccount (const Ptr< Session > &session) |
Returns an account string associated with the local session. More... | |
static Ptr< Session > | FindLocalSession (const string &account_id) |
Returns a session pointer if the account is attached to a local session. More... | |
static void | GetAllLocalAccounts (std::vector< string > *accounts) |
Returns all the accounts attached to the server node. More... | |
static void | GetAllLocalAccountsAndSessions (std::vector< std::pair< string, Ptr< Session > > > *accounts) |
Returns all the accounts attached to the server node and sessions. More... | |
static void | GetAllLocalSessions (std::vector< Ptr< Session > > *sessions) |
Returns all the sessions of logged-in accounts. More... | |
static int64_t | GetGlobalAccountsNumber () |
Returns the total number of logged-in accounts. More... | |
static void | GetGlobalAccountsNumberAsync (const GlobalAccountsNumberCallback &callback) |
static size_t | GetLocalAccountsNumber () |
Returns the number of accounts attached to the server node. More... | |
static bool | IsLoggedIn (const Ptr< Session > &session) |
Checks whether the given session is logged in the server node. More... | |
static Rpc::PeerId | Locate (const string &account_id) ASSERT_NO_ROLLBACK |
Locates a server node hosting the given account. More... | |
static void | LocateAsync (const string &account_id, const LocateCallback &callback) ASSERT_NO_ROLLBACK |
Locates a server node hosting the given account. More... | |
static bool | RedirectClient (const Ptr< Session > &session, const Rpc::PeerId &peer_id, const string &extra_data) ASSERT_NO_ROLLBACK |
Cooperatively moves client to another server. More... | |
static void | RedirectClientAsync (const Ptr< Session > &session, const Rpc::PeerId &peer_id, const string &extra_data, const RedirectClientCallback &callback) ASSERT_NO_ROLLBACK |
Cooperatively moves client to another server. More... | |
static void | RegisterRedirectionHandler (const RedirectionCallback &handler) |
static void | RegisterRemoteLogoutHandler (const RemoteLogoutCallback &handler) |
static void | SendMessage (const string &msg_type, const Ptr< FunMessage > &msg, const string &account_id, const Encryption &enc=kDefaultEncryption, const TransportProtocol &protocol=kDefaultProtocol, const Callback &cb=kNullCallback) ASSERT_NO_ROLLBACK |
Asynchronously sends a protobuf message to the given account. More... | |
static void | SendMessage (int32_t msg_type, const Ptr< FunMessage > &msg, const string &account_id, const Encryption &enc=kDefaultEncryption, const TransportProtocol &protocol=kDefaultProtocol, const Callback &cb=kNullCallback) ASSERT_NO_ROLLBACK |
Asynchronously sends a protobuf message to the given account. More... | |
static void | SendMessage (const ProtobufExtensionIdentifier &msg_type, const Ptr< FunMessage > &msg, const string &account_id, const Encryption &enc=kDefaultEncryption, const TransportProtocol &protocol=kDefaultProtocol, const Callback &cb=kNullCallback) ASSERT_NO_ROLLBACK |
Asynchronously sends a protobuf message to the given account. More... | |
static void | SendMessage (const string &msg_type, const Json &msg, const string &account_id, const Encryption &enc=kDefaultEncryption, const TransportProtocol &protocol=kDefaultProtocol, const Callback &cb=kNullCallback) ASSERT_NO_ROLLBACK |
Asynchronously sends a Json message to the given account. More... | |
static bool | SendMessageSync (const string &msg_type, const Ptr< FunMessage > &msg, const string &account_id, const Encryption &enc=kDefaultEncryption, const TransportProtocol &protocol=kDefaultProtocol) ASSERT_NO_ROLLBACK |
Synchronously sends a protobuf message to the given account. More... | |
static bool | SendMessageSync (int32_t msg_type, const Ptr< FunMessage > &msg, const string &account_id, const Encryption &enc=kDefaultEncryption, const TransportProtocol &protocol=kDefaultProtocol) ASSERT_NO_ROLLBACK |
Synchronously sends a protobuf message to the given account. More... | |
static bool | SendMessageSync (const ProtobufExtensionIdentifier &msg_type, const Ptr< FunMessage > &msg, const string &account_id, const Encryption &enc=kDefaultEncryption, const TransportProtocol &protocol=kDefaultProtocol) ASSERT_NO_ROLLBACK |
Synchronously sends a protobuf message to the given account. More... | |
static bool | SendMessageSync (const string &msg_type, const Json &msg, const string &account_id, const Encryption &enc=kDefaultEncryption, const TransportProtocol &protocl=kDefaultProtocol) ASSERT_NO_ROLLBACK |
Synchronously sends a Json message to the given account. More... | |
static bool | SetLoggedOut (const string &account_id) ASSERT_NO_ROLLBACK |
Marks the given account logged out of this server node. More... | |
static bool | SetLoggedOut (const Ptr< Session > &session) ASSERT_NO_ROLLBACK |
Marks the given session logged out of this server node. More... | |
static void | SetLoggedOutAsync (const string &account_id, const LogoutCallback &callback) ASSERT_NO_ROLLBACK |
Marks the given account logged out of this server node. More... | |
static void | SetLoggedOutAsync (const Ptr< Session > &session, const LogoutCallback &callback) ASSERT_NO_ROLLBACK |
Marks the given session logged out of this server node. More... | |
static bool | SetLoggedOutGlobal (const string &account_id) ASSERT_NO_ROLLBACK |
Marks the given account logged out of any server node. More... | |
static void | SetLoggedOutGlobalAsync (const string &account_id, const LogoutCallback &callback) ASSERT_NO_ROLLBACK |
Marks the given account logged out of any server node. More... | |
Static Public Attributes | |
static const Callback | kNullCallback |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
server_tag | Rpc::Tag that identify the targets RPC servers. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
server_tag | Rpc::Tag that identify the targets RPC servers. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
server_tag | Rpc::Tag that identify the targets RPC servers. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | reference to a Json instance. |
server_tag | Rpc::Tag that identify the targets RPC servers. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
servers | Rpc::PeerMap that identify the targets RPC servers. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
servers | Rpc::PeerMap that identify the targets RPC servers. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
servers | Rpc::PeerMap that identify the targets RPC servers. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | reference to a Json instance. |
servers | Rpc::PeerMap that identify the targets RPC servers. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | reference to a Json instance. |
enc | Encryption as with Session::SendMessage() |
protocol | transport protocol supports kTcp, kUdp types only. |
|
static |
This information is shared among a cluster of game servers. If the given account has already logged into other server node, reporting will be rejected and this function will return false. (Distribution feature is required enabled.)
account_id | account id in the string form. |
session | pointer to a session instance. |
|
static |
This information is shared among a cluster of game servers. If the given account has already logged into other server node, reporting will be rejected and this function will return false. (Distribution feature is required enabled.)
account_id | account id in the string form. |
session | pointer to a session instance. |
callback | function to receive a result. |
|
static |
This information is shared among a cluster of game servers. If the given account has already logged into other server node, reporting will be rejected and this function will return false. (Distribution feature is required enabled.)
account_id | account id in the string form. |
session | pointer to a session instance. |
max_retry | max retry count if login failed. |
login_callback | function to receive a result. |
logout_callback | function to receive a logout result if logout succeed while retrying. |
session | a pointer to the session. |
account_id | account id in the string form. |
|
static |
accounts | container to be filled with the accounts. |
|
static |
accounts | container to be filled with the accounts and sessions |
|
static |
sessions | container to be filled with the sessions. |
|
static |
|
static |
|
static |
session | session to check. |
|
static |
The return value can be used to implement user-level RPC messages.
account_id | account id in the string form. |
|
static |
The return value can be used to implement user-level RPC messages.
account_id | account id in the string form. |
callback | function to receive server node's id. |
|
static |
session | client session which will be redirected to another server |
peer_id | rpc_id for destination server |
extra_data | addtional data to be transferred to destination server |
|
static |
session | client session which will be redirected to another server |
peer_id | rpc_id for destination server |
extra_data | addtional data to be transferred to destination server |
callback | function to receive a result |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
account_id | account id in the string form. |
enc | Encryption as with Session::SendMessage() |
protocol | Protocol as with Session::SendMessage() |
cb | Callback instance to be invoked when this RPC request is done. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
account_id | account id in the string form. |
enc | Encryption as with Session::SendMessage() |
protocol | Protocol as with Session::SendMessage() |
cb | Callback instance to be invoked when this RPC request is done. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
account_id | account id in the string form. |
enc | Encryption as with Session::SendMessage() |
protocol | Protocol as with Session::SendMessage() |
cb | Callback instance to be invoked when this RPC request is done. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | reference to a Json instance. |
account_id | account id in the string form. |
enc | Encryption as with Session::SendMessage() |
protocol | Protocol as with Session::SendMessage() |
cb | Callback instance to be invoked when this RPC request is done. |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
account_id | account id in the string form. |
enc | Encryption as with Session::SendMessage() |
protocol | Protocol as with Session::SendMessage() |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
account_id | account id in the string form. |
enc | Encryption as with Session::SendMessage() |
protocol | Protocol as with Session::SendMessage() |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | pointer to a FunMessage instance. |
account_id | account id in the string form. |
enc | Encryption as with Session::SendMessage() |
protocol | Protocol as with Session::SendMessage() |
|
static |
msg_type | msg type as with Session::SendMessage() |
msg | reference to a Json instance. |
account_id | account id in the string form. |
enc | Encryption as with Session::SendMessage() |
protocol | Protocol as with Session::SendMessage() |
|
static |
After this reporting the account can log in other server.
account_id | account id in the string form. |
|
static |
After this reporting the account can log in other server.
session | the session to logout. |
|
static |
After this reporting the account can log in other server.
account_id | account id in the string form. |
callback | function to receive a result. |
|
static |
After this reporting the account can log in other server.
session | the session to logout. |
callback | function to receive a result. |
|
static |
After this reporting the account can log in other server.
account_id | account id in the string form. |
|
static |
After this reporting the account can log in other server.
account_id | account id in the string form. |
callback | function to receive a result. |