Skip to content
Snippets Groups Projects
Select Git revision
  • 46d24ae2211684b352e6f2019c0de833f1ee70c8
  • main default
  • respawn-Spikes
  • web-api
  • menu
  • teleporter
  • level-management
  • level-manager
  • gravity-rmx
  • baptiste
  • develop
  • server
12 results

Player.cs

Blame
  • Player.cs 788 B
    namespace WebAPI.Model
    {
        public class Player
        {
            public int Id { get; }
            public float X { get; set; }
            public float Y { get; set; }
            public bool FlipX { get; set; }
            public bool FlipY { get; set; }
            public bool Online { get; set; }
            public int Rotation { get; set; }
    
    
            public Player(int id)
            {
                Id = id;
                Online = true;
                CheckAFK();
            }
    
            private void CheckAFK()
            {
                Task.Run(() =>
                {
                    while (true)
                    {
                        var x = X;
                        var y = Y;
                        Task.Delay(30000).Wait();
                        Online = x != X || y != Y;
                    }
                });
            }
        }
    }