Copyright | (c) Anton Gushcha, 2015-2016 |
---|---|
License | BSD3 |
Maintainer | ncrashed@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
- class NetworkMessage i => RemoteActor i a | i -> a, a -> i where
- type RemoteActorState i :: *
- type RemoteActorId a :: *
- newtype RemActorId i = RemActorId {
- unRemActorId :: i
- data RemActorNetMessage i
- clientSync :: (ActorMonad m, SyncMonad m, NetworkMonad m, LoggingMonad m, RemoteActor i a) => Sync m i s a -> Peer -> i -> GameWire m s a
- serverSync :: (MonadFix m, ActorMonad m, SyncMonad m, NetworkMonad m, LoggingMonad m, RemoteActor i a) => Sync m i s a -> i -> GameWire m s a
- registerRemoteActor :: forall proxy i a m. (ActorMonad m, ActorMessage i, RemoteActor i a) => proxy i -> GameMonadT m ()
Documentation
class NetworkMessage i => RemoteActor i a | i -> a, a -> i Source #
API to support automatic synchronization of actors between client and server
type RemoteActorState i :: * Source #
State of remote actor (should be equal a)
type RemoteActorId a :: * Source #
Id of remote actor (should be equal i)
newtype RemActorId i Source #
Id of synchronization actor build over another actor
RemActorId | |
|
Eq i => Eq (RemActorId i) Source # | |
Ord i => Ord (RemActorId i) Source # | |
Show i => Show (RemActorId i) Source # | |
Generic (RemActorId i) Source # | |
RemoteActor i a => ActorMessage (RemActorId i) Source # | |
RemoteActor i a => NetworkMessage (RemActorId i) Source # | |
type Rep (RemActorId i) Source # | |
type ActorMessageType (RemActorId i) Source # | |
type NetworkMessageType (RemActorId i) Source # | |
data RemActorNetMessage i Source #
Network protocol of synchronization actor
RemActorSyncRequest | Request full synchronization |
RemActorSyncValue !Word64 !ByteString | Carries value of indexed value |
Show (RemActorNetMessage i) Source # | |
Generic (RemActorNetMessage i) Source # | |
Serialize (RemActorNetMessage i) Source # | |
type Rep (RemActorNetMessage i) Source # | |
:: (ActorMonad m, SyncMonad m, NetworkMonad m, LoggingMonad m, RemoteActor i a) | |
=> Sync m i s a | Sync strategy |
-> Peer | Server connection |
-> i | Actor id |
-> GameWire m s a | Synchronizing of client state |
Perform client side synchronization
:: (MonadFix m, ActorMonad m, SyncMonad m, NetworkMonad m, LoggingMonad m, RemoteActor i a) | |
=> Sync m i s a | Sync strategy |
-> i | Actor id |
-> GameWire m s a | Synchronizing of server state |
Perform server side synchronization
:: (ActorMonad m, ActorMessage i, RemoteActor i a) | |
=> proxy i | Proxy of type of base actor id |
-> GameMonadT m () | Register basic id |
Need to be called once for each remote actor (remote collections actually do this)