yisyang/eos

Revenue logic for every 15 Min

Closed this issue ยท 5 comments

Hi,
Thanks for the great work and code works perfectly on my server. The issue i am facing is in revenue generation for every 15 mins by selling the products to 'Computer'. My products are not automatically selling. Can you please let me know how this logic works in the code and which all tables are used to accomplish this.
As many tables are empty, which may be causing problem to run this feature.

Thanks,
Chirag

The sales are computed based on crons, this is what lives on my server:

scott@ratjoy:~$ cat /etc/crontab
# m h dom mon dow user	command
1 0 * * * www php /var/www/ratjoy/app/eos/admin/cron_maintenance.php >/dev/null 2>&1
*/15 * * * * www php /var/www/ratjoy/app/eos/admin/cron_maintenance_15m_sales_1.php >/dev/null 2>&1
3 0 * * * www php /var/www/ratjoy/app/eos/admin/cron_maintenance_firms_1.php >/dev/null 2>&1
1,16,31,46 * * * * www php /var/www/ratjoy/app/eos/admin/cron_maintenance_update_15m.php >/dev/null 2>&1
*/15 * * * * www php /var/www/ratjoy/app/eos/admin/cron_maintenance_update_15m_rj.php >/dev/null 2>&1
35 23 * * * www php /var/www/ratjoy/app/eos/admin/cron_maintenance_janitor.php >/dev/null 2>&1

Yes i solved this issue by activating the crons over my server.
Can you tell me how quest is working as i do not have any data in quest table? what make quest work?is there some cron which will make it active? how can i test?

The cron_maintenance script has these lines:

		// Add 3 quests
		$sql = "UPDATE firms SET quests_available = LEAST(quests_available + 3, 10) WHERE quests_available < 10";
		if(!$db->query($sql)){
			$cron_report_msg = "Error running sql: ".$sql;
			return false;
		}

Meaning every day, each company gets 3 more available quests, until total limit reaches 10.
The next time a player visits the quest page of a company, all available quests (firms.quests_available) of the company will convert into active quests, and you will get records in the firm_quest table, and firms.quests_available will become 0.

Hi,
My Quest problem is still not solved yet. While going through the code and database I observed that i don have any data in 'list_quest' table due to which no quests are showing over there. How will i get the real data in that table? if it is predefined data can you please export the 'list_quest' table and send it?

Thanks

@rogersama

CREATE TABLE `list_quest` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type` int(10) unsigned DEFAULT NULL,
  `level_min` int(10) unsigned NOT NULL DEFAULT '0',
  `level_max` int(10) unsigned NOT NULL DEFAULT '99',
  `value_unit_max` bigint(20) unsigned DEFAULT NULL,
  `value_total` bigint(20) unsigned DEFAULT NULL,
  `target_id` int(10) unsigned DEFAULT NULL,
  `target_type` tinytext,
  `n` bigint(20) DEFAULT NULL,
  `q` int(10) unsigned DEFAULT NULL,
  `cash` bigint(20) DEFAULT NULL,
  `duration` bigint(20) unsigned DEFAULT NULL,
  `quest_giver_id` int(10) unsigned DEFAULT NULL,
  `quest_giver_subject` tinytext,
  `quest_giver_body` text,
  `linked_quest_c` int(10) unsigned DEFAULT NULL,
  `linked_quest_f` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `level_min` (`level_min`,`level_max`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO list_quest (id, type, level_min, level_max, value_unit_max, value_total, target_id, target_type, n, q, cash, duration, quest_giver_id, quest_giver_subject, quest_giver_body, linked_quest_c, linked_quest_f)
VALUES
  (1, 10, 0, 13, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (2, 11, 0, 13, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (3, 3, 0, 99, NULL, NULL, NULL, NULL, NULL, 5, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (4, 1, 5, 99, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (5, 20, 0, 13, NULL, NULL, NULL, 'fact', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (6, 20, 0, 13, NULL, NULL, NULL, 'store', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (7, 20, 2, 13, NULL, NULL, NULL, 'rnd', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (8, 33, 3, 99, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (9, 40, 0, 13, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (10, 41, 0, 13, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (11, 50, 3, 13, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (12, 51, 3, 13, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (13, 42, 5, 99, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (14, 43, 5, 99, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
  (101, 3, 99, 99, NULL, 1000000, NULL, NULL, NULL, 15, NULL, 86400, NULL, NULL, NULL, NULL, NULL),
  (102, 3, 99, 99, NULL, 1000000, NULL, NULL, NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL);