Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
Dedicated reconnect fixed based on simple test.
Browse files Browse the repository at this point in the history
  • Loading branch information
qbism committed Apr 2, 2016
1 parent ffba33e commit 01ee1d8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
25 changes: 12 additions & 13 deletions host_cmd.c
Expand Up @@ -35,19 +35,18 @@ Host_Quit_f
==================
*/

extern void M_Quit_f (void);

void Host_Quit_f (void) //qb: restored original function
{
if (key_dest != key_console && cls.state != ca_dedicated)
{
M_Quit_f ();
return;
}
CL_Disconnect ();
Host_ShutdownServer(false);

Sys_Quit ();
void Host_Quit_f (void)
{
/* // Manoel Kasimier - "quit" always quits - removed - begin
if (key_dest != key_console && cls.state != ca_dedicated)
{
M_Menu_Quit_f ();
return;
}
*/ // Manoel Kasimier - "quit" always quits - removed - end CL_Disconnect ();
Host_ShutdownServer(false);

Sys_Quit ();
}


Expand Down
6 changes: 3 additions & 3 deletions net_dgrm.c
Expand Up @@ -1036,9 +1036,9 @@ static qsocket_t *_Datagram_CheckNewConnections (void) //qb: from bjpquake
// it's somebody coming back in from a crash/disconnect
// so close the old qsocket and let their retry get them back in

// ProQuake fix
// NET_Close(s);
// return NULL;
//qb: ProQuake fix commented these out, but otherwise can't reconnect on LAN
NET_Close(s);
return NULL;
}
}

Expand Down
6 changes: 6 additions & 0 deletions net_main.c
Expand Up @@ -628,6 +628,11 @@ qboolean NET_CanSendMessage (qsocket_t *sock)


int NET_SendToAll(sizebuf_t *data, int blocktime)
{
return NET_SendToAll2 (data, blocktime, false);
}

int NET_SendToAll2 (sizebuf_t *data, int blocktime, qboolean nolocals)
{
double start;
int i;
Expand All @@ -643,6 +648,7 @@ int NET_SendToAll(sizebuf_t *data, int blocktime)
{
if (host_client->netconnection->driver == 0)
{
if (!nolocals)
NET_SendMessage(host_client->netconnection, data);
state1[i] = true;
state2[i] = true;
Expand Down
7 changes: 6 additions & 1 deletion sv_main.c
Expand Up @@ -1505,7 +1505,12 @@ void SV_SendReconnect (void)

MSG_WriteByte (&msg, svc_stufftext);
MSG_WriteString (&msg, "reconnect\n");
NET_SendToAll (&msg, 5);

// Don't send a reconnect message to a local client; it can cause problems if coming
// after the client has already reached signon 4. In that case, the client will behave
// as if reconnect is entered in the console while playing; the loading plaque will
// display and the client is detached from the game (which will continue)
NET_SendToAll2 (&msg, 5, true);

if (cls.state != ca_dedicated)

Expand Down

0 comments on commit 01ee1d8

Please sign in to comment.