Try to clean up a few things in the hopes of making Eukara's efforts easier. That or just to give him conflicts.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5081 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
e200777d6a
commit
5e58832acf
|
@ -4838,7 +4838,7 @@ void Host_DoRunFile(hrf_t *f)
|
||||||
qboolean Host_RunFile(const char *fname, int nlen, vfsfile_t *file)
|
qboolean Host_RunFile(const char *fname, int nlen, vfsfile_t *file)
|
||||||
{
|
{
|
||||||
hrf_t *f;
|
hrf_t *f;
|
||||||
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT)
|
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT) && !defined(_XBOX)
|
||||||
//win32 file urls are basically fucked, so defer to the windows api.
|
//win32 file urls are basically fucked, so defer to the windows api.
|
||||||
char utf8[MAX_OSPATH*3];
|
char utf8[MAX_OSPATH*3];
|
||||||
if (nlen >= 7 && !strncmp(fname, "file://", 7))
|
if (nlen >= 7 && !strncmp(fname, "file://", 7))
|
||||||
|
@ -5664,7 +5664,7 @@ void Host_FinishLoading(void)
|
||||||
"\n"
|
"\n"
|
||||||
"See the GNU General Public License for more details.\n");
|
"See the GNU General Public License for more details.\n");
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(FTE_SDL) && defined(WEBCLIENT)
|
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(_XBOX) && defined(WEBCLIENT)
|
||||||
if (Sys_RunInstaller())
|
if (Sys_RunInstaller())
|
||||||
Sys_Quit();
|
Sys_Quit();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -562,24 +562,8 @@ void SV_Master_Shutdown (void)
|
||||||
//remove dead servers.
|
//remove dead servers.
|
||||||
//master was polled a minute ago and server was not on list - server on multiple masters would be awkward.
|
//master was polled a minute ago and server was not on list - server on multiple masters would be awkward.
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include "winquake.h"
|
|
||||||
#else
|
|
||||||
typedef int SOCKET;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "netinc.h"
|
#include "netinc.h"
|
||||||
|
|
||||||
#ifdef AF_IPX
|
|
||||||
#define USEIPX
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(_XBOX)
|
|
||||||
#undef TCPCONNECT
|
|
||||||
#undef IPPROTO_IPV6
|
|
||||||
#undef USEIPX
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//the number of servers should be limited only by memory.
|
//the number of servers should be limited only by memory.
|
||||||
|
|
||||||
cvar_t slist_cacheinfo = CVAR("slist_cacheinfo", "0"); //this proves dangerous, memory wise.
|
cvar_t slist_cacheinfo = CVAR("slist_cacheinfo", "0"); //this proves dangerous, memory wise.
|
||||||
|
|
|
@ -1,7 +1,178 @@
|
||||||
#include <xtl.h>
|
|
||||||
#include "quakedef.h"
|
#include "quakedef.h"
|
||||||
|
#include <xtl.h>
|
||||||
|
|
||||||
void main( int argc, char **argv) {
|
|
||||||
|
/*Timers, supposedly xbox supports QueryPerformanceCounter stuff*/
|
||||||
|
double Sys_DoubleTime (void)
|
||||||
|
{
|
||||||
|
static int first = 1;
|
||||||
|
static LARGE_INTEGER qpcfreq;
|
||||||
|
LARGE_INTEGER PerformanceCount;
|
||||||
|
static LONGLONG oldcall;
|
||||||
|
static LONGLONG firsttime;
|
||||||
|
LONGLONG diff;
|
||||||
|
|
||||||
|
QueryPerformanceCounter (&PerformanceCount);
|
||||||
|
if (first)
|
||||||
|
{
|
||||||
|
first = 0;
|
||||||
|
QueryPerformanceFrequency(&qpcfreq);
|
||||||
|
firsttime = PerformanceCount.QuadPart;
|
||||||
|
diff = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
diff = PerformanceCount.QuadPart - oldcall;
|
||||||
|
if (diff >= 0)
|
||||||
|
oldcall = PerformanceCount.QuadPart;
|
||||||
|
return (oldcall - firsttime) / (double)qpcfreq.QuadPart;
|
||||||
|
}
|
||||||
|
unsigned int Sys_Milliseconds (void)
|
||||||
|
{
|
||||||
|
return Sys_DoubleTime()*1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
NORETURN void VARGS Sys_Error (const char *error, ...)
|
||||||
|
{
|
||||||
|
//FIXME: panic! everyone panic!
|
||||||
|
//you might want to figure out some way to display the message...
|
||||||
|
for(;;)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Sys_Sleep(double seconds)
|
||||||
|
{ //yields to other processes/threads for a bit.
|
||||||
|
}
|
||||||
|
|
||||||
|
void Sys_Quit (void)
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
Host_Shutdown ();
|
||||||
|
//successful execution.
|
||||||
|
//should go back to the system menu or something, or possibly longjmp out of the main loop.
|
||||||
|
for (;;)
|
||||||
|
;
|
||||||
|
exit(1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void Sys_Shutdown(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void Sys_Init(void)
|
||||||
|
{ //register system-specific cvars here
|
||||||
|
}
|
||||||
|
|
||||||
|
/*prints to dedicated server console or debug output*/
|
||||||
|
void VARGS Sys_Printf (char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list argptr;
|
||||||
|
char msg[MAXPRINTMSG];
|
||||||
|
|
||||||
|
va_start (argptr,fmt);
|
||||||
|
_vsnprintf (msg,sizeof(msg)-1, fmt,argptr);
|
||||||
|
msg[sizeof(msg)-1] = 0; //_vsnprintf sucks.
|
||||||
|
va_end (argptr);
|
||||||
|
|
||||||
|
//no idea what the stdout is hooked up to, lets try it anyway.
|
||||||
|
printf("%s", msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*returns the system video mode settings, ish*/
|
||||||
|
qboolean Sys_GetDesktopParameters(int *width, int *height, int *bpp, int *refreshrate)
|
||||||
|
{
|
||||||
|
//FIXME: use XGetVideoStandard or XGetVideoFlags or something
|
||||||
|
*width = 640;
|
||||||
|
*height = 480;
|
||||||
|
*bpp = 32;
|
||||||
|
*refreshrate = 60;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*dedicated server type stuff*/
|
||||||
|
qboolean Sys_InitTerminal(void)
|
||||||
|
{
|
||||||
|
return false; //failure
|
||||||
|
}
|
||||||
|
void Sys_CloseTerminal (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
char *Sys_ConsoleInput (void)
|
||||||
|
{ //returns any text typed on the stdin, when acting as a dedicated server.
|
||||||
|
//this includes debugger commands if we're integrated with fteqccgui
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*various system notifications*/
|
||||||
|
void Sys_ServerActivity(void)
|
||||||
|
{ //player joined the server or said something. would normally flash the app in the system tray.
|
||||||
|
}
|
||||||
|
|
||||||
|
/*check any system message queues here*/
|
||||||
|
void Sys_SendKeyEvents(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
qboolean Sys_RandomBytes(qbyte *string, int len)
|
||||||
|
{
|
||||||
|
//FIXME: should return some cryptographically strong random number data from some proper crypto library. C's rand function isn't really strong enough.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*filesystem stuff*/
|
||||||
|
void Sys_mkdir (char *path)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
qboolean Sys_remove (char *path)
|
||||||
|
{
|
||||||
|
return false; //false for failure
|
||||||
|
}
|
||||||
|
qboolean Sys_Rename (char *oldfname, char *newfname)
|
||||||
|
{
|
||||||
|
return false; //false for failure
|
||||||
|
}
|
||||||
|
int Sys_EnumerateFiles (const char *gpath, const char *match, int (QDECL *func)(const char *fname, qofs_t fsize, void *parm, searchpathfuncs_t *spath), void *parm, searchpathfuncs_t *spath)
|
||||||
|
{
|
||||||
|
//if func returns false, abort with false return value, otherwise return true.
|
||||||
|
//use wildcmd to compare two filenames
|
||||||
|
//note that match may contain wildcards and multiple directories with multiple wildcards all over.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*consoles don't tend to need system clipboards, so this is fully internal to our engine*/
|
||||||
|
#define SYS_CLIPBOARD_SIZE 256
|
||||||
|
static char clipboard_buffer[SYS_CLIPBOARD_SIZE] = {0};
|
||||||
|
char *Sys_GetClipboard(void)
|
||||||
|
{
|
||||||
|
return clipboard_buffer;
|
||||||
|
}
|
||||||
|
void Sys_CloseClipboard(char *bf)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void Sys_SaveClipboard(char *text)
|
||||||
|
{
|
||||||
|
Q_strncpyz(clipboard_buffer, text, SYS_CLIPBOARD_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*dynamic library stubs*/
|
||||||
|
dllhandle_t *Sys_LoadLibrary(const char *name, dllfunction_t *funcs)
|
||||||
|
{
|
||||||
|
Con_Printf("Sys_LoadLibrary: %s\n", name);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
void Sys_CloseLibrary(dllhandle_t *lib)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void *Sys_GetAddressForName(dllhandle_t *module, const char *exportname)
|
||||||
|
{
|
||||||
|
return NULL; //unsupported
|
||||||
|
}
|
||||||
|
char *Sys_GetNameForAddress(dllhandle_t *module, void *address)
|
||||||
|
{
|
||||||
|
return NULL; //unsupported (on most platforms, actually)
|
||||||
|
}
|
||||||
|
|
||||||
|
void main( int argc, char **argv)
|
||||||
|
{
|
||||||
float time, lasttime;
|
float time, lasttime;
|
||||||
quakeparms_t parms;
|
quakeparms_t parms;
|
||||||
|
|
||||||
|
@ -23,3 +194,47 @@ void main( int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*input stubs
|
||||||
|
in_generic.c should make these kinda useless, but sometimes you need more than the following three functions:
|
||||||
|
void IN_JoystickAxisEvent(unsigned int devid, int axis, float value);
|
||||||
|
void IN_KeyEvent(unsigned int devid, int down, int keycode, int unicode);
|
||||||
|
void IN_MouseMove(unsigned int devid, int abs, float x, float y, float z, float size);
|
||||||
|
that said, if they're enough, then just call those in Sys_SendKeyEvents. You can also call them from other threads just fine.
|
||||||
|
their devid values should be assigned only when a button is first pressed, or something, so controllers get assigned to seats in the order that they're pressed. so player 1 always hits a button first to ensure that they are player 1.
|
||||||
|
or just hardcode those based upon usbport numbers, but that's unreliable with usb hubs.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void INS_Shutdown (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void INS_ReInit (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void INS_Move(float *movements, int pnum)
|
||||||
|
{
|
||||||
|
//accululates system-specific inputs on a per-seat basis.
|
||||||
|
}
|
||||||
|
void INS_Init (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void INS_Accumulate(void) //input polling
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void INS_Commands (void) //used to Cbuf_AddText joystick button events in windows.
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void INS_EnumerateDevices(void *ctx, void(*callback)(void *ctx, const char *type, const char *devicename, unsigned int *qdevid))
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
unsigned int i;
|
||||||
|
for (i = 0; i < MAX_JOYSTICKS; i++)
|
||||||
|
if (sdljoy[i].controller)
|
||||||
|
callback(ctx, "joy", sdljoy[i].devname, &sdljoy[i].qdevid);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include <WinSockX.h>
|
#include <WinSockX.h>
|
||||||
#else
|
#else
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winsock2.h>
|
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
#include <mmreg.h>
|
#include <mmreg.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -109,7 +109,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#if !defined(NO_DIRECTX) && !defined(NODIRECTX) && defined(_WIN32)
|
#if !defined(NO_DIRECTX) && !defined(NODIRECTX) && defined(_WIN32)
|
||||||
#define AVAIL_DINPUT
|
#define AVAIL_DINPUT
|
||||||
#define AVAIL_DSOUND
|
#define AVAIL_DSOUND
|
||||||
#undef AVAIL_WASAPI
|
#define AVAIL_WASAPI
|
||||||
#endif
|
#endif
|
||||||
#ifdef WINRT
|
#ifdef WINRT
|
||||||
#define AVAIL_XAUDIO2
|
#define AVAIL_XAUDIO2
|
||||||
|
@ -117,7 +117,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#define AVAIL_XZDEC
|
#define AVAIL_XZDEC
|
||||||
|
|
||||||
#if !defined(MINIMAL) && !defined(NPFTE) && !defined(NPQTV)
|
#if !defined(MINIMAL) && !defined(NPFTE) && !defined(NPQTV)
|
||||||
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT)
|
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT) && !defined(_XBOX)
|
||||||
#if !defined(_MSC_VER) || _MSC_VER > 1200
|
#if !defined(_MSC_VER) || _MSC_VER > 1200
|
||||||
#define HAVE_WINSSPI //built in component, checks against windows' root ca database and revocations etc.
|
#define HAVE_WINSSPI //built in component, checks against windows' root ca database and revocations etc.
|
||||||
#endif
|
#endif
|
||||||
|
@ -125,9 +125,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#define HAVE_GNUTLS //currently disabled as it does not validate the server's certificate, beware the mitm attack.
|
#define HAVE_GNUTLS //currently disabled as it does not validate the server's certificate, beware the mitm attack.
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_WINSSPI) || defined(HAVE_GNUTLS)
|
|
||||||
#define HAVE_SSL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//#define DYNAMIC_ZLIB
|
//#define DYNAMIC_ZLIB
|
||||||
//#define DYNAMIC_LIBPNG
|
//#define DYNAMIC_LIBPNG
|
||||||
|
@ -164,6 +161,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#undef AVAIL_WASAPI //wasapi is available in the vista sdk, while that's compatible with earlier versions, its not really expected until 2008
|
#undef AVAIL_WASAPI //wasapi is available in the vista sdk, while that's compatible with earlier versions, its not really expected until 2008
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define HAVE_TCP //says we can use tcp too (either ipv4 or ipv6)
|
||||||
|
#define HAVE_PACKET //if we have the socket api at all...
|
||||||
|
|
||||||
//set any additional defines or libs in win32
|
//set any additional defines or libs in win32
|
||||||
#define LOADERTHREAD
|
#define LOADERTHREAD
|
||||||
|
|
||||||
|
@ -198,10 +198,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#undef AVAIL_JPEGLIB
|
#undef AVAIL_JPEGLIB
|
||||||
#undef AVAIL_XZDEC
|
#undef AVAIL_XZDEC
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(MULTITHREAD) //always thread on win32 non-minimal builds
|
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(MULTITHREAD) && !defined(_XBOX) //always thread on win32 non-minimal builds
|
||||||
#ifndef _XBOX
|
|
||||||
#define MULTITHREAD
|
#define MULTITHREAD
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
#elif defined(MINIMAL)
|
#elif defined(MINIMAL)
|
||||||
#define QUAKESTATS
|
#define QUAKESTATS
|
||||||
|
@ -258,10 +256,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#define PSKMODELS //PSK model format (ActorX stuff from UT, though not the format the game itself uses)
|
#define PSKMODELS //PSK model format (ActorX stuff from UT, though not the format the game itself uses)
|
||||||
#define HALFLIFEMODELS //halflife model support (experimental)
|
#define HALFLIFEMODELS //halflife model support (experimental)
|
||||||
#define INTERQUAKEMODELS
|
#define INTERQUAKEMODELS
|
||||||
|
|
||||||
#ifndef _XBOX
|
|
||||||
#define RAGDOLL
|
#define RAGDOLL
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HUFFNETWORK //huffman network compression
|
#define HUFFNETWORK //huffman network compression
|
||||||
#define DOOMWADS //doom wad/sprite support
|
#define DOOMWADS //doom wad/sprite support
|
||||||
|
@ -404,7 +399,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#undef HAVE_SPEECHTOTEXT //windows speech-to-text thing
|
#undef HAVE_SPEECHTOTEXT //windows speech-to-text thing
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_XBOX)
|
||||||
|
#undef HAVE_TCP //FIXME
|
||||||
|
#undef HAVE_PACKET //FIXME
|
||||||
|
#undef SUPPORT_ICE //screw that
|
||||||
|
#undef PLUGINS //would need LoadLibrary working properly.
|
||||||
|
|
||||||
|
#undef AVAIL_DINPUT //xbox apparently only really does controllers.
|
||||||
|
#undef AVAIL_DSOUND //FIXME
|
||||||
|
#undef TEXTEDITOR //its hard to edit text when you have just a controller (and no onscreen keyboard)
|
||||||
|
#undef RAGDOLL //needs a proper physics engine
|
||||||
|
#undef AVAIL_MP3_ACM //api not supported
|
||||||
|
#undef HAVE_SPEECHTOTEXT //api not supported
|
||||||
|
#undef MULTITHREAD //no CreateThread stuff.
|
||||||
|
#undef SUBSERVERS //single-process.
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef FTE_TARGET_WEB
|
#ifdef FTE_TARGET_WEB
|
||||||
|
//sandboxing...
|
||||||
|
#undef HAVE_TCP //websockets are not real tcp.
|
||||||
|
#undef HAVE_PACKET //no udp support
|
||||||
|
|
||||||
//try to trim the fat
|
//try to trim the fat
|
||||||
#undef VOICECHAT //too lazy to compile speex
|
#undef VOICECHAT //too lazy to compile speex
|
||||||
#undef HLCLIENT //dlls...
|
#undef HLCLIENT //dlls...
|
||||||
|
@ -437,6 +452,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
// #undef RTLIGHTS
|
// #undef RTLIGHTS
|
||||||
#endif
|
#endif
|
||||||
#ifdef WINRT
|
#ifdef WINRT
|
||||||
|
//microsoft do not support winsock any more.
|
||||||
|
#undef HAVE_TCP
|
||||||
|
#undef HAVE_PACKET
|
||||||
|
|
||||||
#undef TCPCONNECT //err...
|
#undef TCPCONNECT //err...
|
||||||
#undef IRCCONNECT //not happening
|
#undef IRCCONNECT //not happening
|
||||||
#undef AVAIL_DSOUND //yeah, good luck there
|
#undef AVAIL_DSOUND //yeah, good luck there
|
||||||
|
@ -456,6 +475,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#define GLESONLY //should reduce the conditions a little
|
#define GLESONLY //should reduce the conditions a little
|
||||||
#endif
|
#endif
|
||||||
#if defined(NACL)
|
#if defined(NACL)
|
||||||
|
//stuff is sandboxed.
|
||||||
|
#undef HAVE_TCP //websockets are not true tcp
|
||||||
|
#undef HAVE_PACKET //no udp support.
|
||||||
|
|
||||||
#undef SUPPORT_ICE
|
#undef SUPPORT_ICE
|
||||||
#undef CL_MASTER //no sockets support
|
#undef CL_MASTER //no sockets support
|
||||||
#undef SV_MASTER //noone uses this anyway
|
#undef SV_MASTER //noone uses this anyway
|
||||||
|
@ -472,6 +495,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#undef USE_MYSQL
|
#undef USE_MYSQL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_WINSSPI) || defined(HAVE_GNUTLS)
|
||||||
|
#define HAVE_SSL
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(USE_SQLITE) || defined(USE_MYSQL)
|
#if defined(USE_SQLITE) || defined(USE_MYSQL)
|
||||||
#define SQL
|
#define SQL
|
||||||
#endif
|
#endif
|
||||||
|
@ -529,6 +556,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#undef SUPPORT_ICE //depends upon zlib's crc32 for fingerprinting. I cba writing my own.
|
#undef SUPPORT_ICE //depends upon zlib's crc32 for fingerprinting. I cba writing my own.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_TCP
|
||||||
|
#undef TCPCONNECT
|
||||||
|
#undef IRCCONNECT
|
||||||
|
#undef WEBSERVER
|
||||||
|
#undef WEBCLIENT
|
||||||
|
#endif
|
||||||
|
#ifndef HAVE_PACKET
|
||||||
|
#undef SV_MASTER
|
||||||
|
#undef CL_MASTER
|
||||||
|
#undef SUPPORT_ICE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef SERVERONLY //remove options that don't make sense on only a server
|
#ifdef SERVERONLY //remove options that don't make sense on only a server
|
||||||
#undef Q2CLIENT
|
#undef Q2CLIENT
|
||||||
#undef Q3CLIENT
|
#undef Q3CLIENT
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
|
#ifndef NETINC_INCLUDED
|
||||||
|
#define NETINC_INCLUDED
|
||||||
|
|
||||||
#if !defined(NACL) && !defined(FTE_TARGET_WEB) && !defined(WINRT)
|
|
||||||
#define HAVE_IPV4 //says we can send and receive AF_INET ipv4 udp packets.
|
|
||||||
#define HAVE_TCP //says we can use tcp too (either ipv4 or ipv6)
|
|
||||||
#define HAVE_PACKET //if we have the socket api at all...
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_PACKET
|
#ifndef HAVE_PACKET
|
||||||
|
|
||||||
|
@ -36,26 +33,23 @@
|
||||||
#define ntohl BigLong
|
#define ntohl BigLong
|
||||||
|
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
#ifdef _MSC_VER
|
|
||||||
#define USEIPX
|
|
||||||
#endif
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
#include <xtl.h>
|
#include <xtl.h>
|
||||||
#include <WinSockX.h>
|
#include <WinSockX.h>
|
||||||
#else
|
#else
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define USEIPX
|
||||||
|
#endif
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#endif
|
|
||||||
// #include "winquake.h"
|
|
||||||
#ifndef _XBOX
|
|
||||||
#ifdef USEIPX
|
#ifdef USEIPX
|
||||||
#include "wsipx.h"
|
#include "wsipx.h"
|
||||||
#endif
|
#endif
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifndef IPPROTO_IPV6
|
#if !defined(IPPROTO_IPV6) && !defined(_XBOX)
|
||||||
/*for msvc6*/
|
/*for msvc6*/
|
||||||
#define IPPROTO_IPV6 41
|
#define IPPROTO_IPV6 41
|
||||||
|
|
||||||
|
@ -110,6 +104,11 @@
|
||||||
#ifndef IPV6_V6ONLY
|
#ifndef IPV6_V6ONLY
|
||||||
#define IPV6_V6ONLY 27
|
#define IPV6_V6ONLY 27
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define HAVE_IPV4
|
||||||
|
#ifdef IPPROTO_IPV6
|
||||||
|
#define HAVE_IPV6
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -141,7 +140,14 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(AF_INET6) && !defined(IPPROTO_IPV6)
|
#if defined(AF_INET6) && !defined(IPPROTO_IPV6)
|
||||||
#define IPPROTO_IPV6 IPPROTO_IPV6
|
#define IPPROTO_IPV6 IPPROTO_IPV6 //fte often just checks to see if IPPROTO_IPV6 is defined or not, which doesn't work if its an enum value or somesuch...
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(AF_INET)
|
||||||
|
#define HAVE_IPV4
|
||||||
|
#endif
|
||||||
|
#ifdef IPPROTO_IPV6
|
||||||
|
#define HAVE_IPV6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SOCKET int
|
#define SOCKET int
|
||||||
|
@ -314,3 +320,5 @@ vfsfile_t *FS_OpenTCP(const char *name, int defaultport);
|
||||||
#ifndef SOCK_CLOEXEC
|
#ifndef SOCK_CLOEXEC
|
||||||
#define SOCK_CLOEXEC 0
|
#define SOCK_CLOEXEC 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif //NETINC_INCLUDED
|
||||||
|
|
|
@ -940,12 +940,6 @@ static int Plug_NewStreamHandle(plugstream_e type)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_XBOX)
|
|
||||||
#undef TCPCONNECT
|
|
||||||
#undef IPPROTO_IPV6
|
|
||||||
#undef USEIPX
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_PACKET
|
#ifdef HAVE_PACKET
|
||||||
//EBUILTIN(int, NET_TCPListen, (char *ip, int port, int maxcount));
|
//EBUILTIN(int, NET_TCPListen, (char *ip, int port, int maxcount));
|
||||||
//returns a new socket with listen enabled.
|
//returns a new socket with listen enabled.
|
||||||
|
|
|
@ -111,13 +111,11 @@ extern int isPlugin; //if 2, we were invoked by a debugger, and we need to give
|
||||||
static int debuggerstacky;
|
static int debuggerstacky;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(FTE_SDL)
|
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(_XBOX)
|
||||||
#ifndef _XBOX
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
void INS_UpdateGrabs(int fullscreen, int activeapp);
|
void INS_UpdateGrabs(int fullscreen, int activeapp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int QCLibEditor(pubprogfuncs_t *prinst, const char *filename, int *line, int *statement, char *error, pbool fatal);
|
int QCLibEditor(pubprogfuncs_t *prinst, const char *filename, int *line, int *statement, char *error, pbool fatal);
|
||||||
void QCLoadBreakpoints(const char *vmname, const char *progsname)
|
void QCLoadBreakpoints(const char *vmname, const char *progsname)
|
||||||
{ //this asks the gui to reapply any active breakpoints and waits for them so that any spawn functions can be breakpointed properly.
|
{ //this asks the gui to reapply any active breakpoints and waits for them so that any spawn functions can be breakpointed properly.
|
||||||
|
@ -307,7 +305,8 @@ qboolean QCExternalDebuggerCommand(char *text)
|
||||||
|
|
||||||
int QDECL QCEditor (pubprogfuncs_t *prinst, const char *filename, int *line, int *statement, char *reason, pbool fatal)
|
int QDECL QCEditor (pubprogfuncs_t *prinst, const char *filename, int *line, int *statement, char *reason, pbool fatal)
|
||||||
{
|
{
|
||||||
#if defined(_WIN32) && !defined(SERVERONLY) && !defined(FTE_SDL) && !defined(_XBOX)
|
#ifndef SERVERONLY
|
||||||
|
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(_XBOX)
|
||||||
if (isPlugin >= 2)
|
if (isPlugin >= 2)
|
||||||
{
|
{
|
||||||
if (wantquit)
|
if (wantquit)
|
||||||
|
@ -368,6 +367,7 @@ int QDECL QCEditor (pubprogfuncs_t *prinst, const char *filename, int *line, int
|
||||||
return debuggerresume;
|
return debuggerresume;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef TEXTEDITOR
|
#ifdef TEXTEDITOR
|
||||||
return QCLibEditor(prinst, filename, line, statement, reason, fatal);
|
return QCLibEditor(prinst, filename, line, statement, reason, fatal);
|
||||||
|
|
|
@ -172,7 +172,7 @@ void NPQTV_Sys_MainLoop(void);
|
||||||
#define UPD_STABLE 1
|
#define UPD_STABLE 1
|
||||||
#define UPD_TESTING 2
|
#define UPD_TESTING 2
|
||||||
|
|
||||||
#if defined(WEBCLIENT) && defined(_WIN32) && !defined(SERVERONLY)
|
#if defined(WEBCLIENT) && defined(_WIN32) && !defined(SERVERONLY) && !defined(_XBOX)
|
||||||
int StartLocalServer(int close);
|
int StartLocalServer(int close);
|
||||||
|
|
||||||
#define HAVEAUTOUPDATE
|
#define HAVEAUTOUPDATE
|
||||||
|
|
|
@ -28,27 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#pragma warning(disable : 4051) // ALPHA
|
#pragma warning(disable : 4051) // ALPHA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#ifndef WIN32_BLOATED
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _XBOX
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(WINAPI_FAMILY) && !defined(WINRT)
|
|
||||||
#if WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
|
|
||||||
//don't just define it. things that don't #include winquake.h / glquake.h need it too.
|
|
||||||
#error "WINRT needs to be defined for non-desktop"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef APIENTRY
|
|
||||||
#define APIENTRY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs);
|
void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs);
|
||||||
qboolean BoundsIntersect (vec3_t mins1, vec3_t maxs1, vec3_t mins2, vec3_t maxs2);
|
qboolean BoundsIntersect (vec3_t mins1, vec3_t maxs1, vec3_t mins2, vec3_t maxs2);
|
||||||
void ClearBounds (vec3_t mins, vec3_t maxs);
|
void ClearBounds (vec3_t mins, vec3_t maxs);
|
||||||
|
@ -102,6 +81,13 @@ void Mod_LightmapAllocBlock(lmalloc_t *lmallocator, int w, int h, unsigned short
|
||||||
#define GLclampd GLclampf
|
#define GLclampd GLclampf
|
||||||
#define GLdouble GLfloat
|
#define GLdouble GLfloat
|
||||||
#else
|
#else
|
||||||
|
#ifdef _WIN32 //windows might use the standard header filename, but it still requires that we manually include windows.h first.
|
||||||
|
#ifndef WIN32_BLOATED
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#ifdef GL_STATIC
|
#ifdef GL_STATIC
|
||||||
#define GL_GLEXT_PROTOTYPES
|
#define GL_GLEXT_PROTOTYPES
|
||||||
|
@ -109,6 +95,10 @@ void Mod_LightmapAllocBlock(lmalloc_t *lmallocator, int w, int h, unsigned short
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
// #include <GL/glu.h>
|
// #include <GL/glu.h>
|
||||||
|
|
||||||
|
#ifndef APIENTRY
|
||||||
|
#define APIENTRY //our code decorates function pointers with this for windows, so make sure it exists on systems that don't need it.
|
||||||
|
#endif
|
||||||
#include "glsupp.h"
|
#include "glsupp.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
#ifdef WEBSVONLY
|
#ifdef WEBSVONLY
|
||||||
|
|
||||||
#include "quakedef.h"
|
#include "quakedef.h"
|
||||||
#ifdef _WIN32
|
|
||||||
#include "winquake.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define Con_TPrintf IWebPrintf
|
#define Con_TPrintf IWebPrintf
|
||||||
#define IWebPrintf printf
|
#define IWebPrintf printf
|
||||||
|
@ -33,10 +30,6 @@ qboolean SV_AllowDownload (const char *name);
|
||||||
|
|
||||||
typedef qboolean iwboolean;
|
typedef qboolean iwboolean;
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
#define INVALID_SOCKET ~0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//it's not allowed to error.
|
//it's not allowed to error.
|
||||||
#ifndef WEBSVONLY
|
#ifndef WEBSVONLY
|
||||||
void VARGS IWebDPrintf(char *fmt, ...) LIKEPRINTF(1);
|
void VARGS IWebDPrintf(char *fmt, ...) LIKEPRINTF(1);
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#ifdef WEBSERVER
|
#ifdef WEBSERVER
|
||||||
|
|
||||||
#include "iweb.h"
|
#include "iweb.h"
|
||||||
|
#include "netinc.h"
|
||||||
|
|
||||||
#ifdef WEBSVONLY //we need some functions from quake
|
#ifdef WEBSVONLY //we need some functions from quake
|
||||||
|
|
||||||
|
|
|
@ -1709,7 +1709,9 @@ struct
|
||||||
{"SetExtField", QVM_SetExtField},
|
{"SetExtField", QVM_SetExtField},
|
||||||
{"GetExtField", QVM_GetExtField},
|
{"GetExtField", QVM_GetExtField},
|
||||||
{"ChangeLevel2", QVM_ChangeLevel2}, //with start spot
|
{"ChangeLevel2", QVM_ChangeLevel2}, //with start spot
|
||||||
{"URI_Query", QVM_uri_query}, //with start spot
|
#ifdef WEBCLIENT
|
||||||
|
{"URI_Query", QVM_uri_query},
|
||||||
|
#endif
|
||||||
{"particleeffectnum", QVM_particleeffectnum},
|
{"particleeffectnum", QVM_particleeffectnum},
|
||||||
{"trailparticles", QVM_trailparticles},
|
{"trailparticles", QVM_trailparticles},
|
||||||
{"pointparticles", QVM_pointparticles},
|
{"pointparticles", QVM_pointparticles},
|
||||||
|
|
|
@ -236,8 +236,8 @@ char *JCL_Info_ValueForKey (char *s, const char *key, char *valuebuf, int valuel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && defined(HAVE_PACKET)
|
||||||
#include "windns.h"
|
#include <windns.h>
|
||||||
static DNS_STATUS (WINAPI *pDnsQuery_UTF8) (PCSTR pszName, WORD wType, DWORD Options, PIP4_ARRAY aipServers, PDNS_RECORD *ppQueryResults, PVOID *pReserved);
|
static DNS_STATUS (WINAPI *pDnsQuery_UTF8) (PCSTR pszName, WORD wType, DWORD Options, PIP4_ARRAY aipServers, PDNS_RECORD *ppQueryResults, PVOID *pReserved);
|
||||||
static VOID (WINAPI *pDnsRecordListFree)(PDNS_RECORD pRecordList, DNS_FREE_TYPE FreeType);
|
static VOID (WINAPI *pDnsRecordListFree)(PDNS_RECORD pRecordList, DNS_FREE_TYPE FreeType);
|
||||||
static HMODULE dnsapi_lib;
|
static HMODULE dnsapi_lib;
|
||||||
|
@ -263,7 +263,7 @@ qboolean NET_DNSLookup_SRV(char *host, char *out, int outlen)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else
|
#elif defined(__unix__) || defined(ANDROID) || defined(__MACH__) || defined(__linux__)
|
||||||
#include <resolv.h>
|
#include <resolv.h>
|
||||||
#include <arpa/nameser.h>
|
#include <arpa/nameser.h>
|
||||||
qboolean NET_DNSLookup_SRV(char *host, char *out, int outlen)
|
qboolean NET_DNSLookup_SRV(char *host, char *out, int outlen)
|
||||||
|
@ -352,6 +352,11 @@ qboolean NET_DNSLookup_SRV(char *host, char *out, int outlen)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
qboolean NET_DNSLookup_SRV(char *host, char *out, int outlen)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue