-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathREFlexUpdater.lua
108 lines (94 loc) · 2.94 KB
/
REFlexUpdater.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
local _G = _G
local _, RE = ...
local mfloor = _G.math.floor
function RE:UpdateSettings()
if RE.Settings.ConfigVersion < 260 then
if RE.Settings.ConfigVersion < 220 then
RE.Settings.CurrentTab = 1
RE.Settings.Filters = {["Spec"] = _G.ALL, ["Map"] = 1, ["Bracket"] = 1, ["Date"] = {0, 0}, ["DateMode"] = 1}
RE.Settings.ConfigVersion = 220
end
if RE.Settings.ConfigVersion < 234 then
RE.Settings.Filters.Season = 0
RE.Settings.ConfigVersion = 234
end
if RE.Settings.ConfigVersion < 240 then
RE.Settings.LDBMode = 2
RE.Settings.LDBSide = "A"
RE.Settings.ConfigVersion = 240
end
if RE.Settings.ConfigVersion < 250 then
if not RE.Settings.Filters.DateMode then
RE.Settings.Filters.DateMode = 1
end
RE.Settings.ConfigVersion = 250
end
RE.Settings.ArenaStatsLimit = 3
RE.Settings.ConfigVersion = 260
end
end
function RE:UpdateDatabase()
for i=1, #RE.Database do
if RE.Database[i].Version < 266 then
if RE.Database[i].Version < 224 then
if RE.Database[i].Map == 1681 then
RE.Database[i].Map = 2107
RE.Database[i].isBrawl = true
else
RE.Database[i].isBrawl = false
end
RE.Database[i].Version = 224
end
if RE.Database[i].Version < 225 then
if RE.Database[i].Map == 562 then
RE.Database[i].Map = 1672
end
if RE.Database[i].Map == 559 then
RE.Database[i].Map = 1505
end
RE.Database[i].Version = 225
end
if RE.Database[i].Version < 230 then
if not RE.Database[i].PlayerNum or RE.Database[i].Map == 1170 then
RE.Database[i].Hidden = true
else
RE.Database[i].Hidden = false
end
RE.Database[i].Version = 230
end
if RE.Database[i].Version < 235 then
if RE.Database[i].isArena and RE.Database[i].isRated and RE.Database[i].isBrawl then
RE.Database[i].Hidden = true
end
RE.Database[i].Version = 235
end
if RE.Database[i].Version < 260 then
RE.Database[i].Time = RE.Database[i].Time - (RE.PlayerTimezone * 3600)
RE.Database[i].Version = 260
end
if RE.Database[i].Version < 265 then
if RE.Database[i].Map == 489 then
RE.Database[i].Map = 2106
elseif RE.Database[i].Map == 529 then
RE.Database[i].Map = 2107
end
end
if RE.Database[i].Map == 998 then
RE.Database[i].Map = 1035
end
RE.Database[i].Version = 266
end
end
end
function RE:UpdateHDatabase()
for i=1, #_G.REFlexDatabase do
local date = mfloor(_G.REFlexDatabase[i].Time / 86400) * 86400
local playerData = RE:GetPlayerData(i)
if playerData[5] > 0 then
if not _G.REFlexHonorDatabase[date] then
_G.REFlexHonorDatabase[date] = 0
end
_G.REFlexHonorDatabase[date] = _G.REFlexHonorDatabase[date] + playerData[5]
end
end
end