| Copyright | (c) Anton Gushcha, 2015-2016 |
|---|---|
| License | BSD3 |
| Maintainer | ncrashed@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Game.GoreAndAsh.Sync.Remote.Actor
Description
- 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
Associated Types
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
Constructors
| RemActorId | |
Fields
| |
Instances
| 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
Constructors
| RemActorSyncRequest | Request full synchronization |
| RemActorSyncValue !Word64 !ByteString | Carries value of indexed value |
Instances
| Show (RemActorNetMessage i) Source # | |
| Generic (RemActorNetMessage i) Source # | |
| Serialize (RemActorNetMessage i) Source # | |
| type Rep (RemActorNetMessage i) Source # | |
Arguments
| :: (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
Arguments
| :: (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
Arguments
| :: (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)