diff options
Diffstat (limited to 'src/crsm.cpp')
| -rw-r--r-- | src/crsm.cpp | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/src/crsm.cpp b/src/crsm.cpp index a5d052d..87bcbfe 100644 --- a/src/crsm.cpp +++ b/src/crsm.cpp @@ -118,7 +118,7 @@ ClientInfo* CRSM::parseClientInfo(QString& message) if(parts[0] == Config.Auto.Volatile.Clonk.ServerPCName) { - return nullptr; + return &Session.Clonk.Server; } int CUID = parts[1].toInt(); @@ -193,10 +193,22 @@ void CRSM::readServerOutput() { const QString& type = what.left(3); what = what.mid(5); - if(type == "Cnt") + + static ClientInfo* playerInfoClient = nullptr; + + if(type == "Plr" && playerInfoClient != nullptr) { - Session.CountDown = what.toInt(); - return; + playerInfoClient->players.append(what); + } + else + { + playerInfoClient = nullptr; + + if(type == "Cnt") + { + Session.CountDown = what.toInt(); + return; + } } ClientInfo* clientPtr = parseClientInfo(what); @@ -206,6 +218,20 @@ void CRSM::readServerOutput() } ClientInfo& client = *clientPtr; + if(type == "Pli" || type == "Pla") + { + playerInfoClient = clientPtr; + + if(type == "Pli") + { + playerInfoClient->players.clear(); + } + } + else if(clientPtr == &Session.Clonk.Server) + { + return; + } + if(type == "Msg" || type == "Mac" || type == "Snd") { bool isMeMessage = (type == "Mac"); @@ -780,6 +806,10 @@ void CRSM::startScen(const ScenarioSettings &scen, QStringList argList) Session.Scenario = scen; Session.IRC.UseIngameChat = Config.IRC.UseIngameChat; + + Session.Clonk.Server.pcName = Config.Auto.Volatile.Clonk.ServerPCName; + Session.Clonk.Server.nick = Config.Auto.Volatile.Clonk.ServerNick; + setSessionState(CRSMSession::Lobby); filename = scenarioFileName(scen.name); |
