diff options
author | Livio Recchia <recchialivio@libero.it> | 2020-04-06 18:52:41 +0000 |
---|---|---|
committer | Livio Recchia <recchialivio@libero.it> | 2020-04-06 18:52:41 +0000 |
commit | 62586ad1ba399cf0d964ca7123e0e257fc0956d8 (patch) | |
tree | 49b37cd6d91b426d7eef5bfc31171751e9d3b8d2 | |
parent | f7b7ec66d47369e735c297372a1956038d9eed39 (diff) | |
parent | 076d5f3cdde1f21c6ff75962ae3f6ac0e5a5c303 (diff) | |
download | manachat-62586ad1ba399cf0d964ca7123e0e257fc0956d8.tar.gz manachat-62586ad1ba399cf0d964ca7123e0e257fc0956d8.tar.bz2 manachat-62586ad1ba399cf0d964ca7123e0e257fc0956d8.tar.xz manachat-62586ad1ba399cf0d964ca7123e0e257fc0956d8.zip |
Merge branch 'jak1/structuring_test' into 'master'
Jak1/structuring test
See merge request liviorecchia/manachat!2
-rw-r--r-- | .gitignore | 4 | ||||
-rwxr-xr-x | config/.placeholder (renamed from bot/.placeholder) | 0 | ||||
-rw-r--r-- | config/manachat.ini.template | 35 | ||||
-rwxr-xr-x | config/shopAdmins.txt (renamed from shopAdmins.txt) | 0 | ||||
-rwxr-xr-x | config/shoplist.txt (renamed from shoplist.txt) | 0 | ||||
-rwxr-xr-x | curses/tmwcli.py | 6 | ||||
-rwxr-xr-x | db/itemdb.txt (renamed from itemdb.txt) | 0 | ||||
-rwxr-xr-x | db/mapdb.zip (renamed from mapdb.zip) | bin | 256414 -> 256414 bytes | |||
-rwxr-xr-x | db/mapnames.txt (renamed from mapnames.txt) | 0 | ||||
-rwxr-xr-x | db/monsterdb.txt (renamed from monsterdb.txt) | 0 | ||||
-rwxr-xr-x | gui/managui.py | 4 | ||||
-rwxr-xr-x | gui/tmxmap.py | 2 | ||||
-rwxr-xr-x | headless.py | 2 | ||||
-rwxr-xr-x | itemdb.py | 2 | ||||
-rwxr-xr-x | mapnames.py | 2 | ||||
-rwxr-xr-x | monsterdb.py | 2 | ||||
-rwxr-xr-x | plugins/manaboy.py | 10 | ||||
-rwxr-xr-x | plugins/shop.py | 4 | ||||
-rwxr-xr-x | runshop.py | 4 | ||||
-rwxr-xr-x | simple.py | 6 |
20 files changed, 59 insertions, 24 deletions
@@ -1,6 +1,6 @@ #configuration files -manachat.ini -bot/*.txt +config/manachat.ini +config/*.txt #compiled python files *.pyc diff --git a/bot/.placeholder b/config/.placeholder index e69de29..e69de29 100755 --- a/bot/.placeholder +++ b/config/.placeholder diff --git a/config/manachat.ini.template b/config/manachat.ini.template new file mode 100644 index 0000000..ba34d3b --- /dev/null +++ b/config/manachat.ini.template @@ -0,0 +1,35 @@ +[Server] +host = 52.174.196.146 +port = 6901 + +[Player] +username = * +password = * +charname = * + +[Other] +online_txt_url = http://server.themanaworld.org/online.txt +log_network_packets = 0 + +[Plugins] +autospell = 0 +msgqueue = 0 +chatlogfile = 0 +shop = 1 +autofollow = 0 +manaboy = 1 + +[msgqueue] +net.mapserv.cmsg_chat_whisper = 7.5 + +[notify] +notif_timeout = 7000 +notif_sound = 1 + +[chatlogfile] +chatlog_dir = chatlogs + +[shop] +timeout = 60 +shoplist_txt = config/shoplist.txt +admins_file = config/shopAdmins.txt diff --git a/shopAdmins.txt b/config/shopAdmins.txt index ede5d01..ede5d01 100755 --- a/shopAdmins.txt +++ b/config/shopAdmins.txt diff --git a/shoplist.txt b/config/shoplist.txt index 39c6278..39c6278 100755 --- a/shoplist.txt +++ b/config/shoplist.txt diff --git a/curses/tmwcli.py b/curses/tmwcli.py index 679019b..93ae52d 100755 --- a/curses/tmwcli.py +++ b/curses/tmwcli.py @@ -80,7 +80,7 @@ if __name__ == "__main__": if len(sys.argv) > 1: config.read(sys.argv[1]) else: - config.read('../manachat.ini') + config.read('../config/manachat.ini') rootLogger = logging.getLogger('') rootLogger.addHandler(logging.NullHandler()) @@ -107,8 +107,8 @@ if __name__ == "__main__": plugins.load_plugins(config) - monsterdb.read_monster_db('../monsterdb.txt') - itemdb.load_itemdb('../itemdb.txt') + monsterdb.read_monster_db('../db/monsterdb.txt') + itemdb.load_itemdb('../db/itemdb.txt') online_users = OnlineUsers(config.get('Other', 'online_txt_url')) online_users.start() diff --git a/itemdb.txt b/db/itemdb.txt Binary files differindex c89df34..c89df34 100755 --- a/itemdb.txt +++ b/db/itemdb.txt diff --git a/mapnames.txt b/db/mapnames.txt index 03bc6a4..03bc6a4 100755 --- a/mapnames.txt +++ b/db/mapnames.txt diff --git a/monsterdb.txt b/db/monsterdb.txt index 74c5bbe..74c5bbe 100755 --- a/monsterdb.txt +++ b/db/monsterdb.txt diff --git a/gui/managui.py b/gui/managui.py index d9d4976..9a72fd7 100755 --- a/gui/managui.py +++ b/gui/managui.py @@ -16,7 +16,7 @@ from kivy.uix.popup import Popup from kivy.config import ConfigParser config = ConfigParser() -config.read("manachat.ini") +config.read("config/manachat.ini") import monsterdb import itemdb @@ -91,7 +91,7 @@ class ManaGuiApp(App): netlog.addHandler(fh) monsterdb.read_monster_db() - itemdb.load_itemdb('itemdb.txt') + itemdb.load_itemdb('db/itemdb.txt') dbgh = DebugLogHandler(self) dbgh.setFormatter(logging.Formatter("[%(asctime)s] %(message)s", diff --git a/gui/tmxmap.py b/gui/tmxmap.py index 800868e..58ee490 100755 --- a/gui/tmxmap.py +++ b/gui/tmxmap.py @@ -82,7 +82,7 @@ class MapWidget(Image): def load_map(self, name, *args): if name not in self.maps: Logger.info("Caching map %s", name) - zf = zipfile.ZipFile('mapdb.zip', 'r') + zf = zipfile.ZipFile('db/mapdb.zip', 'r') self.maps[name] = pickle.load(zf.open(name + '.pickle')) zf.close() # m = pytmx.TiledMap(filename=filename) diff --git a/headless.py b/headless.py index 59d17c6..054314a 100755 --- a/headless.py +++ b/headless.py @@ -35,7 +35,7 @@ if __name__ == '__main__': level=logging.INFO, datefmt="%Y-%m-%d %H:%M:%S") - config_ini = 'manachat.ini' + config_ini = 'config/manachat.ini' if len(sys.argv) > 1: if sys.argv[1].endswith('.ini') and os.path.isfile(sys.argv[1]): config_ini = sys.argv[1] @@ -4,7 +4,7 @@ from loggers import debuglog item_names = {0: 'GP'} -def load_itemdb(dbfile='itemdb.txt'): +def load_itemdb(dbfile='db/itemdb.txt'): with open(dbfile, 'rt') as f: for l in f.readlines(): try: diff --git a/mapnames.py b/mapnames.py index 5c01280..612908b 100755 --- a/mapnames.py +++ b/mapnames.py @@ -2,7 +2,7 @@ map_names = {} -def read_map_names(file='mapnames.txt'): +def read_map_names(file='db/mapnames.txt'): with open(file) as f: for l in f.readlines(): try: diff --git a/monsterdb.py b/monsterdb.py index 5235b5f..a4cfd1e 100755 --- a/monsterdb.py +++ b/monsterdb.py @@ -2,7 +2,7 @@ monster_db = {} -def read_monster_db(file='monsterdb.txt'): +def read_monster_db(file='db/monsterdb.txt'): with open(file) as f: for l in f.readlines(): try: diff --git a/plugins/manaboy.py b/plugins/manaboy.py index f5c3d80..76f81d3 100755 --- a/plugins/manaboy.py +++ b/plugins/manaboy.py @@ -31,11 +31,11 @@ def preloadArray(nfile): except: print "preloadArray: File " + nfile + " not found!" -joke_answers = preloadArray("bot/jokes.txt") -ignored_players = preloadArray("bot/ignored.txt") -disliked_players = preloadArray("bot/disliked.txt") -admins = preloadArray("bot/admins.txt") -friends = preloadArray("bot/friends.txt") +joke_answers = preloadArray("config/jokes.txt") +ignored_players = preloadArray("config/ignored.txt") +disliked_players = preloadArray("config/disliked.txt") +admins = preloadArray("config/admins.txt") +friends = preloadArray("config/friends.txt") # ====================== XECUTE ============= diff --git a/plugins/shop.py b/plugins/shop.py index be66cea..cf8a113 100755 --- a/plugins/shop.py +++ b/plugins/shop.py @@ -27,8 +27,8 @@ PLUGIN = { 'blocks': (), 'default_config' : { 'timeout' : 60, - 'shoplist_txt' : 'shoplist.txt', - 'admins_file' : 'shopAdmins.txt' + 'shoplist_txt' : 'config/shoplist.txt', + 'admins_file' : 'config/shopAdmins.txt' } } @@ -46,9 +46,9 @@ if __name__ == '__main__': shoplog.addHandler(dbgh) config = ConfigParser() - config.read('manachat.ini') + config.read('config/manachat.ini') - load_itemdb('itemdb.txt') + load_itemdb('db/itemdb.txt') plugins.load_plugins(config) @@ -95,7 +95,7 @@ if __name__ == '__main__': debuglog.addHandler(dbgh) debuglog.setLevel(logging.INFO) - config_ini = 'manachat.ini' + config_ini = 'config/manachat.ini' if len(sys.argv) > 1: if sys.argv[1].endswith('.ini') and os.path.isfile(sys.argv[1]): config_ini = sys.argv[1] @@ -111,8 +111,8 @@ if __name__ == '__main__': fh.setFormatter(fmt) netlog.addHandler(fh) - load_itemdb('itemdb.txt') - read_monster_db('monsterdb.txt') + load_itemdb('db/itemdb.txt') + read_monster_db('db/monsterdb.txt') plugins.load_plugins(config) |