Photon Server API
Public Member Functions | Static Public Member Functions | List of all members
Photon.MmoDemo.Server.MmoActorOperationHandler Class Reference

–°lient's Peer.CurrentOperationHandler after entering a world. More...

Inheritance diagram for Photon.MmoDemo.Server.MmoActorOperationHandler:
Photon.MmoDemo.Server.MmoActor Photon.SocketServer.Rpc.IOperationHandler

Public Member Functions

 MmoActorOperationHandler (PeerBase peer, World world, InterestArea interestArea)
 
OperationResponse OperationAddInterestArea (PeerBase peer, OperationRequest request, SendParameters sendParameters)
 Handles operation AddInterestArea: Creates a new InterestArea and optionally attaches it to an existing Item. More...
 
OperationResponse OperationAttachInterestArea (PeerBase peer, OperationRequest request, SendParameters sendParameters)
 Handles operation AttachInterestArea: Attaches an existing InterestArea to an existing Item. More...
 
OperationResponse OperationDestroyItem (PeerBase peer, OperationRequest request, SendParameters sendParameters)
 Handles operation DestroyItem: Destroys an existing Item. More...
 
OperationResponse OperationDetachInterestArea (PeerBase peer, OperationRequest request)
 Handles operation DetachInterestArea: Detaches an existing InterestArea from an Item. More...
 
OperationResponse OperationExitWorld (PeerBase peer, OperationRequest request)
 Handles operation ExitWorld: Sends event WorldExited to the client, disposes the actor and replaces the peer's Peer.CurrentOperationHandler with the MmoPeer itself. More...
 
OperationResponse OperationGetProperties (PeerBase peer, OperationRequest request, SendParameters sendParameters)
 Handles operation GetProperties: Sends event ItemProperties to the client. More...
 
OperationResponse OperationMove (PeerBase peer, OperationRequest request, SendParameters sendParameters)
 Handles operation Move: Move the items and ultimately sends event ItemMoved to other clients. More...
 
OperationResponse OperationMoveInterestArea (PeerBase peer, OperationRequest request)
 Handles operation MoveInterestArea: Moves one of the actor's InterestArea. More...
 
OperationResponse OperationRemoveInterestArea (PeerBase peer, OperationRequest request)
 Handles operation RemoveInterestArea: Removes one of the actor's InterestAreas. More...
 
OperationResponse OperationSetProperties (PeerBase peer, OperationRequest request, SendParameters sendParameters)
 Handles operation SetProperties: Sets the Item.Properties of an Item and ultimately sends event ItemPropertiesSet to other clients. More...
 
OperationResponse OperationSetViewDistance (PeerBase peer, OperationRequest request)
 Handles operation SetViewDistance: Changes the subscribe and unsubscribe radius for an InterestArea. More...
 
OperationResponse OperationSpawnItem (PeerBase peer, OperationRequest request)
 Handles operation SpawnItem: Creates a new Item and optionally subscribes an InterestArea to it. More...
 
OperationResponse OperationSubscribeItem (PeerBase peer, OperationRequest request, SendParameters sendParameters)
 Handles operation SubscribeItem: Manually subscribes item (does not affect interest area updates). The client receives event ItemSubscribed on success. More...
 
OperationResponse OperationUnsubscribeItem (PeerBase peer, OperationRequest request, SendParameters sendParameters)
 Handles operation UnsubscribeItem: manually unsubscribes an existing InterestArea from an existing Item. The client receives event ItemUnsubscribed on success. More...
 
OperationResponse OperationRaiseGenericEvent (PeerBase peer, OperationRequest request, SendParameters sendParameters)
 Handles operation RaiseGenericEvent. Sends event ItemGeneric to an Item owner or the subscribers of an Item />. More...
 
void OnDisconnect (PeerBase peer)
 Disposes the actor, stops any further operation handling and disposes the Peer. More...
 
void OnDisconnectByOtherPeer (PeerBase otherPeer, OperationRequest otherRequest, SendParameters sendParameters)
 Kicks the actor from the world (event WorldExited is sent to the client) and then disconnects the client. More...
 
void DisconnectByOtherPeer (PeerBase otherPeer, OperationRequest otherRequest, SendParameters sendParameters)
 Enqueues OnDisconnectByOtherPeer to the PeerBase.RequestFiber. More...
 
OperationResponse OnOperationRequest (PeerBase peer, OperationRequest operationRequest, SendParameters sendParameters)
 Called by Peer.OnOperationRequest. More...
 
- Public Member Functions inherited from Photon.MmoDemo.Server.MmoActor
void AddInterestArea (InterestArea interestArea)
 
void AddItem (Item item)
 
bool RemoveInterestArea (byte interestAreaId)
 
bool RemoveItem (Item item)
 
bool TryGetInterestArea (byte interestAreaId, out InterestArea interestArea)
 
bool TryGetItem (string itemid, out Item item)
 
void Dispose ()
 

Static Public Member Functions

static OperationResponse InvalidOperation (OperationRequest request)
 Handles operations CreateWorld and EnterWorld. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Photon.MmoDemo.Server.MmoActor
 MmoActor (PeerBase peer, World world)
 
virtual void Dispose (bool disposing)
 Disposes the InterestAreas and destroys all owned items. More...
 
- Protected Attributes inherited from Photon.MmoDemo.Server.MmoActor
readonly InterestItems interestItems
 
- Properties inherited from Photon.MmoDemo.Server.MmoActor
Item Avatar [get, set]
 
