| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- /*
- ** 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 <http://www.gnu.org/licenses/>.
- */
- /******************************************************************************
- *
- * NAME
- * $Archive: /Commando/Code/Commando/DlgMPConnectionRefused.cpp $
- *
- * DESCRIPTION
- *
- ******************************************************************************/
- #include "DlgMPConnectionRefused.h"
- #include "cnetwork.h"
- #include "resource.h"
- #include <wwdebug\wwdebug.h>
- #include "dlgmainmenu.h"
- #include "gamespyadmin.h"
- #include "specialbuilds.h"
- #include "dialogtests.h"
- #include "dialogmgr.h"
- #include "gameinitmgr.h"
- /******************************************************************************
- *
- * NAME
- * DlgMPConnectionRefused::DoDialog
- *
- * DESCRIPTION
- *
- * INPUTS
- * NONE
- *
- * RESULT
- * True if dialog created successfully.
- *
- ******************************************************************************/
- bool DlgMPConnectionRefused::DoDialog(const WCHAR * text, bool show_splash_screen)
- {
- DlgMPConnectionRefused* popup = new DlgMPConnectionRefused(text, show_splash_screen);
- if (popup)
- {
- popup->Start_Dialog();
- popup->Release_Ref();
- }
- return (popup != NULL);
- }
- /******************************************************************************
- *
- * NAME
- * DlgMPConnectionRefused::DlgMPConnectionRefused
- *
- * DESCRIPTION
- * Constructor
- *
- * INPUTS
- * NONE
- *
- * RESULT
- * NONE
- *
- ******************************************************************************/
- DlgMPConnectionRefused::DlgMPConnectionRefused(const WCHAR * text, bool show_splash_screen) :
- PopupDialogClass(IDD_MULTIPLAY_CONNECTION_REFUSED)
- {
- WWDEBUG_SAY(("DlgMPConnectionRefused: Instantiated\n"));
- WWASSERT(text != NULL);
- Text.Format(text);
- ShowSplashScreen = show_splash_screen;
- }
- /******************************************************************************
- *
- * NAME
- * DlgMPConnectionRefused::~DlgMPConnectionRefused
- *
- * DESCRIPTION
- * Destructor
- *
- * INPUTS
- * NONE
- *
- * RESULT
- * NONE
- *
- ******************************************************************************/
- DlgMPConnectionRefused::~DlgMPConnectionRefused()
- {
- WWDEBUG_SAY(("DlgMPConnectionRefused: Destructing\n"));
- }
- /******************************************************************************
- *
- * NAME
- * DlgMPConnectionRefused::On_Init_Dialog
- *
- * DESCRIPTION
- *
- * INPUTS
- * NONE
- *
- * RESULT
- * NONE
- *
- ******************************************************************************/
- void DlgMPConnectionRefused::On_Init_Dialog(void)
- {
- Set_Dlg_Item_Text(IDC_REFUSAL_TEXT, Text);
- PopupDialogClass::On_Init_Dialog();
- }
- /******************************************************************************
- *
- * NAME
- * DlgMPConnectionRefused::On_Command
- *
- * DESCRIPTION
- * Process command messages from controls
- *
- * INPUTS
- * Ctrl - ID of control
- * Message -
- * Param - 0 = User invoked abort. 1 = Connection refused by server.
- *
- * RESULT
- * NONE
- *
- ******************************************************************************/
- void DlgMPConnectionRefused::On_Command(int ctrlID, int message, DWORD param)
- {
- if ((IDOK == ctrlID) && (1 != param))
- {
- if (cNetwork::I_Am_Client())
- {
- cNetwork::Cleanup_Client();
- }
- if (cGameSpyAdmin::Get_Is_Launched_From_Gamespy())
- {
- #ifdef MULTIPLAYERDEMO
- GameInitMgrClass::End_Game ();
- if (ShowSplashScreen)
- {
- DialogMgrClass::Flush_Dialogs ();
- START_DIALOG (SplashOutroMenuDialogClass);
- }
- else
- {
- extern void Stop_Main_Loop (int);
- Stop_Main_Loop(EXIT_SUCCESS);
- }
- #else
- extern void Stop_Main_Loop (int);
- Stop_Main_Loop(EXIT_SUCCESS);
- #endif // MULTIPLAYERDEMO
- }
- else if (DialogMgrClass::Get_Dialog_Count () == 1)
- {
- START_DIALOG (MainMenuDialogClass);
- }
- }
- PopupDialogClass::On_Command(ctrlID, message, param);
- }
|