iFun Engine API  1.0.0-b5388
Great Technology for Great Games
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
fun::AccountManager Class Reference
Inheritance diagram for fun::AccountManager:

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< SessionFindLocalSession (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
 

Member Function Documentation

◆ BroadcastGlobally() [1/8]

static void fun::AccountManager::BroadcastGlobally ( const string msg_type,
const Ptr< FunMessage > &  msg,
const Rpc::Tag &  server_tag,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
server_tagRpc::Tag that identify the targets RPC servers.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ BroadcastGlobally() [2/8]

static void fun::AccountManager::BroadcastGlobally ( int32_t  msg_type,
const Ptr< FunMessage > &  msg,
const Rpc::Tag &  server_tag,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
server_tagRpc::Tag that identify the targets RPC servers.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ BroadcastGlobally() [3/8]

static void fun::AccountManager::BroadcastGlobally ( const ProtobufExtensionIdentifier msg_type,
const Ptr< FunMessage > &  msg,
const Rpc::Tag &  server_tag,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
server_tagRpc::Tag that identify the targets RPC servers.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ BroadcastGlobally() [4/8]

static void fun::AccountManager::BroadcastGlobally ( const string msg_type,
const Json msg,
const Rpc::Tag &  server_tag,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgreference to a Json instance.
server_tagRpc::Tag that identify the targets RPC servers.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ BroadcastGlobally() [5/8]

static void fun::AccountManager::BroadcastGlobally ( const string msg_type,
const Ptr< FunMessage > &  msg,
const Rpc::PeerMap &  servers,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
serversRpc::PeerMap that identify the targets RPC servers.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ BroadcastGlobally() [6/8]

static void fun::AccountManager::BroadcastGlobally ( int32_t  msg_type,
const Ptr< FunMessage > &  msg,
const Rpc::PeerMap &  servers,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
serversRpc::PeerMap that identify the targets RPC servers.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ BroadcastGlobally() [7/8]

static void fun::AccountManager::BroadcastGlobally ( const ProtobufExtensionIdentifier msg_type,
const Ptr< FunMessage > &  msg,
const Rpc::PeerMap &  servers,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
serversRpc::PeerMap that identify the targets RPC servers.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ BroadcastGlobally() [8/8]

static void fun::AccountManager::BroadcastGlobally ( const string msg_type,
const Json msg,
const Rpc::PeerMap &  servers,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgreference to a Json instance.
serversRpc::PeerMap that identify the targets RPC servers.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ BroadcastLocally() [1/4]

static void fun::AccountManager::BroadcastLocally ( const string msg_type,
const Ptr< FunMessage > &  msg,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ BroadcastLocally() [2/4]

static void fun::AccountManager::BroadcastLocally ( int32_t  msg_type,
const Ptr< FunMessage > &  msg,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ BroadcastLocally() [3/4]

static void fun::AccountManager::BroadcastLocally ( const ProtobufExtensionIdentifier msg_type,
const Ptr< FunMessage > &  msg,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ BroadcastLocally() [4/4]

static void fun::AccountManager::BroadcastLocally ( const string msg_type,
const Json msg,
const Encryption &  enc,
const TransportProtocol &  protocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgreference to a Json instance.
encEncryption as with Session::SendMessage()
protocoltransport protocol supports kTcp, kUdp types only.

◆ CheckAndSetLoggedIn()

static bool fun::AccountManager::CheckAndSetLoggedIn ( const string account_id,
const Ptr< Session > &  session 
)
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.)

Parameters
account_idaccount id in the string form.
sessionpointer to a session instance.
Returns
true if the account was previously not reported logged into other node. false, otherwise.

◆ CheckAndSetLoggedInAsync() [1/2]

static void fun::AccountManager::CheckAndSetLoggedInAsync ( const string account_id,
const Ptr< Session > &  session,
const LoginCallback &  callback 
)
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.)

Parameters
account_idaccount id in the string form.
sessionpointer to a session instance.
callbackfunction to receive a result.

◆ CheckAndSetLoggedInAsync() [2/2]

static void fun::AccountManager::CheckAndSetLoggedInAsync ( const string account_id,
const Ptr< Session > &  session,
const size_t &  max_retry,
const LoginCallback &  login_callback,
const LogoutCallback &  logout_callback 
)
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.)

Parameters
account_idaccount id in the string form.
sessionpointer to a session instance.
max_retrymax retry count if login failed.
login_callbackfunction to receive a result.
logout_callbackfunction to receive a logout result if logout succeed while retrying.

◆ FindLocalAccount()

static string fun::AccountManager::FindLocalAccount ( const Ptr< Session > &  session)
static
Returns
account name in string if the session exists and local. empty string, otherwise.
Parameters
sessiona pointer to the session.

◆ FindLocalSession()

static Ptr<Session> fun::AccountManager::FindLocalSession ( const string account_id)
static
Returns
pointer to a session instance.
Parameters
account_idaccount id in the string form.

◆ GetAllLocalAccounts()

static void fun::AccountManager::GetAllLocalAccounts ( std::vector< string > *  accounts)
static
Parameters
accountscontainer to be filled with the accounts.

◆ GetAllLocalAccountsAndSessions()

static void fun::AccountManager::GetAllLocalAccountsAndSessions ( std::vector< std::pair< string, Ptr< Session > > > *  accounts)
static
Parameters
accountscontainer to be filled with the accounts and sessions

◆ GetAllLocalSessions()

static void fun::AccountManager::GetAllLocalSessions ( std::vector< Ptr< Session > > *  sessions)
static
Parameters
sessionscontainer to be filled with the sessions.

◆ GetGlobalAccountsNumber()

static int64_t fun::AccountManager::GetGlobalAccountsNumber ( )
static
Returns
the number of accounts. -1 if failed to get accounts number.

◆ GetLocalAccountsNumber()

static size_t fun::AccountManager::GetLocalAccountsNumber ( )
static
Returns
the number of accounts.

◆ IsLoggedIn()

static bool fun::AccountManager::IsLoggedIn ( const Ptr< Session > &  session)
static
Parameters
sessionsession to check.
Returns
true if the given session is logged in the server node. false, otherwise

◆ Locate()

static Rpc::PeerId fun::AccountManager::Locate ( const string account_id)
static

The return value can be used to implement user-level RPC messages.

Parameters
account_idaccount id in the string form.
Returns
Rpc::PeerId server node's id.

◆ LocateAsync()

static void fun::AccountManager::LocateAsync ( const string account_id,
const LocateCallback &  callback 
)
static

The return value can be used to implement user-level RPC messages.

Parameters
account_idaccount id in the string form.
callbackfunction to receive server node's id.

◆ RedirectClient()

static bool fun::AccountManager::RedirectClient ( const Ptr< Session > &  session,
const Rpc::PeerId &  peer_id,
const string extra_data 
)
static
Parameters
sessionclient session which will be redirected to another server
peer_idrpc_id for destination server
extra_dataaddtional data to be transferred to destination server

◆ RedirectClientAsync()

static void fun::AccountManager::RedirectClientAsync ( const Ptr< Session > &  session,
const Rpc::PeerId &  peer_id,
const string extra_data,
const RedirectClientCallback &  callback 
)
static
Parameters
sessionclient session which will be redirected to another server
peer_idrpc_id for destination server
extra_dataaddtional data to be transferred to destination server
callbackfunction to receive a result

◆ SendMessage() [1/4]

static void fun::AccountManager::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 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
account_idaccount id in the string form.
encEncryption as with Session::SendMessage()
protocolProtocol as with Session::SendMessage()
cbCallback instance to be invoked when this RPC request is done.

◆ SendMessage() [2/4]

static void fun::AccountManager::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 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
account_idaccount id in the string form.
encEncryption as with Session::SendMessage()
protocolProtocol as with Session::SendMessage()
cbCallback instance to be invoked when this RPC request is done.

◆ SendMessage() [3/4]

static void fun::AccountManager::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 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
account_idaccount id in the string form.
encEncryption as with Session::SendMessage()
protocolProtocol as with Session::SendMessage()
cbCallback instance to be invoked when this RPC request is done.

◆ SendMessage() [4/4]

static void fun::AccountManager::SendMessage ( const string msg_type,
const Json msg,
const string account_id,
const Encryption &  enc = kDefaultEncryption,
const TransportProtocol &  protocol = kDefaultProtocol,
const Callback &  cb = kNullCallback 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgreference to a Json instance.
account_idaccount id in the string form.
encEncryption as with Session::SendMessage()
protocolProtocol as with Session::SendMessage()
cbCallback instance to be invoked when this RPC request is done.

◆ SendMessageSync() [1/4]

static bool fun::AccountManager::SendMessageSync ( const string msg_type,
const Ptr< FunMessage > &  msg,
const string account_id,
const Encryption &  enc = kDefaultEncryption,
const TransportProtocol &  protocol = kDefaultProtocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
account_idaccount id in the string form.
encEncryption as with Session::SendMessage()
protocolProtocol as with Session::SendMessage()
Returns
true if successfuly sent the msg to the account. false, otherwise.

◆ SendMessageSync() [2/4]

static bool fun::AccountManager::SendMessageSync ( int32_t  msg_type,
const Ptr< FunMessage > &  msg,
const string account_id,
const Encryption &  enc = kDefaultEncryption,
const TransportProtocol &  protocol = kDefaultProtocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
account_idaccount id in the string form.
encEncryption as with Session::SendMessage()
protocolProtocol as with Session::SendMessage()
Returns
true if successfuly sent the msg to the account. false, otherwise.

◆ SendMessageSync() [3/4]

static bool fun::AccountManager::SendMessageSync ( const ProtobufExtensionIdentifier msg_type,
const Ptr< FunMessage > &  msg,
const string account_id,
const Encryption &  enc = kDefaultEncryption,
const TransportProtocol &  protocol = kDefaultProtocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgpointer to a FunMessage instance.
account_idaccount id in the string form.
encEncryption as with Session::SendMessage()
protocolProtocol as with Session::SendMessage()
Returns
true if successfuly sent the msg to the account. false, otherwise.

◆ SendMessageSync() [4/4]

static bool fun::AccountManager::SendMessageSync ( const string msg_type,
const Json msg,
const string account_id,
const Encryption &  enc = kDefaultEncryption,
const TransportProtocol &  protocl = kDefaultProtocol 
)
static
Parameters
msg_typemsg type as with Session::SendMessage()
msgreference to a Json instance.
account_idaccount id in the string form.
encEncryption as with Session::SendMessage()
protocolProtocol as with Session::SendMessage()
Returns
true if successfuly sent the msg to the account. false, otherwise.

◆ SetLoggedOut() [1/2]

static bool fun::AccountManager::SetLoggedOut ( const string account_id)
static

After this reporting the account can log in other server.

Parameters
account_idaccount id in the string form.
Returns
true if the account was previously reported logged in. false, oterwise.

◆ SetLoggedOut() [2/2]

static bool fun::AccountManager::SetLoggedOut ( const Ptr< Session > &  session)
static

After this reporting the account can log in other server.

Parameters
sessionthe session to logout.
Returns
true if the session was previously reported logged in. false, oterwise.

◆ SetLoggedOutAsync() [1/2]

static void fun::AccountManager::SetLoggedOutAsync ( const string account_id,
const LogoutCallback &  callback 
)
static

After this reporting the account can log in other server.

Parameters
account_idaccount id in the string form.
callbackfunction to receive a result.

◆ SetLoggedOutAsync() [2/2]

static void fun::AccountManager::SetLoggedOutAsync ( const Ptr< Session > &  session,
const LogoutCallback &  callback 
)
static

After this reporting the account can log in other server.

Parameters
sessionthe session to logout.
callbackfunction to receive a result.

◆ SetLoggedOutGlobal()

static bool fun::AccountManager::SetLoggedOutGlobal ( const string account_id)
static

After this reporting the account can log in other server.

Parameters
account_idaccount id in the string form.
Returns
true if the account was previously reported logged in. false, oterwise.

◆ SetLoggedOutGlobalAsync()

static void fun::AccountManager::SetLoggedOutGlobalAsync ( const string account_id,
const LogoutCallback &  callback 
)
static

After this reporting the account can log in other server.

Parameters
account_idaccount id in the string form.
callbackfunction to receive a result.