summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLivio Recchia <recchialivio@libero.it>2020-04-06 18:52:41 +0000
committerLivio Recchia <recchialivio@libero.it>2020-04-06 18:52:41 +0000
commit62586ad1ba399cf0d964ca7123e0e257fc0956d8 (patch)
tree49b37cd6d91b426d7eef5bfc31171751e9d3b8d2
parentf7b7ec66d47369e735c297372a1956038d9eed39 (diff)
parent076d5f3cdde1f21c6ff75962ae3f6ac0e5a5c303 (diff)
downloadmanachat-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--.gitignore4
-rwxr-xr-xconfig/.placeholder (renamed from bot/.placeholder)0
-rw-r--r--config/manachat.ini.template35
-rwxr-xr-xconfig/shopAdmins.txt (renamed from shopAdmins.txt)0
-rwxr-xr-xconfig/shoplist.txt (renamed from shoplist.txt)0
-rwxr-xr-xcurses/tmwcli.py6
-rwxr-xr-xdb/itemdb.txt (renamed from itemdb.txt)0
-rwxr-xr-xdb/mapdb.zip (renamed from mapdb.zip)bin256414 -> 256414 bytes
-rwxr-xr-xdb/mapnames.txt (renamed from mapnames.txt)0
-rwxr-xr-xdb/monsterdb.txt (renamed from monsterdb.txt)0
-rwxr-xr-xgui/managui.py4
-rwxr-xr-xgui/tmxmap.py2
-rwxr-xr-xheadless.py2
-rwxr-xr-xitemdb.py2
-rwxr-xr-xmapnames.py2
-rwxr-xr-xmonsterdb.py2
-rwxr-xr-xplugins/manaboy.py10
-rwxr-xr-xplugins/shop.py4
-rwxr-xr-xrunshop.py4
-rwxr-xr-xsimple.py6
20 files changed, 59 insertions, 24 deletions
diff --git a/.gitignore b/.gitignore
index 77c453b..6610404 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
index c89df34..c89df34 100755
--- a/itemdb.txt
+++ b/db/itemdb.txt
diff --git a/mapdb.zip b/db/mapdb.zip
index 0efdc80..0efdc80 100755
--- a/mapdb.zip
+++ b/db/mapdb.zip
Binary files differ
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]
diff --git a/itemdb.py b/itemdb.py
index 34bde26..593699f 100755
--- a/itemdb.py
+++ b/itemdb.py
@@ -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'
}
}
diff --git a/runshop.py b/runshop.py
index 22fd740..b126fdf 100755
--- a/runshop.py
+++ b/runshop.py
@@ -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)
diff --git a/simple.py b/simple.py
index f68553f..e96cc1d 100755
--- a/simple.py
+++ b/simple.py
@@ -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)