"implemented" gacha system

This commit is contained in:
Mikhail Thompson
2024-07-02 15:11:52 -04:00
parent 76ecf031b5
commit 53dab52b9a
5 changed files with 98 additions and 45 deletions

View File

@@ -0,0 +1,33 @@
using nksrv.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nksrv.LobbyServer.Msgs.Character
{
[PacketPath("/character/costume/set")]
public class SetCharacterCostume : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var req = await ReadData<ReqSetCharacterCostume>();
var user = GetUser();
foreach (var item in user.Characters)
{
if(item.Csn == req.Csn)
{
item.CostumeId = req.CostumeId;
break;
}
}
JsonDb.Save();
var response = new ResSetCharacterCostume();
WriteData(response);
}
}
}