Commit Graph

48 Commits (57aefa7a85f18719d9e1b799977161f4b7dd7320)

Author SHA1 Message Date
Giel van Schijndel 57aefa7a85 * Use unpack_from, instead of unpack, if multiple items are contained in the same buffer
* Use xrange() instead of range() when looping over its items
  - xrange() is faster and more lightweight as iterable

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7198 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-27 21:30:40 +02:00
Giel van Schijndel 227ecdb1f8 Lobby protocol: Workaround the fact that the 2.0.x versions don't perform endian swapping
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7197 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-27 21:30:40 +02:00
Giel van Schijndel 322c10e7a4 * Use struct.Struct objects instead of free functions from the "struct" module to perform encoding and decoding
* Perform version range comparisons like this: lowest_version <= version < one_higher_than_largest_version

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7196 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-27 21:30:39 +02:00
Giel van Schijndel 9ff472fad5 Fix a syntax and semantical error:
* Use the % operator for formatting strings
 * Use struct.unpack for decoding a struct (instead of struct.pack)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7195 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-27 21:30:39 +02:00
Giel van Schijndel 8bfd2acef1 Use a single function to perform the encoding as a C string
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7194 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-27 21:30:39 +02:00
Giel van Schijndel cffa0b65af Make BinaryProtocol more flexible to allow it to work with 2.0+ as well as the 2.2 lobby protocol (depending on what parameter was used during construction)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7128 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 16:03:19 +02:00
Giel van Schijndel 7f5bc28bd0 Move the Game, Protocol classes to files of their own (to allow them to be reused by the IRC bot, instead of duplicating code)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7127 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 16:03:19 +02:00
Giel van Schijndel f95bcd605b Move the IRC bot to the same directory as the lobby server
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7126 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-22 13:18:35 +02:00
Giel van Schijndel ead99ec654 Properly align the "private" property
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7090 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-20 15:31:23 +02:00
Giel van Schijndel 8d5b42fe96 Lets consistently use TABs for indentation (instead of mixing with spaces)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7089 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-20 15:31:23 +02:00
Giel van Schijndel e399b2562c Split out the protocol from the Game class into a separate BinaryProtocol(Protocol) class
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7088 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-20 15:31:23 +02:00
Giel van Schijndel 4aa8982d0a * Save Game's data in a dictionary for easier access at some locations
- This additionally make is possible to split out the lobby protocol into a separate class later on
 * Show exception's messages when exceptions occur

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7087 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-20 15:31:22 +02:00
Giel van Schijndel 72d1881464 Remove trailing whitespace
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7086 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-20 15:31:22 +02:00
Buginator 562ade5d29 Use the correct version of the masterserver file
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7080 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-19 23:45:25 +02:00
Buginator c2e5d2462f Adds password support to warzone.
Adds feedback from the lobby server.

Notes: You have to enter a password *first*, and then either host the game, or join a game.

Thanks to elio for the new icons!


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7079 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-19 23:45:25 +02:00
Giel van Schijndel bd04dd7378 Make the lobby server executable
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7073 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-19 23:45:24 +02:00
Buginator e1c91576c9 Game server port is now 2100
Master server port is now 9990 

Updated masterserver python program as well.

