mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-06 22:50:30 -04:00
Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
This commit is contained in:
parent
f12ba1502b
commit
22191ce648
591 changed files with 53264 additions and 3362 deletions
48
server/FSO.Server.Api.Core/Controllers/AvatarDataController.cs
Executable file
48
server/FSO.Server.Api.Core/Controllers/AvatarDataController.cs
Executable file
|
@ -0,0 +1,48 @@
|
|||
using FSO.Common.Utils;
|
||||
using FSO.Server.Api.Core.Utils;
|
||||
using FSO.Server.Protocol.CitySelector;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace FSO.Server.Api.Core.Controllers
|
||||
{
|
||||
[EnableCors]
|
||||
[Route("cityselector/app/AvatarDataServlet")]
|
||||
[ApiController]
|
||||
public class AvatarDataController : ControllerBase
|
||||
{
|
||||
public IActionResult Get()
|
||||
{
|
||||
var api = Api.INSTANCE;
|
||||
var user = api.RequireAuthentication(Request);
|
||||
|
||||
var result = new XMLList<AvatarData>("The-Sims-Online");
|
||||
|
||||
using (var db = api.DAFactory.Get())
|
||||
{
|
||||
var avatars = db.Avatars.GetSummaryByUserId(user.UserID);
|
||||
|
||||
foreach (var avatar in avatars)
|
||||
{
|
||||
result.Add(new AvatarData
|
||||
{
|
||||
ID = avatar.avatar_id,
|
||||
Name = avatar.name,
|
||||
ShardName = api.Shards.GetById(avatar.shard_id).Name,
|
||||
HeadOutfitID = avatar.head,
|
||||
BodyOutfitID = avatar.body,
|
||||
AppearanceType = (AvatarAppearanceType)Enum.Parse(typeof(AvatarAppearanceType), avatar.skin_tone.ToString()),
|
||||
Description = avatar.description,
|
||||
LotId = avatar.lot_id,
|
||||
LotName = avatar.lot_name,
|
||||
LotLocation = avatar.lot_location
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return ApiResponse.Xml(HttpStatusCode.OK, result);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue