Beispiel #1
0
    void UpdateObjective(QuestsObjectivesData entry)
    {
        string query = "UPDATE quest_objectives";
        query += " SET ";
        query += entry.UpdateList ();
        query += " WHERE id=?id";

        // Setup the register data
        List<Register> update = new List<Register> ();
        foreach (string field in entry.fields.Keys) {
            update.Add (entry.fieldToRegister (field));
        }

        DatabasePack.Update (DatabasePack.contentDatabasePrefix, query, update);
    }
Beispiel #2
0
    void InsertObjective(QuestsObjectivesData entry)
    {
        string query = "INSERT INTO quest_objectives";
        query += " (questID, primaryObjective, objectiveType, target, targetCount, targetText) ";
        query += "VALUES ";
        query += " (" + entry.questID + ",1,'" + entry.objectiveType + "'," + entry.target + "," + entry.targetCount + ",'" + entry.targetText + "') ";

        // Setup the register data
        List<Register> update = new List<Register> ();
        foreach (string field in entry.fields.Keys) {
            update.Add (entry.fieldToRegister (field));
        }

        int itemID = -1;
        itemID = DatabasePack.Insert (DatabasePack.contentDatabasePrefix, query, update);

        entry.id = itemID;
    }