diff --git a/_tools/import_buffs.py b/_tools/import_buffs.py deleted file mode 100644 index 2f567fb..0000000 --- a/_tools/import_buffs.py +++ /dev/null @@ -1,38 +0,0 @@ -import os -import json -import psycopg2 -import requests -import tempfile -from dotenv import load_dotenv - -load_dotenv("../.env") - -db = psycopg2.connect( - host=os.getenv("POSTGRES_HOST"), - user=os.getenv("POSTGRES_USER"), - password=os.getenv("POSTGRES_PASSWORD"), - database=os.getenv("POSTGRES_DB"), - port=os.getenv("POSTGRES_PORT"), -) -cursor = db.cursor() -with tempfile.NamedTemporaryFile() as f: - f.write(requests.get("https://raw.githubusercontent.com/ggmolly/belfast-data/main/EN/benefit_buff_template.json").content) - f.seek(0) - data = json.load(f) - -for buff_id in data: - buff = data[buff_id] - id = buff["id"] - name = buff["name"] - desc = buff["desc"] - max_time = buff["max_time"] - benefit_type = buff["benefit_type"] - cursor.execute(""" - insert into buffs - (id, name, description, max_time, benefit_type) - values (%s, %s, %s, %s, %s) ON CONFLICT (id) DO UPDATE SET name = %s, description = %s, max_time = %s, benefit_type = %s - """, (id, name, desc, max_time, benefit_type, name, desc, max_time, benefit_type)) - -db.commit() -db.close() -print("[#] done") \ No newline at end of file diff --git a/_tools/import_dock.py b/_tools/import_dock.py deleted file mode 100644 index bffed3f..0000000 --- a/_tools/import_dock.py +++ /dev/null @@ -1,73 +0,0 @@ -import os -import json -import psycopg2 -from dotenv import load_dotenv - -load_dotenv("../.env") - -db = psycopg2.connect( - host=os.getenv("POSTGRES_HOST"), - user=os.getenv("POSTGRES_USER"), - password=os.getenv("POSTGRES_PASSWORD"), - database=os.getenv("POSTGRES_DB"), - port=os.getenv("POSTGRES_PORT"), -) -cursor = db.cursor() - - -ships_id = [] - -with open("CommanderFleetA (SC_12010)_15.json", "r") as f: - data = json.load(f) - for ship in data["ship_list"]: - ships_id.append( - ( - ship["template_id"], - ship["level"], - ship["max_level"], - ship["energy"], - ship["intimacy"], - ship["is_locked"] == "true", - ship["propose"] == "true", - ship["common_flag"] == "true", - ship["blue_print_flag"] == "true", - ship["proficiency"] == "true", - ship["activity_npc"] or 0, - ship["name"], - ship["change_name_timestamp"], - ship["create_time"], - ship["skin_id"] - ) - ) - -with open("CommanderFleet (SC_12001)_14.json", "r") as f: - data = json.load(f) - for ship in data["shiplist"]: - ships_id.append( - ( - ship["template_id"], - ship["level"], - ship["max_level"], - ship["energy"], - ship["intimacy"], - ship["is_locked"] == "true", - ship["propose"] > 0, - ship["common_flag"] == "true", - ship["blue_print_flag"] == "true", - ship["proficiency"] == "true", - ship["activity_npc"] or 0, - ship["name"], - ship["change_name_timestamp"], - ship["create_time"], - ship["skin_id"] - ) - ) - -COMMANDER_ID = 5640350 - -for ship in ships_id: - cursor.execute("""insert into owned_ships (owner_id, ship_id, level, max_level, energy, intimacy, is_locked, propose, common_flag, - blueprint_flag, proficiency, activity_npc, custom_name, change_name_timestamp, create_time, skin_id) - values (%s, %s, %s, %s, %s, %s, %s::boolean, %s::boolean, %s::boolean, %s::boolean, %s::boolean, %s, %s, to_timestamp(%s), to_timestamp(%s), %s) - """, (COMMANDER_ID, *ship)) -db.commit() \ No newline at end of file diff --git a/_tools/import_items.py b/_tools/import_items.py deleted file mode 100644 index 04afd1c..0000000 --- a/_tools/import_items.py +++ /dev/null @@ -1,43 +0,0 @@ -import os -import json -import psycopg2 -import requests -import tempfile -from dotenv import load_dotenv - -load_dotenv("../.env") -db = psycopg2.connect( - host=os.getenv("POSTGRES_HOST"), - user=os.getenv("POSTGRES_USER"), - password=os.getenv("POSTGRES_PASSWORD"), - database=os.getenv("POSTGRES_DB"), - port=os.getenv("POSTGRES_PORT"), -) -cursor = db.cursor() - -with tempfile.NamedTemporaryFile() as f: - f.write(requests.get("https://raw.githubusercontent.com/ggmolly/belfast-data/main/EN/item_data_statistics.json").content) - f.seek(0) - data = json.load(f) - -print("[#] inserting items...") -for item_id in data: - item = data[item_id] - id = item["id"] - name = item["name"] - rarity = item["rarity"] - shop_id = item.get("shop_id", -2) - type = item["type"] - virtual_type = item["virtual_type"] - try: - cursor.execute(""" - insert into items - (id, name, rarity, shop_id, type, virtual_type) - values (%s, %s, %s, %s, %s, %s) ON CONFLICT (id) DO UPDATE SET name = %s, rarity = %s, shop_id = %s, type = %s, virtual_type = %s - """, (id, name, rarity, shop_id, type, virtual_type, name, rarity, shop_id, type, virtual_type)) - except Exception as e: - print(name) - print(e) - exit() - -db.commit() diff --git a/_tools/import_pools.py b/_tools/import_pools.py deleted file mode 100644 index 2360acd..0000000 --- a/_tools/import_pools.py +++ /dev/null @@ -1,55 +0,0 @@ -import os -import json -import psycopg2 -import requests -from bs4 import BeautifulSoup -from dotenv import load_dotenv - -load_dotenv("../.env") - -db = psycopg2.connect( - host=os.getenv("POSTGRES_HOST"), - user=os.getenv("POSTGRES_USER"), - password=os.getenv("POSTGRES_PASSWORD"), - database=os.getenv("POSTGRES_DB"), - port=os.getenv("POSTGRES_PORT"), -) -cur = db.cursor() - -URL = "https://azurlane.koumakan.jp/wiki/Building#Permanent_Construction" - -resp = requests.get(URL) -assert resp.status_code == 200 -soup = BeautifulSoup(resp.text, "html.parser") - -name_id = { - "Light": 2, - "Heavy": 3, - "Special": 1, -} - -def get_template_id(name: str) -> int: - name = name.replace("µ", "μ") - name = name.replace(" (Battleship)", "(BB)") - try: - cur.execute("SELECT template_id FROM ships WHERE name = %s ORDER BY template_id ASC LIMIT 1", (name,)) - return cur.fetchone()[0] - except: - # print(f"Could not find {name}") - return None - -pools = soup.select("table.azltable.bdpooltbl.mw-collapsible.mw-collapsed.toggle-right > tbody > tr") -entries = [] -# print(len(pools)) -for row in pools: - pool_name = row.select_one("th").text.strip() - pool_id = name_id[pool_name] - ships = row.select("div.alicapt") - for ship in ships: - name = ship.select_one("a").text.strip() - id = get_template_id(name) - entries.append((id, pool_id)) -cur.execute("UPDATE ships SET pool_id = NULL") -for entry in entries: - cur.execute("UPDATE ships SET pool_id = %s WHERE template_id = %s", (entry[1], entry[0])) -db.commit() diff --git a/_tools/import_resources.py b/_tools/import_resources.py deleted file mode 100644 index dcb6c5b..0000000 --- a/_tools/import_resources.py +++ /dev/null @@ -1,50 +0,0 @@ -import os -import json -import psycopg2 -import requests -import tempfile -from dotenv import load_dotenv - -load_dotenv("../.env") - -db = psycopg2.connect( - host=os.getenv("POSTGRES_HOST"), - user=os.getenv("POSTGRES_USER"), - password=os.getenv("POSTGRES_PASSWORD"), - database=os.getenv("POSTGRES_DB"), - port=os.getenv("POSTGRES_PORT"), -) -cursor = db.cursor() -with tempfile.NamedTemporaryFile() as f: - f.write(requests.get("https://raw.githubusercontent.com/ggmolly/belfast-data/main/EN/player_resource.json").content) - f.seek(0) - data = json.load(f) - -allowed_items = set() -cursor.execute("SELECT id FROM items") -for row in cursor.fetchall(): - allowed_items.add(row[0]) - -for resource_id in data: - # check if resource_id is a number - if not resource_id.isdigit(): - continue - resource = data[resource_id] - id = resource["id"] - item_id = resource["itemid"] - if item_id == 0 or item_id not in allowed_items: - item_id = None - name = resource["name"] - cursor.execute( - """ - INSERT INTO resources (id, item_id, name) - VALUES (%s, %s, %s) - ON CONFLICT (id) DO UPDATE SET - item_id = %s, - name = %s - """, - (id, item_id, name, item_id, name), - ) -db.commit() -db.close() -print("[#] done") \ No newline at end of file diff --git a/_tools/import_ships.py b/_tools/import_ships.py deleted file mode 100644 index 2db1bd9..0000000 --- a/_tools/import_ships.py +++ /dev/null @@ -1,83 +0,0 @@ -import os -import psycopg2 -import json -import sqlite3 -import requests -import tempfile -import subprocess -from dotenv import load_dotenv -from typing import Dict, List, Tuple - -load_dotenv("../.env") -db = psycopg2.connect( - host=os.getenv("POSTGRES_HOST"), - user=os.getenv("POSTGRES_USER"), - password=os.getenv("POSTGRES_PASSWORD"), - database=os.getenv("POSTGRES_DB"), - port=os.getenv("POSTGRES_PORT"), -) -cursor = db.cursor() - -with tempfile.NamedTemporaryFile() as f: - f.write(requests.get("https://raw.githubusercontent.com/ggmolly/belfast-data/main/EN/ship_data_statistics.json").content) - f.seek(0) - ship_stats = json.load(f) - -with tempfile.NamedTemporaryFile() as f: - f.write(requests.get("https://raw.githubusercontent.com/ggmolly/belfast-data/main/build_times.json").content) - f.seek(0) - build_times = json.load(f) - -rarities = set() -ships = [] -print("[#] inserting ship data") -for ship_id in ship_stats: - ship = ship_stats[ship_id] - id = ship["id"] - name = ship["name"].strip() - nationality = ship["nationality"] - rarity = ship["rarity"] - star = ship["star"] - type = ship["type"] - skin_id = ship["skin_id"] - build_time = build_times.get(str(id), 0) - rarities.add(rarity) - ships.append((id, name, nationality, rarity, star, type, build_time, skin_id)) - -print("[#] inserting ships") -KNOWN_INVALID_IDS = [ - 900197, - 900198, - 900029, -] - -groups: Dict[int, Tuple[List[int], List[str]]] = {} -ship_data: Dict[int, tuple] = {} -for ship in ships: - ship_group = ship[0] // 10 - if ship_group not in groups: - groups[ship_group] = ([], []) - groups[ship_group][0].append(ship[0]) - groups[ship_group][1].append(ship[1]) - ship_data[ship[0]] = ship - -# Remove all groups that have less than 2 ships or less -for group in list(groups.keys()): - if len(groups[group][0]) < 2: - print("[!] invalid group", groups[group]) - del groups[group] - continue - if len(set(groups[group][1])) != 1: # if there are different names in the group - print("[!] invalid group", groups[group]) - del groups[group] - -for group in list(groups.keys()): - ships = groups[group][0] - for ship in ships: - data = ship_data[ship] - cursor.execute(""" - INSERT INTO ships (template_id, name, nationality, rarity_id, star, type, build_time) - VALUES (%s, %s, %s, %s, %s, %s, %s) ON CONFLICT DO NOTHING; - """, (data[0], data[1], data[2], data[3], data[4], data[5], data[6]) - ) -db.commit() \ No newline at end of file diff --git a/_tools/import_shop_offers.py b/_tools/import_shop_offers.py deleted file mode 100644 index cc0b515..0000000 --- a/_tools/import_shop_offers.py +++ /dev/null @@ -1,77 +0,0 @@ -import os -import json -import psycopg2 -import requests -import tempfile -from dotenv import load_dotenv - -load_dotenv("../.env") -db = psycopg2.connect( - host=os.getenv("POSTGRES_HOST"), - user=os.getenv("POSTGRES_USER"), - password=os.getenv("POSTGRES_PASSWORD"), - database=os.getenv("POSTGRES_DB"), - port=os.getenv("POSTGRES_PORT"), -) -cursor = db.cursor() - -with tempfile.NamedTemporaryFile() as f: - f.write(requests.get("https://raw.githubusercontent.com/ggmolly/belfast-data/main/EN/shop_template.json").content) - f.seek(0) - data = json.load(f) - -print("[#] inserting shop offers...") - -""" -create table shop_offers -( - id bigserial - primary key, - effects integer[], - number bigint, - resource_number bigint, - resource_id bigint - constraint fk_shop_offers_resource - references resources, - type bigint -); -""" - -RESERVED_STRINGS = { # this map is used to convert some strings to an arbitrary number - "count": 2890000, - "equip_bag_size": 2890001, - "ship_bag_size": 2890002, - "dorm_exp_pos": 2890003, - "dorm_food_max": 2890004, - "tradingport_level": 2890005, - "oilfield_level": 2890006, - "shop_street_level": 2890007, - "shop_street_flash": 2890008, - "dorm_fix_pos": 2890009, - "dorm_floor": 2890010, - "class_room_level": 2890011, - "skill_room_pos": 2890012, - "commander_bag_size": 2890013, - "spweapon_bag_size": 2890014, -} - -for shop_offer_id in data: - shop_offer = data[shop_offer_id] - id = shop_offer["id"] - effects = shop_offer["effect_args"] - number = shop_offer["num"] - if isinstance(effects, str): - effects = [RESERVED_STRINGS[effects]] - for i, effect in enumerate(effects): - if isinstance(effect, str): - effects[i] = RESERVED_STRINGS[effect] - resource_number = shop_offer["resource_num"] - resource_id = shop_offer["resource_type"] - type = shop_offer["type"] - cursor.execute(""" - insert into shop_offers - (id, effects, number, resource_number, resource_id, type) - values (%s, %s, %s, %s, %s, %s) ON CONFLICT (id) DO UPDATE SET effects = %s, number = %s, resource_number = %s, resource_id = %s, type = %s - """, (id, effects, number, resource_number, resource_id, type, effects, number, resource_number, resource_id, type)) - -db.commit() \ No newline at end of file diff --git a/_tools/import_skins.py b/_tools/import_skins.py deleted file mode 100644 index 0e9e28b..0000000 --- a/_tools/import_skins.py +++ /dev/null @@ -1,36 +0,0 @@ -import os -import psycopg2 -import json -import requests -import tempfile -from dotenv import load_dotenv - -load_dotenv("../.env") -db = psycopg2.connect( - host=os.getenv("POSTGRES_HOST"), - user=os.getenv("POSTGRES_USER"), - password=os.getenv("POSTGRES_PASSWORD"), - database=os.getenv("POSTGRES_DB"), - port=os.getenv("POSTGRES_PORT"), -) -cursor = db.cursor() - -with tempfile.NamedTemporaryFile() as f: - f.write(requests.get("https://raw.githubusercontent.com/ggmolly/belfast-data/main/EN/ship_skin_template.json").content) - f.seek(0) - skin_stats = json.load(f) - -print("[#] inserting skin data") -for skin_id in skin_stats: - skin = skin_stats[skin_id] - id = skin["id"] - name = skin["name"] - ship_group = skin["ship_group"] - cursor.execute(""" - INSERT INTO skins (id, name, ship_group) - VALUES (%s, %s, %s) ON CONFLICT (id) DO UPDATE SET name = %s, ship_group = %s - """, (id, name, ship_group, name, ship_group) - ) - -print("[#] commiting changes") -db.commit() \ No newline at end of file diff --git a/answer/Activities.go b/answer/activities.go similarity index 100% rename from answer/Activities.go rename to answer/activities.go diff --git a/answer/AskMailBody.go b/answer/ask_mail_body.go similarity index 100% rename from answer/AskMailBody.go rename to answer/ask_mail_body.go diff --git a/answer/AuthConfirm.go b/answer/auth_confirm.go similarity index 100% rename from answer/AuthConfirm.go rename to answer/auth_confirm.go diff --git a/answer/BuildFinish.go b/answer/build_finish.go similarity index 100% rename from answer/BuildFinish.go rename to answer/build_finish.go diff --git a/answer/BuildQuickFinish.go b/answer/build_quick_finish.go similarity index 100% rename from answer/BuildQuickFinish.go rename to answer/build_quick_finish.go diff --git a/answer/ChangeSelectedSkin.go b/answer/change_selected_skin.go similarity index 100% rename from answer/ChangeSelectedSkin.go rename to answer/change_selected_skin.go diff --git a/answer/ChangeShipLockState.go b/answer/change_ship_lock_state.go similarity index 100% rename from answer/ChangeShipLockState.go rename to answer/change_ship_lock_state.go diff --git a/answer/ChatRoomChange.go b/answer/chat_room_change.go similarity index 100% rename from answer/ChatRoomChange.go rename to answer/chat_room_change.go diff --git a/answer/CommanderCommissionsFleet.go b/answer/commander_commissions_fleet.go similarity index 100% rename from answer/CommanderCommissionsFleet.go rename to answer/commander_commissions_fleet.go diff --git a/answer/CommanderFleetA.go b/answer/commander_fleet_a.go similarity index 100% rename from answer/CommanderFleetA.go rename to answer/commander_fleet_a.go diff --git a/answer/CommanderFriendList.go b/answer/commander_friend_list.go similarity index 100% rename from answer/CommanderFriendList.go rename to answer/commander_friend_list.go diff --git a/answer/CommanderGuildChat.go b/answer/commander_guild_chat.go similarity index 100% rename from answer/CommanderGuildChat.go rename to answer/commander_guild_chat.go diff --git a/answer/CommanderGuildData.go b/answer/commander_guild_data.go similarity index 100% rename from answer/CommanderGuildData.go rename to answer/commander_guild_data.go diff --git a/answer/CommanderGuildTechnologies.go b/answer/commander_guild_technologies.go similarity index 100% rename from answer/CommanderGuildTechnologies.go rename to answer/commander_guild_technologies.go diff --git a/answer/CommanderMissions.go b/answer/commander_missions.go similarity index 100% rename from answer/CommanderMissions.go rename to answer/commander_missions.go diff --git a/answer/CommanderOwnedSkins.go b/answer/commander_owned_skins.go similarity index 100% rename from answer/CommanderOwnedSkins.go rename to answer/commander_owned_skins.go diff --git a/answer/CommanderStoryProgress.go b/answer/commander_story_progress.go similarity index 100% rename from answer/CommanderStoryProgress.go rename to answer/commander_story_progress.go diff --git a/answer/ConfirmShip.go b/answer/confirm_ship.go similarity index 100% rename from answer/ConfirmShip.go rename to answer/confirm_ship.go diff --git a/answer/DeleteAllMails.go b/answer/delete_all_mails.go similarity index 100% rename from answer/DeleteAllMails.go rename to answer/delete_all_mails.go diff --git a/answer/DormData.go b/answer/dorm_data.go similarity index 100% rename from answer/DormData.go rename to answer/dorm_data.go diff --git a/answer/EquipedSpecialWeapons.go b/answer/equiped_special_weapons.go similarity index 100% rename from answer/EquipedSpecialWeapons.go rename to answer/equiped_special_weapons.go diff --git a/answer/EquippedWeaponSkin.go b/answer/equipped_weapon_skin.go similarity index 100% rename from answer/EquippedWeaponSkin.go rename to answer/equipped_weapon_skin.go diff --git a/answer/EventData.go b/answer/event_data.go similarity index 100% rename from answer/EventData.go rename to answer/event_data.go diff --git a/answer/ExchangeShip.go b/answer/exchange_ship.go similarity index 100% rename from answer/ExchangeShip.go rename to answer/exchange_ship.go diff --git a/answer/ExerciseEnemies.go b/answer/exercise_enemies.go similarity index 100% rename from answer/ExerciseEnemies.go rename to answer/exercise_enemies.go diff --git a/answer/FetchSecondaryPasswordCommandResponse.go b/answer/fetch_secondary_password_command_response.go similarity index 100% rename from answer/FetchSecondaryPasswordCommandResponse.go rename to answer/fetch_secondary_password_command_response.go diff --git a/answer/FleetEnergyRecoverTime.go b/answer/fleet_energy_recover_time.go similarity index 100% rename from answer/FleetEnergyRecoverTime.go rename to answer/fleet_energy_recover_time.go diff --git a/answer/GameNotices.go b/answer/game_notices.go similarity index 100% rename from answer/GameNotices.go rename to answer/game_notices.go diff --git a/answer/GetGuildRequestsCommandResponse.go b/answer/get_guild_requests_command_response.go similarity index 100% rename from answer/GetGuildRequestsCommandResponse.go rename to answer/get_guild_requests_command_response.go diff --git a/answer/GetMetaProgress.go b/answer/get_meta_progress.go similarity index 100% rename from answer/GetMetaProgress.go rename to answer/get_meta_progress.go diff --git a/answer/GetMetaShipsPointsResponse.go b/answer/get_meta_ships_points_response.go similarity index 100% rename from answer/GetMetaShipsPointsResponse.go rename to answer/get_meta_ships_points_response.go diff --git a/answer/GetMyAssaultFleetCommandResponse.go b/answer/get_my_assault_fleet_command_response.go similarity index 100% rename from answer/GetMyAssaultFleetCommandResponse.go rename to answer/get_my_assault_fleet_command_response.go diff --git a/answer/GiveItem.go b/answer/give_item.go similarity index 100% rename from answer/GiveItem.go rename to answer/give_item.go diff --git a/answer/GiveMailAttachments.go b/answer/give_mail_attachments.go similarity index 100% rename from answer/GiveMailAttachments.go rename to answer/give_mail_attachments.go diff --git a/answer/GiveResources.go b/answer/give_resources.go similarity index 100% rename from answer/GiveResources.go rename to answer/give_resources.go diff --git a/answer/GuildGetActivationEventCommandResponse.go b/answer/guild_get_activation_event_command_response.go similarity index 100% rename from answer/GuildGetActivationEventCommandResponse.go rename to answer/guild_get_activation_event_command_response.go diff --git a/answer/GuildGetAssaultFleetCommandResponse.go b/answer/guild_get_assault_fleet_command_response.go similarity index 100% rename from answer/GuildGetAssaultFleetCommandResponse.go rename to answer/guild_get_assault_fleet_command_response.go diff --git a/answer/GuildGetUserInfoCommand.go b/answer/guild_get_user_info_command.go similarity index 100% rename from answer/GuildGetUserInfoCommand.go rename to answer/guild_get_user_info_command.go diff --git a/answer/JoinServer.go b/answer/join_server.go similarity index 100% rename from answer/JoinServer.go rename to answer/join_server.go diff --git a/answer/JuustagramData.go b/answer/juustagram_data.go similarity index 100% rename from answer/JuustagramData.go rename to answer/juustagram_data.go diff --git a/answer/LastLogin.go b/answer/last_login.go similarity index 100% rename from answer/LastLogin.go rename to answer/last_login.go diff --git a/answer/LastOnlineInfo.go b/answer/last_online_info.go similarity index 100% rename from answer/LastOnlineInfo.go rename to answer/last_online_info.go diff --git a/answer/Mailbox.go b/answer/mailbox.go similarity index 100% rename from answer/Mailbox.go rename to answer/mailbox.go diff --git a/answer/Meowfficers.go b/answer/meowfficers.go similarity index 100% rename from answer/Meowfficers.go rename to answer/meowfficers.go diff --git a/answer/MetaCharacterTacticsInfoRequestCommandResponse.go b/answer/meta_character_tactics_info_request_command_response.go similarity index 100% rename from answer/MetaCharacterTacticsInfoRequestCommandResponse.go rename to answer/meta_character_tactics_info_request_command_response.go diff --git a/answer/OngoingBuilds.go b/answer/ongoing_builds.go similarity index 100% rename from answer/OngoingBuilds.go rename to answer/ongoing_builds.go diff --git a/answer/OwnedItems.go b/answer/owned_items.go similarity index 100% rename from answer/OwnedItems.go rename to answer/owned_items.go diff --git a/answer/PermanentActivites.go b/answer/permanent_activites.go similarity index 100% rename from answer/PermanentActivites.go rename to answer/permanent_activites.go diff --git a/answer/PlayerBuffs.go b/answer/player_buffs.go similarity index 100% rename from answer/PlayerBuffs.go rename to answer/player_buffs.go diff --git a/answer/PlayerDock.go b/answer/player_dock.go similarity index 100% rename from answer/PlayerDock.go rename to answer/player_dock.go diff --git a/answer/PlayerInfo.go b/answer/player_info.go similarity index 100% rename from answer/PlayerInfo.go rename to answer/player_info.go diff --git a/answer/ProposeShip.go b/answer/propose_ship.go similarity index 100% rename from answer/ProposeShip.go rename to answer/propose_ship.go diff --git a/answer/ReceiveChatMessage.go b/answer/receive_chat_message.go similarity index 100% rename from answer/ReceiveChatMessage.go rename to answer/receive_chat_message.go diff --git a/answer/RenameProposedShip.go b/answer/rename_proposed_ship.go similarity index 100% rename from answer/RenameProposedShip.go rename to answer/rename_proposed_ship.go diff --git a/answer/ResourcesInfo.go b/answer/resources_info.go similarity index 100% rename from answer/ResourcesInfo.go rename to answer/resources_info.go diff --git a/answer/RetireShip.go b/answer/retire_ship.go similarity index 100% rename from answer/RetireShip.go rename to answer/retire_ship.go diff --git a/answer/SendHeartbeat.go b/answer/send_heartbeat.go similarity index 100% rename from answer/SendHeartbeat.go rename to answer/send_heartbeat.go diff --git a/answer/SendMailList.go b/answer/send_mail_list.go similarity index 100% rename from answer/SendMailList.go rename to answer/send_mail_list.go diff --git a/answer/SendPlayerShipCount.go b/answer/send_player_ship_count.go similarity index 100% rename from answer/SendPlayerShipCount.go rename to answer/send_player_ship_count.go diff --git a/answer/Servers.go b/answer/servers.go similarity index 100% rename from answer/Servers.go rename to answer/servers.go diff --git a/answer/SetFavoriteShip.go b/answer/set_favorite_ship.go similarity index 100% rename from answer/SetFavoriteShip.go rename to answer/set_favorite_ship.go diff --git a/answer/ShipBuild.go b/answer/ship_build.go similarity index 100% rename from answer/ShipBuild.go rename to answer/ship_build.go diff --git a/answer/ShipyardData.go b/answer/shipyard_data.go similarity index 100% rename from answer/ShipyardData.go rename to answer/shipyard_data.go diff --git a/answer/ShopData.go b/answer/shop_data.go similarity index 100% rename from answer/ShopData.go rename to answer/shop_data.go diff --git a/answer/ShoppingCommandAnswer.go b/answer/shopping_command_answer.go similarity index 100% rename from answer/ShoppingCommandAnswer.go rename to answer/shopping_command_answer.go diff --git a/answer/TechnologyNationProxy.go b/answer/technology_nation_proxy.go similarity index 100% rename from answer/TechnologyNationProxy.go rename to answer/technology_nation_proxy.go diff --git a/answer/UNK_12026.go b/answer/unk_12026.go similarity index 100% rename from answer/UNK_12026.go rename to answer/unk_12026.go diff --git a/answer/UNK_12101.go b/answer/unk_12101.go similarity index 100% rename from answer/UNK_12101.go rename to answer/unk_12101.go diff --git a/answer/UNK_13002.go b/answer/unk_13002.go similarity index 100% rename from answer/UNK_13002.go rename to answer/unk_13002.go diff --git a/answer/UNK_13506.go b/answer/unk_13506.go similarity index 100% rename from answer/UNK_13506.go rename to answer/unk_13506.go diff --git a/answer/UNK_16105.go b/answer/unk_16105.go similarity index 100% rename from answer/UNK_16105.go rename to answer/unk_16105.go diff --git a/answer/UNK_17001.go b/answer/unk_17001.go similarity index 100% rename from answer/UNK_17001.go rename to answer/unk_17001.go diff --git a/answer/UNK_17204.go b/answer/unk_17204.go similarity index 100% rename from answer/UNK_17204.go rename to answer/unk_17204.go diff --git a/answer/UNK_24021.go b/answer/unk_24021.go similarity index 100% rename from answer/UNK_24021.go rename to answer/unk_24021.go diff --git a/answer/UNK_25027.go b/answer/unk_25027.go similarity index 100% rename from answer/UNK_25027.go rename to answer/unk_25027.go diff --git a/answer/UNK_26102.go b/answer/unk_26102.go similarity index 100% rename from answer/UNK_26102.go rename to answer/unk_26102.go diff --git a/answer/UNK_27001.go b/answer/unk_27001.go similarity index 100% rename from answer/UNK_27001.go rename to answer/unk_27001.go diff --git a/answer/UNK_33001.go b/answer/unk_33001.go similarity index 100% rename from answer/UNK_33001.go rename to answer/unk_33001.go diff --git a/answer/UNK_33114.go b/answer/unk_33114.go similarity index 100% rename from answer/UNK_33114.go rename to answer/unk_33114.go diff --git a/answer/UNK_34502.go b/answer/unk_34502.go similarity index 100% rename from answer/UNK_34502.go rename to answer/unk_34502.go diff --git a/answer/UNK_63000.go b/answer/unk_63000.go similarity index 100% rename from answer/UNK_63000.go rename to answer/unk_63000.go diff --git a/answer/UpdateMailImpFlag.go b/answer/update_mail_imp_flag.go similarity index 100% rename from answer/UpdateMailImpFlag.go rename to answer/update_mail_imp_flag.go diff --git a/answer/UpdatePacket.go b/answer/update_packet.go similarity index 100% rename from answer/UpdatePacket.go rename to answer/update_packet.go diff --git a/answer/UpdateSecretaries.go b/answer/update_secretaries.go similarity index 100% rename from answer/UpdateSecretaries.go rename to answer/update_secretaries.go diff --git a/answer/WeeklyMissions.go b/answer/weekly_missions.go similarity index 100% rename from answer/WeeklyMissions.go rename to answer/weekly_missions.go diff --git a/connection/Client.go b/connection/client.go similarity index 100% rename from connection/Client.go rename to connection/client.go diff --git a/connection/Server.go b/connection/server.go similarity index 100% rename from connection/Server.go rename to connection/server.go diff --git a/debug/InsertPacket.go b/debug/insert_packet.go similarity index 100% rename from debug/InsertPacket.go rename to debug/insert_packet.go diff --git a/go.sum b/go.sum index 0be45d2..3ee5339 100644 --- a/go.sum +++ b/go.sum @@ -1,14 +1,9 @@ -github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= -github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= @@ -16,37 +11,23 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.16.0 h1:x+plE831WK4vaKHO/jpgUGsvLKIqRRkz6M78GuJAfGE= -github.com/go-playground/validator/v10 v10.16.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn0+wvQ3bZ8b/AU4= github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= -github.com/gofiber/fiber/v2 v2.51.0 h1:JNACcZy5e2tGApWB2QrRpenTWn0fq0hkFm6k0C86gKQ= -github.com/gofiber/fiber/v2 v2.51.0/go.mod h1:xaQRZQJGqnKOQnbQw+ltvku3/h8QxvNi8o6JiJ7Ll0U= github.com/gofiber/fiber/v2 v2.52.4 h1:P+T+4iK7VaqUsq2PALYEfBBo6bJZ4q3FP8cZ84EggTM= github.com/gofiber/fiber/v2 v2.52.4/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= -github.com/gofiber/template v1.8.2 h1:PIv9s/7Uq6m+Fm2MDNd20pAFFKt5wWs7ZBd8iV9pWwk= -github.com/gofiber/template v1.8.2/go.mod h1:bs/2n0pSNPOkRa5VJ8zTIvedcI/lEYxzV3+YPXdBvq8= github.com/gofiber/template v1.8.3 h1:hzHdvMwMo/T2kouz2pPCA0zGiLCeMnoGsQZBTSYgZxc= github.com/gofiber/template v1.8.3/go.mod h1:bs/2n0pSNPOkRa5VJ8zTIvedcI/lEYxzV3+YPXdBvq8= -github.com/gofiber/template/html/v2 v2.0.5 h1:BKLJ6Qr940NjntbGmpO3zVa4nFNGDCi/IfUiDB9OC20= -github.com/gofiber/template/html/v2 v2.0.5/go.mod h1:RCF14eLeQDCSUPp0IGc2wbSSDv6yt+V54XB/+Unz+LM= github.com/gofiber/template/html/v2 v2.1.1 h1:QEy3O3EBkvwDthy5bXVGUseOyO6ldJoiDxlF4+MJiV8= github.com/gofiber/template/html/v2 v2.1.1/go.mod h1:2G0GHHOUx70C1LDncoBpe4T6maQbNa4x1CVNFW0wju0= github.com/gofiber/utils v1.1.0 h1:vdEBpn7AzIUJRhe+CiTOJdUcTg4Q9RK+pEa0KPbLdrM= github.com/gofiber/utils v1.1.0/go.mod h1:poZpsnhBykfnY1Mc0KeEa6mSHrS3dV0+oBWyeQmb2e0= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA= github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.5.1 h1:5I9etrGkLrN+2XPCsi6XLlV5DITbSL/xBZdmAxFcXPI= -github.com/jackc/pgx/v5 v5.5.1/go.mod h1:Ig06C2Vu0t5qXC60W8sqIthScaEnFvojjj9dSljmHRA= github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= @@ -57,12 +38,8 @@ github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= @@ -76,63 +53,38 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M= -github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/fasthttp v1.52.0 h1:wqBQpxH71XW0e2g+Og4dzQM8pk34aFYlA1Ga8db7gU0= github.com/valyala/fasthttp v1.52.0/go.mod h1:hf5C4QnVMkNXMspnsUlfM3WitlgYflyhHYoKol/szxQ= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.5.4 h1:Iyrp9Meh3GmbSuyIAGyjkN+n9K+GHX9b9MqsTL4EJCo= -gorm.io/driver/postgres v1.5.4/go.mod h1:Bgo89+h0CRcdA33Y6frlaHHVuTdOf87pmyzwW9C/BH0= gorm.io/driver/postgres v1.5.7 h1:8ptbNJTDbEmhdr62uReG5BGkdQyeasu/FZHxI0IMGnM= gorm.io/driver/postgres v1.5.7/go.mod h1:3e019WlBaYI5o5LIdNV+LyxCMNtLOQETBXL2h4chKpA= -gorm.io/gorm v1.25.5 h1:zR9lOiiYf09VNh5Q1gphfyia1JpiClIWG9hQaxB/mls= -gorm.io/gorm v1.25.5/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= gorm.io/gorm v1.25.9 h1:wct0gxZIELDk8+ZqF/MVnHLkA1rvYlBWUMv2EdsK1g8= gorm.io/gorm v1.25.9/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= diff --git a/logger/Event.go b/logger/event.go similarity index 100% rename from logger/Event.go rename to logger/event.go diff --git a/main.go b/main.go index de07a03..6fdfde8 100644 --- a/main.go +++ b/main.go @@ -45,7 +45,7 @@ func init() { logger.LogEvent("Environment", "Load", err.Error(), logger.LOG_LEVEL_ERROR) } if orm.InitDatabase() { // if first run, populate the database - misc.UpdateAllData() + misc.UpdateAllData("EN") } packets.RegisterPacketHandler(10800, []packets.PacketHandler{answer.Forge_SC10801}) packets.RegisterPacketHandler(8239, []packets.PacketHandler{answer.Forge_SC8239}) diff --git a/misc/UpdateData.go b/misc/UpdateData.go deleted file mode 100644 index 04f03a1..0000000 --- a/misc/UpdateData.go +++ /dev/null @@ -1,43 +0,0 @@ -package misc - -import ( - "fmt" - "os/exec" - - "github.com/ggmolly/belfast/logger" - "golang.org/x/text/cases" - "golang.org/x/text/language" -) - -const ( - ITEMS_PATH = "/home/molly/Documents/al-zero/AzurLaneData/EN/sharecfgdata/item_data_statistics.json" - BUFF_PATH = "/home/molly/Documents/al-zero/AzurLaneData/EN/ShareCfg/benefit_buff_template.json" - SHIP_PATH = "/home/molly/Documents/al-zero/AzurLaneData/EN/sharecfgdata/ship_data_statistics.json" - SKIN_PATH = "/home/molly/Documents/al-zero/AzurLaneData/EN/ShareCfg/ship_skin_template.json" -) - -var ( - tablesUpdate = []string{ - "items", - "buffs", - "ships", - "skins", - "resources", - "pools", - "shop_offers", - } - caser = cases.Title(language.AmericanEnglish) -) - -func UpdateAllData() { - logger.LogEvent("GameData", "Updating", "Updating all game data.. this may take a while.", logger.LOG_LEVEL_INFO) - go func() { - for _, table := range tablesUpdate { - if err := exec.Command("sh", "_tools/import.sh", table).Run(); err != nil { - logger.LogEvent("GameData", caser.String(table), fmt.Sprintf("error importing %s : %s", table, err.Error()), logger.LOG_LEVEL_ERROR) - } else { - logger.LogEvent("GameData", caser.String(table), fmt.Sprintf("successfully imported %s!", table), logger.LOG_LEVEL_INFO) - } - } - }() -} diff --git a/misc/GameUpdate.go b/misc/game_update.go similarity index 99% rename from misc/GameUpdate.go rename to misc/game_update.go index 315f7e6..5176cc6 100644 --- a/misc/GameUpdate.go +++ b/misc/game_update.go @@ -161,7 +161,7 @@ func GetGameHashes() HashMap { logger.LogEvent("GameUpdate", "GetHashes", err.Error(), logger.LOG_LEVEL_ERROR) return nil } - go UpdateAllData() + go UpdateAllData("EN") return azurLaneHashes } diff --git a/misc/GetPacketFields.go b/misc/get_packet_fields.go similarity index 100% rename from misc/GetPacketFields.go rename to misc/get_packet_fields.go diff --git a/misc/GitHash.go b/misc/git_hash.go similarity index 100% rename from misc/GitHash.go rename to misc/git_hash.go diff --git a/misc/LatestCommits.go b/misc/latest_commits.go similarity index 100% rename from misc/LatestCommits.go rename to misc/latest_commits.go diff --git a/misc/ProtoToJson.go b/misc/proto_to_json.go similarity index 100% rename from misc/ProtoToJson.go rename to misc/proto_to_json.go diff --git a/misc/update_data.go b/misc/update_data.go new file mode 100644 index 0000000..9a99f55 --- /dev/null +++ b/misc/update_data.go @@ -0,0 +1,277 @@ +package misc + +import ( + "encoding/json" + "fmt" + "net/http" + + "github.com/ggmolly/belfast/logger" + "github.com/ggmolly/belfast/orm" + "google.golang.org/protobuf/proto" + "gorm.io/gorm" +) + +const ( + // region / file + URL_BASE = "https://raw.githubusercontent.com/ggmolly/belfast-data/main/%s/%s" + REGIONLESS_URL_BASE = "https://raw.githubusercontent.com/ggmolly/belfast-data/main/%s" +) + +var ( + dataFn = map[string]func(string, *gorm.DB) error{ + "Items": importItems, + "Buffs": importBuffs, + "Ships": importShips, + "Skins": importSkins, + "Resources": importResources, + "Pools": importPools, + "BuildTimes": importBuildTimes, + "ShopOffers": importShopOffers, + } + // Golang maps are unordered, so we need to keep track of the order of the keys ourselves + order = []string{"Items", "Buffs", "Ships", "Skins", "Resources", "Pools", "BuildTimes", "ShopOffers"} +) + +func getBelfastData(region string, file string) (*json.Decoder, *http.Response, error) { + var url string + if region == "" { + url = fmt.Sprintf(REGIONLESS_URL_BASE, file) + } else { + url = fmt.Sprintf(URL_BASE, region, file) + } + resp, err := http.Get(url) + if err != nil { + return nil, nil, err + } + if resp.StatusCode != http.StatusOK { + return nil, nil, fmt.Errorf("failed to fetch data from %s: %s", url, resp.Status) + } + return json.NewDecoder(resp.Body), resp, nil +} + +// TODO: A lot of code duplication here, could be refactored + +func importItems(region string, tx *gorm.DB) error { + decoder, resp, err := getBelfastData(region, "item_data_statistics.json") + if err != nil { + return err + } + defer resp.Body.Close() + decoder.Token() // Consume the start of the array '[' + + // Decode each elements + for decoder.More() { + var item orm.Item + if err := decoder.Decode(&item); err != nil { + return err + } else if err := tx.Create(&item).Error; err != nil { + return err + } + } + return nil +} + +func importBuffs(region string, tx *gorm.DB) error { + decoder, resp, err := getBelfastData(region, "benefit_buff_template.json") + if err != nil { + return err + } + defer resp.Body.Close() + decoder.Token() // Consume the start of the array '[' + + // Decode each elements + for decoder.More() { + var buff orm.Buff + if err := decoder.Decode(&buff); err != nil { + return err + } else if err := tx.Create(&buff).Error; err != nil { + return err + } + } + return nil +} + +func importShips(region string, tx *gorm.DB) error { + decoder, resp, err := getBelfastData(region, "ship_data_statistics.json") + if err != nil { + return err + } + defer resp.Body.Close() + decoder.Token() // Consume the start of the array '[' + + // Decode each elements + for decoder.More() { + var ship orm.Ship + if err := decoder.Decode(&ship); err != nil { + return err + } else if err := tx.Create(&ship).Error; err != nil { + return err + } + } + return nil +} + +func importSkins(region string, tx *gorm.DB) error { + decoder, resp, err := getBelfastData(region, "ship_skin_template.json") + if err != nil { + return err + } + defer resp.Body.Close() + decoder.Token() // Consume the start of the array '[' + + // Decode each elements + for decoder.More() { + var skin orm.Skin + if err := decoder.Decode(&skin); err != nil { + return err + } else if err := tx.Create(&skin).Error; err != nil { + return err + } + } + return nil +} + +func importResources(region string, tx *gorm.DB) error { + decoder, resp, err := getBelfastData(region, "player_resource.json") + if err != nil { + return err + } + defer resp.Body.Close() + decoder.Token() // Consume the start of the array '[' + + // Decode each elements + for decoder.More() { + var resource orm.Resource + if err := decoder.Decode(&resource); err != nil { + return err + } else if err := tx.Create(&resource).Error; err != nil { + return err + } + } + return nil +} + +func importPools(region string, tx *gorm.DB) error { + decoder, resp, err := getBelfastData("", "build_pools.json") + if err != nil { + return err + } + defer resp.Body.Close() + + // [{"id": 101451, "pool": 2}, {"id": 702011, "pool": 2}, {"id": 101491, "pool": 2}, {"id": 702031, "pool": 2}...] + decoder.Token() // Consume the start of the array '[' + + // Decode each elements + for decoder.More() { + var pool struct { + ID uint32 `json:"id"` + Pool uint32 `json:"pool"` + } + if err := decoder.Decode(&pool); err != nil { + return err + } + + // Update each ship with the pool + var ship orm.Ship + if err := tx.Where("template_id = ?", pool.ID).First(&ship).Error; err != nil { + return err + } + ship.PoolID = proto.Uint32(pool.Pool) + if err := tx.Save(&ship).Error; err != nil { + return err + } + } + return nil +} + +func importBuildTimes(region string, tx *gorm.DB) error { + decoder, resp, err := getBelfastData("", "build_times.json") + if err != nil { + return err + } + defer resp.Body.Close() + + // {"101031": 1380, "101041": 1380, "101061": 1500, "101071": 1500, ...} + var buildTimes map[string]uint32 + if err := decoder.Decode(&buildTimes); err != nil { + return err + } + + // Update each ship with the build time + for id, time := range buildTimes { + var ship orm.Ship + if err := tx.Where("template_id = ?", id).First(&ship).Error; err != nil { + return err + } + ship.BuildTime = time + if err := tx.Save(&ship).Error; err != nil { + return err + } + } + return nil +} + +func importShopOffers(region string, tx *gorm.DB) error { + decoder, resp, err := getBelfastData(region, "shop_template.json") + if err != nil { + return err + } + defer resp.Body.Close() + decoder.Token() // Consume the start of the array '[' + + // Decode each elements + for decoder.More() { + var offer struct { // decoding to json via a pq.Int64Array is not supported, so we need to decode the effects manually + orm.ShopOffer + Effects_ []uint32 `json:"effects" gorm:"-"` + } + if err := decoder.Decode(&offer); err != nil { + return err + } + + // Manually convert the effects to pq.Int64Array + offer.ShopOffer.Effects = make([]int64, len(offer.Effects_)) + for i, effect := range offer.Effects_ { + offer.ShopOffer.Effects[i] = int64(effect) + } + + shopOffer := orm.ShopOffer{ + ID: offer.ID, + Effects: offer.Effects, + Number: offer.Number, + ResourceNumber: offer.ResourceNumber, + ResourceID: offer.ResourceID, + Type: offer.Type, + } + if err := tx.Create(&shopOffer).Error; err != nil { + return err + } + } + return nil +} + +// XXX: The database can end in a limbo state if an error occurs while updating the data (e.g. network error, invalid JSON, etc.) +// upon restarting Belfast, the database won't be re-populated because some tables were already populated +// this could be fixed by passing a single transaction to all the data import functions, but requires some refactoring +// due to the way data is being initialized (mix of 'misc' and 'orm' packages) +func UpdateAllData(region string) { + logger.LogEvent("GameData", "Updating", "Updating all game data.. this may take a while.", logger.LOG_LEVEL_INFO) + tx := orm.GormDB.Begin() + for _, key := range order { + fn := dataFn[key] + logger.LogEvent("GameData", "Updating", fmt.Sprintf("Updating %s (region=%s)", key, region), logger.LOG_LEVEL_INFO) + // defer func() { + // if r := recover(); r != nil { + // logger.LogEvent("GameData", "Updating", fmt.Sprintf("panic occurred while updating %s: %v", key, r), logger.LOG_LEVEL_ERROR) + // tx.Rollback() + // } + // }() + if err := fn(region, tx); err != nil { + logger.LogEvent("GameData", "Updating", fmt.Sprintf("failed to update %s: %s", key, err.Error()), logger.LOG_LEVEL_ERROR) + tx.Rollback() + } + } + if err := tx.Commit().Error; err != nil { + logger.LogEvent("GameData", "Updating", fmt.Sprintf("failed to commit transaction: %s", err.Error()), logger.LOG_LEVEL_ERROR) + } +} diff --git a/orm/Buff.go b/orm/Buff.go deleted file mode 100644 index 09a2568..0000000 --- a/orm/Buff.go +++ /dev/null @@ -1,9 +0,0 @@ -package orm - -type Buff struct { - ID uint32 `gorm:"primary_key"` - Name string `gorm:"size:50"` - Description string `gorm:"size:170"` - MaxTime int `gorm:"default:0;not null"` - BenefitType string `gorm:"size:50;not null"` -} diff --git a/orm/Item.go b/orm/Item.go deleted file mode 100644 index 004a28b..0000000 --- a/orm/Item.go +++ /dev/null @@ -1,10 +0,0 @@ -package orm - -type Item struct { - ID uint32 `gorm:"primary_key"` - Name string `gorm:"size:70;not null"` - Rarity int `gorm:"not null"` - ShopID int `gorm:"not null"` - Type int `gorm:"not null"` - VirtualType int `gorm:"not null"` -} diff --git a/orm/Shop.go b/orm/Shop.go deleted file mode 100644 index 73bf1a8..0000000 --- a/orm/Shop.go +++ /dev/null @@ -1,14 +0,0 @@ -package orm - -import "github.com/lib/pq" - -type ShopOffer struct { - ID uint32 `gorm:"primary_key"` - Effects pq.Int64Array `gorm:"type:integer[];not_null"` - Number uint32 `gorm:"not_null"` - ResourceNumber uint32 `gorm:"not_null"` - ResourceID uint32 `gorm:"not_null"` - Type uint32 `gorm:"not_null"` - - Resource Resource `gorm:"foreignkey:ResourceID;references:ID"` -} diff --git a/orm/buff.go b/orm/buff.go new file mode 100644 index 0000000..148ba0e --- /dev/null +++ b/orm/buff.go @@ -0,0 +1,9 @@ +package orm + +type Buff struct { + ID uint32 `gorm:"primary_key" json:"id"` + Name string `gorm:"size:50" json:"name"` + Description string `gorm:"size:170" json:"desc"` + MaxTime int `gorm:"default:0;not_null" json:"max_time"` + BenefitType string `gorm:"size:50;not_null" json:"benefit_type"` +} diff --git a/orm/Build.go b/orm/build.go similarity index 100% rename from orm/Build.go rename to orm/build.go diff --git a/orm/Chat.go b/orm/chat.go similarity index 100% rename from orm/Chat.go rename to orm/chat.go diff --git a/orm/Commander.go b/orm/commander.go similarity index 100% rename from orm/Commander.go rename to orm/commander.go diff --git a/orm/Database.go b/orm/database.go similarity index 100% rename from orm/Database.go rename to orm/database.go diff --git a/orm/Debug.go b/orm/debug.go similarity index 100% rename from orm/Debug.go rename to orm/debug.go diff --git a/orm/item.go b/orm/item.go new file mode 100644 index 0000000..e3c668f --- /dev/null +++ b/orm/item.go @@ -0,0 +1,10 @@ +package orm + +type Item struct { + ID uint32 `gorm:"primary_key" json:"id"` + Name string `gorm:"size:70;not_null" json:"name"` + Rarity int `gorm:"not_null" json:"rarity"` + ShopID int `gorm:"not_null;default:-2" json:"shop_id,omitempty"` + Type int `gorm:"not_null" json:"type"` + VirtualType int `gorm:"not_null" json:"virtual_type"` +} diff --git a/orm/Mail.go b/orm/mail.go similarity index 100% rename from orm/Mail.go rename to orm/mail.go diff --git a/orm/Notice.go b/orm/notice.go similarity index 93% rename from orm/Notice.go rename to orm/notice.go index 6fb8ecb..7d88a3e 100644 --- a/orm/Notice.go +++ b/orm/notice.go @@ -2,7 +2,7 @@ package orm type Notice struct { ID int `gorm:"primary_key"` - Version int `gorm:"type:smallint;default:1;not null"` + Version int `gorm:"type:smallint;default:1;not_null"` BtnTitle string `gorm:"size:128;not_null"` Title string `gorm:"size:256;not_null"` TitleImageURL string `gorm:"type:text;not_null"` diff --git a/orm/OwnedItems.go b/orm/owned_items.go similarity index 100% rename from orm/OwnedItems.go rename to orm/owned_items.go diff --git a/orm/OwnedShip.go b/orm/owned_ship.go similarity index 100% rename from orm/OwnedShip.go rename to orm/owned_ship.go diff --git a/orm/Punishment.go b/orm/punishment.go similarity index 100% rename from orm/Punishment.go rename to orm/punishment.go diff --git a/orm/Rarity.go b/orm/rarity.go similarity index 100% rename from orm/Rarity.go rename to orm/rarity.go diff --git a/orm/Resource.go b/orm/resource.go similarity index 79% rename from orm/Resource.go rename to orm/resource.go index 8170268..4157c56 100644 --- a/orm/Resource.go +++ b/orm/resource.go @@ -9,16 +9,16 @@ var ( type OwnedResource struct { CommanderID uint32 `gorm:"primaryKey"` ResourceID uint32 `gorm:"primaryKey"` - Amount uint32 `gorm:"not null;default:0"` + Amount uint32 `gorm:"not_null;default:0"` Commander Commander `gorm:"foreignKey:CommanderID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` Resource Resource `gorm:"foreignKey:ResourceID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` } type Resource struct { - ID uint32 `gorm:"primary_key"` - ItemID uint32 - Name string `gorm:"type:varchar(50);not null"` + ID uint32 `gorm:"primary_key" json:"id"` + ItemID uint32 `json:"itemid"` + Name string `gorm:"type:varchar(128);not_null" json:"name"` Item Item `gorm:"foreignKey:ItemID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` } diff --git a/orm/Server.go b/orm/server.go similarity index 100% rename from orm/Server.go rename to orm/server.go diff --git a/orm/Ship.go b/orm/ship.go similarity index 83% rename from orm/Ship.go rename to orm/ship.go index 82248d8..cab9c64 100644 --- a/orm/Ship.go +++ b/orm/ship.go @@ -6,14 +6,14 @@ import ( ) type Ship struct { - TemplateID uint32 `gorm:"primary_key"` - Name string `gorm:"size:32;not_null"` - RarityID uint32 `gorm:"not_null"` - Star uint32 `gorm:"not_null"` - Type uint32 `gorm:"not_null"` - Nationality uint32 `gorm:"not_null"` - BuildTime uint32 `gorm:"not_null"` - PoolID uint32 + TemplateID uint32 `gorm:"primary_key" json:"id"` + Name string `gorm:"size:32;not_null" json:"name"` + RarityID uint32 `gorm:"not_null" json:"rarity"` + Star uint32 `gorm:"not_null" json:"star"` + Type uint32 `gorm:"not_null" json:"type"` + Nationality uint32 `gorm:"not_null" json:"nationality"` + BuildTime uint32 `gorm:"not_null" json:"-"` + PoolID *uint32 // Rarity Rarity `gorm:"foreignKey:RarityID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` // ShipType ShipType `gorm:"foreignKey:Type;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` diff --git a/orm/shop.go b/orm/shop.go new file mode 100644 index 0000000..eb13279 --- /dev/null +++ b/orm/shop.go @@ -0,0 +1,14 @@ +package orm + +import "github.com/lib/pq" + +type ShopOffer struct { + ID uint32 `gorm:"primary_key" json:"id"` + Effects pq.Int64Array `gorm:"type:integer[];not_null" json:"-"` + Number uint32 `gorm:"not_null" json:"num"` + ResourceNumber uint32 `gorm:"not_null" json:"resource_num"` + ResourceID uint32 `gorm:"not_null" json:"resource_type"` + Type uint32 `gorm:"not_null" json:"type"` + + Resource Resource `gorm:"foreignkey:ResourceID;references:ID"` +} diff --git a/orm/Skin.go b/orm/skin.go similarity index 56% rename from orm/Skin.go rename to orm/skin.go index db6f37e..f4fca86 100644 --- a/orm/Skin.go +++ b/orm/skin.go @@ -3,9 +3,9 @@ package orm import "time" type Skin struct { - ID uint32 `gorm:"primary_key"` - Name string `gorm:"size:128;not_null"` - ShipGroup int `gorm:"not_null"` + ID uint32 `gorm:"primary_key" json:"id"` + Name string `gorm:"size:128;not_null" json:"name"` + ShipGroup int `gorm:"not_null" json:"ship_group"` } type OwnedSkin struct { diff --git a/orm/Yostarus.go b/orm/yostarus.go similarity index 100% rename from orm/Yostarus.go rename to orm/yostarus.go diff --git a/packets/Magic.go b/packets/magic.go similarity index 100% rename from packets/Magic.go rename to packets/magic.go diff --git a/web/routes/Builds.go b/web/routes/builds.go similarity index 100% rename from web/routes/Builds.go rename to web/routes/builds.go diff --git a/web/routes/Depot.go b/web/routes/depot.go similarity index 100% rename from web/routes/Depot.go rename to web/routes/depot.go diff --git a/web/routes/Dock.go b/web/routes/dock.go similarity index 100% rename from web/routes/Dock.go rename to web/routes/dock.go diff --git a/web/routes/Frames.go b/web/routes/frames.go similarity index 100% rename from web/routes/Frames.go rename to web/routes/frames.go diff --git a/web/routes/Index.go b/web/routes/index.go similarity index 100% rename from web/routes/Index.go rename to web/routes/index.go diff --git a/web/routes/Players.go b/web/routes/players.go similarity index 100% rename from web/routes/Players.go rename to web/routes/players.go diff --git a/web/routes/Resources.go b/web/routes/resources.go similarity index 100% rename from web/routes/Resources.go rename to web/routes/resources.go diff --git a/web/routes/Servers.go b/web/routes/servers.go similarity index 100% rename from web/routes/Servers.go rename to web/routes/servers.go diff --git a/web/utils/AccountStatusBadge.go b/web/utils/account_status_badge.go similarity index 100% rename from web/utils/AccountStatusBadge.go rename to web/utils/account_status_badge.go diff --git a/web/utils/HumanReadableSize.go b/web/utils/human_readable_size.go similarity index 100% rename from web/utils/HumanReadableSize.go rename to web/utils/human_readable_size.go diff --git a/web/utils/ISOTimestamp.go b/web/utils/iso_timestamp.go similarity index 100% rename from web/utils/ISOTimestamp.go rename to web/utils/iso_timestamp.go diff --git a/web/utils/RepeatString.go b/web/utils/repeat_string.go similarity index 100% rename from web/utils/RepeatString.go rename to web/utils/repeat_string.go diff --git a/web/utils/ReturnAlert.go b/web/utils/return_alert.go similarity index 100% rename from web/utils/ReturnAlert.go rename to web/utils/return_alert.go diff --git a/web/utils/ReturnToast.go b/web/utils/return_toast.go similarity index 100% rename from web/utils/ReturnToast.go rename to web/utils/return_toast.go diff --git a/web/utils/SecondsLeft.go b/web/utils/seconds_left.go similarity index 100% rename from web/utils/SecondsLeft.go rename to web/utils/seconds_left.go diff --git a/web/utils/TabColor.go b/web/utils/tab_color.go similarity index 100% rename from web/utils/TabColor.go rename to web/utils/tab_color.go diff --git a/web/utils/TimeFormat.go b/web/utils/time_format.go similarity index 100% rename from web/utils/TimeFormat.go rename to web/utils/time_format.go diff --git a/web/utils/TimeLeft.go b/web/utils/time_left.go similarity index 100% rename from web/utils/TimeLeft.go rename to web/utils/time_left.go diff --git a/web/utils/TimeSpan.go b/web/utils/time_span.go similarity index 100% rename from web/utils/TimeSpan.go rename to web/utils/time_span.go diff --git a/web/utils/TrimString.go b/web/utils/trim_string.go similarity index 100% rename from web/utils/TrimString.go rename to web/utils/trim_string.go