Exemplo n.º 1
0
 public EnPlayerState(PlayerStateInfo ps)
 {
     Condition = ps.Condition.ToString();
     Comment   = ps.Comment;
     Mode      = ps.Mode.ToString();
     Score     = ps.Score;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Awake is called when the script instance is being loaded.
 /// </summary>
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Exemplo n.º 3
0
        public SessionInfo()
        {
            QueueableMediaTypes = new List <string>();

            AdditionalUsers = new List <SessionUserInfo>();
            PlayState       = new PlayerStateInfo();
        }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        if (m_player == null)
        {
            m_player = GameObject.FindGameObjectWithTag("Player");
        }

        if (m_cam == null)
        {
            m_cam = Camera.main.gameObject;
        }

        if (m_gameManager == null)
        {
            m_gameManager = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>();
        }

        m_boardRB     = GetComponent <Rigidbody>();
        m_playerRB    = m_player.GetComponent <Rigidbody>();
        m_playerState = m_player.GetComponent <PlayerStateInfo>();
        m_playerMover = m_player.GetComponent <PlayerMovementController>();

        m_boardMeshFilter = GetComponentInChildren <MeshFilter>();
        m_boardMesh       = m_boardMeshFilter.mesh;

        m_hoverSoundSource = m_hoverEffects.GetComponent <AudioSource>();
    }
Exemplo n.º 5
0
        private void savePlayerState(BasePlayer player)
        {
            long currentTimestamp = GrabCurrentTimestamp();
            var  info             = new PlayTimeInfo(player);
            var  state            = new PlayerStateInfo(player);

            if (!playTimeData.Players.ContainsKey(info.SteamID))
            {
                playTimeData.Players.Add(info.SteamID, info);
            }
            long initTimeStamp = playerStateData.Players[state.SteamID].InitTimeStamp;
            long afkTime       = playerStateData.Players[state.SteamID].AfkTime;
            long totalPlayed   = currentTimestamp - initTimeStamp;

            playTimeData.Players[info.SteamID].AfkTime += afkTime;
            TimeSpan humanAfkTime = TimeSpan.FromSeconds(playTimeData.Players[info.SteamID].AfkTime);

            playTimeData.Players[info.SteamID].HumanAfkTime = string.Format("{0:c}", humanAfkTime);

            playTimeData.Players[info.SteamID].PlayTime += totalPlayed;
            TimeSpan humanPlayTime = TimeSpan.FromSeconds(playTimeData.Players[info.SteamID].PlayTime);

            playTimeData.Players[info.SteamID].HumanPlayTime = string.Format("{0:c}", humanPlayTime);

            playTimeData.Players[info.SteamID].LastSeen = (DateTime.Now).ToString("G");

            Interface.GetMod().DataFileSystem.WriteObject("PlayTimeTracker", playTimeData);
        }
Exemplo n.º 6
0
        // Master AFK checking function, iterates through all connected players.
        private void afkCheck()
        {
            foreach (BasePlayer player in BasePlayer.activePlayerList) {
            var state = new PlayerStateInfo(player);

            if (playerStateData.Players.ContainsKey(state.SteamID)) {
              double currentX = Math.Round(player.transform.position.x, 2);
              double currentY = Math.Round(player.transform.position.y, 2);
              double currentZ = Math.Round(player.transform.position.z, 2);

              double[] storedPos = playerStateData.Players[state.SteamID].Position;

              if (currentX == storedPos[0] && currentY == storedPos[1] && currentZ == storedPos[2]) {
            playerStateData.Players[state.SteamID].AfkCount += 1;
              } else {
            playerStateData.Players[state.SteamID].AfkCount = 0;
            playerStateData.Players[state.SteamID].Position[0] = currentX;
            playerStateData.Players[state.SteamID].Position[1] = currentY;
            playerStateData.Players[state.SteamID].Position[2] = currentZ;
              }

              if (playerStateData.Players[state.SteamID].AfkCount > cyclesUntilAfk) {
            playerStateData.Players[state.SteamID].AfkTime += afkCheckInterval;
              }
            }
              }
        }
