iFun Engine API  1.0.0-b2601
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
fun::DedicatedServerRpc Class Reference
Inheritance diagram for fun::DedicatedServerRpc:

Public Types

typedef boost::function< void(const
PeerId &, const Xid &, const
Ptr< const
FunDedicatedServerRpcMessage > &)> 
Callback
 Functor to be invoked when a client receives back a reply.
 
typedef boost::function< void(const
PeerId &)> 
ConnectHandler
 Functor to be invoked when a peer connected.
 
typedef boost::function< void(const
PeerId &)> 
DisconnectHandler
 Functor to be invoked when a peer disconnected.
 
typedef
boost::asio::ip::tcp::endpoint 
PeerEndpoint
 
typedef Uuid PeerId
 
typedef std::map< PeerId,
PeerEndpoint > 
PeerMap
 
typedef string Tag
 
typedef Uuid Xid
 

Static Public Member Functions

static void Call (const PeerId &peer, const Ptr< FunDedicatedServerRpcMessage > &msg, const Callback &callback) ASSERT_NO_ROLLBACK
 Sends a RPC requst to the given Dedicated Server RPC peer. More...
 
static void CallRandomly (const Ptr< FunDedicatedServerRpcMessage > &msg, const Callback &callback) ASSERT_NO_ROLLBACK
 Sends a RPC requst to the Deidcated Server RPC peer randomly. More...
 
static size_t GetPeers (PeerMap *ret)
 Returns information on Dedicated Server RPC peers. More...
 
static size_t GetPeersWithTag (PeerMap *ret, const Tag &tag)
 Returns a list of RPC peers with the given tag. More...
 
static Tag GetPeerTag (const PeerId &peer)
 Gets a tag of the peer. More...
 
static bool HasTag (const PeerId &peer, const Tag &tag)
 Checks if the RPC peer has the tag. More...
 
static bool IsPeerConnected (const PeerId &peer)
 Checks if the peer is connected. More...
 
static void RegisterConnectHandler (const ConnectHandler &h)
 Registers a handler for notifying a new peer connection.
 
static void RegisterDisconnectHandler (const DisconnectHandler &h)
 Registers a handler for notifying a peer disconnection.
 

Static Public Attributes

static const PeerId kNullPeerId
 
static const Xid kNullXid
 

Member Function Documentation

static void fun::DedicatedServerRpc::Call ( const PeerId &  peer,
const Ptr< FunDedicatedServerRpcMessage > &  msg,
const Callback callback 
)
static
Parameters
peerPeerId that identifies the target RPC peer.
msgFunDedicatedServerRpcMessage protobuf instance to send.
callbackCallback instance to be invoked once a reply arrives.
static void fun::DedicatedServerRpc::CallRandomly ( const Ptr< FunDedicatedServerRpcMessage > &  msg,
const Callback callback 
)
static
Parameters
msgFunDedicatedServerRpcMessage protobuf instance to send.
callbackCallback instance to be invoked once a reply arrives.
static size_t fun::DedicatedServerRpc::GetPeers ( PeerMap *  ret)
static
Returns
the number of peers.
Parameters
retret a pointer to PeerMap instance.
static size_t fun::DedicatedServerRpc::GetPeersWithTag ( PeerMap *  ret,
const Tag &  tag 
)
static
Returns
the number of peers.
Parameters
retret a pointer to PeerMap instance.
tagstring to identify rpc peers.
static Tag fun::DedicatedServerRpc::GetPeerTag ( const PeerId &  peer)
static
Returns
tag.
Parameters
peerpeer id in question.
static bool fun::DedicatedServerRpc::HasTag ( const PeerId &  peer,
const Tag &  tag 
)
static
Returns
true if the RPC peer has the tag.
Parameters
tagstring to check.
static bool fun::DedicatedServerRpc::IsPeerConnected ( const PeerId &  peer)
static
Returns
true if the peer is connected.
Parameters
peerpeer id in question.