From 7af85d6f2f203dad5e7f4d960d35dff0c0228242 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 1 Apr 2014 13:52:36 +0200 Subject: [PATCH] Add command to eternally trap players ingame --- code/ryzom/client/src/global.cpp | 2 ++ code/ryzom/client/src/global.h | 2 ++ .../client/src/interface_v3/interface_manager.cpp | 13 +++++++++++++ code/ryzom/client/src/net_manager.cpp | 9 +++++++++ code/ryzom/common/data_common/msg.xml | 4 ++-- 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/global.cpp b/code/ryzom/client/src/global.cpp index ac15aafbc..29db04f5e 100644 --- a/code/ryzom/client/src/global.cpp +++ b/code/ryzom/client/src/global.cpp @@ -69,6 +69,8 @@ bool PermanentlyBanned = false; bool IgnoreEntityDbUpdates = false; bool FreeTrial = false; +bool NoLogout = false; + std::vector > VRDeviceCache; diff --git a/code/ryzom/client/src/global.h b/code/ryzom/client/src/global.h index 28f98a3a9..f22f786d6 100644 --- a/code/ryzom/client/src/global.h +++ b/code/ryzom/client/src/global.h @@ -130,6 +130,8 @@ extern std::string Cookie, FSAddr; extern std::string RingMainURL; extern bool FreeTrial; +extern bool NoLogout; + void resetTextContext (const char *font, bool resetInterfaceManager); #endif // CL_GLOBAL_H diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 8a70e10fd..df2cb0376 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -1089,6 +1089,7 @@ void CInterfaceManager::configureQuitDialogBox() // Show Launch Editor if not in editor mode CInterfaceElement *eltCancel = quitDlg->getElement(quitDialogStr+":cancel"); CInterfaceElement *eltEdit = quitDlg->getElement(quitDialogStr+":launch_editor"); + if (eltEdit) { if (UserRoleInSession != R2::TUserRole::ur_editor && !sessionOwner) @@ -1159,6 +1160,18 @@ void CInterfaceManager::configureQuitDialogBox() eltQuitNow->setActive(false); } } + + if (NoLogout) + { + eltEdit->setY(0); + eltEdit->setActive(false); + eltQuit->setY(0); + eltQuit->setActive(false); + eltQuitNow->setY(0); + eltQuitNow->setActive(false); + eltRet->setY(0); + eltRet->setActive(false); + } } // Make all controls have the same size diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 1eedc16c5..487e05358 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -3555,6 +3555,13 @@ void impulseSetNpcIconTimer(NLMISC::CBitMemStream &impulse) CNPCIconCache::getInstance().setMissionGiverTimer(delay); } +void impulseEventDisableLogoutButton(NLMISC::CBitMemStream &impulse) +{ + NoLogout = true; + CInterfaceManager *im = CInterfaceManager::getInstance(); + im->configureQuitDialogBox(); +} + //----------------------------------------------- // initializeNetwork : //----------------------------------------------- @@ -3704,6 +3711,8 @@ void initializeNetwork() GenericMsgHeaderMngr.setCallback( "NPC_ICON:SET_DESC", impulseSetNpcIconDesc ); GenericMsgHeaderMngr.setCallback( "NPC_ICON:SVR_EVENT_MIS_AVL", impulseServerEventForMissionAvailability ); GenericMsgHeaderMngr.setCallback( "NPC_ICON:SET_TIMER", impulseSetNpcIconTimer ); + + GenericMsgHeaderMngr.setCallback( "EVENT:DISABLE_LOGOUT_BUTTON", impulseEventDisableLogoutButton ); } diff --git a/code/ryzom/common/data_common/msg.xml b/code/ryzom/common/data_common/msg.xml index 3fa75650e..9ae6fab16 100644 --- a/code/ryzom/common/data_common/msg.xml +++ b/code/ryzom/common/data_common/msg.xml @@ -1111,8 +1111,8 @@ sendto="EGS" format="u32 u32 uc" description="set the cursom of the item in inventory $inventory in slot $slot to $text" /> - +