Skip to content

Commit

Permalink
[9407] If instance have reset time not let rate make it less 1 day.
Browse files Browse the repository at this point in the history
This also fix crash at instance reset data loading at server startup.
  • Loading branch information
VladimirMangos committed Feb 18, 2010
1 parent 66fee05 commit 70d4dae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/game/InstanceSaveMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ void InstanceSaveManager::LoadResetTimes()

// the reset_delay must be at least one day
uint32 period = uint32(mapDiff->resetTime / DAY * sWorld.getConfig(CONFIG_FLOAT_RATE_INSTANCE_RESET_TIME)) * DAY;
if (period < DAY)
period = DAY;

time_t t = GetResetTimeFor(mapid,difficulty);
if(!t)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9406"
#define REVISION_NR "9407"
#endif // __REVISION_NR_H__

18 comments on commit 70d4dae

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If map for specific difficulty have reset time in DBC then rate applied to this time will make final reset time not less 1 day.
This restore in this part how rate work before MapDifficulty.dbc has been added to client.

So if map have reset time then it will be have at least 1 day reset time.

@Neo2003
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have access to DBC content nor know about which map you talk about but I don't see any on offy applying this rule.
Ex: I go to naxx 25 on Tuesday evening (some hours before the week reset), it will reset anyway on Wednesday 5:00, same for ICC, EDC...
5 Heroic instances reset every day, but it does not depend on the time you left it, the reset is server-wide and always at same time (5:00).

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, one specific time not dependent from player enter and not often that one day.

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i meaning all map instances (heroic non-raid and normal/heroic raid) reset in same time for specific map, and period in days

@Stabatha
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this make raids like ICC reset daily like heroics instead of 7 days?

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grr... THIS IS NOT TOUCH normal stored in DBC reset time. This only prevent for > 0 reset time stored in DBC scale to 0 with rate config option too small value. int(7 * 0.1)==0. Code for rate 0.1 will make instaed 0 reset time in like case use 1.

@luisalvarado
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Vladimir is trying to say is that even if you put on mangos.conf to make Instances Reset in less than a day, the minimum will always be 1 full day. So there will be no way to reset an instance in less than a day and would avoid a problem later on. This will have no impact on DBC since DBC has already a 24 hour or more reset time.

@boxa
Copy link
Contributor

@boxa boxa commented on 70d4dae Feb 19, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this? If problems in a config?
On servers with small onlain (not my) coefficente (cd) for instances may be and 1 hour.
May code:
// especcially for config errors
if (period == 0)
period = DAY;

@boxa
Copy link
Contributor

@boxa boxa commented on 70d4dae Feb 19, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No :))
if (!period)
period = DAY;

Will live С++

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For who you want period - 1 hour for raid? How raid instance complete time can be less for small group? For small group of cheaters....
I not see any usefulness for 1 hr period, totally.

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and not for period==0 (it checked before rate apply, but for period > 0 but less DAY

@Stabatha
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a way to make raids reset daily too without having to edit DBC. Making people a week to reset ICC or Ony is silly on a private test server

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you set rate and it down until 1 day (but not less)

@boxa
Copy link
Contributor

@boxa boxa commented on 70d4dae Feb 19, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded one day is not good solution...
Without any dependency...

@boxa
Copy link
Contributor

@boxa boxa commented on 70d4dae Feb 19, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This define "CONFIG_FLOAT_RATE_INSTANCE_RESET_TIME" - now fiction %-/

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol. This rate existed from 2.x client time and it in past always work in this way, scale reset time in full days count not less that 1 day.
In result typo when implemented get reset times from DB instead table check has been lost with crash code in result for values < 1 DAY (0).
In 3.0.9 switch time as i remember.

So you say nonsense that only show that you not understand how this work in past.

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...from DBC instead Db table...

@Neo2003
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine for me :) I did not understand the commit message :) I should have read the code :p

Please sign in to comment.