Eh?
This commit is contained in:
parent
4a4f353250
commit
1065357e70
@ -1173,11 +1173,11 @@ netprot::Packet netprot::makePack(void* ptr, PACKET_TYPE type) {
|
||||
}
|
||||
|
||||
void netprot::recvPacks(SOCKET sock, Buffer* buf, std::vector<char*>* lsPck) {
|
||||
int len = buf->tmp ? buf->tmp - buf->ptr : 0,
|
||||
int len = 0,//buf->tmp ? buf->tmp - buf->ptr : 0,
|
||||
end = 0;
|
||||
char* cursor = buf->tmp ? buf->tmp : nullptr,
|
||||
* next = buf->tmp ? buf->tmp + 1 : buf->ptr,
|
||||
* last = buf->tmp ? buf->tmp : buf->ptr;
|
||||
char* cursor = nullptr,//buf->tmp ? buf->tmp : nullptr,
|
||||
* next = buf->ptr,//buf->tmp ? buf->tmp + 1 : buf->ptr,
|
||||
* last = buf->ptr,//buf->tmp ? buf->tmp : buf->ptr;
|
||||
bool ended = true;
|
||||
struct pollfd fds[1];
|
||||
|
||||
|
@ -374,15 +374,13 @@ void Server::Run() {
|
||||
sendPackTo<BulletAdd>(m_sock_udp, bull, &m_buf, conn->getAddr());
|
||||
delete bull;
|
||||
}
|
||||
if (!netbull.empty())
|
||||
netbull.clear();
|
||||
|
||||
if (!bullets.empty())
|
||||
std::cout << "Bullets: " << bullets.size() << std::endl;
|
||||
|
||||
for (auto bull = bullets.begin(); bull != bullets.end(); ++bull) {
|
||||
ChunkMod* cmod = nullptr;
|
||||
Bullet* bullet = *bull;
|
||||
if (bullet->Update(m_world, (1. / 60.), 20, m_players, &cmod)) {
|
||||
if (bullet->Update(m_world, (1. / 60.), 1, m_players, &cmod)) {
|
||||
if (cmod)
|
||||
chunkdiffs.emplace_back(cmod);
|
||||
bullit.push_back(bull);
|
||||
@ -392,6 +390,11 @@ void Server::Run() {
|
||||
|
||||
for (auto& bull: bullit)
|
||||
bullets.erase(bull);
|
||||
|
||||
if (!bullets.empty())
|
||||
bullets.clear();
|
||||
|
||||
if (!bullit.empty())
|
||||
bullit.clear();
|
||||
|
||||
for (auto& chat : chatlog) {
|
||||
@ -400,6 +403,7 @@ void Server::Run() {
|
||||
sendPackTo<Chat>(m_sock_udp, chat, &m_buf, conn->getAddr());
|
||||
delete chat;
|
||||
}
|
||||
if (!chatlog.empty())
|
||||
chatlog.clear();
|
||||
|
||||
for (auto& chmo : chunkdiffs) {
|
||||
@ -407,6 +411,7 @@ void Server::Run() {
|
||||
sendPackTo<ChunkMod>(m_sock_udp, chmo, &m_buf, conn->getAddr());
|
||||
delete chmo;
|
||||
}
|
||||
if (!chunkdiffs.empty())
|
||||
chunkdiffs.clear();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user