Commit Graph

260 Commits

Author SHA1 Message Date
Mark Vejvoda d91e72a825 - windows compile bugfixes 2012-09-22 21:00:31 +00:00
Mark Vejvoda 1c211e4ce6 - lots of code cleanup from the cppcheck 2012-09-22 20:13:57 +00:00
Mark Vejvoda bc794178aa - attempt to stabilize socket send a little better 2012-07-20 15:21:32 +00:00
Mark Vejvoda 2572fcf561 - more logging to track down cold's issue 2012-07-06 21:01:45 +00:00
Mark Vejvoda dbb116f250 - load of changes to get things compiling under VC++ 2010 (with updated deps seperate for vc2010) 2012-04-20 01:04:05 +00:00
Mark Vejvoda 3b8dd289ac - updated cmake to check for support of backtraces in gcc compiler
- fixed numerous bugs / warnings from cppcheck
2012-04-16 19:29:37 +00:00
Mark Vejvoda 8c0bf75bf5 - got built in memory leak working. Just edit leak_dumper.h and uncomment:
//#define SL_LEAK_DUMP
- got better / more accurate stack dumps when we detect errors in game.
- Both of these need to be worked on in windows next, win32 may not compile for now until i fix it on that platform.
- BE VERY CAREFUL when working in leak_dumper.* it may cause GCC and your system to crash if you don't know what you are doing!
2012-04-14 21:21:09 +00:00
Mark Vejvoda 9286130138 - bugfixes and code cleanup found using cppcheck 2012-03-28 06:25:57 +00:00
Mark Vejvoda 9e1001fac7 - headless server will only give network status info to the locahost now and not on any other ip (for security purposes) 2012-03-27 05:39:02 +00:00
Mark Vejvoda d356e5f5de - added new headless server status check:
on the SAME box as the headless run:
./megaglest --headless-server-status
2012-03-25 06:55:43 +00:00
Mark Vejvoda b14431385f - attempt to make accepting socket connections and dealing with certain connection problems more stable 2012-03-24 01:09:55 +00:00
Mark Vejvoda cf1c7c1ca2 - tighten up socket error checking during peek for data on connection check 2012-02-11 22:52:52 +00:00
Mark Vejvoda 4ad42518c0 - updated for better handling of streflop on different platforms
- attempt for bugfix on windows when socket send buffer is continuously full
2012-02-10 06:21:06 +00:00
Mark Vejvoda fbf7610420 - port changes from 3.6.0.3 to trunk for windows hosting patch 2012-01-20 04:15:13 +00:00
Mark Vejvoda 093b1efb2c - added a few more socket guards around invalid socket value 2012-01-06 21:21:52 +00:00
Mark Vejvoda 88ad6d3723 - added a guard on the socket so we only shutdown if not already done so by possibly another thread. 2012-01-06 21:18:36 +00:00
Mark Vejvoda 835c886705 - few tweaks to get things compiling under mingw 2011-12-25 03:09:39 +00:00
Mark Vejvoda 496b847999 - bugfixes to build on debians multi-platform build system 2011-12-23 04:38:42 +00:00
Mark Vejvoda 66f44ff7c4 - more cleanup from cppcheck (using eclipse plugin now) 2011-12-02 17:46:02 +00:00
Mark Vejvoda d33e1174a5 - bugfixes related to cppcheck report
- bugfixes found using valgrind (memory leaks)
2011-12-02 16:07:59 +00:00
Mark Vejvoda 7cf9c189b2 - disallow non compressed tileset downloads when client IP not on same subnet as host
- bugfix for LAN server broadcasting
- bugfix for empty message on player disconnect (now properly shows that player switched to AI mode)
2011-11-29 05:07:18 +00:00
Mark Vejvoda 03a7a72ef5 revert network code back to beta1 code 2011-11-27 05:27:50 +00:00
Mark Vejvoda 5fd3457d70 - fixed socket changes for windows compiler 2011-11-27 00:11:18 +00:00
Mark Vejvoda da854f103b - added some special ways to configure how sockets work on a system for testing 2011-11-27 00:07:55 +00:00
Mark Vejvoda 6c1c248d62 - attempt to fix network stuttering using a new multi-read single write mutex + semaphore class 2011-11-26 08:14:23 +00:00
Mark Vejvoda 82c9002d0a - attempt to further stabilize cpu usage and network reliability 2011-11-25 20:03:07 +00:00
Mark Vejvoda 2a8c712b1a - more socket performance changes
- auto complete now works also in IRC chat, and tabbing loops through all matched names.
2011-11-25 09:12:53 +00:00
Mark Vejvoda e2135f76eb - attempt to fix network game play 'stuttering' 2011-11-25 05:37:55 +00:00
Mark Vejvoda c6b7d3991e - attempt to fix network game play 'stuttering'
- bugfix for ip address gathering
- added tab autocomplete in chat windows for playernames
2011-11-24 23:15:21 +00:00
Mark Vejvoda 5aa34ebd08 - bugfix for sockets on windows 2011-11-23 08:11:30 +00:00
Mark Vejvoda 3cdf50c399 - a load of bugfixes including:
- proper handling of invalid client connects, after 6 bad attempts in a 60 second period of time the IP address is blocked from the current game
  - Added check for invalid particles for tileset objects
  - Made messagebox wider in game mod menu
  - Fixed numerous threading issues discovered while testing on my 8 core CPU
  - a Little bit of rendering cleanup
