summaryrefslogtreecommitdiff
path: root/protocols/Xfire
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Xfire')
-rw-r--r--protocols/Xfire/src/searching4games.cpp5
-rw-r--r--protocols/Xfire/src/variables.cpp48
2 files changed, 49 insertions, 4 deletions
diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp
index b40a607990..27348bc926 100644
--- a/protocols/Xfire/src/searching4games.cpp
+++ b/protocols/Xfire/src/searching4games.cpp
@@ -27,7 +27,7 @@
#include "stdafx.h"
#include "baseProtocol.h"
#include "Xfire_gamelist.h"
-
+#include "variables.h"
#include <string>
using std::string;
@@ -244,8 +244,7 @@ void Scan4Games( LPVOID lparam )
mir_forkthread(ShowSearchDialog,&hwnd);
}
- FoldersGetCustomPath( XFireWorkingFolder, inipath, 1024, "" );
- strcat(inipath,"\\");
+ strcpy(inipath, XFireGetFoldersPath ("IniFile"));
strcat(inipath,"xfire_games.ini");
//erstmal db säubern
diff --git a/protocols/Xfire/src/variables.cpp b/protocols/Xfire/src/variables.cpp
index 5527c06100..07724b21c2 100644
--- a/protocols/Xfire/src/variables.cpp
+++ b/protocols/Xfire/src/variables.cpp
@@ -165,4 +165,50 @@ char* Varmyxfirevoice(ARGUMENTSINFO *ai)
}
return mir_strdup("");
-} \ No newline at end of file
+}
+
+char* XFireGetFoldersPath(char * pathtype)
+{// Get XFire folder path
+extern HANDLE XFireWorkingFolder;
+extern HANDLE XFireIconFolder;
+extern HANDLE XFireAvatarFolder;
+ char path[1024] = "";
+ if (ServiceExists(MS_FOLDERS_REGISTER_PATH)){
+ if (pathtype == "Avatar"){
+ FoldersGetCustomPath(XFireAvatarFolder, path, 1024, "" );}
+ if (pathtype == "IniFile"){
+ FoldersGetCustomPath(XFireWorkingFolder, path, 1024, "" );}
+ if (pathtype == "IconsFile"){
+ FoldersGetCustomPath(XFireIconFolder, path, 1024, "" );}
+ strcat(path,"\\");
+ return path;
+ }
+ else {
+/******BASE********/
+ char BaseFolder[MAX_PATH]= "";
+ char CurProfileF[MAX_PATH] = "";
+ char CurProfile[MAX_PATH] = "";
+ CallService(MS_DB_GETPROFILEPATH, (WPARAM) MAX_PATH, (LPARAM)BaseFolder);
+ strcat(BaseFolder, "\\");
+ CallService(MS_DB_GETPROFILENAME, (WPARAM) MAX_PATH, (LPARAM)CurProfileF);
+ int i;
+ for (i = MAX_PATH; 5; i--){
+ if (CurProfileF[i] == 't' && CurProfileF[i-3] == '.'){
+ i = i-3;
+ break;
+ }
+ }
+ memcpy(CurProfile, CurProfileF, i);
+ strcat(BaseFolder, CurProfile);
+ strcat(BaseFolder, "\\");
+ strcat(BaseFolder, "XFire");
+ strcat(BaseFolder, "\\");
+/*******BASE********/
+ if (pathtype == "Avatar"){
+ strcat(BaseFolder, "Avatars");
+ strcat(BaseFolder, "\\");
+ }
+ strcat(path, BaseFolder);
+ }
+ return path;
+}