Commit graph

230 commits

Author SHA1 Message Date
sezero
406ed513d4 * keys.c (HISTORY_FILE_NAME): define simply as history.txt without
prefixing with a game directory, so that the history file would be
written into the basedir and not affected by dynamic game directory
changes.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@232 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-26 07:56:28 +00:00
sezero
53b780c9a2 host.c (Host_Shutdown): Write the console command history file only if
not a dedicated server. Same for shutting down the CDAudio and sound
subsystems.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@231 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-26 00:31:12 +00:00
sezero
b33ac1c08a keys.c (History_Init): Made global again.
(History_Shutdown): Likewise.
keys.h: Added prototypes for History_Init and History_Shutdown.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@230 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-26 00:15:22 +00:00
sezero
5739389db5 * keys.c (History_Init): Make it static. Tidy-up its formatting.
(History_Shutdown): Likewise.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@229 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-25 23:55:41 +00:00
stevenaaus
5d8098f1a5 Add Bakers/Ezquakes persistent history feature
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@228 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-25 13:32:49 +00:00
sezero
7f884a951b net_udp.c, net_wins.c, net_wipx.c: Add more informative debug messages.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@227 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 18:11:00 +00:00
sezero
94387b68a2 net_wins.c (WINS_GetLocalAddress): Make sure buff is null terminated.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@226 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 18:09:02 +00:00
sezero
dde3458f13 net_wins.c (WINS_Init): Fix error return value as INVALID_SOCKET.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@225 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 18:05:43 +00:00
sezero
50cea5662f * console.h (Con_DebugLog): Add prototype.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@224 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 11:02:13 +00:00
sezero
b2aba1c07d Reorganize files for platform-specific code:
* sys_sdl_win.c: Copied from sys_sdl.c. Windows-only. Remove unix code.
(Sys_Init): New procedure. Call AllocConsole() and get input and output
handles for dedicated servers.
(Sys_ConsoleInput): Add a windows version.
(Sys_Error): Adjust for the allocated console and use windows api.
Adjust message output. Remove the console timeout, doesn't work somehow.
Just display the console for 3 seconds and then exit. Rely on SDL that
it redirects/logs the stdout/stderr to files.
* sys_sdl_unix.c: Rename from sys_sdl.c. Unix-only. Remove windows code.
(Sys_Init): New procedure.
(Sys_Error): Remove Windows-oriented dedicated server specific code.
Adjust message output.
* sys_sdl.c: Delete.
* sys.h (Sys_Init): Add prototype.
* main_sdl.c (main): Call Sys_Init().
* pl_linux.c (PL_ErrorDialog): Remove terminal printing which Sys_Error
already does.
* pl_osx.m (PL_ErrorDialog): Update from uhexen2.
* pl_win.c: Make icon handle static. whitespace and formatting tidy-up.
* Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Adjust for the
sys_sdl.c name change to sys_sdl_unix.c and sys_sdl_win.c.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@223 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-22 11:01:24 +00:00
sezero
4c86b544f5 * net_udp.c (UDP_Read): Remove the get_qsockaddr() helper which came from the
old fitzsdl port, and use the struct qsockaddr *addr argument with typecasting
as in original quake.
(get_qsockaddr): Remove.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@222 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 16:23:06 +00:00
sezero
850ef74acf * net_udp.c (UDP_Init): Fix Con_SafePrintf() call.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@221 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 16:17:17 +00:00
sezero
bb11a66451 net_udp, net_wins, net_wipx network drivers update:
- do not try to set the quake hostname to the machine name if it isn't set.
- use the newly added unix/windows socket api compatibility macros from
net_sys.h: using just an int as the socketfd wasn't a problem without win64
support: the windows SOCKET type is not only unsigned but may actually be
wider (uintptr_t, which is 8 bytes on win64).


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@220 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 15:24:40 +00:00
sezero
94a056abcf net_sdlnet.c: reverted parts of rev. 197/198.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@219 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 13:27:30 +00:00
sezero
4a202dad3d net_main.c: more trivialities.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@218 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 12:27:30 +00:00
sezero
c8bdc511d8 net_bsd.c, net_dgrm.h, net_loop.c, net_loop.h, net_sdl.c, net_win.c: more trivialities.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@217 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 12:20:25 +00:00
sezero
63c98a9576 * host_cmd.c, menu.c, sv_main.c: Include net_sys.h (for net_defs.h).
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@216 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:50:21 +00:00
sezero
7a36701fa8 * Makefile, Makefile.darwin, Makefile.w32, Makefile.w64: Build changes:
The SDL_net driver is now disabled by default and platform-specific network
drivers will be used. To compile for SDL_net, a command like "make SDLNET=1"
must be used, in which case a new preprocessor macro _USE_SDLNET will be
defined in the CFLAGS. For windows targets when not using SDL_net, WINSOCK2
is added as another option: A command line like "make WINSOCK2=1" will enable
WinSock2 api and a new preprocessor macro _USE_WINSOCK2 will be defined in
the CFLAGS. Or, a command line like "make WINSOCK2=0" will disable WinSock2
api and the old WinSock 1.1 api will be used instead. For Win64, WinSock2 is
enabled by default. For Win32, WinSock 1.1 is the default api.
* net_bsd.c, net_dgrm.c, net_loop.c, net_main.c, net_sdl.c, net_sdlnet.c,
net_udp.c, net_win.c, net_wins.c, net_wipx.c: Use the newly added net_sys.h
header. The sys_socket_t type is not in use, yet.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@215 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 11:10:38 +00:00
sezero
291a531b44 * arch_def.h, net_sys.h, wsaerror.h: New headers, adapted from uhexen2.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@214 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 10:55:21 +00:00
sezero
7239a9a679 net_defs.h (net_driver_t): Removed the controlSock member. It is not used
for any purpose in either of Loop, Datagram or Serial drivers. It used to
be assigned the value returned by the Init() procedure of the relevant
driver which is either 0 for success or -1 for failure, therefore there is
no purpose to it at all.
net_main.c (NET_Init): Removed the controlSocket var and adjusted for the
net_driver_t change.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@213 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 10:50:21 +00:00
sezero
b4cb4368a4 net_main.c: made static variables and functions static. formatting tidy-ups.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@212 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 10:41:34 +00:00
sezero
4e508de0e6 net_dgrm.c: made the statistic counter variables static. same for the
testPollProcedure and test2PollProcedure varibles and StrAddr, NET_Ban_f,
SendMessageNext, ReSendMessage, PrintStats and NET_Stats_f functions.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@211 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 10:16:58 +00:00
sezero
b963f776e5 net_dgrm.c: made the packetBuffer struct static.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@210 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 10:03:10 +00:00
sezero
31e63fecf0 * common.c: Renamed the empty Test_f function of johnfitz to FitzTezt_f.
Renamed its associated console command to fitztest.
* net_dgrm.c: Renamed back Net_Test_f to Test_f. Added back the test,
test2 and ban console commands.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@209 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 09:58:12 +00:00
sezero
e98d1efcc3 * net_dgrm.c: changed the types of banAddr and banMask to struct in_addr.
changed the type of testAddr in _Datagram_CheckNewConnections() to in_addr_t.
a little formatting tidy-up.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@208 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 09:45:24 +00:00
sezero
dcd4743a2b * net_defs.h, net_udp.c, net_wins.c, net_wipx.c, net_sdlnet.c: prefixed
the members of qsockaddr structure with a "q".


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@207 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 09:20:32 +00:00
sezero
b95bf1ae87 * net_udp.c: Changed broadcastaddr type to struct sockaddr_in.
* net_wins.c: Likewise.
* net_wipx.c: Changed broadcastaddr type to struct sockaddr_ipx.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@206 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-21 09:00:56 +00:00
sezero
eb45598f39 * net_win.c, net_wins.c, net_wipx.c: warning and compilation fixes.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@205 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 20:50:27 +00:00
sezero
2cbdc2f756 * net.h: separated the functions and data exported through net.h into two:
net.h now holds all public exports and the new net_defs.h holds the exports
only required by the net layer. besides the net_* files, host_cmd.c and
sv_main.c are the only reasonable foreign importers of net_defs.h: they
require accessing the qsocket_s structure members. The only one that does
not fit is menu.c needing some net exports, but it may be properly handled,
later on.
* net_defs.h: New header.
* host_cmd.c: Include net_defs.h.
* menu.c: Likewise.
* net_bsd.c: Likewise.
* net_dgrm.c: Likewise.
* net_loop.c: Likewise.
* net_main.c: Likewise.
* net_sdl.c: Likewise.
* net_sdlnet.c: Likewise.
* net_udp.c: Likewise.
* net_win.c: Likewise.
* net_wins.c: Likewise.
* net_wipx.c: Likewise.
* sv_main.c: Likewise.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@204 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 17:21:10 +00:00
sezero
45ce066ee5 from uhexen2:
* net_dgrm.c (Datagram_Init): Datagram_Init() must return -1 if it couldn't
initialize any drivers.
* net_main.c (): dedicated servers must error out if no network drivers are
available.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@203 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 15:33:45 +00:00
sezero
b2bb022eb5 * net_main.c: added commentary on the driver checks in the code.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@202 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 15:19:58 +00:00
sezero
1fc6e7c34c net_main.c (NET_SendToAll): Really change all occurances of state2 to msg_sent.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@201 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 15:06:26 +00:00
sezero
0f948f8231 * net_main.c: Fix NET_SendToAll() so that it really skips non-connected
clients. While we're at it, change the type of the blocktime argument
to double (the comparison is against a double.) Rename the cryptic
state1 and state2 variables to something more indicative of thei
purpose, ie. msg_init and msg_sent. from uhexen2.
* net.h, host.c, sv_main.c: Adjust for the NET_SendToAll() argument type
change.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@200 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 15:00:57 +00:00
sezero
2b569dc06b * net_udp.c: Changed myAddr type to in_addr_t.
* net_wins.c: Changed myAddr type to u_long.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@199 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 13:10:52 +00:00
sezero
e789fcaed0 * net_sdlnet.c: Pass "localhost" instead of NULL to SDLNet_ResolveHost().
added some remarks about missing functionality in SDL_net.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@198 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 12:50:51 +00:00
sezero
9a09a1ee08 * net_sdlnet.c: Added ASSERT_SOCKETID for paranoid debugging purposes,
disabled by default. Made socket_id() to work in two passes, once for
looking for a match and the next for looking for an empty slot in the
net_sockets[] array. Made it to Sys_Error if there are no empty slots.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@197 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 11:05:28 +00:00
sezero
013a3ad1db Some more tidy-up and minor fixing in net stuff. Largely trivial. Also
added winquake.h.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@196 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-20 10:03:05 +00:00
sezero
719ba437b7 * gl_vidsdl.c, in_sdl.c, main_sdl.c, net_sdlnet.c, pl_linux.c, pl_osx.m,
pl_win.c, sys_sdl.c: Explicitly include SDL.h in the SDL source files. At
present, quakedef.h already includes SDL.h you may never know what would
happen in the future.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@195 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 22:50:48 +00:00
sezero
858fea3461 * input.h: Removed the SDL_MAJOR_VERSION guards around BuildKeyMaps() and
Key_Map() prototypes. Made Key_Map() to accept void* argument instead of
SDL_KeyboardEvent* so that the code can compile even without SDL.
* in_sdl.c (Key_Map): Adjusted for argument type change with proper cast
to SDL_KeyboardEvent*. The assembler output is the same as before.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@194 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 22:45:18 +00:00
sezero
288edb93a0 Makefiles: Removed an obsoleted comment. Added objects for platform-specific
network drivers in commented out form.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@193 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 20:15:21 +00:00
sezero
0e7d3d7009 * net_wipx.c, net_wipx.h: added from Fitzquake-0.85 source.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@192 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 20:07:04 +00:00
sezero
59574dd7a3 net_udp.h: Renamed all function argument names as socket to socketid.
net_udp.c: Renamed all function argument names as socket to socketid.
Replaced the inet_addr("127.0.0.1") call with htonl(INADDR_LOOPBACK).
Replaced qboolean _true with int _true.
net.h: Renamed the OpenSocket and CloseSocket function pointers to
Open_Socket and Close_Socket.
net_dgrm.c: Adjusted for Open_Socket and Close_Socket change.
net_sdlnet.c: Made some functions static.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@191 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 18:20:22 +00:00
sezero
c5f6ed0763 * net_udp.c: more minor fixes and tidy-ups.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@190 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 17:04:04 +00:00
sezero
44608bb902 * sys_sdl.c: Added a Sys_ConsoleInput implementation from uhexen2.
Only for unix for the time being.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@189 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 16:50:15 +00:00
sezero
2aeca5e276 * net_bsd.c: minor whitespace tidy-up.
* net_sdl.c (net_drivers[]): removed duplicated Datagram entry.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@188 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 16:45:38 +00:00
sezero
28bc6db8d1 * net_udp.c: Some cleanups & tidy-ups.
* net_bsd.c: Added from original Quake source.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@187 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 16:37:28 +00:00
sezero
6ee0b477b2 * main_sdl.c: better dedicated server loop.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@186 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 14:50:48 +00:00
sezero
e05ac1be84 * gl_model.c (Mod_LoadFaces): Do not call GL_SubdivideSurface() in dedicated
servers, otherwise we segfault in SubdividePolygon() at the BoundPoly() call.
This is a workaround, the actual problem is yet to be looked into.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@185 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 14:16:05 +00:00
sezero
6b05365aa3 * main_sdl.c: Skip the SDL_Event stuff in dedicated servers.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@184 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 14:10:19 +00:00
sezero
6667ab7afb * host_cmd.c (Host_Map_f): Do not call IN_Activate() for dedicated servers.
(Host_Changelevel_f): Likewise.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@183 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 09:00:22 +00:00