|
@@ -8,6 +8,18 @@ import base64
|
|
import os
|
|
import os
|
|
import textwrap
|
|
import textwrap
|
|
import sys
|
|
import sys
|
|
|
|
+import re
|
|
|
|
+
|
|
|
|
+def rot47(s):
|
|
|
|
+ x = ''
|
|
|
|
+ for c in s:
|
|
|
|
+ j = ord(c)
|
|
|
|
+ if j >= 33 and j <= 126:
|
|
|
|
+ x += chr(33+ ((j+14) % 94))
|
|
|
|
+ else:
|
|
|
|
+ x += c
|
|
|
|
+ return x
|
|
|
|
+
|
|
|
|
|
|
base_path = "/messagebase"
|
|
base_path = "/messagebase"
|
|
|
|
|
|
@@ -46,6 +58,7 @@ bases = {
|
|
"FSXNET-Magicka": "fsx_mag",
|
|
"FSXNET-Magicka": "fsx_mag",
|
|
"FSXNET-Mystic": "fsx_mys",
|
|
"FSXNET-Mystic": "fsx_mys",
|
|
"FSXNET-Enigma": "fsx_eng",
|
|
"FSXNET-Enigma": "fsx_eng",
|
|
|
|
+ "FSXNET-Data": "fsx_dat",
|
|
# "HappyNet-General": "msgs/hpy_gen",
|
|
# "HappyNet-General": "msgs/hpy_gen",
|
|
}
|
|
}
|
|
|
|
|
|
@@ -78,6 +91,8 @@ def bbs_get_messages(area):
|
|
return messages
|
|
return messages
|
|
|
|
|
|
|
|
|
|
|
|
+MATCH1 = re.compile(">>> BEGIN(.*)>>> END", re.DOTALL)
|
|
|
|
+
|
|
def bbs_message(area, msgno):
|
|
def bbs_message(area, msgno):
|
|
global dbc
|
|
global dbc
|
|
|
|
|
|
@@ -89,7 +104,8 @@ def bbs_message(area, msgno):
|
|
)
|
|
)
|
|
row = dbc.fetchone()
|
|
row = dbc.fetchone()
|
|
stamp = pendulum.parse(row[4]).timestamp()
|
|
stamp = pendulum.parse(row[4]).timestamp()
|
|
- return {
|
|
|
|
|
|
+
|
|
|
|
+ data = {
|
|
"MsgNum": row[0],
|
|
"MsgNum": row[0],
|
|
"number": row[0],
|
|
"number": row[0],
|
|
"to": row[1],
|
|
"to": row[1],
|
|
@@ -105,6 +121,15 @@ def bbs_message(area, msgno):
|
|
# // processed
|
|
# // processed
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (area == 'fsx_dat') and ('>>> BEGIN' in row[5]):
|
|
|
|
+ body = row[5] + "\n"
|
|
|
|
+ result = MATCH1.search(body)
|
|
|
|
+ if result:
|
|
|
|
+ data['rot47'] = rot47(result.group(1)).lstrip("\n").replace("\n", "<br />")
|
|
|
|
+
|
|
|
|
+ return data
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
# bases = {"FSX_BOT": "fsx_bot"}
|
|
# bases = {"FSX_BOT": "fsx_bot"}
|
|
|
|
|