From d0e6c02feba06bfa3aba53595df6db3788c69840 Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Sun, 29 Jul 2018 08:59:00 -0500 Subject: [PATCH] addtunnel now can't update locations with existing tunnels. Also several other fixes --- DiscordDatabaseInterface.py | 55 ------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 DiscordDatabaseInterface.py diff --git a/DiscordDatabaseInterface.py b/DiscordDatabaseInterface.py deleted file mode 100644 index 78bf4b2..0000000 --- a/DiscordDatabaseInterface.py +++ /dev/null @@ -1,55 +0,0 @@ -from DatabaseModels import * -from DatabaseInterface import DatabaseInterface - - -class DiscordDatabaseInterface(DatabaseInterface): - - def add_location(self, session, owner_uuid, name, x_pos, z_pos, dimension=None): - owner = DatabaseInterface.find_player_by_discord_uuid(self, session, owner_uuid) - return DatabaseInterface.add_location(self, session, owner, name, x_pos, z_pos, dimension) - - def add_shop(self, session, owner_uuid, name, x_pos, z_pos, dimension=None): - owner = DatabaseInterface.find_player_by_discord_uuid(self, session, owner_uuid) - return DatabaseInterface.add_shop(self, session, owner, name, x_pos, z_pos, dimension) - - def add_tunnel(self, session, owner_uuid, color, number, location_name=""): - owner = DatabaseInterface.find_player_by_discord_uuid(self, session, owner_uuid) - return DatabaseInterface.add_tunnel(self, session, owner, color, number, location_name) - - def add_item(self, session, owner_uuid, shop_name, item_name, price, amount): - owner = DatabaseInterface.find_player_by_discord_uuid(self, session, owner_uuid) - return DatabaseInterface.add_item(self, session, owner, shop_name, item_name, price, amount) - - def add_player(self, session, player_name, discord_id): - try: - player = self.find_player(session, player_name) - except PlayerNotFound: - try: - uuid = grab_UUID(player_name) - player = self.find_player_by_mc_uuid(session, uuid) - except PlayerNotFound: - player = Player(player_name, discord_id) - self.database.add_object(session, player) - finally: - player.name = player_name - return player - - def find_location_by_owner_uuid(self, session, owner_uuid): - owner = DatabaseInterface.find_player_by_discord_uuid(self, session, owner_uuid) - return DatabaseInterface.find_location_by_owner(self, session, owner) - - def find_shop_by_owner_uuid(self, session, owner_uuid): - owner = DatabaseInterface.find_player_by_discord_uuid(self, session, owner_uuid) - return DatabaseInterface.find_shop_by_owner(self, session, owner) - - def find_shop_by_name_and_owner_uuid(self, session, owner_uuid, name): - owner = DatabaseInterface.find_player_by_discord_uuid(self, session, owner_uuid) - return DatabaseInterface.find_shop_by_name_and_owner(self, session, owner, name) - - def find_location_by_name_and_owner_uuid(self, session, owner_uuid, name): - owner = DatabaseInterface.find_player_by_discord_uuid(self, session, owner_uuid) - return DatabaseInterface.find_location_by_name_and_owner(self, session, owner, name) - - def delete_location(self, session, owner_uuid, name): - owner = DatabaseInterface.find_player_by_discord_uuid(self, session, owner_uuid) - return DatabaseInterface.delete_location(self, session, owner, name) \ No newline at end of file