int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, qboolean quakesignon_suppressreliables)
{
int totallen = 0;
- int temp;
// if this packet was supposedly choked, but we find ourselves sending one
// anyway, make sure the size counting starts at zero
sendreliable = true;
}
// outgoing unreliable packet number, and outgoing reliable packet number (0 or 1)
- temp = (unsigned int)conn->outgoing_unreliable_sequence | ((unsigned int)sendreliable<<31);
- *((int *)(sendbuffer + 0)) = LittleLong(temp);
+ StoreLittleLong(sendbuffer, (unsigned int)conn->outgoing_unreliable_sequence | ((unsigned int)sendreliable<<31));
// last received unreliable packet number, and last received reliable packet number (0 or 1)
- temp = (unsigned int)conn->qw.incoming_sequence | ((unsigned int)conn->qw.incoming_reliable_sequence<<31);
- *((int *)(sendbuffer + 4)) = LittleLong(temp);
+ StoreLittleLong(sendbuffer + 4, (unsigned int)conn->qw.incoming_sequence | ((unsigned int)conn->qw.incoming_reliable_sequence<<31));
packetLen = 8;
conn->outgoing_unreliable_sequence++;
// client sends qport in every packet
{
cl_sockets[cl_numsockets++] = s;
LHNETADDRESS_ToString(LHNET_AddressFromSocket(s), addressstring2, sizeof(addressstring2), true);
- Con_Printf("Client opened a socket on address %s\n", addressstring2);
+ if (addresstype != LHNETADDRESSTYPE_LOOP)
+ Con_Printf("Client opened a socket on address %s\n", addressstring2);
}
else
{
Con_Printf("Client using port %i\n", port);
NetConn_OpenClientPort(NULL, LHNETADDRESSTYPE_LOOP, 2);
NetConn_OpenClientPort(net_address.string, LHNETADDRESSTYPE_INET4, port);
+#ifdef SUPPORTIPV6
NetConn_OpenClientPort(net_address_ipv6.string, LHNETADDRESSTYPE_INET6, port);
+#endif
}
void NetConn_CloseServerPorts(void)
{
sv_sockets[sv_numsockets++] = s;
LHNETADDRESS_ToString(LHNET_AddressFromSocket(s), addressstring2, sizeof(addressstring2), true);
- Con_Printf("Server listening on address %s\n", addressstring2);
+ if (addresstype != LHNETADDRESSTYPE_LOOP)
+ Con_Printf("Server listening on address %s\n", addressstring2);
return true;
}
else
NetConn_OpenServerPort(NULL, LHNETADDRESSTYPE_LOOP, 1, 1);
if (opennetports)
{
+#ifdef SUPPORTIPV6
qboolean ip4success = NetConn_OpenServerPort(net_address.string, LHNETADDRESSTYPE_INET4, port, 100);
NetConn_OpenServerPort(net_address_ipv6.string, LHNETADDRESSTYPE_INET6, port, ip4success ? 1 : 100);
+#else
+ NetConn_OpenServerPort(net_address.string, LHNETADDRESSTYPE_INET4, port, 100);
+#endif
}
if (sv_numsockets == 0)
Host_Error("NetConn_OpenServerPorts: unable to open any ports!");
// darkplaces or quake3
char protocolnames[1400];
Protocol_Names(protocolnames, sizeof(protocolnames));
- Con_Printf("\"%s\" received, sending connect request back to %s\n", string, addressstring2);
+ Con_DPrintf("\"%s\" received, sending connect request back to %s\n", string, addressstring2);
M_Update_Return_Reason("Got challenge response");
// update the server IP in the userinfo (QW servers expect this, and it is used by the reconnect command)
InfoString_SetValue(cls.userinfo, sizeof(cls.userinfo), "*ip", addressstring2);