#include <ChatSession.h>
Inheritance diagram for CChatSession:
Public Member Functions | |
CChatSession (CChatFrame *pFrame=NULL) | |
virtual | ~CChatSession () |
void | Setup (GGUID *pGUID, SOCKADDR_IN *pHost, BOOL bMustPush) |
BOOL | Connect () |
TRISTATE | GetConnectedState () const |
void | OnED2KMessage (CEDPacket *pPacket) |
virtual void | AttachTo (CConnection *pConnection) |
BOOL | SendPush (BOOL bAutomatic) |
BOOL | OnPush (GGUID *pGUID, CConnection *pConnection) |
virtual void | Close () |
void | Print (LPCTSTR pszString) |
void | Send (CG2Packet *pPacket, BOOL bRelease=TRUE) |
BOOL | SendPrivateMessage (BOOL bAction, LPCTSTR pszText) |
void | StatusMessage (int nFlags, UINT nID,...) |
void | OnOpenWindow () |
void | OnCloseWindow () |
Public Attributes | |
BOOL | m_bGUID |
GGUID | m_pGUID |
int | m_nState |
PROTOCOLID | m_nProtocol |
BOOL | m_bOld |
BOOL | m_bMustPush |
DWORD | m_tPushed |
CString | m_sUserAgent |
CString | m_sUserNick |
CGProfile * | m_pProfile |
BOOL | m_bUnicode |
DWORD | m_nClientID |
SOCKADDR_IN | m_pServer |
CPrivateChatFrame * | m_pWndPrivate |
CWnd * | m_pWndPublic |
Protected Member Functions | |
virtual BOOL | OnRun () |
virtual BOOL | OnConnected () |
virtual BOOL | OnRead () |
virtual void | OnDropped (BOOL bError) |
virtual BOOL | OnHeaderLine (CString &strHeader, CString &strValue) |
virtual BOOL | OnHeadersComplete () |
BOOL | ReadHandshake () |
BOOL | ReadPacketsED2K () |
BOOL | SendPacketsED2K () |
BOOL | ReadText () |
BOOL | ReadPackets () |
void | PostOpenWindow () |
BOOL | SendChatMessage (CEDPacket *pPacket) |
BOOL | OnChatMessage (CEDPacket *pPacket) |
BOOL | OnEstablished () |
BOOL | OnText (const CString &str) |
BOOL | OnPacket (CG2Packet *pPacket) |
BOOL | OnProfileChallenge (CG2Packet *pPacket) |
BOOL | OnProfileDelivery (CG2Packet *pPacket) |
BOOL | OnChatRequest (CG2Packet *pPacket) |
BOOL | OnChatAnswer (CG2Packet *pPacket) |
BOOL | OnChatMessage (CG2Packet *pPacket) |
|
Definition at line 60 of file ChatSession.cpp. References CChatCore::Add(), ChatCore, cssNull, m_bGUID, m_bMustPush, m_bOld, m_bUnicode, m_nClientID, m_nProtocol, m_nState, m_pProfile, m_pServer, m_pWndPrivate, m_pWndPublic, m_tPushed, NULL, and PROTOCOL_NULL. |
|
Definition at line 90 of file ChatSession.cpp. References ChatCore, CConnection::m_hSocket, m_pProfile, NULL, and CChatCore::Remove(). |
|
Reimplemented from CConnection. Definition at line 194 of file ChatSession.cpp. References CChatCore::Add(), CConnection::AttachTo(), ChatCore, cssRequest1, and m_nState. Referenced by CChatCore::OnAccept(). |
|
Reimplemented from CConnection. Definition at line 248 of file ChatSession.cpp. References ChatCore, CConnection::Close(), cssNull, IDS_CHAT_CLOSED, m_nProtocol, m_nState, CChatCore::m_pSection, m_pWndPrivate, m_pWndPublic, NULL, PROTOCOL_ED2K, and StatusMessage(). Referenced by OnChatAnswer(), CChatFrame::OnChatDisconnect(), OnCloseWindow(), OnDropped(), OnPush(), OnRun(), ReadHandshake(), ReadPackets(), and ReadText(). |
|
Definition at line 121 of file ChatSession.cpp. References CChatCore::Add(), ChatCore, CConnection::ConnectTo(), cssConnecting, cssNull, IDS_CHAT_CANT_CONNECT, IDS_CHAT_CANT_PUSH, IDS_CHAT_CONNECTING_TO, m_bMustPush, m_nProtocol, m_nState, CConnection::m_pHost, CChatCore::m_pSection, CConnection::m_sAddress, PROTOCOL_ED2K, SendPush(), and StatusMessage(). Referenced by CChatFrame::OnChatConnect(). |
|
Definition at line 162 of file ChatSession.cpp. References cssActive, cssNull, m_nState, TS_FALSE, TS_TRUE, and TS_UNKNOWN. Referenced by CChatFrame::OnChatConnect(), CPrivateChatFrame::OnLocalMessage(), CChatFrame::OnUpdateChatConnect(), CChatFrame::OnUpdateChatDisconnect(), and CPrivateChatFrame::OnUpdateChatPriority(). |
|
Definition at line 1056 of file ChatSession.cpp. References Close(), cssActive, IDS_CHAT_PRIVATE_AWAY, IDS_CHAT_PRIVATE_ONLINE, IDS_CHAT_PRIVATE_REFUSED, CG2Packet::m_bCompound, CPacket::m_nPosition, m_nState, m_sUserNick, CG2Packet::ReadPacket(), CG2Packet::ReadString(), and StatusMessage(). Referenced by OnPacket(). |
|
Definition at line 1093 of file ChatSession.cpp. References CG2Packet::m_bCompound, CPacket::m_nPosition, m_pWndPrivate, NULL, CPrivateChatFrame::OnRemoteMessage(), CG2Packet::ReadPacket(), and CG2Packet::ReadString(). |
|
Definition at line 730 of file ChatSession.cpp. References m_bUnicode, m_pWndPrivate, NULL, CPrivateChatFrame::OnRemoteMessage(), CPacket::ReadShortLE(), CPacket::ReadString(), and CPacket::ReadStringUTF8(). Referenced by OnPacket(), and ReadPacketsED2K(). |
|
Definition at line 1012 of file ChatSession.cpp. References CGProfile::GUID, CG2Packet::m_bCompound, CPacket::m_nPosition, MyProfile, CG2Packet::New(), PostOpenWindow(), CPacket::Read(), CG2Packet::ReadPacket(), Send(), CPacket::Write(), and CG2Packet::WritePacket(). Referenced by OnPacket(). |
|
Definition at line 1288 of file ChatSession.cpp. References Close(), m_nProtocol, m_pProfile, m_pWndPrivate, m_pWndPublic, NULL, and PROTOCOL_ED2K. Referenced by CPrivateChatFrame::Accept(), and CChatFrame::OnDestroy(). |
|
Reimplemented from CConnection. Definition at line 271 of file ChatSession.cpp. References cssRequest2, IDS_CHAT_CONNECTED, CConnection::m_bInitiated, m_nProtocol, m_nState, CConnection::m_pOutput, CConnection::m_tConnected, CConnection::OnConnected(), CConnection::OnWrite(), CBuffer::Print(), PROTOCOL_ED2K, CConnection::SendMyAddress(), Settings, CSettings::SmartAgent(), and StatusMessage(). Referenced by OnPush(). |
|
Reimplemented from CConnection. Definition at line 303 of file ChatSession.cpp. References Close(), cssConnecting, IDS_CHAT_CANT_CONNECT, IDS_CHAT_DROPPED, CConnection::m_hSocket, m_nState, CConnection::m_sAddress, m_tPushed, SendPush(), and StatusMessage(). |
|
Definition at line 172 of file ChatSession.cpp. References ChatCore, cssActive, IDS_CHAT_PRIVATE_ONLINE, m_nState, CConnection::m_pInput, CChatCore::m_pSection, m_sUserNick, CConnection::m_tConnected, PostOpenWindow(), and StatusMessage(). Referenced by CChatCore::OnED2KMessage(). |
|
Definition at line 521 of file ChatSession.cpp. References cssActive, G2_PACKET_PROFILE_CHALLENGE, IDS_CHAT_HANDSHAKE_G1, IDS_CHAT_HANDSHAKE_G2, m_bOld, m_nProtocol, m_nState, m_pWndPrivate, CConnection::m_tConnected, CG2Packet::New(), NULL, CPrivateChatFrame::OnProfileReceived(), PostOpenWindow(), PROTOCOL_ED2K, PROTOCOL_G2, Send(), and StatusMessage(). Referenced by OnHeadersComplete(). |
|
Reimplemented from CConnection. Definition at line 428 of file ChatSession.cpp. References GNUTELLA_DEFAULT_PORT, CConnection::m_bInitiated, m_nProtocol, CConnection::m_pHost, CConnection::m_sAddress, m_sUserAgent, m_sUserNick, CShareazaApp::Message(), MSG_DEBUG, PROTOCOL_ED2K, PROTOCOL_G2, and theApp. |
|
Reimplemented from CConnection. Definition at line 469 of file ChatSession.cpp. References cssHandshake, cssHeaders1, cssHeaders2, cssHeaders3, cssRequest3, CGProfile::GetNick(), CGProfile::IsValid(), m_nProtocol, m_nState, CConnection::m_pOutput, MyProfile, OnEstablished(), CConnection::OnWrite(), CBuffer::Print(), PROTOCOL_G2, Settings, and CSettings::SmartAgent(). |
|
Definition at line 1239 of file ChatSession.cpp. References CPrivateChatFrame::Accept(), ChatWindows, cssActive, CChatWindows::FindED2KFrame(), CChatWindows::FindPrivate(), IDS_CHAT_PRIVATE_ONLINE, m_bGUID, m_bMustPush, m_nClientID, m_nProtocol, m_nState, m_pGUID, CConnection::m_pHost, m_pServer, m_pWndPrivate, m_pWndPublic, m_sUserNick, NULL, CPrivateChatFrame::OnProfileReceived(), PROTOCOL_ED2K, and StatusMessage(). Referenced by CMainWnd::OnOpenChat(). |
|
Definition at line 905 of file ChatSession.cpp. References G2_PACKET_PROFILE_CHALLENGE, G2_PACKET_PROFILE_DELIVERY, CG2Packet::IsType(), OnChatAnswer(), OnChatMessage(), OnChatRequest(), OnProfileChallenge(), and OnProfileDelivery(). Referenced by ReadPackets(). |
|
Definition at line 931 of file ChatSession.cpp. References G2_PACKET_PROFILE_DELIVERY, CG2Packet::GetStringLen(), CGProfile::GetXML(), CGProfile::IsValid(), MyProfile, CG2Packet::New(), NULL, Send(), CG2Packet::WritePacket(), and CG2Packet::WriteString(). Referenced by OnPacket(). |
|
Definition at line 946 of file ChatSession.cpp. References CXMLElement::FromString(), CGProfile::FromXML(), CGProfile::GetNick(), CGProfile::GUID, CGProfile::IsValid(), CG2Packet::m_bCompound, m_bGUID, CPacket::m_nPosition, m_pGUID, m_pProfile, m_pWndPrivate, m_sUserNick, CG2Packet::New(), NULL, CPrivateChatFrame::OnProfileReceived(), CG2Packet::ReadPacket(), CG2Packet::ReadString(), Send(), CPacket::Write(), and CG2Packet::WritePacket(). Referenced by OnPacket(). |
|
Definition at line 227 of file ChatSession.cpp. References CChatCore::Add(), CConnection::AttachTo(), ChatCore, Close(), cssConnecting, cssNull, IDS_CHAT_PUSH_DONE, m_bGUID, m_nProtocol, m_nState, m_pGUID, CConnection::m_sAddress, m_tPushed, OnConnected(), PROTOCOL_ED2K, and StatusMessage(). Referenced by CChatCore::OnPush(). |
|
Reimplemented from CConnection. Definition at line 350 of file ChatSession.cpp. References cssActive, cssHandshake, cssHeaders1, cssHeaders2, cssHeaders3, cssRequest1, cssRequest2, cssRequest3, m_nProtocol, m_nState, CConnection::OnRead(), PROTOCOL_ED2K, PROTOCOL_G2, ReadHandshake(), CConnection::ReadHeaders(), ReadPackets(), and ReadText(). |
|
Reimplemented from CConnection. Definition at line 323 of file ChatSession.cpp. References Close(), CSettings::Connection, cssActive, cssConnecting, cssNull, IDS_HANDSHAKE_TIMEOUT, m_nProtocol, m_nState, CConnection::m_sAddress, CConnection::m_tConnected, CShareazaApp::Message(), MSG_ERROR, PROTOCOL_ED2K, ReadPacketsED2K(), SendPacketsED2K(), Settings, theApp, CSettings::sConnection::TimeoutConnect, and CSettings::sConnection::TimeoutHandshake. |
|
Definition at line 779 of file ChatSession.cpp. References m_bOld, m_pWndPrivate, NULL, CPrivateChatFrame::OnRemoteMessage(), and CConnection::StartsWith(). Referenced by ReadText(). |
|
Definition at line 1229 of file ChatSession.cpp. References m_pWndPrivate, m_pWndPublic, NULL, CShareazaApp::SafeMainWnd(), theApp, and WM_OPENCHAT. Referenced by OnChatRequest(), OnED2KMessage(), and OnEstablished(). |
|
Definition at line 754 of file ChatSession.cpp. References cssHandshake, m_nProtocol, m_nState, CConnection::m_pOutput, CConnection::OnWrite(), CBuffer::Print(), and PROTOCOL_G2. Referenced by SendPrivateMessage(). |
|
Definition at line 381 of file ChatSession.cpp. References _tcsistr(), Close(), cssHeaders1, cssHeaders2, cssHeaders3, cssRequest1, cssRequest2, cssRequest3, IDS_CHAT_PRIVATE_REFUSED, m_bOld, m_nState, CConnection::m_pInput, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEBUG, CBuffer::ReadLine(), CConnection::StartsWith(), StatusMessage(), and theApp. Referenced by OnRead(). |
|
Definition at line 828 of file ChatSession.cpp. References Close(), G2_FLAG_BIG_ENDIAN, CSettings::Gnutella1, CBuffer::m_nLength, CBuffer::m_pBuffer, CConnection::m_pInput, CSettings::sGnutella1::MaximumPacket, CG2Packet::New(), OnPacket(), CPacket::Release(), CBuffer::Remove(), and Settings. Referenced by OnRead(). |
|
Definition at line 551 of file ChatSession.cpp. References ED2K_C2C_MESSAGE, ED2K_PROTOCOL_EDONKEY, ED2K_PROTOCOL_EMULE, m_bGUID, CEDPacket::m_nEdProtocol, CEDPacket::m_nType, CConnection::m_pInput, CConnection::m_sAddress, CShareazaApp::Message(), MSG_ERROR, NULL, OnChatMessage(), CEDPacket::ReadBuffer(), CPacket::Release(), and theApp. Referenced by OnRun(). |
|
Definition at line 763 of file ChatSession.cpp. References Close(), CConnection::m_pInput, OnText(), and CBuffer::ReadLine(). Referenced by OnRead(). |
|
Definition at line 816 of file ChatSession.cpp. References cssHandshake, m_nProtocol, m_nState, CConnection::m_pOutput, NULL, CConnection::OnWrite(), PROTOCOL_G2, CPacket::Release(), and CG2Packet::ToBuffer(). Referenced by OnChatRequest(), OnEstablished(), OnProfileChallenge(), OnProfileDelivery(), and SendPrivateMessage(). |
|
|
Definition at line 590 of file ChatSession.cpp. References ED2K_PROTOCOL_EMULE, CConnection::m_pOutput, NULL, CEDPacket::ReadBuffer(), and SendChatMessage(). Referenced by OnRun(). |
|
|
Definition at line 205 of file ChatSession.cpp. References CConnection::Close(), cssNull, IDS_CHAT_PUSH_SENT, m_bGUID, m_nProtocol, m_nState, m_pGUID, CConnection::m_pHost, CConnection::m_tConnected, m_tPushed, Network, PROTOCOL_ED2K, CNetwork::SendPush(), and StatusMessage(). Referenced by Connect(), and OnDropped(). |
|
Definition at line 102 of file ChatSession.cpp. References ChatCore, m_bGUID, m_bMustPush, m_pGUID, CConnection::m_pHost, CChatCore::m_pSection, m_sUserNick, and NULL. Referenced by CPrivateChatFrame::Initiate(). |
|
Definition at line 1193 of file ChatSession.cpp. References LoadString(), m_pWndPrivate, NULL, and CChatFrame::OnStatusMessage(). Referenced by Close(), Connect(), OnChatAnswer(), CPrivateChatFrame::OnChatPriority(), OnConnected(), OnDropped(), OnED2KMessage(), OnEstablished(), CPrivateChatFrame::OnLocalMessage(), OnOpenWindow(), OnPush(), ReadHandshake(), SendChatMessage(), and SendPush(). |
|
Definition at line 46 of file ChatSession.h. Referenced by CChatSession(), CChatWindows::FindPrivate(), CChatCore::FindSession(), CPrivateChatFrame::OnChatBrowse(), OnOpenWindow(), OnProfileDelivery(), OnPush(), ReadPacketsED2K(), SendPush(), and Setup(). |
|
Definition at line 52 of file ChatSession.h. Referenced by CChatSession(), Connect(), CChatWindows::FindPrivate(), CChatCore::FindSession(), OnOpenWindow(), and Setup(). |
|
Definition at line 51 of file ChatSession.h. Referenced by CChatSession(), OnEstablished(), OnText(), ReadHandshake(), and SendPrivateMessage(). |
|
Definition at line 57 of file ChatSession.h. Referenced by CChatSession(), CChatCore::FindSession(), OnChatMessage(), and SendPrivateMessage(). |
|
Definition at line 58 of file ChatSession.h. Referenced by CChatSession(), CChatWindows::FindPrivate(), CChatCore::FindSession(), and OnOpenWindow(). |
|
|
Definition at line 49 of file ChatSession.h. Referenced by CPrivateChatFrame::Accept(), AttachTo(), CChatSession(), Close(), Connect(), CChatCore::FindSession(), GetConnectedState(), OnChatAnswer(), OnConnected(), OnDropped(), OnED2KMessage(), OnEstablished(), OnHeadersComplete(), OnOpenWindow(), OnPush(), OnRead(), OnRun(), Print(), ReadHandshake(), Send(), SendChatMessage(), SendPrivateMessage(), and SendPush(). |
|
Definition at line 47 of file ChatSession.h. Referenced by CChatWindows::FindPrivate(), CChatCore::FindSession(), CPrivateChatFrame::OnChatBrowse(), OnOpenWindow(), OnProfileDelivery(), OnPush(), SendChatMessage(), SendPush(), and Setup(). |
|
Definition at line 56 of file ChatSession.h. Referenced by CChatSession(), OnCloseWindow(), OnProfileDelivery(), and ~CChatSession(). |
|
Definition at line 59 of file ChatSession.h. Referenced by CChatSession(), CChatCore::FindSession(), and OnOpenWindow(). |
|
Definition at line 61 of file ChatSession.h. Referenced by CChatSession(), Close(), OnChatMessage(), OnCloseWindow(), OnEstablished(), OnOpenWindow(), OnProfileDelivery(), OnText(), PostOpenWindow(), and StatusMessage(). |
|
Definition at line 62 of file ChatSession.h. Referenced by CChatSession(), Close(), OnCloseWindow(), OnOpenWindow(), and PostOpenWindow(). |
|
Reimplemented from CConnection. Definition at line 54 of file ChatSession.h. Referenced by CChatCore::FindSession(), and OnHeaderLine(). |
|
Definition at line 55 of file ChatSession.h. Referenced by CChatCore::FindSession(), OnChatAnswer(), OnED2KMessage(), OnHeaderLine(), OnOpenWindow(), OnProfileDelivery(), CPrivateChatFrame::OnProfileReceived(), SendChatMessage(), and Setup(). |
|
Definition at line 53 of file ChatSession.h. Referenced by CChatSession(), OnDropped(), OnPush(), and SendPush(). |