Upload files to "routes/API"

This commit is contained in:
2026-07-24 15:43:25 +00:00
parent 50a7e49c46
commit 7f97348756
5 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using Stella.Models;
namespace Stella.Routes.API
{
public class GetPlayerEvents
{
[ServerAPI.GET("/api/playerevents/v1/all")]
public LocalPlayerEventInfo ReturnGetPlayerEvents()
{
return new LocalPlayerEventInfo
{
Created = [],
Responses = []
};
}
}
}

View File

@@ -0,0 +1,32 @@
using Stella.Models;
using System.Text.Json;
namespace Stella.Routes.API
{
public class PlayerReporting
{
[ServerAPI.POST("/api/PlayerReporting/v1/hile")]
[ServerAPI.UseAuthorization]
public dynamic ModerationBlockDetails(HttpContext ctx)
{
Console.WriteLine(JsonSerializer.Serialize(ctx.Request.Form.ToDictionary(x => x.Key, x => x.Value.ToString())));
return Results.Ok();
}
[ServerAPI.GET("/api/PlayerReporting/v1/moderationBlockDetails")]
[ServerAPI.UseAuthorization]
public dynamic ReturnModerationBlockDetails()
{
return new ModerationBlockDetailDTO
{
ReportCategory = ReportCategory.Unknown,
Duration = 0,
GameSessionId = 0,
IsHostKick = false,
Message = "",
PlayerIdReporter = null,
IsBan = false
};
}
}
}

View File

@@ -0,0 +1,29 @@
using MongoDB.Driver;
using Stella.Models;
namespace Stella.Routes.API
{
public class GetPlayerReputation
{
[ServerAPI.GET("/api/playerReputation/v1/{accountId}")]
public ReputationDTO ReturnGetPlayerReputation(int accountId)
{
MongoDB.User user = MongoDB.usersCollection.Find(u => u.AccountId == accountId).FirstOrDefault();
return new ReputationDTO
{
AccountId = accountId,
Noteriety = 0,
CheerGeneral = 0,
CheerHelpful = 1,
CheerGreatHost = 1,
CheerSportsman = 1,
CheerCreative = 1,
CheerCredit = 0,
SubscriberCount = 0,
SubscribedCount = 0,
SelectedCheer = CheerCategory.General
};
}
}
}

View File

@@ -0,0 +1,11 @@
namespace Stella.Routes.API
{
public class MySubscriptions
{
[ServerAPI.GET("/api/playersubscriptions/v1/my")]
public List<object> PlayerSubscriptions()
{
return [];
}
}
}

21
routes/API/Progression.cs Normal file
View File

@@ -0,0 +1,21 @@
using MongoDB.Driver;
using Stella.Models;
namespace Stella.Routes.API
{
public class GetProgression
{
[ServerAPI.GET("/api/players/v1/progression/{accountId}")]
public ProgressionDTO Progression(int accountId)
{
MongoDB.User user = MongoDB.usersCollection.Find(u => u.AccountId == accountId).FirstOrDefault();
return new ProgressionDTO
{
AccountId = accountId,
Level = 1,
XP = 0
};
}
}
}