-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Epitaph Road endgame content.
- Loading branch information
1 parent
59caba9
commit ad2777a
Showing
136 changed files
with
76,905 additions
and
81,674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
Arrowgene.Ddon.Database/Files/Database/Script/migration_epitaph_road.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE TABLE ddon_epitaph_road_unlocks ( | ||
"character_id" INTEGER NOT NULL, | ||
"epitaph_id" INTEGER NOT NULL, | ||
CONSTRAINT "pk_ddon_epitaph_road_unlocks" PRIMARY KEY ("character_id", "epitaph_id"), | ||
CONSTRAINT "fk_ddon_epitaph_road_unlocks_character_id" FOREIGN KEY ("character_id") REFERENCES "ddon_character"("character_id") ON DELETE CASCADE | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
Arrowgene.Ddon.Database/Sql/Core/DdonSqlDbEpitaphRoadUnlocks.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System.Collections.Generic; | ||
using System.Data.Common; | ||
|
||
namespace Arrowgene.Ddon.Database.Sql.Core | ||
{ | ||
public abstract partial class DdonSqlDb<TCon, TCom, TReader> : SqlDb<TCon, TCom, TReader> | ||
where TCon : DbConnection | ||
where TCom : DbCommand | ||
where TReader : DbDataReader | ||
{ | ||
/* ddon_epitaph_road_unlocks */ | ||
protected static readonly string[] EpitaphRoadUnlocksFields = new string[] | ||
{ | ||
"character_id", "epitaph_id" | ||
}; | ||
|
||
private readonly string SqlSelectEpitaphUnlocks = $"SELECT {BuildQueryField(EpitaphRoadUnlocksFields)} FROM \"ddon_epitaph_road_unlocks\" WHERE \"character_id\"=@character_id;"; | ||
private readonly string SqlInsertEpitaphUnlocks = $"INSERT INTO \"ddon_epitaph_road_unlocks\" ({BuildQueryField(EpitaphRoadUnlocksFields)}) VALUES ({BuildQueryInsert(EpitaphRoadUnlocksFields)});"; | ||
|
||
public bool InsertEpitahRoadUnlock(uint characterId, uint epitaphId, DbConnection? connectionIn = null) | ||
{ | ||
using TCon connection = OpenNewConnection(); | ||
return ExecuteNonQuery(connection, SqlInsertEpitaphUnlocks, command => | ||
{ | ||
AddParameter(command, "character_id", characterId); | ||
AddParameter(command, "epitaph_id", epitaphId); | ||
}) == 1; | ||
} | ||
|
||
public List<uint> GetEpitahRoadUnlocks(uint characterId, DbConnection? connectionIn = null) | ||
{ | ||
using TCon connection = OpenNewConnection(); | ||
|
||
var results = new List<uint>(); | ||
|
||
ExecuteInTransaction(connection => | ||
{ | ||
ExecuteReader(connection, SqlSelectEpitaphUnlocks, command => | ||
{ | ||
AddParameter(command, "character_id", characterId); | ||
}, reader => | ||
{ | ||
while (reader.Read()) | ||
{ | ||
results.Add(GetUInt32(reader, "epitaph_id")); | ||
} | ||
}); | ||
}); | ||
|
||
return results; | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
Arrowgene.Ddon.Database/Sql/Core/Migration/00000024_EpitaphRoadMigration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Data.Common; | ||
|
||
namespace Arrowgene.Ddon.Database.Sql.Core.Migration | ||
{ | ||
public class EpitaphRoadMigration : IMigrationStrategy | ||
{ | ||
public uint From => 23; | ||
public uint To => 24; | ||
|
||
private readonly DatabaseSetting DatabaseSetting; | ||
|
||
public EpitaphRoadMigration(DatabaseSetting databaseSetting) | ||
{ | ||
DatabaseSetting = databaseSetting; | ||
} | ||
|
||
public bool Migrate(IDatabase db, DbConnection conn) | ||
{ | ||
string adaptedSchema = DdonDatabaseBuilder.GetAdaptedSchema(DatabaseSetting, "Script/migration_epitaph_road.sql"); | ||
db.Execute(conn, adaptedSchema); | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.