2005-02-28 07:16:19 +00:00
|
|
|
#include "quakedef.h"
|
2004-08-23 01:40:25 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
#ifdef WEBSVONLY
|
|
|
|
#undef vsnprintf
|
|
|
|
#undef _vsnprintf
|
|
|
|
#ifdef _WIN32
|
|
|
|
#define vsnprintf _vsnprintf
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2004-08-23 01:40:25 +00:00
|
|
|
#ifdef WEBSERVER
|
|
|
|
|
|
|
|
#include "iweb.h"
|
|
|
|
|
|
|
|
//hows this as a bug.
|
|
|
|
//TCP data can travel at different speeds.
|
|
|
|
//If the later bits of a data channel arrive after the message saying that a transfer was compleate,
|
|
|
|
//the later bits of the file may not arrive before the client closes the conenction.
|
|
|
|
//this is a major bug and can prevent the server from giving files at a high pl/ping
|
|
|
|
|
2005-11-29 13:14:15 +00:00
|
|
|
#include "netinc.h"
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
static iwboolean ftpserverinitied = false;
|
2014-02-07 08:38:40 +00:00
|
|
|
static SOCKET ftpserversocket = INVALID_SOCKET;
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
qboolean ftpserverfailed;
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct FTPclient_s{
|
|
|
|
char name[64];
|
|
|
|
char pwd[64];
|
|
|
|
int auth; //has it got auth?
|
|
|
|
char path[256];
|
|
|
|
|
|
|
|
char commandbuffer[256];
|
|
|
|
char messagebuffer[256];
|
|
|
|
int cmdbuflen;
|
|
|
|
int msgbuflen;
|
2011-05-19 13:34:07 +00:00
|
|
|
|
2014-02-07 08:38:40 +00:00
|
|
|
SOCKET controlsock;
|
|
|
|
SOCKET datasock; //FTP only allows one transfer per connection.
|
2004-08-23 01:40:25 +00:00
|
|
|
int dataislisten;
|
|
|
|
int datadir; //0 no data, 1 reading, 2 writing
|
2005-12-22 02:29:11 +00:00
|
|
|
vfsfile_t *file;
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
unsigned long blocking;
|
|
|
|
|
|
|
|
struct FTPclient_s *next;
|
|
|
|
} FTPclient_t;
|
|
|
|
|
|
|
|
FTPclient_t *FTPclient;
|
|
|
|
|
2014-02-07 08:38:40 +00:00
|
|
|
SOCKET FTP_BeginListening(int aftype, int port)
|
2011-05-19 13:34:07 +00:00
|
|
|
{
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
struct sockaddr_qstorage address;
|
2004-08-23 01:40:25 +00:00
|
|
|
unsigned long _true = true;
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
unsigned long _false = false;
|
2004-08-23 01:40:25 +00:00
|
|
|
int i;
|
2014-02-07 08:38:40 +00:00
|
|
|
SOCKET sock;
|
2004-08-23 01:40:25 +00:00
|
|
|
|
2013-04-02 05:18:17 +00:00
|
|
|
#ifdef IPPROTO_IPV6
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
if ((sock = socket ((aftype!=1)?PF_INET6:PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
|
2013-04-02 05:18:17 +00:00
|
|
|
#else
|
|
|
|
if ((sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
|
|
|
|
#endif
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
IWebPrintf ("FTP_BeginListening: socket: %s\n", strerror(neterrno()));
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
return INVALID_SOCKET;
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
if (ioctlsocket (sock, FIONBIO, &_true) == -1)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
IWebPrintf ("FTP_BeginListening: ioctl FIONBIO: %s", strerror(neterrno()));
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
return INVALID_SOCKET;
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
|
2013-04-02 05:18:17 +00:00
|
|
|
#ifdef IPPROTO_IPV6
|
|
|
|
if (aftype != 1)
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
{
|
|
|
|
//0=ipv4+ipv6
|
|
|
|
//2=ipv6 only
|
|
|
|
if (aftype == 0)
|
|
|
|
{
|
|
|
|
if (0 > setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&_false, sizeof(_false)))
|
|
|
|
{
|
|
|
|
//abort and do ipv4 only if hybrid sockets don't work.
|
|
|
|
closesocket(sock);
|
|
|
|
return FTP_BeginListening(1, port);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
memset(&address, 0, sizeof(address));
|
|
|
|
((struct sockaddr_in6*)&address)->sin6_family = AF_INET6;
|
|
|
|
if (port == PORT_ANY)
|
|
|
|
((struct sockaddr_in6*)&address)->sin6_port = 0;
|
|
|
|
else
|
|
|
|
((struct sockaddr_in6*)&address)->sin6_port = htons((short)port);
|
|
|
|
}
|
2013-04-02 05:18:17 +00:00
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
//1=ipv4 only
|
|
|
|
((struct sockaddr_in*)&address)->sin_family = AF_INET;
|
|
|
|
//ZOID -- check for interface binding option
|
|
|
|
if ((i = COM_CheckParm("-ip")) != 0 && i < com_argc) {
|
|
|
|
((struct sockaddr_in*)&address)->sin_addr.s_addr = inet_addr(com_argv[i+1]);
|
2013-11-29 14:36:47 +00:00
|
|
|
Con_TPrintf("Binding to IP Interface Address of %s\n",
|
2013-04-02 05:18:17 +00:00
|
|
|
inet_ntoa(((struct sockaddr_in*)&address)->sin_addr));
|
|
|
|
} else
|
|
|
|
((struct sockaddr_in*)&address)->sin_addr.s_addr = INADDR_ANY;
|
|
|
|
|
|
|
|
if (port == PORT_ANY)
|
|
|
|
((struct sockaddr_in*)&address)->sin_port = 0;
|
|
|
|
else
|
|
|
|
((struct sockaddr_in*)&address)->sin_port = htons((short)port);
|
|
|
|
}
|
2011-05-19 13:34:07 +00:00
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
if( bind (sock, (void *)&address, sizeof(address)) == -1)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
IWebPrintf("FTP_BeginListening: failed to bind socket\n");
|
2004-08-23 01:40:25 +00:00
|
|
|
closesocket(ftpserversocket);
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
return INVALID_SOCKET;
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
2011-05-19 13:34:07 +00:00
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
listen(sock, 3);
|
2004-08-23 01:40:25 +00:00
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
return sock;
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FTP_ServerShutdown(void)
|
|
|
|
{
|
|
|
|
closesocket(ftpserversocket);
|
|
|
|
ftpserverinitied = false;
|
|
|
|
IWebPrintf("FTP server is deactivated\n");
|
|
|
|
}
|
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
//we ought to filter this to remove duplicates.
|
2014-02-07 08:38:40 +00:00
|
|
|
static int QDECL SendFileNameTo(const char *rawname, qofs_t size, void *param, searchpathfuncs_t *spath)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
SOCKET socket = *(SOCKET*)param;
|
2004-08-23 01:40:25 +00:00
|
|
|
// int i;
|
|
|
|
char buffer[256+1];
|
|
|
|
char *slash;
|
2009-04-01 22:03:56 +00:00
|
|
|
char nondirname[MAX_QPATH];
|
|
|
|
int isdir = rawname[strlen(rawname)-1] == '/';
|
|
|
|
char *fname;
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
#ifndef WEBSVONLY //copy protection of the like that QWSV normally has.
|
|
|
|
if (!isdir)
|
2009-04-01 22:03:56 +00:00
|
|
|
if (!SV_AllowDownload(rawname)) //don't advertise if we're going to disallow it
|
2004-08-23 01:40:25 +00:00
|
|
|
return true;
|
|
|
|
#endif
|
|
|
|
|
2009-04-01 22:03:56 +00:00
|
|
|
Q_strncpyz(nondirname, rawname, sizeof(nondirname));
|
2004-08-23 01:40:25 +00:00
|
|
|
if (isdir)
|
2009-04-01 22:03:56 +00:00
|
|
|
nondirname[strlen(nondirname)-1] = '\0';
|
|
|
|
fname = nondirname;
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
while((slash = strchr(fname, '/')))
|
|
|
|
fname = slash+1;
|
|
|
|
|
|
|
|
if (isdir)
|
2014-03-30 00:39:37 +00:00
|
|
|
sprintf(buffer, "drw-r--r--\t1\troot\troot\t%8u Jan 1 12:00 %s\r\n", (unsigned int)size, fname);
|
2004-08-23 01:40:25 +00:00
|
|
|
else
|
2014-03-30 00:39:37 +00:00
|
|
|
sprintf(buffer, "-rw-r--r--\t1\troot\troot\t%8u Jan 1 12:00 %s\r\n", (unsigned int)size, fname);
|
2011-05-19 13:34:07 +00:00
|
|
|
|
2004-08-23 01:40:25 +00:00
|
|
|
// strcpy(buffer, fname);
|
|
|
|
// for (i = strlen(buffer); i < 40; i+=8)
|
|
|
|
// strcat(buffer, "\t");
|
2005-02-28 07:16:19 +00:00
|
|
|
send(socket, buffer, strlen(buffer), 0);
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-02-07 08:38:40 +00:00
|
|
|
SOCKET FTP_SV_makelistensocket(unsigned long nblocking)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
|
|
|
char name[256];
|
2014-02-07 08:38:40 +00:00
|
|
|
SOCKET sock;
|
2004-08-23 01:40:25 +00:00
|
|
|
struct hostent *hent;
|
2011-05-19 13:34:07 +00:00
|
|
|
|
2004-08-23 01:40:25 +00:00
|
|
|
struct sockaddr_in address;
|
|
|
|
// int fromlen;
|
|
|
|
|
|
|
|
address.sin_family = AF_INET;
|
|
|
|
if (gethostname(name, sizeof(name)) == -1)
|
|
|
|
return INVALID_SOCKET;
|
|
|
|
hent = gethostbyname(name);
|
|
|
|
if (!hent)
|
|
|
|
return INVALID_SOCKET;
|
|
|
|
address.sin_addr.s_addr = *(int *)(hent->h_addr_list[0]);
|
|
|
|
address.sin_port = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
|
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
Sys_Error ("FTP_TCP_OpenSocket: socket: %s", strerror(neterrno()));
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (ioctlsocket (sock, FIONBIO, &nblocking) == -1)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
Sys_Error ("FTP_TCP_OpenSocket: ioctl FIONBIO: %s", strerror(neterrno()));
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
2011-05-19 13:34:07 +00:00
|
|
|
|
2004-08-23 01:40:25 +00:00
|
|
|
if( bind (sock, (void *)&address, sizeof(address)) == -1)
|
|
|
|
{
|
|
|
|
closesocket(sock);
|
|
|
|
return INVALID_SOCKET;
|
|
|
|
}
|
2011-05-19 13:34:07 +00:00
|
|
|
|
2004-08-23 01:40:25 +00:00
|
|
|
listen(sock, 2);
|
|
|
|
|
|
|
|
return sock;
|
|
|
|
}
|
2014-02-07 08:38:40 +00:00
|
|
|
iwboolean FTP_SVSocketPortToString (SOCKET socket, char *s)
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
{
|
|
|
|
struct sockaddr_qstorage addr;
|
|
|
|
int adrlen = sizeof(addr);
|
|
|
|
|
|
|
|
if (getsockname(socket, (struct sockaddr*)&addr, &adrlen) == -1)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (((struct sockaddr_in*)&addr)->sin_family == AF_INET6)
|
|
|
|
sprintf(s, "%i", ntohs(((struct sockaddr_in6*)&addr)->sin6_port));
|
|
|
|
else
|
|
|
|
sprintf(s, "%i", ntohs(((struct sockaddr_in*)&addr)->sin_port));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
//only to be used for ipv4 sockets.
|
2014-02-07 08:38:40 +00:00
|
|
|
iwboolean FTP_SVSocketToString (SOCKET socket, char *s)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
|
|
|
struct sockaddr_in addr;
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
qbyte *baddr;
|
2004-08-23 01:40:25 +00:00
|
|
|
int adrlen = sizeof(addr);
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
char name[256];
|
2004-08-23 01:40:25 +00:00
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
//get the port.
|
2004-08-23 01:40:25 +00:00
|
|
|
if (getsockname(socket, (struct sockaddr*)&addr, &adrlen) == -1)
|
|
|
|
return false;
|
2011-05-19 13:34:07 +00:00
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
baddr = (qbyte *)&addr.sin_addr;
|
|
|
|
|
|
|
|
if (gethostname(name, sizeof(name)) != -1)
|
|
|
|
{
|
|
|
|
struct hostent *hent = gethostbyname(name);
|
|
|
|
if (hent)
|
|
|
|
baddr = hent->h_addr_list[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
sprintf(s, "%i,%i,%i,%i,%i,%i", baddr[0], baddr[1], baddr[2], baddr[3], ((qbyte *)&addr.sin_port)[0], ((qbyte *)&addr.sin_port)[1]);
|
2004-08-23 01:40:25 +00:00
|
|
|
return true;
|
|
|
|
}
|
2014-02-07 08:38:40 +00:00
|
|
|
iwboolean FTP_SVRemoteSocketToString (SOCKET socket, char *s, int slen)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
struct sockaddr_qstorage addr;
|
|
|
|
netadr_t na;
|
2004-08-23 01:40:25 +00:00
|
|
|
int adrlen = sizeof(addr);
|
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
// addr.sin_family = AF_INET;
|
2004-08-23 01:40:25 +00:00
|
|
|
if (getpeername(socket, (struct sockaddr*)&addr, &adrlen) == -1)
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
{
|
|
|
|
*s = 0;
|
2004-08-23 01:40:25 +00:00
|
|
|
return false;
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
}
|
2011-05-19 13:34:07 +00:00
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
SockadrToNetadr(&addr, &na);
|
2013-05-03 04:28:08 +00:00
|
|
|
NET_AdrToString(s, slen, &na);
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
|
|
|
|
// if (((struct sockaddr_in*)&addr)->sin_family == AF_INET6)
|
|
|
|
// {
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// sprintf(s, "%i,%i,%i,%i,%i,%i", ((qbyte *)&addr.sin_addr)[0], ((qbyte *)&addr.sin_addr)[1], ((qbyte *)&addr.sin_addr)[2], ((qbyte *)&addr.sin_addr)[3], ((qbyte *)&addr.sin_port)[0], ((qbyte *)&addr.sin_port)[1]);
|
2004-08-23 01:40:25 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* Responsable for sending all control server -> client messages.
|
|
|
|
* Queues the message if it cannot send now.
|
|
|
|
* Kicks if too big a queue.
|
|
|
|
*/
|
|
|
|
void QueueMessage(FTPclient_t *cl, char *msg)
|
|
|
|
{
|
|
|
|
if (send (cl->controlsock, msg, strlen(msg), 0) == -1)
|
|
|
|
{ //wasn't sent
|
|
|
|
if (strlen(msg) + strlen(cl->messagebuffer) >= sizeof(cl->messagebuffer)-1)
|
|
|
|
closesocket(cl->controlsock); //but don't mark it as closed, so we get errors later (for this is how we shall tell).
|
|
|
|
strcat(cl->messagebuffer, msg);
|
|
|
|
}
|
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
|
2004-08-23 01:40:25 +00:00
|
|
|
void VARGS QueueMessageva(FTPclient_t *cl, char *fmt, ...)
|
|
|
|
{
|
|
|
|
va_list argptr;
|
|
|
|
char msg[1024];
|
|
|
|
|
|
|
|
va_start (argptr, fmt);
|
2006-03-06 01:41:09 +00:00
|
|
|
vsnprintf (msg,sizeof(msg)-1, fmt,argptr);
|
2009-11-04 21:16:50 +00:00
|
|
|
msg[sizeof(msg)-1] = 0;
|
2004-08-23 01:40:25 +00:00
|
|
|
va_end (argptr);
|
|
|
|
|
|
|
|
if (send (cl->controlsock, msg, strlen(msg), 0) == -1)
|
|
|
|
{ //wasn't sent
|
|
|
|
if (strlen(msg) + strlen(cl->messagebuffer) >= sizeof(cl->messagebuffer)-1)
|
|
|
|
closesocket(cl->controlsock); //but don't mark it as closed, so we get errors later (for this is how we shall tell).
|
|
|
|
strcat(cl->messagebuffer, msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
iwboolean FTP_ServerThinkForConnection(FTPclient_t *cl)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
struct sockaddr_in from;
|
|
|
|
int fromlen;
|
|
|
|
char *msg, *line;
|
|
|
|
|
|
|
|
char mode[64];
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
char resource[8192];
|
2009-11-04 21:16:50 +00:00
|
|
|
int _true = true;
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
if (cl->datadir == 1)
|
|
|
|
{
|
|
|
|
int pos, sent;
|
|
|
|
int ammount, wanted = sizeof(resource);
|
|
|
|
|
2005-12-22 02:29:11 +00:00
|
|
|
pos = VFS_TELL(cl->file);
|
|
|
|
ammount = VFS_READ(cl->file, resource, wanted);
|
2004-08-23 01:40:25 +00:00
|
|
|
sent = send(cl->datasock, resource, ammount, 0);
|
|
|
|
|
|
|
|
if (sent == -1)
|
|
|
|
{
|
2005-12-22 02:29:11 +00:00
|
|
|
VFS_SEEK(cl->file, pos);
|
2014-02-07 08:38:40 +00:00
|
|
|
if (neterrno() != NET_EWOULDBLOCK)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
cl->datasock = INVALID_SOCKET;
|
2005-12-22 02:29:11 +00:00
|
|
|
VFS_CLOSE(cl->file);
|
2004-08-23 01:40:25 +00:00
|
|
|
cl->file = NULL;
|
2011-05-19 13:34:07 +00:00
|
|
|
|
2004-08-23 01:40:25 +00:00
|
|
|
QueueMessage (cl, "226 Transfer complete .\r\n");
|
|
|
|
cl->datadir = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sent != ammount)
|
2005-12-22 02:29:11 +00:00
|
|
|
VFS_SEEK(cl->file, pos + sent);
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
if (ammount != wanted && sent == ammount) //file is over
|
|
|
|
{
|
|
|
|
send(cl->datasock, resource, 0, 0);
|
|
|
|
send(cl->datasock, resource, 0, 0);
|
|
|
|
send(cl->datasock, resource, 0, 0);
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
cl->datasock = INVALID_SOCKET;
|
2005-12-22 02:29:11 +00:00
|
|
|
VFS_CLOSE(cl->file);
|
2004-08-23 01:40:25 +00:00
|
|
|
cl->file = NULL;
|
|
|
|
|
|
|
|
QueueMessage (cl, "226 Transfer complete .\r\n");
|
|
|
|
cl->datadir = 0;
|
|
|
|
}
|
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
|
|
|
|
pos = cl->datadir?1:!cl->blocking;
|
2011-05-19 13:34:07 +00:00
|
|
|
if (ioctlsocket (cl->controlsock, FIONBIO, (u_long *)&pos) == -1)
|
2009-11-04 21:16:50 +00:00
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
IWebPrintf ("FTP_ServerRun: blocking error: %s\n", strerror(neterrno()));
|
2009-11-04 21:16:50 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
else if (cl->datadir == 2)
|
|
|
|
{
|
|
|
|
int len;
|
|
|
|
while((len = recv(cl->datasock, resource, sizeof(resource), 0)) >0 )
|
2011-05-19 13:34:07 +00:00
|
|
|
{
|
2005-12-22 02:29:11 +00:00
|
|
|
VFS_WRITE(cl->file, resource, len);
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
if (len == -1)
|
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
if (neterrno() != NET_EWOULDBLOCK)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
cl->datasock = INVALID_SOCKET;
|
|
|
|
if (cl->file)
|
2005-12-22 02:29:11 +00:00
|
|
|
VFS_CLOSE(cl->file);
|
2004-08-23 01:40:25 +00:00
|
|
|
cl->file = NULL;
|
|
|
|
|
|
|
|
QueueMessage (cl, "226 Transfer complete .\r\n");
|
|
|
|
cl->datadir = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (len == 0)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "226 Transfer complete .\r\n");
|
2005-12-22 02:29:11 +00:00
|
|
|
VFS_CLOSE(cl->file);
|
2004-08-23 01:40:25 +00:00
|
|
|
cl->file = NULL;
|
|
|
|
cl->datadir = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-19 13:34:07 +00:00
|
|
|
ret = recv(cl->controlsock, cl->commandbuffer+cl->cmdbuflen, sizeof(cl->commandbuffer)-1 - cl->cmdbuflen, 0);
|
2004-08-23 01:40:25 +00:00
|
|
|
if (ret == -1)
|
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
int e = neterrno();
|
|
|
|
if (e == NET_EWOULDBLOCK)
|
2004-08-23 01:40:25 +00:00
|
|
|
return false; //remove
|
|
|
|
|
2014-02-07 08:38:40 +00:00
|
|
|
if (e == NET_ECONNABORTED || e == NET_ECONNRESET)
|
2004-08-23 01:40:25 +00:00
|
|
|
return true;
|
|
|
|
|
2014-02-07 08:38:40 +00:00
|
|
|
Con_Printf ("NET_GetPacket: %s\n", strerror(e));
|
2004-08-23 01:40:25 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (*cl->messagebuffer)
|
|
|
|
{
|
|
|
|
if (send (cl->controlsock, cl->messagebuffer, strlen(cl->messagebuffer), 0) != -1)
|
|
|
|
*cl->messagebuffer = '\0'; //YAY! It went!
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret == 0)
|
|
|
|
return false;
|
|
|
|
cl->cmdbuflen += ret;
|
|
|
|
cl->commandbuffer[cl->cmdbuflen] = 0;
|
|
|
|
|
|
|
|
line = cl->commandbuffer;
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
msg = line;
|
|
|
|
while (*line)
|
|
|
|
{
|
|
|
|
if (*line == '\r')
|
|
|
|
*line = ' ';
|
|
|
|
if (*line == '\n')
|
|
|
|
break;
|
|
|
|
line++;
|
|
|
|
}
|
|
|
|
if (!*line) //broken client
|
|
|
|
{
|
|
|
|
memmove(cl->commandbuffer, line, strlen(line)+1);
|
|
|
|
cl->cmdbuflen = strlen(line);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
*line = '\0';
|
|
|
|
line++;
|
|
|
|
IWebPrintf("FTP: %s\n", msg);
|
|
|
|
|
|
|
|
msg = COM_ParseOut(msg, mode, sizeof(mode));
|
|
|
|
if (!stricmp(mode, "SYST"))
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "215 UNIX Type: L8.\r\n"); //some browsers can be wierd about things.
|
|
|
|
}
|
|
|
|
else if (!stricmp(mode, "user"))
|
|
|
|
{
|
2011-05-19 13:34:07 +00:00
|
|
|
msg = COM_ParseOut(msg, cl->name, sizeof(cl->name));
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
QueueMessage (cl, "331 User name received, will be checked with password.\r\n");
|
|
|
|
}
|
|
|
|
else if (!stricmp(mode, "pass"))
|
|
|
|
{
|
|
|
|
msg = COM_ParseOut(msg, cl->pwd, sizeof(cl->pwd));
|
|
|
|
|
|
|
|
cl->auth = IWebAuthorize(cl->name, cl->pwd);
|
|
|
|
|
|
|
|
if (cl->auth)
|
|
|
|
QueueMessage (cl, "230 User logged in.\r\n");
|
|
|
|
else
|
|
|
|
QueueMessage (cl, "530 Username or Password was incorrect or otherwise invalid.\r\n");
|
|
|
|
}
|
|
|
|
else if (!stricmp(mode, "TYPE"))
|
|
|
|
{
|
|
|
|
if (!cl->auth)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "530 Not logged in.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
msg = COM_ParseOut(msg, resource, sizeof(resource));
|
|
|
|
|
|
|
|
if (!stricmp(resource, "A")) //ascii
|
|
|
|
{
|
2014-05-16 01:34:58 +00:00
|
|
|
QueueMessage (cl, "200 ascii selected.\r\n");
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
else if (!stricmp(resource, "I")) //binary
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "200 binary selected.\r\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-05-16 01:34:58 +00:00
|
|
|
QueueMessage (cl, "200 ascii selected.\r\n");
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!stricmp(mode, "PWD"))
|
|
|
|
{
|
|
|
|
if (!cl->auth)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "530 Not logged in.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
QueueMessageva (cl, "257 \"%s\"\r\n", cl->path);
|
|
|
|
}
|
|
|
|
else if (!stricmp(mode, "CWD"))
|
|
|
|
{
|
|
|
|
char *p;
|
|
|
|
if (!cl->auth)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "530 Not logged in.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
Q_strcpyline(cl->path, msg+1, sizeof(cl->path));//path starts after cmd and single space
|
|
|
|
for (p = cl->path+strlen(cl->path)-1; *p == ' ' && p >= cl->path; p--)
|
|
|
|
*p = '\0';
|
|
|
|
QueueMessage (cl, "200 directory changed.\r\n");
|
|
|
|
}
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
else if (!stricmp(mode, "EPSV"))
|
|
|
|
{
|
|
|
|
int aftype = 0;
|
|
|
|
//one argument, "1"=ipv4, "2"=ipv6. if not present, use same as control connection
|
|
|
|
//reply: "229 Entering Extended Passive Mode (|||$PORTNUM|)\r\n"
|
|
|
|
|
|
|
|
if (!cl->auth)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "530 Not logged in.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (cl->datasock != INVALID_SOCKET)
|
|
|
|
{
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
cl->datasock = INVALID_SOCKET;
|
|
|
|
}
|
|
|
|
|
|
|
|
cl->datasock = FTP_BeginListening(aftype, 0);
|
|
|
|
if (cl->datasock == INVALID_SOCKET)
|
|
|
|
QueueMessage (cl, "425 server was unable to make a listen socket\r\n");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FTP_SVSocketPortToString(cl->datasock, resource);
|
|
|
|
QueueMessageva (cl, "229 Entering Extended Passive Mode (|||%s|).\r\n", resource);
|
|
|
|
}
|
|
|
|
cl->dataislisten = true;
|
|
|
|
}
|
2004-08-23 01:40:25 +00:00
|
|
|
else if (!stricmp(mode, "PASV"))
|
|
|
|
{
|
|
|
|
if (!cl->auth)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "530 Not logged in.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (cl->datasock != INVALID_SOCKET)
|
|
|
|
{
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
cl->datasock = INVALID_SOCKET;
|
|
|
|
}
|
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
cl->datasock = FTP_BeginListening(1, 0);
|
2004-08-23 01:40:25 +00:00
|
|
|
if (cl->datasock == INVALID_SOCKET)
|
|
|
|
QueueMessage (cl, "425 server was unable to make a listen socket\r\n");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FTP_SVSocketToString(cl->datasock, resource);
|
|
|
|
QueueMessageva (cl, "227 Entering Passive Mode (%s).\r\n", resource);
|
|
|
|
}
|
|
|
|
cl->dataislisten = true;
|
|
|
|
}
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
// else if (!stricmp(mode, "EPRT"))
|
|
|
|
// {
|
|
|
|
//eg: one of:
|
|
|
|
//EPRT |1|132.235.1.2|6275|
|
|
|
|
//EPRT |2|1080::8:800:200C:417A|5282|
|
|
|
|
|
|
|
|
//reply: 522 Network protocol not supported, use (1,2)
|
|
|
|
// }
|
2004-08-23 01:40:25 +00:00
|
|
|
else if (!stricmp(mode, "PORT"))
|
|
|
|
{
|
|
|
|
if (!cl->auth)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "530 Not logged in.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (cl->datasock != INVALID_SOCKET)
|
|
|
|
{
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
cl->datasock = INVALID_SOCKET;
|
|
|
|
}
|
|
|
|
msg = COM_ParseOut(msg, resource, sizeof(resource));
|
|
|
|
|
|
|
|
cl->dataislisten = false;
|
|
|
|
|
|
|
|
if ((cl->datasock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
|
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
Sys_Error ("FTP_ServerThinkForConnection: socket: %s", strerror(neterrno()));
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
|
2011-05-19 13:34:07 +00:00
|
|
|
if (ioctlsocket (cl->datasock, FIONBIO, (u_long *)&_true) == -1)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
Sys_Error ("FTP_ServerThinkForConnection: ioctl FIONBIO: %s", strerror(neterrno()));
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
from.sin_family = AF_INET;
|
|
|
|
|
|
|
|
from.sin_addr.s_addr = INADDR_ANY;
|
|
|
|
|
|
|
|
from.sin_port = 0;
|
2011-05-19 13:34:07 +00:00
|
|
|
|
2004-08-23 01:40:25 +00:00
|
|
|
if( bind (cl->datasock, (void *)&from, sizeof(from)) == -1)
|
|
|
|
{
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
cl->datasock=INVALID_SOCKET;
|
|
|
|
|
|
|
|
QueueMessage (cl, "425 server bind error.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
2011-05-19 13:34:07 +00:00
|
|
|
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
fromlen = sizeof(from);
|
|
|
|
FTP_StringToAdr(resource, (qbyte *)&from.sin_addr, (qbyte *)&from.sin_port);
|
|
|
|
connect(cl->datasock, (struct sockaddr *)&from, fromlen);
|
|
|
|
|
|
|
|
QueueMessage (cl, "200 Opened data channel.\r\n");
|
|
|
|
}
|
|
|
|
else if (!stricmp(mode, "LIST"))
|
|
|
|
{
|
|
|
|
char buffer[256];
|
|
|
|
if (!cl->auth)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "530 Not logged in.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (cl->dataislisten) //accept a connect.
|
|
|
|
{
|
2011-05-20 04:10:46 +00:00
|
|
|
int err;
|
2007-09-04 20:54:24 +00:00
|
|
|
int _true = true;
|
2004-08-23 01:40:25 +00:00
|
|
|
int temp;
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
struct sockaddr_qstorage adr;
|
2004-08-23 01:40:25 +00:00
|
|
|
int adrlen = sizeof(adr);
|
|
|
|
temp = accept(cl->datasock, (struct sockaddr *)&adr, &adrlen);
|
2014-02-07 08:38:40 +00:00
|
|
|
err = neterrno();
|
2004-08-23 01:40:25 +00:00
|
|
|
closesocket(cl->datasock);
|
|
|
|
cl->datasock = temp;
|
|
|
|
cl->dataislisten = false;
|
|
|
|
|
|
|
|
if (cl->datasock == INVALID_SOCKET)
|
|
|
|
{
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
QueueMessageva (cl, "425 Can't accept pasv data connection - %i.\r\n", err);
|
2004-08-23 01:40:25 +00:00
|
|
|
continue;
|
|
|
|
}
|
2007-09-04 20:54:24 +00:00
|
|
|
else
|
2011-05-19 13:34:07 +00:00
|
|
|
ioctlsocket(cl->datasock, FIONBIO, (u_long *)&_true);
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
if (cl->datasock == INVALID_SOCKET)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "503 Bad sequence of commands.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (*cl->path == '/')
|
|
|
|
strcpy(buffer, cl->path+1);
|
|
|
|
else
|
|
|
|
strcpy(buffer, cl->path);
|
2004-12-08 04:14:52 +00:00
|
|
|
|
2008-01-28 13:27:30 +00:00
|
|
|
if (*buffer) //last character should be a /
|
2004-12-08 04:14:52 +00:00
|
|
|
if (buffer[strlen(buffer)-1] != '/')
|
|
|
|
strcat(buffer, "/");
|
|
|
|
|
2004-08-23 01:40:25 +00:00
|
|
|
strcat(buffer, "*");
|
|
|
|
QueueMessage (cl, "125 Opening FAKE ASCII mode data connection for file.\r\n");
|
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
COM_EnumerateFiles(buffer, SendFileNameTo, &cl->datasock);
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
QueueMessage (cl, "226 Transfer complete.\r\n");
|
|
|
|
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
cl->datasock = INVALID_SOCKET;
|
|
|
|
}
|
|
|
|
// else if (!stricmp(mode, "SIZE")) //why IE can't use the list command to find file length, I've no idea.
|
|
|
|
// {
|
|
|
|
// msg = COM_ParseOut(msg, resource, sizeof(resource));
|
|
|
|
// }
|
|
|
|
else if (!stricmp(mode, "RETR"))
|
|
|
|
{
|
|
|
|
if (!cl->auth)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "530 Not logged in.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (cl->dataislisten) //accept a connect.
|
|
|
|
{
|
2007-09-08 20:29:36 +00:00
|
|
|
int _true = true;
|
2004-08-23 01:40:25 +00:00
|
|
|
int temp;
|
|
|
|
struct sockaddr_in adr;
|
|
|
|
int adrlen = sizeof(adr);
|
|
|
|
temp = accept(cl->datasock, (struct sockaddr *)&adr, &adrlen);
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
cl->datasock = temp;
|
|
|
|
cl->dataislisten = false;
|
|
|
|
|
|
|
|
if (cl->datasock == INVALID_SOCKET)
|
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
QueueMessageva (cl, "425 Can't accept pasv data connection - %i.\r\n", neterrno());
|
2004-08-23 01:40:25 +00:00
|
|
|
continue;
|
|
|
|
}
|
2007-09-04 20:54:24 +00:00
|
|
|
else
|
2011-05-19 13:34:07 +00:00
|
|
|
ioctlsocket(cl->datasock, FIONBIO, (u_long *)&_true);
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
if (cl->datasock == INVALID_SOCKET)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "503 Bad sequence of commands.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
msg = COM_ParseOut(msg, resource, sizeof(resource));
|
|
|
|
|
2011-05-19 13:34:07 +00:00
|
|
|
if (!cl->auth & IWEBACC_READ)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
|
|
|
QueueMessage (cl, "550 No read access.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (!(*resource == '/'))
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
2013-05-03 04:28:08 +00:00
|
|
|
int plen = strlen(cl->path);
|
|
|
|
if (plen && cl->path[plen-1] != '/')
|
|
|
|
{
|
|
|
|
memmove(resource+plen+1, resource, strlen(resource)+1);
|
|
|
|
memcpy(resource, cl->path, plen);
|
|
|
|
resource[plen] = '/';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
memmove(resource+plen, resource, strlen(resource)+1);
|
|
|
|
memcpy(resource, cl->path, plen);
|
|
|
|
}
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
if (*resource == '/')
|
|
|
|
{
|
|
|
|
if (SV_AllowDownload(resource+1))
|
2005-12-22 02:29:11 +00:00
|
|
|
cl->file = FS_OpenVFS(resource+1, "rb", FS_GAME);
|
2004-08-23 01:40:25 +00:00
|
|
|
else
|
|
|
|
cl->file = IWebGenerateFile(resource+1, NULL, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (SV_AllowDownload(resource))
|
2005-12-22 02:29:11 +00:00
|
|
|
cl->file = FS_OpenVFS(resource, "rb", FS_GAME);
|
2004-08-23 01:40:25 +00:00
|
|
|
else
|
|
|
|
cl->file = IWebGenerateFile(resource, NULL, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!cl->file)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "550 File not found.\r\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ //send data
|
|
|
|
QueueMessage (cl, "125 Opening BINARY mode data connection for file.\r\n");
|
|
|
|
|
|
|
|
cl->datadir = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!stricmp(mode, "STOR"))
|
|
|
|
{
|
|
|
|
if (!cl->auth)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "530 Not logged in.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
Q_strcpyline(mode, msg+1, sizeof(mode));
|
|
|
|
|
|
|
|
|
|
|
|
if (!(cl->auth & IWEBACC_FULL) && (((cl->auth & IWEBACC_WRITE && !IWebAllowUpLoad(cl->path+1, cl->name)) || !(cl->auth & IWEBACC_WRITE))))
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "550 Permission denied.\r\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (cl->dataislisten) //accept a connect.
|
|
|
|
{
|
2007-09-08 20:29:36 +00:00
|
|
|
int _true = true;
|
2004-08-23 01:40:25 +00:00
|
|
|
int temp;
|
|
|
|
struct sockaddr_in adr;
|
|
|
|
int adrlen = sizeof(adr);
|
|
|
|
temp = accept(cl->datasock, (struct sockaddr *)&adr, &adrlen);
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
cl->datasock = temp;
|
|
|
|
cl->dataislisten = false;
|
|
|
|
|
|
|
|
if (cl->datasock == INVALID_SOCKET)
|
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
QueueMessageva (cl, "425 Can't accept pasv data connection - %i.\r\n", neterrno());
|
2004-08-23 01:40:25 +00:00
|
|
|
continue;
|
|
|
|
}
|
2007-09-04 20:54:24 +00:00
|
|
|
else
|
2011-05-19 13:34:07 +00:00
|
|
|
ioctlsocket(cl->datasock, FIONBIO, (u_long *)&_true);
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
if (cl->datasock == INVALID_SOCKET)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "502 Bad sequence of commands.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// msg = COM_ParseOut(msg, mode, sizeof(mode));
|
|
|
|
|
|
|
|
if (*mode == '/')
|
|
|
|
sprintf(resource, "%s%s", cl->path, mode);
|
|
|
|
else
|
|
|
|
sprintf(resource, "%s%s", cl->path, mode);
|
|
|
|
|
2005-12-22 02:29:11 +00:00
|
|
|
cl->file = FS_OpenVFS(resource, "rb", FS_GAMEONLY);
|
2004-08-23 01:40:25 +00:00
|
|
|
if (cl->file)
|
|
|
|
{
|
2005-12-22 02:29:11 +00:00
|
|
|
VFS_CLOSE(cl->file);
|
2004-08-23 01:40:25 +00:00
|
|
|
QueueMessage (cl, "550 File already exists.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
2005-12-22 02:29:11 +00:00
|
|
|
cl->file = FS_OpenVFS(resource, "wb", FS_GAME);
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
if (!cl->file)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "550 Couldn't open output.\r\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ //send data
|
|
|
|
QueueMessage (cl, "125 Opening BINARY mode data connection for input.\r\n");
|
|
|
|
|
|
|
|
cl->datadir = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!stricmp(mode, "STRU"))
|
|
|
|
{
|
|
|
|
if (!cl->auth)
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "530 Not logged in.\r\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
msg = COM_ParseOut(msg, resource, sizeof(resource));
|
|
|
|
if (!strcmp(resource, "F"))
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "200 recordless structure selected.\r\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "504 not implemented (it's a simple server).\r\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!stricmp(mode, "NOOP"))
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "200 Do something then!\r\n");
|
|
|
|
}
|
|
|
|
else if (!stricmp(mode, "QUIT"))
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "200 About to quit.\r\n");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
QueueMessage (cl, "502 Command not implemented.\r\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(WEBSVONLY) && defined(_WIN32)
|
|
|
|
unsigned int WINAPI BlockingClient(FTPclient_t *cl)
|
|
|
|
{
|
|
|
|
unsigned long _false = false;
|
|
|
|
if (ioctlsocket (cl->controlsock, FIONBIO, &_false) == -1)
|
|
|
|
{
|
|
|
|
IWebPrintf ("FTP_ServerRun: blocking error: %s\n", strerror(qerrno));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
cl->blocking = true;
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
while (!FTP_ServerThinkForConnection(cl))
|
|
|
|
{
|
|
|
|
Sleep(10);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cl->file)
|
2005-12-22 02:29:11 +00:00
|
|
|
VFS_CLOSE(cl->file);
|
2004-08-23 01:40:25 +00:00
|
|
|
closesocket(cl->controlsock);
|
|
|
|
if (cl->datasock)
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
|
|
|
|
IWebFree(cl);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-09-17 20:35:39 +00:00
|
|
|
iwboolean FTP_ServerRun(iwboolean ftpserverwanted, int port)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
|
|
|
FTPclient_t *cl, *prevcl;
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
struct sockaddr_qstorage from;
|
2004-08-23 01:40:25 +00:00
|
|
|
int fromlen;
|
2014-02-07 08:38:40 +00:00
|
|
|
SOCKET clientsock;
|
2004-08-23 01:40:25 +00:00
|
|
|
unsigned long _true = true;
|
|
|
|
|
|
|
|
if (!ftpserverinitied)
|
|
|
|
{
|
|
|
|
if (ftpserverwanted)
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
{
|
|
|
|
ftpserversocket = FTP_BeginListening(0, port);
|
|
|
|
if (ftpserversocket == INVALID_SOCKET)
|
|
|
|
{
|
|
|
|
ftpserverfailed = true;
|
|
|
|
IWebPrintf("Unable to establish listening FTP socket\n");
|
|
|
|
}
|
|
|
|
ftpserverinitied = true;
|
|
|
|
}
|
2004-08-23 01:40:25 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else if (!ftpserverwanted)
|
|
|
|
{
|
|
|
|
FTP_ServerShutdown();
|
|
|
|
return false;
|
|
|
|
}
|
2011-05-19 13:34:07 +00:00
|
|
|
|
2004-08-23 01:40:25 +00:00
|
|
|
prevcl = NULL;
|
|
|
|
for (cl = FTPclient; cl; cl = cl->next)
|
|
|
|
{
|
|
|
|
if (FTP_ServerThinkForConnection(cl))
|
|
|
|
{
|
|
|
|
if (cl->file)
|
2005-12-22 02:29:11 +00:00
|
|
|
VFS_CLOSE(cl->file);
|
2004-08-23 01:40:25 +00:00
|
|
|
closesocket(cl->controlsock);
|
|
|
|
if (cl->datasock)
|
|
|
|
closesocket(cl->datasock);
|
|
|
|
|
|
|
|
if (prevcl)
|
|
|
|
{
|
|
|
|
prevcl->next = cl->next;
|
|
|
|
IWebFree(cl);
|
|
|
|
cl = prevcl;
|
|
|
|
|
|
|
|
if (!cl) //kills loop
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FTPclient = cl->next;
|
|
|
|
IWebFree(cl);
|
|
|
|
cl = FTPclient;
|
|
|
|
|
|
|
|
if (!cl) //kills loop
|
|
|
|
break;
|
2011-05-19 13:34:07 +00:00
|
|
|
}
|
2004-08-23 01:40:25 +00:00
|
|
|
}
|
|
|
|
prevcl = cl;
|
|
|
|
}
|
|
|
|
|
|
|
|
fromlen = sizeof(from);
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
if (ftpserversocket == INVALID_SOCKET)
|
|
|
|
clientsock = INVALID_SOCKET;
|
|
|
|
else
|
|
|
|
clientsock = accept(ftpserversocket, (struct sockaddr *)&from, &fromlen);
|
2004-08-23 01:40:25 +00:00
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
if (clientsock == INVALID_SOCKET)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
int e = neterrno();
|
|
|
|
if (e == NET_EWOULDBLOCK)
|
2004-08-23 01:40:25 +00:00
|
|
|
return false;
|
|
|
|
|
2014-02-07 08:38:40 +00:00
|
|
|
if (e == NET_ECONNABORTED || e == NET_ECONNRESET)
|
2004-08-23 01:40:25 +00:00
|
|
|
{
|
2013-11-29 14:36:47 +00:00
|
|
|
Con_TPrintf ("Connection lost or aborted\n");
|
2004-08-23 01:40:25 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-02-07 08:38:40 +00:00
|
|
|
Con_Printf ("NET_GetPacket: %s\n", strerror(e));
|
2004-08-23 01:40:25 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ioctlsocket (clientsock, FIONBIO, &_true) == -1)
|
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
IWebPrintf ("FTP_ServerRun: blocking error: %s\n", strerror(neterrno()));
|
2004-08-23 01:40:25 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
cl = IWebMalloc(sizeof(FTPclient_t));
|
|
|
|
if (!cl) //iwebmalloc is allowed to fail.
|
|
|
|
{
|
|
|
|
char *msg = "421 Not enough memory is allocated.\r\n"; //don't be totally anti social
|
|
|
|
send(clientsock, msg, strlen(msg), 0);
|
|
|
|
closesocket(clientsock); //try to forget this ever happend
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
char resource[256];
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
FTP_SVRemoteSocketToString(clientsock, resource, sizeof(resource));
|
2004-08-23 01:40:25 +00:00
|
|
|
IWebPrintf("FTP connect from %s\n", resource);
|
|
|
|
}
|
|
|
|
cl->controlsock = clientsock;
|
|
|
|
cl->datasock = INVALID_SOCKET;
|
|
|
|
cl->next = FTPclient;
|
|
|
|
cl->blocking = false;
|
|
|
|
strcpy(cl->path, "/");
|
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
QueueMessage(cl, "220-" FULLENGINENAME " FTP Server.\r\n220 Welcomes all new users.\r\n");
|
2004-08-23 01:40:25 +00:00
|
|
|
|
|
|
|
#if defined(WEBSVONLY) && defined(_WIN32)
|
|
|
|
if (!CreateThread(NULL, 128, BlockingClient, cl, 0, NULL))
|
|
|
|
#endif
|
|
|
|
FTPclient = cl;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|