/* ** Command & Conquer Renegade(tm) ** Copyright 2025 Electronic Arts Inc. ** ** 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 3 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, see . */ /****************************************************************************** * * FILE * $Archive: /Commando/Code/WWOnline/WOLConnect.h $ * * DESCRIPTION * Westwood Online wait conditions. * * PROGRAMMER * $Author: Denzil_l $ * * VERSION INFO * $Revision: 14 $ * $Modtime: 1/29/02 1:44p $ * ******************************************************************************/ #ifndef __WOLCONNECT_H__ #define __WOLCONNECT_H__ #include "WOLSession.h" #include "WaitCondition.h" #include "WOLChatMsg.h" #include #include #include "RefPtr.h" namespace WWOnline { const wchar_t* const DefaultPassword = L"zotclot9"; //----------------------------------------------------------------------------- // Retrieve serverlist wait condition //----------------------------------------------------------------------------- class ServerListWait : public SingleWait, public Observer, public Observer { public: static RefPtr Create(const RefPtr& session); void WaitBeginning(void); protected: ServerListWait(const RefPtr&); virtual ~ServerListWait(); ServerListWait(const ServerListWait&); const ServerListWait& operator=(const ServerListWait&); void HandleNotification(ServerError& serverError); void HandleNotification(IRCServerList& serverList); RefPtr mSession; }; //----------------------------------------------------------------------------- // Disconnect from WWOnline wait condition //----------------------------------------------------------------------------- class DisconnectWait : public SingleWait, public Observer, public Observer { public: static RefPtr Create(const RefPtr& session); void WaitBeginning(void); void EndWait(WaitResult, const wchar_t*); protected: DisconnectWait(const RefPtr& session); virtual ~DisconnectWait(); DisconnectWait(const DisconnectWait&); const DisconnectWait& operator=(const DisconnectWait&); void HandleNotification(ServerError& serverError); void HandleNotification(ConnectionStatus& status); RefPtr mSession; }; //----------------------------------------------------------------------------- // Connect to WWOnline wait condition //----------------------------------------------------------------------------- class ConnectWait : public SingleWait, public Observer, public Observer { public: static RefPtr Create(const RefPtr& session, const RefPtr& server, const RefPtr& login); void WaitBeginning(void); void EndWait(WaitResult, const wchar_t*); protected: ConnectWait(const RefPtr& session, const RefPtr& server, const RefPtr& login); virtual ~ConnectWait(); ConnectWait(const ConnectWait&); const ConnectWait& operator=(const ConnectWait&); void HandleNotification(ServerError& serverError); void HandleNotification(ConnectionStatus& status); RefPtr mSession; RefPtr mServer; RefPtr mLogin; }; //----------------------------------------------------------------------------- // Request for chat channel list wait condition //----------------------------------------------------------------------------- class ChannelListWait : public SingleWait, public Observer, public Observer, public Observer { public: static RefPtr Create(const RefPtr& session, int type); void WaitBeginning(void); protected: ChannelListWait(const RefPtr& session, int type); virtual ~ChannelListWait(); ChannelListWait(const ChannelListWait&); const ChannelListWait& operator=(const ChannelListWait&); void HandleNotification(ServerError& serverError); void HandleNotification(ConnectionStatus& status); void HandleNotification(ChannelListEvent& event); RefPtr mSession; int mType; }; //----------------------------------------------------------------------------- // Request to leave a channel wait condition //----------------------------------------------------------------------------- class LeaveChannelWait : public SingleWait, public Observer, public Observer, public Observer { public: static RefPtr Create(const RefPtr& session); void WaitBeginning(void); protected: LeaveChannelWait(const RefPtr& session); virtual ~LeaveChannelWait(); LeaveChannelWait(const LeaveChannelWait&); const LeaveChannelWait& operator=(const LeaveChannelWait&); void HandleNotification(ServerError& serverError); void HandleNotification(ConnectionStatus& status); void HandleNotification(ChannelEvent& status); RefPtr mSession; }; //----------------------------------------------------------------------------- // Request to join a channel wait condition //----------------------------------------------------------------------------- class JoinChannelWait : public SingleWait, public Observer, public Observer, public Observer { public: static RefPtr Create(const RefPtr& session, const RefPtr& channel, const wchar_t* password); static RefPtr Create(const RefPtr& session, const wchar_t* channelName, const wchar_t* password, int type); void WaitBeginning(void); protected: JoinChannelWait(const RefPtr& session, const RefPtr& channel, const wchar_t* password); JoinChannelWait(const RefPtr& session, const wchar_t* channelName, const wchar_t* password, int type); virtual ~JoinChannelWait(); JoinChannelWait(const JoinChannelWait&); const JoinChannelWait& operator=(const JoinChannelWait&); void HandleNotification(ServerError& serverError); void HandleNotification(ConnectionStatus& status); void HandleNotification(ChannelEvent& status); RefPtr mSession; RefPtr mChannel; WideStringClass mChannelName; WideStringClass mPassword; int mType; }; //----------------------------------------------------------------------------- // Request to create a new channel wait condition //----------------------------------------------------------------------------- class CreateChannelWait : public SingleWait, public Observer, public Observer, public Observer { public: static RefPtr Create(const RefPtr& session, const RefPtr& channel, const wchar_t* password); void WaitBeginning(void); protected: CreateChannelWait(const RefPtr& session, const RefPtr& channel, const wchar_t* password); virtual ~CreateChannelWait(); CreateChannelWait(const CreateChannelWait&); const CreateChannelWait& operator=(const CreateChannelWait&); void HandleNotification(ServerError& serverError); void HandleNotification(ConnectionStatus& status); void HandleNotification(ChannelEvent& status); RefPtr mSession; RefPtr mChannel; WideStringClass mPassword; }; //----------------------------------------------------------------------------- // Request a new user list wait condition //----------------------------------------------------------------------------- class UserListWait : public SerialWait, public Observer, public Observer { public: static RefPtr Create(const RefPtr& session); void WaitBeginning(void); protected: UserListWait(const RefPtr& session); virtual ~UserListWait(); UserListWait(const UserListWait&); const UserListWait& operator=(const UserListWait&); void HandleNotification(ServerError&); void HandleNotification(UserList&); RefPtr mSession; }; //----------------------------------------------------------------------------- // Request to find a user wait condition //----------------------------------------------------------------------------- class GetUserWait : public SerialWait { public: static RefPtr Create(const RefPtr& session, const wchar_t* userName); void WaitBeginning(void); WaitResult GetResult(void); protected: GetUserWait(const RefPtr& session, const wchar_t* userName); virtual ~GetUserWait(); GetUserWait(const GetUserWait&); const GetUserWait& operator=(const GetUserWait&); RefPtr mSession; WideStringClass mUserName; }; //----------------------------------------------------------------------------- // Request to locate a user wait condition //----------------------------------------------------------------------------- class LocateUserWait : public SingleWait, public Observer, public Observer { public: static RefPtr Create(const RefPtr& session, const wchar_t* userName); void WaitBeginning(void); protected: LocateUserWait(const RefPtr& session, const wchar_t* userName); virtual ~LocateUserWait(); LocateUserWait(const LocateUserWait&); const LocateUserWait& operator=(const LocateUserWait&); void HandleNotification(ServerError&); void HandleNotification(UserEvent&); RefPtr mSession; WideStringClass mUserName; }; //----------------------------------------------------------------------------- // Request to send a private message to a user wait condition //----------------------------------------------------------------------------- class SendMsgWait : public SingleWait { public: static RefPtr Create(const RefPtr& session, ChatMessage& message); void WaitBeginning(void); protected: SendMsgWait(const RefPtr& session, ChatMessage& message); virtual ~SendMsgWait(); SendMsgWait(const SendMsgWait&); const SendMsgWait& operator=(const SendMsgWait&); RefPtr mSession; ChatMessage mMessage; }; } #endif // __WOLCONNECT_H__