merge: r6994

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7018 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-12 14:12:07 +02:00
Dennis Schridde aac41748dc Bump copyright
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6617 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 18:01:48 +00:00
Buginator 2df15ab5c6 Fixes endian issue with master server code.
We always want the structure packed to be 'network byte order' (big-endian).

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5728 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-01 18:11:00 +00:00
Dennis Schridde 387fbd52d3 Typo in masterserver
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4437 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-30 17:30:19 +00:00
Dennis Schridde 7a688bdf45 Better debug output
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4386 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 12:08:13 +00:00
Dennis Schridde 40a2257a31 Fix NameError, Remove code duplication by using private method, Move private methods to top
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4385 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 12:02:37 +00:00
Dennis Schridde 9acf48f307 Check games every 100 requests
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4375 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 16:47:06 +00:00
Dennis Schridde 8370aa874c Use globals
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4372 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 15:49:26 +00:00
Dennis Schridde 132c61b913 test->check + cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4371 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 15:45:59 +00:00
Dennis Schridde 88cf9281ed Move vitality test into game class
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4370 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 14:23:46 +00:00
Dennis Schridde 227976de92 Move debug message (gamedb has its own header, no need to repeat it)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4369 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 14:22:32 +00:00
Dennis Schridde c7824914e0 Mention client IP in debug messages
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4368 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 14:17:33 +00:00
Dennis Schridde d85628ef27 gdb->gamedb and dont let struct.error raise over handle()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4367 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 14:09:44 +00:00
Dennis Schridde 4108ad54fc Fix "AttributeError: Game instance has no attribute 'requestHandler'"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4366 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 14:03:42 +00:00
Dennis Schridde 7a08a17a6b Indention Bug (tm)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4365 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 13:09:14 +00:00
Dennis Schridde 39a4686df7 Mistake in last commit
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4364 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 12:48:08 +00:00
Dennis Schridde 6ab996879b Cleanup indention
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4363 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 12:45:12 +00:00
Dennis Schridde 39f34056a9 Import from __future__ has to be first in file. Additionaly let the lobby tester connect to lobby.wz2100.net
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4234 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 00:33:16 +00:00
Giel van Schijndel 748adec208 Use network byte order for struct unpacking on the lobby server (rather than native byte ordering)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3666 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-03 16:51:56 +00:00
Dennis Schridde d21c8a2753 Correcting germanified Gerard...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3140 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-23 18:43:43 +00:00
Dennis Schridde c9e197c902 Improved MasterServer by Gerhard Schaden, patch #893.
Depends on Python 2.5, but we should have that on the server very soon.
Should effectively help fight ghostgames and also be easily extensible in the future. (Gerhard talked about a web-interface with admin functions. :) )


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3139 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-23 18:40:10 +00:00
Dennis Schridde 3c7898d1c3 Add fancy author/version/doc headers to masterserver
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3120 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 15:21:11 +00:00
Gerard Krol 49958fcc6b Expire games that were updated > 1 hour ago.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3114 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-21 20:51:06 +00:00
Dennis Schridde b3f62323d4 This time fix it really. Thanks EvilGuru.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1967 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 16:29:15 +00:00
Dennis Schridde 1a61e63fc4 Fix a mistake which resulted in infinite loops and horrendously big logfiles. Thanks to Kamaze and EvilGuru.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1966 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 16:18:04 +00:00
Dennis Schridde 3acbbe97a3 Remove the gameData from the list even if we couldn't read the new data.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1956 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-24 16:38:07 +00:00
Dennis Schridde 6a40fa81cf Use allow_reuse_address correctly.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1952 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-23 23:14:05 +00:00
Dennis Schridde 69aefb6909 - Rename lobbyDev to lobbyDbg
- Add debug output to gameserver sanity check
- Set the connection-check timeout to 10s
- Allow reusing of the masterserver address since otherwise lobbyserver restarts don't work immediately


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1951 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-23 23:01:07 +00:00
Dennis Schridde 460fd94d47 - Don't list wrongly configured gameservers (eg. behind a NAT)
- Try to fix len(None) (TypeError: len() of unsized object)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1950 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-23 22:27:14 +00:00
Giel van Schijndel 0a590a79af * Use network byte-order (big-endian) for size of game list as response to "list" command
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1629 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-13 18:19:22 +00:00
Gerard Krol 2055a59020 Fix "ghost" games, and allow for updating the game state when hosting a game without having to disconnect and reconnect.
This will have to be implemented in the game as well.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1581 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-01 21:01:32 +00:00
Dennis Schridde 2674023d77 New masterserver by Gerard and Kamaze
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1514 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-21 14:20:20 +00:00