From 4bb35c8bb8311816f911cd4e9d2ab71b2adbc79a Mon Sep 17 00:00:00 2001 From: Mordred Date: Thu, 2 Feb 2023 22:46:37 +0100 Subject: [PATCH] Basic db statements for main fc table --- src/common/Database/ZoneDbConnection.cpp | 38 +++++++++++++----------- src/common/Database/ZoneDbConnection.h | 4 +++ 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/common/Database/ZoneDbConnection.cpp b/src/common/Database/ZoneDbConnection.cpp index 9e65a82f..b9712207 100644 --- a/src/common/Database/ZoneDbConnection.cpp +++ b/src/common/Database/ZoneDbConnection.cpp @@ -356,25 +356,29 @@ void Sapphire::Db::ZoneDbConnection::doPrepareStatements() "DELETE FROM infolinkshell WHERE LinkshellId = ?;", CONNECTION_BOTH ); - /*prepareStatement( LAND_INS, - "INSERT INTO land ( LandSetId ) VALUES ( ? );", + prepareStatement( FC_SEL_ALL, + "SELECT FreeCompanyId, MasterCharacterId, FcName, FcTag, FcCredit, FcCreditAccumu, FcRank, FcPoint, CrestId, CreateDate, GrandCompanyID, " + " ReputationList, FcStatus, FcBoard, FcMotto, ActiveActionList, ActiveActionLeftTimeList, StockActionList " + "FROM freecompany " + "ORDER BY FreeCompanyId ASC;", + CONNECTION_SYNC ); + + prepareStatement( FC_INS, + "INSERT INTO freecompany ( FreeCompanyId, MasterCharacterId, FcName, FcTag, FcCredit, FcCreditAccumu, FcRank, FcPoint," + " ReputationList, CrestId, CreateDate, GrandCompanyID, FcStatus, FcBoard, FcMotto ) VALUES ( ?, ?, ?, ?, ?, ?, ?," + " ?, ?, ?, ?, ?, ?, ?, ? );", CONNECTION_BOTH ); - prepareStatement( LAND_SEL, - "SELECT LandSetId, Size, houseState, iconColor, iconAddIcon, fcId, fcIcon, fcIconColor, exteriorRoof, " - "exteriorWall, exteriorWindow, exteriorDoor, otherFloorWall, otherFloorFlooring, basementWall, " - "gardenSign, colorSlot_0, colorSlot_1, colorSlot_2, colorSlot_3, colorSlot_4, colorSlot_5, " - "colorSlot_6, colorSlot_7, ownerPlayerId, nextDrop, dropCount, currentPrice " - "FROM land WHERE LandSetId = ?;", + prepareStatement( FC_UP, + "UPDATE freecompany SET MasterCharacterId = ?, FcName = ?, FcTag = ?, FcCredit = ?, FcCreditAccumu = ?," + " FcRank = ?, FcPoint = ?, ReputationList = ?, CrestId = ?," + " CreateDate = ?, GrandCompanyID = ?, FcStatus = ?, FcBoard = ?, " + " FcMotto = ?, ActiveActionList = ?, , ActiveActionLeftTimeList = ?, StockActionList = ? " + " WHERE FreeCompanyId = ?;", + CONNECTION_BOTH ); + + prepareStatement( FC_DEL, + "DELETE FROM freecompany WHERE FreeCompanyId = ?;", CONNECTION_BOTH ); - prepareStatement( LAND_UP, - "UPDATE land SET Size = ?, houseState = ?, iconColor = ?, iconAddIcon = ?, fcId = ?, " - "fcIcon = ?, fcIconColor = ?, exteriorRoof = ?, exteriorWall = ?, exteriorWindow = ?, " - "exteriorDoor = ?, otherFloorWall = ?, otherFloorFlooring = ?, basementWall = ?, gardenSign = ?, " - "colorSlot_0 = ?, colorSlot_1 = ?, colorSlot_2 = ?, colorSlot_3 = ?, colorSlot_4 = ?, " - "colorSlot_5 = ?, colorSlot_6 = ?, colorSlot_7 = ?, ownerPlayerId = ?, nextDrop = ?, " - "dropCount = ?, currentPrice = ?" - " WHERE LandSetId = ?;", - CONNECTION_BOTH );*/ } diff --git a/src/common/Database/ZoneDbConnection.h b/src/common/Database/ZoneDbConnection.h index 291454a8..16f8d82e 100644 --- a/src/common/Database/ZoneDbConnection.h +++ b/src/common/Database/ZoneDbConnection.h @@ -115,6 +115,10 @@ namespace Sapphire::Db LINKSHELL_UP, LINKSHELL_DEL, + FC_SEL_ALL, + FC_INS, + FC_UP, + FC_DEL, MAX_STATEMENTS };