@@ -16,22 +16,16 @@ bool Game::IniBool(CIniReader ini, std::string section, std::string key)
16
16
bool b = ini.ReadInteger (section, key, 0 ) == 1 ;
17
17
if (b == true )
18
18
{
19
- LOGGER << key << " = true" << std::endl;
20
19
return true ;
21
20
}
22
21
else
23
22
{
24
- LOGGER << key << " = false" << std::endl;
25
23
return false ;
26
24
}
27
25
}
28
26
29
27
void Game::Init ()
30
28
{
31
- static char sBufferz [1024 ];
32
- sprintf (sBufferz , " %s is compatible with this plugin.\n " , GetGameVersionName ());
33
- LOGGER << sBufferz << std::endl;
34
-
35
29
CIniReader ini (" Discord_" GAME " .ini" );
36
30
DCStatus = IniBool (ini, " Discord" , " DiscordStatus" );
37
31
ShowDetectedIni = IniBool (ini, " Discord" , " ShowDetectedINIMsg" );
@@ -49,6 +43,20 @@ void Game::Init()
49
43
Message (" Discord_%s.ini Detected!" , GAME);
50
44
}
51
45
46
+ if (ShowLOG)
47
+ {
48
+ static char sBufferz [1024 ];
49
+ sprintf (sBufferz , " GTA Trilogy Discord RPC\n v4.1\n " );
50
+ LOGGER << sBufferz << std::endl;
51
+ }
52
+
53
+ if (ShowLOG)
54
+ {
55
+ static char sBufferz [1024 ];
56
+ sprintf (sBufferz , " %s Detected.\n " , GetGameVersionName ());
57
+ LOGGER << sBufferz << std::endl;
58
+ }
59
+
52
60
rpc->Update ();
53
61
}
54
62
@@ -57,7 +65,7 @@ void Game::Update()
57
65
if (ShowLOG)
58
66
{
59
67
LOGGER << std::endl;
60
- Logger (" Starting Discord RPC Plugins ." );
68
+ Logger (" Trying to start Events::initRwEvent ." );
61
69
}
62
70
63
71
Events::initRwEvent += []
@@ -75,7 +83,7 @@ void Game::Update()
75
83
76
84
if (ShowLOG)
77
85
{
78
- Logger (" Discord Module Initialized !" );
86
+ Logger (" Events::initRwEvent Started !" );
79
87
}
80
88
81
89
if (DCStatus)
@@ -86,7 +94,10 @@ void Game::Update()
86
94
details = " Game: III" ;
87
95
}
88
96
#elif GTASA
89
- if (GetGameVersion () == GAME_10US_HOODLUM || GetGameVersion () == GAME_10US_COMPACT)
97
+ if (GetGameVersion () == GAME_10US_HOODLUM || GetGameVersion () == GAME_10US_COMPACT ||
98
+ GetGameVersion () == GAME_10EU || GetGameVersion () == GAME_11US ||
99
+ GetGameVersion () == GAME_11EU || GetGameVersion () == GAME_STEAM ||
100
+ GetGameVersion () == GAME_STEAM_LV)
90
101
{
91
102
details = " Game: San Andreas" ;
92
103
}
@@ -102,13 +113,14 @@ void Game::Update()
102
113
state = " Version: 1.0 EN" ;
103
114
}
104
115
#elif GTASA
105
- if (GetGameVersion () == GAME_10US_HOODLUM)
106
- {
107
- state = " Version: 1.0 US Hoodlum" ;
108
- }
109
- else if (GetGameVersion () == GAME_10US_COMPACT)
116
+ if (GetGameVersion () == GAME_10US_HOODLUM || GetGameVersion () == GAME_10US_COMPACT ||
117
+ GetGameVersion () == GAME_10EU || GetGameVersion () == GAME_11US ||
118
+ GetGameVersion () == GAME_11EU || GetGameVersion () == GAME_STEAM ||
119
+ GetGameVersion () == GAME_STEAM_LV)
110
120
{
111
- state = " Version: 1.0 US Compact" ;
121
+ static char sBufferz [1024 ];
122
+ sprintf (sBufferz , " Version: %s" , GetGameVersionNames ());
123
+ state = sBufferz ;
112
124
}
113
125
#elif GTAVC
114
126
if (GetGameVersion () == GAME_10EN)
@@ -148,44 +160,52 @@ BOOL APIENTRY DllMain(HINSTANCE hDllHandle, DWORD reason, LPVOID lpReserved)
148
160
#ifdef GTASA
149
161
if (GetModuleHandleA (" SAMP.dll" ) || GetModuleHandleA (" SAMP.asi" ))
150
162
{
151
- if (GetGameVersion () != GAME_10US_HOODLUM || GetGameVersion () != GAME_10US_COMPACT)
163
+ if (GetGameVersion () != GAME_10US_HOODLUM || GetGameVersion () != GAME_10US_COMPACT ||
164
+ GetGameVersion () != GAME_10EU || GetGameVersion () != GAME_11US ||
165
+ GetGameVersion () != GAME_11EU || GetGameVersion () != GAME_STEAM ||
166
+ GetGameVersion () != GAME_STEAM_LV)
152
167
{
153
- static char sBufferz [1024 ];
168
+ /* static char sBufferz[1024];
154
169
sprintf(sBufferz, "GTA Trilogy Discord RPC\nv4.0 \n\nSA-MP Detected and this plugin are incompatible with this version \n- %s", GetGameVersionName());
155
- LOGGER << sBufferz << " \n " << std::endl;
170
+ LOGGER << sBufferz << "\n" << std::endl;*/
156
171
157
172
Error (" SA-MP Detected and this plugin are incompatible with this version \n - %s" , GetGameVersionName ());
158
173
IfSampExist = true ;
159
174
}
160
175
else
161
176
{
162
- static char sBufferz [1024 ];
177
+ /* static char sBufferz[1024];
163
178
sprintf(sBufferz, "GTA Trilogy Discord RPC\nv4.0 \n\nSA-MP Detected! Ignoring Plugin.");
164
- LOGGER << sBufferz << std::endl;
179
+ LOGGER << sBufferz << std::endl;*/
165
180
166
181
Error (" SA-MP Detected!" );
167
182
IfSampExist = true ;
168
183
}
169
184
}
170
185
else
171
186
{
172
- if (GetGameVersion () == GAME_10US_HOODLUM || GetGameVersion () == GAME_10US_COMPACT)
187
+ if (GetGameVersion () == GAME_10US_HOODLUM || GetGameVersion () == GAME_10US_COMPACT ||
188
+ GetGameVersion () == GAME_10EU || GetGameVersion () == GAME_11US ||
189
+ GetGameVersion () == GAME_11EU || GetGameVersion () == GAME_STEAM ||
190
+ GetGameVersion () == GAME_STEAM_LV)
173
191
{
174
- static char sBufferz [1024 ];
192
+ /* static char sBufferz[1024];
175
193
sprintf(sBufferz, "GTA Trilogy Discord RPC\nv4.0\n");
176
- LOGGER << sBufferz << std::endl;
194
+ LOGGER << sBufferz << std::endl;*/
177
195
178
196
rpc->Init ();
179
197
IfSampExist = false ;
180
198
}
181
199
else
182
200
{
183
- static char sBufferz [1024 ];
201
+ /* static char sBufferz[1024];
184
202
sprintf(sBufferz, "GTA Trilogy Discord RPC\nv4.0 \n\nERROR: This plugin does not work with %s version.", GetGameVersionName());
185
- LOGGER << sBufferz << std::endl;
203
+ LOGGER << sBufferz << std::endl;*/
186
204
187
- Error (" This game version is not supported by %s plugin.\n This plugin supports these game versions:\n - %s \n - %s" ,
188
- plugin::paths::GetPluginFileNameA (), GetGameVersionName (GAME_10US_HOODLUM), GetGameVersionName (GAME_10US_COMPACT));
205
+ Error (" This game version is not supported by %s plugin.\n This plugin supports these game versions:\n - %s \n - %s \n - %s \n - %s \n - %s \n - %s \n - %s" ,
206
+ plugin::paths::GetPluginFileNameA (), GetGameVersionName (GAME_10US_HOODLUM), GetGameVersionName (GAME_10US_COMPACT),
207
+ GetGameVersionName (GAME_10EU), GetGameVersionName (GAME_11US), GetGameVersionName (GAME_11EU), GetGameVersionName (GAME_STEAM),
208
+ GetGameVersionName (GAME_STEAM_LV));
189
209
IfSampExist = false ;
190
210
}
191
211
}
0 commit comments