* GameLobby::gameLock now has a separate file
* GameLobby::const_iterator now also has a separate file
* move class RAIICounter to files of its own for ease of reusability
* remove dummy game (from lobbyprotocol::requestHandler in requesthandler.cpp)
* Remove commented out code (main.cpp)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1650 4a71c877-e1ca-e34f-864e-861f7616d084
* Add new class lobbyprotocol::requestHandler which deals with protocol specific tasks
* Move all protocol dependant code from class GameLobby to lobbyprotocol::requestHandler
* Add some comments to code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1649 4a71c877-e1ca-e34f-864e-861f7616d084
* Modify class TCPServer to take a boost::asio::ip::tcp::endpoint for member-function listen instead of a port number
* Now use command line arguments for addresses to listen on (on each of those addresses we open port 9998 still)
* Fix wrongly named include guards (lobby.hpp)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1646 4a71c877-e1ca-e34f-864e-861f7616d084
* handles incoming connections from TCPServer (functions properly now)
* uses an std::list to store GAMESTRUCTs in
* uses ReadWriteMutex for multithreading synchronisation
* handles "addg" requests
* handles game persistence (with specialized "game" locks, which will die along with the connection)
* handles "list" requests
* dumps the entire list of current games to the user
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1645 4a71c877-e1ca-e34f-864e-861f7616d084
This class allows multiple readers to obtain a lock at the same time. Until a writer attempts to obtain a lock, then attempts by readers to lock will block. Also second writers that attempt to lock will block until the first releases its lock.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1644 4a71c877-e1ca-e34f-864e-861f7616d084
* Add asynchronous TCP server class: TCPServer
* Add comparison operators for SESSIONDESC and GAMESTRUCT respectively
* Add -D_WIN32_WINNT=0x0501 to the compiletime options (needed for Boost::Asio on WinXP, 2k needs -D_WIN32_WINNT=0x0500, GNU/Linux systems define it themselves automatically)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1643 4a71c877-e1ca-e34f-864e-861f7616d084
* move inclusion of definition of GAMESTRUCT to new header file game.hpp
* Allow game.hpp including files to be compiled without SDL (useful for crosscompiling), by internally (in game.hpp) declaring GAMESTRUCT as well
* Stay connected when an "addg" command is received (client needs to disconnect to indicate the game should be removed from the lobbylist)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1642 4a71c877-e1ca-e34f-864e-861f7616d084
* switch to using IPv4 instead of IPv6 (for testing)
* Use correct buffersize for retrieval of a command/method (5 bytes/chars right now, ought to be NUL-terminated)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1641 4a71c877-e1ca-e34f-864e-861f7616d084
r1638. Exception handler still removed if WZ_OS_MAC is set.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1640 4a71c877-e1ca-e34f-864e-861f7616d084
(one of my first, and probably ugly, versions, going to commit incrementally till the last)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1639 4a71c877-e1ca-e34f-864e-861f7616d084
Thanks to Kim <lav-coyote> for noting the comment about the playstation compiler reason
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1636 4a71c877-e1ca-e34f-864e-861f7616d084
- WZ_OS_MAC && DEBUG implies --debug all so that Console.app can be used
to view debugging output on debug builds when launching from Finder
- DEBUG flag re-added to Debug builds in Xcode project; was removed
accidentally at some point
- WZ_OS_MAC no longer implies WZ_OS_UNIX; handled separately where
necessary
- Do not use Warzone's crash handler since Mac OS X provides a good
crash reporter already that just saves the crash log, with lots of
useful information, to ~/Library/Logs/CrashReporter/Warzone.crash.log
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1635 4a71c877-e1ca-e34f-864e-861f7616d084
* Remove parameter `BOOL async` of NETfindGame since it wasn't used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1628 4a71c877-e1ca-e34f-864e-861f7616d084
(This function was only used to generate a hash from the compiled Warzone executable, this hash was then used as a security value across the network. This method won't work when using different compilers, OSes, etc.)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1624 4a71c877-e1ca-e34f-864e-861f7616d084
- Move wzFPSmanager over to main.c, so the delay can be dealt with directly in the mainloop instead of the detour through frameUpdate
- Adding the functions directly to main.c is probably not the wisest idea, but may be fixed later
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1623 4a71c877-e1ca-e34f-864e-861f7616d084
- Split the mainloop into several (run) subfunctions
- start/stop functions for (de)initialization. This replaces the !Restart part
- removed necessity of several variables
- This is the last step before the event based mainloop
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1622 4a71c877-e1ca-e34f-864e-861f7616d084
* Add some debug messages for the cases where map_Height receives negative SDWORDs passed as if they are UDWORDs
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1614 4a71c877-e1ca-e34f-864e-861f7616d084
* fix coding style (i.e. replaced four spaces for one '\t')
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1613 4a71c877-e1ca-e34f-864e-861f7616d084
- removed asserts for off-map coords which were making the game completely unplayable (crashes wz after 3 mins of play in mp)
NOTE: if someone will decide to remove the checks please fix the problems caused by the removal to make sure the game is still playable
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1611 4a71c877-e1ca-e34f-864e-861f7616d084
* When receiving an SDL_ACTIVEEVENT also check for SDL_APPMOUSEFOCUS, but don't loose focus because of it, only gain focus when receiving this
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1605 4a71c877-e1ca-e34f-864e-861f7616d084