Home | Trees | Index | Help |
|
---|
Package twisted :: Package sibling :: Module loginserv :: Class LoginService |
|
Accessor
--+ |Versioned
--+ |ApplicationService
--+ |Service
--+ |Service
--+ | LoginService
This service should run in the same process as a twisted.mother service. The mother service handles logins from siblings while this LoginService handles logins from clients.
This service enforces a single simultaneous login per-identity.Method Summary | |
---|---|
__init__(self,
name,
application,
motherService)
| |
_cbPerspective(self,
perspective)
| |
Fail if the player is already on-line. | |
Utility method for loading the remote identity once it is known which sibling the identity should be loaded on. | |
This must return a deferred that yields a perspective object. | |
Inherited from Service | |
Add a perspective to this Service. | |
Cache a perspective loaded from an external data source. | |
Create a perspective from self.perspectiveClass and add it to this service. | |
Return a perspective that represents a user for this service. | |
Return a Deferred which is a request for a perspective on this service. | |
The name of this service. | |
Get a string describing the type of this service. | |
Deferred Perspective |
Load a perspective from an external data-source. |
| |
Uncache a perspective loaded from an external data source. | |
Inherited from ApplicationService | |
Have my parent disown me. | |
| |
| |
| |
This call is made as a service starts up. | |
This call is made before shutdown. | |
| |
Inherited from Accessor | |
| |
| |
| |
*actually* del self.k without incurring side-effects. | |
*actually* set self.k to v without incurring side-effects. | |
Inherited from Versioned | |
Get state, adding a version number to it on its way out. | |
| |
(internal) Do a version upgrade. |
Class Variable Summary | |
---|---|
Inherited from Service | |
NoneType |
serviceName = None |
NoneType |
serviceType = None |
Inherited from ApplicationService | |
int |
persistenceVersion = 1 |
NoneType |
serviceParent = None |
int |
serviceRunning = 0 |
Inherited from Versioned | |
tuple |
persistenceForgets = ()
|
Method Details |
---|
getPerspectiveForIdentity(self, name, identity)Fail if the player is already on-line. |
loadIdentityForSibling(self, sibling, name, identity)Utility method for loading the remote identity once it is known which sibling the identity should be loaded on. Should be called from within the loadLoginPerspective block. This returns (ticket, host, port, sibling) which must be used by the client to login to the sibling server. |
loadLoginPerspective(self, name, identity)This must return a deferred that yields a perspective object. Within this block, loadIdentityForSibling should be called. This block of functionality is broken out like this so that the decision as to which sibling to load the perspective on can be deferred, as well as the loading of the perspective itself being deferred. example:def loadLoginPerspective(self, name, identity): d1 = defer.Deferred() sibling = choice(self.motherService.siblings) d2 = self.loadIdentityForSibling(sibling, name, identity) d2.addCallback(self._cbTicket, name, d1) return d1 def _cbTicket(self, data, name, d1): newPerspective = MyPerspective(name) p.setTicket(data) d1.callback(newPerspective)In the example, the choosing of sibling servers is not asychronous, but this framework allows it to be. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat Sep 13 04:20:40 2003 | http://epydoc.sf.net |