Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27847
Modified Files:
ChangeLog commands.cpp gumps.cpp gumps.h speech.cpp wolf.dsp
wolfpack.pro wolfpack.vcproj
Removed Files:
pagesystem.h
Log Message:
pagesystem
--- pagesystem.h DELETED ---
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.273
retrieving revision 1.274
diff -C2 -d -r1.273 -r1.274
*** wolf.dsp 16 Sep 2004 14:57:45 -0000 1.273
--- wolf.dsp 8 Oct 2004 10:57:10 -0000 1.274
***************
*** 485,492 ****
# Begin Source File
- SOURCE=.\pagesystem.h
- # End Source File
- # Begin Source File
-
SOURCE=.\party.h
# End Source File
--- 485,488 ----
Index: gumps.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/gumps.cpp,v
retrieving revision 1.172
retrieving revision 1.173
diff -C2 -d -r1.172 -r1.173
*** gumps.cpp 2 Oct 2004 22:15:50 -0000 1.172
--- gumps.cpp 8 Oct 2004 10:57:10 -0000 1.173
***************
*** 35,39 ****
#include "spawnregions.h"
#include "accounts.h"
- #include "pagesystem.h"
#include "territories.h"
#include "basechar.h"
--- 35,38 ----
***************
*** 191,612 ****
}
}
-
- cPagesGump::cPagesGump( uint page, WPPAGE_TYPE ptype )
- {
- if ( page == 0 )
- return;
-
- page_ = page;
- ptype_ = ptype;
- QStringList charNames;
- QStringList pageTimes;
- QStringList pageCategories;
- std::vector<WPPAGE_TYPE> pageTypes;
- std::vector<uint> offsets;
- uint offset = 0;
-
- QStringList categories = cPagesManager::getInstance()->categories();
-
- pagequeue_.clear();
-
- cPagesManager::iterator it = cPagesManager::getInstance()->begin();
- while ( it != cPagesManager::getInstance()->end() )
- {
- P_CHAR pChar = FindCharBySerial( ( *it )->charSerial() );
- if ( pChar && ptype <= ( *it )->pageType() )
- {
- charNames.push_back( pChar->name() );
- pageTimes.push_back( ( *it )->pageTime() );
- pageCategories.push_back( categories[( *it )->pageCategory() - 1] );
- pageTypes.push_back( ( *it )->pageType() );
- offsets.push_back( offset );
- pagequeue_.push_back( ( *it ) );
- }
- it++;
- offset++;
- }
-
- uint numsocks = charNames.size();
- uint pages = ( ( uint ) ceil( ( double ) numsocks / 10.0f ) );
-
- startPage();
- addBackground( 0xE10, 480, 360 ); //Background
- addCheckertrans( 15, 15, 450, 330 );
- addGump( 180, 18, 0xFA8 );
- addText( 215, 20, tr( "Page Queue" ), 0x530 );
-
- // X button
- addText( 70, 320, "Close", 0x834 );
- addButton( 30, 320, 0xFB1, 0xFB3, 0 );
-
- startPage( 1 );
-
- int right = page_ * 10 - 1;
- int left = page_ * 10 - 10;
- if ( ( signed int ) numsocks <= ( signed int ) right )
- right = numsocks - 1;
-
- int i = left;
- while ( i <= right )
- {
- addButton( 20, 60 + ( i - left ) * 22, 0xFA5, 0xFA7, offsets[i] + 3 );
- addText( 50, 60 + ( i - left ) * 22, QString( "%1" ).arg( charNames[i] ), 0x844 + 5 * pageTypes[i] );
- addText( 200, 60 + ( i - left ) * 22, QString( "%1" ).arg( pageCategories[i] ), 0x844 + 5 * pageTypes[i] );
- addText( 280, 60 + ( i - left ) * 22, QString( "%1" ).arg( pageTimes[i] ), 0x844 + 5 * pageTypes[i] );
- i++;
- }
-
- addText( 280, 320, tr( "Page %1 of %2" ).arg( page_ ).arg( pages ), 0x834 );
- if ( page_ > 1 ) // previous page
- addButton( 240, 320, 0x0FC, 0x0FC, 1 );
-
- if ( page_ < pages ) // next page
- addButton( 260, 320, 0x0FA, 0x0FA, 2 );
- }
-
- void cPagesGump::handleResponse( cUOSocket* socket, const gumpChoice_st& choice )
- {
- if ( choice.button == 0 )
- return;
- else
- {
- switch ( choice.button )
- {
- case 1:
- {
- cPagesGump* pGump = new cPagesGump( page_ - 1, ptype_ );
- socket->send( pGump );
- }
- break;
- case 2:
- {
- cPagesGump* pGump = new cPagesGump( page_ + 1, ptype_ );
- socket->send( pGump );
- }
- break;
- default:
- {
- cPageInfoGump* pGump = new cPageInfoGump( pagequeue_[choice.button - 3] );
- socket->send( pGump );
- }
- break;
- }
- }
- }
-
- cPageInfoGump::cPageInfoGump( cPage* page )
- {
- page_ = page;
-
- if ( cPagesManager::getInstance()->contains( page ) )
- {
- P_PLAYER pChar = dynamic_cast<P_PLAYER>( FindCharBySerial( page->charSerial() ) );
- if ( !pChar )
- return;
- startPage();
-
- addBackground( 0xE10, 440, 440 ); //Background
- addResizeGump( 195, 360, 0xBB8, 205, 20 );
- addCheckertrans( 15, 15, 410, 410 );
-
- addGump( 165, 18, 0xFA2 );
- addText( 200, 20, tr( "Page Menu" ), 0x530 );
-
- // X button
- addText( 70, 400, "Close", 0x834 );
- addButton( 30, 400, 0xFB1, 0xFB3, 0 );
-
- QStringList categories = cPagesManager::getInstance()->categories();
- switch ( page->pageType() )
- {
- case PT_GM:
- addText( 150, 400, QString( "GM Page, Category: %1" ).arg( categories[page->pageCategory() - 1] ), 0x844 + 5 * page->pageType() );
- break;
- case PT_COUNSELOR:
- addText( 150, 400, QString( "Counselor Page, Category: %1" ).arg( categories[page->pageCategory() - 1] ), 0x844 + 5 * page->pageType() );
- break;
- }
-
- startPage( 1 );
-
- Q_UINT16 hue = 0x834;
-
- addText( 50, 60, tr( "Char name:" ), hue );
- addText( 200, 60, QString( "%1" ).arg( pChar->name() ), hue );
- addText( 50, 80, tr( "Account name:" ), hue );
- addText( 200, 80, QString( "%1" ).arg( pChar->account()->login() ), hue );
- addText( 50, 100, tr( "Char position:" ), hue );
- addText( 200, 100, QString( "%1,%2,%3 map %4" ).arg( pChar->pos().x ).arg( pChar->pos().y ).arg( pChar->pos().z ).arg( pChar->pos().map ), hue );
- addText( 50, 120, tr( "Page sent from:" ), hue );
- addText( 200, 120, QString( "%1,%2,%3 map %4" ).arg( page->pagePos().x ).arg( page->pagePos().y ).arg( page->pagePos().z ).arg( page->pagePos().map ), hue );
- addText( 50, 140, tr( "Date/time:" ), hue );
- addText( 200, 140, QString( "%1" ).arg( page->pageTime() ), hue );
-
- addText( 50, 160, tr( "Message:" ), hue );
- QString html = QString( "<body text=\"#0000FF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">%1</body>" ).arg( page_->content() );
- addResizeGump( 45, 180, 0xBB8, 345, 84 );
- addHtmlGump( 50, 180, 340, 80, html );
-
- addButton( 20, 280, 0xFA5, 0xFA7, 1 );
- addText( 50, 280, tr( "Go to char position" ), 0x834 );
- addButton( 20, 300, 0xFA5, 0xFA71, 2 );
- addText( 50, 300, tr( "Bring char" ), 0x834 );
- addButton( 20, 320, 0xFA5, 0xFA7, 3 );
- addText( 50, 320, tr( "Go to page position" ), 0x834 );
- addButton( 20, 360, 0xFBD, 0xFBF, 4 );
- addText( 50, 360, tr( "Send message:" ), 0x834 );
- addInputField( 200, 360, 190, 16, 1, tr( "<msg>" ), 0x834 );
-
- addButton( 220, 280, 0xFAB, 0xFAD, 5 );
- addText( 250, 280, tr( "Show socket info gump" ), 0x834 );
- addButton( 220, 300, 0xFA5, 0xFA7, 6 );
- addText( 250, 300, tr( "Move page on top" ), 0x834 );
- addButton( 220, 320, 0xFA5, 0xFA7, 7 );
- addText( 250, 320, tr( "Delete page" ), 0x834 );
- }
- }
-
- void cPageInfoGump::handleResponse( cUOSocket* socket, const gumpChoice_st& choice )
- {
- if ( choice.button == 0 )
- return;
- else if ( page_ && cPagesManager::getInstance()->contains( page_ ) )
- {
- P_PLAYER pChar = dynamic_cast<P_PLAYER>( FindCharBySerial( page_->charSerial() ) );
-
- if ( !pChar )
- return;
-
- cUOSocket* socket_ = pChar->socket();
-
- if ( !socket_ )
- return;
-
- P_PLAYER mChar = socket->player();
- switch ( choice.button )
- {
- case 1:
- // Check if the privileges are ok
- if ( mChar && !mChar->account()->authorized( "command", "go" ) )
- {
- socket->sysMessage( tr( "Access to command 'go' was denied" ) );
- }
- else if ( mChar )
- {
- mChar->removeFromView( false );
- mChar->moveTo( pChar->pos() );
- mChar->resend( false );
- socket->resendPlayer();
- socket->resendWorld();
- }
- break;
- case 2:
- // Check if the privileges are ok
- if ( mChar && !mChar->account()->authorized( "command", "move" ) || pChar->account()->rank() >= mChar->account()->rank() )
- {
- socket->sysMessage( tr( "Access to command 'move' was denied" ) );
- }
- else if ( mChar )
- {
- pChar->removeFromView( false );
- pChar->moveTo( mChar->pos() );
- pChar->resend( false );
- socket_->resendPlayer();
- socket_->resendWorld();
- }
- break;
- case 3:
- // Check if the privileges are ok
- if ( mChar && !mChar->account()->authorized( "command", "go" ) )
- {
- socket->sysMessage( tr( "Access to command 'go' was denied" ) );
- }
- else if ( mChar )
- {
- mChar->removeFromView( false );
- mChar->moveTo( page_->pagePos() );
- mChar->resend( false );
- socket->resendPlayer();
- socket->resendWorld();
- }
- break;
- case 4:
- {
- std::map<Q_UINT16, QString>::const_iterator it = choice.textentries.find( 1 );
- if ( it != choice.textentries.end() )
- socket_->sysMessage( it->second );
-
- socket->sysMessage( tr( "Message sent." ) );
- }
- break;
- case 6:
- cPagesManager::getInstance()->moveOnTop( page_ );
- break;
- case 7:
- cPagesManager::getInstance()->remove( page_ );
- return;
- }
- cPageInfoGump* pGump = new cPageInfoGump( page_ );
- socket->send( pGump );
- }
- else
- socket->sysMessage( tr( "ERROR: Page has been deleted in the meantime!" ) );
- }
-
- cHelpGump::cHelpGump( SERIAL charSerial )
- {
- P_CHAR pChar = FindCharBySerial( charSerial );
- if ( !pChar )
- return;
-
- char_ = charSerial;
- QStringList categories = cPagesManager::getInstance()->categories();
- cPage* pPage = cPagesManager::getInstance()->find( pChar->serial() );
-
- uint category = 0;
- QStringList lines;
- if ( pPage )
- {
- category = pPage->pageCategory();
- lines = QStringList::split( "<br>", pPage->content(), true );
- }
- else
- {
- lines.push_back( tr( "<msg>" ) );
- lines.push_back( "" );
- lines.push_back( "" );
- lines.push_back( "" );
- }
-
- if ( category > categories.count() )
- category = 0;
-
- uint heightmod = ( ( uint ) ( categories.count() / 2 ) + ( ( pPage ) ? 2 : 0 ) );
-
- startPage();
- addResizeGump( 0, 40, 0xA28, 450, 330 + 20 * heightmod ); //Background
- addGump( 105, 18, 0x58B ); // Fancy top-bar
- addGump( 182, 0, 0x589 ); // "Button" like gump
- addGump( 193, 10, 0x15E9 ); // "Button" like gump
- addText( 190, 90, tr( "Help menu" ), 0x530 );
-
- addText( 50, 120, tr( "Message: %1" ).arg( ( ( pPage ) ? pPage->pageTime() : QString( "" ) ) ), 0x834 );
- addResizeGump( 45, 140, 0xBB8, 345, 84 );
-
- addInputField( 50, 140, 330, 16, 1, lines[0], 0x834 );
- addInputField( 50, 160, 330, 16, 2, lines[1], 0x834 );
- addInputField( 50, 180, 330, 16, 3, lines[2], 0x834 );
- addInputField( 50, 200, 330, 16, 4, lines[3], 0x834 );
-
- startGroup( 1 );
-
- addRadioButton( 50, 230, 0xD0, 0xD1, 1, ( ( pPage ) ? ( pPage->pageType() == PT_GM ) : true ) );
- addText( 80, 230, tr( "GM Page" ), 0x844 );
-
- addRadioButton( 250, 230, 0xD0, 0xD1, 2, ( ( pPage ) ? ( pPage->pageType() == PT_COUNSELOR ) : false ) );
- addText( 280, 230, tr( "Counselor Page" ), 0x849 );
-
- uint i = 0; // categories[0] == none.. should not be option!
- uint offset = 0;
- startGroup( 2 );
- addText( 50, 270, tr( "Categories:" ), 0x834 );
- while ( i < categories.count() )
- {
- addRadioButton( 50, 290 + offset * 20, 0xD0, 0xD1, i + 1, ( ( pPage ) ? ( category == ( i ) ) : ( i == 0 ) ) );
- addText( 80, 290 + offset * 20, categories[i], 0x834 );
-
- if ( i + 1 < categories.count() )
- {
- addRadioButton( 250, 290 + offset * 20, 0xD0, 0xD1, i + 2, ( ( pPage ) ? ( category == ( i + 1 ) ) : false ) );
- addText( 280, 290 + offset * 20, categories[i + 1], 0x834 );
- }
- offset++;
- i += 2;
- }
-
- if ( pPage )
- {
- addButton( 50, 290 + ( offset + 1 ) * 20, 0xFA5, 0xFA7, 2 );
- addText( 100, 290 + ( offset + 1 ) * 20, "Delete my page", 0x834 );
- }
-
- // addButton( 20, 280, 0xFA5, 0xFA7, 1 );
- // addText( 60, 280, tr( "" ), 0x834 );
-
- // OK button
- addButton( 50, 320 + 20 * heightmod, 0xF9, 0xF8, 1 );
- // Cancel button
- addButton( 120, 320 + 20 * heightmod, 0xF3, 0xF1, 0 );
-
- startPage( 1 );
- }
-
- void cHelpGump::handleResponse( cUOSocket* socket, const gumpChoice_st& choice )
- {
- if ( choice.button == 0 ) // canceled
- return;
-
- cPage* pPage = cPagesManager::getInstance()->find( char_ );
-
- if ( choice.button == 2 )
- {
- if ( pPage )
- {
- cPagesManager::getInstance()->remove( pPage );
- socket->sysMessage( "Page successfully deleted." );
- return;
- }
- }
- else
- {
- P_PLAYER pChar = dynamic_cast<P_PLAYER>( FindCharBySerial( char_ ) );
- if ( !pChar )
- return;
-
- QStringList lines;
- std::map<Q_UINT16, QString>::const_iterator it = choice.textentries.begin();
- while ( it != choice.textentries.end() )
- {
- lines.push_back( it->second );
- it++;
- }
- QString content_ = lines.join( "<br>" );
-
- if ( pPage )
- {
- pPage->setPageTime();
- pPage->setContent( content_ );
- pPage->setPagePos( pChar->pos() );
- }
- else
- {
- pPage = new cPage( char_, PT_GM, content_, pChar->pos() );
- cPagesManager::getInstance()->push_back( pPage );
- }
-
- switch ( choice.switches[0] )
- {
- case 1:
- pPage->setPageType( PT_GM );
- break;
- case 2:
- pPage->setPageType( PT_COUNSELOR );
- break;
- }
-
- pPage->setPageCategory( choice.switches[1] );
-
- QString account = "";
- if ( pChar->account() )
- account = pChar->account()->login();
- QString message = tr( "%1 Page from %2 [%3]: %4" ).arg( choice.switches[0] == 1 ? "GM" : "Counselor" ).arg( pChar->name() ).arg( account ).arg( lines.join( "\n" ) );
-
- cUOSocket* mSock = 0;
- for ( mSock = Network::instance()->first(); mSock; mSock = Network::instance()->next() )
- {
- // Send a Message to this Character
- if ( mSock->account() && mSock->account()->isPageNotify() )
- mSock->sysMessage( message );
- }
- }
- }
--- 190,191 ----
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.266
retrieving revision 1.267
diff -C2 -d -r1.266 -r1.267
*** commands.cpp 4 Oct 2004 20:16:26 -0000 1.266
--- commands.cpp 8 Oct 2004 10:57:09 -0000 1.267
***************
*** 41,45 ****
#include "definitions.h"
#include "scriptmanager.h"
- #include "pagesystem.h"
#include "sectors.h"
#include "contextmenu.h"
--- 41,44 ----
***************
*** 462,488 ****
/*
- \command pages
- \description Manage support tickets.
- */
- void commandPages( cUOSocket* socket, const QString& command, const QStringList& args ) throw()
- {
- Q_UNUSED( args );
- Q_UNUSED( command );
- // Pages
- if ( socket->player() )
- {
- cPagesGump* pGump = NULL;
-
- if ( socket->player()->isGM() )
- pGump = new cPagesGump( 1, PT_GM );
- else if ( socket->player()->isCounselor() )
- pGump = new cPagesGump( 1, PT_COUNSELOR );
-
- if ( pGump )
- socket->send( pGump );
- }
- }
-
- /*
\command shutdown
\description Shutdown the Wolfpack server.
--- 461,464 ----
***************
*** 1563,1567 ****
{ "DOORGEN", commandDoorGenerator },
{ "GMTALK", commandGmtalk },
- { "PAGES", commandPages },
{ "PAGENOTIFY", commandPageNotify },
{ "RELOAD", commandReload },
--- 1539,1542 ----
Index: wolfpack.vcproj
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.vcproj,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** wolfpack.vcproj 30 Sep 2004 12:23:03 -0000 1.51
--- wolfpack.vcproj 8 Oct 2004 10:57:10 -0000 1.52
***************
*** 421,427 ****
</File>
<File
- RelativePath=".\pagesystem.h">
- </File>
- <File
RelativePath=".\party.cpp">
</File>
--- 421,424 ----
Index: speech.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/speech.cpp,v
retrieving revision 1.190
retrieving revision 1.191
diff -C2 -d -r1.190 -r1.191
*** speech.cpp 8 Oct 2004 01:13:16 -0000 1.190
--- speech.cpp 8 Oct 2004 10:57:10 -0000 1.191
***************
*** 39,43 ****
#include "territories.h"
#include "network/uosocket.h"
- #include "pagesystem.h"
#include "skills.h"
#include "pythonscript.h"
--- 39,42 ----
***************
*** 107,150 ****
break;
- // Paging a GM
- case cPlayer::enPageGM:
- {
- cPage* pPage = new cPage( pChar->serial(), PT_GM, speech, pChar->pos() );
- cPagesManager::getInstance()->push_back( pPage );
- notification = tr( "GM Page from %1: %2" ).arg( pChar->name() ).arg( speech );
-
- for ( cUOSocket*mSock = Network::instance()->first(); mSock; mSock = Network::instance()->next() )
- if ( mSock->player() && mSock->player()->isGM() )
- mSock->sysMessage( notification );
-
- if ( Network::instance()->count() > 0 )
- socket->sysMessage( tr( "Available Game Masters have been notified of your request." ) );
- else
- socket->sysMessage( tr( "There was no Game Master available, page queued." ) );
-
- pChar->setInputMode( cPlayer::enNone );
- }
- break;
-
- // Paging a Counselor
- case cPlayer::enPageCouns:
- {
- cPage* pPage = new cPage( pChar->serial(), PT_COUNSELOR, speech, pChar->pos() );
- cPagesManager::getInstance()->push_back( pPage );
- notification = tr( "Counselor Page from %1: %2" ).arg( pChar->name() ).arg( speech );
-
- for ( cUOSocket*mSock = Network::instance()->first(); mSock; mSock = Network::instance()->next() )
- if ( mSock->player() && ( socket->player()->isCounselor() || socket->player()->isGM() ) )
- mSock->sysMessage( notification );
-
- if ( Network::instance()->count() > 0 )
- socket->sysMessage( tr( "Available Counselors have been notified of your request." ) );
- else
- socket->sysMessage( tr( "There was no Counselor available, page queued." ) );
-
- pChar->setInputMode( cPlayer::enNone );
- }
- break;
-
default:
break; // do nothing
--- 106,109 ----
Index: ChangeLog
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v
retrieving revision 1.99
retrieving revision 1.100
diff -C2 -d -r1.99 -r1.100
*** ChangeLog 8 Oct 2004 01:13:15 -0000 1.99
--- ChangeLog 8 Oct 2004 10:57:09 -0000 1.100
***************
*** 35,38 ****
--- 35,39 ----
- Added the ability to sell items from subpacks.
- Fixed a bug (Exploit) related to consumeResource.
+ - Removed old page system from core.
Wolfpack 12.9.11 Beta (26. September 2004)
Index: gumps.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/gumps.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** gumps.h 24 Sep 2004 04:47:25 -0000 1.44
--- gumps.h 8 Oct 2004 10:57:10 -0000 1.45
***************
*** 254,295 ****
};
- class cPagesGump : public cGump
- {
- OBJECTDEF(cPagesGump)
- private:
- uint page_;
- WPPAGE_TYPE ptype_;
-
- std::vector<cPage*> pagequeue_;
-
- public:
- cPagesGump( uint page, WPPAGE_TYPE ptype );
-
- virtual void handleResponse( cUOSocket* socket, const gumpChoice_st& choice );
- };
-
- class cPageInfoGump : public cGump
- {
- OBJECTDEF(cPageInfoGump)
- private:
- cPage* page_;
-
- public:
- cPageInfoGump( cPage* page_ );
-
- virtual void handleResponse( cUOSocket* socket, const gumpChoice_st& choice );
- };
-
- class cHelpGump : public cGump
- {
- OBJECTDEF(cHelpGump)
- private:
- SERIAL char_;
-
- public:
- cHelpGump( SERIAL charSerial );
-
- virtual void handleResponse( cUOSocket* socket, const gumpChoice_st& choice );
- };
-
#endif
--- 254,256 ----
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.213
retrieving revision 1.214
diff -C2 -d -r1.213 -r1.214
*** wolfpack.pro 25 Sep 2004 22:57:09 -0000 1.213
--- wolfpack.pro 8 Oct 2004 10:57:10 -0000 1.214
***************
*** 92,96 ****
multi.h \
npc.h \
- pagesystem.h \
party.h \
persistentbroker.h \
--- 92,95 ----
|