Commit graph

211 commits

Author SHA1 Message Date
Kp 426fb16654 Pass nm_set_item_radio arg by & 2015-01-18 01:58:31 +00:00
Kp fa10e51999 Add helper nm_item_text 2015-01-18 01:58:31 +00:00
Kp 4705c3f2d8 Pass nm_set_item_checkbox arg by & 2015-01-18 01:58:31 +00:00
Kp f8163957ef Add helper nm_item_input 2015-01-18 01:58:31 +00:00
Kp 67e503b9b7 Add helper nm_item_menu 2015-01-18 01:58:31 +00:00
Kp 249534c669 Short circuit net_udp_process_monitor_vector 2015-01-18 01:58:30 +00:00
Kp 63353ae4ad Factor out net_udp_create_monitor_vector bitmap array 2015-01-17 18:31:42 +00:00
Kp 28a31a223f Centralize window_close calls 2015-01-17 18:31:41 +00:00
Kp c2b7990550 Pass window_get_canvas arg by & 2015-01-17 18:31:40 +00:00
Kp b6a3735f53 Add convenience d_strnicmp for literal right side 2015-01-12 00:26:03 +00:00
Kp 6a872da54a Pass UDP socket by & 2015-01-03 23:44:32 +00:00
Kp d5d416c62c Use ntstring for Netgame.mission_name 2015-01-03 23:44:32 +00:00
Kp bd9513b080 Fix sending uninitialized bytes in light request 2014-12-30 02:09:21 +00:00
Kp fbac119095 Propagate use of objptridx_t 2014-12-23 04:20:27 +00:00
Kp ac1340e3c9 Use ntstring for mission_name 2014-12-22 04:35:48 +00:00
Kp 03370ed3e5 Use ntstring for Netgame.mission_name 2014-12-22 04:35:48 +00:00
Kp e166846dd1 Use ntstring for Netgame.game_name 2014-12-22 04:35:48 +00:00
Kp 0c8191db94 Fix player clear range 2014-12-07 00:49:18 +00:00
Kp a0727f4f84 Throw on net_udp_read_sync_packet failure
Callers expect sane Player_num, but on failure, it is invalid.
Returning a failure status causes net_udp_level_sync to fault using
Players[Player_num].connected, so throw an exception instead.
2014-12-07 00:00:22 +00:00
Kp 2b627f0158 Pass net_udp buffers as const 2014-12-06 23:59:34 +00:00
Kp 9d700aab08 Make kill_matrix uint16_t, not short 2014-12-06 23:30:55 +00:00
Kp cfe0f89dae Use array<> for team_kills 2014-12-06 04:52:53 +00:00
Kp a55028d5b4 Fix crash on UDP initialization 2014-12-06 02:16:28 +00:00
Kp f206b3b127 Reduce inclusion of object.h 2014-11-23 04:36:58 +00:00
Kp 2c349136cc Avoid slicing into segnum_t local 2014-11-20 03:00:36 +00:00
Kp 60837a7cfb Fix -fno-inline build by promoting INVALID_SOCKET to global scope 2014-11-02 17:05:10 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp bbba6255ab Use RAIIsocket for UDP_Socket[] 2014-10-21 02:37:00 +00:00
Kp 2645d41b5f Convert net_udp to range_for 2014-10-19 03:54:18 +00:00
Kp 62dc7a874f Pass sockaddr by const &, not value 2014-10-18 23:37:34 +00:00
Kp 54f635c5cc Use operator== to compare sockaddr 2014-10-18 23:20:39 +00:00
Kp 486707a9ef Fix argument to net_udp_send_mdata_direct
Use argument, not global
2014-10-17 02:23:40 +00:00
Kp 7c76c68255 Make unused_newmenu_userdata_t const 2014-10-16 02:13:09 +00:00
zico cc785a991c Update timer in net_udp_do_frame and net_udp_process_pong to make sure we don't cause artificial delays 2014-10-13 02:18:10 +02:00
Kp 7f648c0f5f Wrap segment iteration idiom 2014-10-12 23:10:05 +00:00
Kp fb641b3250 Wrap object iteration idiom 2014-10-12 23:05:46 +00:00
Kp 6977a0eb74 Add operator!= to callsign_t 2014-10-11 04:33:22 +00:00
Kp a8f853aa7a Pass d_event arg by const& 2014-10-04 22:36:13 +00:00
Kp 59cacbd8ce Move Allow_marker_view, AlwaysLighting into DXX_BUILD_DESCENT_II 2014-09-28 21:09:22 +00:00
Kp e6b9f3f923 Use typedef for player number 2014-09-21 22:10:12 +00:00
Kp 5571cf75ef Ignore -udp_myport requests for reserved port 2014-09-17 02:16:33 +00:00
Kp 9ccc5400fb Refactor UDP_MyPort handling
Store as short, not string.

