Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23605
Modified Files:
commands.cpp gumps.cpp gumps.h targetrequests.h
Log Message:
Removed outdated .tags command.
Index: targetrequests.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.h,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** targetrequests.h 2 Jul 2004 06:01:18 -0000 1.68
--- targetrequests.h 5 Jul 2004 14:03:16 -0000 1.69
***************
*** 417,453 ****
};
- class cTagsInfoTarget : public cTargetRequest
- {
- public:
- cTagsInfoTarget()
- {
- }
-
- virtual bool responsed( cUOSocket* socket, cUORxTarget* target )
- {
- if ( isCharSerial( target->serial() ) )
- {
- P_CHAR pChar = FindCharBySerial( target->serial() );
- if ( pChar )
- {
- cTagsInfoGump* pGump = new cTagsInfoGump( pChar );
- socket->send( pGump );
- }
- return true;
- }
- else if ( isItemSerial( target->serial() ) )
- {
- P_ITEM pItem = FindItemBySerial( target->serial() );
- if ( pItem )
- {
- cTagsInfoGump* pGump = new cTagsInfoGump( pItem );
- socket->send( pGump );
- }
- return true;
- }
- return false;
- }
- };
-
class cAddEventTarget : public cTargetRequest
{
--- 417,420 ----
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.238
retrieving revision 1.239
diff -C2 -d -r1.238 -r1.239
*** commands.cpp 15 Jun 2004 02:44:43 -0000 1.238
--- commands.cpp 5 Jul 2004 14:03:15 -0000 1.239
***************
*** 749,835 ****
/*
- \command tags
- \description Manage the tags for an object.
- \usage - <code>tags set [key] [value]</code>
- - <code>tags set [key] [value] string</code>
- - <code>tags set [key] [value] value</code>
- Key denotes the name of the tag you want to set, remove or view.
- Value is the value of the new tag. If you specify 'value' as the last
- parameter, the tag will be evaluated and set as an integer.
- The set subcommand will attach a new tag or change an existing tag.
- The get subcommand will show the value of a tag attached to the object.
- The remove subcommand will remove a tag from the object.
- The info subcommand will show a dialog with all attached tags.
-
- \notes The remove subcommand also accepts <i>all</i> as the key which will
- remove all attached tags from the object.
- */
- void commandTags( cUOSocket* socket, const QString& command, const QStringList& args ) throw()
- {
- Q_UNUSED( command );
- // Tags set <key> <value> (as string/value)
- // Tags get <key>
- // Tags remove <key> or all
- // Tags info
-
- if ( args.count() == 0 )
- {
- socket->sysMessage( tr( "Usage: tags <set|get|remove|info>" ) );
- return;
- }
-
- QString subCommand = args[0].lower();
-
- // set
- if ( subCommand == "set" )
- {
- if ( args.count() < 3 )
- {
- socket->sysMessage( tr( "Usage: tags set <key> <value> (as value/string)" ) );
- }
- else
- {
- UINT8 type = 0; // 0 - string, 1 - value
- if ( args.count() == 5 )
- {
- if ( args[4].lower() == "value" )
- type = 1;
- }
- socket->sysMessage( tr( "Please select a target" ) );
- socket->attachTarget( new cSetTagTarget( args[1], args[2], type ) );
- }
- }
- if ( subCommand == "get" )
- {
- if ( args.count() < 2 )
- {
- socket->sysMessage( tr( "Usage tags get <key>" ) );
- }
- else
- {
- socket->sysMessage( tr( "Please select a target" ) );
- socket->attachTarget( new cGetTagTarget( args[1] ) );
- }
- }
- if ( subCommand == "remove" )
- {
- if ( args.count() < 2 )
- {
- socket->sysMessage( tr( "Usage tags remove <key>" ) );
- }
- else
- {
- socket->sysMessage( tr( "Please select a target" ) );
- socket->attachTarget( new cRemoveTagTarget( args[1] ) );
- }
- }
- if ( subCommand == "info" )
- {
- socket->sysMessage( tr( "Please select a target" ) );
- socket->attachTarget( new cTagsInfoTarget() );
- }
- }
-
- /*
\command who
\description Manage connected clients.
--- 749,752 ----
***************
*** 1480,1483 ****
stCommand cCommands::commands[] =
{
! { "ACCOUNT", commandAccount }, { "ADDEVENT", commandAddEvent }, { "ALLMOVE", commandAllMove }, { "ALLSHOW", commandAllShow }, { "ALLSKILLS", commandAllSkills }, { "BROADCAST", commandBroadcast }, { "DOORGEN", commandDoorGenerator }, { "FIX", commandFix }, { "GMTALK", commandGmtalk }, { "INVIS", commandInvis }, { "KILL", commandKill }, { "MOVE", commandMove }, { "PAGES", commandPages }, { "PAGENOTIFY", commandPageNotify }, { "PASSWORD", commandPassword }, { "RELOAD", commandReload }, { "REMOVE", commandRemove }, { "REMOVEEVENT", commandRemoveEvent }, { "RESEND", commandResend }, { "RESTOCK", commandRestock }, { "RESURRECT", commandResurrect }, { "SAVE", commandSave }, { "SERVERTIME", commandServerTime }, { "SET", commandSet }, { "SHOW", commandShow }, { "SHUTDOWN", commandShutDown }, { "STAFF", commandStaff }, { "SPAWNREGION", commandSpawnRegion }, { "TAGS", commandTags }, { "TELE", commandTele }, { "WHO", commandWho }, { NULL, NULL }
};
--- 1397,1430 ----
stCommand cCommands::commands[] =
{
! { "ACCOUNT", commandAccount },
! { "ADDEVENT", commandAddEvent },
! { "ALLMOVE", commandAllMove },
! { "ALLSHOW", commandAllShow },
! { "ALLSKILLS", commandAllSkills },
! { "BROADCAST", commandBroadcast },
! { "DOORGEN", commandDoorGenerator },
! { "FIX", commandFix },
! { "GMTALK", commandGmtalk },
! { "INVIS", commandInvis },
! { "KILL", commandKill },
! { "MOVE", commandMove },
! { "PAGES", commandPages },
! { "PAGENOTIFY", commandPageNotify },
! { "PASSWORD", commandPassword },
! { "RELOAD", commandReload },
! { "REMOVE", commandRemove },
! { "REMOVEEVENT", commandRemoveEvent },
! { "RESEND", commandResend },
! { "RESTOCK", commandRestock },
! { "RESURRECT", commandResurrect },
! { "SAVE", commandSave },
! { "SERVERTIME", commandServerTime },
! { "SET", commandSet },
! { "SHOW", commandShow },
! { "SHUTDOWN", commandShutDown },
! { "STAFF", commandStaff },
! { "SPAWNREGION", commandSpawnRegion },
! { "TELE", commandTele },
! { "WHO", commandWho },
! { NULL, NULL }
};
Index: gumps.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/gumps.cpp,v
retrieving revision 1.165
retrieving revision 1.166
diff -C2 -d -r1.165 -r1.166
*** gumps.cpp 15 Jun 2004 02:44:43 -0000 1.165
--- gumps.cpp 5 Jul 2004 14:03:16 -0000 1.166
***************
*** 192,262 ****
}
- cTagsInfoGump::cTagsInfoGump( const cUObject* object ) : object_( const_cast<cUObject*>( object ) )
- {
- if ( object )
- {
- QStringList allkeys = object->getTags();
-
- UINT32 page_ = 0;
- UINT32 numkeys = allkeys.size();
- UINT32 pages = ( ( UINT32 ) ceil( ( double ) numkeys / 10.0f ) );
-
- startPage();
- // Basic .INFO Header
- addResizeGump( 0, 40, 0xA28, 450, 420 ); //Background
- addGump( 105, 18, 0x58B ); // Fancy top-bar
- addGump( 182, 0, 0x589 ); // "Button" like gump
- addTilePic( 202, 23, 0x14eb ); // Type of info menu
- addText( 190, 90, tr( "Tags Info" ), 0x530 );
-
- // OK button
- addButton( 50, 410, 0xF9, 0xF8, 0 ); // Only Exit possible
-
- for ( page_ = 1; page_ <= pages; page_++ )
- {
- startPage( page_ );
-
- UINT32 i;
- UINT32 right = page_ * 19 - 1;
- UINT32 left = page_ * 19 - 19;
- if ( numkeys <= right )
- right = numkeys - 1;
-
- QStringList keys = QStringList();
- QStringList::const_iterator it = allkeys.at( left );
- while ( it != allkeys.at( right + 1 ) )
- {
- keys.push_back( ( *it ) );
- it++;
- }
- UINT32 thiskeys = keys.size();
-
- for ( i = 0; i < thiskeys; i++ )
- {
- addText( 50, 120 + i * 20, tr( "Tag \"%1\": %2" ).arg( keys[i] ).arg( object->getTag( keys[i] ).toString() ), 0x834 );
- }
-
- addText( 310, 410, tr( "Page %1 of %2" ).arg( page_ ).arg( pages ), 0x834 );
- if ( page_ > 1 ) // previous page
- addPageButton( 270, 410, 0x0FC, 0x0FC, page_ - 1 );
-
- if ( page_ < pages ) // next page
- addPageButton( 290, 410, 0x0FA, 0x0FA, page_ + 1 );
- }
- }
- }
-
- void cTagsInfoGump::handleResponse( cUOSocket* socket, const gumpChoice_st& choice )
- {
- if ( choice.button == 0 )
- return;
-
- if ( object_ )
- {
- cTagsInfoGump* pGump = new cTagsInfoGump( object_ );
- socket->send( pGump );
- }
- }
-
cWhoMenuGump::cWhoMenuGump( UINT32 page )
{
--- 192,195 ----
Index: gumps.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/gumps.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** gumps.h 2 Jun 2004 15:04:05 -0000 1.40
--- gumps.h 5 Jul 2004 14:03:16 -0000 1.41
***************
*** 252,266 ****
};
- class cTagsInfoGump : public cGump
- {
- protected:
- cUObject* object_;
-
- public:
- cTagsInfoGump( const cUObject* object_ );
-
- virtual void handleResponse( cUOSocket* socket, const gumpChoice_st& choice );
- };
-
class cWhoMenuGump : public cGump
{
--- 252,255 ----
|