예제 #1
0
 /// <summary>
 /// Rrturn the charfile file access timestamp. This is the time
 /// this character was last accessed.
 /// </summary>
 /// <param name="charFile">The charfile to check.</param>
 /// <returns>The access time</returns>
 public static DateTime GetTimeStamp(FLDataFile charFile)
 {
     if (charFile.SettingExists("Player", "tstamp"))
     {
         long high = charFile.GetSetting("Player", "tstamp").UInt(0);
         long low  = charFile.GetSetting("Player", "tstamp").UInt(1);
         return(DateTime.FromFileTime(high << 32 | low));
     }
     return(DateTime.Now);
 }
예제 #2
0
        /// <summary>
        /// Return the ship string for the specified player
        /// </summary>
        /// <param name="gameData">The current game data.</param>
        /// <param name="charFile">The player's data file.</param>
        /// <returns>A string containing the ship name.</returns>
        public static string GetShip(FLGameData gameData, FLDataFile charFile, out Int64 shipArchType)
        {
            string nickNameOrHash = charFile.GetSetting("Player", "ship_archetype").Str(0);

            GameDataSet.HashListRow shipItem = gameData.GetItemByNickName(nickNameOrHash);
            if (shipItem != null)
            {
                shipArchType = shipItem.ItemHash;
            }
            else
            {
                shipArchType = charFile.GetSetting("Player", "ship_archetype").UInt(0);
            }
            return(gameData.GetItemDescByHash(shipArchType));
        }
예제 #3
0
        /// <summary>
        /// Return the location string for the specified player
        /// </summary>
        /// <param name="gameData">The current game data.</param>
        /// <param name="charFile">The player's data file.</param>
        /// <returns>A string containing the location.</returns>
        public static string GetLocation(FLGameData gameData, FLDataFile charFile)
        {
            string location = gameData.GetItemDescByNickNameX(charFile.GetSetting("Player", "system").Str(0));

            if (charFile.SettingExists("Player", "pos"))
            {
                float posX = charFile.GetSetting("Player", "pos").Float(0);
                float posY = charFile.GetSetting("Player", "pos").Float(1);
                float posZ = charFile.GetSetting("Player", "pos").Float(2);
                location += String.Format(" in space {0}, {1}, {2}", posX, posY, posZ);
            }
            else
            {
                location += " docked at " + gameData.GetItemDescByNickNameX(charFile.GetSetting("Player", "base").Str(0));
            }
            return(location);
        }
예제 #4
0
 /// <summary>
 /// Return the secs this character has been played on
 /// </summary>
 /// <param name="charFile">The charfile to check.</param>
 /// <returns>Seconds of in game time.</returns>
 public static uint GetOnLineTime(FLDataFile charfile)
 {
     if (charfile.SettingExists("mPlayer", "total_time_played"))
     {
         return((uint)charfile.GetSetting("mPlayer", "total_time_played").Float(0));
     }
     else
     {
         return(0);
     }
 }