Centralize reset-to-default.  Fixes sometimes resetting to hardcoded
default instead of GameArg default.

Centralize and improve error check.  Now rejects privileged ports
consistently.
2014-09-17 02:13:13 +00:00
Kp cbe07f023c Reduce scope of for variables 2014-09-13 21:45:21 +00:00
Kp 49734df8a4 Use partial_range to search netgame list 2014-09-13 21:44:42 +00:00
Kp 822d3c7518 Avoid reloading Player_num when clearing player callsigns 2014-09-12 02:43:37 +00:00
Kp 9ea72090a2 Fix return semantics of net_udp_send_request 2014-09-12 02:43:36 +00:00
Kp f7f416c3cb Trap blown bitmap overflow 2014-09-11 22:16:18 +00:00
Adam Gensler e718103da6 fix incorrect tracker_register length 2014-08-27 14:08:09 -04:00
Kp 1d16377d48 Change isyou to your_index and promote it out a layer
There is only ever one record for which isyou is true.
2014-08-16 21:56:46 +00:00
Kp 125d9257be Use special type names for segment/object numbers 2014-08-13 02:57:12 +00:00
Kp d0db98fe01 Use array<> for netgame_info members 2014-08-09 16:43:55 +00:00
Kp 125218aa5a Fix partial_range exception sending game information
Netgame.players is [MAX_PLAYERS], not [MAX_PLAYERS+4].
2014-08-09 04:14:54 +00:00
Kp 4acbb40ad7 Use enum for window event result 2014-08-07 02:47:48 +00:00
Kp 7133d75698 Propagate loop variable to silence gcc 4.6 warning
Suppress warning about changed variable scope under new ISO C++ rules.
2014-08-01 03:34:08 +00:00
Kp 33bf7b6e12 Use constant scan labels 2014-07-30 03:06:41 +00:00
Kp 2c8eca5229 Use constant status 2014-07-30 03:06:41 +00:00
Kp 593f4b08e0 Use unique_ptr for start_poll_data 2014-07-25 02:54:31 +00:00
Kp c1d184240d Use unique_ptr to manage fonts 2014-07-22 23:48:23 +00:00
Kp 7552ceb259 Remove unused arguments 2014-07-16 03:24:40 +00:00
Kp 92f7ace9ae Remove useless self assignment 2014-07-16 03:22:33 +00:00
Kp 5c30b2fefd Use operator= instead of memcpy 2014-07-05 19:25:41 +00:00
Kp 44d1924e96 Use special type for player callsign 2014-07-05 19:20:56 +00:00
Kp 1c55ca68ee List initialize UDP quaternionpos 2014-07-04 04:13:46 +00:00
Kp e259857fea List initialize UDP mdata pkt_num array 2014-07-04 04:12:45 +00:00
Kp a2f65bb467 List initialize UDP_mdata_queue 2014-07-04 04:11:45 +00:00
Kp 75379b5857 List initialize Active_udp_games 2014-07-04 04:10:01 +00:00
Kp 8a35164ae4 List initialize UDP sAddr 2014-07-04 04:09:46 +00:00
Kp 97d72b4dfe List initialize UDP hints 2014-07-04 04:09:26 +00:00
Kp 9b6bd1d17a Move sAddr initialization into udp_dns_filladdr 2014-07-04 04:09:25 +00:00
Kp d5b55cf512 List initialize kill_matrix 2014-07-04 04:07:14 +00:00
Matt Vandermeulen 28f307eb85 Fixes #5 - Byteswap header renamed to byteutil, plus sed magic
[Kp: switch to #pragma for byteutil.h]
2014-07-03 02:03:08 +00:00
Kp 78559cdc62 Cast network buffers for compatibility with Win32 prototype
Win32 deviates from BSD and sets the buffer type as char*
2014-06-28 03:52:37 +00:00
Kp 71e7458bd8 Avoid memory corruption when moving UDP queues
Passing overlapping ranges to memcpy leads to undefined behavior.  Some
versions of glibc copy backwards, causing incorrect results when the
ranges overlap.  Switch to std::move to guarantee a copy forward and to
ensure proper handling of any future class members.

See https://lwn.net/Articles/414467/
2014-06-27 03:11:39 +00:00
Kp 6091496b28 Unpack UDP_mdata_info 2014-06-26 03:17:23 +00:00
Kp c7b161cf2d Unpack UDP_frame_info 2014-06-26 03:17:23 +00:00
Kp 291d11d17e Unpack UDP_sequence_packet 2014-06-26 03:17:23 +00:00
Kp 65fedf7b59 Unpack netgame_info 2014-06-26 03:17:23 +00:00
zico f6a18e05a6 Reworked packet loss prevention system to send and receive protected packets in correct order 2014-06-24 14:49:18 +02:00
Kp e5673ae8ea Pass pnum to boss action 2014-06-08 00:05:33 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
zico 090e4c5f1d Reverted commit 8f112d669c. 2014-06-01 19:10:38 +02:00
zico a5893af38b Reverted commit 0c10c9db7f. 2014-06-01 19:09:42 +02:00
Kp a2427f58b5 Use special type to reduce pointer/index conversions 2014-01-12 19:32:12 +00:00
Kp 9a5d0f6f09 Use symbolic values for segment/object first/none 2014-01-06 04:17:55 +00:00
Kp 40e90fea22 Move Light_subtracted[] to Segments[].light_subtracted 2014-01-01 03:33:27 +00:00
Kp 094dfbf3d4 Reduce header inclusions 2013-12-31 03:22:03 +00:00
Kp 073f00974a Eliminate uses of the typedef struct X { ... } X; pattern
C++ does not require this pattern.

import re, fileinput
to = re.compile(r'^typedef struct ([a-z_A-Z]+)\s*{')
tc = re.compile(r'^}(.*?)\s*([a-z_A-Z]+);$')
osn = None
for line in fileinput.input(inplace=True):
	m = to.match(line)
	if m:
		osn = m.group(1)
		print 'struct %s\n{' % osn
		continue
	if osn:
		m = tc.match(line)
		if m:
			csn = m.group(2)
			if osn == csn:
				print '}%s;' % m.group(1)
				osn = None
				continue
			else:
				osn = None
	print line,
2013-12-28 22:48:07 +00:00
Kp bdf55f907b Use assignment instead of memcpy 2013-12-25 23:50:26 +00:00
Kp f9269b0fb4 Show failed hostname when DNS lookup fails 2013-12-25 03:22:06 +00:00
Kp 1e8036bd24 Split compiler.h for PCH compatibility 2013-12-21 05:12:38 +00:00
Kp f0bae2c8cd Add EVENT_WINDOW_CREATED to centralize window init/deinit logic 2013-12-20 02:51:24 +00:00
zico 35266309d0 Made version mismatch screen spill out some explanatory information about Multi protocol version 2013-12-19 14:03:00 +01:00
Kp 9776827a33 Make Objects[] a C++ array 2013-12-18 04:51:46 +00:00
zico 45a39d7587 Fixed usage of nm_messagebox_str in net_udp_process_dump 2013-12-16 06:23:06 +01:00
zico 340af42d86 Due to increased calls of multi_do_frame introduced in 6bd9c2bfc1 net_udp_start_poll needed to be modified to see if a player joined or left; Also constantly refill the list in case players change but their numbers don't (i.e. one leaves and one joins at the same time) 2013-12-16 06:13:44 +01:00
Kp 92e8cb7a31 Add type checking to newmenu subfunction userdata 2013-12-15 21:54:38 +00:00
Kp 3908215e73 Add type checking to nm_messagebox format string 2013-12-15 21:54:17 +00:00
Kp 8f9015acd2 Switch manual join menu not to use nm_messagebox1
Fixes a remotely triggerable crash caused by parsing game names as a
format string.
2013-12-15 18:58:02 +00:00
Kp cea46651fc Check type of window handler function 2013-12-15 18:51:26 +00:00
Kp 14811b12d9 Format entire game description in a single call 2013-12-15 01:47:07 +00:00
Kp a3fa660d33 Remove casts in dxx_sendto calls 2013-12-11 04:05:24 +00:00
zico 6bd9c2bfc1 Rearranged game mode check so ANARCHY_ONLY_MISSION will not prohibit CTF, Hoard or Bounty 2013-12-10 01:52:19 +01:00
zico dae83f9edc Set PPS limits from 5 to 40 2013-12-09 14:25:32 +01:00
zico 3e2fd4f74b Improved pdata update sync when firing and not limiting general use of the force flag 2013-12-09 14:05:24 +01:00
zico 2e407fa5a8 Removed short packets and added segment number to quaternion structure 2013-12-09 14:00:23 +01:00
Kp 75c229c6bf Normalize con_printf newline usage 2013-12-07 21:13:37 +00:00
Kp 70149044c1 Switch gr_printf(x,y,s) to gr_string(x,y,s) 2013-12-06 04:02:13 +00:00
Kp 0726431030 Simplify preparing secret level text in MP game setup 2013-12-06 00:24:07 +00:00
Kp 8ecfce07a1 Fix missing declarations when tracker is enabled
Drakona reports that tracker support does not build.  Fix it.
2013-12-04 23:43:45 +00:00
Kp 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp 74db12f880 Move similar/main/net_udp.c -> similar/main/net_udp.cpp 2012-11-11 22:12:51 +00:00
Renamed from similar/main/net_udp.c (Browse further)