mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 10:41:01 +00:00
Nice fix.
This commit is contained in:
@@ -43,7 +43,7 @@ void TLuaEngine::operator()() {
|
||||
auto Futures = TriggerEvent("onInit");
|
||||
WaitForAll(Futures);
|
||||
for (const auto& Future : Futures) {
|
||||
if (Future->Error) {
|
||||
if (Future->Error && Future->ErrorMessage != BeamMPFnNotFoundError) {
|
||||
beammp_lua_error("Calling \"onInit\" on \"" + Future->StateId + "\" failed: " + Future->ErrorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,11 @@ void TNetwork::TCPServerMain() {
|
||||
TConnection client {};
|
||||
SOCKET Listener = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
int optval = 1;
|
||||
#ifdef WIN32
|
||||
setsockopt(Listener, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<const char*>(&optval), sizeof(optval));
|
||||
#else
|
||||
setsockopt(Listener, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<void*>(&optval), sizeof(optval));
|
||||
#endif
|
||||
// TODO: check optval or return value idk
|
||||
sockaddr_in addr {};
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
|
||||
Reference in New Issue
Block a user