Jump to content

[Instance] Reset System


Auntie Mangos

Recommended Posts

  • 40 years later...

Core: 10240

SD2: 1744

No Custom Patches.

1st and most important Bug: when you enter in a new instance the first msg were say the time for the instance get reset doesnt show the time.

Also at raid information doesnt show too the time that you need to wait for the instance get the reset.

2cnd less important but important: i test this in a older revision but 10000+

when the reset time comes and your doing the current instance, you are teleported to a nearly Gy, when you should get a msg asking to you if you want to get saved in the current instance or go out.

here a picture where you can see and understand about the 1st bug.

http://img101.imageshack.us/f/sinttulofr.png/

Link to comment
Share on other sites

Try this patch, it's old, but should do the job.

diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp
index 289ea07..b8ab0b1 100644
--- a/src/game/InstanceSaveMgr.cpp
+++ b/src/game/InstanceSaveMgr.cpp
@@ -505,6 +505,8 @@ void InstanceSaveManager::LoadResetTimes()
            if(t - tim[type-1] > now)
                break;

+        ScheduleReset(true, t - tim[type-1], InstResetEvent(type, mapid, difficulty, -1));
+
        for(ResetTimeMapDiffInstances::const_iterator in_itr = mapDiffResetInstances.lower_bound(map_diff_pair);
            in_itr != mapDiffResetInstances.upper_bound(map_diff_pair); ++in_itr)
        {
@@ -610,6 +612,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
        return;

    time_t now = time(NULL);
+    time_t today = (now / DAY) * DAY;

    if (!warn)
    {
@@ -638,10 +641,14 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b

        // calculate the next reset time
        uint32 diff = sWorld.getConfig(CONFIG_UINT32_INSTANCE_RESET_TIME_HOUR) * HOUR;
-        uint32 period = mapDiff->resetTime * DAY;
-        time_t next_reset = ((now + timeLeft + MINUTE) / DAY * DAY) + period + diff;
+        uint32 period = (mapDiff->resetTime / DAY * sWorld.getConfig(CONFIG_FLOAT_RATE_INSTANCE_RESET_TIME)) * DAY;
+        time_t next_reset = today + period + diff;
+
        // update it in the DB
        CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%d' AND difficulty = '%d'", (uint64)next_reset, mapid, difficulty);
+
+        SetResetTimeFor(mapid,difficulty,(uint64)next_reset);
+        ScheduleReset(true, next_reset-3600, InstResetEvent(1, mapid, difficulty, -1));
    }

    // note: this isn't fast but it's meant to be executed very rarely

Link to comment
Share on other sites

Core: 10240

SD2: 1744

No Custom Patches.

1st and most important Bug: when you enter in a new instance the first msg were say the time for the instance get reset doesnt show the time.

Also at raid information doesnt show too the time that you need to wait for the instance get the reset.

Was working fine for me when I tested on 10186 last time. Tested in Ulduar.

Link to comment
Share on other sites

I have solved this issue by stoping the server and applyed this sqls to characters database::


DROP TABLE IF EXISTS `character_instance`;
CREATE TABLE `character_instance` (
 `guid` int(11) unsigned NOT NULL default '0',
 `instance` int(11) unsigned NOT NULL default '0',
 `permanent` tinyint(1) unsigned NOT NULL default '0',
 PRIMARY KEY  (`guid`,`instance`),
 KEY `instance` (`instance`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `character_instance`
--

LOCK TABLES `character_instance` WRITE;
/*!40000 ALTER TABLE `character_instance` DISABLE KEYS */;
/*!40000 ALTER TABLE `character_instance` ENABLE KEYS */;
UNLOCK TABLES;


DROP TABLE IF EXISTS `instance_reset`;
CREATE TABLE `instance_reset` (
 `mapid` int(11) unsigned NOT NULL default '0',
 `difficulty` tinyint(1) unsigned NOT NULL default '0',
 `resettime` bigint(40) NOT NULL default '0',
 PRIMARY KEY  (`mapid`,`difficulty`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `instance_reset`
--

LOCK TABLES `instance_reset` WRITE;
/*!40000 ALTER TABLE `instance_reset` DISABLE KEYS */;
/*!40000 ALTER TABLE `instance_reset` ENABLE KEYS */;
UNLOCK TABLES;

Link to comment
Share on other sites

They drop and crecreate tables, the structure seems to be the same what mangos currently uses, so cleaner way for those two SQL snippets looks like

-- TRUNCATE TABLE instance;
TRUNCATE TABLE instance_reset;
TRUNCATE TABLE character_instance;

is ur asking to me well i already said that 10296.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use