Same as last commit, except this one will affect .cfg's where the default port is changed

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3877 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Lance 2011-07-15 16:31:53 +00:00
parent a7b0200cd6
commit 73204d959c
1 changed files with 32 additions and 31 deletions

View File

@ -400,6 +400,19 @@ void Cmd_UDPPort(cmdctxt_t *ctx)
{
int news;
int newp = atoi(Cmd_Argv(ctx, 1));
news = QW_InitUDPSocket(newp, false);
if (news != INVALID_SOCKET)
{
ctx->cluster->mastersendtime = ctx->cluster->curtime;
closesocket(ctx->cluster->qwdsocket[0]);
ctx->cluster->qwdsocket[0] = news;
ctx->cluster->qwlistenportnum = newp;
Cmd_Printf(ctx, "Opened udp4 port %i (all connected qw clients will time out)\n", newp);
}
else
Cmd_Printf(ctx, "Failed to open udp4 port %i\n", newp);
news = QW_InitUDPSocket(newp, true);
if (news != INVALID_SOCKET)
@ -413,19 +426,6 @@ void Cmd_UDPPort(cmdctxt_t *ctx)
}
else
Cmd_Printf(ctx, "Failed to open udp6 port %i\n", newp);
news = QW_InitUDPSocket(newp, false);
if (news != INVALID_SOCKET)
{
ctx->cluster->mastersendtime = ctx->cluster->curtime;
closesocket(ctx->cluster->qwdsocket[0]);
ctx->cluster->qwdsocket[0] = news;
ctx->cluster->qwlistenportnum = newp;
Cmd_Printf(ctx, "Opened udp4 port %i (all connected qw clients will time out)\n", newp);
}
else
Cmd_Printf(ctx, "Failed to open udp4 port %i\n", newp);
}
void Cmd_AdminPassword(cmdctxt_t *ctx)
{
@ -1029,6 +1029,20 @@ void Cmd_MVDPort(cmdctxt_t *ctx)
else
{
news = Net_TCPListen(newp, false);
if (news != INVALID_SOCKET)
{
if (ctx->cluster->tcpsocket[0] != INVALID_SOCKET)
closesocket(ctx->cluster->tcpsocket[0]);
ctx->cluster->tcpsocket[0] = news;
ctx->cluster->tcplistenportnum = newp;
Cmd_Printf(ctx, "Opened tcp4 port %i\n", newp);
}
else
Cmd_Printf(ctx, "Failed to open tcp4 port %i\n", newp);
news = Net_TCPListen(newp, true);
if (news != INVALID_SOCKET)
@ -1043,19 +1057,6 @@ void Cmd_MVDPort(cmdctxt_t *ctx)
else
Cmd_Printf(ctx, "Failed to open tcp6 port %i\n", newp);
news = Net_TCPListen(newp, false);
if (news != INVALID_SOCKET)
{
if (ctx->cluster->tcpsocket[0] != INVALID_SOCKET)
closesocket(ctx->cluster->tcpsocket[0]);
ctx->cluster->tcpsocket[0] = news;
ctx->cluster->tcplistenportnum = newp;
Cmd_Printf(ctx, "Opened tcp4 port %i\n", newp);
}
else
Cmd_Printf(ctx, "Failed to open tcp4 port %i\n", newp);
}
}