Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
fritz-franz-plus-web.py
Package: MMOPRG_server_dev.rar [view]
Upload User: ghyvgy
Upload Date: 2009-05-26
Package Size: 547k
Code Size: 2k
Category:
Other Games
Development Platform:
Python
- # Import Twisted code
- from twisted.spread.pb import AuthRoot, BrokerFactory, portno
- from twisted.internet.app import Application
- from twisted.cred.authorizer import DefaultAuthorizer
- # Import our own library
- import cellphone
- import metamorph
- # Create root-level object and authorizer
- app = Application("Metamorphosis")
- auth = DefaultAuthorizer(app)
- # Create our services (inside the App directory)
- phoneCompany = cellphone.PhoneCompany("cellphone", app, auth)
- buggyWorld = metamorph.BuggyWorld("metamorph", app, auth)
- # Create Identities for Joe and Bob.
- def makeAccount(userName, phoneNumber, bugName, pw):
- # Create a cell phone for the player, so they can chat.
- phone = phoneCompany.createPerspective(phoneNumber)
- # Create a bug for the player, so they can play the game.
- bug = buggyWorld.createPerspective(bugName)
- # Create an identity for the player, so they can log in.
- i = auth.createIdentity(userName)
- i.setPassword(pw)
- # add perspectives to identity we created
- i.addKeyForPerspective(phone)
- i.addKeyForPerspective(bug)
- # Finally, commit the identity back to its authorizer.
- i.save()
- # Create both Bob's and Joe's accounts.
- makeAccount("joe", "222-303-8484", "fritz", "joepass")
- makeAccount("bob", "222-303-8485", "franz", "bobpass")
- app.listenTCP(portno, BrokerFactory(AuthRoot(auth)))
- from twisted.web.server import Site
- from twisted.web.static import File
- from twisted.web.script import ResourceScript
- f = File('.')
- f.processors = { '.rpy': ResourceScript }
- app.listenTCP(8080, Site(f))
- app.run()