TitanInterface.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. #ifndef _TitanInterface_H
  2. #define _TitanInterface_H
  3. #include "DEQUE"
  4. #include "MAP"
  5. #include "LIST"
  6. #include "STRING"
  7. #include "VECTOR"
  8. #include "common/CriticalSection.h"
  9. #include "common/ThreadBase.h"
  10. #include "msg/comm/SMsgCommRegisterRequest.h"
  11. #include "msg/fact/SMsgFactStartProcessUnicode.h"
  12. #include "msg/routing/MMsgRoutingRegisterClient.h"
  13. #include "EasySocket/EasySocket.h"
  14. #include "EasySocket/PipeCmd.h"
  15. #include "crypt/EGPrivateKey.h"
  16. #include "crypt/EGPublicKey.h"
  17. #include "crypt/BFSymmetricKey.h"
  18. #include "auth/Auth1PublicKeyBlock.h"
  19. #include "auth/Auth1Certificate.h"
  20. typedef int BOOL;
  21. typedef char* LPSTR;
  22. typedef const char* LPCSTR;
  23. typedef unsigned char BYTE;
  24. #include "MD52.h"
  25. extern "C"
  26. {
  27. #include "TitanInterfaceC.h"
  28. }
  29. namespace WONMisc {
  30. class EasySocketEngine;
  31. class SocketPipe;
  32. class EasySocket;
  33. };
  34. namespace WONMsg {
  35. class TRawMsg;
  36. class TMessage;
  37. };
  38. enum IpType {
  39. ip,
  40. ipx
  41. };
  42. typedef union {
  43. WONMisc::SocketPipe *pipe;
  44. WONMsg::ClientId id;
  45. } ClientMapUnion;
  46. typedef std::pair<unsigned long, unsigned long> ClientNetAddr;
  47. typedef std::map<ClientNetAddr, ClientMapUnion> ClientToPipe;
  48. class TitanInterface : public WONCommon::ThreadBase
  49. {
  50. public:
  51. TitanInterface(unsigned long isLan, unsigned long isIP);
  52. ~TitanInterface();
  53. // Overridden from ThreadBase
  54. void startThread();
  55. void stopThread();
  56. void loadVerifierKey();
  57. //Creates a socket to verify that networking with current protocol is possible
  58. unsigned long CanNetwork(void);
  59. //--MikeN
  60. // Begin shutdown procesing. Sends shutdown msg to all connected clients and
  61. // closes connection after msg has been sent.
  62. void StartShutdown(unsigned char titanMsgType, const void* thePacket, unsigned short theLen);
  63. // Request the list of valid Homeworld client versions from a Directory Server
  64. void RequestValidVersions();
  65. // Request directory contents, theDir is subdir of /Homeworld dir
  66. // Set theDir to NULL to get contents of /Homeworld
  67. void RequestDirectory();
  68. // Game data maintenance (create, delete, replace)
  69. void RequestCreateGame(const wchar_t* theGame, DirectoryCustomInfo* myInfo);
  70. void RequestDeleteGame(const wchar_t* theGame);
  71. void RequestReplaceGame(const wchar_t* theGame, DirectoryCustomInfo* myInfo, unsigned long replaceTimeout);
  72. void RequestRenewGameLifespan(const wchar_t* theGame, unsigned long newLifespan);
  73. // Connect to a client
  74. void ConnectToClient(Address* theAddressP);
  75. // Ping a game
  76. void SendPing(Address* theAddressP,unsigned int pingsizebytes);
  77. // Send a Lan broadcast
  78. void SendLanBroadcast(const void* thePacket, unsigned short theLen);
  79. void BroadcastPacket(unsigned char titanMsgType, const void* thePacket, unsigned short theLen);
  80. // Send a packet to a client
  81. void SendPacketTo(Address* theAddressP, unsigned char titanMsgType,
  82. const void* thePacket, unsigned short theLen,
  83. bool appendSeqNum = false, int theSeqNum = 0);
  84. // Authentication stuff
  85. void Authenticate(const string &loginName, const string &password, const string &theNewPassword, bool CreateAccount);
  86. // Routing Server stuff
  87. unsigned long StartRoutingServer(const wchar_t* theChannelName, const wchar_t* theChannelDescription, const wchar_t* thePassword, bool isGameServer,unsigned char *routingaddress);
  88. void RegisterRoutingServer(void);
  89. void HandleRoutingRegisterReply(WONMisc::SocketPipe* thePipeP, const WONMsg::SmallMessage& theMsgR);
  90. void ConnectToRoutingServer(wstring theUserName, const wchar_t* thePassword, int theServer, bool reconnect = false);
  91. void CloseRoutingServerConnection(int theServer);
  92. void RoutingSendChatBroadcast(unsigned short theSize, const unsigned char* theDataP, int theServer = 0, bool appendSeqNum = false, int theSeqNum = 0);
  93. void RoutingSendChatWhisper(unsigned long* theIds, unsigned short theNumIds, unsigned short theSize, const unsigned char* theDataP, bool addSeqNum =false, int theSeqNum =0);
  94. void RoutingSendDataBroadcast(unsigned short theSize, const unsigned char* theDataP, int theServer = 0, bool appendSeqNum = false, int theSeqNum = 0);
  95. void RoutingSendData(WONMsg::ClientId theId, unsigned short theSize, const unsigned char* theDataP, int theServer = 0, bool appendSeqNum = false, int theSeqNum = 0);
  96. void SetGameKey(unsigned char *key);
  97. const unsigned char *GetGameKey(void);
  98. // Patch stuff
  99. int GetPatch(const char *theFilename,const char *saveFileName);
  100. static void GetPatch(void *theArgs);
  101. bool CheckStartingGame(unsigned char *routingaddress);
  102. bool BehindFirewall(void);
  103. void LeaveGameNotify(void);
  104. Address GetMyPingAddress(void);
  105. void ConnectingCancelHit();
  106. // void QueryRoutingServers(void);
  107. void PumpEngine();
  108. void OnInitialLobbyEnter(void);
  109. void OnFinalLobbyExit(void);
  110. void OnCaptainStartedGame(void);
  111. void CreateMediaMetrixEditControl(void);
  112. static bool TitanInterface::SaveWonstuff();
  113. private:
  114. bool mUseRoutingServer; // Are we using a routing server for game communication?
  115. bool mUseOldScheme; // Old
  116. bool mLaunched;
  117. bool mBehindFirewall;
  118. bool mIsGameServer; // is the Routing Server that we're starting a game server (true) or a chat server (false)
  119. bool mAmCaptain;
  120. bool mRoutingReconnect[2];
  121. int mRoutingReconnectNum[2];
  122. bool mLoggedInToRoutingServer[2];
  123. bool mHaveConnectedToAChatServer;
  124. bool mGameDisconnectWasVoluntary;
  125. bool mFailFactOverDirectly;
  126. int mCaptainReconnectNum;
  127. HWND mMediaMetrixHWND; // MediaMetrix edit control HANDLE
  128. std::vector<std::wstring> mRoutingQueryMap;
  129. // std::vector<SOCKADDR_IN> mRoutingAddrMap;
  130. unsigned short mRoutingQueryOffset;
  131. void InitPacketList(void);
  132. void AddPacketToList(const std::basic_string<unsigned char> &thePacket, unsigned char theType);
  133. std::list<std::basic_string<unsigned char> > mPacketList;
  134. std::list<unsigned char> mPacketTypeList;
  135. unsigned long mFirstPacket;
  136. unsigned long mSeqNum;
  137. CaptainGameInfo mOldtpGameCreated;
  138. enum { GAME_NOT_STARTED, GAME_STARTING, GAME_STARTED } mGameCreationState;
  139. struct LoginKeyStruct {
  140. unsigned long authAddr;
  141. unsigned short authPort;
  142. char loginKey[8];
  143. char newLoginKey[8];
  144. };
  145. char mOldNewLoginKey[8];
  146. int mNumPlayersJoined;
  147. Address mMyIPAddress; // Remember this for later
  148. Address mCaptainAddress;
  149. WONMisc::EasySocketEngine* mEngine; // Socket engine
  150. WONMisc::SocketPipe* mAuthPipe; // AuthServer connection
  151. WONMisc::SocketPipe* mDirPipe; // DirServer connection
  152. WONMisc::SocketPipe* mEventPipe; // EventServer "connection" (UDP)
  153. WONMisc::SocketPipe* mFactPipe; // FactoryServer connection
  154. WONMisc::SocketPipe* mRoutePipe[2]; // RoutingServer connection
  155. WONMisc::SocketPipe* mLanAdPipe; // For advertising games, people, LAN chat
  156. WONMisc::SocketPipe* mTimerPipe; // For refreshing certificate
  157. WONMisc::SocketPipe* mFirewallPipe;
  158. WONMisc::SocketPipe* mFactPingPipe;
  159. WONMisc::SocketPipe* mRoutingInfoPipe;
  160. WONMisc::SocketPipe* mCaptainPipe;
  161. long mCurFactPing;
  162. unsigned long mMinPingTime;
  163. int mNumPingTrials;
  164. ClientToPipe mClientMap; // Client connections
  165. bool mCloseRequest; // Shutdown requested?
  166. IpType mIpType; // ip or ipx
  167. bool mIsLan; // is this a lan game
  168. WONMisc::EasySocket::SocketType mDatagramType; // IPX or UDP
  169. WONMisc::EasySocket::SocketType mStreamType; // SPX or TCP
  170. // Auth stuff
  171. WONCrypt::EGPublicKey *mVerifierKey; // Auth verifier key
  172. WONCrypt::EGPrivateKey *mPrivateKey; // Private key for certificate
  173. WONAuth::Auth1PublicKeyBlock *mPublicKeyBlock; // Auth public key block
  174. WONAuth::Auth1Certificate *mCertificate; // Auth certificate
  175. time_t mAuthDeltaTime; // Difference from auth server clock
  176. bool mNeedToAuthenticateAfterGettingAuthDirectory;
  177. WONCrypt::BFSymmetricKey *mAuthSessionKey;
  178. WONCrypt::BFSymmetricKey *mDirSessionKey;
  179. WONCrypt::BFSymmetricKey *mDirClientSecret;
  180. WONCrypt::BFSymmetricKey *mFactSessionKey;
  181. WONCrypt::BFSymmetricKey *mFactClientSecret;
  182. WONCrypt::BFSymmetricKey *mRouteSessionKey[2];
  183. WONCrypt::BFSymmetricKey *mRouteClientSecret[2];
  184. unsigned short mDirInSeqNum;
  185. unsigned short mDirOutSeqNum;
  186. unsigned short mDirSessionId;
  187. unsigned short mFactSessionId;
  188. unsigned long mNumAuthServersTried;
  189. unsigned long mCurAuthServer;
  190. unsigned long mNumDirServersTried;
  191. unsigned long mCurDirServer;
  192. unsigned long mNumFactServersTried;
  193. unsigned long mCurFactServer;
  194. unsigned long mNumFirewallServersTried;
  195. unsigned long mCurFirewallServer;
  196. std::wstring mChannelName;
  197. std::wstring mChannelDescription;
  198. std::wstring mRoomPassword;
  199. std::string mLoginName;
  200. std::string mPassword;
  201. std::string mNewPassword;
  202. bool mCreateAccount;
  203. WONMsg::SMsgFactStartProcessUnicode mStartProcessMsg;
  204. WONMsg::MMsgRoutingRegisterClient mRouteRegisterMsg;
  205. WONMsg::SMsgCommRegisterRequest mRegisterRoutingServerMsg;
  206. bool mNeedToRegisterRoutingServer;
  207. unsigned long FACTSERVER_NUM;
  208. unsigned long AUTHSERVER_NUM;
  209. unsigned long FIREWALLSERVER_NUM;
  210. unsigned long EVENTSERVER_NUM;
  211. SOCKADDR_IN FACTSERVER_ADDRESSES[MAX_IPS];
  212. SOCKADDR_IN AUTHSERVER_ADDRESSES[MAX_IPS];
  213. SOCKADDR_IN FIREWALLSERVER_ADDRESSES[MAX_IPS];
  214. SOCKADDR_IN EVENTSERVER_ADDRESSES[MAX_IPS];
  215. // For Routing Server
  216. WONMsg::ClientId mMyClientId[2]; // client id of the local user
  217. bool mHaveReceivedInitialUserList; // Initial list of users here?
  218. SOCKADDR_IN mRoutingAddress[2]; // Routing server address
  219. std::deque<unsigned char> mWaitingRequestQueue[2]; // queue of messages (message types) waiting for StatusReply messages
  220. WONCrypt::BFSymmetricKey mGameKey; // stored on Routing Server when you create a game
  221. // Critical sections
  222. WONCommon::CriticalSection mPipeCrit;
  223. WONCommon::CriticalSection mClientCrit;
  224. WONCommon::CriticalSection mRoutingCrit;
  225. WONCommon::CriticalSection mPacketCrit;
  226. WONCommon::CriticalSection mStartRoutingCrit;
  227. int threadProcess();
  228. void ChangeAddress(Address *theOldAddress, Address *theNewAddress);
  229. void HandleWaitCmd(WONMisc::PipeCmd* theCmdP);
  230. void HandleAcceptCmd(WONMisc::SocketPipe* thePipeP, WONMisc::PipeCmd* theCmdP);
  231. void HandleCloseCmd(WONMisc::SocketPipe* thePipeP);
  232. void HandleRecvCmd(WONMisc::SocketPipe* thePipeP, WONMisc::PipeCmd* theCmdP, bool pipeClosed);
  233. void HandleTitanMsg(WONMisc::SocketPipe* thePipeP, const char* theBufP, unsigned long theLen);
  234. void HandleSmallMsg(WONMisc::SocketPipe* thePipeP, const char* theBufP, unsigned long theLen);
  235. void HandleMiniMsg(WONMisc::SocketPipe* thePipeP, const char* theBufP, unsigned long theLen);
  236. void HandleLanBroadcastMsg(WONMisc::SocketPipe* thePipeP, const char* theBufP, unsigned long theLen);
  237. // Directory server stuff
  238. void DirFailOver(void);
  239. void ResetDirFailOver(void);
  240. void DirHandleGetTitanServers(void);
  241. void DirHandleGetHWDirectory(void);
  242. void DirStartPeerLogin(void);
  243. void HandleDirStatusReply(const WONMsg::TMessage& theMsgR);
  244. void HandleGetDirReply(const WONMsg::TMessage& theMsgR);
  245. void HandleDirMultiEntityReply(const WONMsg::SmallMessage& theMsgR);
  246. // Factory Server Stuff
  247. void FactFailOver(void);
  248. void ResetFactFailOver(void);
  249. void PingFactServer(void);
  250. void PingHandleReply(const WONMsg::MiniMessage& theMsgR);
  251. void HandleStartRoutingReply(WONMisc::SocketPipe* thePipeP, const WONMsg::SmallMessage& theMsgR);
  252. void FactHandleStartProcess(void);
  253. // Firewall Server stuff
  254. void FirewallFailOver(void);
  255. void FirewallDetect(void);
  256. void HandleFirewallResponse(WONMisc::SocketPipe *thePipeP, const WONMsg::SmallMessage& theMsgR);
  257. // Authentication server stuff
  258. void AuthFailOver(void);
  259. void ResetAuthFailOver(void);
  260. bool ReadLoginKey(char *theKey);
  261. void WriteLoginKey(char *theKey, bool useOldNewLoginKey = false);
  262. void AuthHandleGetPubKeysReply(const WONMsg::TMessage &theMsg);
  263. void AuthGetPubKeyBlock(void);
  264. void AuthHandleLogin(void);
  265. void AuthHandleChallenge(const WONMsg::TMessage &theMsg);
  266. void AuthHandleLoginReply(const WONMsg::TMessage &theMsg);
  267. void AuthHandleRefresh(void);
  268. void PeerHandleChallenge(WONMisc::SocketPipe** thePipeP, const WONMsg::TMessage& theMsgR);
  269. void PeerHandleComplete(WONMisc::SocketPipe** thePipeP, const WONMsg::TMessage& theMsgR);
  270. void PeerHandleMiniChallenge(WONMisc::SocketPipe** thePipeP, const WONMsg::MiniMessage& theMsgR);
  271. void PeerHandleMiniComplete(WONMisc::SocketPipe** thePipeP, const WONMsg::MiniMessage& theMsgR);
  272. bool EncryptMessage(const WONMsg::BaseMessage &theInMsg, WONMsg::BaseMessage &theOutMsg, const WONCrypt::BFSymmetricKey &theKey, unsigned short theSessionId, unsigned short *theSeqNum);
  273. // bool EncryptTMessage(const WONMsg::BaseMessage &theInMsg, WONMsg::BaseMessage &theOutMsg, const WONCrypt::BFSymmetricKey &theKey, unsigned short theSessionId, unsigned short *theSeqNum);
  274. bool EncryptNonTMessage(const WONMsg::BaseMessage &theInMsg, WONMsg::BaseMessage &theOutMsg, const WONCrypt::BFSymmetricKey &theKey, unsigned short theSessionId, unsigned short *theSeqNum);
  275. bool DecryptMessage(const char *theBuf, unsigned long theLen, WONMsg::BaseMessage &theOutMsg, WONMisc::SocketPipe **thePipePP);
  276. // bool DecryptTMessage(const char *theBuf, unsigned long theLen, WONMsg::BaseMessage &theOutMsg, WONMisc::SocketPipe **thePipePP);
  277. bool DecryptNonTMessage(const char *theBuf, unsigned long theLen, WONMsg::BaseMessage &theOutMsg, WONMisc::SocketPipe **thePipePP);
  278. // void HandleGetNumUsersReply(WONMisc::SocketPipe *thePipeP, const WONMsg::MiniMessage& theMsgR);
  279. // Routing Server methods
  280. void HandleRoutingGroupChange(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR, int theServer);
  281. void HandleRoutingGroupChangeEx(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR, int theServer);
  282. void HandleRoutingGetClientListReply(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR, int theServer);
  283. void HandleRoutingRegisterClientReply(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR, int theServer);
  284. void HandleRoutingCreateDataObject(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR);
  285. void HandleRoutingDeleteDataObject(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR);
  286. void HandleRoutingPeerChat(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR, int theServer);
  287. void HandleRoutingPeerData(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR, int theServer);
  288. void HandleRoutingPeerData(WONMisc::SocketPipe* thePipeP, const WONCommon::RawBuffer &theData,WONMsg::ClientId theId, int theServer);
  289. void HandleRoutingPeerDataMultiple(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR, int theServer);
  290. void HandleRoutingReadDataObjectReply(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR);
  291. void HandleRoutingReplaceDataObject(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR);
  292. void HandleRoutingStatusReply(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR, int theServer);
  293. void HandleRoutingRegister(int theServer);
  294. void OnNewRoutingServerClient(WONMsg::ClientId theClientId, const std::wstring& theUserNameR, unsigned long theIPAddress, int theServer);
  295. // Event Server stuff
  296. unsigned long mEventTag;
  297. bool mHasLobbyEnterEventBeenSent;
  298. time_t mLobbyEnterTime;
  299. time_t mGameStartTime;
  300. void RecordEvent(unsigned short theEventType);
  301. // Homeworld stuff
  302. void HandlePeerMsg(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR);
  303. void HandleJoinGame(WONMisc::SocketPipe* thePipeP, const TitanPacketMsg& theMsgR);
  304. void HandleJoinConfirm(WONMisc::SocketPipe* thePipeP, const TitanPacketMsg& theMsgR);
  305. void HandleLeaveGame(WONMisc::SocketPipe* thePipeP, const TitanPacketMsg& theMsgR);
  306. void HandleJoinReject(WONMisc::SocketPipe* thePipeP, const TitanPacketMsg& theMsgR);
  307. void HandleGameData(const TitanPacketMsg& theMsgR);
  308. void HandleGameStart(const TitanPacketMsg& theMsgR);
  309. void HandleGameMsg(const TitanPacketMsg& theMsgR);
  310. void HandleGameDisolved(const TitanPacketMsg& theMsgR);
  311. void HandleKickedOutOfGame(const TitanPacketMsg& theMsgR);
  312. void HandleUpdatePlayer(WONMisc::SocketPipe* thePipeP, const TitanPacketMsg& theMsgR);
  313. void HandleChannelList(WONMsg::DirEntityList& dirEntities);
  314. void HandleTitanServerList(WONMsg::DirEntityList& dirEntities);
  315. void HandlePing(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR);
  316. void HandlePingReply(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR);
  317. void HandleClientReconnect(WONMisc::SocketPipe* thePipeP, const WONMsg::MiniMessage& theMsgR);
  318. void HandleBeginStartGame(WONMisc::SocketPipe* thePipeP, const TitanPacketMsg& theMsgR);
  319. void HandleChangeAddress(WONMisc::SocketPipe* thePipeP, const TitanPacketMsg& theMsgR);
  320. void HandleRequestPackets(WONMisc::SocketPipe* thePipeP, const TitanPacketMsg& theMsgR);
  321. // Utility
  322. ClientNetAddr TitanInterface::MakeClientNetAddr(Address* theAddressP);
  323. void TitanInterface::InitDestAddress(Address* theAddressP, WONMisc::SocketPipe* thePipeP);
  324. void BuildAddress(SOCKADDR_IN& theAddrR, long theIP, unsigned short thePort);
  325. void BuildAddress(SOCKADDR_IN& theAddrR, const WONCommon::RawBuffer& theSixBytes);
  326. void BuildAddress(SOCKADDR_IN& theAddrR, unsigned char buffer[]);
  327. const char* PrintAddress(SOCKADDR_IN& theAddrR);
  328. const char* PrintAddress(const WONCommon::RawBuffer& theSixBytes);
  329. bool SendMsg(WONMisc::SocketPipe* thePipeP, const WONMsg::BaseMessage& theMsgR, unsigned char theLengthFieldSize = 0);
  330. unsigned long GetLengthFieldSize(const WONMsg::BaseMessage& theMsgR);
  331. unsigned long GetLocalIPAddress(void);
  332. bool EncryptAndSendRoutingMsg(const WONMsg::BaseMessage &theMsgR, int theServer);
  333. WONMisc::SocketPipe* ConnectTo(const SOCKADDR& theDest, WONMisc::EasySocket::SocketType theType=WONMisc::EasySocket::TCP, WONMisc::RecvLengthPrefixType thePrefixType=WONMisc::ptUnsignedLong);
  334. WONMisc::SocketPipe* ConnectTo(const Address& theDest, WONMisc::EasySocket::SocketType theType=WONMisc::EasySocket::TCP, WONMisc::RecvLengthPrefixType thePrefixType=WONMisc::ptUnsignedLong);
  335. WONMisc::SocketPipe* ConnectAndSend(const SOCKADDR& theDest, const WONMsg::BaseMessage& theMsgR, WONMisc::EasySocket::SocketType theType=WONMisc::EasySocket::TCP, WONMisc::RecvLengthPrefixType thePrefixType=WONMisc::ptUnsignedLong);
  336. WONMisc::SocketPipe* ConnectAndSend(const SOCKADDR_IN& theDest, const WONMsg::BaseMessage& theMsgR, WONMisc::EasySocket::SocketType theType=WONMisc::EasySocket::TCP, WONMisc::RecvLengthPrefixType thePrefixType=WONMisc::ptUnsignedLong);
  337. WONMisc::SocketPipe* ConnectAndSend(const Address& theDest, const WONMsg::BaseMessage& theMsgR, WONMisc::EasySocket::SocketType theType=WONMisc::EasySocket::TCP, WONMisc::RecvLengthPrefixType thePrefixType=WONMisc::ptUnsignedLong);
  338. static unsigned long GetHashSection(bool restart, unsigned char** theUnhashedBufP, unsigned char digest[MD5_HASH_SIZE]);
  339. static void TitanInterface::ShortCircuitChallengeResponse(unsigned char* theSeed, unsigned char* theChallengeResponseP);
  340. static bool TitanInterface::ReadFromWonstuff(bool restart, unsigned char* theBufferP);
  341. };
  342. #endif // _TitanInterface_H