Fix
This commit is contained in:
parent
0fab0574b2
commit
0eda36b7a1
@ -102,6 +102,7 @@ namespace network
|
|||||||
// Rather than try and let the player in, just tell them they are a duplicate player and reject connection
|
// Rather than try and let the player in, just tell them they are a duplicate player and reject connection
|
||||||
game::NET_OutOfBandPrint(game::NS_SERVER, from, "error\nYou are already connected to the server.");
|
game::NET_OutOfBandPrint(game::NS_SERVER, from, "error\nYou are already connected to the server.");
|
||||||
}
|
}
|
||||||
|
|
||||||
SOCKET create_socket(const char* net_interface, int port, int protocol)
|
SOCKET create_socket(const char* net_interface, int port, int protocol)
|
||||||
{
|
{
|
||||||
sockaddr_in address{};
|
sockaddr_in address{};
|
||||||
@ -119,7 +120,7 @@ namespace network
|
|||||||
|
|
||||||
u_long arg = 1;
|
u_long arg = 1;
|
||||||
ioctlsocket(sock, FIONBIO, &arg);
|
ioctlsocket(sock, FIONBIO, &arg);
|
||||||
char optval[4] = {1};
|
char optval[4] = { 1 };
|
||||||
setsockopt(sock, 0xFFFF, 32, optval, 4);
|
setsockopt(sock, 0xFFFF, 32, optval, 4);
|
||||||
|
|
||||||
if (bind(sock, reinterpret_cast<sockaddr*>(&address), sizeof(address)) != -1)
|
if (bind(sock, reinterpret_cast<sockaddr*>(&address), sizeof(address)) != -1)
|
||||||
@ -130,6 +131,7 @@ namespace network
|
|||||||
closesocket(sock);
|
closesocket(sock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void on(const std::string& command, const callback& callback)
|
void on(const std::string& command, const callback& callback)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user