-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
REFlexUpdater.lua
160 lines (141 loc) · 4.83 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
local _, RE = ...
local mfloor = math.floor
local tinsert = table.insert
function RE:UpdateSettings()
if RE.Settings.ConfigVersion < 260 then
if RE.Settings.ConfigVersion < 220 then
RE.Settings.CurrentTab = 1
RE.Settings.Filters = {["Spec"] = 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
if RE.Settings.ConfigVersion < 260 then
RE.Settings.ArenaStatsLimit = 3
RE.Settings.ConfigVersion = 260
end
if RE.Settings.Filters.DateMode > 1 then
RE.Settings.Filters.DateMode = RE.Settings.Filters.DateMode + 1
end
RE.Settings.ConfigVersion = 310
end
end
function RE:UpdateDatabase()
for i=1, #RE.Database do
if RE.Database[i].Version < 3300 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
RE.Database[i].Version = 265
end
if RE.Database[i].Version < 266 then
if RE.Database[i].Map == 998 then
RE.Database[i].Map = 1035
end
RE.Database[i].Version = 266
end
if RE.Database[i].Version < 268 then
if RE.Database[i].Map == 2177 then
RE.Database[i].Hidden = true
end
RE.Database[i].Version = 268
end
if RE.Database[i].Version < 274 then
if RE.Database[i].Map == 2197 then
RE.Database[i].Map = 30
end
RE.Database[i].Version = 274
end
if RE.Database[i].Version < 300 then
RE.Database[i].StatsNum = nil
if not RE.Database[i].Hidden and RE.Database[i].PlayersStats then
local tmp = RE.Database[i].PlayersStats[RE.Database[i].PlayerNum]
RE.Database[i].PlayerStats = {}
for _, v in pairs(tmp) do
tinsert(RE.Database[i].PlayerStats, v[1])
end
RE.Database[i].PlayersStats = nil
end
if not RE.Database[i].Hidden and not RE.Database[i].isArena then
RE.Database[i].BGPlace = {}
tinsert(RE.Database[i].BGPlace, {RE:GetBGPlace(RE.Database[i], true)})
tinsert(RE.Database[i].BGPlace, {RE:GetBGPlace(RE.Database[i], false)})
RE.Database[i].BGComposition = {}
tinsert(RE.Database[i].BGComposition, {RE:GetBGComposition(RE.Database[i], true)})
tinsert(RE.Database[i].BGComposition, {RE:GetBGComposition(RE.Database[i], false)})
if not RE.Database[i].isRated then
RE.Database[i].Players = {RE.Database[i].Players[RE.Database[i].PlayerNum]}
RE.Database[i].PlayerNum = 1
end
end
RE.Database[i].Version = 300
end
RE.Database[i].isSoloShuffle = false
RE.Database[i].Version = 3300
end
end
end
function RE:UpdateHDatabase()
for i=1, #REFlexDatabase do
local date = mfloor(REFlexDatabase[i].Time / 86400) * 86400
local playerData = RE:GetPlayerData(i)
if playerData[5] > 0 then
if not REFlexHonorDatabase[date] then
REFlexHonorDatabase[date] = 0
end
REFlexHonorDatabase[date] = REFlexHonorDatabase[date] + playerData[5]
end
end
end