aboutsummaryrefslogtreecommitdiff
path: root/modules/players.py
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-11-07 15:35:55 +0100
committerKarel Kočí <cynerd@email.cz>2015-11-07 15:35:55 +0100
commitccc21b09f752d583e3fdca694cd94e61a9fbaa69 (patch)
tree1cf19174ddcbd39c2dc05557823b5f7d9fc169ec /modules/players.py
parent2a7c2861b69da4570e90be17ad5e0f36b3ec0527 (diff)
downloadmcserver-wrapper-ccc21b09f752d583e3fdca694cd94e61a9fbaa69.tar.gz
mcserver-wrapper-ccc21b09f752d583e3fdca694cd94e61a9fbaa69.tar.bz2
mcserver-wrapper-ccc21b09f752d583e3fdca694cd94e61a9fbaa69.zip
Remove modules
Modules are not used any more. They are now useless.
Diffstat (limited to 'modules/players.py')
-rw-r--r--modules/players.py52
1 files changed, 0 insertions, 52 deletions
diff --git a/modules/players.py b/modules/players.py
deleted file mode 100644
index 91e50b6..0000000
--- a/modules/players.py
+++ /dev/null
@@ -1,52 +0,0 @@
-import os
-import sys
-import re
-import utils
-from utils import conf
-
-services = (
- utils.Service.config,
- utils.Service.init,
- utils.Service.clean,
- utils.Service.parse
- )
-
-players = set()
-
-def config(conf):
- conf.playersFile = conf.folder + '/players'
-
-def init():
- with open(conf.playersFile, 'w') as f:
- pass
-
-def clean():
- os.remove(conf.playersFile)
-
-def parse(line):
- if 'logged in with entity id' in line:
- name = line[len('[00:00:00] [Server thread/INFO]: '):]
- name = name[:name.index('[')]
- __user_join__(name)
- elif 'left the game' in line:
- name = line[len('[00:00:00] [Server thread/INFO]: '):]
- name = name[:name.index(' ')]
- __user_leave__(name)
- else:
- return False
- return True
-
-
-def __user_join__(username):
- print("User '" + username + "' joined server.")
- with open(conf.playersFile, 'a') as f:
- players.add(username)
- f.write(username + '\n')
-
-def __user_leave__(username):
- print("User '" + username + "' left server.")
- players.remove(username)
- with open(conf.playersFile, 'w') as f:
- f.writelines(players)
- if players:
- f.write('\n')