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()
def __init__(self): connection = RealmConnection() self.engine = connection.engine self.session = connection.session
def __enter__(self): connection = RealmConnection() self.session = connection.session return self
def create_tables(): BaseModel.metadata.create_all(LoginConnection().engine) BaseModel.metadata.create_all(WorldConnection().engine) BaseModel.metadata.create_all(RealmConnection().engine)