Sorry for the late answer, I’ve been kind of busy recently and the DSL has been on the back burner.
The fact that there is a 1 minute delay is kind of strange.
The way the log is updated is indeed like a tail: I track the file size, and when it changes I load the new content from the last position I had loaded.
Then I search for tokens that match a specific content, in this case the code is like that:
std::string_view joinSucceededToken("Join succeeded:");
std::string_view playerDisconnecctedToken("Player disconnected:");
(...)
// Player filtering
m_ServerLogFilePlayersContent.append(line);
m_ServerLogFilePlayersContent.append("\r\n");
(...)
auto pos = line.find(joinSucceededToken);
if (pos != line.npos)
{
// [2022.10.20-08.56.56:349][418]LogNet: Join succeeded: name#id
pos += joinSucceededToken.size();
dw::String playerName = line.substr(pos);
m_CurrentPlayers.insert(playerName.Strip());
}
else
{
pos = line.find(playerDisconnecctedToken);
if (pos != line.npos)
{
// [2022.10.20-09.39.28:612][590]LogNet: Player disconnected: name#id
pos += playerDisconnecctedToken.size();
dw::String playerName = line.substr(pos);
m_CurrentPlayers.erase(playerName.Strip());
}
}
then at the end of the parsing, without any delay, the player tab is modified if the number of players changed.
int playerCount = (int)m_CurrentPlayers.size();
if (m_CurrentPlayerCount != playerCount)
{
m_CurrentPlayerCount = playerCount;
// If the number of players has changed, we modify the tab to indicate the number of players
dw::String playersTabCaption = "Players";
if (m_CurrentPlayerCount)
{
playersTabCaption.FormatAppend(" (%u)", m_CurrentPlayerCount);
}
SetTabCaption(IDC_TABBED_VIEW, (int)TabEntry::e_TabEntryPlayers, playersTabCaption);
}
The m_ServerLogFilePlayersContent is used to populate the end of the player tab, and as you can see is processed at the same time as the data is extracted from the log.
Here is 100% of the code that generates the player’s tab:
case TabEntry::e_TabEntryPlayers:
{
dw::String logContent;
if (m_CurrentPlayers.empty())
{
logContent.FormatAppend("No player connected\r\n");
}
else
{
logContent.FormatAppend("Players currently connected\r\n");
for (const auto& playerName : m_CurrentPlayers)
{
logContent.FormatAppend("- %s\r\n",playerName);
}
}
logContent.FormatAppend("-=-=-=-=-\r\n");
logContent.FormatAppend("%s",m_ServerLogFilePlayersContent);
SetItemText(IDC_LOG_FILE_SNIPPET, logContent);
}
break;
This is called at the end of the log parsing, and all it does is to print the list of all the players in the m_CurrentPlayers which was updated above, then the -=-= separator, and finally the m_ServerLogFilePlayersContent content mentioned earlier.
Out of the box, I’ve no idea how they could get out of sync, obviously the UI has some delays to avoid slowing down things, but when you click on a tab, the refresh is instant and based on up-to-date content.
@tiagoturilli regarding the
but I must warn you that every time a new version is released, the DSL becomes heavier to run.
I don’t believe that’s true at all, most of the changes I’ve done to the DSL are like a couple lines here and there, the main change is that I often need to publish a new DSL when a major change was done in the game server.
If what you are saying is actually true, then I need some numbers that show that, like show me your task manager running various versions of the DSL using significantly different amount of memory and CPU usage.



