Posted: Mon Aug 23, 2010 3:42 pm
Well I'd be first to admit that there's something of a Cargo Cult element to what I did, yes.
Code: Select all
MSG_WriteByte (&cls.message, clc_nop);
Code: Select all
CL_KeepaliveMessage();
Code: Select all
byte proquake_connection;
Still in In net_dgrm.c in _Datagram_Connect add the yellow ...MSG_WriteLong(&net_message, 0);
MSG_WriteByte(&net_message, CCREQ_CONNECT);
MSG_WriteString(&net_message, "QUAKE");
MSG_WriteByte(&net_message, NET_PROTOCOL_VERSION);
// Tell the server we are ProQuake 3.70
// A normal Quake server only looks at the first 12 bytes of the message
// above, so only a ProQuake server reads these extra bytes.
MSG_WriteByte(&net_message, 1); // JPG - added this
MSG_WriteByte(&net_message, 37); // JPG 3.00 - added this
MSG_WriteByte(&net_message, 0); // JPG 3.00 - added this (flags)
MSG_WriteLong(&net_message, 0); // JPG 3.00 - password protected servers
Finally in cl_input.c we need to make sure we write short angles when connected to a ProQuake server (0-65535 = 2 bytes = 16 bits) instead of byte angles (0-255 = 1 byte = 8 bits).
int len = ret;
ret = MSG_ReadByte();
if (ret == CCREP_REJECT)
{
reason = MSG_ReadString();
Con_Printf("%s\n", reason);
q_strlcpy(m_return_reason, reason, sizeof(m_return_reason));
goto ErrorReturn;
}
if (ret == CCREP_ACCEPT)
{
Q_memcpy(&sock->addr, &sendaddr, sizeof(struct qsockaddr));
dfunc.SetSocketPort (&sock->addr, MSG_ReadLong());
Con_Printf ("Client port is %s\n", dfunc.AddrToString(&sock->addr));
// Client has received CCREP_ACCEPT meaning client may connect
// Now find out if this is a ProQuake server ...
sock->proquake_connection = (len > 9 && MSG_ReadByte () == 1) ? 1 : 0;
And in put this in net_main.cfor (i=0 ; i<3 ; i++)
//johnfitz -- 16-bit angles for PROTOCOL_FITZQUAKE
if (!cls.demoplayback && NET_QSocketIsProQuakeServer(cls.netcon))
MSG_WriteAngle16 (&buf, cl.viewangles);
else
if (cl.protocol == PROTOCOL_NETQUAKE)
MSG_WriteAngle (&buf, cl.viewangles);
else
MSG_WriteAngle16 (&buf, cl.viewangles);
//johnfitz
Code: Select all
qboolean NET_QSocketIsProQuakeServer (qsocket_t *s)
{
return s->proquake_connection;
}
I was trying to test Mark V on a server and the "easier NAT fix" didn't cut it. Wish all this were known in the past.r00k wrote:ya that sock->proquake onnection
i have 1defined as MOD_PROQUAKE