# Path: swfconduit/session.py
# class Session(object):
#     protocol    = None
#     server      = None
#     session_id  = ""
# 
#     def __init__( self, server, protocol ):
#         """ Initialize a new session """
#         self.server     = server
#         self.protocol   = protocol
#         self.session_id = uuid4()
# 
#     def close( self ):
#         """ Close the session """
#         self.server.closeSession( self )
# 
#     def fireEvent( self, event ):
#         """ Fire off the event to the local server """
#         reply = self.server.fireEvent( event, self )
#         if ( reply is not None ):
#             self.sendEvent( reply )
# 
#     def open( self ):
#         """ Open the session """
#         pass
# 
#     def sendEvent( self, event ):
#         """ Send an event to the remote client """
#         self.protocol.sendEvent( event )
# 
# Path: swfconduit/event.py
# class ErrorEvent( Event ):
#     e = None
#     traceback = ""
# 
#     def __init__( self, e ):
#         self.e = e
#         self.traceback = traceback.format_exc()
# 
#     def fire( self, server, session ):
#         # Can't raise here, we already ARE an error
#         print "Whachotalkingboutwillis?" + self.__repr__()


from swfconduit.session import Session
from swfconduit.event import ErrorEvent
from twisted.internet import reactor
import twisted.internet.protocol
import swfconduit.protocol
import swfconduit.event
import pyamf
import traceback, sys
# Copyright (c) 2010 Double Cluepon Software
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#-----------------------------------------------------------------------------

"""
A Server handles the overall persistence and events. It connects to databases,
manages Sessions, caches data, handles world persistence, and does the final
firing of Events.

The default server does nothing. You must create a subclass of server to do
what you want to do. Your Server subclass should add any necessary properties
like DB connections.

"""


class Server( twisted.internet.protocol.Factory ):
    protocol        = swfconduit.protocol.Protocol

# Path: swfconduit/session.py
# class Session(object):
#     protocol    = None
#     server      = None
#     session_id  = ""
# 
#     def __init__( self, server, protocol ):
#         """ Initialize a new session """
#         self.server     = server
#         self.protocol   = protocol
#         self.session_id = uuid4()
# 
#     def close( self ):
#         """ Close the session """
#         self.server.closeSession( self )
# 
#     def fireEvent( self, event ):
#         """ Fire off the event to the local server """
#         reply = self.server.fireEvent( event, self )
#         if ( reply is not None ):
#             self.sendEvent( reply )
# 
#     def open( self ):
#         """ Open the session """
#         pass
# 
#     def sendEvent( self, event ):
#         """ Send an event to the remote client """
#         self.protocol.sendEvent( event )
# 
# Path: swfconduit/event.py
# class ErrorEvent( Event ):
#     e = None
#     traceback = ""
# 
#     def __init__( self, e ):
#         self.e = e
#         self.traceback = traceback.format_exc()
# 
#     def fire( self, server, session ):
#         # Can't raise here, we already ARE an error
#         print "Whachotalkingboutwillis?" + self.__repr__()


# Path: swfconduit/server.py
from swfconduit.session import Session
from swfconduit.event import ErrorEvent
from twisted.internet import reactor
import twisted.internet.protocol
import swfconduit.protocol
import swfconduit.event
import pyamf
import traceback, sys

# Copyright (c) 2010 Double Cluepon Software
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#-----------------------------------------------------------------------------

"""
A Server handles the overall persistence and events. It connects to databases,
manages Sessions, caches data, handles world persistence, and does the final
firing of Events.

The default server does nothing. You must create a subclass of server to do
what you want to do. Your Server subclass should add any necessary properties
like DB connections.

"""


class Server( twisted.internet.protocol.Factory ):
    protocol        = swfconduit.protocol.Protocol

    session         = Session