forked from Universal-Rom-Tools/Universal-XML-Scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Scraper.au3.Backup.au3
653 lines (608 loc) · 33.5 KB
/
Scraper.au3.Backup.au3
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Ressources\Scraper.ico
#AutoIt3Wrapper_Outfile=.\Scraper.exe
#AutoIt3Wrapper_Outfile_x64=.\Scraper64.exe
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_Description=Scraper
#AutoIt3Wrapper_Res_Fileversion=1.2.0.6
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_LegalCopyright=LEGRAS David
#AutoIt3Wrapper_Res_Language=1036
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=y
#AutoIt3Wrapper_Run_Tidy=y
#Tidy_Parameters=/reel
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
TraySetState(2)
If $CmdLine[0] = 0 Then Exit
$vThreadNumber = $CmdLine[1]
#include <Date.au3>
#include <array.au3>
#include <File.au3>
#include <String.au3>
#include <Crypt.au3>
#include <InetConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
If Not _FileCreate(@ScriptDir & "\test") Then ; Testing UXS Directory
Global $iScriptPath = @AppDataDir & "\UXMLS" ; If not, use Path to current user's Roaming Application Data
DirCreate($iScriptPath) ;
Else
Global $iScriptPath = @ScriptDir
FileDelete($iScriptPath & "\test")
EndIf
Global $iINIPath = $iScriptPath & "\UXS-config.ini"
Global $iLOGPath = $iScriptPath & "\LOGs\log" & $vThreadNumber & ".txt"
Global $iVerboseLVL = IniRead($iINIPath, "GENERAL", "$vVerbose", 0)
_LOG_Ceation($iLOGPath) ; Starting Log
;~ #include "./Include/_MultiLang.au3"
;~ #include "./Include/_XML.au3"
;~ #include "./Include/_MailSlot.au3"
;~ #include "./Include/_GraphGDIPlus.au3"
;~ #include "./Include/_MyFunction.au3"
;~ #include "./Include/_AutoItErrorTrap.au3"
;~ #include "./Include/_Hash.au3"
; Custom title and text...
_AutoItErrorTrap("AutoItErrorTrap", "Hi!" & @CRLF & @CRLF & "An error was detected in the program, you can try again," & _
" cancel to exit or continue to see more details of the error." & @CRLF & @CRLF & "Sorry for the inconvenience!")
Local $iScriptVer = FileGetVersion(@ScriptFullPath)
Local $iINIVer = IniRead($iINIPath, "GENERAL", "$verINI", '0.0.0.0')
Local $iSoftname = "UniversalXMLScraperV" & $iScriptVer
Global $iDevId = BinaryToString(_Crypt_DecryptData("0x1552EDED2FA9B5", "1gdf1g1gf", $CALG_RC4))
Global $iDevPassword = BinaryToString(_Crypt_DecryptData("0x1552EDED2FA9B547FBD0D9A623D954AE7BEDC681", "1gdf1g1gf", $CALG_RC4))
Global $iTEMPPath = $iScriptPath & "\TEMP\MIX" & $vThreadNumber
Global $iTEMPPathGlobal = $iScriptPath & "\TEMP"
Global $iRessourcesPath = $iScriptPath & "\Ressources"
Global $iLangPath = $iScriptPath & "\LanguageFiles" ; Where we are storing the language files.
Global $iProfilsPath = $iScriptPath & "\ProfilsFiles" ; Where we are storing the profils files.
Global $vNodeType = "Element"
Global $vSSLogin = IniRead($iINIPath, "LAST_USE", "$vSSLogin", "")
Global $vSSPassword = BinaryToString(_Crypt_DecryptData(IniRead($iINIPath, "LAST_USE", "$vSSPassword", ""), "1gdf1g1gf", $CALG_RC4))
Local $iSize, $aRomList, $vBoucle, $aConfig, $vProfilsPath, $oXMLProfil, $oXMLSystem, $aMatchingCountry, $oXMLGenre
Local $sMailSlotMother = "\\.\mailslot\Mother"
Local $sMailSlotName = "\\.\mailslot\Son" & $vThreadNumber
Local $sMailSlotCancel = "\\.\mailslot\Cancel" & $vThreadNumber
Local $sMailSlotCheckEngine = "\\.\mailslot\CheckEngine"
Local $hMailSlot = _CreateMailslot($sMailSlotName)
Local $hMailSlotCancel = _CreateMailslot($sMailSlotCancel)
Local $iNumberOfMessagesOverall = 1
_SendMail($sMailSlotCheckEngine, $vThreadNumber & "|0")
$oXMLSystem = _XMLSystem_Create()
If $oXMLSystem = -1 Then Exit
$oXMLGenre = _XMLGenre_Create()
If $oXMLGenre = -1 Then Exit
Sleep(1000)
_SendMail($sMailSlotCheckEngine, $vThreadNumber & "|0")
While $iNumberOfMessagesOverall < 5
If _CheckCount($hMailSlotCancel) >= 1 Then
_MailSlotClose($hMailSlot)
_MailSlotClose($hMailSlotCancel)
Exit
EndIf
If _MailSlotGetMessageCount($hMailSlot) >= 1 Then
Switch $iNumberOfMessagesOverall
Case 1
$aRomList = _ReadMessage($hMailSlot)
_LOG("Read Message $aRomList : " & $aRomList, 1, $iLOGPath)
$aRomList = StringSplit($aRomList, '{Break}', $STR_ENTIRESPLIT + $STR_NOCOUNT)
ReDim $aRomList[13]
$iNumberOfMessagesOverall += 1
Case 2
$vBoucle = _ReadMessage($hMailSlot)
_LOG("Read Message $vBoucle : " & $vBoucle, 1, $iLOGPath)
$iNumberOfMessagesOverall += 1
Case 3
$aConfig = _ReadMessage($hMailSlot)
_LOG("Read Message $aConfig : " & $aConfig, 1, $iLOGPath)
$aConfig = StringSplit($aConfig, '{Break}', $STR_ENTIRESPLIT + $STR_NOCOUNT)
ReDim $aConfig[16]
$aConfig[8] = _XML_Open($iTEMPPathGlobal & "\scraped\" & $vBoucle & ".xml")
$aConfig[9] = StringSplit($aConfig[9], "|")
$aConfig[10] = StringSplit($aConfig[10], "|")
_FileReadToArray($aConfig[11], $aMatchingCountry, $FRTA_NOCOUNT, "|")
$aConfig[11] = $aMatchingCountry
$iNumberOfMessagesOverall += 1
Case 4
$vProfilsPath = _ReadMessage($hMailSlot)
_LOG("Read Message $vProfilsPath : " & $vProfilsPath, 1, $iLOGPath)
$oXMLProfil = _XML_Open($vProfilsPath)
$iNumberOfMessagesOverall += 1
EndSwitch
Else
; no new message - just yield
Sleep(200)
EndIf
If $iNumberOfMessagesOverall = 5 Then
_SendMail($sMailSlotCheckEngine, $vThreadNumber & "|1")
$vRomTimer = TimerInit()
_LOG("-----Making " & $aRomList[2], 1, $iLOGPath)
$aRomList = _Game_Make($aRomList, $vBoucle, $aConfig, $oXMLProfil)
$oXMLAfterTidy = _XML_CreateDOMDocument(Default)
$vXMLAfterTidy = _XML_TIDY($aConfig[8])
_XML_LoadXML($oXMLAfterTidy, $vXMLAfterTidy)
FileDelete($iTEMPPathGlobal & "\scraped\" & $vBoucle & ".xml")
_XML_SaveToFile($oXMLAfterTidy, $iTEMPPathGlobal & "\scraped\" & $vBoucle & ".xml")
$iNumberOfMessagesOverall = 1
$vScrapedTime = Round((TimerDiff($vRomTimer) / 1000), 2)
_SendMail($sMailSlotMother, $vBoucle & "|" & $vScrapedTime)
_LOG("-----" & $aRomList[2] & " scraped in " & $vScrapedTime & "s", 3, $iLOGPath)
_SendMail($sMailSlotCheckEngine, $vThreadNumber & "|0")
If _CheckCount($hMailSlotCancel) >= 1 Then Exit
EndIf
WEnd
Func _Game_Make($aRomList, $vBoucle, $aConfig, $oXMLProfil)
Local $vValue = "", $vAttributeName, $vWhile = 1, $vNode, $vBracketPos = 0, $vHookPos = 0, $vSystem
While 1
If $aRomList[3] = 4 Then
$vNodeType = "Folder"
_LOG("Creating Folder", 1, $iLOGPath)
Else
$vNodeType = "Element"
_LOG("Creating Element", 1, $iLOGPath)
EndIf
_LOG("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_Type = " & _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_Type", 0, "", $oXMLProfil), 1, $iLOGPath)
Switch _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_Type", 0, "", $oXMLProfil)
Case "XML_Value"
$vValue = _XML_Read_Source($aRomList, $vBoucle, $aConfig, $oXMLProfil, $vWhile)
$vNode = _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_Value", 0, "", $oXMLProfil)
Switch _Coalesce(StringLower(_XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_CASE", 0, "", $oXMLProfil)), "default")
Case "true"
$vValue = StringUpper($vValue)
Case "false"
$vValue = StringLower($vValue)
EndSwitch
If $aConfig[5] <> 2 Then
_LOG($vNode & " <-- " & $vValue, 1, $iLOGPath)
_XML_WriteValue($vNode, $vValue, "", $aConfig[8])
EndIf
Case "XML_Attribute"
$vValue = _XML_Read_Source($aRomList, $vBoucle, $aConfig, $oXMLProfil, $vWhile)
$vAttributeName = _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_Attribute_Name", 0, "", $oXMLProfil)
$vNode = _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_Value", 0, "", $oXMLProfil)
Switch _Coalesce(StringLower(_XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_CASE", 0, "", $oXMLProfil)), "default")
Case "true"
$vValue = StringUpper($vValue)
Case "false"
$vValue = StringLower($vValue)
EndSwitch
If $aConfig[5] <> 2 Then
_LOG($vNode & " <-- " & $vValue, 1, $iLOGPath)
_XML_WriteAttributs($vNode, $vAttributeName, $vValue, "", $aConfig[8])
EndIf
Case "XML_Path"
$vValue = _XML_Read_Source($aRomList, $vBoucle, $aConfig, $oXMLProfil, $vWhile)
$vNode = _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_Value", 0, "", $oXMLProfil)
_LOG($vNode & " <-- " & $vValue, 1, $iLOGPath)
If Number($vValue) < 0 Or $aConfig[5] = 2 Then
_LOG($vNode & " <-- No value to write", 1, $iLOGPath)
Else
$vSystem = StringSplit(IniRead($iINIPath, "LAST_USE", "$vSource_RomPath", ""), "\")
$vSystem = $vSystem[UBound($vSystem) - 1]
$vValue = StringReplace($vValue, '%system%', $vSystem)
_XML_WriteValue($vNode, $vValue, "", $aConfig[8])
EndIf
Case "XML_Value_FORMAT"
$vValue = _XML_Read_Source($aRomList, $vBoucle, $aConfig, $oXMLProfil, $vWhile)
Switch _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_FORMAT", 0, "", $oXMLProfil)
Case '%20on1%'
$vValue = StringReplace(Round(($vValue * 100 / 20) / 100, 2), ",", ".")
Case '%ES_Date%'
$vValue = StringLeft(StringReplace($vValue, "-", "") & '00000000', 8) & "T000000"
Case '%Filename%'
$vValue = $aRomList[2]
Case '%Name+Filename_Bracket%'
If StringInStr($aRomList[2], "(") > 0 Then $vBracketPos = StringInStr($aRomList[2], "(")
If StringInStr($aRomList[2], "[") > 0 Then $vHookPos = StringInStr($aRomList[2], "[")
If $vHookPos < $vBracketPos And $vHookPos > 0 Then $vBracketPos = $vHookPos
If $vBracketPos > 0 Then $vValue = $vValue & " " & StringMid($aRomList[2], $vBracketPos)
Case '%Name+Option%'
$vRomId = _XML_Read("Data/jeu/romid", 0, $aRomList[8]) ;RomId
$vTarget_NameOption_Country = _XML_Read('Profil/Element[@Type="Name"]/Target_NameOption_Country', 0, "", $oXMLProfil)
Switch $vTarget_NameOption_Country
Case "Yes"
$vCountryshort = _Coalesce(_XML_Read("Data/jeu/regionshortnames/regionshortname", 0, $aRomList[8]), "unknown")
If $vCountryshort <> "unknown" Then
Local $aLangPref = $aConfig[9]
For $vBoucle2 = 1 To UBound($aLangPref) - 1
$vXpathTemp = '/Data/regions/region[nomcourt="' & $vCountryshort & '"]/nom_' & $aLangPref[$vBoucle2]
$vCountry = _XML_Read($vXpathTemp, 0, $iRessourcesPath & "\Countrylist.xml")
If $vValue <> -1 And $vValue <> "" Then
$vValue = $vValue & " [" & $vCountry & "]"
$vBoucle2 = UBound($aLangPref) - 1
EndIf
Next
EndIf
Case "YesNoWorld"
$vCountryshort = _Coalesce(_XML_Read("Data/jeu/regionshortnames/regionshortname", 0, $aRomList[8]), "unknown")
If $vCountryshort <> "unknown" And $vCountryshort <> "wor" Then
Local $aLangPref = $aConfig[9]
For $vBoucle2 = 1 To UBound($aLangPref) - 1
$vXpathTemp = '/Data/regions/region[nomcourt="' & $vCountryshort & '"]/nom_' & $aLangPref[$vBoucle2]
$vCountry = _XML_Read($vXpathTemp, 0, $iRessourcesPath & "\Countrylist.xml")
If $vValue <> -1 And $vValue <> "" Then
$vValue = $vValue & " [" & $vCountry & "]"
$vBoucle2 = UBound($aLangPref) - 1
EndIf
Next
EndIf
EndSwitch
If _XML_Read('Profil/Element[@Type="Name"]/Target_NameOption_Clone', 0, "", $oXMLProfil) = "Yes" Then $vTarget_NameOption_Clone_Value = _Coalesce(_XML_Read("Data/jeu/cloneof", 0, $aRomList[8]), 0)
If _XML_Read('Profil/Element[@Type="Name"]/Target_NameOption_Beta', 0, "", $oXMLProfil) = "Yes" Then $vTarget_NameOption_Beta_Value = _Coalesce(_XML_Read('Data/jeu/roms/rom[romid="' & $vRomId & '"]/beta', 0, $aRomList[8]), 0)
If _XML_Read('Profil/Element[@Type="Name"]/Target_NameOption_Demo', 0, "", $oXMLProfil) = "Yes" Then $vTarget_NameOption_Demo_Value = _Coalesce(_XML_Read('Data/jeu/roms/rom[romid="' & $vRomId & '"]/demo', 0, $aRomList[8]), 0)
If _XML_Read('Profil/Element[@Type="Name"]/Target_NameOption_Proto', 0, "", $oXMLProfil) = "Yes" Then $vTarget_NameOption_Proto_Value = _Coalesce(_XML_Read('Data/jeu/roms/rom[romid="' & $vRomId & '"]/proto', 0, $aRomList[8]), 0)
If _XML_Read('Profil/Element[@Type="Name"]/Target_NameOption_Trad', 0, "", $oXMLProfil) = "Yes" Then $vTarget_NameOption_Trad_Value = _Coalesce(_XML_Read('Data/jeu/roms/rom[romid="' & $vRomId & '"]/trad', 0, $aRomList[8]), 0)
If _XML_Read('Profil/Element[@Type="Name"]/Target_NameOption_Hack', 0, "", $oXMLProfil) = "Yes" Then $vTarget_NameOption_Hack_Value = _Coalesce(_XML_Read('Data/jeu/roms/rom[romid="' & $vRomId & '"]/hack', 0, $aRomList[8]), 0)
If _XML_Read('Profil/Element[@Type="Name"]/Target_NameOption_Unl', 0, "", $oXMLProfil) = "Yes" Then $vTarget_NameOption_Unl_Value = _Coalesce(_XML_Read('Data/jeu/roms/rom[romid="' & $vRomId & '"]/unl', 0, $aRomList[8]), 0)
If _XML_Read('Profil/Element[@Type="Name"]/Target_NameOption_Alt', 0, "", $oXMLProfil) = "Yes" Then $vTarget_NameOption_Alt_Value = _Coalesce(_XML_Read('Data/jeu/roms/rom[romid="' & $vRomId & '"]/alt', 0, $aRomList[8]), 0)
If _XML_Read('Profil/Element[@Type="Name"]/Target_NameOption_Best', 0, "", $oXMLProfil) = "Yes" Then $vTarget_NameOption_Best_Value = _Coalesce(_XML_Read('Data/jeu/roms/rom[romid="' & $vRomId & '"]/best', 0, $aRomList[8]), 0)
$vNameTag = ""
If $vTarget_NameOption_Clone_Value <> "0" Then $vNameTag = $vNameTag & "Clone, "
If $vTarget_NameOption_Beta_Value <> "0" Then $vNameTag = $vNameTag & "Beta, "
If $vTarget_NameOption_Demo_Value <> "0" Then $vNameTag = $vNameTag & "Demo, "
If $vTarget_NameOption_Proto_Value <> "0" Then $vNameTag = $vNameTag & "Proto, "
If $vTarget_NameOption_Trad_Value <> "0" Then $vNameTag = $vNameTag & "Trad, "
If $vTarget_NameOption_Hack_Value <> "0" Then $vNameTag = $vNameTag & "Hack, "
If $vTarget_NameOption_Unl_Value <> "0" Then $vNameTag = $vNameTag & "Unl, "
If $vTarget_NameOption_Alt_Value <> "0" Then $vNameTag = $vNameTag & "Alt, "
If $vTarget_NameOption_Best_Value <> "0" Then $vNameTag = $vNameTag & "Best, "
If StringRight($vNameTag, 2) = ", " Then $vNameTag = StringTrimRight($vNameTag, 2)
If $vNameTag <> "" Then $vValue = $vValue & " (" & $vNameTag & ")"
_LOG("Final name : " & $vValue, 1, $iLOGPath)
EndSwitch
$vNode = _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_Value", 0, "", $oXMLProfil)
Switch _Coalesce(StringLower(_XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_CASE", 0, "", $oXMLProfil)), "default")
Case "true"
$vValue = StringUpper($vValue)
Case "false"
$vValue = StringLower($vValue)
EndSwitch
If $aConfig[5] <> 2 Then
_LOG($vNode & " <-- " & $vValue, 1, $iLOGPath)
_XML_WriteValue($vNode, $vValue, "", $aConfig[8])
EndIf
Case Else
_LOG("End Of Elements", 1, $iLOGPath)
ExitLoop
EndSwitch
$vWhile = $vWhile + 1
WEnd
Return $aRomList
EndFunc ;==>_Game_Make
Func _XML_Read_Source($aRomList, $vBoucle, $aConfig, $oXMLProfil, $vWhile)
Local $vXpath, $vValue, $vXpathTemp, $aXpathCountry, $aPathSplit, $sDrive, $sDir, $sFileName, $sExtension
$vSource_Type = _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Type", 0, "", $oXMLProfil)
_LOG("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Type = " & $vSource_Type, 1, $iLOGPath)
Switch $vSource_Type
Case "XML_Value"
_LOG("->XML_Value", 1, $iLOGPath)
If $aRomList[9] = 0 Or $aConfig[5] = 2 Then Return ""
$vXpath = _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Value", 0, "", $oXMLProfil)
_LOG("$vXpath : " & $vXpath, 3, $iLOGPath)
If StringInStr($vXpath, '%LANG%') Then
_LOG('%LANG%', 3, $iLOGPath)
Local $aLangPref = $aConfig[9]
For $vBoucle2 = 1 To UBound($aLangPref) - 1
$vXpathTemp = StringReplace($vXpath, '%LANG%', $aLangPref[$vBoucle2])
$vValue = _XML_Read($vXpathTemp, 0, $aRomList[8])
If $vValue <> -1 And $vValue <> "" Then Return $vValue
Next
EndIf
If StringInStr($vXpath, '%COUNTRY%') Then
_LOG('%COUNTRY%', 3, $iLOGPath)
$aXpathCountry = _Fallback($aConfig, $vXpath, $aRomList[8])
For $vBoucle2 = 1 To UBound($aXpathCountry) - 1
$vValue = _XML_Read($aXpathCountry[$vBoucle2], 0, $aRomList[8])
_LOG("COUNTRY " & $aXpathCountry[$vBoucle2] & "=" & $vValue, 1, $iLOGPath)
If $vValue <> -1 And $vValue <> "" Then Return $vValue
Next
EndIf
_LOG('NO TAG', 3, $iLOGPath)
$vValue = _XML_Read($vXpath, 0, $aRomList[8])
_LOG($vXpath & "=" & $vValue, 1, $iLOGPath)
If $vValue <> -1 Then Return $vValue
Return ""
Case "XML_Attribute"
_LOG("->XML_Attribute", 1, $iLOGPath)
If $aRomList[9] = 0 Or $aConfig[5] = 2 Then Return ""
Return _XML_Read(_XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Value", 1, "", $oXMLProfil), 0, $aRomList[8])
Case "XML_Download"
_LOG("->XML_Download", 1, $iLOGPath)
If $aRomList[9] = 0 Then Return ""
$vXpath = _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Value", 0, "", $oXMLProfil)
$aXpathCountry = _Fallback($aConfig, $vXpath, $aRomList[8])
For $vBoucle2 = 1 To UBound($aXpathCountry) - 1
$vDownloadURL = _Coalesce(_XML_Read($aXpathCountry[$vBoucle2], 0, $aRomList[8]), -1)
If $vDownloadURL < 0 Then
If $aXpathCountry[$vBoucle2] <> 'None' Then _LOG($aXpathCountry[$vBoucle2] & " problem : " & $vDownloadURL, 3, $iLOGPath)
Else
$vDownloadMaxWidth = _Coalesce(_XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_Image_Width", 0, "", $oXMLProfil), 0)
$vDownloadMaxHeight = _Coalesce(_XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Target_Image_Height", 0, "", $oXMLProfil), 0)
$vDownloadTag = _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Download_Tag", 0, "", $oXMLProfil)
If $vNodeType = "Folder" Then $vDownloadTag = $vDownloadTag & "-folder"
$vDownloadExt = _Coalesce(IniRead($iINIPath, "LAST_USE", "$vTarget_Image_Ext", ""), _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Download_Ext", 0, "", $oXMLProfil))
$aPathSplit = _PathSplit(StringReplace($aRomList[0], "\", "_"), $sDrive, $sDir, $sFileName, $sExtension)
$vSource_ImagePath = $aConfig[3] & "\" & $sFileName & $vDownloadTag & "." & $vDownloadExt
$vSource_ImagePath = _Picture_Download($vDownloadURL, $vSource_ImagePath, $oXMLProfil, $vDownloadMaxWidth, $vDownloadMaxHeight)
If $vSource_ImagePath < 0 Then Return -1
$vTarget_ImagePath = $aConfig[4] & $sFileName & $vDownloadTag & "." & $vDownloadExt
If $vNodeType = "Folder" Then
$vCheckExist = _XML_NodeExists($aConfig[8], _XML_Read('/Profil/Folder/Target_Value', 0, "", $oXMLProfil) & '[* = "' & $vTarget_ImagePath & '"]')
Else
$vCheckExist = _XML_NodeExists($aConfig[8], _XML_Read('/Profil/Game/Target_Value', 0, "", $oXMLProfil) & '[* = "' & $vTarget_ImagePath & '"]')
EndIf
If $vCheckExist = $XML_RET_SUCCESS Then
_LOG(_XML_Read('/Profil/Game/Target_Value', 0, "", $oXMLProfil) & '[* = "' & $vTarget_ImagePath & '"]' & " Already exist in XML ( " & $vCheckExist & ")", 1, $iLOGPath)
Return -2
EndIf
Return $vTarget_ImagePath
EndIf
Next
Return ""
Case "Fixe_Value"
_LOG("->Fixe_Value", 1, $iLOGPath)
Return _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Value", 0, "", $oXMLProfil)
Case "Variable_Value"
_LOG("->Variable_Value", 1, $iLOGPath)
Switch _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Value", 0, "", $oXMLProfil)
Case '%XML_Rom_Path%'
$vSystem = StringSplit(IniRead($iINIPath, "LAST_USE", "$vSource_RomPath", ""), "\")
$vSystem = $vSystem[UBound($vSystem) - 1]
$vXMLRomPath = $aConfig[2] & StringReplace($aRomList[0], "\", "/")
$vXMLRomPath = StringReplace($vXMLRomPath, '%system%', $vSystem)
Return $vXMLRomPath
Case '%AutoHide%'
If $aRomList[3] = 2 Or $aRomList[3] = 3 Then Return "true"
Case Else
_LOG("SOURCE Unknown", 1, $iLOGPath)
Return ""
EndSwitch
Case "MIX_Template"
_LOG("->MIX_Template", 1, $iLOGPath)
If $aRomList[9] = 0 And $aConfig[6] = 0 Then Return ""
Local $vDownloadTag, $vDownloadExt, $vTargetPicturePath, $aPathSplit, $sDrive, $sDir, $sFileName, $sExtension
$vDownloadTag = _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Download_Tag", 0, "", $oXMLProfil)
If $vNodeType = "Folder" Then $vDownloadTag = $vDownloadTag & "-folder"
$vDownloadExt = _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Download_Ext", 0, "", $oXMLProfil)
$aPathSplit = _PathSplit(StringReplace($aRomList[0], "\", "_"), $sDrive, $sDir, $sFileName, $sExtension)
$vTargetPicturePath = $aConfig[4] & $sFileName & $vDownloadTag & "." & $vDownloadExt
Switch _XML_Read("/Profil/" & $vNodeType & "[" & $vWhile & "]/Source_Download_Path", 0, "", $oXMLProfil)
Case '%Local_Path_File%'
$vDownloadPath = $aConfig[3] & "\" & $sFileName & $vDownloadTag & "." & $vDownloadExt
Case Else ; For the futur
$vDownloadPath = $aConfig[3] & "\" & $sFileName & $vDownloadTag & "." & $vDownloadExt
EndSwitch
If FileExists($vDownloadPath) And $aConfig[5] <> 2 Then Return $vTargetPicturePath
$vValue = _MIX_Engine($aRomList, $vBoucle, $aConfig, $oXMLProfil)
If Not FileExists($vValue) Then Return -1
FileCopy($vValue, $vDownloadPath, $FC_OVERWRITE)
_LOG("MIX Template finished (" & $vTargetPicturePath & ")", 1, $iLOGPath)
Return $vTargetPicturePath
Case Else
_LOG("->SOURCE Unknown", 1, $iLOGPath)
Return ""
EndSwitch
EndFunc ;==>_XML_Read_Source
Func _Fallback($aConfig, $vXpath, $vSource_RomXMLPath)
Local $vCountryPref = '', $vIdGenre = ''
If StringInStr($vXpath, '%COUNTRY%') Then
Local $aCountryPref = $aConfig[10]
Else
Local $aCountryPref[2] = ["", $vXpath]
EndIf
Local $aXpathCountry[UBound($aCountryPref)]
For $vBoucle = 1 To UBound($aCountryPref) - 1
$vCountryPref = $aCountryPref[$vBoucle]
If $vCountryPref = '%COUNTRY%' Then $vCountryPref = _XML_Read("Data/jeu/regionshortnames/regionshortname", 0, $vSource_RomXMLPath)
$aXpathCountry[$vBoucle] = StringReplace($vXpath, '%COUNTRY%', $vCountryPref)
Next
Return $aXpathCountry
EndFunc ;==>_Fallback
Func _Picture_Download($vDownloadURL, $vSource_ImagePath, $oXMLProfil, $vDownloadMaxWidth = 0, $vDownloadMaxHeight = 0)
Local $vDownloadOutputFormat, $aPathSplit, $sDrive, $sDir, $sFileName, $sExtension
$aPathSplit = _PathSplit($vSource_ImagePath, $sDrive, $sDir, $sFileName, $sExtension)
If $vDownloadMaxWidth > 0 Then
$vDownloadMaxWidth = "&maxwidth=" & $vDownloadMaxWidth
Else
$vDownloadMaxWidth = "&maxwidth=" & _Coalesce(IniRead($iINIPath, "LAST_USE", "$vTarget_Image_Width", ""), _XML_Read("Profil/General/Target_Image_Width", 0, "", $oXMLProfil))
EndIf
If $vDownloadMaxHeight > 0 Then
$vDownloadMaxHeight = "&maxheight=" & $vDownloadMaxHeight
Else
$vDownloadMaxHeight = "&maxheight=" & _Coalesce(IniRead($iINIPath, "LAST_USE", "$vTarget_Image_Height", ""), _XML_Read("Profil/General/Target_Image_Height", 0, "", $oXMLProfil))
EndIf
$vDownloadOutputFormat = "&outputformat=" & StringMid($sExtension, 2)
If FileExists($vSource_ImagePath) And $aConfig[5] <> 2 Then
_LOG($vSource_ImagePath & " File already exist", 1, $iLOGPath)
Return $vSource_ImagePath
EndIf
$vDownloadURL = StringReplace($vDownloadURL, "#sspassword#", $vSSPassword) & $vDownloadMaxWidth & $vDownloadMaxHeight & $vDownloadOutputFormat
$vValue = _DownloadWRetry($vDownloadURL, $vSource_ImagePath)
If $vValue < 0 Or Not FileExists($vSource_ImagePath) Then
Return -1
Else
Return $vSource_ImagePath
EndIf
EndFunc ;==>_Picture_Download
Func _MIX_Engine($aRomList, $vBoucle, $aConfig, $oXMLProfil)
Local $vMIXTemplatePath = $iScriptPath & "\Mix\TEMP\"
Local $oMixConfig = _XML_Open($vMIXTemplatePath & "config.xml")
Local $vTarget_Width = _Coalesce(IniRead($iINIPath, "LAST_USE", "$vTarget_Image_Width", ""), _XML_Read("/Profil/General/Target_Width", 0, "", $oMixConfig))
Local $vTarget_Height = _Coalesce(IniRead($iINIPath, "LAST_USE", "$vTarget_Image_Height", ""), _XML_Read("/Profil/General/Target_Height", 0, "", $oMixConfig))
Local $vID_System = $aConfig[12]
Local $vPicTarget = -1, $vWhile = 1, $vFinalValue = ""
Dim $aMiXPicTemp[1]
Sleep(250)
FileDelete($iTEMPPath & "\MIX")
Sleep(250)
DirCreate($iTEMPPath & "\MIX")
FileSetAttrib($iTEMPPath, "+H")
While 1
$iString = ""
Switch StringLower(_XML_Read("/Profil/Element[" & $vWhile & "]/Source_Type", 0, "", $oMixConfig))
Case "fixe_value"
$vPicTarget = $iTEMPPath & "\MIX\" & _XML_Read("/Profil/Element[" & $vWhile & "]/Name", 0, "", $oMixConfig) & ".png"
If Not FileCopy($vMIXTemplatePath & _XML_Read("/Profil/Element[" & $vWhile & "]/Source_Value", 0, "", $oMixConfig), $vPicTarget, $FC_OVERWRITE + $FC_CREATEPATH) Then
_LOG("Error copying " & $vMIXTemplatePath & _XML_Read("/Profil/Element[" & $vWhile & "]/Source_Value", 0, "", $oMixConfig) & " to " & $vPicTarget, 2, $iLOGPath)
Else
$aPicParameters = _MIX_Engine_Dim($vWhile, $oMixConfig)
_GDIPlus_Imaging($vPicTarget, $aPicParameters, $vTarget_Width, $vTarget_Height)
_LOG("fixe_value : " & $vPicTarget & " Created", 1, $iLOGPath)
_ArrayAdd($aMiXPicTemp, $vPicTarget)
EndIf
Case "xml_value"
$vPicTarget = $iTEMPPath & "\MIX\" & _XML_Read("/Profil/Element[" & $vWhile & "]/Name", 0, "", $oMixConfig) & ".png"
$vXpath = _XML_Read("/Profil/Element[" & $vWhile & "]/Source_Value", 0, "", $oMixConfig)
$vOrigin = StringLower(_XML_Read("/Profil/Element[" & $vWhile & "]/source_Origin", 0, "", $oMixConfig))
If $vOrigin = -1 Then $vOrigin = 'game'
$aPicParameters = _MIX_Engine_Dim($vWhile, $oMixConfig)
$aXpathCountry = _Fallback($aConfig, $vXpath, $aRomList[8])
For $vBoucle2 = 1 To UBound($aXpathCountry) - 1
If Not FileExists($vPicTarget) Then
If StringInStr($aXpathCountry[$vBoucle2], '%IDGENRE%') Then
$vIdGenre = _XML_Read("Data/jeu/genres/genres_id/genre_id", 0, $aRomList[8])
$aXpathCountry[$vBoucle2] = StringReplace($aXpathCountry[$vBoucle2], '%IDGENRE%', $vIdGenre)
EndIf
Switch $vOrigin
Case 'game'
$vDownloadURL = _Coalesce(_XML_Read($aXpathCountry[$vBoucle2], 0, $aRomList[8]), -1)
$vCRC = _Coalesce(_XML_Read($aXpathCountry[$vBoucle2] & "_crc", 0, $aRomList[8]), Default)
If $vDownloadURL = -1 Then _LOG("No URL : " & $aXpathCountry[$vBoucle2], 1, $iLOGPath)
Case 'system'
$vDownloadURL = _Coalesce(_XML_Read(StringReplace($aXpathCountry[$vBoucle2], "%IDSYSTEM%", $vID_System), 0, "", $oXMLSystem), -1)
$vCRC = _Coalesce(_XML_Read(StringReplace($aXpathCountry[$vBoucle2], "%IDSYSTEM%", $vID_System) & "_crc", 0, "", $oXMLSystem), Default)
If $vDownloadURL = -1 Then _LOG("No URL : " & StringReplace($aXpathCountry[$vBoucle2], "%IDSYSTEM%", $vID_System), 1, $iLOGPath)
EndSwitch
If Not ($vDownloadURL < 0) Then
$vValue = _DownloadWRetry(StringReplace($vDownloadURL, "#sspassword#", $vSSPassword), $vPicTarget, 15, 20, $vCRC)
If $vValue < 0 Then
_LOG("xml_value : " & $vPicTarget & " Not Added", 2, $iLOGPath)
Else
$vRotationLvl = _Coalesce(_XML_Read("/Profil/Element[" & $vWhile & "]/Target_Rotation", 0, "", $oMixConfig), 0)
If $vRotationLvl > 0 Then
If _GDIPlus_Rotation($vPicTarget, $vRotationLvl) = -1 Then _LOG("Rotation Failed", 2, $iLOGPath)
EndIf
_GDIPlus_Imaging($vPicTarget, $aPicParameters, $vTarget_Width, $vTarget_Height)
_ArrayAdd($aMiXPicTemp, $vPicTarget)
_LOG("xml_value : " & $vPicTarget & " Created", 1, $iLOGPath)
EndIf
EndIf
Else
_LOG("File : " & $vPicTarget & " already exist", 1, $iLOGPath)
EndIf
Next
Case "text"
Switch StringLower(_XML_Read("/Profil/Element[" & $vWhile & "]/Source_TextType", 0, "", $oMixConfig))
Case "xml_value"
$vXpath = (_XML_Read("/Profil/Element[" & $vWhile & "]/Source_Value", 0, "", $oMixConfig))
If StringInStr($vXpath, '%LANG%') Then
Local $aLangPref = $aConfig[9]
For $vBoucle2 = 1 To UBound($aLangPref) - 1
$vXpathTemp = StringReplace($vXpath, '%LANG%', $aLangPref[$vBoucle2])
$vValue = _XML_Read($vXpathTemp, 0, $aRomList[8])
If $vValue <> -1 And $vValue <> "" Then
$vBoucle2 = UBound($aLangPref) - 1
$iString = $vValue
EndIf
Next
EndIf
$aXpathCountry = _Fallback($aConfig, $vXpath, $aRomList[8])
For $vBoucle2 = 1 To UBound($aXpathCountry) - 1
$vValue = _XML_Read($aXpathCountry[$vBoucle2], 0, $aRomList[8])
_LOG("COUNTRY " & $aXpathCountry[$vBoucle2] & "=" & $vValue, 1, $iLOGPath)
If $vValue <> -1 And $vValue <> "" And $iString = "" Then
$vBoucle2 = UBound($aXpathCountry) - 1
$iString = $vValue
EndIf
Next
_LOG("Text = " & $iString, 1, $iLOGPath)
Case "fixe"
$iString = (_XML_Read("/Profil/Element[" & $vWhile & "]/Source_Value", 0, "", $oMixConfig))
_LOG("Text = " & $iString, 1, $iLOGPath)
EndSwitch
$aPicParameters = _MIX_Engine_Dim($vWhile, $oMixConfig)
$iFont = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_Font", 0, "", $oMixConfig)
$iFontSize = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_FontSize", 0, "", $oMixConfig)
$iFontStyle = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_FontStyle", 0, "", $oMixConfig)
$iFontColor = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_FontColor", 0, "", $oMixConfig)
$vPath = $aMiXPicTemp[UBound($aMiXPicTemp) - 1]
_GDIPlus_Text($vPath, $iString, $aPicParameters[2], $aPicParameters[3], $iFont, $iFontSize, $iFontStyle, $iFontColor, $aPicParameters[13], $aPicParameters[14])
Case 'gdi_function'
Switch StringLower(_XML_Read("/Profil/Element[" & $vWhile & "]/Source_Function", 0, "", $oMixConfig))
Case 'transparency'
$aPicParameters = _MIX_Engine_Dim($vWhile, $oMixConfig)
$vTransLvl = _XML_Read("/Profil/Element[" & $vWhile & "]/Source_Value", 0, "", $oMixConfig)
$vPath = $aMiXPicTemp[UBound($aMiXPicTemp) - 1]
If _GDIPlus_Transparency($vPath, $vTransLvl) = -1 Then _LOG("Transparency Failed", 2, $iLOGPath)
Case 'merge'
If _GDIPlus_Merge($aMiXPicTemp[UBound($aMiXPicTemp) - 2], $aMiXPicTemp[UBound($aMiXPicTemp) - 1]) = -1 Then _LOG("Merging Failed", 2, $iLOGPath)
_ArrayDelete($aMiXPicTemp, UBound($aMiXPicTemp) - 1)
Case 'transparencyzone'
$aPicParameters = _MIX_Engine_Dim($vWhile, $oMixConfig)
$vTransLvl = _XML_Read("/Profil/Element[" & $vWhile & "]/Source_Value", 0, "", $oMixConfig)
$vPath = $aMiXPicTemp[UBound($aMiXPicTemp) - 1]
If _GDIPlus_TransparencyZone($vPath, $vTarget_Width, $vTarget_Height, $vTransLvl, $aPicParameters[2], $aPicParameters[3], $aPicParameters[0], $aPicParameters[1]) = -1 Then _LOG("Transparency Failed", 2, $iLOGPath)
Case Else
_LOG("Unknown GDI_Function", 2, $iLOGPath)
EndSwitch
Case Else
_LOG("End Of MIX", 1, $iLOGPath)
ExitLoop
EndSwitch
$vWhile = $vWhile + 1
WEnd
;~ _ArrayDisplay($aMiXPicTemp);Debug
For $vBoucle2 = UBound($aMiXPicTemp) - 1 To 2 Step -1
If FileExists($aMiXPicTemp[$vBoucle2 - 1]) Then _GDIPlus_Merge($aMiXPicTemp[$vBoucle2 - 1], $aMiXPicTemp[$vBoucle2])
Next
If Not IsArray($aMiXPicTemp) Or UBound($aMiXPicTemp) - 1 <= 0 Then
_LOG("End Of Elements", 1, $iLOGPath)
Return -1
EndIf
$vCompression = _XML_Read("/Profil/Compression/use", 0, "", $oMixConfig)
$vCompressionSoft = _XML_Read("/Profil/Compression/soft", 0, "", $oMixConfig)
$vCompressionParameter = _XML_Read("/Profil/Compression/parameter", 0, "", $oMixConfig)
If StringLower($vCompression) = 'yes' Then _Compression($aMiXPicTemp[1], $vCompressionSoft, $vCompressionParameter)
If UBound($aMiXPicTemp) - 1 > 0 Then Return $aMiXPicTemp[1]
Return -1
EndFunc ;==>_MIX_Engine
Func _MIX_Engine_Dim($vWhile, $oMixConfig)
Dim $aPicParameters[15]
$aPicParameters[0] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_Width", 0, "", $oMixConfig)
$aPicParameters[1] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_Height", 0, "", $oMixConfig)
$aPicParameters[2] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_TopLeftX", 0, "", $oMixConfig)
$aPicParameters[3] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_TopLeftY", 0, "", $oMixConfig)
$aPicParameters[4] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_TopRightX", 0, "", $oMixConfig)
$aPicParameters[5] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_TopRightY", 0, "", $oMixConfig)
$aPicParameters[6] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_BottomLeftX", 0, "", $oMixConfig)
$aPicParameters[7] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_BottomLeftY", 0, "", $oMixConfig)
$aPicParameters[8] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_Maximize", 0, "", $oMixConfig)
$aPicParameters[9] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_OriginX", 0, "", $oMixConfig)
$aPicParameters[10] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_OriginY", 0, "", $oMixConfig)
$aPicParameters[11] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_BottomRightX", 0, "", $oMixConfig)
$aPicParameters[12] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_BottomRightY", 0, "", $oMixConfig)
$aPicParameters[13] = _Coalesce(_XML_Read("/Profil/Element[" & $vWhile & "]/Target_OriginPicX", 0, "", $oMixConfig), Default)
$aPicParameters[14] = _Coalesce(_XML_Read("/Profil/Element[" & $vWhile & "]/Target_OriginPicY", 0, "", $oMixConfig), Default)
Return $aPicParameters
EndFunc ;==>_MIX_Engine_Dim
Func _XMLSystem_Create()
Local $oXMLSystem, $vXMLSystemPath = $iScriptPath & "\Ressources\systemlist.xml"
$oXMLSystem = _XML_Open($vXMLSystemPath)
If $oXMLSystem = -1 Then
MsgBox(0, 'ERREUR', '')
Exit
Else
_LOG("systemlist.xml Opened", 1, $iLOGPath)
Return $oXMLSystem
EndIf
EndFunc ;==>_XMLSystem_Create
Func _XMLGenre_Create()
Local $oXMLGenre, $vXMLGenrePath = $iScriptPath & "\Ressources\Genresliste.xml"
$oXMLGenre = _XML_Open($vXMLGenrePath)
If $oXMLGenre = -1 Then
MsgBox(0, 'ERREUR', '')
Exit
Else
_LOG("Genrelist.xml Opened", 1, $iLOGPath)
Return $oXMLGenre
EndIf
EndFunc ;==>_XMLGenre_Create