2011-11-23 08:00:09 +00:00
Mark Vejvoda 2cecb2c3a0 fixed horrible UPNP bugs related to timing, where ports would be either NOT properly opened or not closed due to thread timing and no thread protection. 2011-10-23 00:55:34 +00:00
Mark Vejvoda af2e2a8930 - added new debug compile option for UPNP:
cmake -DCMAKE_INSTALL_PREFIX= -DWANT_STATIC_LIBS=ON -DBUILD_MEGAGLEST_UPNP_DEBUG=On ..

This will output tons of stuff to console to help debug issues in miniupnpc
2011-10-21 03:24:04 +00:00
Mark Vejvoda 3d20c207d5 - bugfixes for supporting compile of miniupnpc1.4 -> 1.6. Added two new optional commandline options for cmake:
-DMINIUPNPC_VERSION_PRE1_6=true
-DMINIUPNPC_VERSION_PRE1_5=true
2011-10-12 22:04:00 +00:00
Mark Vejvoda f0fc8dc561 - updated embedded miniupnpc to latest version 1.6 2011-10-12 19:21:13 +00:00
Mark Vejvoda fe8e76efd8 - applied some memory leak cleanups 2011-09-27 20:35:45 +00:00
Mark Vejvoda 2a86cb4f7d - added support for proper quiting and console input/output in headless mode. Type: quit followed by return into the console to properly shutdown in headless mode. 2011-09-27 10:16:09 +00:00
Mark Vejvoda ba35e3cc9f - fixed win32 compile errors 2011-09-02 04:22:04 +00:00
Mark Vejvoda 4a5a7f010d - final phase of cppcheck verbose fixes (outstanding items should be left alone) 2011-09-01 18:51:43 +00:00
Mark Vejvoda 57afc2d715 - phase 2 of cppcheck verbose fixes 2011-09-01 01:11:23 +00:00
Mark Vejvoda 3af608151e - bugfixes found from cppcheck 2011-08-31 19:44:19 +00:00
Mark Vejvoda 38aa9c94fb - bugfix for units doing a build command where unit is > 1 size
- additional guards for null in miniupnpc calls
2011-06-02 05:05:54 +00:00
Mark Vejvoda 1803c2ea94 - only show debug when verbose enabled 2011-06-01 19:07:28 +00:00
Mark Vejvoda f2ccc5b0ca - bugfix for miniupnpc (when using non embedded version there was a null pointer) 2011-06-01 19:06:14 +00:00
Mark Vejvoda 1dbdc29622 - do not throw error when connection drops on partial socket receive, just log the condition and close gracefully 2011-05-29 23:01:16 +00:00
Mark Vejvoda d7c3d9e7ad - code hardening for threaded socket destruction handling 2011-05-28 19:22:03 +00:00
Mark Vejvoda 1cf6d523fd - updated cmake system to support using NON EMBEDDED versions of libircclient and miniupnpc for proper build in Debian 2011-05-27 06:37:43 +00:00
Mark Vejvoda 4b47c79af5 - attempt to fix tomreyn's segfault when socket is closing 2011-05-25 21:57:01 +00:00
Mark Vejvoda 93767d8ed8 - bugfix for trying socket connect when nic is down
- removed platform mismatch console printf
2011-05-17 00:21:51 +00:00
Mark Vejvoda 69a627dca7 -fixed AllowGameDataSynchCheck=true so it works properly again 2011-04-26 23:34:48 +00:00
Mark Vejvoda 706c72c87f - bugfix when receiving additional socket data 2011-04-26 23:19:27 +00:00
Mark Vejvoda ac83b1a898 - attempt to fix socket bug where we incorrectly polled for data using ioctl / ioctlsocket. While we stilkl do some peeks, the bulk of the socket work is now done properly by simply doing recv and thus should prove more stable and reliable as well as perform better. 2011-04-24 04:22:19 +00:00
Mark Vejvoda 540d91ed92 - bugfix for recent socket change on windows 2011-04-13 05:07:47 +00:00
Mark Vejvoda 1858240879 - inspired by brazil boy. added a temp block feature for server player to temp block players from the current game in the lobby 2011-04-13 04:04:08 +00:00
Mark Vejvoda 7a501a4e26 - added code to track mutex source for sockets 2011-04-13 01:20:40 +00:00
Mark Vejvoda 1ffc7d99d4 - calculate megapack techtree CRC first if it exists in the users techtrees 2011-04-10 23:50:47 +00:00
Mark Vejvoda 3b56aa4475 - performance changes... (problem found by titi) most debug calls line are skipped when the debug flag is disabled even BEFORE getting into the handledebug method.
This improves performance VERY MUCH.
2011-03-28 03:54:23 +00:00
Mark Vejvoda 15e00694bf - attempt to tighten up socket connection logic that detects disconnect 2011-03-26 02:00:41 +00:00
Mark Vejvoda bca617cf18 - bugfix for socket mutex locked when deleting socket
- added faction detail in lobby when CRC's do not match on techtree
2011-03-19 12:04:18 +00:00
Mark Vejvoda e070cf2cbb - added player status for network based games so players can indicate if they are ready to play or not 2011-03-11 11:11:46 +00:00
Mark Vejvoda 9382473294 - attempt to make a few tweaks for more smooth network play 2011-03-05 20:15:28 +00:00
Mark Vejvoda bd29260fef - Does this fix choppy network play? Please test and let me know 2011-02-21 01:34:31 +00:00
Mark Vejvoda 8ec58868dc - attempt to improve network performance (use separate mutexes for read / write operations) 2011-02-15 07:49:40 +00:00
Mark Vejvoda 31e722287f - bugfixes for when players disconnect, do not switch observers to AI and only show message once.
- Attempts to debug/improve network performance
2011-02-15 03:32:14 +00:00
Mark Vejvoda 4488a4d388 - make pathfinder caching an ini setting tso its easy to test (disabled by default)
- some code cleanup related to threads and sockets
2011-02-13 03:06:12 +00:00
Mark Vejvoda 17e2a87890 - fixed one type of freeze in the custom menu
- some small opengl changes
2011-02-08 18:23:41 +00:00
Mark Vejvoda c58e893047 - attempt to improve issues in the custom menu related to freezing
- modified debug UI display to support multi levels of UI debug info
- added more validations to mutexes
- improved client sockets to properly be setup as non blocking
2011-02-06 07:01:54 +00:00
Mark Vejvoda 0b4eef10c5 - added a very useful way to track mutex usage and performance timings of mutex locking to discover thread lock issues 2011-01-31 23:01:39 +00:00
Mark Vejvoda 66261ad662 - updated line endings to unix style characters to fix Bug #3085838 2011-01-20 15:56:30 +00:00
Mark Vejvoda 9ba8668751 - win32 winsock bugfixes causing havok and grief for win32 users (corrupt winsock stack due to extra call to wsacleanup) 2011-01-17 23:45:09 +00:00
Mark Vejvoda d8e28fbf90 - attempt to fix WSAStartup error message on win32 2011-01-17 21:31:59 +00:00
Mark Vejvoda 8c4cdd037c - updated for compiling on BSD
- also bugfix for socket broadcast segfault (partial fix)
2011-01-13 01:46:32 +00:00
Mark Vejvoda d9e7dcc69a - another attempt to fix socket send freeze 2011-01-11 03:56:38 +00:00
Mark Vejvoda 1c78fca0fb - Added tileset and map CRC check in the network lobby
- numerous bugfixes
2011-01-09 04:49:21 +00:00
Mark Vejvoda e12692293a - cleanup a compiler warning 2011-01-07 06:28:42 +00:00
Mark Vejvoda a5a744fcad - updated FTP code to use specific ports for MG and not random FTP ports 2011-01-06 00:52:00 +00:00
Mark Vejvoda 3370fdd39f - attempt to fix socket freeze issue 2011-01-02 16:24:44 +00:00
Mark Vejvoda 5f4d3e9088 - numerous thread bugfixes related to menu stability and ftp server socket usage 2011-01-02 09:33:37 +00:00
Mark Vejvoda 2b1732e27e - overhaul of thread processing, especially in the menus, things now freeze much less and should be more reliable 2011-01-02 06:46:48 +00:00
Mark Vejvoda d176053da9 - plenty of code cleanup (some refactoring of socket / UPNP code)
- FTP console output now only shows when --verbose used
2010-12-31 08:21:26 +00:00
Mark Vejvoda 973b546b04 - more bugfixes related to ftp and firewall handling 2010-12-30 20:02:30 +00:00
Mark Vejvoda 64446194e7 - more bugfixes related to ftp and firewall handling 2010-12-30 18:51:25 +00:00
Mark Vejvoda 1480d7c68d - bugfix for compiling in VC++ 2010-12-30 16:05:47 +00:00
Mark Vejvoda 3f0ee7a6cb - some initial changes to try to get ftp working over the Internet with firewalls etc 2010-12-30 15:56:02 +00:00
Mark Vejvoda 4fb1b1092f - added ftp port # as an ini setting and added to UPNP for router auto-config
- added new language string for message box to prompt map file downloads
2010-12-29 20:28:25 +00:00
Mark Vejvoda 03eaa2c033 numerous important bugfixes:
- observers and end game fog of war enable would most likely cause out of synch, I think its fixed now
- better handling of threaded logging
- cleanup of socket thread processing to ensure all network packets get processed properly and in order
2010-12-24 08:43:09 +00:00
Mark Vejvoda bc90aa7ce4 - added UPNP router auto-configure for Internet games (hurray) 2010-12-21 05:07:10 +00:00
Mark Vejvoda a844b79d3e - fixed an evil socket bug! Sockets in Linux were NOT properly set as non blocking and vice versa as expected. PErhaps this helps with the menu bug 2010-12-18 23:03:53 +00:00
Mark Vejvoda b605c65aa9 - updates to support both Windows and Linux targets from CodeBlocks Workspace 2010-12-07 07:00:11 +00:00
Mark Vejvoda 7872e980e1 - updated thread handling slightly in menus to make things more stable 2010-12-05 01:52:38 +00:00
Mark Vejvoda d2de4eb22a - change to properly toggle socket blocking mode in Linux 2010-11-09 16:51:03 +00:00
Mark Vejvoda fd3a8e4705 - minor bugfix when broadcasting on UDP (only one socket per unique subnet) 2010-10-23 05:12:28 +00:00
Mark Vejvoda 06b9d7eef7 - cleaned up a whole pile of compiler warnings 2010-10-21 15:21:46 +00:00
Mark Vejvoda d5117ed7fa - cleaned up a whole pile of compiler warnings 2010-10-21 07:20:17 +00:00
Mark Vejvoda 0d050f62d4 - added code to now output all eerors to console (with option to save in log file)
- added more LUA debug info
2010-10-06 20:22:06 +00:00
Mark Vejvoda 0c99a516c5 - First mac patch from GeoVah (thanks) 2010-09-11 05:14:42 +00:00
Mark Vejvoda 1a9ec91eeb - attempt to fix a possible mutex deadlock based on Nebososo's logs 2010-09-08 06:18:34 +00:00
Mark Vejvoda 9817e8a860 - memory leak fixes 2010-09-07 17:30:13 +00:00
Mark Vejvoda 58ab55a6aa - cleaned up some compiler warnings 2010-09-06 06:22:08 +00:00
Mark Vejvoda ada90b4e27 - attempt to improve network performance and log more info regarding menu and network performance 2010-09-02 22:34:25 +00:00
Mark Vejvoda 169234b80f - added more safety checks in broadcast socket thread 2010-08-26 19:50:18 +00:00
Mark Vejvoda a64fa69d02 - bugfixes for experimental game data synch check in lobby
- added a fix for socket sending when the send buffer is full and we have more data to send
2010-08-26 03:15:36 +00:00
Mark Vejvoda e5678be10c - bugfixes for experimental game data synch check in lobby
- added a fix for socket sending when the send buffer is full and we have more data to send
2010-08-26 02:36:17 +00:00
Mark Vejvoda 19892ff11d - small network optimization to help stabilize frequently called network code 2010-08-23 15:17:36 +00:00
Mark Vejvoda 07cbcc0bec - added a bunch of null terminations to all char buffers in network protocol 2010-08-20 23:53:10 +00:00
Mark Vejvoda d69fbc6925 - more NULL checking for safer execution
- added safer mutex guards in custom game menu
2010-08-20 22:42:26 +00:00
Mark Vejvoda 0e82836e01 - more NULL checking for safer execution 2010-08-20 22:17:30 +00:00
Mark Vejvoda 2dcbe1473b - stupid win32 compile fix for sockets 2010-08-07 06:28:00 +00:00
Mark Vejvoda a5bf684493 - more network fixes to make lag and disconnects more stable
- changed the way the game end logic happens to try to make it more stable
2010-08-07 04:49:06 +00:00
Mark Vejvoda fe8d3b3130 - numerous bugfixes mostly centered around network lag, but also added more logging and protective code (like buffer overflow checks)
*NOTE: This version is NOT backwards compatible with other builds
2010-08-07 03:26:38 +00:00
Mark Vejvoda a0831666b5 - added a check for linux NIC's to only return those that are both UP and Running 2010-07-16 20:02:44 +00:00
Mark Vejvoda e3ad4b7b60 - bugfix to ignore 0.* ip addresses 2010-07-16 17:11:38 +00:00
Mark Vejvoda a3ec4650c4 - moved pause for lagged clients option to custom game menu
- bugfix to ignore 0.* ip addresses
2010-07-16 16:53:19 +00:00
Mark Vejvoda 3e53b69676 - added client side ping style packet for linux socket disconnect checking 2010-07-09 15:01:49 +00:00
Mark Vejvoda 4ba69753f9 - added extra check on linux for socket disconnect 2010-07-09 05:29:42 +00:00
Mark Vejvoda ab655162cb - added more bug fixes related to network disconnects.
- Added a new global message box to display error messages on top of any graphics window being displayed.
2010-07-08 08:29:51 +00:00
Mark Vejvoda 8478ab80b3 - bugfixes for malformed debug statements
- updated version to 3.3.5.1
- added more null checks
- changes to try to fix crash when ending a game (delete cells bug)
2010-07-06 05:30:34 +00:00
Mark Vejvoda 1d4f47718c - added many new things and fixed a number of bugs (too tried to mention them all) 2010-06-24 01:23:18 +00:00
Mark Vejvoda 87b4706940 - Attempt to use libcurl in a thread safe manner 2010-06-23 14:49:20 +00:00
Mark Vejvoda a05760d2a4 - threading bugfixes from the client join menu 2010-06-22 15:03:57 +00:00
Mark Vejvoda f720c43462 - commented out ping thread as it was unused and possibly caused crashing 2010-06-22 14:12:57 +00:00
Mark Vejvoda 622c707c2e - standardized broadcast socket thread shutdown 2010-06-22 12:18:50 +00:00
Mark Vejvoda e091460f40 - attempt to add a client LAG checker to notify and disconnect clients that fall too far behind. 2010-06-15 05:36:07 +00:00
Mark Vejvoda b3b2d098b7 - Fix for IP Address discovery and broadcasting UDP servers 2010-06-14 21:03:23 +00:00
Mark Vejvoda 4debe015ce - more bug fixes found during menu navigation and testing 2010-06-11 04:55:49 +00:00
Mark Vejvoda 3b06db30e9 commented out ping code and added synch check for large comamnds list 2010-06-05 00:00:36 +00:00
Mark Vejvoda f6517183bb small fix for initial ping time 2010-06-04 20:39:23 +00:00
Mark Vejvoda 77049a2db6 updated ping logic 2010-06-04 20:37:42 +00:00
Mark Vejvoda d80a8850b6 updated macro's for platform specific logic 2010-06-04 20:26:15 +00:00
Mark Vejvoda 3acc421404 updated ping code to properly work for windows 2010-06-04 20:11:31 +00:00
Mark Vejvoda ce6068b65a added #defines for win32 2010-06-04 19:55:42 +00:00
Mark Vejvoda 964be91fa9 added ping times to UI 2010-06-04 19:42:58 +00:00
Mark Vejvoda 0069fbf4f0 - added more debug code and fixed a server bug where client connecting at the same time a server opens a slot would result in a crash sometimes. 2010-05-31 06:11:31 +00:00
Mark Vejvoda 272a072ec3 added client socket accept info to debug log as well as some change detection 2010-05-17 06:41:05 +00:00
Mark Vejvoda 319b672e20 added better handling of network connections:
- only listen for new clients on a server if an open slot exists (unconnected)
- for both server and client we wait a max of 10 seconds to receive a proper intro packet or we disconnect (could have connected to / from a non glest application using the same port)
2010-05-12 15:25:56 +00:00
Mark Vejvoda fd2274775e moved threads into base common hiearchy and started an a new cache manager. 2010-04-30 22:54:24 +00:00
Mark Vejvoda d412cb5f79 Added a bunch of NULL pointer guards, changed undertake to cleanup dead units more safely and added more debug tracing 2010-04-20 02:19:37 +00:00
Mark Vejvoda 30c4eb2b96 Added some performance logging capabilities and socket cleanup for new broadcast thread sockets 2010-04-15 01:19:00 +00:00
Mark Vejvoda 8c438b812d Some final fixed related to combined cross platform socket code 2010-04-13 07:29:48 +00:00
Mark Vejvoda 561dd69107 First Attempt at merging socket code into cross platform classes 2010-04-13 06:59:30 +00:00
Mark Vejvoda a5aba5cc66 Bugfix for tracker#: 2985599
- Added better management of UDP broadcast thread when user toggles on/off network slots.
2010-04-12 21:40:57 +00:00
Mark Vejvoda f7df0fd3d4 Bugfix for LAN autofind servers. Needed to change the way we broadcast UDP so that we do it individually for each NIC's broadcast address. (see: http://stackoverflow.com/questions/683624/udp-broadcast-on-all-interfaces) 2010-04-11 07:13:14 +00:00
Mark Vejvoda af87e53bbe Bugfix for trace bug#: 2984991
falling back to english text for scenarios text. 
- Also added more error checking and commented out some excessive debug output statements.
2010-04-11 01:25:06 +00:00
Mark Vejvoda 18249c02bd - Some changes to try to reload textures for win32 when doing alt-enter
- Added better logging and guards in sound and socket classes
2010-04-04 04:14:27 +00:00
Mark Vejvoda a0c0be4d65 Some bug fixes related to file transfer code and user folders 2010-04-03 04:30:28 +00:00
Mark Vejvoda c8019116c5 Slight change to use receiver's IP address instead of manufactured packet info 2010-04-03 02:21:04 +00:00
Mark Vejvoda bc725454fd Added a new menu item in join menu and added a threaded callback system for clients when searching for servers so that the UI doesn't wait for responses 2010-04-02 02:33:32 +00:00
Mark Vejvoda e392f3ca2f Changed posix to use all IP addresses for LAN auto connect 2010-04-01 07:50:15 +00:00
Mark Vejvoda 6c92f188b6 Ported auto-discover LAN connect to win32 2010-04-01 07:46:14 +00:00
Mark Vejvoda 0bcb710606 Added auto-discovery of LAN servers using UDP broadcast. (for now the client must press the A key from the join menu to trigger this) 2010-04-01 06:31:10 +00:00