OH YEAH.
This commit is contained in:
parent
553ef01765
commit
78f7974f1c
@ -855,7 +855,7 @@ std::vector<char*> netprot::recvPacks(SOCKET sock, Buffer* buf) {
|
|||||||
cmp = memcmp(cursor, &footer, sizeof(uint64_t) + sizeof(uint8_t));
|
cmp = memcmp(cursor, &footer, sizeof(uint64_t) + sizeof(uint8_t));
|
||||||
if (cmp == 0) {
|
if (cmp == 0) {
|
||||||
lsPck.push_back(last);
|
lsPck.push_back(last);
|
||||||
cursor += sizeof(uint64_t) + sizeof(uint8_t) + 1;
|
cursor += sizeof(uint64_t) + sizeof(uint8_t);
|
||||||
last = cursor;
|
last = cursor;
|
||||||
next = cursor + 1;
|
next = cursor + 1;
|
||||||
}
|
}
|
||||||
@ -867,7 +867,9 @@ std::vector<char*> netprot::recvPacks(SOCKET sock, Buffer* buf) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int x = 0; x < buf->len; ++x)
|
||||||
|
std::putchar(buf->ptr[x]);
|
||||||
|
std::puts("");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -19,7 +19,7 @@ namespace netprot {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct Buffer { // Pour pouvoir rendre l'utilisation des buffers plus clean.
|
struct Buffer { // Pour pouvoir rendre l'utilisation des buffers plus clean.
|
||||||
char* ptr = new char[BUFFER_LENGTH];
|
char* ptr = new char[BUFFER_LENGTH] { 1 };
|
||||||
uint32_t len = BUFFER_LENGTH;
|
uint32_t len = BUFFER_LENGTH;
|
||||||
|
|
||||||
~Buffer() { delete[] ptr; }
|
~Buffer() { delete[] ptr; }
|
||||||
|
@ -107,10 +107,10 @@ int Connector::Connect(const char* srv_addr, std::string name) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lsPck.empty())
|
//if (lsPck.empty())
|
||||||
errors++;
|
//errors++;
|
||||||
lsPck.clear();
|
lsPck.clear();
|
||||||
if (errors > 1000000)
|
if (errors > 1000)
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user