summaryrefslogtreecommitdiff
path: root/protocols/Xfire/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
commitddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch)
tree5d74f37a7013d13b92c182628d6b68a58e148ae4 /protocols/Xfire/src
parentc39340bf493a1745a41317bbf937fc7eb6cbb26a (diff)
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Xfire/src')
-rw-r--r--protocols/Xfire/src/baseProtocol.h55
-rw-r--r--protocols/Xfire/src/buddylist.cpp2
-rw-r--r--protocols/Xfire/src/buddylist.h96
-rw-r--r--protocols/Xfire/src/main.cpp96
-rw-r--r--protocols/Xfire/src/processbuddyinfo.cpp2
-rw-r--r--protocols/Xfire/src/processbuddyinfo.h2
-rw-r--r--protocols/Xfire/src/socket.h8
-rw-r--r--protocols/Xfire/src/stdafx.h44
-rw-r--r--protocols/Xfire/src/userdetails.cpp16
9 files changed, 153 insertions, 168 deletions
diff --git a/protocols/Xfire/src/baseProtocol.h b/protocols/Xfire/src/baseProtocol.h
index 7946c2adcb..64abc5720c 100644
--- a/protocols/Xfire/src/baseProtocol.h
+++ b/protocols/Xfire/src/baseProtocol.h
@@ -29,59 +29,14 @@
//=====================================================
// Includes (yea why not include lots of stuff :D )
//=====================================================
-#include <windows.h>
-#include <gdiplus.h>
-#include <Wininet.h>
-#include <commctrl.h>
-#include <stdio.h>
-#include <time.h>
-#include <stddef.h>
-#include <process.h>
-#include <string.h>
-#include <winsock.h>
-#include "resource.h"
-#include <winbase.h>
-#include <tlhelp32.h>
-#include <Psapi.h>
-#include <string.h>
-#include <Iphlpapi.h>
-
-//Miranda SDK headers
-#include <newpluginapi.h>
-#include <m_clist.h>
-#include <m_clui.h>
-#include <m_skin.h>
-#include <m_langpack.h>
-#include <m_protomod.h>
-#include <m_database.h>
-#include <m_system.h>
-#include <m_protocols.h>
-#include <m_protomod.h>
-#include <m_protosvc.h>
-#include <m_protoint.h>
-#include <m_userinfo.h>
-#include <m_options.h>
-#include <m_utils.h>
-#include <m_ignore.h>
-#include <m_netlib.h>
-#include <m_avatars.h>
-#include <m_folders.h>
-#include <m_assocmgr.h>
-#include <m_icolib.h>
-#include <m_genmenu.h>
-#include <m_extraicons.h>
-#include <m_xstatus.h>
-#include "services.h"
-
-/*#pragma comment(lib, "atl.lib")
-#include <atldef.h>
-#define _ATL_DLL_IMPL
-#include <atliface.h>*/
+#pragma once
#ifndef _BASEPROTO_H
#define _BASEPROTO_H
+#include "services.h"
+
//=======================================================
// Definitions
//=======================================================
@@ -103,7 +58,7 @@ INT_PTR GetStatus(WPARAM wParam,LPARAM lParam);
INT_PTR TMLoadIcon(WPARAM wParam,LPARAM lParam);
INT_PTR SetNickName(WPARAM newnick, LPARAM lparam);
-BOOL IsXFireContact(HANDLE h);
+BOOL IsXFireContact(HCONTACT h);
int displayPopup(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType,HICON hhicon=NULL);
BOOL CreateToolTip(int toolID, HWND hDlg, CHAR* pText);
void EnableDlgItem(HWND hwndDlg, UINT control, int state);
@@ -200,7 +155,7 @@ struct XFire_FoundGame
struct XFire_SetAvatar
{
- HANDLE hContact;
+ HCONTACT hContact;
char* username;
};
diff --git a/protocols/Xfire/src/buddylist.cpp b/protocols/Xfire/src/buddylist.cpp
index 4c596001a0..a7f2ba8042 100644
--- a/protocols/Xfire/src/buddylist.cpp
+++ b/protocols/Xfire/src/buddylist.cpp
@@ -36,7 +36,7 @@
//buddylist verarbeitung von der main in buddylist verschoben, um doppelte schleifenverarbeitung zuunterbinden
#include "baseProtocol.h"
-extern HANDLE handlingBuddys(xfirelib::BuddyListEntry *entry, int clan=0,char* group=NULL,BOOL dontscan=FALSE);
+extern HCONTACT handlingBuddys(xfirelib::BuddyListEntry *entry, int clan=0,char* group=NULL,BOOL dontscan=FALSE);
extern void setBuddyStatusMsg(xfirelib::BuddyListEntry *entry);
namespace xfirelib {
diff --git a/protocols/Xfire/src/buddylist.h b/protocols/Xfire/src/buddylist.h
index 7ab1e26878..ee6f2a22b4 100644
--- a/protocols/Xfire/src/buddylist.h
+++ b/protocols/Xfire/src/buddylist.h
@@ -37,60 +37,60 @@
namespace xfirelib {
- using namespace std;
+ using namespace std;
- struct Client;
- struct BuddyListEntry;
+ struct Client;
+ struct BuddyListEntry;
- class BuddyList : public PacketListener {
- public:
- BuddyList(Client *client);
- ~BuddyList();
-
- vector <BuddyListEntry *> * getEntries() { return entries; }
- vector <BuddyListEntry *> * getEntriesClan() { return entriesClan; }
-
- void receivedPacket(XFirePacket *packet);
- BuddyListEntry *getBuddyById(long userid);
- BuddyListEntry *getBuddyBySid(const char *sid);
- BuddyListEntry *getBuddyByName(string username);
- private:
- void initEntries(BuddyListNamesPacket* buddynames);
- void initEntriesClan(ClanBuddyListNamesPacket* buddynames);
- void updateOnlineBuddies(BuddyListOnlinePacket* buddiesOnline);
- void updateBuddiesGame(BuddyListGamesPacket* buddiesGames);
- void updateFriendsofFriend(FriendsBuddyListNamesPacket* friends);
-
- Client *client;
- vector <BuddyListEntry *> * entries;
- vector <BuddyListEntry *> * entriesClan;
- };
+ class BuddyList : public PacketListener {
+ public:
+ BuddyList(Client *client);
+ ~BuddyList();
+
+ vector <BuddyListEntry *> * getEntries() { return entries; }
+ vector <BuddyListEntry *> * getEntriesClan() { return entriesClan; }
+
+ void receivedPacket(XFirePacket *packet);
+ BuddyListEntry *getBuddyById(long userid);
+ BuddyListEntry *getBuddyBySid(const char *sid);
+ BuddyListEntry *getBuddyByName(string username);
+ private:
+ void initEntries(BuddyListNamesPacket* buddynames);
+ void initEntriesClan(ClanBuddyListNamesPacket* buddynames);
+ void updateOnlineBuddies(BuddyListOnlinePacket* buddiesOnline);
+ void updateBuddiesGame(BuddyListGamesPacket* buddiesGames);
+ void updateFriendsofFriend(FriendsBuddyListNamesPacket* friends);
+
+ Client *client;
+ vector <BuddyListEntry *> * entries;
+ vector <BuddyListEntry *> * entriesClan;
+ };
class BuddyListEntry {
public:
- BuddyListEntry();
- ~BuddyListEntry();
- bool isOnline();
-
- void setSid(const char *sid);
-
- long userid;
- char sid[16];
- string nick;
- string username;
- string statusmsg;
- string gameinfo;
- long game;
- long game2;
- HANDLE hcontact;
- int clanid;
-
- //lastpopup
- char* lastpopup;
-
- XFireGame *gameObj;
- XFireGame *game2Obj;
+ BuddyListEntry();
+ ~BuddyListEntry();
+ bool isOnline();
+
+ void setSid(const char *sid);
+
+ long userid;
+ char sid[16];
+ string nick;
+ string username;
+ string statusmsg;
+ string gameinfo;
+ long game;
+ long game2;
+ HCONTACT hcontact;
+ int clanid;
+
+ //lastpopup
+ char* lastpopup;
+
+ XFireGame *gameObj;
+ XFireGame *game2Obj;
};
typedef BuddyListEntry *PBuddyListEntry;
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp
index b663fd50b5..bc9e744231 100644
--- a/protocols/Xfire/src/main.cpp
+++ b/protocols/Xfire/src/main.cpp
@@ -148,13 +148,13 @@ INT_PTR RecvMessage(WPARAM wParam, LPARAM lParam);
INT_PTR SendMessage(WPARAM wParam, LPARAM lParam);
int FillList(WPARAM wParam, LPARAM lParam);
-HANDLE CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan);
-HANDLE CList_FindContact (int uid);
+HCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan);
+HCONTACT CList_FindContact (int uid);
void CList_MakeAllOffline();
static INT_PTR UserIsTyping(WPARAM wParam, LPARAM lParam);
HANDLE LoadGameIcon(char* g, int id, HICON* ico,BOOL onyico=FALSE,char * gamename=NULL,int*uu=NULL);
BOOL GetAvatar(char* username,XFireAvatar* av);
-//void SetAvatar(HANDLE hContact, char* username);
+//void SetAvatar(HCONTACT hContact, char* username);
static void SetAvatar(LPVOID lparam);
static INT_PTR GetIPPort(WPARAM /*wParam*/,LPARAM lParam);
static INT_PTR GetVIPPort(WPARAM /*wParam*/,LPARAM lParam);
@@ -187,7 +187,7 @@ INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam);
INT_PTR GetXStatusIcon(WPARAM wParam, LPARAM lParam);
static INT_PTR GotoProfile2(WPARAM wParam,LPARAM lParam);
-HANDLE handlingBuddys(BuddyListEntry *entry, int clan=0,char* group=NULL,BOOL dontscan=FALSE);
+HCONTACT handlingBuddys(BuddyListEntry *entry, int clan=0,char* group=NULL,BOOL dontscan=FALSE);
int StatusIcon(WPARAM wParam,LPARAM lParam);
void CreateGroup(char*grpn,char*field); //void CreateGroup(char*grp);
@@ -514,7 +514,7 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
db_free(&dbv);
}
CreateGroup(Translate(fofname),"fofgroup");
- HANDLE hc=handlingBuddys(entry,-1,Translate(fofname));
+ HCONTACT hc=handlingBuddys(entry,-1,Translate(fofname));
if (hc)
{
CheckAvatar(entry);
@@ -608,8 +608,7 @@ void XFireClient::sendmsg(char*usr,char*cmsg) {
xfire_newc.nick=(char*)invite->nick.c_str();
xfire_newc.id=0;
- HANDLE handle=CList_AddContact(xfire_newc,TRUE,TRUE,0);
-
+ HCONTACT handle = CList_AddContact(xfire_newc,TRUE,TRUE,0);
if (handle) { // invite nachricht mitsenden
string str = (char*)invite->msg.c_str();
@@ -999,7 +998,7 @@ int ExtraListRebuild(WPARAM wparam, LPARAM lparam)
int ExtraImageApply1(WPARAM wparam, LPARAM lparam)
{
- HANDLE hContact = (HANDLE)wparam;
+ HCONTACT hContact = (HCONTACT)wparam;
char *szProto = GetContactProto(hContact);
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);
@@ -1011,7 +1010,7 @@ int ExtraImageApply1(WPARAM wparam, LPARAM lparam)
int ExtraImageApply2(WPARAM wparam, LPARAM lparam)
{
- HANDLE hContact=(HANDLE)wparam;
+ HCONTACT hContact=(HCONTACT)wparam;
// TODO: maybe need to fix extra icons
char *szProto = GetContactProto(hContact);
if ( szProto != NULL && !lstrcmpiA( szProto, protocolname ) && db_get_w(hContact, protocolname, "Status", ID_STATUS_OFFLINE)!=ID_STATUS_OFFLINE) {
@@ -1327,18 +1326,18 @@ static void SetStatusLate( LPVOID param )
static void SendAck( LPVOID param )
{
- ProtoBroadcastAck(protocolname, param, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck(protocolname, (HCONTACT)param, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
}
static void SendBadAck( LPVOID param )
{
- ProtoBroadcastAck(protocolname, param, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 0, LPARAM(Translate("XFire does not support offline messaging!")));
+ ProtoBroadcastAck(protocolname, (HCONTACT)param, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 0, LPARAM(Translate("XFire does not support offline messaging!")));
}
static INT_PTR UserIsTyping(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = ( HANDLE )wParam;
- DBVARIANT dbv;
+ HCONTACT hContact = (HCONTACT)wParam;
+ DBVARIANT dbv;
if (lParam==PROTOTYPE_SELFTYPING_ON)
{
@@ -1364,9 +1363,9 @@ static INT_PTR UserIsTyping(WPARAM wParam, LPARAM lParam)
INT_PTR SendMessage(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *ccs = (CCSDATA *) lParam;
+ CCSDATA *ccs = (CCSDATA *) lParam;
PROTORECVEVENT* pre = (PROTORECVEVENT*)ccs->lParam;
- DBVARIANT dbv;
+ DBVARIANT dbv;
int sended=0;
db_get_s(ccs->hContact, protocolname, "Username",&dbv);
@@ -1377,13 +1376,10 @@ INT_PTR SendMessage(WPARAM wParam, LPARAM lParam)
mir_forkthread(SendAck,ccs->hContact);
sended=1;
}
- else
- {
- mir_forkthread(SendBadAck,ccs->hContact);
- }
- db_free(&dbv);
+ else mir_forkthread(SendBadAck,ccs->hContact);
- return sended;
+ db_free(&dbv);
+ return sended;
}
//=======================================================
@@ -1598,15 +1594,15 @@ INT_PTR GetStatus(WPARAM wParam,LPARAM lParam)
return ID_STATUS_OFFLINE;
}
-HANDLE CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan)
+HCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan)
{
- HANDLE hContact;
+ HCONTACT hContact;
if (xfc.username == NULL)
return 0;
// here we create a new one since no one is to be found
- hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
if ( hContact ) {
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM)protocolname );
@@ -1668,7 +1664,7 @@ HANDLE CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan)
return false;
}
-BOOL IsXFireContact(HANDLE hContact)
+BOOL IsXFireContact(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto != NULL && !lstrcmpiA(szProto, protocolname))
@@ -1677,9 +1673,9 @@ BOOL IsXFireContact(HANDLE hContact)
return FALSE;
}
-HANDLE CList_FindContact (int uid)
+HCONTACT CList_FindContact (int uid)
{
- for (HANDLE hContact = db_find_first(protocolname); hContact; hContact = db_find_next(hContact, protocolname))
+ for (HCONTACT hContact = db_find_first(protocolname); hContact; hContact = db_find_next(hContact, protocolname))
if ( db_get_dw(hContact, protocolname, "UserId", -1) == uid)
return hContact;
@@ -1689,7 +1685,7 @@ HANDLE CList_FindContact (int uid)
void CList_MakeAllOffline()
{
vector<HANDLE> fhandles;
- for (HANDLE hContact = db_find_first(protocolname); hContact; hContact = db_find_next(hContact, protocolname)) {
+ for (HCONTACT hContact = db_find_first(protocolname); hContact; hContact = db_find_next(hContact, protocolname)) {
//freunde von freunden in eine seperate liste setzen
//nur wenn das nicht abgestellt wurde
if (db_get_b(hContact,protocolname,"friendoffriend",0)==1 && db_get_b(NULL,protocolname,"fofdbremove",0)==1)
@@ -1770,7 +1766,7 @@ void SetAvatar2(LPVOID lparam) {
}
void SetAvatar(LPVOID lparam)
-//void SetAvatar(HANDLE hContact, char* username)
+//void SetAvatar(HCONTACT hContact, char* username)
{
//EnterCriticalSection(&avatarMutex);
//WaitForSingleObject(hMutex, INFINITE);
@@ -1932,14 +1928,14 @@ static INT_PTR GetIPPort(WPARAM wParam,LPARAM lParam)
HGLOBAL clipbuffer;
char* buffer;
- if (db_get_w((HANDLE)wParam, protocolname, "Port", -1)==0)
+ if (db_get_w((HCONTACT)wParam, protocolname, "Port", -1)==0)
return 0;
DBVARIANT dbv;
- if (db_get_s((HANDLE)wParam, protocolname, "ServerIP",&dbv))
+ if (db_get_s((HCONTACT)wParam, protocolname, "ServerIP",&dbv))
return 0;
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HANDLE)wParam, protocolname, "Port", -1));
+ mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HCONTACT)wParam, protocolname, "Port", -1));
db_free(&dbv);
@@ -1965,14 +1961,14 @@ static INT_PTR GetVIPPort(WPARAM wParam,LPARAM lParam)
HGLOBAL clipbuffer;
char* buffer;
- if (db_get_w((HANDLE)wParam, protocolname, "VPort", -1)==0)
+ if (db_get_w((HCONTACT)wParam, protocolname, "VPort", -1)==0)
return 0;
DBVARIANT dbv;
- if (db_get_s((HANDLE)wParam, protocolname, "VServerIP",&dbv))
+ if (db_get_s((HCONTACT)wParam, protocolname, "VServerIP",&dbv))
return 0;
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HANDLE)wParam, protocolname, "VPort", -1));
+ mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HCONTACT)wParam, protocolname, "VPort", -1));
db_free(&dbv);
@@ -1997,7 +1993,7 @@ static INT_PTR GotoProfile(WPARAM wParam,LPARAM lParam)
DBVARIANT dbv;
char temp[64]="";
- if (db_get_s((HANDLE)wParam, protocolname, "Username",&dbv))
+ if (db_get_s((HCONTACT)wParam, protocolname, "Username",&dbv))
return 0;
strcpy(temp,"http://xfire.com/profile/");
@@ -2013,7 +2009,7 @@ static INT_PTR GotoXFireClanSite(WPARAM wParam,LPARAM lParam) {
DBVARIANT dbv;
char temp[64]="";
- int clanid=db_get_dw((HANDLE)wParam, protocolname, "Clan",-1);
+ int clanid=db_get_dw((HCONTACT)wParam, protocolname, "Clan",-1);
mir_snprintf(temp, SIZEOF(temp), "ClanUrl_%d", clanid);
if (db_get_s(NULL, protocolname, temp,&dbv))
@@ -2074,7 +2070,7 @@ static INT_PTR GotoProfileAct(WPARAM wParam,LPARAM lParam)
int RebuildContactMenu( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
bool bEnabled = true, bEnabled2 = true;
DBVARIANT dbv;
@@ -2688,9 +2684,9 @@ void setBuddyStatusMsg(BuddyListEntry *entry)
}
}*/
-HANDLE handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
+HCONTACT handlingBuddys(BuddyListEntry *entry, int clan,char*group,BOOL dontscan)
{
- HANDLE hContact;
+ HCONTACT hContact;
string game;
if (entry==NULL)
@@ -3257,14 +3253,14 @@ INT_PTR SendPrefs(WPARAM wparam, LPARAM lparam)
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 (!db_get_b((HCONTACT)wParam, protocolname, "DontSendDenyPacket", 0))
+ if (db_get_b((HCONTACT)wParam,"CList","NotOnList",0))
{
if (myClient!=NULL)
if (myClient->client->connected)
{
DBVARIANT dbv2;
- if (!db_get((HANDLE)wParam,protocolname,"Username",&dbv2)) {
+ if (!db_get((HCONTACT)wParam,protocolname,"Username",&dbv2)) {
SendDenyInvitationPacket deny;
deny.name = dbv2.pszVal;
myClient->client->send( &deny );
@@ -3297,7 +3293,7 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam)
char temp[256];
DBVARIANT dbv;
- if (!db_get_s((HANDLE)wParam, protocolname, "Username",&dbv))
+ if (!db_get_s((HCONTACT)wParam, protocolname, "Username",&dbv))
{
mir_snprintf(temp, SIZEOF(temp), Translate("Do you really want to delete your friend %s?"), dbv.pszVal);
if (MessageBoxA(NULL,temp,Translate("Confirm Delete"),MB_YESNO|MB_ICONQUESTION)==IDYES)
@@ -3308,7 +3304,7 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam)
{
SendRemoveBuddyPacket removeBuddy;
- removeBuddy.userid=db_get_dw((HANDLE)wParam,protocolname,"UserId",0);
+ removeBuddy.userid=db_get_dw((HCONTACT)wParam,protocolname,"UserId",0);
if (removeBuddy.userid!=0)
{
@@ -3326,7 +3322,7 @@ INT_PTR BlockFriend(WPARAM wParam,LPARAM lParam)
{
DBVARIANT dbv;
- if (!db_get_s((HANDLE)wParam, protocolname, "Username",&dbv))
+ if (!db_get_s((HCONTACT)wParam, protocolname, "Username",&dbv))
{
if (MessageBox(NULL,TranslateT("Block this user from ever contacting you again?"),TranslateT("Block Confirmation"),MB_YESNO|MB_ICONQUESTION)==IDYES)
{
@@ -3353,7 +3349,7 @@ INT_PTR StartThisGame(WPARAM wParam,LPARAM lParam) {
xgamelist.Block(TRUE);
//hole die gameid des spiels
- int id=db_get_w((HANDLE)wParam, protocolname, "GameId",0);
+ int id=db_get_w((HCONTACT)wParam, protocolname, "GameId",0);
//hole passendes spielobjekt
Xfire_game*game=xgamelist.getGamebyGameid(id);
@@ -3373,7 +3369,7 @@ INT_PTR JoinGame(WPARAM wParam,LPARAM lParam) {
xgamelist.Block(TRUE);
//hole die gameid des spiels
- int id=db_get_w((HANDLE)wParam, protocolname, "GameId",0);
+ int id=db_get_w((HCONTACT)wParam, protocolname, "GameId",0);
//hole passendes spielobjekt
Xfire_game*game=xgamelist.getGamebyGameid(id);
@@ -3382,8 +3378,8 @@ INT_PTR JoinGame(WPARAM wParam,LPARAM lParam) {
if (game)
{
DBVARIANT dbv; //dbv.pszVal
- int port=db_get_w((HANDLE)wParam, protocolname, "Port",0);
- if (!db_get_s((HANDLE)wParam, protocolname, "ServerIP",&dbv))
+ int port=db_get_w((HCONTACT)wParam, protocolname, "Port",0);
+ if (!db_get_s((HCONTACT)wParam, protocolname, "ServerIP",&dbv))
{
//starte spiel mit netzwerk parametern
game->start_game(dbv.pszVal,port);
diff --git a/protocols/Xfire/src/processbuddyinfo.cpp b/protocols/Xfire/src/processbuddyinfo.cpp
index 687b27284f..28eb283f66 100644
--- a/protocols/Xfire/src/processbuddyinfo.cpp
+++ b/protocols/Xfire/src/processbuddyinfo.cpp
@@ -27,7 +27,7 @@ extern HANDLE XFireAvatarFolder;
return h;
}*/
-void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo,HANDLE hcontact,char* username) {
+void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo,HCONTACT hcontact,char* username) {
char temp[255] = "";
char filename[1024] = "";
BOOL dl=FALSE;
diff --git a/protocols/Xfire/src/processbuddyinfo.h b/protocols/Xfire/src/processbuddyinfo.h
index 0964ef983b..e4fad3b387 100644
--- a/protocols/Xfire/src/processbuddyinfo.h
+++ b/protocols/Xfire/src/processbuddyinfo.h
@@ -4,4 +4,4 @@
#include "getbuddyinfo.h"
#include "buddyinfo.h"
-void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo,HANDLE hcontact,char* username); \ No newline at end of file
+void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, HCONTACT hcontact,char* username); \ No newline at end of file
diff --git a/protocols/Xfire/src/socket.h b/protocols/Xfire/src/socket.h
index 370aeb74f7..17fdd46bc6 100644
--- a/protocols/Xfire/src/socket.h
+++ b/protocols/Xfire/src/socket.h
@@ -10,14 +10,6 @@
#include "stdafx.h"
-#include <sys/types.h>
-//#include <netinet/in.h>
-//#include <netdb.h>
-//#include <unistd.h>
-#include <string>
-//#include <arpa/inet.h>
-#include <winsock2.h>
-
#include "socketexception.h"
diff --git a/protocols/Xfire/src/stdafx.h b/protocols/Xfire/src/stdafx.h
index 3b6a0d7bd2..c6055649f3 100644
--- a/protocols/Xfire/src/stdafx.h
+++ b/protocols/Xfire/src/stdafx.h
@@ -9,10 +9,12 @@
#define _WIN32_WINNT 0x0501 // Ändern Sie dies in den geeigneten Wert für andere Versionen von Windows.
#endif
+#include <sys/types.h>
#include <stdio.h>
#include <cstdlib>
#include <tchar.h>
#include <iostream>
+#include <string>
#define uint unsigned int
#define socklen_t int
@@ -33,4 +35,44 @@
#pragma comment(lib,"user32.lib")
#pragma comment(lib,"gdi32.lib")
-// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
+#include <winsock2.h>
+#include <gdiplus.h>
+#include <Wininet.h>
+#include <commctrl.h>
+#include <stdio.h>
+#include <time.h>
+#include <stddef.h>
+#include <process.h>
+#include <string.h>
+#include <tlhelp32.h>
+#include <Psapi.h>
+#include <string.h>
+#include <Iphlpapi.h>
+
+#include "resource.h"
+
+//Miranda SDK headers
+#include <newpluginapi.h>
+#include <m_clist.h>
+#include <m_clui.h>
+#include <m_skin.h>
+#include <m_langpack.h>
+#include <m_protomod.h>
+#include <m_database.h>
+#include <m_system.h>
+#include <m_protocols.h>
+#include <m_protomod.h>
+#include <m_protosvc.h>
+#include <m_protoint.h>
+#include <m_userinfo.h>
+#include <m_options.h>
+#include <m_utils.h>
+#include <m_ignore.h>
+#include <m_netlib.h>
+#include <m_avatars.h>
+#include <m_folders.h>
+#include <m_assocmgr.h>
+#include <m_icolib.h>
+#include <m_genmenu.h>
+#include <m_extraicons.h>
+#include <m_xstatus.h>
diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp
index 0ae7e662f6..bb30eccb98 100644
--- a/protocols/Xfire/src/userdetails.cpp
+++ b/protocols/Xfire/src/userdetails.cpp
@@ -61,7 +61,7 @@ void LoadProfilStatus(LPVOID lparam) {
delete[] lparam;
}
-void SetItemTxt(HWND hwndDlg,int feldid,char*feld,HANDLE hcontact,int type)
+void SetItemTxt(HWND hwndDlg,int feldid,char*feld,HCONTACT hcontact,int type)
{
DBVARIANT dbv;
if (!db_get(hcontact,protocolname,feld,&dbv)) {
@@ -91,14 +91,14 @@ static int GetIPPortUDetails(HANDLE wParam,char* feld1,char* feld2)
HGLOBAL clipbuffer;
char* buffer;
- if (db_get_w((HANDLE)wParam, protocolname, feld2, -1)==0)
+ if (db_get_w((HCONTACT)wParam, protocolname, feld2, -1)==0)
return 0;
DBVARIANT dbv;
- if (db_get_s((HANDLE)wParam, protocolname, feld1,&dbv))
+ if (db_get_s((HCONTACT)wParam, protocolname, feld1,&dbv))
return 0;
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HANDLE)wParam, protocolname, feld2, -1));
+ mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w((HCONTACT)wParam, protocolname, feld2, -1));
db_free(&dbv);
@@ -118,7 +118,7 @@ static int GetIPPortUDetails(HANDLE wParam,char* feld1,char* feld2)
return 0;
}
-void addToList(HWND listbox,HANDLE hContact,char*key,char*val)
+void addToList(HWND listbox,HCONTACT hContact,char*key,char*val)
{
DBVARIANT dbv;
if (!db_get(hContact,protocolname,val,&dbv))
@@ -245,7 +245,7 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam
case PSN_INFOCHANGED:
{
char* szProto;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
uhandle=hContact; //handle sichern
if (hContact == NULL)
@@ -370,7 +370,7 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam
case PSN_INFOCHANGED:
{
char* szProto;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
if (hContact == NULL)
szProto = protocolname;
@@ -429,7 +429,7 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam
int OnDetailsInit(WPARAM wParam,LPARAM lParam)
{
- if (!IsXFireContact((HANDLE)lParam))
+ if (!IsXFireContact((HCONTACT)lParam))
return 0;
OPTIONSDIALOGPAGE odp = { sizeof(odp) };