rpaciorek 406ebe20c2
initial support for XP points (#16)
* GetPetAchievementsByUserID and enum for PointTypes

* add RankService

* use AchievementPointTypes for PointTypeID

... insted of int in schema

* support for player XP, fix dragon XP

- database table
- return correct value in API call
- save XP from mission

* rename RankService to AchievementService

* use addAchievementPoints for all non item reward

this could be a good place for wallet servicing too ... so currency reward too

* return const XP value for farming and fishing

we don't have gathering method for those XPs yet

* fix avatar schema, fix coding style
2023-08-14 18:34:14 +02:00

36 lines
1.1 KiB
C#

using Microsoft.AspNetCore.Mvc.Formatters;
using sodoff.Model;
using sodoff.Services;
using System.Xml;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers(options => {
options.OutputFormatters.Add(new XmlSerializerOutputFormatter(new XmlWriterSettings() { OmitXmlDeclaration = false }));
options.OutputFormatters.RemoveType<HttpNoContentOutputFormatter>();
});
builder.Services.AddDbContext<DBContext>();
builder.Services.AddScoped<KeyValueService>();
builder.Services.AddSingleton<ItemService>();
builder.Services.AddSingleton<MissionStoreSingleton>();
builder.Services.AddScoped<MissionService>();
builder.Services.AddSingleton<StoreService>();
builder.Services.AddScoped<RoomService>();
builder.Services.AddSingleton<AchievementService>();
var app = builder.Build();
using var scope = app.Services.CreateScope();
scope.ServiceProvider.GetRequiredService<DBContext>().Database.EnsureCreated();
// Configure the HTTP request pipeline.
app.UseAuthorization();
app.MapControllers();
app.Run();