예제 #1
0
 public void SetLastCustomBuildHandler(SetLastCustomBuildMessage message, Player player)
 {
     if (player.TryGetComponent <CharacterComponent>(out var characterComponent))
     {
         characterComponent.Rocket = message.Tokens;
     }
 }
예제 #2
0
        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();
        }