Ejemplo n.º 1
0
from apollo.server import skeletonSetup

from apollo.server.render.supervisor import RendererSupervisor

from apollo.server.models import meta

from apollo.server.models.auth import User, Group, SecurityDomain
from apollo.server.models.rpg import Profession, ProfessionBaseStat, Skill

from apollo.server.models.geography import Terrain, Realm, Chunk, CHUNK_STRIDE, Tile

# initialize
logging.basicConfig(level=logging.INFO)

if __name__ == "__main__":
    skeletonSetup()

    sess = meta.Session()
    meta.Base.metadata.drop_all(sess.bind)
    print "Creating tables..."
    meta.Base.metadata.create_all(sess.bind)

    # set spawn
    SPAWN_X = 0
    SPAWN_Y = 1

    # create terrain
    print "Generating terrain information..."

    terrains = [
        Terrain(name=u"Grass", img=u"grass"),
Ejemplo n.º 2
0
 def __init__(self):
     skeletonSetup(os.path.join(dist_root, "apollod.conf"))
     self.sess = meta.Session()
Ejemplo n.º 3
0
"""

import sys
import os

dist_root = os.path.join(os.path.dirname(__file__), "..")

# add the apollo path to the pythonpath
sys.path.insert(1, dist_root)

from apollo.server import skeletonSetup
from apollo.server.models import meta
from apollo.server.models.geography import Realm, Chunk, Tile, CHUNK_STRIDE

if __name__ == "__main__":
    skeletonSetup(os.path.join(dist_root, "apollod.conf"))

    print "Apollo Database Consistency Checker\n"

    sess = meta.Session()

    for realm in sess.query(Realm):
        print "Performing consistency check on realm: %s" % realm.id

        ccoords = set()
        tcoords = set()

        for chunk in sess.query(Chunk).filter(Chunk.realm_id == realm.id):
            if chunk.cx < 0 or chunk.cx >= realm.cw:
                print "ERROR: chunk %s has an incorrect cx position! Expected something in the range [0,%d], got %d" % (chunk.id, realm.cw - 1, chunk.cx)
                continue