PeerBase Peer [get]
 
World World [get]
 Gets the world the actor is member of. More...
 

Detailed Description

–°lient's Peer.CurrentOperationHandler after entering a world.

Constructor & Destructor Documentation

Photon.MmoDemo.Server.MmoActorOperationHandler.MmoActorOperationHandler ( PeerBase  peer,
World  world,
InterestArea  interestArea 
)
inline

Member Function Documentation

void Photon.MmoDemo.Server.MmoActorOperationHandler.DisconnectByOtherPeer ( PeerBase  otherPeer,
OperationRequest  otherRequest,
SendParameters  sendParameters 
)
inline

Enqueues OnDisconnectByOtherPeer to the PeerBase.RequestFiber.

This method is intended to be used to disconnect a user's peer if he connects with multiple clients while the application logic wants to allow just one.

static OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.InvalidOperation ( OperationRequest  request)
inlinestatic

Handles operations CreateWorld and EnterWorld.

void Photon.MmoDemo.Server.MmoActorOperationHandler.OnDisconnect ( PeerBase  peer)
inline

Disposes the actor, stops any further operation handling and disposes the Peer.

Implements Photon.SocketServer.Rpc.IOperationHandler.

void Photon.MmoDemo.Server.MmoActorOperationHandler.OnDisconnectByOtherPeer ( PeerBase  otherPeer,
OperationRequest  otherRequest,
SendParameters  sendParameters 
)
inline

Kicks the actor from the world (event WorldExited is sent to the client) and then disconnects the client.

Called by DisconnectByOtherPeer after being enqueued to the PeerBase.RequestFiber. It kicks the actor from the world (event WorldExited) and then continues the original request by calling the original peer's OnOperationRequest method.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OnOperationRequest ( PeerBase  peer,
OperationRequest  operationRequest,
SendParameters  sendParameters 
)
inline

Called by Peer.OnOperationRequest.

Parameters
peerThe calling peer.
operationRequestThe operation request.
sendParametersThe send Parameters.
Returns
The operation response.

Implements Photon.SocketServer.Rpc.IOperationHandler.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationAddInterestArea ( PeerBase  peer,
OperationRequest  request,
SendParameters  sendParameters 
)
inline

Handles operation AddInterestArea: Creates a new InterestArea and optionally attaches it to an existing Item.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationAttachInterestArea ( PeerBase  peer,
OperationRequest  request,
SendParameters  sendParameters 
)
inline

Handles operation AttachInterestArea: Attaches an existing InterestArea to an existing Item.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationDestroyItem ( PeerBase  peer,
OperationRequest  request,
SendParameters  sendParameters 
)
inline

Handles operation DestroyItem: Destroys an existing Item.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationDetachInterestArea ( PeerBase  peer,
OperationRequest  request 
)
inline

Handles operation DetachInterestArea: Detaches an existing InterestArea from an Item.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationExitWorld ( PeerBase  peer,
OperationRequest  request 
)
inline

Handles operation ExitWorld: Sends event WorldExited to the client, disposes the actor and replaces the peer's Peer.CurrentOperationHandler with the MmoPeer itself.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationGetProperties ( PeerBase  peer,
OperationRequest  request,
SendParameters  sendParameters 
)
inline

Handles operation GetProperties: Sends event ItemProperties to the client.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationMove ( PeerBase  peer,
OperationRequest  request,
SendParameters  sendParameters 
)
inline

Handles operation Move: Move the items and ultimately sends event ItemMoved to other clients.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationMoveInterestArea ( PeerBase  peer,
OperationRequest  request 
)
inline

Handles operation MoveInterestArea: Moves one of the actor's InterestArea.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationRaiseGenericEvent ( PeerBase  peer,
OperationRequest  request,
SendParameters  sendParameters 
)
inline

Handles operation RaiseGenericEvent. Sends event ItemGeneric to an Item owner or the subscribers of an Item />.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationRemoveInterestArea ( PeerBase  peer,
OperationRequest  request 
)
inline

Handles operation RemoveInterestArea: Removes one of the actor's InterestAreas.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationSetProperties ( PeerBase  peer,
OperationRequest  request,
SendParameters  sendParameters 
)
inline

Handles operation SetProperties: Sets the Item.Properties of an Item and ultimately sends event ItemPropertiesSet to other clients.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationSetViewDistance ( PeerBase  peer,
OperationRequest  request 
)
inline

Handles operation SetViewDistance: Changes the subscribe and unsubscribe radius for an InterestArea.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationSpawnItem ( PeerBase  peer,
OperationRequest  request 
)
inline

Handles operation SpawnItem: Creates a new Item and optionally subscribes an InterestArea to it.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationSubscribeItem ( PeerBase  peer,
OperationRequest  request,
SendParameters  sendParameters 
)
inline

Handles operation SubscribeItem: Manually subscribes item (does not affect interest area updates). The client receives event ItemSubscribed on success.

If the submitted SubscribeItem.PropertiesRevision is null or smaller than the item Item.PropertiesRevision event ItemProperties is sent to the client.

OperationResponse Photon.MmoDemo.Server.MmoActorOperationHandler.OperationUnsubscribeItem ( PeerBase  peer,
OperationRequest  request,
SendParameters  sendParameters 
)
inline

Handles operation UnsubscribeItem: manually unsubscribes an existing InterestArea from an existing Item. The client receives event ItemUnsubscribed on success.