Menu Close

Configuring the PersistentStorage.

Welcome to AngbandOS Forums Setup and Configuring Configuring the PersistentStorage.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #925
    iggy_hunter
    Keymaster

    AngbandOS has three providers for persistent storage.

    1. SQL
    2. MySQL
    3. FileSystem

    Switching the AngbandOS.Web project between storage providers involves 4 changes.

    1. Update the connection string as needed. This is stored as a user secret.

    SQL:
    “ConnectionString”: “Server=;Database=AngbandOS;user=;password=”,

    or

    MySQL:
    “ConnectionString”: “Server=;Database=AngbandOS;user=;password=”,

    2. Update the dependency injection service for the desired WebPersistentStorage:

    SQL:
    builder.Services.AddScoped(typeof(IWebPersistentStorage), typeof(SqlWebPersistentStorage)); // Persistent storage driver

    or

    MySQL:
    builder.Services.AddScoped(typeof(IWebPersistentStorage), typeof(MySqlWebPersistentStorage)); // Persistent storage driver

    3. Update the desired DbContext to use.

    SQL:
    builder.Services.AddDbContext(options => options.UseSqlServer(connectionString));

    or

    MySQL:
    builder.Services.AddDbContext(options => options.UseMySQL(connectionString));

    4. Update the Hub/GameService CorePersistentStorage:

    SQL:
    ICorePersistentStorage corePersistentStorage = new SqlCorePersistentStorage(ConnectionString, userId, guid);

    or

    MySQL:
    ICorePersistentStorage corePersistentStorage = new MySqlCorePersistentStorage(ConnectionString, userId, guid);

    • This topic was modified 1 year, 9 months ago by iggy_hunter.
Viewing 1 post (of 1 total)
  • The forum ‘Setup and Configuring’ is closed to new topics and replies.