From a444ac1463b8c2ba59026a9d680fb3d83d13803f Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 18 Feb 2022 16:30:56 +0100 Subject: [PATCH] More setup work. --- Mourne-CI/sql/db_13_04_23.sql | 69 +++++---- SConstruct | 1 + app/ai/ai_node.cpp | 53 +++++++ app/buildings/building_node.cpp | 185 +++++++++++++++++++++++ app/changelog/changelog_node.cpp | 24 +++ app/hero/hero_node.cpp | 252 +++++++++++++++++++++++++++++++ app/mail/mail_node.cpp | 62 ++++++++ app/news/news_node.cpp | 11 ++ app/units/unit_node.cpp | 84 +++++++++++ app/units/unit_node.h | 28 ++++ app/village/village_node.cpp | 38 +++++ 11 files changed, 775 insertions(+), 32 deletions(-) create mode 100644 app/units/unit_node.cpp create mode 100644 app/units/unit_node.h diff --git a/Mourne-CI/sql/db_13_04_23.sql b/Mourne-CI/sql/db_13_04_23.sql index d409682..293a364 100644 --- a/Mourne-CI/sql/db_13_04_23.sql +++ b/Mourne-CI/sql/db_13_04_23.sql @@ -25,7 +25,7 @@ SET time_zone = "+00:00"; -- -- Table structure for table `ai_settings` -- - +--done CREATE TABLE IF NOT EXISTS `ai_settings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `setting` text NOT NULL, @@ -37,7 +37,7 @@ CREATE TABLE IF NOT EXISTS `ai_settings` ( -- -- Dumping data for table `ai_settings` -- - +--done INSERT INTO `ai_settings` (`id`, `setting`, `value`, `description`) VALUES (1, 'on', '1', '1 if AI is on, 0 if AI is off.'), (2, 'max_attack_village_limit', '15', 'Max number of Ai Village that can attack at the same time.'), @@ -49,7 +49,7 @@ INSERT INTO `ai_settings` (`id`, `setting`, `value`, `description`) VALUES -- -- Table structure for table `ai_units` -- - +--done CREATE TABLE IF NOT EXISTS `ai_units` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` text NOT NULL, @@ -69,7 +69,7 @@ CREATE TABLE IF NOT EXISTS `ai_units` ( -- -- Dumping data for table `ai_units` -- - +--done INSERT INTO `ai_units` (`id`, `name`, `icon`, `ability`, `can_carry`, `attack`, `defense`, `rate`, `per_score`, `turn`, `strong_against`, `weak_against`) VALUES (1, 'Soilder', 'E_NOTIMPL', 2, 1, 1, 1, 0.5, 3, 2, 0, 0), (2, 'test2', 'E_NOTIMPL', 1, 0, 1, 1, 1, 5, 1, 0, 0); @@ -123,6 +123,7 @@ INSERT INTO `assignments` (`id`, `unitid`, `max`, `bonus_per_assigned`, `spellid -- Table structure for table `attacks` -- +--done CREATE TABLE IF NOT EXISTS `attacks` ( `id` int(11) NOT NULL AUTO_INCREMENT, `villageid` int(11) NOT NULL, @@ -187,7 +188,7 @@ CREATE TABLE IF NOT EXISTS `buildings` ( -- -- Dumping data for table `buildings` -- - +--done INSERT INTO `buildings` (`id`, `name`, `description`, `icon`, `rank`, `next_rank`, `time_to_build`, `creates`, `num_creates`, `score`, `defense`, `ability`, `cost_food`, `cost_wood`, `cost_stone`, `cost_iron`, `cost_mana`, `mod_max_food`, `mod_max_wood`, `mod_max_stone`, `mod_max_iron`, `mod_max_mana`, `mod_rate_food`, `mod_rate_wood`, `mod_rate_stone`, `mod_rate_iron`, `mod_rate_mana`, `mod_percent_food`, `mod_percent_wood`, `mod_percent_stone`, `mod_percent_iron`, `mod_percent_mana`, `assignment1`, `assignment2`, `assignment3`, `assignment4`, `assignment5`, `req_tech`, `tech_group`, `tech_secondary_group`) VALUES (1, 'empty', '', 'empty/empty.png', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (2, 'Build in Progress', '', 'bip/bip.png', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), @@ -270,6 +271,7 @@ CREATE TABLE IF NOT EXISTS `building_spell_cooldowns` ( -- Table structure for table `changelog_commits` -- +--done CREATE TABLE IF NOT EXISTS `changelog_commits` ( `id` int(11) NOT NULL AUTO_INCREMENT, `versionid` int(11) NOT NULL, @@ -284,6 +286,7 @@ CREATE TABLE IF NOT EXISTS `changelog_commits` ( -- Table structure for table `changelog_versions` -- +--done CREATE TABLE IF NOT EXISTS `changelog_versions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `version` varchar(64) NOT NULL, @@ -297,6 +300,7 @@ CREATE TABLE IF NOT EXISTS `changelog_versions` ( -- Table structure for table `combat_logs` -- +--done CREATE TABLE IF NOT EXISTS `combat_logs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `villageid` int(11) NOT NULL, @@ -316,6 +320,7 @@ CREATE TABLE IF NOT EXISTS `combat_logs` ( -- Table structure for table `db_version` -- +-- Not needed Settings can handle it CREATE TABLE IF NOT EXISTS `db_version` ( `id` int(11) NOT NULL AUTO_INCREMENT, `version` int(11) NOT NULL, @@ -325,7 +330,7 @@ CREATE TABLE IF NOT EXISTS `db_version` ( -- -- Dumping data for table `db_version` -- - +-- Not needed INSERT INTO `db_version` (`id`, `version`) VALUES (1, 1363701677); @@ -334,7 +339,7 @@ INSERT INTO `db_version` (`id`, `version`) VALUES -- -- Table structure for table `events` -- - +--done CREATE TABLE IF NOT EXISTS `events` ( `id` int(11) NOT NULL AUTO_INCREMENT, `villageid` int(11) NOT NULL, @@ -351,7 +356,7 @@ CREATE TABLE IF NOT EXISTS `events` ( -- -- Table structure for table `heroes` -- - +--done CREATE TABLE IF NOT EXISTS `heroes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userid` int(11) NOT NULL, @@ -442,7 +447,7 @@ CREATE TABLE IF NOT EXISTS `heroes` ( -- -- Table structure for table `heros_inventory` -- - +--done CREATE TABLE IF NOT EXISTS `heros_inventory` ( `id` int(11) NOT NULL AUTO_INCREMENT, `charid` int(11) NOT NULL DEFAULT '0', @@ -464,7 +469,7 @@ CREATE TABLE IF NOT EXISTS `heros_inventory` ( -- -- Table structure for table `hero_inventory_templates` -- - +--done CREATE TABLE IF NOT EXISTS `hero_inventory_templates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `classid` tinyint(4) NOT NULL DEFAULT '0', @@ -481,7 +486,7 @@ CREATE TABLE IF NOT EXISTS `hero_inventory_templates` ( -- -- Table structure for table `hero_items` -- - +--done CREATE TABLE IF NOT EXISTS `hero_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(60) NOT NULL, @@ -553,7 +558,7 @@ CREATE TABLE IF NOT EXISTS `hero_items` ( -- -- Table structure for table `hero_templates` -- - +--done CREATE TABLE IF NOT EXISTS `hero_templates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `classname` varchar(20) NOT NULL, @@ -595,7 +600,7 @@ CREATE TABLE IF NOT EXISTS `hero_templates` ( -- -- Dumping data for table `hero_templates` -- - +--done INSERT INTO `hero_templates` (`id`, `classname`, `nomod_max_health`, `nomod_max_mana`, `max_health`, `max_mana`, `agility`, `strength`, `stamina`, `intellect`, `spirit`, `nomod_attackpower`, `attackpower`, `armor`, `dodge`, `nomod_dodge`, `parry`, `nomod_parry`, `hit`, `crit`, `nomod_crit`, `nomod_damage_min`, `nomod_damage_max`, `damage_min`, `damage_max`, `ranged_damage_min`, `ranged_damage_max`, `nomod_ranged_damage_min`, `nomod_ranged_damage_max`, `nomod_heal_min`, `nomod_heal_max`, `heal_min`, `heal_max`) VALUES (1, 'Warrior', 100, 50, 250, 150, 10, 10, 15, 10, 10, 100, 400, 0, 5.3333333333333, 5, 5.3333333333333, 5, 80, 5.75, 5, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 0, 0), (2, 'Rogue', 100, 100, 200, 200, 15, 10, 10, 10, 10, 30, 0, 0, 5.5, 5, 5.3333333333333, 5, 85, 0, 5, 1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0), @@ -606,7 +611,7 @@ INSERT INTO `hero_templates` (`id`, `classname`, `nomod_max_health`, `nomod_max_ -- -- Table structure for table `mails` -- - +--done CREATE TABLE IF NOT EXISTS `mails` ( `id` int(11) NOT NULL AUTO_INCREMENT, `owner` int(11) NOT NULL, @@ -628,7 +633,7 @@ CREATE TABLE IF NOT EXISTS `mails` ( -- -- Table structure for table `mail_drafts` -- - +--done CREATE TABLE IF NOT EXISTS `mail_drafts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userid` int(11) NOT NULL, @@ -652,7 +657,7 @@ CREATE TABLE IF NOT EXISTS `mail_drafts` ( -- -- Table structure for table `mail_sent` -- - +--done CREATE TABLE IF NOT EXISTS `mail_sent` ( `id` int(11) NOT NULL AUTO_INCREMENT, `userid` int(11) NOT NULL, @@ -674,7 +679,7 @@ CREATE TABLE IF NOT EXISTS `mail_sent` ( -- -- Table structure for table `news` -- - +--done CREATE TABLE IF NOT EXISTS `news` ( `id` int(11) NOT NULL AUTO_INCREMENT, `written_by` varchar(32) NOT NULL, @@ -751,7 +756,7 @@ CREATE TABLE IF NOT EXISTS `sessions` ( -- -- Table structure for table `spells` -- - +--done CREATE TABLE IF NOT EXISTS `spells` ( `id` int(11) NOT NULL AUTO_INCREMENT, `effect` int(11) NOT NULL DEFAULT '0', @@ -786,7 +791,7 @@ CREATE TABLE IF NOT EXISTS `spells` ( -- -- Dumping data for table `spells` -- - +--done INSERT INTO `spells` (`id`, `effect`, `duration`, `cooldown`, `description`, `description_admin`, `weather_change_to`, `cost_food`, `cost_wood`, `cost_stone`, `cost_iron`, `cost_mana`, `mod_max_food`, `mod_max_wood`, `mod_max_stone`, `mod_max_iron`, `mod_max_mana`, `mod_rate_food`, `mod_rate_wood`, `mod_rate_stone`, `mod_rate_iron`, `mod_rate_mana`, `mod_percent_food`, `mod_percent_wood`, `mod_percent_stone`, `mod_percent_iron`, `mod_percent_mana`) VALUES (1, 0, 60, 70, 'Increases productivity of this building, by a small amount.', 'Test spell', 0, 400, 100, 100, 100, 100, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10), (2, 0, 100, 100, 'Increases the food production rate of this building.', 'Test spell 2 (over the top crazy)', 0, 140, 140, 140, 140, 140, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0); @@ -796,7 +801,7 @@ INSERT INTO `spells` (`id`, `effect`, `duration`, `cooldown`, `description`, `de -- -- Table structure for table `technologies` -- - +--done CREATE TABLE IF NOT EXISTS `technologies` ( `id` int(11) NOT NULL AUTO_INCREMENT, `description` text NOT NULL, @@ -832,7 +837,7 @@ CREATE TABLE IF NOT EXISTS `technologies` ( -- -- Dumping data for table `technologies` -- - +--done INSERT INTO `technologies` (`id`, `description`, `time`, `score`, `cost_food`, `cost_wood`, `cost_stone`, `cost_iron`, `cost_mana`, `mod_max_food`, `mod_max_wood`, `mod_max_stone`, `mod_max_iron`, `mod_max_mana`, `mod_rate_food`, `mod_rate_wood`, `mod_rate_stone`, `mod_rate_iron`, `mod_rate_mana`, `mod_percent_food`, `mod_percent_wood`, `mod_percent_stone`, `mod_percent_iron`, `mod_percent_mana`, `mod_create_id`, `mod_spell_id`, `flag_ai`, `is_secondary`) VALUES (1, 'This will do something.', 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0.001, 0.001, 0.001, 0.001, 0.001, 0, 0, 0, 0, 0, 0, 0, 0, 0), (2, 'Allows you to track bugs.', 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0.1, 0.1, 0.1, 0.1, 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0), @@ -846,7 +851,7 @@ INSERT INTO `technologies` (`id`, `description`, `time`, `score`, `cost_food`, ` -- -- Table structure for table `technology_groups` -- - +--done CREATE TABLE IF NOT EXISTS `technology_groups` ( `id` int(11) NOT NULL AUTO_INCREMENT, `groupid` int(11) NOT NULL, @@ -857,7 +862,7 @@ CREATE TABLE IF NOT EXISTS `technology_groups` ( -- -- Dumping data for table `technology_groups` -- - +--done INSERT INTO `technology_groups` (`id`, `groupid`, `technologyid`) VALUES (3, 1, 1), (4, 1, 2), @@ -873,7 +878,7 @@ INSERT INTO `technology_groups` (`id`, `groupid`, `technologyid`) VALUES -- -- Table structure for table `technology_group_descriptions` -- - +--done CREATE TABLE IF NOT EXISTS `technology_group_descriptions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `group_name` text NOT NULL, @@ -883,7 +888,7 @@ CREATE TABLE IF NOT EXISTS `technology_group_descriptions` ( -- -- Dumping data for table `technology_group_descriptions` -- - +--done INSERT INTO `technology_group_descriptions` (`id`, `group_name`) VALUES (1, 'Lumber Mill R1-5'), (2, 'Corn Field R1-5'), @@ -894,7 +899,7 @@ INSERT INTO `technology_group_descriptions` (`id`, `group_name`) VALUES -- -- Table structure for table `technology_have_requirements` -- - +--done CREATE TABLE IF NOT EXISTS `technology_have_requirements` ( `id` int(11) NOT NULL AUTO_INCREMENT, `technologyid` int(11) NOT NULL, @@ -906,7 +911,7 @@ CREATE TABLE IF NOT EXISTS `technology_have_requirements` ( -- -- Dumping data for table `technology_have_requirements` -- - +--done INSERT INTO `technology_have_requirements` (`id`, `technologyid`, `comment`) VALUES (3, 2, 'test1'), (5, 4, 'Corn F opt test r1-5 sec'); @@ -916,7 +921,7 @@ INSERT INTO `technology_have_requirements` (`id`, `technologyid`, `comment`) VAL -- -- Table structure for table `technology_requirements` -- - +--done CREATE TABLE IF NOT EXISTS `technology_requirements` ( `id` int(11) NOT NULL AUTO_INCREMENT, `technologyid` int(11) NOT NULL, @@ -928,7 +933,7 @@ CREATE TABLE IF NOT EXISTS `technology_requirements` ( -- -- Dumping data for table `technology_requirements` -- - +--done INSERT INTO `technology_requirements` (`id`, `technologyid`, `req_tech_id`) VALUES (7, 2, 1), (8, 4, 3); @@ -938,7 +943,7 @@ INSERT INTO `technology_requirements` (`id`, `technologyid`, `req_tech_id`) VALU -- -- Table structure for table `units` -- - +--done CREATE TABLE IF NOT EXISTS `units` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type` int(11) NOT NULL, @@ -971,7 +976,7 @@ CREATE TABLE IF NOT EXISTS `units` ( -- -- Dumping data for table `units` -- - +--done INSERT INTO `units` (`id`, `type`, `name`, `icon`, `score`, `can_defend`, `defense`, `attack`, `weak_against`, `strong_against`, `turn`, `ability`, `time_to_create`, `cost_unit`, `cost_num_unit`, `cost_food`, `cost_wood`, `cost_stone`, `cost_iron`, `cost_mana`, `mod_rate_food`, `mod_rate_wood`, `mod_rate_stone`, `mod_rate_iron`, `mod_rate_mana`) VALUES (1, 0, 'Villager', 'E_NOTIMPL', 1, 1, 5, 2, 1, 0, 1, 0, 5, 0, 0, 100, 1, 1, 1, 0, 0.001, 0, 0, 0, 0), (2, 0, 'Tester', 'E_NOTIMPL', 0, 0, 0, 0, 0, 0, 0, 0, 10, 1, 1, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0), @@ -1111,7 +1116,7 @@ CREATE TABLE IF NOT EXISTS `weathers` ( -- -- Dumping data for table `weathers` -- - +--done INSERT INTO `weathers` (`id`, `name`, `description`, `art`, `css`, `effect`, `mod_max_food`, `mod_max_wood`, `mod_max_stone`, `mod_max_iron`, `mod_max_mana`, `mod_percent_food`, `mod_percent_wood`, `mod_percent_stone`, `mod_percent_iron`, `mod_percent_mana`) VALUES (1, 'Sunny', 'Your maximum food increases by 1000, also increases food production by 10%.', 'E_NOTIMPL', 'sunny', 0, 1000, 0, 0, 0, 0, 10, 0, 0, 0, 0), (2, 'Cold', 'Your max iron increases by 1000, also iron production increases by 10%.', 'E_NOTIMPL', 'cold', 0, 0, 0, 0, 1000, 0, 0, 0, 0, 10, 0); diff --git a/SConstruct b/SConstruct index 422060f..da909b2 100644 --- a/SConstruct +++ b/SConstruct @@ -41,6 +41,7 @@ folders = [ 'app/event', 'app/hero', 'app/mail', + 'app/units', 'app/news', 'app/village', 'app/weather', diff --git a/app/ai/ai_node.cpp b/app/ai/ai_node.cpp index cd9c498..d938ae3 100644 --- a/app/ai/ai_node.cpp +++ b/app/ai/ai_node.cpp @@ -34,6 +34,59 @@ bool AINode::admin_full_render() { return false; } +/* + +CREATE TABLE IF NOT EXISTS `ai_settings` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `setting` text NOT NULL, + `value` text NOT NULL, + `description` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; + +-- +-- Dumping data for table `ai_settings` +-- + +INSERT INTO `ai_settings` (`id`, `setting`, `value`, `description`) VALUES +(1, 'on', '1', '1 if AI is on, 0 if AI is off.'), +(2, 'max_attack_village_limit', '15', 'Max number of Ai Village that can attack at the same time.'), +(3, 'attack_village_rand', '0', 'How much difference can there be from max_attack_village_limit'), +(4, 'ai_unit_max_diff', '10', 'How much different AI Units can attack at once.'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `ai_units` +-- + +CREATE TABLE IF NOT EXISTS `ai_units` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` text NOT NULL, + `icon` text NOT NULL, + `ability` int(11) NOT NULL, + `can_carry` float NOT NULL, + `attack` float NOT NULL, + `defense` float NOT NULL, + `rate` float NOT NULL, + `per_score` int(11) NOT NULL, + `turn` int(11) NOT NULL, + `strong_against` int(11) NOT NULL, + `weak_against` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Dumping data for table `ai_units` +-- + +INSERT INTO `ai_units` (`id`, `name`, `icon`, `ability`, `can_carry`, `attack`, `defense`, `rate`, `per_score`, `turn`, `strong_against`, `weak_against`) VALUES +(1, 'Soilder', 'E_NOTIMPL', 2, 1, 1, 1, 0.5, 3, 2, 0, 0), +(2, 'test2', 'E_NOTIMPL', 1, 0, 1, 1, 1, 5, 1, 0, 0); + + +*/ + AINode::AINode() : AdminNode() { } diff --git a/app/buildings/building_node.cpp b/app/buildings/building_node.cpp index 7d494e9..31a2f6f 100644 --- a/app/buildings/building_node.cpp +++ b/app/buildings/building_node.cpp @@ -571,6 +571,191 @@ void BuildingNode::create_table() { tb->run_query(); //tb->print(); + + /* + +CREATE TABLE IF NOT EXISTS `spells` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `effect` int(11) NOT NULL DEFAULT '0', + `duration` int(11) NOT NULL DEFAULT '0', + `cooldown` int(11) NOT NULL DEFAULT '0', + `description` text NOT NULL, + `description_admin` text NOT NULL, + `weather_change_to` int(11) NOT NULL DEFAULT '0', + `cost_food` int(11) NOT NULL DEFAULT '0', + `cost_wood` int(11) NOT NULL DEFAULT '0', + `cost_stone` int(11) NOT NULL DEFAULT '0', + `cost_iron` int(11) NOT NULL DEFAULT '0', + `cost_mana` int(11) NOT NULL DEFAULT '0', + `mod_max_food` int(11) NOT NULL DEFAULT '0', + `mod_max_wood` int(11) NOT NULL DEFAULT '0', + `mod_max_stone` int(11) NOT NULL DEFAULT '0', + `mod_max_iron` int(11) NOT NULL DEFAULT '0', + `mod_max_mana` int(11) NOT NULL DEFAULT '0', + `mod_rate_food` float NOT NULL DEFAULT '0', + `mod_rate_wood` float NOT NULL DEFAULT '0', + `mod_rate_stone` float NOT NULL DEFAULT '0', + `mod_rate_iron` float NOT NULL DEFAULT '0', + `mod_rate_mana` float NOT NULL DEFAULT '0', + `mod_percent_food` int(11) NOT NULL DEFAULT '0', + `mod_percent_wood` int(11) NOT NULL DEFAULT '0', + `mod_percent_stone` int(11) NOT NULL DEFAULT '0', + `mod_percent_iron` int(11) NOT NULL DEFAULT '0', + `mod_percent_mana` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Dumping data for table `spells` +-- + +INSERT INTO `spells` (`id`, `effect`, `duration`, `cooldown`, `description`, `description_admin`, `weather_change_to`, `cost_food`, `cost_wood`, `cost_stone`, `cost_iron`, `cost_mana`, `mod_max_food`, `mod_max_wood`, `mod_max_stone`, `mod_max_iron`, `mod_max_mana`, `mod_rate_food`, `mod_rate_wood`, `mod_rate_stone`, `mod_rate_iron`, `mod_rate_mana`, `mod_percent_food`, `mod_percent_wood`, `mod_percent_stone`, `mod_percent_iron`, `mod_percent_mana`) VALUES +(1, 0, 60, 70, 'Increases productivity of this building, by a small amount.', 'Test spell', 0, 400, 100, 100, 100, 100, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10), +(2, 0, 100, 100, 'Increases the food production rate of this building.', 'Test spell 2 (over the top crazy)', 0, 140, 140, 140, 140, 140, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0); + + + */ + +/* + +CREATE TABLE IF NOT EXISTS `technologies` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `description` text NOT NULL, + `time` int(11) NOT NULL DEFAULT '0', + `score` int(11) NOT NULL DEFAULT '0', + `cost_food` int(11) NOT NULL DEFAULT '0', + `cost_wood` int(11) NOT NULL DEFAULT '0', + `cost_stone` int(11) NOT NULL DEFAULT '0', + `cost_iron` int(11) NOT NULL DEFAULT '0', + `cost_mana` int(11) NOT NULL DEFAULT '0', + `mod_max_food` int(11) NOT NULL DEFAULT '0', + `mod_max_wood` int(11) NOT NULL DEFAULT '0', + `mod_max_stone` int(11) NOT NULL DEFAULT '0', + `mod_max_iron` int(11) NOT NULL DEFAULT '0', + `mod_max_mana` int(11) NOT NULL DEFAULT '0', + `mod_rate_food` float NOT NULL DEFAULT '0', + `mod_rate_wood` float NOT NULL DEFAULT '0', + `mod_rate_stone` float NOT NULL DEFAULT '0', + `mod_rate_iron` float NOT NULL DEFAULT '0', + `mod_rate_mana` float NOT NULL DEFAULT '0', + `mod_percent_food` int(11) NOT NULL DEFAULT '0', + `mod_percent_wood` int(11) NOT NULL DEFAULT '0', + `mod_percent_stone` int(11) NOT NULL DEFAULT '0', + `mod_percent_iron` int(11) NOT NULL DEFAULT '0', + `mod_percent_mana` int(11) NOT NULL DEFAULT '0', + `mod_create_id` int(11) NOT NULL DEFAULT '0', + `mod_spell_id` int(11) NOT NULL DEFAULT '0', + `flag_ai` int(11) NOT NULL DEFAULT '0', + `is_secondary` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; + +-- +-- Dumping data for table `technologies` +-- + +INSERT INTO `technologies` (`id`, `description`, `time`, `score`, `cost_food`, `cost_wood`, `cost_stone`, `cost_iron`, `cost_mana`, `mod_max_food`, `mod_max_wood`, `mod_max_stone`, `mod_max_iron`, `mod_max_mana`, `mod_rate_food`, `mod_rate_wood`, `mod_rate_stone`, `mod_rate_iron`, `mod_rate_mana`, `mod_percent_food`, `mod_percent_wood`, `mod_percent_stone`, `mod_percent_iron`, `mod_percent_mana`, `mod_create_id`, `mod_spell_id`, `flag_ai`, `is_secondary`) VALUES +(1, 'This will do something.', 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0.001, 0.001, 0.001, 0.001, 0.001, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(2, 'Allows you to track bugs.', 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0.1, 0.1, 0.1, 0.1, 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(3, 'Corn F opt test', 60, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), +(4, 'Corn F opt test 2', 60, 0, 200, 200, 200, 200, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), +(5, 'Corn F test3', 60, 0, 100, 100, 100, 100, 100, 30, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), +(6, 'Test for the wicked.', 50, 10, 100000, 10000, 10000, 20000000, 20000, 30000, 20000, 20000, 20000, 20000, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `technology_groups` +-- + +CREATE TABLE IF NOT EXISTS `technology_groups` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `groupid` int(11) NOT NULL, + `technologyid` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ; + +-- +-- Dumping data for table `technology_groups` +-- + +INSERT INTO `technology_groups` (`id`, `groupid`, `technologyid`) VALUES +(3, 1, 1), +(4, 1, 2), +(5, 2, 1), +(7, 3, 3), +(8, 3, 4), +(11, 2, 2), +(12, 2, 5), +(13, 2, 6); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `technology_group_descriptions` +-- + +CREATE TABLE IF NOT EXISTS `technology_group_descriptions` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `group_name` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; + +-- +-- Dumping data for table `technology_group_descriptions` +-- + +INSERT INTO `technology_group_descriptions` (`id`, `group_name`) VALUES +(1, 'Lumber Mill R1-5'), +(2, 'Corn Field R1-5'), +(3, 'Corn Field R1-5 Sec'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `technology_have_requirements` +-- + +CREATE TABLE IF NOT EXISTS `technology_have_requirements` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `technologyid` int(11) NOT NULL, + `comment` text NOT NULL, + PRIMARY KEY (`id`), + KEY `technologyid` (`technologyid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; + +-- +-- Dumping data for table `technology_have_requirements` +-- + +INSERT INTO `technology_have_requirements` (`id`, `technologyid`, `comment`) VALUES +(3, 2, 'test1'), +(5, 4, 'Corn F opt test r1-5 sec'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `technology_requirements` +-- + +CREATE TABLE IF NOT EXISTS `technology_requirements` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `technologyid` int(11) NOT NULL, + `req_tech_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `technologyid` (`technologyid`,`req_tech_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; + +-- +-- Dumping data for table `technology_requirements` +-- + +INSERT INTO `technology_requirements` (`id`, `technologyid`, `req_tech_id`) VALUES +(7, 2, 1), +(8, 4, 3); + + +*/ } void BuildingNode::drop_table() { Ref tb = get_table_builder(); diff --git a/app/changelog/changelog_node.cpp b/app/changelog/changelog_node.cpp index fa8aff6..613e249 100644 --- a/app/changelog/changelog_node.cpp +++ b/app/changelog/changelog_node.cpp @@ -34,6 +34,30 @@ bool ChangelogNode::admin_full_render() { return false; } +/* +CREATE TABLE IF NOT EXISTS `changelog_commits` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `versionid` int(11) NOT NULL, + `text` text NOT NULL, + `timestamp` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `changelog_versions` +-- + +CREATE TABLE IF NOT EXISTS `changelog_versions` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `version` varchar(64) NOT NULL, + `timestamp` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +*/ + ChangelogNode::ChangelogNode() : AdminNode() { } diff --git a/app/hero/hero_node.cpp b/app/hero/hero_node.cpp index 5c08bad..b18f11b 100644 --- a/app/hero/hero_node.cpp +++ b/app/hero/hero_node.cpp @@ -34,6 +34,258 @@ bool HeroNode::admin_full_render() { return false; } +/* +CREATE TABLE IF NOT EXISTS `heroes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `userid` int(11) NOT NULL, + `name` varchar(15) NOT NULL, + `level` smallint(6) NOT NULL DEFAULT '1', + `experience` int(11) NOT NULL DEFAULT '0', + `class` int(11) NOT NULL, + `selected` tinyint(4) NOT NULL DEFAULT '1', + `health` int(11) NOT NULL, + `mana` int(11) NOT NULL, + `max_health` int(11) NOT NULL, + `max_mana` int(11) NOT NULL, + `percent_max_health` smallint(6) NOT NULL DEFAULT '100', + `percent_max_mana` smallint(6) NOT NULL DEFAULT '100', + `nomod_max_health` int(11) NOT NULL, + `nomod_max_mana` int(11) NOT NULL, + `points` smallint(6) NOT NULL DEFAULT '0', + `agility` int(11) NOT NULL, + `strength` int(11) NOT NULL, + `stamina` int(11) NOT NULL, + `intellect` int(11) NOT NULL, + `spirit` int(11) NOT NULL, + `percent_agility` smallint(6) NOT NULL DEFAULT '100', + `percent_strength` smallint(6) NOT NULL DEFAULT '100', + `percent_stamina` smallint(6) NOT NULL DEFAULT '100', + `percent_intellect` smallint(6) NOT NULL DEFAULT '100', + `percent_spirit` smallint(6) NOT NULL DEFAULT '100', + `nomod_agility` int(11) NOT NULL, + `nomod_strength` int(11) NOT NULL, + `nomod_stamina` int(11) NOT NULL, + `nomod_intellect` int(11) NOT NULL, + `nomod_spirit` int(11) NOT NULL, + `points_agility` smallint(6) NOT NULL DEFAULT '0', + `points_strength` smallint(6) NOT NULL DEFAULT '0', + `points_stamina` smallint(6) NOT NULL DEFAULT '0', + `points_intellect` smallint(6) NOT NULL DEFAULT '0', + `points_spirit` smallint(6) NOT NULL DEFAULT '0', + `attackpower` int(11) NOT NULL DEFAULT '0', + `percent_attackpower` int(11) NOT NULL DEFAULT '100', + `nomod_attackpower` int(11) NOT NULL DEFAULT '0', + `armor` int(11) NOT NULL, + `percent_armor` int(11) NOT NULL DEFAULT '100', + `nomod_armor` int(11) NOT NULL, + `dodge` double NOT NULL DEFAULT '0', + `nomod_dodge` double NOT NULL DEFAULT '0', + `parry` double NOT NULL DEFAULT '0', + `nomod_parry` double NOT NULL DEFAULT '0', + `hit` double NOT NULL DEFAULT '80', + `crit` double NOT NULL DEFAULT '0', + `nomod_crit` double NOT NULL DEFAULT '0', + `damage_min` int(11) NOT NULL, + `damage_max` int(11) NOT NULL, + `percent_damage_min` smallint(6) NOT NULL DEFAULT '100', + `percent_damage_max` smallint(6) NOT NULL DEFAULT '100', + `nomod_damage_min` int(11) NOT NULL, + `nomod_damage_max` int(11) NOT NULL, + `ranged_damage_min` int(11) NOT NULL DEFAULT '0', + `ranged_damage_max` int(11) NOT NULL DEFAULT '0', + `percent_ranged_damage_min` smallint(6) NOT NULL DEFAULT '100', + `percent_ranged_damage_max` smallint(6) NOT NULL DEFAULT '100', + `nomod_ranged_damage_min` int(11) NOT NULL DEFAULT '0', + `nomod_ranged_damage_max` int(11) NOT NULL DEFAULT '0', + `heal_min` int(11) NOT NULL, + `heal_max` int(11) NOT NULL, + `percent_heal_min` smallint(6) NOT NULL DEFAULT '100', + `percent_heal_max` smallint(6) NOT NULL DEFAULT '100', + `nomod_heal_min` int(11) NOT NULL, + `nomod_heal_max` int(11) NOT NULL, + `life_leech` smallint(6) NOT NULL DEFAULT '0', + `mana_leech` smallint(6) NOT NULL DEFAULT '0', + `gender` int(11) NOT NULL DEFAULT '1', + `on_quest` tinyint(4) NOT NULL DEFAULT '0', + `avatar` text NOT NULL, + `thumb_avatar` text NOT NULL, + `deleted` tinyint(4) NOT NULL DEFAULT '0', + `delete_name` text NOT NULL, + PRIMARY KEY (`id`), + KEY `userid` (`userid`), + KEY `deleted` (`deleted`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; + +-- +-- Dumping data for table `heroes` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `heros_inventory` +-- + +CREATE TABLE IF NOT EXISTS `heros_inventory` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `charid` int(11) NOT NULL DEFAULT '0', + `itemid` int(11) NOT NULL DEFAULT '0', + `is_soulbound` tinyint(4) NOT NULL DEFAULT '0', + `stack_size` tinyint(4) NOT NULL DEFAULT '1', + `container` tinyint(4) NOT NULL DEFAULT '1', + `slot` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + KEY `charid` (`charid`,`container`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; + +-- +-- Dumping data for table `heros_inventory` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `hero_inventory_templates` +-- + +CREATE TABLE IF NOT EXISTS `hero_inventory_templates` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `classid` tinyint(4) NOT NULL DEFAULT '0', + `itemid` int(11) NOT NULL DEFAULT '0', + `slotid` int(11) NOT NULL DEFAULT '0', + `container` smallint(6) NOT NULL DEFAULT '0', + `stack` smallint(6) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `classid` (`classid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `hero_items` +-- + +CREATE TABLE IF NOT EXISTS `hero_items` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(60) NOT NULL, + `icon` varchar(100) NOT NULL, + `quality` tinyint(4) NOT NULL DEFAULT '0', + `itemlevel` int(11) NOT NULL DEFAULT '0', + `stack` tinyint(4) NOT NULL DEFAULT '1', + `type` tinyint(4) NOT NULL DEFAULT '0', + `subtype` tinyint(4) NOT NULL DEFAULT '0', + `subsubtype` smallint(6) NOT NULL DEFAULT '0', + `sell_price` int(11) NOT NULL DEFAULT '0', + `buy_price` int(11) NOT NULL DEFAULT '0', + `text` text NOT NULL, + `soulbound` int(11) NOT NULL DEFAULT '0', + `spell` int(11) NOT NULL DEFAULT '0', + `proc` smallint(6) NOT NULL DEFAULT '0', + `req_level` smallint(6) NOT NULL DEFAULT '0', + `req_class` tinyint(4) NOT NULL DEFAULT '0', + `nomod_max_health` int(11) NOT NULL DEFAULT '0', + `nomod_max_mana` int(11) NOT NULL DEFAULT '0', + `percent_max_health` smallint(6) NOT NULL DEFAULT '0', + `percent_max_mana` smallint(6) NOT NULL DEFAULT '0', + `nomod_agility` smallint(6) NOT NULL DEFAULT '0', + `nomod_strength` smallint(6) NOT NULL DEFAULT '0', + `nomod_stamina` smallint(6) NOT NULL DEFAULT '0', + `nomod_intellect` smallint(6) NOT NULL DEFAULT '0', + `nomod_spirit` smallint(6) NOT NULL DEFAULT '0', + `percent_agility` smallint(6) NOT NULL DEFAULT '0', + `percent_strength` smallint(6) NOT NULL DEFAULT '0', + `percent_stamina` smallint(6) NOT NULL DEFAULT '0', + `percent_intellect` smallint(6) NOT NULL DEFAULT '0', + `percent_spirit` smallint(6) NOT NULL DEFAULT '0', + `nomod_attackpower` int(11) NOT NULL DEFAULT '0', + `percent_attackpower` smallint(6) NOT NULL DEFAULT '0', + `nomod_armor` int(11) NOT NULL DEFAULT '0', + `percent_armor` smallint(6) NOT NULL DEFAULT '0', + `nomod_dodge` double NOT NULL DEFAULT '0', + `nomod_parry` double NOT NULL DEFAULT '0', + `hit` double NOT NULL DEFAULT '0', + `nomod_crit` double NOT NULL DEFAULT '0', + `nomod_damage_min` int(11) NOT NULL DEFAULT '0', + `nomod_damage_max` int(11) NOT NULL DEFAULT '0', + `percent_damage_min` smallint(6) NOT NULL DEFAULT '0', + `percent_damage_max` smallint(6) NOT NULL DEFAULT '0', + `nomod_ranged_damage_min` int(11) NOT NULL DEFAULT '0', + `nomod_ranged_damage_max` int(11) NOT NULL DEFAULT '0', + `percent_ranged_damage_min` smallint(6) NOT NULL DEFAULT '0', + `percent_ranged_damage_max` smallint(6) NOT NULL DEFAULT '0', + `nomod_heal_min` int(11) NOT NULL DEFAULT '0', + `nomod_heal_max` int(11) NOT NULL DEFAULT '0', + `percent_heal_min` smallint(6) NOT NULL DEFAULT '0', + `percent_heal_max` smallint(6) NOT NULL DEFAULT '0', + `life_leech` smallint(6) NOT NULL DEFAULT '0', + `mana_leech` smallint(6) NOT NULL DEFAULT '0', + `level_modifier` double NOT NULL DEFAULT '0', + `level_modifier_max` int(11) NOT NULL DEFAULT '0', + `data1` int(11) NOT NULL DEFAULT '0', + `data2` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `qality` (`quality`,`type`,`subtype`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; + +-- +-- Dumping data for table `hero_items` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `hero_templates` +-- + +CREATE TABLE IF NOT EXISTS `hero_templates` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `classname` varchar(20) NOT NULL, + `nomod_max_health` int(11) NOT NULL DEFAULT '1', + `nomod_max_mana` int(11) NOT NULL DEFAULT '1', + `max_health` int(11) NOT NULL DEFAULT '1', + `max_mana` int(11) NOT NULL DEFAULT '1', + `agility` smallint(6) NOT NULL DEFAULT '0', + `strength` smallint(6) NOT NULL DEFAULT '0', + `stamina` smallint(6) NOT NULL DEFAULT '0', + `intellect` smallint(6) NOT NULL DEFAULT '0', + `spirit` smallint(6) NOT NULL DEFAULT '0', + `nomod_attackpower` int(11) NOT NULL DEFAULT '0', + `attackpower` int(11) NOT NULL DEFAULT '0', + `armor` int(11) NOT NULL DEFAULT '0', + `dodge` double NOT NULL DEFAULT '0', + `nomod_dodge` double NOT NULL DEFAULT '0', + `parry` double NOT NULL DEFAULT '0', + `nomod_parry` double NOT NULL DEFAULT '0', + `hit` double NOT NULL DEFAULT '80', + `crit` double NOT NULL DEFAULT '0', + `nomod_crit` double NOT NULL DEFAULT '0', + `nomod_damage_min` int(11) NOT NULL DEFAULT '0', + `nomod_damage_max` int(11) NOT NULL DEFAULT '0', + `damage_min` int(11) NOT NULL DEFAULT '0', + `damage_max` int(11) NOT NULL DEFAULT '0', + `ranged_damage_min` int(11) NOT NULL DEFAULT '0', + `ranged_damage_max` int(11) NOT NULL DEFAULT '0', + `nomod_ranged_damage_min` int(11) NOT NULL DEFAULT '0', + `nomod_ranged_damage_max` int(11) NOT NULL DEFAULT '0', + `nomod_heal_min` int(11) NOT NULL DEFAULT '0', + `nomod_heal_max` int(11) NOT NULL DEFAULT '0', + `heal_min` int(11) NOT NULL DEFAULT '0', + `heal_max` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `class` (`classname`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; + +-- +-- Dumping data for table `hero_templates` +-- + +INSERT INTO `hero_templates` (`id`, `classname`, `nomod_max_health`, `nomod_max_mana`, `max_health`, `max_mana`, `agility`, `strength`, `stamina`, `intellect`, `spirit`, `nomod_attackpower`, `attackpower`, `armor`, `dodge`, `nomod_dodge`, `parry`, `nomod_parry`, `hit`, `crit`, `nomod_crit`, `nomod_damage_min`, `nomod_damage_max`, `damage_min`, `damage_max`, `ranged_damage_min`, `ranged_damage_max`, `nomod_ranged_damage_min`, `nomod_ranged_damage_max`, `nomod_heal_min`, `nomod_heal_max`, `heal_min`, `heal_max`) VALUES +(1, 'Warrior', 100, 50, 250, 150, 10, 10, 15, 10, 10, 100, 400, 0, 5.3333333333333, 5, 5.3333333333333, 5, 80, 5.75, 5, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 0, 0), +(2, 'Rogue', 100, 100, 200, 200, 15, 10, 10, 10, 10, 30, 0, 0, 5.5, 5, 5.3333333333333, 5, 85, 0, 5, 1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0), +(3, 'Archer', 100, 150, 200, 250, 15, 10, 10, 10, 40, 0, 10, 0, 5.5, 5, 5.3333333333333, 5, 85, 0, 5, 1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0); + +*/ + HeroNode::HeroNode() : AdminNode() { } diff --git a/app/mail/mail_node.cpp b/app/mail/mail_node.cpp index c8bb9b5..56f039d 100644 --- a/app/mail/mail_node.cpp +++ b/app/mail/mail_node.cpp @@ -34,6 +34,68 @@ bool MailNode::admin_full_render() { return false; } +/* +CREATE TABLE IF NOT EXISTS `mails` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `owner` int(11) NOT NULL, + `sender` int(11) NOT NULL, + `time` int(11) NOT NULL, + `subject` text NOT NULL, + `body` text NOT NULL, + `new` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `owner` (`owner`,`sender`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=26 ; + +-- +-- Dumping data for table `mails` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `mail_drafts` +-- + +CREATE TABLE IF NOT EXISTS `mail_drafts` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `userid` int(11) NOT NULL, + `friend` int(11) NOT NULL, + `name` text NOT NULL, + `X` int(11) NOT NULL, + `Y` int(11) NOT NULL, + `time` int(11) NOT NULL, + `subject` text NOT NULL, + `body` text NOT NULL, + PRIMARY KEY (`id`), + KEY `time` (`time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; + +-- +-- Dumping data for table `mail_drafts` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `mail_sent` +-- + +CREATE TABLE IF NOT EXISTS `mail_sent` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `userid` int(11) NOT NULL, + `to_id` int(11) NOT NULL, + `to` text NOT NULL, + `time` int(11) NOT NULL, + `subject` text NOT NULL, + `body` text NOT NULL, + PRIMARY KEY (`id`), + KEY `userid` (`userid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + + +*/ + MailNode::MailNode() : AdminNode() { } diff --git a/app/news/news_node.cpp b/app/news/news_node.cpp index f17d5ef..a099420 100644 --- a/app/news/news_node.cpp +++ b/app/news/news_node.cpp @@ -34,6 +34,17 @@ bool NewsNode::admin_full_render() { return false; } +/* + +CREATE TABLE IF NOT EXISTS `news` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `written_by` varchar(32) NOT NULL, + `text` longtext NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +*/ + NewsNode::NewsNode() : AdminNode() { } diff --git a/app/units/unit_node.cpp b/app/units/unit_node.cpp new file mode 100644 index 0000000..e4123d9 --- /dev/null +++ b/app/units/unit_node.cpp @@ -0,0 +1,84 @@ +#include "unit_node.h" + +#include "web/html/form_validator.h" +#include "web/html/html_builder.h" +#include "web/http/cookie.h" +#include "web/http/http_enums.h" +#include "web/http/http_session.h" +#include "web/http/request.h" +#include "web/http/session_manager.h" + +#include "../html_macros.h" + +#include "database/database.h" +#include "database/database_manager.h" +#include "database/query_builder.h" +#include "database/query_result.h" +#include "database/table_builder.h" + +#include "crypto/hash/sha256.h" + +void UnitNode::handle_request_default(Request *request) { +} + +void UnitNode::admin_handle_request_main(Request *request) { + request->send_error(404); +} +String UnitNode::admin_get_section_name() { + return "News"; +} +void UnitNode::admin_add_section_links(Vector *links) { + links->push_back(AdminSectionLinkInfo("- News Editor", "")); +} +bool UnitNode::admin_full_render() { + return false; +} + +/* +CREATE TABLE IF NOT EXISTS `units` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `type` int(11) NOT NULL, + `name` text NOT NULL, + `icon` text NOT NULL, + `score` int(11) NOT NULL DEFAULT '0', + `can_defend` tinyint(4) NOT NULL DEFAULT '0', + `defense` float NOT NULL DEFAULT '0', + `attack` float NOT NULL DEFAULT '0', + `weak_against` int(11) NOT NULL DEFAULT '0', + `strong_against` int(11) NOT NULL DEFAULT '0', + `turn` int(11) NOT NULL, + `ability` int(11) NOT NULL, + `time_to_create` int(11) NOT NULL, + `cost_unit` int(11) NOT NULL DEFAULT '0', + `cost_num_unit` int(11) NOT NULL DEFAULT '0', + `cost_food` int(11) NOT NULL DEFAULT '0', + `cost_wood` int(11) NOT NULL DEFAULT '0', + `cost_stone` int(11) NOT NULL DEFAULT '0', + `cost_iron` int(11) NOT NULL DEFAULT '0', + `cost_mana` int(11) NOT NULL DEFAULT '0', + `mod_rate_food` float NOT NULL DEFAULT '0', + `mod_rate_wood` float NOT NULL DEFAULT '0', + `mod_rate_stone` float NOT NULL DEFAULT '0', + `mod_rate_iron` float NOT NULL DEFAULT '0', + `mod_rate_mana` float NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; + +-- +-- Dumping data for table `units` +-- + +INSERT INTO `units` (`id`, `type`, `name`, `icon`, `score`, `can_defend`, `defense`, `attack`, `weak_against`, `strong_against`, `turn`, `ability`, `time_to_create`, `cost_unit`, `cost_num_unit`, `cost_food`, `cost_wood`, `cost_stone`, `cost_iron`, `cost_mana`, `mod_rate_food`, `mod_rate_wood`, `mod_rate_stone`, `mod_rate_iron`, `mod_rate_mana`) VALUES +(1, 0, 'Villager', 'E_NOTIMPL', 1, 1, 5, 2, 1, 0, 1, 0, 5, 0, 0, 100, 1, 1, 1, 0, 0.001, 0, 0, 0, 0), +(2, 0, 'Tester', 'E_NOTIMPL', 0, 0, 0, 0, 0, 0, 0, 0, 10, 1, 1, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0), +(3, 0, 'Tester2', 'E_NOTIMPL', 0, 0, 0, 0, 0, 0, 0, 0, 30, 1, 2, 20, 30, 2, 2, 0, 1, 1, 1, 1, 1); + + +*/ + +UnitNode::UnitNode() : + AdminNode() { +} + +UnitNode::~UnitNode() { +} diff --git a/app/units/unit_node.h b/app/units/unit_node.h new file mode 100644 index 0000000..7f279c1 --- /dev/null +++ b/app/units/unit_node.h @@ -0,0 +1,28 @@ +#ifndef UNIT_NODE_H +#define UNIT_NODE_H + +#include "core/containers/vector.h" +#include "core/string.h" + +#include "web_modules/admin_panel/admin_node.h" + +class Request; +class FormValidator; +class QueryResult; + +class UnitNode : public AdminNode { + RCPP_OBJECT(UnitNode, AdminNode); + +public: + void handle_request_default(Request *request); + + void admin_handle_request_main(Request *request); + String admin_get_section_name(); + void admin_add_section_links(Vector *links); + bool admin_full_render(); + + UnitNode(); + ~UnitNode(); +}; + +#endif \ No newline at end of file diff --git a/app/village/village_node.cpp b/app/village/village_node.cpp index 827207e..4140dbd 100644 --- a/app/village/village_node.cpp +++ b/app/village/village_node.cpp @@ -198,6 +198,44 @@ void VillageNode::create_table() { //tb->print(); tb->result = ""; + + /* + CREATE TABLE IF NOT EXISTS `attacks` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `villageid` int(11) NOT NULL, + `attackid` int(11) NOT NULL, + `ai_unitid` int(11) NOT NULL, + `ai_unitcount` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `villageid` (`villageid`,`attackid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +*/ + +/* +CREATE TABLE IF NOT EXISTS `combat_logs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `villageid` int(11) NOT NULL, + `time` int(11) NOT NULL, + `new` tinyint(4) NOT NULL, + `log` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=25 ; +*/ + +/* +CREATE TABLE IF NOT EXISTS `events` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `villageid` int(11) NOT NULL, + `slotid` int(11) NOT NULL, + `type` int(11) NOT NULL, + `end` int(11) NOT NULL, + `data1` int(11) NOT NULL, + `data2` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + +*/ + } #define VILLAGE_BUILDING_SPELLS_TABLE_NAME "village_building_spells"