Beispiel #1
0
    def __init__(self, **kwargs):

        external_session = kwargs.pop('session', None)

        if external_session:
            self.session = external_session
        else:
            connection = RealmConnection()
            # this one uses in create_tables command
            self.engine = connection.engine
            self.session = connection.session

        self.objects = {}

        self.update_packet_builder = UpdatePacketBatch()
        self.fields = {}

        self.object_update_type = ObjectUpdateType.CREATE_OBJECT.value
        self.movement = Movement()
        # this property contains any world object (Object, Unit, Item, Player etc)
        # currently processing by current manager. Inheritable.
        self.world_object = Object()
Beispiel #2
0
 def __init__(self):
     connection = RealmConnection()
     self.engine = connection.engine
     self.session = connection.session
Beispiel #3
0
 def __enter__(self):
     connection = RealmConnection()
     self.session = connection.session
     return self
Beispiel #4
0
def create_tables():
    BaseModel.metadata.create_all(LoginConnection().engine)
    BaseModel.metadata.create_all(WorldConnection().engine)
    BaseModel.metadata.create_all(RealmConnection().engine)