diff --git a/core/allnet.py b/core/allnet.py
index 2fd6db2..6610c23 100644
--- a/core/allnet.py
+++ b/core/allnet.py
@@ -176,18 +176,18 @@ class AllnetServlet:
else AllnetJapanRegionId.AICHI.value
)
resp.region_name0 = (
- arcade["country"]
- if arcade["country"] is not None
- else AllnetCountryCode.JAPAN.value
- )
- resp.region_name1 = (
arcade["state"]
if arcade["state"] is not None
else AllnetJapanRegionId.AICHI.name
)
+ resp.region_name1 = (
+ arcade["country"]
+ if arcade["country"] is not None
+ else AllnetCountryCode.JAPAN.value
+ )
resp.region_name2 = arcade["city"] if arcade["city"] is not None else ""
- resp.client_timezone = (
- arcade["timezone"] if arcade["timezone"] is not None else "+0900"
+ resp.client_timezone = ( # lmao
+ arcade["timezone"] if arcade["timezone"] is not None else "+0900" if req.format_ver == 3 else "+09:00"
)
if req.game_id not in self.uri_registry:
@@ -295,7 +295,6 @@ class AllnetServlet:
return self.to_dfi(res_str)"""
return res_str
-
def handle_dlorder_ini(self, request: Request, match: Dict) -> bytes:
if "file" not in match:
diff --git a/core/data/schema/arcade.py b/core/data/schema/arcade.py
index 31d48f6..ce7c30a 100644
--- a/core/data/schema/arcade.py
+++ b/core/data/schema/arcade.py
@@ -218,9 +218,16 @@ class ArcadeData(BaseData):
return True
- def find_arcade_by_name(self, name: str) -> List[Row]:
+ def get_arcade_by_name(self, name: str) -> Optional[List[Row]]:
sql = arcade.select(or_(arcade.c.name.like(f"%{name}%"), arcade.c.nickname.like(f"%{name}%")))
result = self.execute(sql)
if result is None:
- return False
+ return None
+ return result.fetchall()
+
+ def get_arcades_by_ip(self, ip: str) -> Optional[List[Row]]:
+ sql = arcade.select().where(arcade.c.ip == ip)
+ result = self.execute(sql)
+ if result is None:
+ return None
return result.fetchall()
diff --git a/core/frontend.py b/core/frontend.py
index 7b028ee..0ee2211 100644
--- a/core/frontend.py
+++ b/core/frontend.py
@@ -21,6 +21,7 @@ class IUserSession(Interface):
userId = Attribute("User's ID")
current_ip = Attribute("User's current ip address")
permissions = Attribute("User's permission level")
+ ongeki_version = Attribute("User's selected Ongeki Version")
class PermissionOffset(Enum):
USER = 0 # Regular user
@@ -36,6 +37,7 @@ class UserSession(object):
self.userId = 0
self.current_ip = "0.0.0.0"
self.permissions = 0
+ self.ongeki_version = 7
class FrontendServlet(resource.Resource):
@@ -304,9 +306,9 @@ class FE_System(FE_Base):
def render_GET(self, request: Request):
uri = request.uri.decode()
template = self.environment.get_template("core/frontend/sys/index.jinja")
- usrlist = []
- aclist = []
- cablist = []
+ usrlist: List[Dict] = []
+ aclist: List[Dict] = []
+ cablist: List[Dict] = []
sesh: Session = request.getSession()
usr_sesh = IUserSession(sesh)
@@ -339,6 +341,7 @@ class FE_System(FE_Base):
ac_id_search = uri_parse.get("arcadeId")
ac_name_search = uri_parse.get("arcadeName")
ac_user_search = uri_parse.get("arcadeUser")
+ ac_ip_search = uri_parse.get("arcadeIp")
if ac_id_search is not None:
u = self.data.arcade.get_arcade(ac_id_search[0])
@@ -346,14 +349,22 @@ class FE_System(FE_Base):
aclist.append(u._asdict())
elif ac_name_search is not None:
- ul = self.data.arcade.find_arcade_by_name(ac_name_search[0])
- for u in ul:
- aclist.append(u._asdict())
+ ul = self.data.arcade.get_arcade_by_name(ac_name_search[0])
+ if ul is not None:
+ for u in ul:
+ aclist.append(u._asdict())
elif ac_user_search is not None:
ul = self.data.arcade.get_arcades_managed_by_user(ac_user_search[0])
- for u in ul:
- aclist.append(u._asdict())
+ if ul is not None:
+ for u in ul:
+ aclist.append(u._asdict())
+
+ elif ac_ip_search is not None:
+ ul = self.data.arcade.get_arcades_by_ip(ac_ip_search[0])
+ if ul is not None:
+ for u in ul:
+ aclist.append(u._asdict())
elif uri.startswith("/sys/lookup.cab?"):
uri_parse = parse.parse_qs(uri.replace("/sys/lookup.cab?", "")) # lop off the first bit
diff --git a/core/frontend/index.jinja b/core/frontend/index.jinja
index 7e4a1ca..3dacbe5 100644
--- a/core/frontend/index.jinja
+++ b/core/frontend/index.jinja
@@ -4,6 +4,7 @@
{{ title }}
+
diff --git a/core/frontend/sys/index.jinja b/core/frontend/sys/index.jinja
index 2da821e..120051a 100644
--- a/core/frontend/sys/index.jinja
+++ b/core/frontend/sys/index.jinja
@@ -8,8 +8,8 @@