summaryrefslogtreecommitdiff
path: root/protocols/Xfire
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Xfire')
-rw-r--r--protocols/Xfire/src/Xfire_base.cpp40
-rw-r--r--protocols/Xfire/src/Xfire_game.cpp12
-rw-r--r--protocols/Xfire/src/Xfire_game.h2
-rw-r--r--protocols/Xfire/src/Xfire_gamelist.cpp2
-rw-r--r--protocols/Xfire/src/Xfire_icon_mng.cpp2
-rw-r--r--protocols/Xfire/src/Xfire_voicechat.cpp14
-rw-r--r--protocols/Xfire/src/all_statusmsg.cpp48
-rw-r--r--protocols/Xfire/src/buddylist.cpp8
-rw-r--r--protocols/Xfire/src/iniupdater.cpp12
-rw-r--r--protocols/Xfire/src/main.cpp780
-rw-r--r--protocols/Xfire/src/options.cpp106
-rw-r--r--protocols/Xfire/src/processbuddyinfo.cpp28
-rw-r--r--protocols/Xfire/src/searching4games.cpp18
-rw-r--r--protocols/Xfire/src/services.cpp42
-rw-r--r--protocols/Xfire/src/setnickname.cpp4
-rw-r--r--protocols/Xfire/src/tools.cpp4
-rw-r--r--protocols/Xfire/src/userdetails.cpp60
-rw-r--r--protocols/Xfire/src/variables.cpp36
18 files changed, 579 insertions, 639 deletions
diff --git a/protocols/Xfire/src/Xfire_base.cpp b/protocols/Xfire/src/Xfire_base.cpp
index a3354d88f1..6b2e6c43d7 100644
--- a/protocols/Xfire/src/Xfire_base.cpp
+++ b/protocols/Xfire/src/Xfire_base.cpp
@@ -101,12 +101,12 @@ void Xfire_base::readStringfromDB(char*name,unsigned int dbid,char**to)
//wert aus der dblesen
sprintf_s(temp,128,"%s_%i",name,dbid);
- if(!DBGetContactSettingString(NULL, protocolname, temp,&dbv))
+ if(!db_get_s(NULL, protocolname, temp,&dbv))
{
//string setzen
setString(dbv.pszVal,to);
//dbval wieder freigeben
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -119,12 +119,12 @@ void Xfire_base::readStringfromDB(char*name,unsigned int dbid,int id,char**to)
//wert aus der dblesen
sprintf_s(temp,128,"%s_%i_%i",name,dbid,id);
- if(!DBGetContactSettingString(NULL, protocolname, temp,&dbv))
+ if(!db_get_s(NULL, protocolname, temp,&dbv))
{
//string setzen
setString(dbv.pszVal,to);
//dbval wieder freigeben
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -142,7 +142,7 @@ void Xfire_base::readUtf8StringfromDB(char*name,unsigned int dbid,char**to)
//string setzen
setString(dbv.pszVal,to);
//dbval wieder freigeben
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -160,7 +160,7 @@ void Xfire_base::readUtf8StringfromDB(char*name,unsigned int dbid,int id,char**t
//string setzen
setString(dbv.pszVal,to);
//dbval wieder freigeben
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -174,7 +174,7 @@ void Xfire_base::writeStringtoDB(char*name,unsigned int dbid,int id,char*val)
//wert aus der dblesen
sprintf_s(temp,128,"%s_%i_%i",name,dbid,id);
- DBWriteContactSettingString(NULL, protocolname, temp,val);
+ db_set_s(NULL, protocolname, temp,val);
}
//schreibt einen stringval in die db welche unterid hat
@@ -186,7 +186,7 @@ void Xfire_base::writeStringtoDB(char*name,unsigned int dbid,char*val)
//wert aus der dblesen
sprintf_s(temp,128,"%s_%i",name,dbid);
- DBWriteContactSettingString(NULL, protocolname, temp,val);
+ db_set_s(NULL, protocolname, temp,val);
}
//schreibt einen stringval in die db welche unterid hat
@@ -223,7 +223,7 @@ void Xfire_base::writeBytetoDB(char*name,unsigned int dbid,int val)
//wert aus der dblesen
sprintf_s(temp,128,"%s_%i",name,dbid);
- DBWriteContactSettingByte(NULL, protocolname, temp, val);
+ db_set_b(NULL, protocolname, temp, val);
}
//schreibt einen wordwert in die db
@@ -235,7 +235,7 @@ void Xfire_base::writeWordtoDB(char*name,unsigned int dbid,int val)
//wert aus der dblesen
sprintf_s(temp,128,"%s_%i",name,dbid);
- DBWriteContactSettingWord(NULL, protocolname, temp, val);
+ db_set_w(NULL, protocolname, temp, val);
}
@@ -248,7 +248,7 @@ unsigned char Xfire_base::readBytefromDB(char*name,unsigned int dbid,int default
//wert aus der dblesen
sprintf_s(temp,128,"%s_%i",name,dbid);
- return DBGetContactSettingByte(NULL, protocolname, temp, defaultval);
+ return db_get_b(NULL, protocolname, temp, defaultval);
}
//liest einen wordval aus der db und gibt es zurück
@@ -260,7 +260,7 @@ unsigned int Xfire_base::readWordfromDB(char*name,unsigned int dbid,int defaultv
//wert aus der dblesen
sprintf_s(temp,128,"%s_%i",name,dbid);
- return DBGetContactSettingWord(NULL, protocolname, temp, defaultval);
+ return db_get_w(NULL, protocolname, temp, defaultval);
}
//entfernt einen dbeintrag
@@ -274,10 +274,10 @@ BOOL Xfire_base::removeDBEntry(char*name,unsigned int dbid)
sprintf_s(temp,128,"%s_%i",name,dbid);
//eintrag entfernen
- if(!DBGetContactSetting(NULL, protocolname, temp,&dbv))
+ if(!db_get(NULL, protocolname, temp,&dbv))
{
- DBFreeVariant(&dbv);
- DBDeleteContactSetting(NULL, protocolname, temp);
+ db_free(&dbv);
+ db_unset(NULL, protocolname, temp);
return TRUE;
}
@@ -295,10 +295,10 @@ BOOL Xfire_base::removeDBEntry(char*name,unsigned int dbid,int id)
sprintf_s(temp,128,"%s_%i_%i",name,dbid,id);
//eintrag entfernen
- if(!DBGetContactSetting(NULL, protocolname, temp,&dbv))
+ if(!db_get(NULL, protocolname, temp,&dbv))
{
- DBFreeVariant(&dbv);
- DBDeleteContactSetting(NULL, protocolname, temp);
+ db_free(&dbv);
+ db_unset(NULL, protocolname, temp);
return TRUE;
}
@@ -507,9 +507,9 @@ BOOL Xfire_base::getGamename(unsigned int gameid,char* out,int outsize){
DBVARIANT dbv;
char dbstr[80]="";
sprintf_s(dbstr,XFIRE_MAXSIZEOFGAMENAME,"customgamename_%d",gameid);
- if(!DBGetContactSetting(NULL,protocolname,dbstr,&dbv)) {
+ if(!db_get(NULL,protocolname,dbstr,&dbv)) {
sprintf_s(out,outsize,"%s",dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return TRUE;
}
else
diff --git a/protocols/Xfire/src/Xfire_game.cpp b/protocols/Xfire/src/Xfire_game.cpp
index 196584b580..bd8e2b0e2a 100644
--- a/protocols/Xfire/src/Xfire_game.cpp
+++ b/protocols/Xfire/src/Xfire_game.cpp
@@ -471,14 +471,6 @@ void Xfire_game::remoteMenuitem()
//aktualisiert menüpunkt ob hidden
void Xfire_game::refreshMenuitem()
{
- if(menuhandle!=NULL)
- {
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
-
- if(this->notinstartmenu)
- mi.flags|= CMIF_HIDDEN;
-
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )menuhandle, ( LPARAM )&mi );
- }
+ if(menuhandle != NULL)
+ Menu_ShowItem(menuhandle, !this->notinstartmenu);
} \ No newline at end of file
diff --git a/protocols/Xfire/src/Xfire_game.h b/protocols/Xfire/src/Xfire_game.h
index 56a0e6e6e7..8fa5c7f5a2 100644
--- a/protocols/Xfire/src/Xfire_game.h
+++ b/protocols/Xfire/src/Xfire_game.h
@@ -44,7 +44,7 @@ public:
//id des spiels
unsigned int id;
//handle des menuitems
- HANDLE menuhandle;
+ HGENMENU menuhandle;
//spiel soll bei der detection übersprungen werden
BOOL skip;
//voicehat?
diff --git a/protocols/Xfire/src/Xfire_gamelist.cpp b/protocols/Xfire/src/Xfire_gamelist.cpp
index c4fb12ee20..eca9f00b13 100644
--- a/protocols/Xfire/src/Xfire_gamelist.cpp
+++ b/protocols/Xfire/src/Xfire_gamelist.cpp
@@ -191,7 +191,7 @@ void Xfire_gamelist::writeDatabase()
}
//anzahl aktualisieren
- DBWriteContactSettingWord(NULL, protocolname, "foundgames", gamelist.size());
+ db_set_w(NULL, protocolname, "foundgames", gamelist.size());
}
//prüft ob ein game schon in der liste is
diff --git a/protocols/Xfire/src/Xfire_icon_mng.cpp b/protocols/Xfire/src/Xfire_icon_mng.cpp
index f5612e8e56..0a583a6998 100644
--- a/protocols/Xfire/src/Xfire_icon_mng.cpp
+++ b/protocols/Xfire/src/Xfire_icon_mng.cpp
@@ -177,7 +177,7 @@ Xfire_icon_cache Xfire_icon_mng::LoadGameIcon(unsigned int gameid) {
//icon vom xfire server laden
HICON Xfire_icon_mng::downloadIcon(char* shortname) {
//nur vom internetladen, wenn die option aktiv ist
- if(!DBGetContactSettingByte(NULL,protocolname,"xfiresitegameico",0))
+ if(!db_get_b(NULL,protocolname,"xfiresitegameico",0))
return NULL;
//keinen namen angegeben?
diff --git a/protocols/Xfire/src/Xfire_voicechat.cpp b/protocols/Xfire/src/Xfire_voicechat.cpp
index a1c6483b00..d14ae6f9d5 100644
--- a/protocols/Xfire/src/Xfire_voicechat.cpp
+++ b/protocols/Xfire/src/Xfire_voicechat.cpp
@@ -159,27 +159,27 @@ void Xfire_voicechat::writeToDatabase(SendGameStatus2Packet* packet) {
if(packet==NULL || packet->gameid==XFIREVOICECHAT_NOVOICE) {
//einträge aus der db entfernen
- DBDeleteContactSetting(NULL,protocolname, "VServerIP");
- DBDeleteContactSetting(NULL,protocolname, "currentvoicename");
+ db_unset(NULL,protocolname, "VServerIP");
+ db_unset(NULL,protocolname, "currentvoicename");
//zurück
return;
}
//ip speichern
sprintf_s(temp,32,"%d.%d.%d.%d:%d",(unsigned char)packet->ip[3],(unsigned char)packet->ip[2],(unsigned char)packet->ip[1],(unsigned char)packet->ip[0],packet->port);
- DBWriteContactSettingString(NULL, protocolname, "VServerIP", temp);
+ db_set_s(NULL, protocolname, "VServerIP", temp);
//namen jeh nach id schreiben
switch(packet->gameid) {
case XFIREVOICECHAT_TS3:
- DBWriteContactSettingString(NULL, protocolname, "currentvoicename", "Teamspeak 3");
+ db_set_s(NULL, protocolname, "currentvoicename", "Teamspeak 3");
break;
case XFIREVOICECHAT_TS2:
- DBWriteContactSettingString(NULL, protocolname, "currentvoicename", "Teamspeak 2");
+ db_set_s(NULL, protocolname, "currentvoicename", "Teamspeak 2");
break;
case XFIREVOICECHAT_MUMBLE:
- DBWriteContactSettingString(NULL, protocolname, "currentvoicename", "Mumble");
+ db_set_s(NULL, protocolname, "currentvoicename", "Mumble");
break;
case XFIREVOICECHAT_VENTRILO:
- DBWriteContactSettingString(NULL, protocolname, "currentvoicename", "Ventrilo");
+ db_set_s(NULL, protocolname, "currentvoicename", "Ventrilo");
break;
};
}
diff --git a/protocols/Xfire/src/all_statusmsg.cpp b/protocols/Xfire/src/all_statusmsg.cpp
index 7063507879..b033b4e3bb 100644
--- a/protocols/Xfire/src/all_statusmsg.cpp
+++ b/protocols/Xfire/src/all_statusmsg.cpp
@@ -26,7 +26,7 @@ int statustype;
BOOL BackupStatusMsg() {
DBVARIANT dbv;
- statustype=DBGetContactSettingByte(NULL,protocolname,"statuschgtype",0);
+ statustype=db_get_b(NULL,protocolname,"statuschgtype",0);
XFireLog("Backup Status Message ...");
@@ -67,7 +67,7 @@ BOOL BackupStatusMsg() {
sprintf_s(ttemp,128,"%s%s",temp[i]->szModuleName,PS_SETAWAYMSG);
//xfire wird geskipped, offline prots und invs prots auch, und locked status prots auch
- if(!temp[i]->bIsEnabled||statusid==ID_STATUS_INVISIBLE||statusid==ID_STATUS_OFFLINE||!lstrcmpiA( temp[i]->szModuleName, protocolname )||!ServiceExists(ttemp)||DBGetContactSettingByte(NULL,temp[i]->szModuleName,"LockMainStatus",0)==1)
+ if(!temp[i]->bIsEnabled||statusid==ID_STATUS_INVISIBLE||statusid==ID_STATUS_OFFLINE||!lstrcmpiA( temp[i]->szModuleName, protocolname )||!ServiceExists(ttemp)||db_get_b(NULL,temp[i]->szModuleName,"LockMainStatus",0)==1)
{
XFireLog("-> Skip %s.",temp[i]->szModuleName);
@@ -87,7 +87,7 @@ BOOL BackupStatusMsg() {
int caps=CallProtoService(temp[i]->szModuleName,PS_GETCAPS,PFLAGNUM_2,0);
//normale statusreihenfolge
- if(DBGetContactSettingByte(NULL,protocolname,"dndfirst",0)==0)
+ if(db_get_b(NULL,protocolname,"dndfirst",0)==0)
{
if(caps&PF2_LIGHTDND)
{
@@ -149,35 +149,35 @@ BOOL BackupStatusMsg() {
switch(statusid)
{
case ID_STATUS_ONLINE:
- if(DBGetContactSetting(NULL,"SRAway","OnMsg",&dbv))
+ if(db_get(NULL,"SRAway","OnMsg",&dbv))
olstatusmsg->push_back(Translate("Yep, I'm here."));
break;
case ID_STATUS_AWAY:
- if(DBGetContactSetting(NULL,"SRAway","AwayMsg",&dbv))
+ if(db_get(NULL,"SRAway","AwayMsg",&dbv))
olstatusmsg->push_back(Translate("I've been away since %time%."));
break;
case ID_STATUS_NA:
- if(DBGetContactSetting(NULL,"SRAway","NaMsg",&dbv))
+ if(db_get(NULL,"SRAway","NaMsg",&dbv))
olstatusmsg->push_back(Translate("Give it up, I'm not in!"));
break;
case ID_STATUS_OCCUPIED:
- if(DBGetContactSetting(NULL,"SRAway","OccupiedMsg",&dbv))
+ if(db_get(NULL,"SRAway","OccupiedMsg",&dbv))
olstatusmsg->push_back(Translate("Not right now."));
break;
case ID_STATUS_DND:
- if(DBGetContactSetting(NULL,"SRAway","DndMsg",&dbv))
+ if(db_get(NULL,"SRAway","DndMsg",&dbv))
olstatusmsg->push_back(Translate("Give a guy some peace, would ya?"));
break;
case ID_STATUS_FREECHAT:
- if(DBGetContactSetting(NULL,"SRAway","FreeChatMsg",&dbv))
+ if(db_get(NULL,"SRAway","FreeChatMsg",&dbv))
olstatusmsg->push_back(Translate("Well, I would talk to you if Miranda ICQ supported chat"));
break;
case ID_STATUS_ONTHEPHONE:
- if(DBGetContactSetting(NULL,"SRAway","OtpMsg",&dbv))
+ if(db_get(NULL,"SRAway","OtpMsg",&dbv))
olstatusmsg->push_back(Translate("That'll be the phone."));
break;
case ID_STATUS_OUTTOLUNCH:
- if(DBGetContactSetting(NULL,"SRAway","OtlMsg",&dbv))
+ if(db_get(NULL,"SRAway","OtlMsg",&dbv))
olstatusmsg->push_back(Translate("Mmm...food."));
break;
default:
@@ -195,7 +195,7 @@ BOOL BackupStatusMsg() {
olstatusmsg->push_back(string(dbv.pszVal));
protoname->push_back(temp[i]->szModuleName);
//freigeben
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
protoname->push_back(temp[i]->szModuleName);
@@ -216,23 +216,23 @@ BOOL SetGameStatusMsg()
if (ServiceExists(MS_VARS_FORMATSTRING))
{
DBVARIANT dbv;
- if(!DBGetContactSetting(NULL,protocolname,"setstatusmsg",&dbv)) {
+ if(!db_get(NULL,protocolname,"setstatusmsg",&dbv)) {
//direkte funktionen verwenden
statusmsg = variables_parse(dbv.pszVal,NULL,0);
if (statusmsg == NULL)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return FALSE;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
{
//alternativ zweig ohne variables
DBVARIANT dbv;
- if(!DBGetContactSetting(NULL,protocolname,"setstatusmsg",&dbv)) {
+ if(!db_get(NULL,protocolname,"setstatusmsg",&dbv)) {
DBVARIANT dbv3;
@@ -242,37 +242,37 @@ BOOL SetGameStatusMsg()
//mit den vars ersetzen beginnen
//derzeitiges spiel
- if(!DBGetContactSetting(NULL,protocolname, "currentgamename",&dbv3))
+ if(!db_get(NULL,protocolname, "currentgamename",&dbv3))
{
xgamelist.strreplace("%myxfiregame%",dbv3.pszVal,&statusmsg);
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
}
else
xgamelist.strreplace("%myxfiregame%","",&statusmsg);
//derzeitiges voiceprogram
- if(!DBGetContactSetting(NULL,protocolname, "currentvoicename",&dbv3))
+ if(!db_get(NULL,protocolname, "currentvoicename",&dbv3))
{
xgamelist.strreplace("%myxfirevoice%",dbv3.pszVal,&statusmsg);
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
}
else
xgamelist.strreplace("%myxfirevoice%","",&statusmsg);
//derzeitige voiceip
- if(!DBGetContactSetting(NULL,protocolname, "VServerIP",&dbv3))
+ if(!db_get(NULL,protocolname, "VServerIP",&dbv3))
{
xgamelist.strreplace("%myxfirevoiceip%",dbv3.pszVal,&statusmsg);
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
}
else
xgamelist.strreplace("%myxfirevoiceip%","",&statusmsg);
//derzeitige gameip
- if(!DBGetContactSetting(NULL,protocolname, "ServerIP",&dbv3))
+ if(!db_get(NULL,protocolname, "ServerIP",&dbv3))
{
xgamelist.strreplace("%myxfireserverip%",dbv3.pszVal,&statusmsg);
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
}
else
xgamelist.strreplace("%myxfireserverip%","",&statusmsg);
diff --git a/protocols/Xfire/src/buddylist.cpp b/protocols/Xfire/src/buddylist.cpp
index b26d07266a..d2ae949d7a 100644
--- a/protocols/Xfire/src/buddylist.cpp
+++ b/protocols/Xfire/src/buddylist.cpp
@@ -148,10 +148,10 @@ namespace xfirelib {
char * dummy;
sprintf_s(temp,255,"Clan_%d",entry->clanid);
- DBVARIANT dbv;
- if(!DBGetContactSetting(NULL,protocolname,temp,&dbv))
- {
- dummy=dbv.pszVal;
+ DBVARIANT dbv;
+ if(!db_get(NULL,protocolname,temp,&dbv))
+ {
+ dummy=dbv.pszVal;
}
else
dummy=NULL;
diff --git a/protocols/Xfire/src/iniupdater.cpp b/protocols/Xfire/src/iniupdater.cpp
index 4ccf320b9b..cc835332a4 100644
--- a/protocols/Xfire/src/iniupdater.cpp
+++ b/protocols/Xfire/src/iniupdater.cpp
@@ -65,7 +65,7 @@ void UpdateMyXFireIni(LPVOID dummy) {
if(CheckWWWContent(request))
{
- if(DBGetContactSettingByte(NULL,protocolname,"dontaskforupdate",0)==1||DialogBox(hinstance,MAKEINTRESOURCE(IDD_UPDATE),NULL,DlgUpdateDialogProc)==IDOK)
+ if(db_get_b(NULL,protocolname,"dontaskforupdate",0)==1||DialogBox(hinstance,MAKEINTRESOURCE(IDD_UPDATE),NULL,DlgUpdateDialogProc)==IDOK)
{
if(GetWWWContent2(request,file,FALSE))
{
@@ -74,12 +74,12 @@ void UpdateMyXFireIni(LPVOID dummy) {
//derzeitige ini und sichern
rename(file2,file3);
//lösche .old, wenn aktiv
- if(DBGetContactSettingByte(NULL,protocolname,"nobackupini",0))
+ if(db_get_b(NULL,protocolname,"nobackupini",0))
remove(file3);
//neue aktiv schalten
rename(file,file2);
- if(DBGetContactSettingByte(NULL,protocolname,"dontaskforupdate",0)==0) MSGBOX(Translate("The xfire_games.ini was updated."));
+ if(db_get_b(NULL,protocolname,"dontaskforupdate",0)==0) MSGBOX(Translate("The xfire_games.ini was updated."));
}
else
MSGBOX(Translate("Error during xfire_games Update."));
@@ -105,7 +105,7 @@ void UpdateMyIcons(LPVOID dummy) {
if(CheckWWWContent(request))
{
- if(DBGetContactSettingByte(NULL,protocolname,"dontaskforupdate",0)==1||MessageBox(NULL,Translate("There is a new Icons.dll online, do you want to update now?"),"Miranda XFire Protocol Plugin",MB_YESNO|MB_ICONQUESTION)==IDYES)
+ if(db_get_b(NULL,protocolname,"dontaskforupdate",0)==1||MessageBox(NULL,Translate("There is a new Icons.dll online, do you want to update now?"),"Miranda XFire Protocol Plugin",MB_YESNO|MB_ICONQUESTION)==IDYES)
{
if(GetWWWContent2(request,file,FALSE)) {
//altes backup löschen
@@ -113,12 +113,12 @@ void UpdateMyIcons(LPVOID dummy) {
//derzeitige ini und sichern
rename(file2,file3);
//lösche .old, wenn aktiv
- if(DBGetContactSettingByte(NULL,protocolname,"nobackupini",0))
+ if(db_get_b(NULL,protocolname,"nobackupini",0))
remove(file3);
//neue aktiv schalten
rename(file,file2);
- if(DBGetContactSettingByte(NULL,protocolname,"dontaskforupdate",0)==0) MSGBOX(Translate("The Icons.dll was updated."));
+ if(db_get_b(NULL,protocolname,"dontaskforupdate",0)==0) MSGBOX(Translate("The Icons.dll was updated."));
}
else
MSGBOX(Translate("Error during Icons.dll Update."));
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp
index ae7fcc07e3..0c0a76ce4b 100644
--- a/protocols/Xfire/src/main.cpp
+++ b/protocols/Xfire/src/main.cpp
@@ -98,7 +98,7 @@ HINSTANCE hinstance = NULL;
int hLangpack;
HANDLE hExtraIcon1, hExtraIcon2;
HANDLE heventXStatusIconChanged;
-HANDLE copyipport,gotoclansite,vipport,joingame,startthisgame,removefriend,blockfriend;
+HGENMENU copyipport,gotoclansite,vipport,joingame,startthisgame,removefriend,blockfriend;
int foundgames=0;
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
@@ -250,10 +250,10 @@ void XFireClient::CheckAvatar(BuddyListEntry* entry) {
return;
//keine avatars?
- if(DBGetContactSettingByte(NULL,protocolname,"noavatars",-1)==0)
+ if(db_get_b(NULL,protocolname,"noavatars",-1)==0)
{
//avatar gelocked?
- if(DBGetContactSettingByte(entry->hcontact, "ContactPhoto", "Locked", -1)!=1)
+ if(db_get_b(entry->hcontact, "ContactPhoto", "Locked", -1)!=1)
{
//avatar lade auftrag übergeben
this->avatarloader->loadAvatar(entry->hcontact,(char*)entry->username.c_str(),entry->userid);
@@ -382,7 +382,7 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
{
temp=0;
}
- DBWriteContactSettingByte(NULL,protocolname,xfireconfigitems[i].dbentry,temp);
+ db_set_b(NULL,protocolname,xfireconfigitems[i].dbentry,temp);
}
}
break;
@@ -494,7 +494,7 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
sprintf(temp,"Clan_%d",clan->clanid);
DBVARIANT dbv;
- if(!DBGetContactSetting(NULL,protocolname,temp,&dbv))
+ if(!db_get(NULL,protocolname,temp,&dbv))
{
dummy=dbv.pszVal;
}
@@ -517,17 +517,17 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
char fofname[128]=LPGEN("Friends of Friends Playing");
DBVARIANT dbv;
//gruppennamen überladen
- if(!DBGetContactSetting(NULL,protocolname,"overload_fofgroupname",&dbv))
+ if(!db_get(NULL,protocolname,"overload_fofgroupname",&dbv))
{
strcpy_s(fofname,128,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
CreateGroup(Translate(fofname),"fofgroup");
HANDLE hc=handlingBuddys(entry,-1,Translate(fofname));
if(hc)
{
CheckAvatar(entry);
- DBWriteContactSettingByte(hc,protocolname,"friendoffriend",1);
+ db_set_b(hc,protocolname,"friendoffriend",1);
}
}
}
@@ -579,17 +579,10 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
}
else
{
- if(entry->game==0&&
- entry->hcontact!=0&&
- DBGetContactSettingByte(entry->hcontact,protocolname,"friendoffriend",0)==1)
- {
- DBWriteContactSettingWord(entry->hcontact,protocolname,"Status",ID_STATUS_OFFLINE);
- //CallService( MS_DB_CONTACT_DELETE, (WPARAM) entry->hcontact, 0);
- }
+ if(entry->game == 0 && entry->hcontact != 0 && db_get_b(entry->hcontact,protocolname,"friendoffriend",0)==1)
+ db_set_w(entry->hcontact,protocolname,"Status",ID_STATUS_OFFLINE);
else
- {
- handlingBuddys(entry,0,NULL);
- }
+ handlingBuddys(entry,0,NULL);
}
}
}
@@ -617,7 +610,7 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
InviteRequestPacket *invite = (InviteRequestPacket*)content;
//nur nich blockierte buddy's durchlassen
- if(!DBGetContactSettingByte(NULL,"XFireBlock",(char*)invite->name.c_str(),0))
+ if(!db_get_b(NULL,"XFireBlock",(char*)invite->name.c_str(),0))
{
XFireContact xfire_newc;
xfire_newc.username=(char*)invite->name.c_str();
@@ -656,12 +649,12 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
for(int i=0;i<clan->count;i++)
{
sprintf(temp,"Clan_%d",clan->clanid[i]);
- DBWriteContactSettingString(NULL, protocolname, temp, (char*)clan->name[i].c_str());
+ db_set_s(NULL, protocolname, temp, (char*)clan->name[i].c_str());
sprintf(temp,"ClanUrl_%d",clan->clanid[i]);
- DBWriteContactSettingString(NULL, protocolname, temp, (char*)clan->url[i].c_str());
+ db_set_s(NULL, protocolname, temp, (char*)clan->url[i].c_str());
- if(!DBGetContactSettingByte(NULL,protocolname,"noclangroups",0)) {
+ if(!db_get_b(NULL,protocolname,"noclangroups",0)) {
CreateGroup((char*)clan->name[i].c_str(),"mainclangroup");
}
}
@@ -676,9 +669,9 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
LoginSuccessPacket *login = (LoginSuccessPacket*)content;
char * temp = mir_utf8decode((char*)login->nick.c_str(),NULL);
//nick speichern
- DBWriteContactSettingString(NULL,protocolname,"Nick",temp);
+ db_set_s(NULL,protocolname,"Nick",temp);
//uid speichern
- DBWriteContactSettingDword(NULL,protocolname,"myuid",login->myuid);
+ db_set_dw(NULL,protocolname,"myuid",login->myuid);
this->myuid=login->myuid;
//avatar auslesen
GetBuddyInfo* buddyinfo=new GetBuddyInfo();
@@ -694,9 +687,9 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
if((unsigned int)client->protocolVersion<(unsigned int)version->newversion)
{
- DBWriteContactSettingByte(NULL,protocolname,"protover",version->newversion);
+ db_set_b(NULL,protocolname,"protover",version->newversion);
//recprotoverchg
- if(DBGetContactSettingWord(NULL,protocolname,"recprotoverchg",0)==0)
+ if(db_get_w(NULL,protocolname,"recprotoverchg",0)==0)
{
sprintf_s(temp,255,Translate("The protocol version is too old. Changed current version from %d to %d. You can reconnect now."),client->protocolVersion,version->newversion);
MSGBOXE(temp);
@@ -824,9 +817,9 @@ void StartIniUpdateAndDetection(LPVOID dummy)
EnterCriticalSection(&connectingMutex);
//ini/ico updater, nur wenn aktiv
- if(DBGetContactSettingByte(NULL,protocolname,"autoiniupdate",0))
+ if(db_get_b(NULL,protocolname,"autoiniupdate",0))
UpdateMyXFireIni(NULL);
- if(DBGetContactSettingByte(NULL,protocolname,"autoicodllupdate",0))
+ if(db_get_b(NULL,protocolname,"autoicodllupdate",0))
UpdateMyIcons(NULL);
#ifndef NO_PTHREAD
@@ -996,7 +989,7 @@ static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam)
SkinAddNewSoundEx("xfirebstartgame",protocolname,LPGEN("Buddy start a game"));
//hook für mbot einfügen, nur wenn mbot option aktiv
- if(DBGetContactSettingByte(NULL,protocolname,"mbotsupport",0))
+ if(db_get_b(NULL,protocolname,"mbotsupport",0))
HookEvent(XFIRE_INGAMESTATUSHOOK, mBotNotify);
//init der extraicons wenn service vorhanden
@@ -1043,9 +1036,9 @@ int ExtraImageApply(WPARAM wparam, LPARAM lparam)
HANDLE hContact=(HANDLE)wparam;
// TODO: maybe need to fix extra icons
char *szProto = GetContactProto(hContact);
- if ( szProto != NULL && !lstrcmpiA( szProto, protocolname ) && DBGetContactSettingWord(hContact, protocolname, "Status", ID_STATUS_OFFLINE)!=ID_STATUS_OFFLINE) {
- int gameid=DBGetContactSettingWord(hContact, protocolname, "GameId", 0);
- int gameid2=DBGetContactSettingWord(hContact, protocolname, "VoiceId", 0);
+ if ( szProto != NULL && !lstrcmpiA( szProto, protocolname ) && db_get_w(hContact, protocolname, "Status", ID_STATUS_OFFLINE)!=ID_STATUS_OFFLINE) {
+ int gameid=db_get_w(hContact, protocolname, "GameId", 0);
+ int gameid2=db_get_w(hContact, protocolname, "VoiceId", 0);
if(gameid!=0)
{
@@ -1074,20 +1067,20 @@ extern "C" __declspec(dllexport) int Load(void)
//void* init = GetProcAddress(LoadLibrary("atl"),"AtlAxWinInit"); _asm call init;
//keine protoversion in der db, dann wohl der erste start von xfire
- if(DBGetContactSettingByte(NULL,protocolname,"protover",0)==0)
+ if(db_get_b(NULL,protocolname,"protover",0)==0)
{
- DBWriteContactSettingByte(NULL,protocolname,"protover",0x84);
- DBWriteContactSettingWord(NULL,protocolname,"avatarloadlatency",1000);
- DBWriteContactSettingByte(NULL,protocolname,"gameico",0);
- DBWriteContactSettingByte(NULL,protocolname,"voiceico",1);
- DBWriteContactSettingByte(NULL,protocolname,"specialavatarload",1);
- DBWriteContactSettingByte(NULL,protocolname,"xfiresitegameico",1);
- DBWriteContactSettingByte(NULL,protocolname,"recprotoverchg",1);
+ db_set_b(NULL,protocolname,"protover",0x84);
+ db_set_w(NULL,protocolname,"avatarloadlatency",1000);
+ db_set_b(NULL,protocolname,"gameico",0);
+ db_set_b(NULL,protocolname,"voiceico",1);
+ db_set_b(NULL,protocolname,"specialavatarload",1);
+ db_set_b(NULL,protocolname,"xfiresitegameico",1);
+ db_set_b(NULL,protocolname,"recprotoverchg",1);
if(MessageBoxA(NULL,Translate("It seems that is the first time you use this plugin. Do you want to automatically download the latest available xfire_games.ini and icons.dll?\r\nWithout the ini xfire can't detect any games on your computer."),"Miranda XFire Protocol Plugin",MB_YESNO|MB_ICONQUESTION)==IDYES)
{
- DBWriteContactSettingByte(NULL,protocolname,"autoiniupdate",1);
- DBWriteContactSettingByte(NULL,protocolname,"autoicodllupdate",1);
+ db_set_b(NULL,protocolname,"autoiniupdate",1);
+ db_set_b(NULL,protocolname,"autoicodllupdate",1);
}
}
@@ -1348,10 +1341,10 @@ extern "C" __declspec(dllexport) int Load(void)
//lade GetExtendedUdpTable Funktion
HMODULE hmod=LoadLibraryA("IpHlpApi.dll");
_GetExtendedUdpTable=(pGetExtendedUdpTable)GetProcAddress(hmod,"GetExtendedUdpTable");
- if(_GetExtendedUdpTable==NULL&&DBGetContactSettingByte(NULL,protocolname,"ipportdetec",0))
+ if(_GetExtendedUdpTable==NULL&&db_get_b(NULL,protocolname,"ipportdetec",0))
{
//MessageBoxA(0,"GetExtendedUdpTable not found. ServerIP/Port detection feature will be disabled.","Miranda XFire Protocol Plugin",MB_OK|MB_ICONINFORMATION);
- DBWriteContactSettingByte(NULL,protocolname,"ipportdetec",0);
+ db_set_b(NULL,protocolname,"ipportdetec",0);
XFireLog("Wasn't able to get GetExtendedUdpTable function");
}
@@ -1381,7 +1374,7 @@ INT_PTR GetXStatusIcon(WPARAM wParam, LPARAM lParam) {
INT_PTR RecvMessage(WPARAM wParam, LPARAM lParam)
{
CCSDATA *ccs = ( CCSDATA* )lParam;
- DBDeleteContactSetting(ccs->hContact, "CList", "Hidden");
+ db_unset(ccs->hContact, "CList", "Hidden");
char *szProto = GetContactProto(ccs->hContact);
if ( szProto != NULL && !lstrcmpiA( szProto, protocolname ))
@@ -1424,16 +1417,16 @@ static INT_PTR UserIsTyping(WPARAM wParam, LPARAM lParam)
if(lParam==PROTOTYPE_SELFTYPING_ON)
{
- if(DBGetContactSettingByte(NULL,protocolname,"sendtyping",1)==1)
+ if(db_get_b(NULL,protocolname,"sendtyping",1)==1)
{
if(myClient!=NULL)
if(myClient->client->connected)
- if(!DBGetContactSettingString(hContact, protocolname, "Username",&dbv))
+ if(!db_get_s(hContact, protocolname, "Username",&dbv))
{
SendTypingPacket typing;
typing.init(myClient->client, dbv.pszVal);
myClient->client->send( &typing );
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -1452,9 +1445,9 @@ INT_PTR SendMessage(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv;
int sended=0;
- DBGetContactSettingString(ccs->hContact, protocolname, "Username",&dbv);
+ db_get_s(ccs->hContact, protocolname, "Username",&dbv);
if(myClient!=NULL)
- if(myClient->client->connected&&DBGetContactSettingWord(ccs->hContact, protocolname, "Status", -1)!=ID_STATUS_OFFLINE)
+ if(myClient->client->connected&&db_get_w(ccs->hContact, protocolname, "Status", -1)!=ID_STATUS_OFFLINE)
{
/*if(myClient->useutf8)
myClient->sendmsg(dbv.pszVal, ( char* )ccs->lParam);
@@ -1468,7 +1461,7 @@ INT_PTR SendMessage(WPARAM wParam, LPARAM lParam)
{
mir_forkthread(SendBadAck,ccs->hContact);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return sended;
}
@@ -1484,7 +1477,7 @@ INT_PTR GetCaps(WPARAM wParam,LPARAM lParam)
else if(wParam==PFLAGNUM_2)
return PF2_ONLINE|PF2_SHORTAWAY; // add the possible statuses here.
else if(wParam==PFLAGNUM_3)
- return PF2_ONLINE|(DBGetContactSettingByte(NULL,protocolname,"nocustomaway",0)==1?0:PF2_SHORTAWAY);
+ return PF2_ONLINE|(db_get_b(NULL,protocolname,"nocustomaway",0)==1?0:PF2_SHORTAWAY);
else if(wParam==PFLAGNUM_4)
return PF4_SUPPORTTYPING|PF4_AVATARS;
else if(wParam==PFLAG_UNIQUEIDTEXT)
@@ -1539,7 +1532,7 @@ static void ConnectingThread(LPVOID params)
}
else
{
- if(DBGetContactSettingWord(NULL,protocolname,"noconnectfailedbox",0)==0) MSGBOXE(Translate("Unable to connect to XFire."));
+ if(db_get_w(NULL,protocolname,"noconnectfailedbox",0)==0) MSGBOXE(Translate("Unable to connect to XFire."));
wParam =ID_STATUS_OFFLINE;
}
@@ -1565,7 +1558,7 @@ INT_PTR SetStatus(WPARAM wParam,LPARAM lParam)
return 0;
if(wParam!=ID_STATUS_ONLINE&&wParam!=ID_STATUS_OFFLINE&&wParam!=ID_STATUS_AWAY&&wParam!=ID_STATUS_RECONNECT)
- if(DBGetContactSettingByte(NULL,protocolname,"oninsteadafk",0)==0)
+ if(db_get_b(NULL,protocolname,"oninsteadafk",0)==0)
wParam=ID_STATUS_AWAY; //protokoll auf away schalten
else
wParam=ID_STATUS_ONLINE; //protokoll auf online schalten
@@ -1585,12 +1578,12 @@ INT_PTR SetStatus(WPARAM wParam,LPARAM lParam)
DBVARIANT dbv;
DBVARIANT dbv2;
- if(DBGetContactSetting(NULL,protocolname,"login",&dbv))
+ if(db_get(NULL,protocolname,"login",&dbv))
{
MSGBOXE(Translate("No Loginname is set!"));
wParam=ID_STATUS_OFFLINE;
}
- else if(DBGetContactSetting(NULL,protocolname,"password",&dbv2))
+ else if(db_get(NULL,protocolname,"password",&dbv2))
{
MSGBOXE(Translate("No Password is set!"));
wParam=ID_STATUS_OFFLINE;
@@ -1603,26 +1596,26 @@ INT_PTR SetStatus(WPARAM wParam,LPARAM lParam)
delete myClient;
//alter proxycode, entfernt da über netlib die proxysache geregelt wird
- /* if(DBGetContactSettingByte(NULL, protocolname, "useproxy" ,0))
+ /* if(db_get_b(NULL, protocolname, "useproxy" ,0))
{
//verbindung über proxy
DBVARIANT dbv3;
DBVARIANT dbv4;
- if(!DBGetContactSetting(NULL,protocolname,"proxyip",&dbv3))
+ if(!db_get(NULL,protocolname,"proxyip",&dbv3))
{
- if(!DBGetContactSetting(NULL,protocolname,"proxyport",&dbv4))
+ if(!db_get(NULL,protocolname,"proxyport",&dbv4))
{
- myClient = new XFireClient(dbv.pszVal,dbv2.pszVal,DBGetContactSettingByte(NULL,protocolname,"protover",0),1,dbv3.pszVal,atoi(dbv4.pszVal));
- DBFreeVariant(&dbv4);
+ myClient = new XFireClient(dbv.pszVal,dbv2.pszVal,db_get_b(NULL,protocolname,"protover",0),1,dbv3.pszVal,atoi(dbv4.pszVal));
+ db_free(&dbv4);
}
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
}
}
else */
- myClient = new XFireClient(dbv.pszVal,dbv2.pszVal,DBGetContactSettingByte(NULL,protocolname,"protover",0));
+ myClient = new XFireClient(dbv.pszVal,dbv2.pszVal,db_get_b(NULL,protocolname,"protover",0));
//prüfe ob utf8 option aktiv, dann schlater auf true
- if(DBGetContactSettingByte(NULL,protocolname,"useutf8",0))
+ if(db_get_b(NULL,protocolname,"useutf8",0))
{
myClient->useutf8=TRUE;
}
@@ -1648,13 +1641,13 @@ INT_PTR SetStatus(WPARAM wParam,LPARAM lParam)
}
*/
//für die vars
- DBDeleteContactSetting(NULL,protocolname,"currentgamename");
- DBDeleteContactSetting(NULL,protocolname,"currentvoicename");
- DBDeleteContactSetting(NULL,protocolname,"VServerIP");
- DBDeleteContactSetting(NULL,protocolname,"ServerIP");
+ db_unset(NULL,protocolname,"currentgamename");
+ db_unset(NULL,protocolname,"currentvoicename");
+ db_unset(NULL,protocolname,"VServerIP");
+ db_unset(NULL,protocolname,"ServerIP");
- DBFreeVariant(&dbv);
- DBFreeVariant(&dbv2);
+ db_free(&dbv);
+ db_free(&dbv2);
return 0;
}
}
@@ -1667,7 +1660,7 @@ INT_PTR SetStatus(WPARAM wParam,LPARAM lParam)
else if(myClient!=NULL&&myClient->client->connected) // online --> afk
{
//setze bei aktivem nocustomaway die alte awaystatusmsg zurück, bugfix
- if(DBGetContactSettingByte(NULL,protocolname,"nocustomaway",0))
+ if(db_get_b(NULL,protocolname,"nocustomaway",0))
strcpy_s(statusmessage[1],1024,"(AFK) Away from Keyboard");
myClient->Status(statusmessage[1]);
@@ -1686,10 +1679,10 @@ INT_PTR SetStatus(WPARAM wParam,LPARAM lParam)
//teamspeak/ventrilo pid sowie gamepid auf NULL setzen, damit bei einem reconnect die neuerkannt werden
pid=NULL;
ts2pid=NULL;
- DBWriteContactSettingWord(NULL,protocolname,"currentgame",0);
- DBWriteContactSettingWord(NULL,protocolname,"currentvoice",0);
- DBDeleteContactSetting(NULL,protocolname, "VServerIP");
- DBDeleteContactSetting(NULL,protocolname, "ServerIP");
+ db_set_w(NULL,protocolname,"currentgame",0);
+ db_set_w(NULL,protocolname,"currentvoice",0);
+ db_unset(NULL,protocolname, "VServerIP");
+ db_unset(NULL,protocolname, "ServerIP");
if(wParam == ID_STATUS_RECONNECT)
{
@@ -1737,34 +1730,34 @@ HANDLE CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan)
CallService( MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM)protocolname );
if ( InList )
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ db_unset(hContact, "CList", "NotOnList");
else
- DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
- DBDeleteContactSetting(hContact, "CList", "Hidden");
+ db_set_b(hContact, "CList", "NotOnList", 1);
+ db_unset(hContact, "CList", "Hidden");
if(strlen(xfc.nick)>0)
{
if(myClient->useutf8)
DBWriteContactSettingUTF8String(hContact, protocolname, "Nick", xfc.nick);
else
- DBWriteContactSettingString(hContact, protocolname, "Nick", mir_utf8decode(( char* )xfc.nick,NULL));
+ db_set_s(hContact, protocolname, "Nick", mir_utf8decode(( char* )xfc.nick,NULL));
}
else if(strlen(xfc.username)>0)
- DBWriteContactSettingString(hContact, protocolname, "Nick", xfc.username);
+ db_set_s(hContact, protocolname, "Nick", xfc.username);
- DBWriteContactSettingString(hContact, protocolname, "Username", xfc.username);
+ db_set_s(hContact, protocolname, "Username", xfc.username);
- //DBWriteContactSettingString(hContact, protocolname, "Screenname", xfc.nick);
- DBWriteContactSettingDword(hContact, protocolname, "UserId", xfc.id);
+ //db_set_s(hContact, protocolname, "Screenname", xfc.nick);
+ db_set_dw(hContact, protocolname, "UserId", xfc.id);
if(clan>0)
- DBWriteContactSettingDword(hContact, protocolname, "Clan", clan);
+ db_set_dw(hContact, protocolname, "Clan", clan);
- DBWriteContactSettingWord(hContact, protocolname, "Status", SetOnline ? ID_STATUS_ONLINE:ID_STATUS_OFFLINE);
+ db_set_w(hContact, protocolname, "Status", SetOnline ? ID_STATUS_ONLINE:ID_STATUS_OFFLINE);
- if(DBGetContactSettingByte(NULL,protocolname,"noavatars",-1)==0)
+ if(db_get_b(NULL,protocolname,"noavatars",-1)==0)
{
- if(!DBGetContactSettingByte(NULL,protocolname,"specialavatarload",0))
+ if(!db_get_b(NULL,protocolname,"specialavatarload",0))
{
XFire_SetAvatar* xsa=new XFire_SetAvatar;
xsa->hContact=hContact;
@@ -1789,8 +1782,8 @@ HANDLE CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan)
}
if (xfc.id==0) {
- DBWriteContactSettingByte( hContact, "CList", "NotOnList", 1 );
- DBWriteContactSettingByte( hContact, "CList", "Hidden", 1 );
+ db_set_b( hContact, "CList", "NotOnList", 1 );
+ db_set_b( hContact, "CList", "Hidden", 1 );
}
return hContact;
@@ -1813,7 +1806,7 @@ HANDLE CList_FindContact (int uid)
while (hContact) {
char *szProto = GetContactProto(hContact);
if ( szProto != NULL && !lstrcmpiA( szProto, protocolname )) {
- if ( DBGetContactSettingDword(hContact, protocolname, "UserId",-1)==uid)
+ if ( db_get_dw(hContact, protocolname, "UserId",-1)==uid)
return hContact;
}
hContact = db_find_next(hContact);
@@ -1830,60 +1823,60 @@ void CList_MakeAllOffline()
if ( szProto != NULL && !lstrcmpiA( szProto, protocolname )) {
//freunde von freunden in eine seperate liste setzen
//nur wenn das nicht abgestellt wurde
- if(DBGetContactSettingByte(hContact,protocolname,"friendoffriend",0)==1&&
- DBGetContactSettingByte(NULL,protocolname,"fofdbremove",0)==1)
+ if(db_get_b(hContact,protocolname,"friendoffriend",0)==1&&
+ db_get_b(NULL,protocolname,"fofdbremove",0)==1)
{
fhandles.push_back(hContact);
}
- DBDeleteContactSetting(hContact, "CList", "StatusMsg");
- DBDeleteContactSetting(hContact, protocolname, "ServerIP");
- DBDeleteContactSetting(hContact, protocolname, "Port");
- DBDeleteContactSetting(hContact, protocolname, "ServerName");
- DBDeleteContactSetting(hContact, protocolname, "GameType");
- DBDeleteContactSetting(hContact, protocolname, "Map");
- DBDeleteContactSetting(hContact, protocolname, "Players");
- DBDeleteContactSetting(hContact, protocolname, "Passworded");
+ db_unset(hContact, "CList", "StatusMsg");
+ db_unset(hContact, protocolname, "ServerIP");
+ db_unset(hContact, protocolname, "Port");
+ db_unset(hContact, protocolname, "ServerName");
+ db_unset(hContact, protocolname, "GameType");
+ db_unset(hContact, protocolname, "Map");
+ db_unset(hContact, protocolname, "Players");
+ db_unset(hContact, protocolname, "Passworded");
- DBDeleteContactSetting(hContact, protocolname, "XStatusMsg");
- DBDeleteContactSetting(hContact, protocolname, "XStatusId");
- DBDeleteContactSetting(hContact, protocolname, "XStatusName");
+ db_unset(hContact, protocolname, "XStatusMsg");
+ db_unset(hContact, protocolname, "XStatusId");
+ db_unset(hContact, protocolname, "XStatusName");
- if(DBGetContactSettingByte(NULL,protocolname,"noavatars",-1)==1)
+ if(db_get_b(NULL,protocolname,"noavatars",-1)==1)
{
- DBDeleteContactSetting(hContact, "ContactPhoto", "File");
- DBDeleteContactSetting(hContact, "ContactPhoto", "RFile");
- DBDeleteContactSetting(hContact, "ContactPhoto", "Backup");
- DBDeleteContactSetting(hContact, "ContactPhoto", "Format");
- DBDeleteContactSetting(hContact, "ContactPhoto", "ImageHash");
- DBDeleteContactSetting(hContact, "ContactPhoto", "XFireAvatarId");
- DBDeleteContactSetting(hContact, "ContactPhoto", "XFireAvatarMode");
+ db_unset(hContact, "ContactPhoto", "File");
+ db_unset(hContact, "ContactPhoto", "RFile");
+ db_unset(hContact, "ContactPhoto", "Backup");
+ db_unset(hContact, "ContactPhoto", "Format");
+ db_unset(hContact, "ContactPhoto", "ImageHash");
+ db_unset(hContact, "ContactPhoto", "XFireAvatarId");
+ db_unset(hContact, "ContactPhoto", "XFireAvatarMode");
}
else
{
//prüf ob der avatar noch existiert
DBVARIANT dbv;
- if(!DBGetContactSettingString(hContact, "ContactPhoto", "File",&dbv))
+ if(!db_get_s(hContact, "ContactPhoto", "File",&dbv))
{
FILE*f=fopen(dbv.pszVal,"r");
if(f==NULL)
{
- DBDeleteContactSetting(hContact, "ContactPhoto", "File");
- DBDeleteContactSetting(hContact, "ContactPhoto", "RFile");
- DBDeleteContactSetting(hContact, "ContactPhoto", "Backup");
- DBDeleteContactSetting(hContact, "ContactPhoto", "Format");
- DBDeleteContactSetting(hContact, "ContactPhoto", "ImageHash");
- DBDeleteContactSetting(hContact, "ContactPhoto", "XFireAvatarId");
- DBDeleteContactSetting(hContact, "ContactPhoto", "XFireAvatarMode");
+ db_unset(hContact, "ContactPhoto", "File");
+ db_unset(hContact, "ContactPhoto", "RFile");
+ db_unset(hContact, "ContactPhoto", "Backup");
+ db_unset(hContact, "ContactPhoto", "Format");
+ db_unset(hContact, "ContactPhoto", "ImageHash");
+ db_unset(hContact, "ContactPhoto", "XFireAvatarId");
+ db_unset(hContact, "ContactPhoto", "XFireAvatarMode");
}
else
{
fclose(f);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
- DBWriteContactSettingWord(hContact,protocolname,"Status",ID_STATUS_OFFLINE);
+ db_set_w(hContact,protocolname,"Status",ID_STATUS_OFFLINE);
}
hContact = db_find_next(hContact);
}
@@ -1900,7 +1893,7 @@ void SetIcon(HANDLE hcontact,HANDLE hicon,int ctype)
void SetAvatar2(LPVOID lparam) {
static int lasttime=0;
- int sleep=DBGetContactSettingWord(NULL,protocolname,"avatarloadlatency",1000);
+ int sleep=db_get_w(NULL,protocolname,"avatarloadlatency",1000);
lasttime+=sleep;
if(mySleep(lasttime,hConnectionClose))
@@ -1925,7 +1918,7 @@ void SetAvatar(LPVOID lparam)
//EnterCriticalSection(&avatarMutex);
//WaitForSingleObject(hMutex, INFINITE);
static int lasttime=0;
- int sleep=DBGetContactSettingWord(NULL,protocolname,"avatarloadlatency",250);
+ int sleep=db_get_w(NULL,protocolname,"avatarloadlatency",250);
if(bpStatus==ID_STATUS_OFFLINE)
return;
@@ -2082,16 +2075,16 @@ static INT_PTR GetIPPort(WPARAM wParam,LPARAM lParam)
HGLOBAL clipbuffer;
char* buffer;
- if(DBGetContactSettingWord((HANDLE)wParam, protocolname, "Port", -1)==0)
+ if(db_get_w((HANDLE)wParam, protocolname, "Port", -1)==0)
return 0;
DBVARIANT dbv;
- if(DBGetContactSettingString((HANDLE)wParam, protocolname, "ServerIP",&dbv))
+ if(db_get_s((HANDLE)wParam, protocolname, "ServerIP",&dbv))
return 0;
- sprintf(temp,"%s:%d",dbv.pszVal,DBGetContactSettingWord((HANDLE)wParam, protocolname, "Port", -1));
+ sprintf(temp,"%s:%d",dbv.pszVal,db_get_w((HANDLE)wParam, protocolname, "Port", -1));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if(OpenClipboard(NULL))
{
@@ -2115,16 +2108,16 @@ static INT_PTR GetVIPPort(WPARAM wParam,LPARAM lParam)
HGLOBAL clipbuffer;
char* buffer;
- if(DBGetContactSettingWord((HANDLE)wParam, protocolname, "VPort", -1)==0)
+ if(db_get_w((HANDLE)wParam, protocolname, "VPort", -1)==0)
return 0;
DBVARIANT dbv;
- if(DBGetContactSettingString((HANDLE)wParam, protocolname, "VServerIP",&dbv))
+ if(db_get_s((HANDLE)wParam, protocolname, "VServerIP",&dbv))
return 0;
- sprintf(temp,"%s:%d",dbv.pszVal,DBGetContactSettingWord((HANDLE)wParam, protocolname, "VPort", -1));
+ sprintf(temp,"%s:%d",dbv.pszVal,db_get_w((HANDLE)wParam, protocolname, "VPort", -1));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if(OpenClipboard(NULL))
{
@@ -2147,12 +2140,12 @@ static INT_PTR GotoProfile(WPARAM wParam,LPARAM lParam)
DBVARIANT dbv;
char temp[64]="";
- if(DBGetContactSettingString((HANDLE)wParam, protocolname, "Username",&dbv))
+ if(db_get_s((HANDLE)wParam, protocolname, "Username",&dbv))
return 0;
strcpy(temp,"http://xfire.com/profile/");
strcat_s(temp,64,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
CallService( MS_UTILS_OPENURL, 1, (LPARAM)temp );
@@ -2163,15 +2156,15 @@ static INT_PTR GotoXFireClanSite(WPARAM wParam,LPARAM lParam) {
DBVARIANT dbv;
char temp[64]="";
- int clanid=DBGetContactSettingDword((HANDLE)wParam, protocolname, "Clan",-1);
+ int clanid=db_get_dw((HANDLE)wParam, protocolname, "Clan",-1);
sprintf(temp,"ClanUrl_%d",clanid);
- if(DBGetContactSettingString(NULL, protocolname, temp,&dbv))
+ if(db_get_s(NULL, protocolname, temp,&dbv))
return 0;
strcpy(temp,"http://xfire.com/clans/");
strcat_s(temp,64,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
CallService( MS_UTILS_OPENURL, 1, (LPARAM)temp );
@@ -2183,12 +2176,12 @@ static INT_PTR GotoProfile2(WPARAM wParam,LPARAM lParam)
DBVARIANT dbv;
char temp[64]="";
- if(DBGetContactSettingString(NULL, protocolname, "login",&dbv))
+ if(db_get_s(NULL, protocolname, "login",&dbv))
return 0;
strcpy(temp,"http://xfire.com/profile/");
strcat_s(temp,64,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
CallService( MS_UTILS_OPENURL, 1, (LPARAM)temp );
@@ -2205,12 +2198,12 @@ static INT_PTR GotoProfileAct(WPARAM wParam,LPARAM lParam)
DBVARIANT dbv;
char temp[64]="";
- if(DBGetContactSettingString(NULL, protocolname, "login",&dbv))
+ if(db_get_s(NULL, protocolname, "login",&dbv))
return 0;
strcpy(temp,"http://www.xfire.com/?username=");
strcat_s(temp,64,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
CallService( MS_UTILS_OPENURL, 1, (LPARAM)temp );
@@ -2224,107 +2217,60 @@ static INT_PTR GotoProfileAct(WPARAM wParam,LPARAM lParam)
int RebuildContactMenu( WPARAM wParam, LPARAM lParam )
{
- // !!!!!!!! check it later
- CLISTMENUITEM clmi = { 0 };
- clmi.cbSize = sizeof( clmi );
- CLISTMENUITEM clmi2 = { 0 };
- clmi2.cbSize = sizeof( clmi2 );
- CLISTMENUITEM clmi3 = { 0 };
- clmi3.cbSize = sizeof( clmi3 );
- CLISTMENUITEM clmi4 = { 0 };
- clmi4.cbSize = sizeof( clmi4 );
- CLISTMENUITEM clmi5 = { 0 };
- clmi5.cbSize = sizeof( clmi5 );
- CLISTMENUITEM clmi6 = { 0 };
- clmi6.cbSize = sizeof( clmi6 );
- CLISTMENUITEM clmi7 = { 0 };
- clmi7.cbSize = sizeof( clmi7 );
- CLISTMENUITEM clmi8 = { 0 };
- clmi8.cbSize = sizeof( clmi8 );
-
- //kopieren von port und ip nur erlauben, wenn verfügbar
- clmi.flags = CMIM_FLAGS;
- clmi2.flags = CMIM_FLAGS;
- clmi3.flags = CMIM_FLAGS;
- clmi4.flags = CMIM_FLAGS;
- clmi5.flags = CMIM_FLAGS;
- clmi6.flags = CMIM_FLAGS;
- clmi7.flags = CMIM_FLAGS;
- clmi8.flags = CMIM_FLAGS;
+ HANDLE hContact = (HANDLE)wParam;
+ bool bEnabled = true, bEnabled2 = true;
DBVARIANT dbv;
- if(DBGetContactSettingString((HANDLE)wParam, protocolname, "ServerIP",&dbv))
- clmi.flags|= CMIF_HIDDEN;
+ if (db_get_s(hContact, protocolname, "ServerIP", &dbv))
+ bEnabled = false;
else
- DBFreeVariant(&dbv);
-
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )copyipport, ( LPARAM )&clmi );
+ db_free(&dbv);
+ Menu_ShowItem(copyipport, bEnabled);
//kopieren von voice port und ip nur erlauben, wenn verfügbar
- DBVARIANT dbv2;
- if(DBGetContactSettingString((HANDLE)wParam, protocolname, "VServerIP",&dbv2))
- {
- clmi2.flags|= CMIF_HIDDEN;
- }
+ bEnabled = true;
+ if(db_get_s(hContact, protocolname, "VServerIP", &dbv))
+ bEnabled = false;
else
- DBFreeVariant(&dbv2);
-
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )vipport, ( LPARAM )&clmi2 );
+ db_free(&dbv);
+ Menu_ShowItem(vipport, bEnabled);
//clansite nur bei clanmembern anbieten
- if(DBGetContactSettingDword((HANDLE)wParam, protocolname, "Clan",0)==0)
- clmi3.flags|= CMIF_HIDDEN;
-
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )gotoclansite, ( LPARAM )&clmi3 );
+ Menu_ShowItem(gotoclansite, db_get_dw(hContact, protocolname, "Clan",0) != 0);
//NotOnList
- if(DBGetContactSettingDword((HANDLE)wParam, "CList", "NotOnList",0)==0)
- clmi5.flags|= CMIF_HIDDEN;
-
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )blockfriend, ( LPARAM )&clmi5 );
+ Menu_ShowItem(blockfriend, db_get_dw(hContact, "CList", "NotOnList",0) != 0);
//speichere gameid ab
- int gameid=DBGetContactSettingWord((HANDLE)wParam, protocolname, "GameId",0);
+ int gameid = db_get_w(hContact, protocolname, "GameId",0);
//spiel in xfirespieliste?
- if(!xgamelist.Gameinlist(gameid))
- {
+ bEnabled = bEnabled2 = true;
+ if(!xgamelist.Gameinlist(gameid)) {
//nein, dann start und join auf unsichbar schalten
- clmi7.flags|= CMIF_HIDDEN;
- clmi4.flags|= CMIF_HIDDEN;
+ bEnabled = bEnabled2 = false;
}
- else
- {
+ else {
//gameobject holen
Xfire_game* game=xgamelist.getGamebyGameid(gameid);
//hat das spiel netzwerkparameter?
- if(game)
- {
- if(game->networkparams)
- {
+ if(game) {
+ if(game->networkparams) {
//is beim buddy ein port hinterlegt, also spielt er im internet?
- if(!DBGetContactSettingDword((HANDLE)wParam, protocolname, "Port",0))
- {
+ if( !db_get_dw(hContact, protocolname, "Port",0)) {
//nein, dann join button auch ausblenden
- clmi4.flags|= CMIF_HIDDEN;
+ bEnabled = false;
}
}
- else
- clmi4.flags|= CMIF_HIDDEN;
+ else bEnabled = false;
}
- else
- clmi4.flags|= CMIF_HIDDEN;
+ else bEnabled = false;
}
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )joingame, ( LPARAM )&clmi4 );
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )startthisgame, ( LPARAM )&clmi7 );
-
+ Menu_ShowItem(joingame, bEnabled);
+ Menu_ShowItem(startthisgame, bEnabled2);
//remove freind nur bei noramlen buddies
- if(DBGetContactSettingByte((HANDLE)wParam, protocolname, "friendoffriend",0)==1)
- clmi8.flags|= CMIF_HIDDEN;
-
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )removefriend, ( LPARAM )&clmi8 );
-
+ Menu_ShowItem(removefriend, db_get_b(hContact, protocolname, "friendoffriend",0) != 1);
return 0;
}
@@ -2387,14 +2333,14 @@ void gamedetectiont(LPVOID lparam)
time_t t1;
- if(DBGetContactSettingByte(NULL,protocolname,"nogamedetect",0))
+ if(db_get_b(NULL,protocolname,"nogamedetect",0))
#ifndef NO_PTHREAD
return ptr;
#else
return;
#endif
- DWORD lowpids=DBGetContactSettingByte(NULL,protocolname,"skiplowpid",100);
+ DWORD lowpids=db_get_b(NULL,protocolname,"skiplowpid",100);
//XFireLog("XFire Gamedetectionthread started ...","");
@@ -2431,7 +2377,7 @@ void gamedetectiont(LPVOID lparam)
{
//erstmal nach TS2 suchen
//XFireLog("Teamspeak detection ...","");
- if(DBGetContactSettingByte(NULL,protocolname,"ts2detection",0))
+ if(db_get_b(NULL,protocolname,"ts2detection",0))
{
SendGameStatus2Packet *packet = new SendGameStatus2Packet();
if(voicechat.checkVoicechat(packet)) {
@@ -2448,24 +2394,24 @@ void gamedetectiont(LPVOID lparam)
//if (hMapObject) {
//}
//wenn remote feature aktiviert, darüber ip erkennen
- /*if(DBGetContactSettingByte(NULL,protocolname,"ts2useremote",0))
+ /*if(db_get_b(NULL,protocolname,"ts2useremote",0))
{
//ipholen
SendGameStatus2Packet *packet = new SendGameStatus2Packet();
if(TSSetupPacket(packet,&ts2pid,&ts2port))
{
- DBWriteContactSettingWord(NULL,protocolname,"currentvoice",packet->gameid);
+ db_set_w(NULL,protocolname,"currentvoice",packet->gameid);
if(packet->ip[3]!=0)
{
sprintf(temp,"%d.%d.%d.%d:%d",(unsigned char)packet->ip[3],(unsigned char)packet->ip[2],(unsigned char)packet->ip[1],(unsigned char)packet->ip[0],packet->port);
- DBWriteContactSettingString(NULL, protocolname, "VServerIP", temp);
- DBWriteContactSettingString(NULL, protocolname, "currentvoicename", "Teamspeak");
+ db_set_s(NULL, protocolname, "VServerIP", temp);
+ db_set_s(NULL, protocolname, "currentvoicename", "Teamspeak");
}
else
{
- DBDeleteContactSetting(NULL,protocolname, "VServerIP");
- DBDeleteContactSetting(NULL,protocolname, "currentvoicename");
+ db_unset(NULL,protocolname, "VServerIP");
+ db_unset(NULL,protocolname, "currentvoicename");
}
if(myClient!=NULL)
@@ -2490,16 +2436,16 @@ void gamedetectiont(LPVOID lparam)
packet->gameid=vid;
if(vid==32)
- DBWriteContactSettingString(NULL, protocolname, "currentvoicename", "Teamspeak");
+ db_set_s(NULL, protocolname, "currentvoicename", "Teamspeak");
else if(vid==33)
- DBWriteContactSettingString(NULL, protocolname, "currentvoicename", "Ventrilo");
+ db_set_s(NULL, protocolname, "currentvoicename", "Ventrilo");
else if(vid==34)
- DBWriteContactSettingString(NULL, protocolname, "currentvoicename", "Mumble");
+ db_set_s(NULL, protocolname, "currentvoicename", "Mumble");
- DBWriteContactSettingWord(NULL,protocolname,"currentvoice",vid);
+ db_set_w(NULL,protocolname,"currentvoice",vid);
sprintf(temp,"%d.%d.%d.%d:%d",(unsigned char)packet->ip[3],(unsigned char)packet->ip[2],(unsigned char)packet->ip[1],(unsigned char)packet->ip[0],packet->port);
- DBWriteContactSettingString(NULL, protocolname, "VServerIP", temp);
+ db_set_s(NULL, protocolname, "VServerIP", temp);
if(myClient!=NULL)
myClient->client->send( packet );
@@ -2518,9 +2464,9 @@ void gamedetectiont(LPVOID lparam)
{
SendGameStatus2Packet *packet = new SendGameStatus2Packet();
packet->gameid=0;
- DBWriteContactSettingWord(NULL,protocolname,"currentvoice",0);
- DBDeleteContactSetting(NULL,protocolname, "VServerIP");
- DBDeleteContactSetting(NULL,protocolname, "currentvoicename");
+ db_set_w(NULL,protocolname,"currentvoice",0);
+ db_unset(NULL,protocolname, "VServerIP");
+ db_unset(NULL,protocolname, "currentvoicename");
if(myClient!=NULL)
myClient->client->send( packet );
@@ -2536,10 +2482,10 @@ void gamedetectiont(LPVOID lparam)
if(packet->port!=0)
{
packet->gameid=vid;
- DBWriteContactSettingWord(NULL,protocolname,"currentvoice",vid);
+ db_set_w(NULL,protocolname,"currentvoice",vid);
sprintf(temp,"%d.%d.%d.%d:%d",(unsigned char)packet->ip[3],(unsigned char)packet->ip[2],(unsigned char)packet->ip[1],(unsigned char)packet->ip[0],packet->port);
- DBWriteContactSettingString(NULL, protocolname, "VServerIP", temp);
+ db_set_s(NULL, protocolname, "VServerIP", temp);
if(myClient!=NULL)
myClient->client->send( packet );
@@ -2573,7 +2519,7 @@ void gamedetectiont(LPVOID lparam)
//XFireLog("XFire Gamedetection - Game was closed ID: %i",currentgame);
SendGameStatusPacket *packet = new SendGameStatusPacket();
packet->gameid=0;
- if(DBGetContactSettingByte(NULL,protocolname,"sendgamestatus",1))
+ if(db_get_b(NULL,protocolname,"sendgamestatus",1))
if(myClient!=NULL)
myClient->client->send( packet );
@@ -2594,17 +2540,17 @@ void gamedetectiont(LPVOID lparam)
}
sprintf(temp,Translate("Last game: %s playtime: %.2d:%.2d:%.2d"),currentgame->name,mytm->tm_hour,mytm->tm_min,mytm->tm_sec);
- DBWriteContactSettingString(NULL, protocolname, "LastGame", temp);
+ db_set_s(NULL, protocolname, "LastGame", temp);
- if(currentgame->noicqstatus!=TRUE&&DBGetContactSettingByte(NULL,protocolname,"autosetstatusmsg",0))
+ if(currentgame->noicqstatus!=TRUE&&db_get_b(NULL,protocolname,"autosetstatusmsg",0))
SetOldStatusMsg();
- DBWriteContactSettingWord(NULL,protocolname,"currentgame",0);
- DBDeleteContactSetting(NULL,protocolname,"currentgamename");
+ db_set_w(NULL,protocolname,"currentgame",0);
+ db_unset(NULL,protocolname,"currentgamename");
//popup wieder aktivieren, menuservice funk aufrufen, nur wenn popups vorher abgestellt wurden
if(disabledpopups)
- if(DBGetContactSettingByte(NULL,protocolname,"nopopups",0))
+ if(db_get_b(NULL,protocolname,"nopopups",0))
{
if(ServiceExists("PopUp/EnableDisableMenuCommand"))
{
@@ -2618,14 +2564,14 @@ void gamedetectiont(LPVOID lparam)
}
//sound wieder aktivieren, nur wenn es vorher abgestellt wurde
if(disabledsound)
- if(DBGetContactSettingByte(NULL,protocolname,"nosoundev",0))
+ if(db_get_b(NULL,protocolname,"nosoundev",0))
{
- DBWriteContactSettingByte(NULL,"Skin","UseSound",1);
+ db_set_b(NULL,"Skin","UseSound",1);
disabledsound=FALSE;
}
//bug beseitigt, wenn spiel beendet, alte ip entfernen
- DBDeleteContactSetting(NULL,protocolname, "ServerIP");
+ db_unset(NULL,protocolname, "ServerIP");
pid=NULL;
currentgame=NULL;
@@ -2639,7 +2585,7 @@ void gamedetectiont(LPVOID lparam)
{
//XFireLog("Spiel noch offen ...","");
//nur nwspiele nach ip/port scannen
- if(DBGetContactSettingByte(NULL,protocolname,"ipportdetec",0))
+ if(db_get_b(NULL,protocolname,"ipportdetec",0))
if(currentgame->networkparams!=NULL&&currentgame->send_gameid>0)
{
SendGameStatusPacket *packet = new SendGameStatusPacket();
@@ -2652,20 +2598,20 @@ void gamedetectiont(LPVOID lparam)
if(packet->ip[3]!=0)
{
sprintf(temp,"%d.%d.%d.%d:%d",(unsigned char)packet->ip[3],(unsigned char)packet->ip[2],(unsigned char)packet->ip[1],(unsigned char)packet->ip[0],packet->port);
- DBWriteContactSettingString(NULL, protocolname, "ServerIP", temp);
+ db_set_s(NULL, protocolname, "ServerIP", temp);
XFireLog("Got IPPort: %s",temp);
}
else {
- DBDeleteContactSetting(NULL,protocolname, "ServerIP");
+ db_unset(NULL,protocolname, "ServerIP");
XFireLog("NO IPPort","");
}
packet->gameid=currentgame->send_gameid;
- if(DBGetContactSettingByte(NULL,protocolname,"sendgamestatus",1))
+ if(db_get_b(NULL,protocolname,"sendgamestatus",1))
if(myClient!=NULL)
myClient->client->send( packet );
- if(currentgame->noicqstatus!=TRUE&&DBGetContactSettingByte(NULL,protocolname,"autosetstatusmsg",0))
+ if(currentgame->noicqstatus!=TRUE&&db_get_b(NULL,protocolname,"autosetstatusmsg",0))
SetGameStatusMsg();
} else {
XFireLog("GetServerIPPort failed","");
@@ -2712,12 +2658,12 @@ void gamedetectiont(LPVOID lparam)
{
currentgame=nextgame;
pid=processInfo->th32ProcessID;
- DBWriteContactSettingWord(NULL,protocolname,"currentgame",currentgame->id);
- DBWriteContactSettingString(NULL,protocolname,"currentgamename",currentgame->name);
+ db_set_w(NULL,protocolname,"currentgame",currentgame->id);
+ db_set_s(NULL,protocolname,"currentgamename",currentgame->name);
packet->gameid=currentgame->send_gameid;
t1=time(NULL);
- if(DBGetContactSettingByte(NULL,protocolname,"sendgamestatus",1))
+ if(db_get_b(NULL,protocolname,"sendgamestatus",1))
{
XFireLog("XFire Gamedetection - Sendgame-ID: %i",currentgame->send_gameid);
if(currentgame->send_gameid>0)
@@ -2738,29 +2684,29 @@ void gamedetectiont(LPVOID lparam)
SetXFireGameStatusMsg(currentgame);
}
- if(currentgame->noicqstatus!=TRUE&&DBGetContactSettingByte(NULL,protocolname,"autosetstatusmsg",0))
+ if(currentgame->noicqstatus!=TRUE&&db_get_b(NULL,protocolname,"autosetstatusmsg",0))
{
BackupStatusMsg();
SetGameStatusMsg();
}
//popup abschalten, menuservice funk aufrufen
- if(DBGetContactSettingByte(NULL,protocolname,"nopopups",0))
+ if(db_get_b(NULL,protocolname,"nopopups",0))
{
- if(ServiceExists("PopUp/EnableDisableMenuCommand")&&DBGetContactSettingByte(NULL,"PopUp","ModuleIsEnabled",0)==1) /**/
+ if(ServiceExists("PopUp/EnableDisableMenuCommand")&&db_get_b(NULL,"PopUp","ModuleIsEnabled",0)==1) /**/
{
disabledpopups=TRUE;
CallService("PopUp/EnableDisableMenuCommand",NULL,NULL);
}
- else if(ServiceExists("PopUp/ToggleEnabled")&&DBGetContactSettingByte(NULL,"YAPP","Enabled",0)==1)
+ else if(ServiceExists("PopUp/ToggleEnabled")&&db_get_b(NULL,"YAPP","Enabled",0)==1)
{
disabledpopups=TRUE;
CallService("PopUp/ToggleEnabled",NULL,NULL);
}
}
//sound abschalten
- if(DBGetContactSettingByte(NULL,protocolname,"nosoundev",0)&&DBGetContactSettingByte(NULL,"Skin","UseSound",0)==1)
+ if(db_get_b(NULL,protocolname,"nosoundev",0)&&db_get_b(NULL,"Skin","UseSound",0)==1)
{
- DBWriteContactSettingByte(NULL,"Skin","UseSound",0);
+ db_set_b(NULL,"Skin","UseSound",0);
disabledsound=TRUE;
}
}
@@ -2782,7 +2728,7 @@ void gamedetectiont(LPVOID lparam)
static INT_PTR ReScanMyGames(WPARAM wParam,LPARAM lParam)
{
- DBDeleteContactSetting(NULL, protocolname, "foundgames");
+ db_unset(NULL, protocolname, "foundgames");
mir_forkthread(Scan4Games,NULL);
@@ -2807,33 +2753,33 @@ void setBuddyStatusMsg(BuddyListEntry *entry)
{
ostringstream xstatus;
DBVARIANT dbv;
- if (!DBGetContactSettingString(entry->hcontact, protocolname, "RGame", &dbv))
+ if (!db_get_s(entry->hcontact, protocolname, "RGame", &dbv))
{
xstatus << dbv.pszVal << " ";
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if (!DBGetContactSettingByte(NULL, protocolname, "noipportinstatus", 0))
+ if (!db_get_b(NULL, protocolname, "noipportinstatus", 0))
{
- if (!DBGetContactSettingString(entry->hcontact, protocolname, "ServerName", &dbv))
+ if (!db_get_s(entry->hcontact, protocolname, "ServerName", &dbv))
{
xstatus << dbv.pszVal;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- else if (!DBGetContactSettingString(entry->hcontact,protocolname, "ServerIP",&dbv))
+ else if (!db_get_s(entry->hcontact,protocolname, "ServerIP",&dbv))
{
- xstatus << "(" << dbv.pszVal << ":" << DBGetContactSettingWord(entry->hcontact, protocolname, "Port", 0) << ")";
- DBFreeVariant(&dbv);
+ xstatus << "(" << dbv.pszVal << ":" << db_get_w(entry->hcontact, protocolname, "Port", 0) << ")";
+ db_free(&dbv);
}
}
DBWriteContactSettingUTF8String(entry->hcontact, protocolname, "XStatusMsg", xstatus.str().c_str());
}
else
{
- //DBWriteContactSettingByte(entry->hcontact, protocolname, "XStatusId", 1);
- DBDeleteContactSetting(entry->hcontact, protocolname, "XStatusId");
- DBDeleteContactSetting(entry->hcontact, protocolname, "XStatusName");
- DBDeleteContactSetting(entry->hcontact, protocolname, "XStatusMsg");
+ //db_set_b(entry->hcontact, protocolname, "XStatusId", 1);
+ db_unset(entry->hcontact, protocolname, "XStatusId");
+ db_unset(entry->hcontact, protocolname, "XStatusName");
+ db_unset(entry->hcontact, protocolname, "XStatusMsg");
}
/*//statusmsg umwandeln
@@ -2844,12 +2790,12 @@ void setBuddyStatusMsg(BuddyListEntry *entry)
string afk = entry->statusmsg.substr(0, 5);
int status_id = (afk == "(AFK)" || afk == "(ABS)") ? ID_STATUS_AWAY : ID_STATUS_ONLINE;
- DBWriteContactSettingWord(entry->hcontact, protocolname, "Status", status_id);
+ db_set_w(entry->hcontact, protocolname, "Status", status_id);
if (!entry->statusmsg.empty())
DBWriteContactSettingUTF8String(entry->hcontact, "CList", "StatusMsg", entry->statusmsg.c_str());
else
- DBDeleteContactSetting(entry->hcontact, "CList", "StatusMsg");
+ db_unset(entry->hcontact, "CList", "StatusMsg");
}
/*void CheckAvatar(void *ventry)
@@ -2858,13 +2804,13 @@ void setBuddyStatusMsg(BuddyListEntry *entry)
DBVARIANT dbv;
if(entry==NULL)
return;
- if(DBGetContactSettingByte(NULL,protocolname,"noavatars",-1)==0)
+ if(db_get_b(NULL,protocolname,"noavatars",-1)==0)
{
- if(DBGetContactSettingByte(entry->hcontact, "ContactPhoto", "Locked", -1)!=1)
+ if(db_get_b(entry->hcontact, "ContactPhoto", "Locked", -1)!=1)
{
- if(!DBGetContactSettingByte(NULL,protocolname,"specialavatarload",0))
+ if(!db_get_b(NULL,protocolname,"specialavatarload",0))
{
- if(DBGetContactSetting(entry->hcontact,"ContactPhoto", "File",&dbv))
+ if(db_get(entry->hcontact,"ContactPhoto", "File",&dbv))
{
XFire_SetAvatar* xsa=new XFire_SetAvatar;
xsa->hContact=entry->hcontact;
@@ -2907,8 +2853,8 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
entry->hcontact=CList_FindContact(entry->userid);
if(entry->hcontact&&clan==-1)
{
- DBWriteContactSettingWord(entry->hcontact, protocolname, "Status", ID_STATUS_ONLINE);
- DBWriteContactSettingString(entry->hcontact, protocolname, "MirVer", "xfire");
+ db_set_w(entry->hcontact, protocolname, "Status", ID_STATUS_ONLINE);
+ db_set_s(entry->hcontact, protocolname, "MirVer", "xfire");
}
}
@@ -2927,7 +2873,7 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
if (hContact!=0)
{
- if (!entry->nick.empty() && DBGetContactSettingByte(NULL, protocolname, "shownicks", 1)) {
+ if (!entry->nick.empty() && db_get_b(NULL, protocolname, "shownicks", 1)) {
char*nick=NULL;
if (myClient->useutf8)
@@ -2940,33 +2886,33 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
if(myClient->useutf8)
DBWriteContactSettingUTF8String(hContact, protocolname, "Nick", nick);
else
- DBWriteContactSettingString(hContact, protocolname, "Nick", nick);
+ db_set_s(hContact, protocolname, "Nick", nick);
}
else
- DBWriteContactSettingString(hContact, protocolname, "Nick", entry->username.c_str());
+ db_set_s(hContact, protocolname, "Nick", entry->username.c_str());
- //DBWriteContactSettingStringUtf(hContact, protocolname, "Nick", entry->nick.c_str());
+ //db_set_utf(hContact, protocolname, "Nick", entry->nick.c_str());
//DBWriteContactSettingUTF8String(hContact, protocolname, "Nick", ( char* )entry->nick.c_str());
} else
- DBWriteContactSettingString(hContact, protocolname, "Nick", entry->username.c_str());
+ db_set_s(hContact, protocolname, "Nick", entry->username.c_str());
if(!entry->isOnline())
{
- DBWriteContactSettingWord(hContact, protocolname, "Status", ID_STATUS_OFFLINE);
- DBDeleteContactSetting(hContact, protocolname, "XStatusMsg");
- DBDeleteContactSetting(hContact, protocolname, "XStatusId");
- DBDeleteContactSetting(hContact, protocolname, "XStatusName");
- DBDeleteContactSetting(hContact, "CList", "StatusMsg");
+ db_set_w(hContact, protocolname, "Status", ID_STATUS_OFFLINE);
+ db_unset(hContact, protocolname, "XStatusMsg");
+ db_unset(hContact, protocolname, "XStatusId");
+ db_unset(hContact, protocolname, "XStatusName");
+ db_unset(hContact, "CList", "StatusMsg");
//DBWriteContactSettingUTF8String(hContact, protocolname, "XStatusName", "");
- DBDeleteContactSetting(hContact, protocolname, "ServerIP");
- DBDeleteContactSetting(hContact, protocolname, "Port");
- DBDeleteContactSetting(hContact, protocolname, "VServerIP");
- DBDeleteContactSetting(hContact, protocolname, "VPort");
- DBDeleteContactSetting(hContact, protocolname, "RVoice");
- DBDeleteContactSetting(hContact, protocolname, "RGame");
- DBDeleteContactSetting(hContact, protocolname, "GameId");
- DBDeleteContactSetting(hContact, protocolname, "VoiceId");
- DBDeleteContactSetting(hContact, protocolname, "GameInfo");
+ db_unset(hContact, protocolname, "ServerIP");
+ db_unset(hContact, protocolname, "Port");
+ db_unset(hContact, protocolname, "VServerIP");
+ db_unset(hContact, protocolname, "VPort");
+ db_unset(hContact, protocolname, "RVoice");
+ db_unset(hContact, protocolname, "RGame");
+ db_unset(hContact, protocolname, "GameId");
+ db_unset(hContact, protocolname, "VoiceId");
+ db_unset(hContact, protocolname, "GameInfo");
}
else if(entry->game>0||entry->game2>0)
{
@@ -2976,7 +2922,7 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
DummyXFireGame *gameob;
if(strlen(entry->gameinfo.c_str())>0)
- DBWriteContactSettingString(hContact, protocolname, "GameInfo", entry->gameinfo.c_str());
+ db_set_s(hContact, protocolname, "GameInfo", entry->gameinfo.c_str());
//beim voicechat foglendes machn
if(entry->game2>0)
@@ -2985,33 +2931,33 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
xgamelist.getGamename(entry->game2,gname,255);
- DBWriteContactSettingString(hContact, protocolname, "RVoice", gname);
+ db_set_s(hContact, protocolname, "RVoice", gname);
if(gameob)
{
if((unsigned char)gameob->ip[3]!=0) // wenn ip, dann speichern
{
sprintf(temp,"%d.%d.%d.%d",(unsigned char)gameob->ip[3],(unsigned char)gameob->ip[2],(unsigned char)gameob->ip[1],(unsigned char)gameob->ip[0]);
- DBWriteContactSettingString(hContact, protocolname, "VServerIP", temp);
- DBWriteContactSettingWord(hContact, protocolname, "VPort", (unsigned long)gameob->port);
+ db_set_s(hContact, protocolname, "VServerIP", temp);
+ db_set_w(hContact, protocolname, "VPort", (unsigned long)gameob->port);
}
else
{
- DBDeleteContactSetting(hContact, protocolname, "VServerIP");
- DBDeleteContactSetting(hContact, protocolname, "VPort");
+ db_unset(hContact, protocolname, "VServerIP");
+ db_unset(hContact, protocolname, "VPort");
}
}
- DBWriteContactSettingWord(hContact, protocolname, "VoiceId", entry->game2);
+ db_set_w(hContact, protocolname, "VoiceId", entry->game2);
SetIcon(hContact,xgamelist.iconmngr.getGameIconHandle(entry->game2),2); //icon seperat setzen
}
else
{
- DBDeleteContactSetting(hContact, protocolname, "VServerIP");
- DBDeleteContactSetting(hContact, protocolname, "VPort");
- DBDeleteContactSetting(hContact, protocolname, "RVoice");
- DBDeleteContactSetting(hContact, protocolname, "VoiceId");
+ db_unset(hContact, protocolname, "VServerIP");
+ db_unset(hContact, protocolname, "VPort");
+ db_unset(hContact, protocolname, "RVoice");
+ db_unset(hContact, protocolname, "VoiceId");
SetIcon(hContact,(HANDLE)-1,2);
}
@@ -3022,13 +2968,13 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
xgamelist.getGamename(entry->game,gname,255);
- DBWriteContactSettingString(hContact, protocolname, "RGame", gname);
+ db_set_s(hContact, protocolname, "RGame", gname);
//beinhaltet ip und port
gameob=(DummyXFireGame*)entry->gameObj;
//popup, wenn jemand was spielt
- if(DBGetContactSettingByte(NULL,protocolname,"gamepopup",0)==1) {
+ if(db_get_b(NULL,protocolname,"gamepopup",0)==1) {
char temp[256]="";
sprintf(temp,Translate("%s is playing %s."),
@@ -3095,12 +3041,12 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
{
//ip und port in kontakt speichern
sprintf(temp,"%d.%d.%d.%d",(unsigned char)gameob->ip[3],(unsigned char)gameob->ip[2],(unsigned char)gameob->ip[1],(unsigned char)gameob->ip[0]);
- DBWriteContactSettingString(hContact, protocolname, "ServerIP", temp);
- DBWriteContactSettingWord(hContact, protocolname, "Port", (unsigned long)gameob->port);
+ db_set_s(hContact, protocolname, "ServerIP", temp);
+ db_set_w(hContact, protocolname, "Port", (unsigned long)gameob->port);
//lass das query arbeiten
if(dontscan==FALSE)
- if(ServiceExists("GameServerQuery/Query")&&DBGetContactSettingByte(NULL,protocolname,"gsqsupport",0))
+ if(ServiceExists("GameServerQuery/Query")&&db_get_b(NULL,protocolname,"gsqsupport",0))
{
GameServerQuery_query gsqq={0};
gsqq.port=gameob->port;
@@ -3111,36 +3057,36 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
}
else
{
- DBDeleteContactSetting(hContact, protocolname, "ServerName");
- DBDeleteContactSetting(hContact, protocolname, "ServerIP");
- DBDeleteContactSetting(hContact, protocolname, "Port");
+ db_unset(hContact, protocolname, "ServerName");
+ db_unset(hContact, protocolname, "ServerIP");
+ db_unset(hContact, protocolname, "Port");
}
}
SetIcon(hContact,xgamelist.iconmngr.getGameIconHandle(entry->game));
- //DBDeleteContactSetting(hContact, "CList", "StatusMsg");
- DBWriteContactSettingWord(hContact, protocolname, "Status", ID_STATUS_ONLINE);
+ //db_unset(hContact, "CList", "StatusMsg");
+ db_set_w(hContact, protocolname, "Status", ID_STATUS_ONLINE);
DBWriteContactSettingUTF8String(hContact, protocolname, "XStatusName", Translate("Playing"));
setBuddyStatusMsg(entry);
- DBWriteContactSettingByte(hContact, protocolname, "XStatusId", xgamelist.iconmngr.getGameIconId(entry->game)+2);
+ db_set_b(hContact, protocolname, "XStatusId", xgamelist.iconmngr.getGameIconId(entry->game)+2);
//buddy vorher ein spielgestartet, wenn nicht sound spielen?
- if(!DBGetContactSettingWord(hContact, protocolname, "GameId",0))
+ if(!db_get_w(hContact, protocolname, "GameId",0))
SkinPlaySound("xfirebstartgame");
- DBWriteContactSettingWord(hContact, protocolname, "GameId", entry->game);
+ db_set_w(hContact, protocolname, "GameId", entry->game);
}
else
{
SetIcon(hContact,(HANDLE)-1);
- DBDeleteContactSetting(hContact, protocolname, "ServerIP");
- DBDeleteContactSetting(hContact, protocolname, "Port");
- DBDeleteContactSetting(hContact, protocolname, "XStatusMsg");
- DBDeleteContactSetting(hContact, protocolname, "XStatusId");
- DBDeleteContactSetting(hContact, protocolname, "XStatusName");
- DBDeleteContactSetting(hContact, protocolname, "RGame");
- DBDeleteContactSetting(hContact, protocolname, "GameId");
+ db_unset(hContact, protocolname, "ServerIP");
+ db_unset(hContact, protocolname, "Port");
+ db_unset(hContact, protocolname, "XStatusMsg");
+ db_unset(hContact, protocolname, "XStatusId");
+ db_unset(hContact, protocolname, "XStatusName");
+ db_unset(hContact, protocolname, "RGame");
+ db_unset(hContact, protocolname, "GameId");
setBuddyStatusMsg(entry);
}
}
@@ -3150,20 +3096,20 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
SetIcon(hContact,(HANDLE)-1);
SetIcon(hContact,(HANDLE)-1,2);
- DBDeleteContactSetting(hContact, protocolname, "ServerIP");
- DBDeleteContactSetting(hContact, protocolname, "Port");
- DBDeleteContactSetting(hContact, protocolname, "VServerIP");
- DBDeleteContactSetting(hContact, protocolname, "VPort");
- DBDeleteContactSetting(hContact, protocolname, "RVoice");
- DBDeleteContactSetting(hContact, protocolname, "RGame");
- DBDeleteContactSetting(hContact, protocolname, "GameId");
- DBDeleteContactSetting(hContact, protocolname, "VoiceId");
+ db_unset(hContact, protocolname, "ServerIP");
+ db_unset(hContact, protocolname, "Port");
+ db_unset(hContact, protocolname, "VServerIP");
+ db_unset(hContact, protocolname, "VPort");
+ db_unset(hContact, protocolname, "RVoice");
+ db_unset(hContact, protocolname, "RGame");
+ db_unset(hContact, protocolname, "GameId");
+ db_unset(hContact, protocolname, "VoiceId");
}
else
{
- if(DBGetContactSettingWord(entry->hcontact, protocolname, "Status", -1)==ID_STATUS_OFFLINE)
+ if(db_get_w(entry->hcontact, protocolname, "Status", -1)==ID_STATUS_OFFLINE)
{
- if(DBGetContactSettingByte(NULL, protocolname, "noclanavatars", 0)==1&&clan>0)
+ if(db_get_b(NULL, protocolname, "noclanavatars", 0)==1&&clan>0)
;
else
if(myClient) myClient->CheckAvatar(entry);
@@ -3171,75 +3117,75 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
SetIcon(hContact,(HANDLE)-1);
SetIcon(hContact,(HANDLE)-1,2);
- DBWriteContactSettingWord(hContact, protocolname, "Status", ID_STATUS_ONLINE);
- DBWriteContactSettingString(entry->hcontact, protocolname, "MirVer", "xfire");
- if(clan>0) DBWriteContactSettingDword(hContact, protocolname, "Clan", clan);
+ db_set_w(hContact, protocolname, "Status", ID_STATUS_ONLINE);
+ db_set_s(entry->hcontact, protocolname, "MirVer", "xfire");
+ if(clan>0) db_set_dw(hContact, protocolname, "Clan", clan);
//DBWriteContactSettingUTF8String(hContact, "CList", "StatusMsg", "");
- DBDeleteContactSetting(hContact, protocolname, "XStatusMsg");
- DBDeleteContactSetting(hContact, protocolname, "XStatusId");
- DBDeleteContactSetting(hContact, protocolname, "XStatusName");
- DBDeleteContactSetting(hContact, "CList", "StatusMsg");
- DBDeleteContactSetting(hContact, protocolname, "ServerIP");
- DBDeleteContactSetting(hContact, protocolname, "Port");
- DBDeleteContactSetting(hContact, protocolname, "VServerIP");
- DBDeleteContactSetting(hContact, protocolname, "VPort");
- DBDeleteContactSetting(hContact, protocolname, "RVoice");
- DBDeleteContactSetting(hContact, protocolname, "RGame");
- DBDeleteContactSetting(hContact, protocolname, "GameId");
- DBDeleteContactSetting(hContact, protocolname, "VoiceId");
+ db_unset(hContact, protocolname, "XStatusMsg");
+ db_unset(hContact, protocolname, "XStatusId");
+ db_unset(hContact, protocolname, "XStatusName");
+ db_unset(hContact, "CList", "StatusMsg");
+ db_unset(hContact, protocolname, "ServerIP");
+ db_unset(hContact, protocolname, "Port");
+ db_unset(hContact, protocolname, "VServerIP");
+ db_unset(hContact, protocolname, "VPort");
+ db_unset(hContact, protocolname, "RVoice");
+ db_unset(hContact, protocolname, "RGame");
+ db_unset(hContact, protocolname, "GameId");
+ db_unset(hContact, protocolname, "VoiceId");
}
}
if(group!=NULL)
{
- if(!DBGetContactSettingByte(NULL,protocolname,"noclangroups",0))
+ if(!db_get_b(NULL,protocolname,"noclangroups",0))
{
if(clan>0)
{
- int val=DBGetContactSettingByte(NULL,protocolname,"mainclangroup",0);
+ int val=db_get_b(NULL,protocolname,"mainclangroup",0);
- if( DBGetContactSettingByte(NULL,protocolname,"skipfriendsgroups",0)==0 ||
- (DBGetContactSettingByte(NULL,protocolname,"skipfriendsgroups",0)==1&&
- DBGetContactSettingByte(entry->hcontact, protocolname, "isfriend", 0)==0)
+ if( db_get_b(NULL,protocolname,"skipfriendsgroups",0)==0 ||
+ (db_get_b(NULL,protocolname,"skipfriendsgroups",0)==1&&
+ db_get_b(entry->hcontact, protocolname, "isfriend", 0)==0)
)
{
if(val==0)
{
- DBWriteContactSettingString(entry->hcontact, "CList", "Group", group);
+ db_set_s(entry->hcontact, "CList", "Group", group);
}
else
{
char temp[256];
DBVARIANT dbv;
sprintf_s(temp,256,"%d",val-1);
- DBGetContactSettingString(NULL,"CListGroups",temp,&dbv);
+ db_get_s(NULL,"CListGroups",temp,&dbv);
if(dbv.pszVal!=NULL)
{
sprintf_s(temp,256,"%s\\%s",&dbv.pszVal[1],group);
- DBWriteContactSettingString(entry->hcontact, "CList", "Group", temp);
- DBFreeVariant(&dbv);
+ db_set_s(entry->hcontact, "CList", "Group", temp);
+ db_free(&dbv);
}
}
}
}
else if(clan==-1)//hauptgruppe für fof
{
- int val=DBGetContactSettingByte(NULL,protocolname,"fofgroup",0);
+ int val=db_get_b(NULL,protocolname,"fofgroup",0);
if(val==0)
{
- DBWriteContactSettingString(entry->hcontact, "CList", "Group", group);
+ db_set_s(entry->hcontact, "CList", "Group", group);
}
else
{
char temp[256];
DBVARIANT dbv;
sprintf_s(temp,256,"%d",val-1);
- DBGetContactSettingString(NULL,"CListGroups",temp,&dbv);
+ db_get_s(NULL,"CListGroups",temp,&dbv);
if(dbv.pszVal!=NULL)
{
sprintf_s(temp,256,"%s\\%s",&dbv.pszVal[1],group);
- DBWriteContactSettingString(entry->hcontact, "CList", "Group", temp);
- DBFreeVariant(&dbv);
+ db_set_s(entry->hcontact, "CList", "Group", temp);
+ db_free(&dbv);
}
}
}
@@ -3247,7 +3193,7 @@ HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
}
else
{
- DBWriteContactSettingByte(entry->hcontact, protocolname, "isfriend", 1);
+ db_set_b(entry->hcontact, protocolname, "isfriend", 1);
}
return hContact;
@@ -3259,7 +3205,7 @@ INT_PTR AddtoList( WPARAM wParam, LPARAM lParam ) {
if (ccs->hContact)
{
DBVARIANT dbv2;
- if(!DBGetContactSetting(ccs->hContact,protocolname,"Username",&dbv2)) {
+ if(!db_get(ccs->hContact,protocolname,"Username",&dbv2)) {
if(myClient!=NULL)
if(myClient->client->connected)
@@ -3270,7 +3216,7 @@ INT_PTR AddtoList( WPARAM wParam, LPARAM lParam ) {
}
//temporären buddy entfernen, da eh ein neues packet kommt
- DBWriteContactSettingByte(ccs->hContact, protocolname, "DontSendDenyPacket", 1);
+ db_set_b(ccs->hContact, protocolname, "DontSendDenyPacket", 1);
CallService(MS_DB_CONTACT_DELETE, (WPARAM) ccs->hContact, 0);
}
}
@@ -3333,7 +3279,7 @@ void CreateGroup(char*grpn,char*field) {
DBVARIANT dbv;
char* grp[255];
- int val=DBGetContactSettingByte(NULL,protocolname,field,0);
+ int val=db_get_b(NULL,protocolname,field,0);
if(val==0)
{
@@ -3344,16 +3290,16 @@ void CreateGroup(char*grpn,char*field) {
char temp[255];
DBVARIANT dbv;
sprintf_s(temp,255,"%d",val-1);
- DBGetContactSettingString(NULL,"CListGroups",temp,&dbv);
+ db_get_s(NULL,"CListGroups",temp,&dbv);
if(dbv.pszVal!=NULL)
{
sprintf_s((char*)grp,255,"%s\\%s",&dbv.pszVal[1],(char*)grpn);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else //gruppe existiert nciht mehr, auf root alles legen
{
strcpy_s((char*)grp,255,grpn);
- DBWriteContactSettingByte(NULL,protocolname,field,0);
+ db_set_b(NULL,protocolname,field,0);
}
}
@@ -3364,22 +3310,22 @@ void CreateGroup(char*grpn,char*field) {
for (i = 0;; i++)
{
sprintf(temp,"%d",i);
- if (DBGetContactSettingString(NULL, "CListGroups", temp, &dbv))
+ if (db_get_s(NULL, "CListGroups", temp, &dbv))
{
i--;
break;
}
if (dbv.pszVal[0] != '\0' && !lstrcmp(dbv.pszVal + 1, (char*)grp)) {
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
strcpy_s(group,255,"D");
strcat_s(group,255,(char*)grp);
group[0]= 1 | GROUPF_EXPANDED;
sprintf(temp,"%d",i+1);
- DBWriteContactSettingString(NULL, "CListGroups", temp, group);
+ db_set_s(NULL, "CListGroups", temp, group);
CallServiceSync(MS_CLUI_GROUPADDED, i + 1, 0);
}
@@ -3392,7 +3338,7 @@ INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam) {
{
strcpy(statusmessage[0],"");
}
- else if((wParam!=ID_STATUS_ONLINE&&wParam!=ID_STATUS_OFFLINE)/*&&DBGetContactSettingByte(NULL,protocolname,"nocustomaway",0)==0*/)
+ else if((wParam!=ID_STATUS_ONLINE&&wParam!=ID_STATUS_OFFLINE)/*&&db_get_b(NULL,protocolname,"nocustomaway",0)==0*/)
{
strcpy(statusmessage[1],"(AFK) Away from Keyboard");
}
@@ -3403,7 +3349,7 @@ INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam) {
{
strcpy(statusmessage[0],( char* )lParam);
}
- else if((wParam!=ID_STATUS_ONLINE&&wParam!=ID_STATUS_OFFLINE)&&DBGetContactSettingByte(NULL,protocolname,"nocustomaway",0)==0&&strlen(( char* )lParam)>0)
+ else if((wParam!=ID_STATUS_ONLINE&&wParam!=ID_STATUS_OFFLINE)&&db_get_b(NULL,protocolname,"nocustomaway",0)==0&&strlen(( char* )lParam)>0)
{
sprintf(statusmessage[1], "(AFK) %s", (char*)lParam);
//strcpy(statusmessage[1],( char* )lParam);
@@ -3451,7 +3397,7 @@ INT_PTR SetNickName(WPARAM newnick, LPARAM lparam)
if(myClient->client->connected)
{
myClient->setNick((char*)newnick);
- DBWriteContactSettingString(NULL,protocolname,"Nick",(char*)newnick);
+ db_set_s(NULL,protocolname,"Nick",(char*)newnick);
return TRUE;
}
return FALSE;
@@ -3483,25 +3429,27 @@ INT_PTR GetAwayMsg(WPARAM /*wParam*/, LPARAM lParam)
return 1;
}
-int ContactDeleted(WPARAM wParam,LPARAM lParam) {
- if(!DBGetContactSettingByte((HANDLE)wParam, protocolname, "DontSendDenyPacket", 0))
- if(DBGetContactSettingByte((HANDLE)wParam,"CList","NotOnList",0))
+int ContactDeleted(WPARAM wParam,LPARAM lParam)
+{
+ if(!db_get_b((HANDLE)wParam, protocolname, "DontSendDenyPacket", 0))
+ if(db_get_b((HANDLE)wParam,"CList","NotOnList",0))
+ {
+ if(myClient!=NULL)
+ if(myClient->client->connected)
{
- if(myClient!=NULL)
- if(myClient->client->connected)
- {
- DBVARIANT dbv2;
- if(!DBGetContactSetting((HANDLE)wParam,protocolname,"Username",&dbv2)) {
- SendDenyInvitationPacket deny;
- deny.name = dbv2.pszVal;
- myClient->client->send( &deny );
- }
- }
- }
- return 0;
+ DBVARIANT dbv2;
+ if(!db_get((HANDLE)wParam,protocolname,"Username",&dbv2)) {
+ SendDenyInvitationPacket deny;
+ deny.name = dbv2.pszVal;
+ myClient->client->send( &deny );
+ }
+ }
+ }
+ return 0;
}
-INT_PTR StartGame(WPARAM wParam,LPARAM lParam,LPARAM fParam) {
+INT_PTR StartGame(WPARAM wParam,LPARAM lParam,LPARAM fParam)
+{
//gamelist blocken
xgamelist.Block(TRUE);
@@ -3522,7 +3470,7 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam) {
char temp[256];
DBVARIANT dbv;
- if(!DBGetContactSettingString((HANDLE)wParam, protocolname, "Username",&dbv))
+ if(!db_get_s((HANDLE)wParam, protocolname, "Username",&dbv))
{
sprintf(temp,Translate("Do you really want delete your friend %s?"),dbv.pszVal);
if(MessageBoxA(NULL,temp,Translate("Confirm Delete"),MB_YESNO|MB_ICONQUESTION)==IDYES)
@@ -3533,7 +3481,7 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam) {
{
SendRemoveBuddyPacket removeBuddy;
- removeBuddy.userid=DBGetContactSettingDword((HANDLE)wParam,protocolname,"UserId",0);
+ removeBuddy.userid=db_get_dw((HANDLE)wParam,protocolname,"UserId",0);
if(removeBuddy.userid!=0)
{
@@ -3542,7 +3490,7 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam) {
}
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -3550,7 +3498,7 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam) {
INT_PTR BlockFriend(WPARAM wParam,LPARAM lParam) {
DBVARIANT dbv;
- if(!DBGetContactSettingString((HANDLE)wParam, protocolname, "Username",&dbv))
+ if(!db_get_s((HANDLE)wParam, protocolname, "Username",&dbv))
{
if(MessageBoxA(NULL,Translate("Block this user from ever contacting you again?"),Translate("Block Confirmation"),MB_YESNO|MB_ICONQUESTION)==IDYES)
{
@@ -3558,7 +3506,7 @@ INT_PTR BlockFriend(WPARAM wParam,LPARAM lParam) {
{
if(myClient->client->connected)
{
- DBWriteContactSettingByte(NULL,"XFireBlock",dbv.pszVal,1);
+ db_set_b(NULL,"XFireBlock",dbv.pszVal,1);
SendDenyInvitationPacket deny;
deny.name = dbv.pszVal;
@@ -3567,7 +3515,7 @@ INT_PTR BlockFriend(WPARAM wParam,LPARAM lParam) {
}
}
CallService( MS_DB_CONTACT_DELETE, (WPARAM) wParam, 1 );
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -3577,7 +3525,7 @@ INT_PTR StartThisGame(WPARAM wParam,LPARAM lParam) {
xgamelist.Block(TRUE);
//hole die gameid des spiels
- int id=DBGetContactSettingWord((HANDLE)wParam, protocolname, "GameId",0);
+ int id=db_get_w((HANDLE)wParam, protocolname, "GameId",0);
//hole passendes spielobjekt
Xfire_game*game=xgamelist.getGamebyGameid(id);
@@ -3597,7 +3545,7 @@ INT_PTR JoinGame(WPARAM wParam,LPARAM lParam) {
xgamelist.Block(TRUE);
//hole die gameid des spiels
- int id=DBGetContactSettingWord((HANDLE)wParam, protocolname, "GameId",0);
+ int id=db_get_w((HANDLE)wParam, protocolname, "GameId",0);
//hole passendes spielobjekt
Xfire_game*game=xgamelist.getGamebyGameid(id);
@@ -3606,12 +3554,12 @@ INT_PTR JoinGame(WPARAM wParam,LPARAM lParam) {
if(game)
{
DBVARIANT dbv; //dbv.pszVal
- int port=DBGetContactSettingWord((HANDLE)wParam, protocolname, "Port",0);
- if(!DBGetContactSettingString((HANDLE)wParam, protocolname, "ServerIP",&dbv))
+ int port=db_get_w((HANDLE)wParam, protocolname, "Port",0);
+ if(!db_get_s((HANDLE)wParam, protocolname, "ServerIP",&dbv))
{
//starte spiel mit netzwerk parametern
game->start_game(dbv.pszVal,port);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -3627,12 +3575,12 @@ int doneQuery( WPARAM wParam, LPARAM lParam ) {
char temp[256];
BuddyListEntry* bud=(BuddyListEntry*)wParam;
gServerstats* gameinfo = (gServerstats*)lParam;
- DBWriteContactSettingString(bud->hcontact, protocolname, "ServerName", gameinfo->name);
- DBWriteContactSettingString(bud->hcontact, protocolname, "GameType", gameinfo->gametype);
- DBWriteContactSettingString(bud->hcontact, protocolname, "Map", gameinfo->map);
+ db_set_s(bud->hcontact, protocolname, "ServerName", gameinfo->name);
+ db_set_s(bud->hcontact, protocolname, "GameType", gameinfo->gametype);
+ db_set_s(bud->hcontact, protocolname, "Map", gameinfo->map);
sprintf(temp,"(%d/%d)",gameinfo->players,gameinfo->maxplayers);
- DBWriteContactSettingString(bud->hcontact, protocolname, "Players", temp);
- DBWriteContactSettingByte(bud->hcontact, protocolname, "Passworded", gameinfo->password);
+ db_set_s(bud->hcontact, protocolname, "Players", temp);
+ db_set_b(bud->hcontact, protocolname, "Passworded", gameinfo->password);
if(myClient!=NULL)
handlingBuddys(bud,0,NULL,TRUE);
@@ -3668,18 +3616,18 @@ int IconLibChanged(WPARAM wParam, LPARAM lParam) {
INT_PTR GetAvatarInfo(WPARAM wParam, LPARAM lParam) {
PROTO_AVATAR_INFORMATION* pai = (PROTO_AVATAR_INFORMATION*)lParam;
- if(DBGetContactSettingByte(NULL,protocolname,"noavatars",-1)!=0)
+ if(db_get_b(NULL,protocolname,"noavatars",-1)!=0)
return GAIR_NOAVATAR;
- pai->format=DBGetContactSettingWord(pai->hContact,"ContactPhoto","Format",0);
+ pai->format=db_get_w(pai->hContact,"ContactPhoto","Format",0);
if(pai->format==0)
return GAIR_NOAVATAR;
DBVARIANT dbv;
- if(!DBGetContactSetting(pai->hContact,"ContactPhoto","File",&dbv))
+ if(!db_get(pai->hContact,"ContactPhoto","File",&dbv))
{
strcpy(pai->filename,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
return GAIR_NOAVATAR;
diff --git a/protocols/Xfire/src/options.cpp b/protocols/Xfire/src/options.cpp
index e5e9b1ee2e..f252282e40 100644
--- a/protocols/Xfire/src/options.cpp
+++ b/protocols/Xfire/src/options.cpp
@@ -169,30 +169,30 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
else
dllfound = FALSE;
- if(!DBGetContactSetting(NULL,protocolname,"login",&dbv)) {
+ if(!db_get(NULL,protocolname,"login",&dbv)) {
SetDlgItemText(hwndDlg,IDC_LOGIN,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if(!DBGetContactSetting(NULL,protocolname,"Nick",&dbv)) {
+ if(!db_get(NULL,protocolname,"Nick",&dbv)) {
SetDlgItemText(hwndDlg,IDC_NICK,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if(!DBGetContactSetting(NULL,protocolname,"password",&dbv)) {
+ if(!db_get(NULL,protocolname,"password",&dbv)) {
//bit of a security hole here, since it's easy to extract a password from an edit box
CallService(MS_DB_CRYPT_DECODESTRING,strlen(dbv.pszVal)+1,(LPARAM)dbv.pszVal);
SetDlgItemText(hwndDlg,IDC_PASSWORD,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
char temp[255]="";
- sprintf(temp,"%d",DBGetContactSettingByte(NULL,protocolname,"protover",0x5b));
+ sprintf(temp,"%d",db_get_b(NULL,protocolname,"protover",0x5b));
SetDlgItemText(hwndDlg,IDC_PVER,temp);
EnableWindow(GetDlgItem(hwndDlg,IDC_LASTGAME),FALSE);
- if(!DBGetContactSetting(NULL,protocolname,"LastGame",&dbv)) {
+ if(!db_get(NULL,protocolname,"LastGame",&dbv)) {
SetDlgItemText(hwndDlg,IDC_LASTGAME,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if(bpStatus==ID_STATUS_OFFLINE&&bpStatus!=ID_STATUS_CONNECTING) {
@@ -267,9 +267,9 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
GetDlgItemText(hwndDlg,IDC_LOGIN,login,sizeof(login));
dbv.pszVal=NULL;
- if(DBGetContactSetting(NULL,protocolname,"login",&dbv) || strcmp(login,dbv.pszVal))
+ if(db_get(NULL,protocolname,"login",&dbv) || strcmp(login,dbv.pszVal))
reconnectRequired=1;
- if(dbv.pszVal!=NULL) DBFreeVariant(&dbv);
+ if(dbv.pszVal!=NULL) db_free(&dbv);
//den login lowercasen
int size=strlen(login);
@@ -285,26 +285,26 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SetDlgItemText(hwndDlg,IDC_LOGIN,login);
}
- DBWriteContactSettingString(NULL,protocolname,"login",login);
- DBWriteContactSettingString(NULL,protocolname,"Username",login);
+ db_set_s(NULL,protocolname,"login",login);
+ db_set_s(NULL,protocolname,"Username",login);
//nur wenn der nick erfolgreich übertragen wurde
GetDlgItemText(hwndDlg,IDC_NICK,login,sizeof(login));
dbv.pszVal=NULL;
- if(DBGetContactSetting(NULL,protocolname,"Nick",&dbv) || strcmp(login,dbv.pszVal))
+ if(db_get(NULL,protocolname,"Nick",&dbv) || strcmp(login,dbv.pszVal))
{
if(CallService(XFIRE_SET_NICK,0,(WPARAM)login))
- DBWriteContactSettingString(NULL,protocolname,"Nick",login);
+ db_set_s(NULL,protocolname,"Nick",login);
}
- if(dbv.pszVal!=NULL) DBFreeVariant(&dbv);
+ if(dbv.pszVal!=NULL) db_free(&dbv);
GetDlgItemText(hwndDlg,IDC_PASSWORD,str,sizeof(str));
CallService(MS_DB_CRYPT_ENCODESTRING,sizeof(str),(LPARAM)str);
dbv.pszVal=NULL;
- if(DBGetContactSetting(NULL,protocolname,"password",&dbv) || strcmp(str,dbv.pszVal))
+ if(db_get(NULL,protocolname,"password",&dbv) || strcmp(str,dbv.pszVal))
reconnectRequired=1;
- if(dbv.pszVal!=NULL) DBFreeVariant(&dbv);
- DBWriteContactSettingString(NULL,protocolname,"password",str);
+ if(dbv.pszVal!=NULL) db_free(&dbv);
+ db_set_s(NULL,protocolname,"password",str);
GetDlgItemText(hwndDlg,IDC_SERVER,str,sizeof(str));
//neue preferencen sichern
@@ -315,7 +315,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
if(!(BYTE)IsDlgButtonChecked(hwndDlg, xfireconfigitems[i].id))
{
- DBWriteContactSettingByte(NULL,protocolname,xfireconfigitems[i].dbentry,0);
+ db_set_b(NULL,protocolname,xfireconfigitems[i].dbentry,0);
xfireconfig[xfireconfigitems[i].xfireconfigid].wasset=1;
xfireconfig[xfireconfigitems[i].xfireconfigid].data[0]=1;
xfireconfig[xfireconfigitems[i].xfireconfigid].data[1]=1;
@@ -325,7 +325,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
else
{
xfireconfig[xfireconfigitems[i].xfireconfigid].wasset=0;
- DBWriteContactSettingByte(NULL,protocolname,xfireconfigitems[i].dbentry,1);
+ db_set_b(NULL,protocolname,xfireconfigitems[i].dbentry,1);
}
}
CallService(XFIRE_SEND_PREFS,0,0);
@@ -333,7 +333,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
//protocolversion wird autoamtisch vergeben
//GetDlgItemText(hwndDlg,IDC_PVER,str,sizeof(str));
- //DBWriteContactSettingByte(NULL,protocolname,"protover",(char)atoi(str));
+ //db_set_b(NULL,protocolname,"protover",(char)atoi(str));
if(reconnectRequired) MessageBox(hwndDlg,Translate("The changes you have made require you to reconnect to the XFire network before they take effect"),Translate("XFire Options"),MB_OK|MB_ICONINFORMATION);
return TRUE;
@@ -375,9 +375,9 @@ static INT_PTR CALLBACK DlgProcOpts3(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SendDlgItemMessage( hwndDlg, IDC_SCANUPDATECB, CB_ADDSTRING, 0, (LPARAM)TranslateT("On every start" ));
SendDlgItemMessage( hwndDlg, IDC_SCANUPDATECB, CB_ADDSTRING, 0, (LPARAM)TranslateT("Daily" ));
- SendDlgItemMessage( hwndDlg, IDC_SCANUPDATECB, CB_SETCURSEL, DBGetContactSettingByte(NULL,protocolname,"scanalways",0), 0);
+ SendDlgItemMessage( hwndDlg, IDC_SCANUPDATECB, CB_SETCURSEL, db_get_b(NULL,protocolname,"scanalways",0), 0);
- SendDlgItemMessage( hwndDlg, IDC_NOMSG, CB_SETCURSEL, nomsgboxsel[DBGetContactSettingByte(NULL,protocolname,"nomsgbox",0)], 0);
+ SendDlgItemMessage( hwndDlg, IDC_NOMSG, CB_SETCURSEL, nomsgboxsel[db_get_b(NULL,protocolname,"nomsgbox",0)], 0);
/* Gruppen raussuchen */
{
@@ -389,7 +389,7 @@ static INT_PTR CALLBACK DlgProcOpts3(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SendDlgItemMessage( hwndDlg, IDC_FOFGROUP, CB_ADDSTRING, 0, (LPARAM)TranslateT("<Root Group>" ));
sprintf_s(temp,8,"%d",gruppen_id);
- while(!DBGetContactSettingString(NULL,"CListGroups",temp,&dbv))
+ while(!db_get_s(NULL,"CListGroups",temp,&dbv))
{
gruppen_id++;
sprintf_s(temp,8,"%d",gruppen_id);
@@ -397,11 +397,11 @@ static INT_PTR CALLBACK DlgProcOpts3(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if(dbv.pszVal!=NULL) {
SendDlgItemMessage( hwndDlg, IDC_CLANGROUP, CB_ADDSTRING, 0, (LPARAM)&dbv.pszVal[1]);
SendDlgItemMessage( hwndDlg, IDC_FOFGROUP, CB_ADDSTRING, 0, (LPARAM)&dbv.pszVal[1]);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
- SendDlgItemMessage( hwndDlg, IDC_CLANGROUP, CB_SETCURSEL, DBGetContactSettingByte(NULL,protocolname,"mainclangroup",0), 0);
- SendDlgItemMessage( hwndDlg, IDC_FOFGROUP, CB_SETCURSEL, DBGetContactSettingByte(NULL,protocolname,"fofgroup",0), 0);
+ SendDlgItemMessage( hwndDlg, IDC_CLANGROUP, CB_SETCURSEL, db_get_b(NULL,protocolname,"mainclangroup",0), 0);
+ SendDlgItemMessage( hwndDlg, IDC_FOFGROUP, CB_SETCURSEL, db_get_b(NULL,protocolname,"fofgroup",0), 0);
}
@@ -445,7 +445,7 @@ static INT_PTR CALLBACK DlgProcOpts3(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
else
{
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
- tvis.item.state = INDEXTOSTATEIMAGEMASK(DBGetContactSettingByte(NULL,protocolname,mytree[i].dbentry,0)==1?2:1);
+ tvis.item.state = INDEXTOSTATEIMAGEMASK(db_get_b(NULL,protocolname,mytree[i].dbentry,0)==1?2:1);
tvis.item.lParam = 0;
tvis.item.pszText = Translate(mytree[i].name);
mytree[i].hitem=TreeView_InsertItem( hwndTree, &tvis );
@@ -542,24 +542,24 @@ static INT_PTR CALLBACK DlgProcOpts3(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
TreeView_GetItem(hwndTree, &tvic);
if ((( tvic.state & TVIS_STATEIMAGEMASK ) >> 12 == 2 ))
- DBWriteContactSettingByte(NULL,protocolname,mytree[i].dbentry,1);
+ db_set_b(NULL,protocolname,mytree[i].dbentry,1);
else
- DBWriteContactSettingByte(NULL,protocolname,mytree[i].dbentry,0);
+ db_set_b(NULL,protocolname,mytree[i].dbentry,0);
}
}
- DBWriteContactSettingByte(NULL,protocolname,"nomsgbox",(BYTE)nomsgboxsel[SendDlgItemMessage(hwndDlg, IDC_NOMSG, CB_GETCURSEL, 0, 0)]);
+ db_set_b(NULL,protocolname,"nomsgbox",(BYTE)nomsgboxsel[SendDlgItemMessage(hwndDlg, IDC_NOMSG, CB_GETCURSEL, 0, 0)]);
ccc=SendDlgItemMessage(hwndDlg, IDC_CLANGROUP, CB_GETCURSEL, 0, 0);
- DBWriteContactSettingByte(NULL,protocolname,"mainclangroup",(BYTE)ccc);
+ db_set_b(NULL,protocolname,"mainclangroup",(BYTE)ccc);
ccc=SendDlgItemMessage(hwndDlg, IDC_FOFGROUP, CB_GETCURSEL, 0, 0);
- DBWriteContactSettingByte(NULL,protocolname,"fofgroup",(BYTE)ccc);
+ db_set_b(NULL,protocolname,"fofgroup",(BYTE)ccc);
ccc=SendDlgItemMessage(hwndDlg, IDC_SCANUPDATECB, CB_GETCURSEL, 0, 0);
- DBWriteContactSettingByte(NULL,protocolname,"scanalways",(BYTE)ccc);
+ db_set_b(NULL,protocolname,"scanalways",(BYTE)ccc);
//protocolversion wird autoamtisch vergeben
//GetDlgItemText(hwndDlg,IDC_PVER,str,sizeof(str));
- //DBWriteContactSettingByte(NULL,protocolname,"protover",(char)atoi(str));
+ //db_set_b(NULL,protocolname,"protover",(char)atoi(str));
if(reconnectRequired) MessageBox(hwndDlg,Translate("The changes you have made require you to reconnect to the XFire network before they take effect"),Translate("XFire Options"),MB_OK|MB_ICONINFORMATION);
return TRUE;
@@ -651,7 +651,7 @@ static INT_PTR CALLBACK DlgProcOpts4(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
SendDlgItemMessage(hwndDlg, IDC_BLOCKUSER, LB_GETTEXT, sel, (LPARAM)temp);
SendDlgItemMessage(hwndDlg, IDC_BLOCKUSER, LB_DELETESTRING, sel, 0);
- DBDeleteContactSetting(NULL,"XFireBlock",temp);
+ db_unset(NULL,"XFireBlock",temp);
if(SendDlgItemMessage(hwndDlg, IDC_BLOCKUSER, LB_GETCOUNT, 0, 0)==0)
EnableDlgItem(hwndDlg, IDC_REMUSER, FALSE);
}
@@ -689,12 +689,12 @@ static INT_PTR CALLBACK DlgProcOpts5(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg,IDC_ENABLESTSMSG,DBGetContactSettingByte(NULL,protocolname,"autosetstatusmsg",0));
- CheckDlgButton(hwndDlg,IDC_CHGSTATUS,DBGetContactSettingByte(NULL,protocolname,"statuschgtype",0));
- CheckDlgButton(hwndDlg,IDC_DNDFIRST,DBGetContactSettingByte(NULL,protocolname,"dndfirst",0));
- if(!DBGetContactSetting(NULL,protocolname,"setstatusmsg",&dbv)) {
+ CheckDlgButton(hwndDlg,IDC_ENABLESTSMSG,db_get_b(NULL,protocolname,"autosetstatusmsg",0));
+ CheckDlgButton(hwndDlg,IDC_CHGSTATUS,db_get_b(NULL,protocolname,"statuschgtype",0));
+ CheckDlgButton(hwndDlg,IDC_DNDFIRST,db_get_b(NULL,protocolname,"dndfirst",0));
+ if(!db_get(NULL,protocolname,"setstatusmsg",&dbv)) {
SetDlgItemText(hwndDlg,IDC_STATUSMSG,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if(!IsDlgButtonChecked(hwndDlg, IDC_ENABLESTSMSG))
{
@@ -740,11 +740,11 @@ static INT_PTR CALLBACK DlgProcOpts5(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
char str[512];
GetDlgItemText(hwndDlg,IDC_STATUSMSG,str,sizeof(str));
- DBWriteContactSettingString(NULL,protocolname,"setstatusmsg",str);
+ db_set_s(NULL,protocolname,"setstatusmsg",str);
- DBWriteContactSettingByte(NULL,protocolname, "autosetstatusmsg", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ENABLESTSMSG));
- DBWriteContactSettingByte(NULL,protocolname, "statuschgtype", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHGSTATUS));
- DBWriteContactSettingByte(NULL,protocolname, "dndfirst", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DNDFIRST));
+ db_set_b(NULL,protocolname, "autosetstatusmsg", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ENABLESTSMSG));
+ db_set_b(NULL,protocolname, "statuschgtype", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHGSTATUS));
+ db_set_b(NULL,protocolname, "dndfirst", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DNDFIRST));
return TRUE;
}
@@ -786,13 +786,13 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
//spielliste leeren
SendDlgItemMessage( (HWND)hwndDlg, IDC_LGAMELIST, LB_RESETCONTENT, 0, 0);
//spiele auslesen und in die liste einfügen
- int found=DBGetContactSettingWord(NULL,protocolname,"foundgames",0);
+ int found=db_get_w(NULL,protocolname,"foundgames",0);
char temp[XFIRE_MAXSIZEOFGAMENAME];
for(int i=0;i<found;i++)
{
//id auslesen
sprintf_s(temp,XFIRE_MAXSIZEOFGAMENAME,"gameid_%d",i);
- int gameid=DBGetContactSettingWord(NULL,protocolname,temp,0);
+ int gameid=db_get_w(NULL,protocolname,temp,0);
//spielnamen auslesen
xgamelist.getGamename(gameid,temp,XFIRE_MAXSIZEOFGAMENAME);
//eintrag einfügen
@@ -1001,11 +1001,11 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
//gameskip wert setzen
char temp[64]="";
sprintf_s(temp,64,"gameskip_%d",gameid);
- CheckDlgButton(hwndDlg,IDC_DONTDETECT,DBGetContactSettingByte(NULL,protocolname,temp,0));
+ CheckDlgButton(hwndDlg,IDC_DONTDETECT,db_get_b(NULL,protocolname,temp,0));
sprintf_s(temp,64,"gamenostatus_%d",gameid);
- CheckDlgButton(hwndDlg,IDC_NOSTATUSMSG,DBGetContactSettingByte(NULL,protocolname,temp,0));
+ CheckDlgButton(hwndDlg,IDC_NOSTATUSMSG,db_get_b(NULL,protocolname,temp,0));
sprintf_s(temp,64,"notinstartmenu_%d",gameid);
- CheckDlgButton(hwndDlg,IDC_NOTINSTARTMENU,DBGetContactSettingByte(NULL,protocolname,temp,0));
+ CheckDlgButton(hwndDlg,IDC_NOTINSTARTMENU,db_get_b(NULL,protocolname,temp,0));
//extra parameter auslesen, aber nur, wenn das spiel auch sowas unterstützt
if(xgtemp && xgtemp->haveExtraGameArgs())
@@ -1013,10 +1013,10 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
EnableDlgItem(hwndDlg, IDC_EXTRAPARAMS, TRUE);
sprintf_s(temp,64,"gameextraparams_%d",gameid);
DBVARIANT dbv;
- if(!DBGetContactSetting(NULL,protocolname,temp,&dbv))
+ if(!db_get(NULL,protocolname,temp,&dbv))
{
SetDlgItemText(hwndDlg,IDC_EXTRAPARAMS,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
SetDlgItemText(hwndDlg,IDC_EXTRAPARAMS,"");
diff --git a/protocols/Xfire/src/processbuddyinfo.cpp b/protocols/Xfire/src/processbuddyinfo.cpp
index 38f195b127..32ac9d9808 100644
--- a/protocols/Xfire/src/processbuddyinfo.cpp
+++ b/protocols/Xfire/src/processbuddyinfo.cpp
@@ -5,10 +5,10 @@
/*
-DBWriteContactSettingString(xsa->hContact, "ContactPhoto", "Backup", av.backup);
-DBWriteContactSettingString(xsa->hContact, "ContactPhoto", "File", av.file);
-DBWriteContactSettingString(xsa->hContact, "ContactPhoto", "RFile", av.rfile);
-DBWriteContactSettingWord(xsa->hContact, "ContactPhoto", "Format", av.type);
+db_set_s(xsa->hContact, "ContactPhoto", "Backup", av.backup);
+db_set_s(xsa->hContact, "ContactPhoto", "File", av.file);
+db_set_s(xsa->hContact, "ContactPhoto", "RFile", av.rfile);
+db_set_w(xsa->hContact, "ContactPhoto", "Format", av.type);
*/
extern HANDLE XFireAvatarFolder;
@@ -36,18 +36,18 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo,HANDLE hcontact,char*
//versuche doppeltes laden zuvermeiden
if(hcontact) //avatar von freunden
{
- if(DBGetContactSettingDword(hcontact, "ContactPhoto", "XFireAvatarId", 0)==buddyinfo->avatarid &&
- DBGetContactSettingByte(hcontact, "ContactPhoto", "XFireAvatarMode", 0)==buddyinfo->avatarmode)
+ if(db_get_dw(hcontact, "ContactPhoto", "XFireAvatarId", 0)==buddyinfo->avatarid &&
+ db_get_b(hcontact, "ContactPhoto", "XFireAvatarMode", 0)==buddyinfo->avatarmode)
return;
}
else //eigeneder avatar
{
- if(DBGetContactSettingDword(hcontact, protocolname, "XFireAvatarId", 0)==buddyinfo->avatarid &&
- DBGetContactSettingByte(hcontact, protocolname, "XFireAvatarMode", 0)==buddyinfo->avatarmode)
+ if(db_get_dw(hcontact, protocolname, "XFireAvatarId", 0)==buddyinfo->avatarid &&
+ db_get_b(hcontact, protocolname, "XFireAvatarMode", 0)==buddyinfo->avatarmode)
return;
//alten dateipfad des avatars löschen, wenn sichw as geändert hat
- DBDeleteContactSetting(NULL,protocolname, "MyAvatarFile");
+ db_unset(NULL,protocolname, "MyAvatarFile");
}
strcpy(filename, XFireGetFoldersPath ("Avatar"));
@@ -88,8 +88,8 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo,HANDLE hcontact,char*
{
if(hcontact) //buddyavatar setzen
{
- DBWriteContactSettingDword(hcontact, "ContactPhoto", "XFireAvatarId", buddyinfo->avatarid);
- DBWriteContactSettingByte(hcontact, "ContactPhoto", "XFireAvatarMode", buddyinfo->avatarmode);
+ db_set_dw(hcontact, "ContactPhoto", "XFireAvatarId", buddyinfo->avatarid);
+ db_set_b(hcontact, "ContactPhoto", "XFireAvatarMode", buddyinfo->avatarmode);
PROTO_AVATAR_INFORMATION AI;
AI.cbSize = sizeof(AI);
AI.format = type;
@@ -99,10 +99,10 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo,HANDLE hcontact,char*
}
else //eigenen avatar setzen
{
- DBWriteContactSettingDword(NULL, protocolname, "XFireAvatarId", buddyinfo->avatarid);
- DBWriteContactSettingByte(NULL, protocolname, "XFireAvatarMode", buddyinfo->avatarmode);
+ db_set_dw(NULL, protocolname, "XFireAvatarId", buddyinfo->avatarid);
+ db_set_b(NULL, protocolname, "XFireAvatarMode", buddyinfo->avatarmode);
//neuen avatarfilepath eintragen
- DBWriteContactSettingString(NULL,protocolname, "MyAvatarFile",filename);
+ db_set_s(NULL,protocolname, "MyAvatarFile",filename);
//beshceid geben, avatar hat sich geändert
CallService(MS_AV_REPORTMYAVATARCHANGED,(WPARAM)protocolname,0);
}
diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp
index e7d1137c30..509dc28d0a 100644
--- a/protocols/Xfire/src/searching4games.cpp
+++ b/protocols/Xfire/src/searching4games.cpp
@@ -174,18 +174,18 @@ void Scan4Games( LPVOID lparam )
xgamelist.clearGamelist();
//prüfe ob schon gescannt wurde, dann das aus der db nehmen, beschleunigt den start
- foundgames=DBGetContactSettingWord(NULL, protocolname, "foundgames",-1);
+ foundgames=db_get_w(NULL, protocolname, "foundgames",-1);
//um bei einer neuen version einen rescan zuforcen, bei bestimmten wert found auf 0 resetten
- if(DBGetContactSettingWord(NULL, protocolname, "scanver",0)!=XFIRE_SCAN_VAL)
+ if(db_get_w(NULL, protocolname, "scanver",0)!=XFIRE_SCAN_VAL)
foundgames=-1;
BOOL loadgamesfromdb=FALSE;
- if(DBGetContactSettingByte(NULL,protocolname,"scanalways",0)==0)
+ if(db_get_b(NULL,protocolname,"scanalways",0)==0)
loadgamesfromdb=TRUE;
else
{
- if(DBGetContactSettingByte(NULL,protocolname,"scanalways",0)==2)
+ if(db_get_b(NULL,protocolname,"scanalways",0)==2)
{
time_t zeit;
struct tm *t;
@@ -194,9 +194,9 @@ void Scan4Games( LPVOID lparam )
if(t!=NULL)
{
- if(t->tm_yday!=DBGetContactSettingWord(NULL,protocolname,"scanalways_t",0))
+ if(t->tm_yday!=db_get_w(NULL,protocolname,"scanalways_t",0))
{
- DBWriteContactSettingWord(NULL,protocolname,"scanalways_t",t->tm_yday);
+ db_set_w(NULL,protocolname,"scanalways_t",t->tm_yday);
}
else
loadgamesfromdb=TRUE;
@@ -238,7 +238,7 @@ void Scan4Games( LPVOID lparam )
HWND hwnd=NULL;
//suche dialog anzeigen
- if(!DBGetContactSettingByte(NULL,protocolname,"dontdissstatus",0))
+ if(!db_get_b(NULL,protocolname,"dontdissstatus",0))
{
mir_forkthread(ShowSearchDialog,&hwnd);
}
@@ -717,11 +717,11 @@ void Scan4Games( LPVOID lparam )
xgamelist.writeDatabase();
//scanversion setzen, um ungewollten rescan zu vermeiden
- DBWriteContactSettingWord(NULL, protocolname, "scanver", XFIRE_SCAN_VAL);
+ db_set_w(NULL, protocolname, "scanver", XFIRE_SCAN_VAL);
EndDialog(hwnd,0);
- if(!DBGetContactSettingByte(NULL,protocolname,"dontdisresults",0))
+ if(!db_get_b(NULL,protocolname,"dontdisresults",0))
{
int p=strlen(gamelist)-2;
if(p>-1)
diff --git a/protocols/Xfire/src/services.cpp b/protocols/Xfire/src/services.cpp
index 54059eef17..e6147b6009 100644
--- a/protocols/Xfire/src/services.cpp
+++ b/protocols/Xfire/src/services.cpp
@@ -1,21 +1,21 @@
/*
* Plugin of miranda IM(ICQ) for Communicating with users of the XFire Network.
*
- * Copyright (C) 2010 by
- * dufte <dufte@justmail.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * Copyright (C) 2010 by
+ * dufte <dufte@justmail.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Based on J. Lawler - BaseProtocol
@@ -34,17 +34,17 @@ BOOL IsContactMySelf(std::string buddyusername) {
DBVARIANT dbv;
//nur wenn option aktiv, sonst immer FALSE
- if(!DBGetContactSettingByte(NULL,protocolname,"skipmyself",0))
+ if(!db_get_b(NULL,protocolname,"skipmyself",0))
return FALSE;
- if(!DBGetContactSetting(NULL,protocolname,"login",&dbv))
+ if(!db_get(NULL,protocolname,"login",&dbv))
{
if(!lstrcmpiA( dbv.pszVal, buddyusername.c_str() ))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return TRUE;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
return FALSE;
@@ -56,10 +56,10 @@ BOOL IsContactMySelf(std::string buddyusername) {
INT_PTR GetMyAvatar(WPARAM wparam,LPARAM lparam) {
DBVARIANT dbv;
- if(!DBGetContactSetting(NULL,protocolname,"MyAvatarFile",&dbv))
+ if(!db_get(NULL,protocolname,"MyAvatarFile",&dbv))
{
strncpy((char*)wparam, dbv.pszVal, (int)lparam);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
diff --git a/protocols/Xfire/src/setnickname.cpp b/protocols/Xfire/src/setnickname.cpp
index f2e1863970..c6908755d6 100644
--- a/protocols/Xfire/src/setnickname.cpp
+++ b/protocols/Xfire/src/setnickname.cpp
@@ -13,9 +13,9 @@ INT_PTR CALLBACK DlgNickProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
SendMessage(hwndDlg,WM_SETICON, (WPARAM)false, (LPARAM)LoadIcon(hinstance, MAKEINTRESOURCE(IDI_TM)));
DBVARIANT dbv;
- if(!DBGetContactSetting(NULL,protocolname,"Nick",&dbv)) {
+ if(!db_get(NULL,protocolname,"Nick",&dbv)) {
SetDlgItemText(hwndDlg,IDC_NICKNAME,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return TRUE;
}
diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp
index 8d16127d26..9dff6e4d61 100644
--- a/protocols/Xfire/src/tools.cpp
+++ b/protocols/Xfire/src/tools.cpp
@@ -157,7 +157,7 @@ char*menuitemtext(char*mtext)
void Message(LPVOID msg)
{
- switch(DBGetContactSettingByte(NULL,protocolname,"nomsgbox",0))
+ switch(db_get_b(NULL,protocolname,"nomsgbox",0))
{
case 1:
return;
@@ -184,7 +184,7 @@ void Message(LPVOID msg)
void MessageE(LPVOID msg)
{
static BOOL already=FALSE;
- switch(DBGetContactSettingByte(NULL,protocolname,"nomsgbox",0))
+ switch(db_get_b(NULL,protocolname,"nomsgbox",0))
{
case 0:
if(!already)
diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp
index 13b7548d75..e571dedc6a 100644
--- a/protocols/Xfire/src/userdetails.cpp
+++ b/protocols/Xfire/src/userdetails.cpp
@@ -64,7 +64,7 @@ void LoadProfilStatus(LPVOID lparam) {
void SetItemTxt(HWND hwndDlg,int feldid,char*feld,HANDLE hcontact,int type)
{
DBVARIANT dbv;
- if(!DBGetContactSetting(hcontact,protocolname,feld,&dbv)) {
+ if(!db_get(hcontact,protocolname,feld,&dbv)) {
if(type==1)
{
char temp[255];
@@ -75,7 +75,7 @@ void SetItemTxt(HWND hwndDlg,int feldid,char*feld,HANDLE hcontact,int type)
{
SetDlgItemText(hwndDlg,feldid,dbv.pszVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
EnableDlgItem(hwndDlg,feldid,TRUE);
}
else
@@ -91,16 +91,16 @@ static int GetIPPortUDetails(HANDLE wParam,char* feld1,char* feld2)
HGLOBAL clipbuffer;
char* buffer;
- if(DBGetContactSettingWord((HANDLE)wParam, protocolname, feld2, -1)==0)
+ if(db_get_w((HANDLE)wParam, protocolname, feld2, -1)==0)
return 0;
DBVARIANT dbv;
- if(DBGetContactSettingString((HANDLE)wParam, protocolname, feld1,&dbv))
+ if(db_get_s((HANDLE)wParam, protocolname, feld1,&dbv))
return 0;
- sprintf(temp,"%s:%d",dbv.pszVal,DBGetContactSettingWord((HANDLE)wParam, protocolname, feld2, -1));
+ sprintf(temp,"%s:%d",dbv.pszVal,db_get_w((HANDLE)wParam, protocolname, feld2, -1));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if(OpenClipboard(NULL))
{
@@ -121,7 +121,7 @@ static int GetIPPortUDetails(HANDLE wParam,char* feld1,char* feld2)
void addToList(HWND listbox,HANDLE hContact,char*key,char*val)
{
DBVARIANT dbv;
- if(!DBGetContactSetting(hContact,protocolname,val,&dbv))
+ if(!db_get(hContact,protocolname,val,&dbv))
{
LVITEM lvitem;
memset(&lvitem,0,sizeof(lvitem));
@@ -134,7 +134,7 @@ void addToList(HWND listbox,HANDLE hContact,char*key,char*val)
lvitem.iSubItem++;
lvitem.pszText=dbv.pszVal;
SendMessageA(listbox,LVM_SETITEM,0,(LPARAM)&lvitem);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -262,7 +262,7 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam
if (hContact)
{
DBVARIANT dbv;
- if(!DBGetContactSetting(hContact,protocolname,"Username",&dbv))
+ if(!db_get(hContact,protocolname,"Username",&dbv))
{
int usernamesize=strlen(dbv.pszVal)+1;
char* username=new char[usernamesize];
@@ -272,13 +272,13 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam
mir_forkthread(LoadProfilStatus,(LPVOID)username);
}
//LoadProfilStatus
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if(!DBGetContactSetting(hContact,protocolname,"GameInfo",&dbv))
+ if(!db_get(hContact,protocolname,"GameInfo",&dbv))
{
setGameInfo(listbox,dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
addToList(listbox,hContact,"Servername","ServerName");
@@ -301,26 +301,26 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam
{
DBVARIANT dbv;
- if(!DBGetContactSetting(hContact,protocolname,"GameId",&dbv))
+ if(!db_get(hContact,protocolname,"GameId",&dbv))
{
SendMessage(GetDlgItem(hwndDlg,IDC_GAMEICO),STM_SETICON,(WPARAM)xgamelist.iconmngr.getGameIcon(dbv.wVal),0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if(!DBGetContactSetting(hContact,protocolname,"VoiceId",&dbv))
+ if(!db_get(hContact,protocolname,"VoiceId",&dbv))
{
SendMessage(GetDlgItem(hwndDlg,IDC_VOICEICO),STM_SETICON,(WPARAM)xgamelist.iconmngr.getGameIcon(dbv.wVal),0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if(DBGetContactSetting(hContact,protocolname,"ServerIP",&dbv))
+ if(db_get(hContact,protocolname,"ServerIP",&dbv))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_COPYGAME),FALSE);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if(DBGetContactSetting(hContact,protocolname,"VServerIP",&dbv))
+ if(db_get(hContact,protocolname,"VServerIP",&dbv))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_COPYVOICE),FALSE);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
//ShowWindow(GetDlgItem(hwndDlg,IDC_VOICEICO),FALSE)
@@ -388,30 +388,30 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam
char nick[256]="";
char status[256]="";
char game[512]="";
- if(!DBGetContactSetting(hContact,"ContactPhoto","File",&dbv))
+ if(!db_get(hContact,"ContactPhoto","File",&dbv))
{
snprintf(img,256,"<img src=\"%s\">",dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if(!DBGetContactSetting(hContact,protocolname,"Username",&dbv))
+ if(!db_get(hContact,protocolname,"Username",&dbv))
{
snprintf(username,256,"<b>Username:</b> %s<br>",dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if(!DBGetContactSetting(hContact,protocolname,"Nick",&dbv))
+ if(!db_get(hContact,protocolname,"Nick",&dbv))
{
snprintf(nick,256,"<b>Nick:</b> %s<br>",dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if(!DBGetContactSetting(hContact,protocolname,"XStatusMsg",&dbv))
+ if(!db_get(hContact,protocolname,"XStatusMsg",&dbv))
{
snprintf(status,256,"<b>Status:</b> %s<br>",dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if(!DBGetContactSetting(hContact,protocolname,"RGame",&dbv))
+ if(!db_get(hContact,protocolname,"RGame",&dbv))
{
snprintf(game,512,"<fieldset style='border:1px solid #0091d5;background-color:#0d2c3e;margin-bottom:8px;'><legend>Spiel</legend><table><tr><td valign=top style='font-family:Arial;font-size:11px;color:#fff;'><b><u>%s</u></b></td></tr></table></fieldset>",dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
snprintf(profil,2056,"mshtml:<div style='position:absolute;top:0;left:0;border:1px solid #0091d5;background-color:#000;padding:6px;width:334px;height:249px'><table><tr><td valign=top>%s</td><td valign=top style='font-family:Arial;font-size:11px;color:#fff;'>%s%s%s</td></tr><tr><td valign=top colspan=\"2\" style='font-family:Arial;font-size:11px;color:#fff;'>%s%s</td></tr></table></div>",img,username,nick,status,game);
HWND hWnd = ::CreateWindow("AtlAxWin", profil,
diff --git a/protocols/Xfire/src/variables.cpp b/protocols/Xfire/src/variables.cpp
index d1e0d64df0..34c1dec6f2 100644
--- a/protocols/Xfire/src/variables.cpp
+++ b/protocols/Xfire/src/variables.cpp
@@ -21,10 +21,10 @@ char* Varxfiregame(ARGUMENTSINFO *ai)
{
char temp[256];
DBVARIANT dbv3;
- if(!DBGetContactSetting(ai->fi->hContact,protocolname, "RGame",&dbv3))
+ if(!db_get(ai->fi->hContact,protocolname, "RGame",&dbv3))
{
strncpy(temp,dbv3.pszVal,255);
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
return mir_strdup(temp);
}
}
@@ -39,10 +39,10 @@ char* Varmyxfiregame(ARGUMENTSINFO *ai)
return NULL;
DBVARIANT dbv3;
- if(!DBGetContactSetting(NULL,protocolname, "currentgamename",&dbv3))
+ if(!db_get(NULL,protocolname, "currentgamename",&dbv3))
{
char* ret=mir_strdup(dbv3.pszVal);
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
return ret;
}
ai->flags = AIF_FALSE;
@@ -55,10 +55,10 @@ char* Varxfirevoice(ARGUMENTSINFO *ai)
return NULL;
DBVARIANT dbv3;
- if(!DBGetContactSetting(ai->fi->hContact,protocolname, "RVoice",&dbv3))
+ if(!db_get(ai->fi->hContact,protocolname, "RVoice",&dbv3))
{
char* ret=mir_strdup(dbv3.pszVal);
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
return ret;
}
@@ -72,10 +72,10 @@ char* Varmyxfirevoiceip(ARGUMENTSINFO *ai) {
return NULL;
DBVARIANT dbv3;
- if(!DBGetContactSetting(NULL,protocolname, "VServerIP",&dbv3))
+ if(!db_get(NULL,protocolname, "VServerIP",&dbv3))
{
char* ret=mir_strdup(dbv3.pszVal);
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
return ret;
}
@@ -88,10 +88,10 @@ char* Varmyxfireserverip(ARGUMENTSINFO *ai) {
return NULL;
DBVARIANT dbv3;
- if(!DBGetContactSetting(NULL,protocolname, "ServerIP",&dbv3))
+ if(!db_get(NULL,protocolname, "ServerIP",&dbv3))
{
char* ret=mir_strdup(dbv3.pszVal);
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
return ret;
}
@@ -112,10 +112,10 @@ char* Varxfireserverip(ARGUMENTSINFO *ai) {
{
char temp[24];
DBVARIANT dbv3;
- if(!DBGetContactSetting(ai->fi->hContact,protocolname, "ServerIP",&dbv3))
+ if(!db_get(ai->fi->hContact,protocolname, "ServerIP",&dbv3))
{
- sprintf(temp,"%s:%d",dbv3.pszVal,DBGetContactSettingWord(ai->fi->hContact,protocolname, "Port",0));
- DBFreeVariant(&dbv3);
+ sprintf(temp,"%s:%d",dbv3.pszVal,db_get_w(ai->fi->hContact,protocolname, "Port",0));
+ db_free(&dbv3);
return mir_strdup(temp);
}
ai->flags = AIF_FALSE;
@@ -139,10 +139,10 @@ char* Varxfirevoiceip(ARGUMENTSINFO *ai) {
{
char temp[24];
DBVARIANT dbv3;
- if(!DBGetContactSetting(ai->fi->hContact,protocolname, "VServerIP",&dbv3))
+ if(!db_get(ai->fi->hContact,protocolname, "VServerIP",&dbv3))
{
- sprintf(temp,"%s:%d",dbv3.pszVal,DBGetContactSettingWord(ai->fi->hContact,protocolname, "VPort",0));
- DBFreeVariant(&dbv3);
+ sprintf(temp,"%s:%d",dbv3.pszVal,db_get_w(ai->fi->hContact,protocolname, "VPort",0));
+ db_free(&dbv3);
return mir_strdup(temp);
}
ai->flags = AIF_FALSE;
@@ -159,10 +159,10 @@ char* Varmyxfirevoice(ARGUMENTSINFO *ai)
return NULL;
DBVARIANT dbv3;
- if(!DBGetContactSetting(NULL,protocolname, "currentvoicename",&dbv3))
+ if(!db_get(NULL,protocolname, "currentvoicename",&dbv3))
{
char* ret=mir_strdup(dbv3.pszVal);
- DBFreeVariant(&dbv3);
+ db_free(&dbv3);
return ret;
}