Exemplo n.º 7
0
        // Master AFK checking function, iterates through all connected players.
        private void afkCheck()
        {
            foreach (BasePlayer player in BasePlayer.activePlayerList)
            {
                var state = new PlayerStateInfo(player);

                if (playerStateData.Players.ContainsKey(state.SteamID))
                {
                    double currentX = Math.Round(player.transform.position.x, 2);
                    double currentY = Math.Round(player.transform.position.y, 2);
                    double currentZ = Math.Round(player.transform.position.z, 2);

                    double[] storedPos = playerStateData.Players[state.SteamID].Position;

                    if (currentX == storedPos[0] && currentY == storedPos[1] && currentZ == storedPos[2])
                    {
                        playerStateData.Players[state.SteamID].AfkCount += 1;
                    }
                    else
                    {
                        playerStateData.Players[state.SteamID].AfkCount    = 0;
                        playerStateData.Players[state.SteamID].Position[0] = currentX;
                        playerStateData.Players[state.SteamID].Position[1] = currentY;
                        playerStateData.Players[state.SteamID].Position[2] = currentZ;
                    }

                    if (playerStateData.Players[state.SteamID].AfkCount > cyclesUntilAfk)
                    {
                        playerStateData.Players[state.SteamID].AfkTime += afkCheckInterval;
                    }
                }
            }
        }
Exemplo n.º 8
0
        public SessionInfo(ISessionManager sessionManager, ILogger logger)
        {
            _sessionManager = sessionManager;
            _logger         = logger;

            AdditionalUsers = new List <SessionUserInfo>();
            PlayState       = new PlayerStateInfo();
        }
Exemplo n.º 9
0
        public SessionInfo(ISessionManager sessionManager, ILogger logger)
        {
            _sessionManager = sessionManager;
            _logger         = logger;

            AdditionalUsers    = Array.Empty <SessionUserInfo>();
            PlayState          = new PlayerStateInfo();
            SessionControllers = Array.Empty <ISessionController>();
        }
Exemplo n.º 10
0
        public SessionInfo(ISessionManager sessionManager, ILogger logger)
        {
            _sessionManager = sessionManager;
            _logger         = logger;

            AdditionalUsers    = new SessionUserInfo[] { };
            PlayState          = new PlayerStateInfo();
            SessionControllers = new ISessionController[] { };
        }
Exemplo n.º 11
0
        public SessionInfo(ISessionManager sessionManager, ILogger logger)
        {
            _sessionManager = sessionManager;
            _logger         = logger;

            AdditionalUsers          = Array.Empty <SessionUserInfo>();
            PlayState                = new PlayerStateInfo();
            SessionControllers       = Array.Empty <ISessionController>();
            NowPlayingQueue          = Array.Empty <QueueItem>();
            NowPlayingQueueFullItems = Array.Empty <BaseItemDto>();
        }
Exemplo n.º 12
0
        public SessionInfo()
        {
            QueueableMediaTypes = new List <string>();
            PlayableMediaTypes  = new List <string>
            {
                MediaType.Audio,
                MediaType.Book,
                MediaType.Game,
                MediaType.Photo,
                MediaType.Video
            };

            AdditionalUsers   = new List <SessionUserInfo>();
            SupportedCommands = new List <string>();
            PlayState         = new PlayerStateInfo();
        }
Exemplo n.º 13
0
        private void initPlayerState(BasePlayer player)
        {
            long currentTimestamp = GrabCurrentTimestamp();
            var  state            = new PlayerStateInfo(player);

            if (!playerStateData.Players.ContainsKey(state.SteamID))
            {
                playerStateData.Players.Add(state.SteamID, state);
            }
            playerStateData.Players[state.SteamID].InitTimeStamp = currentTimestamp;
            playerStateData.Players[state.SteamID].AfkTime       = 0;
            playerStateData.Players[state.SteamID].AfkCount      = 0;
            playerStateData.Players[state.SteamID].LiveName      = player.displayName;

            playerStateData.Players[state.SteamID].Position[0] = Math.Round(player.transform.position.x, 2);
            playerStateData.Players[state.SteamID].Position[1] = Math.Round(player.transform.position.y, 2);
            playerStateData.Players[state.SteamID].Position[2] = Math.Round(player.transform.position.z, 2);
        }
