More than complicated and not necessary at all. For me, it's only required to allow scans on all present stellar bodies (should be simple).
Because normally the scan is done automatically, when close to ca. 30 LS of an object, but it could be changed to a hotkey or
by adding a sub command to UNEXPLORED entries of the Navigation or Contact list, if the body is the target and the scanner is installed.
That requires a little more work, but feels more reasonable to activate the scanner by a key or command.
Do you have a detailed surface scanner?
lol that would explain thatthanks
also is there a entry for credits? like when they change value?
No single one, but I believe that every transaction that provides or receives credits is covered across the various events.
Nope, updates for me the moment an event happens. How are you trying to read from them?Hello all, I was trying to read from the log files while playing, but it seems that the logs are not saved until the game is closed, anyone else faced the same problem?
Nope, updates for me the moment an event happens. How are you trying to read from them?
I'm using C# FileSystemWatcher Class
The change event is triggered only when the file is created, which is when the game starts and when the game exits.
What Toumal said, also it might be that you're locking ED out of the file? Fileaccess can be a mess in C#, I had some fights with it too.I'm using C# FileSystemWatcher Class
The change event is triggered only when the file is created, which is when the game starts and when the game exits.
I don't know if this is the right place to post this here but here is my code, i can't find anything wrong, but still it is not working.
View attachment 112469
I forgot to mention that this code snapshot is from Toumal solution.
I think i got what is the issue. the OnChanged event of the FileSystemWatcher is triggered when the file size changes. on the other hand, the game is updating the log file using the Flush method of the FileStream class, which does not cause Windows to flush the file’s metadata. The metadata is not flushed until the FileStream Close method is called.
I believe a fix for that, is to use Close method when a log is written and not to rely only only on Flush.
I forgot to mention that this code snapshot is from Toumal solution.
I think i got what is the issue. the OnChanged event of the FileSystemWatcher is triggered when the file size changes. on the other hand, the game is updating the log file using the Flush method of the FileStream class, which does not cause Windows to flush the file’s metadata. The metadata is not flushed until the FileStream Close method is called.
I believe a fix for that, is to use Close method when a log is written and not to rely only only on Flush.
Thread.Sleep(1000)
if(!journalStreamReader.EndOfStream)
{
//do some work because there is a new event entry
// e.g. var newLine = journalStreamReader.ReadLine()
}
No, it is completely normal.my point is that what are we doing is a workaround but not a normal solution.
No, it is completely normal.
For the full details from Raymond Chen: https://blogs.msdn.microsoft.com/oldnewthing/20111226-00/?p=8813
Duke's solution has been and remains the standard way to poll an open file for new data since at least UNIX/C in the 1970s.
public class AddedContentReader
{
private readonly FileStream _fileStream;
private readonly StreamReader _reader;
//Start position is from where to start reading first time. consequent read are managed by the Stream reader
public AddedContentReader(string fileName, long startPosition = 0)
{
//Open the file as FileStream
_fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
_reader = new StreamReader(_fileStream);
//Set the starting position
_fileStream.Position = startPosition;
}
//Get the current offset. You can save this when the application exits and on next reload
//set startPosition to value returned by this method to start reading from that location
public long CurrentOffset
{
get { return _fileStream.Position; }
}
public bool NewDataReady()
{
return (_fileStream.Length >= _fileStream.Position);
}
//Returns the lines added after this function was last called
public string GetAddedLine()
{
return _reader.ReadLine();
}
}
_continuousFileReader = new AddedContentReader(file.FullPath);
while (true) {
Thread.yield();
if (_continuousFileReader != null && _continuousFileReader.NewDataReady())
{
// Specify what is done when a file is changed, created, or deleted.
string newLines = _continuousFileReader.GetAddedLine();
if (newLines != null && newLines.Length > 0)
{
Console.WriteLine("New data: " + newLines);
//Do stuff
}
}
}