forked from WoWruRU/classicdb_ruRU
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmangos_ruRU_support.patch
More file actions
255 lines (234 loc) · 9.26 KB
/
Copy pathcmangos_ruRU_support.patch
File metadata and controls
255 lines (234 loc) · 9.26 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
From 55e2beab9f22b2ae7bbc539650cb20b726bb1951 Mon Sep 17 00:00:00 2001
From: sidsukana <pgsilent@gmail.com>
Date: Sun, 2 Jul 2017 22:56:59 +0500
Subject: [PATCH] ruRU
---
src/game/Chat/Chat.cpp | 4 ++--
src/game/Chat/Level1.cpp | 4 ++--
src/game/Chat/Level2.cpp | 8 ++++----
src/game/Chat/Level3.cpp | 16 ++++++++--------
src/game/World/World.cpp | 12 ++++++------
src/shared/Common.cpp | 2 ++
src/shared/Common.h | 4 +++-
7 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/src/game/Chat/Chat.cpp b/src/game/Chat/Chat.cpp
index a88326fd5..d73073bb4 100644
--- a/src/game/Chat/Chat.cpp
+++ b/src/game/Chat/Chat.cpp
@@ -1797,7 +1797,7 @@ bool ChatHandler::isValidChatMessage(const char* message) const
return false;
}
- for (uint8 i = 0; i < MAX_LOCALE; ++i)
+ for (uint8 i = 0; i < MAX_DBC_LOCALE; ++i)
{
uint32 skillLineNameLength = strlen(skillLine->name[i]);
if (skillLineNameLength > 0 && strncmp(skillLine->name[i], buffer, skillLineNameLength) == 0)
@@ -1810,7 +1810,7 @@ bool ChatHandler::isValidChatMessage(const char* message) const
}
}
bool foundName = false;
- for (uint8 i = 0; i < MAX_LOCALE; ++i)
+ for (uint8 i = 0; i < MAX_DBC_LOCALE; ++i)
{
if (*linkedSpell->SpellName[i] && strcmp(linkedSpell->SpellName[i], buffer) == 0)
{
diff --git a/src/game/Chat/Level1.cpp b/src/game/Chat/Level1.cpp
index 43fd8378b..d882443ac 100644
--- a/src/game/Chat/Level1.cpp
+++ b/src/game/Chat/Level1.cpp
@@ -1519,7 +1519,7 @@ bool ChatHandler::HandleLookupAreaCommand(char* args)
if (!Utf8FitTo(name, wnamepart))
{
loc = 0;
- for (; loc < MAX_LOCALE; ++loc)
+ for (; loc < MAX_DBC_LOCALE; ++loc)
{
if (loc == GetSessionDbcLocale())
continue;
@@ -1533,7 +1533,7 @@ bool ChatHandler::HandleLookupAreaCommand(char* args)
}
}
- if (loc < MAX_LOCALE)
+ if (loc < MAX_DBC_LOCALE)
{
// send area in "id - [name]" format
std::ostringstream ss;
diff --git a/src/game/Chat/Level2.cpp b/src/game/Chat/Level2.cpp
index dd008e818..a0a143269 100644
--- a/src/game/Chat/Level2.cpp
+++ b/src/game/Chat/Level2.cpp
@@ -1256,7 +1256,7 @@ bool ChatHandler::HandleLookupFactionCommand(char* args)
if (!Utf8FitTo(name, wnamepart))
{
loc = 0;
- for (; loc < MAX_LOCALE; ++loc)
+ for (; loc < MAX_DBC_LOCALE; ++loc)
{
if (loc == GetSessionDbcLocale())
continue;
@@ -1270,7 +1270,7 @@ bool ChatHandler::HandleLookupFactionCommand(char* args)
}
}
- if (loc < MAX_LOCALE)
+ if (loc < MAX_DBC_LOCALE)
{
FactionState const* repState = target ? target->GetReputationMgr().GetState(factionEntry) : nullptr;
ShowFactionListHelper(factionEntry, LocaleConstant(loc), repState, target);
@@ -3977,7 +3977,7 @@ bool ChatHandler::HandleLearnAllRecipesCommand(char* args)
if (!Utf8FitTo(name, wnamepart))
{
loc = 0;
- for (; loc < MAX_LOCALE; ++loc)
+ for (; loc < MAX_DBC_LOCALE; ++loc)
{
if (loc == GetSessionDbcLocale())
continue;
@@ -3991,7 +3991,7 @@ bool ChatHandler::HandleLearnAllRecipesCommand(char* args)
}
}
- if (loc < MAX_LOCALE)
+ if (loc < MAX_DBC_LOCALE)
{
targetSkillInfo = skillInfo;
break;
diff --git a/src/game/Chat/Level3.cpp b/src/game/Chat/Level3.cpp
index 649569dd3..7969e0842 100644
--- a/src/game/Chat/Level3.cpp
+++ b/src/game/Chat/Level3.cpp
@@ -2765,7 +2765,7 @@ bool ChatHandler::HandleLookupItemSetCommand(char* args)
if (!Utf8FitTo(name, wnamepart))
{
loc = 0;
- for (; loc < MAX_LOCALE; ++loc)
+ for (; loc < MAX_DBC_LOCALE; ++loc)
{
if (loc == GetSessionDbcLocale())
continue;
@@ -2779,7 +2779,7 @@ bool ChatHandler::HandleLookupItemSetCommand(char* args)
}
}
- if (loc < MAX_LOCALE)
+ if (loc < MAX_DBC_LOCALE)
{
// send item set in "id - [namedlink locale]" format
if (m_session)
@@ -2828,7 +2828,7 @@ bool ChatHandler::HandleLookupSkillCommand(char* args)
if (!Utf8FitTo(name, wnamepart))
{
loc = 0;
- for (; loc < MAX_LOCALE; ++loc)
+ for (; loc < MAX_DBC_LOCALE; ++loc)
{
if (loc == GetSessionDbcLocale())
continue;
@@ -2842,7 +2842,7 @@ bool ChatHandler::HandleLookupSkillCommand(char* args)
}
}
- if (loc < MAX_LOCALE)
+ if (loc < MAX_DBC_LOCALE)
{
char valStr[50] = "";
char const* knownStr = "";
@@ -2953,7 +2953,7 @@ bool ChatHandler::HandleLookupSpellCommand(char* args)
if (!Utf8FitTo(name, wnamepart))
{
loc = 0;
- for (; loc < MAX_LOCALE; ++loc)
+ for (; loc < MAX_DBC_LOCALE; ++loc)
{
if (loc == GetSessionDbcLocale())
continue;
@@ -2967,7 +2967,7 @@ bool ChatHandler::HandleLookupSpellCommand(char* args)
}
}
- if (loc < MAX_LOCALE)
+ if (loc < MAX_DBC_LOCALE)
{
ShowSpellListHelper(target, spellInfo, LocaleConstant(loc));
++counter;
@@ -3192,7 +3192,7 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(char* args)
if (!Utf8FitTo(name, wnamepart))
{
loc = 0;
- for (; loc < MAX_LOCALE; ++loc)
+ for (; loc < MAX_DBC_LOCALE; ++loc)
{
if (loc == GetSessionDbcLocale())
continue;
@@ -3206,7 +3206,7 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(char* args)
}
}
- if (loc < MAX_LOCALE)
+ if (loc < MAX_DBC_LOCALE)
{
// send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
if (m_session)
diff --git a/src/game/World/World.cpp b/src/game/World/World.cpp
index ca5a02d70..5fa761b12 100644
--- a/src/game/World/World.cpp
+++ b/src/game/World/World.cpp
@@ -1304,9 +1304,9 @@ void World::DetectDBCLang()
{
uint32 m_lang_confid = sConfig.GetIntDefault("DBC.Locale", 255);
- if (m_lang_confid != 255 && m_lang_confid >= MAX_LOCALE)
+ if (m_lang_confid != 255 && m_lang_confid >= MAX_DBC_LOCALE)
{
- sLog.outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)", MAX_LOCALE);
+ sLog.outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)", MAX_DBC_LOCALE);
m_lang_confid = LOCALE_enUS;
}
@@ -1315,8 +1315,8 @@ void World::DetectDBCLang()
std::string availableLocalsStr;
- uint32 default_locale = MAX_LOCALE;
- for (int i = MAX_LOCALE - 1; i >= 0; --i)
+ uint32 default_locale = MAX_DBC_LOCALE;
+ for (int i = MAX_DBC_LOCALE - 1; i >= 0; --i)
{
if (strlen(race->name[i]) > 0) // check by race names
{
@@ -1327,13 +1327,13 @@ void World::DetectDBCLang()
}
}
- if (default_locale != m_lang_confid && m_lang_confid < MAX_LOCALE &&
+ if (default_locale != m_lang_confid && m_lang_confid < MAX_DBC_LOCALE &&
(m_availableDbcLocaleMask & (1 << m_lang_confid)))
{
default_locale = m_lang_confid;
}
- if (default_locale >= MAX_LOCALE)
+ if (default_locale >= MAX_DBC_LOCALE)
{
sLog.outError("Unable to determine your DBC Locale! (corrupt DBC?)");
Log::WaitBeforeContinueIfNeed();
diff --git a/src/shared/Common.cpp b/src/shared/Common.cpp
index 17b925c52..f8ea2e3fc 100644
--- a/src/shared/Common.cpp
+++ b/src/shared/Common.cpp
@@ -28,6 +28,7 @@ char const* localeNames[MAX_LOCALE] =
"zhTW",
"esES",
"esMX",
+ "ruRU"
};
// used for search by name or iterate all names
@@ -42,6 +43,7 @@ LocaleNameStr const fullLocaleNameList[] =
{ "zhTW", LOCALE_zhTW },
{ "esES", LOCALE_esES },
{ "esMX", LOCALE_esMX },
+ { "ruRU", LOCALE_ruRU },
{ NULL, LOCALE_enUS }
};
diff --git a/src/shared/Common.h b/src/shared/Common.h
index 41666942d..0edcc2bb2 100644
--- a/src/shared/Common.h
+++ b/src/shared/Common.h
@@ -145,9 +145,11 @@ enum LocaleConstant
LOCALE_zhTW = 5,
LOCALE_esES = 6,
LOCALE_esMX = 7,
+ LOCALE_ruRU = 8
};
-#define MAX_LOCALE 8
+#define MAX_DBC_LOCALE 8
+#define MAX_LOCALE 9
LocaleConstant GetLocaleByName(const std::string& name);