IT'S LEAKING!
This commit is contained in:
parent
4d44d57a5a
commit
33bcdea06f
@ -224,9 +224,9 @@ void Server::Run() {
|
|||||||
std::vector<Bullet*> bullets, outbox_bullets;
|
std::vector<Bullet*> bullets, outbox_bullets;
|
||||||
std::vector<BulletAdd*> netbull;
|
std::vector<BulletAdd*> netbull;
|
||||||
|
|
||||||
Chat* startchat;
|
Chat* startchat = new Chat();
|
||||||
startchat->src_id = 0;
|
startchat->src_id = 0;
|
||||||
char startmess[] = "How would YOU like to die today, motherfuckers?";
|
char startmess[] = "How would -YOU- like to die today, motherfuckers?";
|
||||||
|
|
||||||
strcpy(startchat->mess, 140, startmess);
|
strcpy(startchat->mess, 140, startmess);
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ void Server::Run() {
|
|||||||
sync_acc -= 1000;
|
sync_acc -= 1000;
|
||||||
--timer;
|
--timer;
|
||||||
std::string str = "Timer: ";
|
std::string str = "Timer: ";
|
||||||
Log(str.append(std::to_string(timer).append(" SyncAcc: ").append(std::to_string(sync_acc))), false, false);
|
Log(str.append(std::to_string(timer)), false, false);
|
||||||
}
|
}
|
||||||
last = tstamp;
|
last = tstamp;
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ void Server::Run() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (auto& chmo : conn->ChunkDiffs)
|
for (auto& chmo : conn->ChunkDiffs)
|
||||||
chunkdiffs.emplace_back(chmo);
|
chunkdiffs.emplace_back(std::move(chmo));
|
||||||
conn->ChunkDiffs.clear();
|
conn->ChunkDiffs.clear();
|
||||||
|
|
||||||
for (auto& bull : conn->Bullets) {
|
for (auto& bull : conn->Bullets) {
|
||||||
@ -308,7 +308,7 @@ void Server::Run() {
|
|||||||
nbul->id = key;
|
nbul->id = key;
|
||||||
nbul->tstamp = tstamp;
|
nbul->tstamp = tstamp;
|
||||||
|
|
||||||
netbull.emplace_back(nbul);
|
netbull.emplace_back(std::move(nbul));
|
||||||
}
|
}
|
||||||
conn->Bullets.clear();
|
conn->Bullets.clear();
|
||||||
}
|
}
|
||||||
@ -333,10 +333,11 @@ void Server::Run() {
|
|||||||
ChunkMod* cmod = nullptr;
|
ChunkMod* cmod = nullptr;
|
||||||
if (bull->Update(m_world, (1. / 60.), 20, m_players, &cmod)) {
|
if (bull->Update(m_world, (1. / 60.), 20, m_players, &cmod)) {
|
||||||
if (cmod)
|
if (cmod)
|
||||||
chunkdiffs.emplace_back(cmod);
|
chunkdiffs.emplace_back(std::move(cmod));
|
||||||
outbox_bullets.emplace_back(std::move(bull));
|
outbox_bullets.emplace_back(std::move(bull));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
netbull.clear();
|
||||||
|
|
||||||
for (auto& chat : chatlog) {
|
for (auto& chat : chatlog) {
|
||||||
Log(chat->mess, false, false);
|
Log(chat->mess, false, false);
|
||||||
@ -344,16 +345,18 @@ void Server::Run() {
|
|||||||
sendPackTo<Chat>(m_sock_udp, chat, &m_buf, conn->getAddr());
|
sendPackTo<Chat>(m_sock_udp, chat, &m_buf, conn->getAddr());
|
||||||
delete chat;
|
delete chat;
|
||||||
}
|
}
|
||||||
|
chatlog.clear();
|
||||||
|
|
||||||
for (auto& chmo : chunkdiffs) {
|
for (auto& chmo : chunkdiffs) {
|
||||||
for (auto& [key, conn] : m_conns)
|
for (auto& [key, conn] : m_conns)
|
||||||
sendPackTo<ChunkMod>(m_sock_udp, chmo, &m_buf, conn->getAddr());
|
sendPackTo<ChunkMod>(m_sock_udp, chmo, &m_buf, conn->getAddr());
|
||||||
delete chmo;
|
delete chmo;
|
||||||
}
|
}
|
||||||
|
|
||||||
netbull.clear();
|
|
||||||
chunkdiffs.clear();
|
chunkdiffs.clear();
|
||||||
chatlog.clear();
|
|
||||||
|
for (auto& bull : outbox_bullets)
|
||||||
|
delete bull;
|
||||||
|
outbox_bullets.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
Chat end;
|
Chat end;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user