Exemplo n.º 14
0
 private void Start()
 {
     info       = this.GetComponent <PlayerStateInfo>();
     myChar     = this.GetComponent <BaseCharacter>();
     currentCam = Camera.main;
 }
Exemplo n.º 15
0
 void Start()
 {
     info   = this.GetComponentInParent <PlayerStateInfo>();
     myChar = this.GetComponentInParent <BaseCharacter>();
 }
Exemplo n.º 16
0
 public EnPlayerState(PlayerStateInfo ps)
 {
     Condition = ps.Condition.ToString();
     Position  = new EnPoint(ps.Position);
     Comment   = ps.Comment;
 }
Exemplo n.º 17
0
 void Start()
 {
     info = this.GetComponent <PlayerStateInfo>();
 }
Exemplo n.º 18
0
        private void initPlayerState(BasePlayer player)
        {
            long currentTimestamp = GrabCurrentTimestamp();
              var state = new PlayerStateInfo(player);

              if (!playerStateData.Players.ContainsKey(state.SteamID))
              {
            playerStateData.Players.Add(state.SteamID, state);
              }
              playerStateData.Players[state.SteamID].InitTimeStamp = currentTimestamp;
              playerStateData.Players[state.SteamID].AfkTime = 0;
              playerStateData.Players[state.SteamID].AfkCount = 0;
              playerStateData.Players[state.SteamID].LiveName = player.displayName;

              playerStateData.Players[state.SteamID].Position[0] = Math.Round(player.transform.position.x, 2);
              playerStateData.Players[state.SteamID].Position[1] = Math.Round(player.transform.position.y, 2);
              playerStateData.Players[state.SteamID].Position[2] = Math.Round(player.transform.position.z, 2);
        }
Exemplo n.º 19
0
 private void Start()
 {
     info = this.GetComponentInParent <PlayerStateInfo>();
 }
Exemplo n.º 20
0
 private void Start()
 {
     info = this.GetComponent <PlayerStateInfo>();
     RunUpdate();
 }
Exemplo n.º 21
0
        private void savePlayerState(BasePlayer player)
        {
            long currentTimestamp = GrabCurrentTimestamp();
              var info = new PlayTimeInfo(player);
              var state = new PlayerStateInfo(player);

              if (!playTimeData.Players.ContainsKey(info.SteamID)){
            playTimeData.Players.Add(info.SteamID, info);
              }
              long initTimeStamp = playerStateData.Players[state.SteamID].InitTimeStamp;
              long afkTime = playerStateData.Players[state.SteamID].AfkTime;
              long totalPlayed = currentTimestamp - initTimeStamp;

              playTimeData.Players[info.SteamID].AfkTime += afkTime;
              TimeSpan humanAfkTime = TimeSpan.FromSeconds(playTimeData.Players[info.SteamID].AfkTime);
              playTimeData.Players[info.SteamID].HumanAfkTime = string.Format("{0:c}", humanAfkTime);

              playTimeData.Players[info.SteamID].PlayTime += totalPlayed;
              TimeSpan humanPlayTime = TimeSpan.FromSeconds(playTimeData.Players[info.SteamID].PlayTime);
              playTimeData.Players[info.SteamID].HumanPlayTime = string.Format("{0:c}", humanPlayTime);

              playTimeData.Players[info.SteamID].LastSeen = (DateTime.Now).ToString("G");

              Interface.GetMod().DataFileSystem.WriteObject("PlayTimeTracker", playTimeData);
        }