コード例 #1
0
ファイル: Hex.py プロジェクト: HellEye/KingmakerMapServer
def updateHex(x=None, y=None):
    data, columns = getDataAndColumns(request)
    hex = db.get("hex", query=f"xcoord={x} AND ycoord={y}")
    if len(hex) > 0:
        id = db.post("hex", data, columns, query=f"xcoord={x} AND ycoord={y}")
    else:
        id = db.put("hex", data, columns)
    return {"id": id, "name": "hex"}
コード例 #2
0
def updateSettlement(id=None):
    data, columns = getDataAndColumns(request)
    db.post("settlement", data, columns, f"id='{id}'")
    return f'{{"id":{id}, "name":"settlements"}}'
コード例 #3
0
def insertSettlement():
    data, columns = getDataAndColumns(request)
    outId = db.put("settlement", data, columns)
    return json.dumps({"id": outId, "name": "settlements"})
コード例 #4
0
def updateKingdom(id=None):
    data, columns = getDataAndColumns(request)
    db.post("kingdoms", data, columns, f"id='{id}'")
    return f'{{"id":{id}, "name":"kingdom"}}'
コード例 #5
0
def insertKingdom():
    data, columns = getDataAndColumns(request)
    out=db.put("kingdoms", data, columns)
    return json.dumps({"id":out, "name": "kingdom"})
コード例 #6
0
ファイル: Hex.py プロジェクト: HellEye/KingmakerMapServer
def insertHex():
    data, columns = getDataAndColumns(request)

    id = db.put("hex", data, columns)
    return json.dumps({"id": id, "name": "hex"})
コード例 #7
0
def insertDistrictBuilding():
    data, columns = getDataAndColumns(request)
    outId = db.put("district_buildings", data, columns)
    return json.dumps({"id": outId, "name": "districtBuildings"})
コード例 #8
0
def updateDistrictBuilding(id, xcoord, ycoord):
    data, columns = getDataAndColumns(request)
    outId = db.post("district_buildings", data, columns,
                    f"xcoord={xcoord} AND ycoord={ycoord} AND district={id}")
    return f'{{"id": {id}, "name":"districtBuildings"}}'
コード例 #9
0
def addHexImprovement():
    data, columns=getDataAndColumns(request)
    outId=db.put("hex_improvement", data, columns)
    return json.dumps({"id":outId, "name":"hexImprovements"})
コード例 #10
0
def updateDistrict(id=None):
    data, columns = getDataAndColumns(request)

    db.post("district", data, columns, f"id='{id}'")
    return f'{{"id":{id}, "name":"district"}}'
コード例 #11
0
def insertSettlementImprovement():
    data, columns = getDataAndColumns(request)
    outId = db.put("settlement_improvements", data, columns)
    return f'{{"id": {outId}, "name": "settlementImprovements"}}'
コード例 #12
0
def insertBuildingDiscount():
    data, columns = getDataAndColumns(request)
    print("TEST")
    outId=db.put("building_discount", data, columns)
    print(f'{{"id":{outId}, "name":"buildingDiscount"}}')
    return f'{{"id":{outId}, "name":"buildingDiscount"}}'
コード例 #13
0
ファイル: markers.py プロジェクト: HellEye/KingmakerMapServer
def addMarker():
    data, columns = getDataAndColumns(request)
    outId = db.put("markers", data, columns)
    return f'{{"id":{outId}, "name":"markers"}}'