Add source module to mumo

The source module is inspired by the bf2 module and is supposed to allow on-the-fly context/identity based player management for source engine based games. Currently supported games are TF2, DOD:S, CStrike:Source and HL2DM.

This commit adds the basic structure with unit tests for many of the components. For now only dynamic channel creation and player movement is implemented.

Left todo are dynamic ACL/Group management, unused channel deletion, server channel re-use and, most importantly, actual testing beyond the small unit test coverage.
This commit is contained in:
Stefan Hacker
2013-02-25 10:12:19 +01:00
parent 0ac8b542a9
commit 4b61aa2fec
10 changed files with 1242 additions and 4 deletions

View File

@@ -55,6 +55,7 @@ somestr = Blabla
somenum = 10
testfallbacknum = asdas
blubber = Things %(doesnotexistsasdefault)s
serverregex = ^\[[\w\d\-\(\):]{1,20}\]$
[Server_10]
value = False
[Server_9]
@@ -66,7 +67,8 @@ value = True
('somestr', str, "fail"),
('somenum', int, 0),
('somenumtest', int, 1),
('blubber', str, "empty")),
('blubber', str, "empty"),
('serverregex', re.compile, '.*')),
(lambda x: re.match("Server_\d+",x)):(('value', x2bool, True),),
'somethingelse':(('bla', str, "test"),)}
@@ -121,6 +123,7 @@ value = True
assert(cfg.world.somenum == 10)
self.assertRaises(AttributeError, getattr, cfg.world, "testfallbacknum")
self.assertEqual(cfg.world.blubber, "Things %(doesnotexistsasdefault)s")
self.assertEqual(cfg.world.serverregex, re.compile("^\[[\w\d\-\(\):]{1,20}\]$"))
assert(cfg.somethingelse.bla == "test")
assert(cfg.Server_10.value == False)
assert(cfg.Server_2.value == True)