MCPcopy Create free account
hub / github.com/ddnet/ddnet / HandleWriterFinishJobs

Method HandleWriterFinishJobs

src/game/editor/editor.cpp:7281–7312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7279}
7280
7281void CEditor::HandleWriterFinishJobs()
7282{
7283 if(m_WriterFinishJobs.empty())
7284 return;
7285
7286 std::shared_ptr<CDataFileWriterFinishJob> pJob = m_WriterFinishJobs.front();
7287 if(!pJob->Done())
7288 return;
7289 m_WriterFinishJobs.pop_front();
7290
7291 const char *pErrorMessage = pJob->ErrorMessage();
7292 if(pErrorMessage[0] != '\0')
7293 {
7294 ShowFileDialogError("%s", pErrorMessage);
7295 return;
7296 }
7297
7298 // send rcon.. if we can
7299 if(Client()->RconAuthed() && g_Config.m_EdAutoMapReload)
7300 {
7301 CServerInfo CurrentServerInfo;
7302 Client()->GetServerInfo(&CurrentServerInfo);
7303
7304 if(net_addr_is_local(&Client()->ServerAddress()))
7305 {
7306 char aMapName[MAX_MAP_LENGTH];
7307 IStorage::StripPathAndExtension(pJob->RealFilename(), aMapName, sizeof(aMapName));
7308 if(!str_comp(aMapName, CurrentServerInfo.m_aMap))
7309 Client()->Rcon("hot_reload");
7310 }
7311 }
7312}
7313
7314void CEditor::OnUpdate()
7315{

Callers

nothing calls this directly

Calls 11

net_addr_is_localFunction · 0.85
str_compFunction · 0.85
RconAuthedMethod · 0.80
GetServerInfoMethod · 0.80
ServerAddressMethod · 0.80
RealFilenameMethod · 0.80
RconMethod · 0.80
ClientFunction · 0.70
DoneMethod · 0.45
ErrorMessageMethod · 0.45

Tested by

no test coverage detected