public void SetLastCustomBuildHandler(SetLastCustomBuildMessage message, Player player) { if (player.TryGetComponent <CharacterComponent>(out var characterComponent)) { characterComponent.Rocket = message.Tokens; } }
public async Task SetLastCustomBuildHandler(SetLastCustomBuildMessage message, Player player) { await using var ctx = new UchuContext(); var character = await ctx.Characters.FirstAsync(c => c.Id == player.Id); character.Rocket = message.Tokens; await ctx.SaveChangesAsync(); }