Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv23381
Modified Files:
Trade.cpp ai.cpp basechar.cpp basechar.h boats.cpp chars.cpp
commands.cpp dbl_single_click.cpp encryption.cpp globals.cpp
globals.h items.cpp log.cpp log.h makemenus.cpp network.cpp
npc.cpp persistentbroker.cpp player.cpp progress.h
pythonscript.cpp resources.cpp scriptmanager.cpp sectors.cpp
skills.cpp spawnregions.cpp speech.cpp territories.cpp
tilecache.cpp typedefs.h wolf.dsp wolfpack.cpp wolfpack.h
wolfpack.pro world.cpp wpdefmanager.cpp
Log Message:
Trying out new console code.
Index: Trade.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/Trade.cpp,v
retrieving revision 1.88
retrieving revision 1.89
diff -C2 -d -r1.88 -r1.89
*** Trade.cpp 7 Sep 2003 19:07:46 -0000 1.88
--- Trade.cpp 8 Sep 2003 10:58:46 -0000 1.89
***************
*** 44,48 ****
#include "player.h"
#include "world.h"
! #include "wpconsole.h"
#include "network.h"
#include "items.h"
--- 44,48 ----
#include "player.h"
#include "world.h"
! #include "console.h"
#include "network.h"
#include "items.h"
***************
*** 222,226 ****
if( pChar->takeGold( totalValue, true ) < totalValue )
! clConsole.send( QString( "Player 0x%1 payed less than he should have to vendor 0x%2" ).arg( pChar->serial(), 8, 16 ).arg( pVendor->serial(), 8, 16 ) );
}
--- 222,226 ----
if( pChar->takeGold( totalValue, true ) < totalValue )
! Console::instance()->send( QString( "Player 0x%1 payed less than he should have to vendor 0x%2" ).arg( pChar->serial(), 8, 16 ).arg( pVendor->serial(), 8, 16 ) );
}
Index: ai.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ai.cpp 7 Sep 2003 19:07:46 -0000 1.17
--- ai.cpp 8 Sep 2003 10:58:46 -0000 1.18
***************
*** 41,45 ****
#include "itemid.h"
#include "items.h"
! #include "wpconsole.h"
#include "world.h"
--- 41,45 ----
#include "itemid.h"
#include "items.h"
! #include "console.h"
#include "world.h"
***************
*** 183,187 ****
}
else
! clConsole.send( "Action tag in ai definition must contain attributes for pre-,postcondition and execute at least\n" );
}
else if( TagName == "onspeech" )
--- 183,187 ----
}
else
! Console::instance()->send( "Action tag in ai definition must contain attributes for pre-,postcondition and execute at least\n" );
}
else if( TagName == "onspeech" )
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** basechar.cpp 5 Sep 2003 00:03:44 -0000 1.40
--- basechar.cpp 8 Sep 2003 10:58:46 -0000 1.41
***************
*** 36,40 ****
#include "persistentbroker.h"
#include "dbdriver.h"
! #include "wpconsole.h"
#include "maps.h"
#include "chars.h"
--- 36,40 ----
#include "persistentbroker.h"
#include "dbdriver.h"
! #include "console.h"
#include "maps.h"
#include "chars.h"
***************
*** 337,341 ****
pc->setSkin( 0xF000 );
pc->setOrgSkin( 0xF000 );
! clConsole.send(QString("char/player: %1 : [%2] correted problematic skin hue\n").arg(pc->name()).arg( pc->serial(), 16 ) );
}
}
--- 337,341 ----
pc->setSkin( 0xF000 );
pc->setOrgSkin( 0xF000 );
! Console::instance()->send(QString("char/player: %1 : [%2] correted problematic skin hue\n").arg(pc->name()).arg( pc->serial(), 16 ) );
}
}
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** basechar.h 5 Sep 2003 00:03:45 -0000 1.30
--- basechar.h 8 Sep 2003 10:58:46 -0000 1.31
***************
*** 47,59 ****
class cUOTxTooltipList;
- enum eLogLevel;
! enum eDamageType
! {
! DAMAGE_PHYSICAL = 0,
! DAMAGE_MAGICAL = 1,
! DAMAGE_GODLY = 2,
! DAMAGE_HUNGER = 3
! };
// This class is the base interface for all char objects.
--- 47,52 ----
class cUOTxTooltipList;
!
// This class is the base interface for all char objects.
Index: boats.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/boats.cpp,v
retrieving revision 1.113
retrieving revision 1.114
diff -C2 -d -r1.113 -r1.114
*** boats.cpp 7 Sep 2003 19:07:46 -0000 1.113
--- boats.cpp 8 Sep 2003 10:58:47 -0000 1.114
***************
*** 46,50 ****
#include "world.h"
#include "globals.h"
! #include "wpconsole.h"
#include "log.h"
#include "player.h"
--- 46,50 ----
#include "world.h"
#include "globals.h"
! #include "console.h"
#include "log.h"
#include "player.h"
***************
*** 690,694 ****
break;
default:
! clConsole.log( LOG_WARNING, QString( "cBoat::Move: invalid boatdirection caught (boatdir: %1, serial: %2), corrected to north boatdir!" ).arg( this->boatdir ).arg( this->serial() ) );
this->boatdir = 0;
dy -= moves_;
--- 690,694 ----
break;
default:
! Console::instance()->log( LOG_WARNING, QString( "cBoat::Move: invalid boatdirection caught (boatdir: %1, serial: %2), corrected to north boatdir!" ).arg( this->boatdir ).arg( this->serial() ) );
this->boatdir = 0;
dy -= moves_;
Index: chars.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/chars.cpp,v
retrieving revision 1.330
retrieving revision 1.331
diff -C2 -d -r1.330 -r1.331
*** chars.cpp 5 Sep 2003 00:03:45 -0000 1.330
--- chars.cpp 8 Sep 2003 10:58:47 -0000 1.331
***************
*** 44,48 ****
#include "sectors.h"
#include "wpdefmanager.h"
! #include "wpconsole.h"
#include "log.h"
--- 44,48 ----
#include "sectors.h"
#include "wpdefmanager.h"
! #include "console.h"
#include "log.h"
***************
*** 109,113 ****
if( !DefSection )
{
! clConsole.log( LOG_ERROR, QString( "Unable to create unscripted npc: %1\n" ).arg( section ) );
return NULL;
}
--- 109,113 ----
if( !DefSection )
{
! Console::instance()->log( LOG_ERROR, QString( "Unable to create unscripted npc: %1\n" ).arg( section ) );
return NULL;
}
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.198
retrieving revision 1.199
diff -C2 -d -r1.198 -r1.199
*** commands.cpp 7 Sep 2003 19:07:46 -0000 1.198
--- commands.cpp 8 Sep 2003 10:58:47 -0000 1.199
***************
*** 44,48 ****
#include "tilecache.h"
#include "chars.h"
! #include "wpconsole.h"
#include "wpdefmanager.h"
#include "scriptmanager.h"
--- 44,48 ----
#include "tilecache.h"
#include "chars.h"
! #include "console.h"
#include "wpdefmanager.h"
#include "scriptmanager.h"
***************
*** 129,135 ****
if( ScriptSections.isEmpty() )
{
! clConsole.ChangeColor( WPC_RED );
! clConsole.send( tr("WARNING: No ACLs for players, counselors, gms and admins defined!\n") );
! clConsole.ChangeColor( WPC_NORMAL );
return;
}
--- 129,135 ----
if( ScriptSections.isEmpty() )
{
! Console::instance()->ChangeColor( WPC_RED );
! Console::instance()->send( tr("WARNING: No ACLs for players, counselors, gms and admins defined!\n") );
! Console::instance()->ChangeColor( WPC_NORMAL );
return;
}
***************
*** 869,873 ****
if( subCommand == "python" )
{
! clConsole.send( "Reloading python scripts\n" );
ScriptManager->reload();
ContextMenus::instance()->reload();
--- 869,873 ----
if( subCommand == "python" )
{
! Console::instance()->send( "Reloading python scripts\n" );
ScriptManager->reload();
ContextMenus::instance()->reload();
***************
*** 875,879 ****
if( subCommand == "scripts" )
{
! clConsole.send( "Reloading definitions, scripts and wolfpack.xml\n" );
SrvParams->reload(); // Reload wolfpack.xml
--- 875,879 ----
if( subCommand == "scripts" )
{
! Console::instance()->send( "Reloading definitions, scripts and wolfpack.xml\n" );
SrvParams->reload(); // Reload wolfpack.xml
***************
*** 906,910 ****
if( subCommand == "all" )
{
! clConsole.send( "Reloading definitions, scripts and wolfpack.xml\n" );
SrvParams->reload(); // Reload wolfpack.xml
--- 906,910 ----
if( subCommand == "all" )
{
! Console::instance()->send( "Reloading definitions, scripts and wolfpack.xml\n" );
SrvParams->reload(); // Reload wolfpack.xml
Index: dbl_single_click.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbl_single_click.cpp,v
retrieving revision 1.221
retrieving revision 1.222
diff -C2 -d -r1.221 -r1.222
*** dbl_single_click.cpp 7 Sep 2003 19:07:46 -0000 1.221
--- dbl_single_click.cpp 8 Sep 2003 10:58:47 -0000 1.222
***************
*** 402,406 ****
// }
// else
! // clConsole.send("Unhandled guild item type named: %s with ID of: %X", pi->name().ascii(), pi->id());
return;
// End of guild stuff
--- 402,406 ----
// }
// else
! // Console::instance()->send("Unhandled guild item type named: %s with ID of: %X", pi->name().ascii(), pi->id());
return;
// End of guild stuff
Index: encryption.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/encryption.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** encryption.cpp 7 Sep 2003 19:07:46 -0000 1.13
--- encryption.cpp 8 Sep 2003 10:58:47 -0000 1.14
***************
*** 39,43 ****
#include "encryption.h"
#include "wpdefmanager.h"
! #include "wpconsole.h"
#include "globals.h"
#include "prototypes.h"
--- 39,43 ----
#include "encryption.h"
#include "wpdefmanager.h"
! #include "console.h"
#include "globals.h"
#include "prototypes.h"
Index: globals.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/globals.cpp,v
retrieving revision 1.100
retrieving revision 1.101
diff -C2 -d -r1.100 -r1.101
*** globals.cpp 7 Sep 2003 19:07:46 -0000 1.100
--- globals.cpp 8 Sep 2003 10:58:47 -0000 1.101
***************
*** 38,42 ****
#include "wptargetrequests.h"
#include "typedefs.h"
! #include "wpconsole.h"
#include "srvparams.h"
#include "skills.h"
--- 38,42 ----
#include "wptargetrequests.h"
#include "typedefs.h"
! #include "console.h"
#include "srvparams.h"
#include "skills.h"
***************
*** 56,60 ****
// Instantiate our console object
! WPConsole_cl clConsole;
time_t oldtime, newtime;
--- 56,60 ----
// Instantiate our console object
! cConsole clConsole;
time_t oldtime, newtime;
Index: globals.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/globals.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** globals.h 7 Sep 2003 19:07:46 -0000 1.74
--- globals.h 8 Sep 2003 10:58:47 -0000 1.75
***************
*** 52,57 ****
class cScriptManager;
class WPDefManager;
- class WPConsole_cl;
- //Wolfpack Includes
#include "structs.h"
--- 52,55 ----
***************
*** 60,66 ****
extern enServerState serverState;
-
- // Instantiate our console object
- extern WPConsole_cl clConsole;
extern unsigned int uiCurrentTime;
--- 58,61 ----
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.347
retrieving revision 1.348
diff -C2 -d -r1.347 -r1.348
*** items.cpp 7 Sep 2003 19:07:47 -0000 1.347
--- items.cpp 8 Sep 2003 10:58:47 -0000 1.348
***************
*** 60,64 ****
#include "globals.h"
#include "inlines.h"
! #include "wpconsole.h"
// System Includes
--- 60,64 ----
#include "globals.h"
#include "inlines.h"
! #include "console.h"
// System Includes
***************
*** 714,718 ****
if( !pSpawned )
{
! clConsole.send( tr( "Unable to spawn unscripted item: %1" ).arg( pItem->carve() ) );
break;
}
--- 714,718 ----
if( !pSpawned )
{
! Console::instance()->send( tr( "Unable to spawn unscripted item: %1" ).arg( pItem->carve() ) );
break;
}
***************
*** 854,858 ****
if( !DefSection ) // section not found
{
! clConsole.log( LOG_ERROR, QString( "Unable to create unscripted item: %1\n" ).arg( Section ) );
return NULL;
}
--- 854,858 ----
if( !DefSection ) // section not found
{
! Console::instance()->log( LOG_ERROR, QString( "Unable to create unscripted item: %1\n" ).arg( Section ) );
return NULL;
}
***************
*** 1971,1975 ****
if( pItem == this )
{
! clConsole.log( LOG_WARNING, QString( "Rejected putting an item into itself (%1)" ).arg( serial_, 0, 16 ) );
return;
}
--- 1971,1975 ----
if( pItem == this )
{
! Console::instance()->log( LOG_WARNING, QString( "Rejected putting an item into itself (%1)" ).arg( serial_, 0, 16 ) );
return;
}
Index: log.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/log.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** log.cpp 6 Sep 2003 16:12:33 -0000 1.2
--- log.cpp 8 Sep 2003 10:58:47 -0000 1.3
***************
*** 36,40 ****
#include "srvparams.h"
#include "network/uosocket.h"
! #include "wpconsole.h"
// QT Includes
--- 36,40 ----
#include "srvparams.h"
#include "network/uosocket.h"
! #include "console.h"
// QT Includes
***************
*** 69,73 ****
if ( !d.exists(path) )
{
! clConsole.send( QString("Warning: log path (%1) doesn't exist, creating\n").arg(path) );
QDir d;
d.mkdir( path );
--- 69,73 ----
if ( !d.exists(path) )
{
! Console::instance()->send( QString("Warning: log path (%1) doesn't exist, creating\n").arg(path) );
QDir d;
d.mkdir( path );
***************
*** 81,85 ****
if( !logfile.open( IO_WriteOnly | IO_Append | IO_Translate ) )
{
! clConsole.send( QString( "Couldn't open logfile '%1'\n" ).arg( path ) );
return false;
}
--- 81,85 ----
if( !logfile.open( IO_WriteOnly | IO_Append | IO_Translate ) )
{
! Console::instance()->send( QString( "Couldn't open logfile '%1'\n" ).arg( path ) );
return false;
}
***************
*** 157,166 ****
prelude.sprintf( "%02u:%02u:", now.hour(), now.minute() );
! clConsole.ChangeColor( WPC_WHITE );
! clConsole.send( prelude );
! clConsole.ChangeColor( WPC_NORMAL );
if( sock )
! clConsole.send( QString( "%1:" ).arg( sock->uniqueId(), 0, 16 ) );
}
--- 157,166 ----
prelude.sprintf( "%02u:%02u:", now.hour(), now.minute() );
! Console::instance()->ChangeColor( WPC_WHITE );
! Console::instance()->send( prelude );
! Console::instance()->ChangeColor( WPC_NORMAL );
if( sock )
! Console::instance()->send( QString( "%1:" ).arg( sock->uniqueId(), 0, 16 ) );
}
***************
*** 169,188 ****
{
case LOG_ERROR:
! clConsole.ChangeColor( WPC_RED );
! clConsole.send( "ERROR: " );
! clConsole.ChangeColor( WPC_NORMAL );
break;
case LOG_WARNING:
! clConsole.ChangeColor( WPC_YELLOW );
! clConsole.send( "WARNING: " );
! clConsole.ChangeColor( WPC_NORMAL );
break;
default:
if( !prelude.isEmpty() )
! clConsole.send( " " );
}
! clConsole.send( string );
}
--- 169,188 ----
{
case LOG_ERROR:
! Console::instance()->ChangeColor( WPC_RED );
! Console::instance()->send( "ERROR: " );
! Console::instance()->ChangeColor( WPC_NORMAL );
break;
case LOG_WARNING:
! Console::instance()->ChangeColor( WPC_YELLOW );
! Console::instance()->send( "WARNING: " );
! Console::instance()->ChangeColor( WPC_NORMAL );
break;
default:
if( !prelude.isEmpty() )
! Console::instance()->send( " " );
}
! Console::instance()->send( string );
}
Index: log.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/log.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** log.h 5 Sep 2003 00:03:46 -0000 1.1
--- log.h 8 Sep 2003 10:58:47 -0000 1.2
***************
*** 38,52 ****
// Wolfpack Includes
#include "singleton.h"
!
! // Log Levels
! enum eLogLevel
! {
! LOG_MESSAGE = 0,
! LOG_ERROR,
! LOG_WARNING,
! LOG_NOTICE,
! LOG_TRACE,
! LOG_DEBUG
! };
class cUOSocket;
--- 38,42 ----
// Wolfpack Includes
#include "singleton.h"
! #include "typedefs.h"
class cUOSocket;
Index: makemenus.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/makemenus.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** makemenus.cpp 7 Sep 2003 19:07:47 -0000 1.58
--- makemenus.cpp 8 Sep 2003 10:58:47 -0000 1.59
***************
*** 41,45 ****
#include "basics.h"
#include "network.h"
! #include "wpconsole.h"
// System Includes
--- 41,45 ----
#include "basics.h"
#include "network.h"
! #include "console.h"
// System Includes
***************
*** 2067,2071 ****
}
else
! clConsole.send( tr("WARNING: Missing %1 menu definition!").arg(section) );
}
--- 2067,2071 ----
}
else
! Console::instance()->send( tr("WARNING: Missing %1 menu definition!").arg(section) );
}
Index: network.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network.cpp,v
retrieving revision 1.137
retrieving revision 1.138
diff -C2 -d -r1.137 -r1.138
*** network.cpp 5 Sep 2003 00:03:45 -0000 1.137
--- network.cpp 8 Sep 2003 10:58:47 -0000 1.138
***************
*** 37,41 ****
#include "srvparams.h"
#include "globals.h"
! #include "wpconsole.h"
#include "inlines.h"
#include "network/asyncnetio.h"
--- 37,41 ----
#include "srvparams.h"
#include "globals.h"
! #include "console.h"
#include "inlines.h"
#include "network/asyncnetio.h"
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** npc.cpp 7 Sep 2003 19:07:47 -0000 1.40
--- npc.cpp 8 Sep 2003 10:58:47 -0000 1.41
***************
*** 1418,1426 ****
/* debug...
! clConsole.send( QString( "Pathfinding: %1 iterations\n" ).arg( iterations ) );
std::deque< Coord_cl >::const_iterator it = path_.begin();
while( it != path_.end() )
{
! clConsole.send( QString( "%1,%2\n" ).arg( (*it).x ).arg( (*it).y ) );
++it;
}
--- 1418,1426 ----
/* debug...
! Console::instance()->send( QString( "Pathfinding: %1 iterations\n" ).arg( iterations ) );
std::deque< Coord_cl >::const_iterator it = path_.begin();
while( it != path_.end() )
{
! Console::instance()->send( QString( "%1,%2\n" ).arg( (*it).x ).arg( (*it).y ) );
++it;
}
Index: persistentbroker.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** persistentbroker.cpp 5 Sep 2003 00:03:45 -0000 1.24
--- persistentbroker.cpp 8 Sep 2003 10:58:47 -0000 1.25
***************
*** 34,38 ****
#include "dbdriver.h"
! #include "wpconsole.h"
#include "globals.h"
#include "log.h"
--- 34,38 ----
#include "dbdriver.h"
! #include "console.h"
#include "globals.h"
#include "log.h"
***************
*** 171,178 ****
{
qWarning( query );
! clConsole.ChangeColor( WPC_RED );
! clConsole.send( "ERROR" );
! clConsole.ChangeColor( WPC_NORMAL );
! clConsole.send( ":" + connection->error() + "\n" );
}
return result;
--- 171,178 ----
{
qWarning( query );
! Console::instance()->ChangeColor( WPC_RED );
! Console::instance()->send( "ERROR" );
! Console::instance()->ChangeColor( WPC_NORMAL );
! Console::instance()->send( ":" + connection->error() + "\n" );
}
return result;
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** player.cpp 7 Sep 2003 19:07:47 -0000 1.36
--- player.cpp 8 Sep 2003 10:58:47 -0000 1.37
***************
*** 34,38 ****
#include "globals.h"
#include "chars.h"
! #include "wpconsole.h"
#include "network.h"
#include "network/uosocket.h"
--- 34,38 ----
#include "globals.h"
#include "chars.h"
! #include "console.h"
#include "network.h"
#include "network/uosocket.h"
***************
*** 183,187 ****
{
pc->setBodyID(0x0190);
! clConsole.send("player: %s with bugged body-value detected, restored to male shape\n",pc->name().latin1());
}*/
}
--- 183,187 ----
{
pc->setBodyID(0x0190);
! Console::instance()->send("player: %s with bugged body-value detected, restored to male shape\n",pc->name().latin1());
}*/
}
***************
*** 1004,1008 ****
if( !pi )
{
! clConsole.log( LOG_ERROR, "cChar::canPickUp() - bad parm" );
return false;
}
--- 1004,1008 ----
if( !pi )
{
! Console::instance()->log( LOG_ERROR, "cChar::canPickUp() - bad parm" );
return false;
}
Index: progress.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/progress.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** progress.h 21 Aug 2003 05:04:35 -0000 1.5
--- progress.h 8 Sep 2003 10:58:47 -0000 1.6
***************
*** 21,27 ****
//#include <iostream>
! #include "wpconsole.h"
! extern WPConsole_cl clConsole;
class progress_display
--- 21,27 ----
//#include <iostream>
! #include "console.h"
! extern cConsole clConsole;
class progress_display
***************
*** 39,44 ****
_expected_count = expected_count;
! clConsole.send("\n0% 10 20 30 40 50 60 70 80 90 100%\n");
! clConsole.send("|----|----|----|----|----|----|----|----|----|----|\n");
if ( !_expected_count )
_expected_count = 1; // prevent divide by zero
--- 39,44 ----
_expected_count = expected_count;
! Console::instance()->send("\n0% 10 20 30 40 50 60 70 80 90 100%\n");
! Console::instance()->send("|----|----|----|----|----|----|----|----|----|----|\n");
if ( !_expected_count )
_expected_count = 1; // prevent divide by zero
***************
*** 70,74 ****
do
{
! clConsole.send("*");
}
while ( ++_tic < tics_needed );
--- 70,74 ----
do
{
! Console::instance()->send("*");
}
while ( ++_tic < tics_needed );
***************
*** 76,82 ****
if ( _count == _expected_count ) {
if ( _tic < 51 )
! clConsole.send("*\n");
else if( _tic == 51 )
! clConsole.send("\n");
}
} // display_tic
--- 76,82 ----
if ( _count == _expected_count ) {
if ( _tic < 51 )
! Console::instance()->send("*\n");
else if( _tic == 51 )
! Console::instance()->send("\n");
}
} // display_tic
Index: pythonscript.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** pythonscript.cpp 7 Sep 2003 19:07:47 -0000 1.8
--- pythonscript.cpp 8 Sep 2003 10:58:47 -0000 1.9
***************
*** 41,45 ****
#include "maps.h"
#include "network.h"
! #include "wpconsole.h"
// Library Includes
--- 41,45 ----
#include "maps.h"
#include "network.h"
! #include "console.h"
// Library Includes
***************
*** 140,150 ****
if( !codeModule )
{
! clConsole.ProgressFail();
if( PyErr_Occurred() )
PyErr_Print();
! clConsole.send( QString( "\nError while compiling module [" + moduleName + "]\n" ) );
! clConsole.PrepareProgress( "Continuing loading" );
return false;
}
--- 140,150 ----
if( !codeModule )
{
! Console::instance()->ProgressFail();
if( PyErr_Occurred() )
PyErr_Print();
! Console::instance()->send( QString( "\nError while compiling module [" + moduleName + "]\n" ) );
! Console::instance()->PrepareProgress( "Continuing loading" );
return false;
}
Index: resources.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/resources.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** resources.cpp 28 Aug 2003 20:56:16 -0000 1.45
--- resources.cpp 8 Sep 2003 10:58:47 -0000 1.46
***************
*** 43,47 ****
#include "srvparams.h"
#include "basics.h"
! #include "wpconsole.h"
#include "world.h"
--- 43,47 ----
#include "srvparams.h"
#include "basics.h"
! #include "console.h"
#include "world.h"
***************
*** 775,781 ****
{
if( vein > 0 )
! clConsole.send( tr("ERROR: Wrong vein-amount definition in resource def. %1 (item %2)!").arg(section_).arg(vein) );
else
! clConsole.send( tr("ERROR: Wrong amount definition in resource def. %1!").arg(section_) );
return;
}
--- 775,781 ----
{
if( vein > 0 )
! Console::instance()->send( tr("ERROR: Wrong vein-amount definition in resource def. %1 (item %2)!").arg(section_).arg(vein) );
else
! Console::instance()->send( tr("ERROR: Wrong amount definition in resource def. %1!").arg(section_) );
return;
}
***************
*** 1359,1363 ****
else
{
! clConsole.send( tr("ERROR: Resource definition %1 not found!").arg( resourcename_ ) );
return true;
}
--- 1359,1363 ----
else
{
! Console::instance()->send( tr("ERROR: Resource definition %1 not found!").arg( resourcename_ ) );
return true;
}
***************
*** 1451,1455 ****
else
{
! clConsole.send( tr("ERROR: Resource definition %1 not found!").arg( resourcename_ ) );
return true;
}
--- 1451,1455 ----
else
{
! Console::instance()->send( tr("ERROR: Resource definition %1 not found!").arg( resourcename_ ) );
return true;
}
Index: scriptmanager.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/scriptmanager.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** scriptmanager.cpp 7 Sep 2003 19:07:47 -0000 1.5
--- scriptmanager.cpp 8 Sep 2003 10:58:47 -0000 1.6
***************
*** 34,38 ****
#include "basechar.h"
#include "globals.h"
! #include "wpconsole.h"
#include "world.h"
#include "items.h"
--- 34,38 ----
#include "basechar.h"
#include "globals.h"
! #include "console.h"
#include "world.h"
#include "items.h"
***************
*** 100,104 ****
// assigned to scripted items and characters
// because all of them got invalidated while relaoding
! clConsole.PrepareProgress( "Recreating assigned Script-pointers" );
cItemIterator iter_items;
--- 100,104 ----
// assigned to scripted items and characters
// because all of them got invalidated while relaoding
! Console::instance()->PrepareProgress( "Recreating assigned Script-pointers" );
cItemIterator iter_items;
***************
*** 112,116 ****
pChar->recreateEvents();
! clConsole.ProgressDone();
serverState = RUNNING;
}
--- 112,116 ----
pChar->recreateEvents();
! Console::instance()->ProgressDone();
serverState = RUNNING;
}
***************
*** 134,138 ****
void cScriptManager::load()
{
! clConsole.PrepareProgress( "Loading Script Manager" );
// Load the XML Script
--- 134,138 ----
void cScriptManager::load()
{
! Console::instance()->PrepareProgress( "Loading Script Manager" );
// Load the XML Script
***************
*** 153,158 ****
}
! clConsole.ProgressDone();
! clConsole.send( QString("%1 Script(s) loaded\n").arg(ScriptsLoaded) );
}
--- 153,158 ----
}
! Console::instance()->ProgressDone();
! Console::instance()->send( QString("%1 Script(s) loaded\n").arg(ScriptsLoaded) );
}
Index: sectors.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/sectors.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** sectors.cpp 5 Sep 2003 00:03:45 -0000 1.15
--- sectors.cpp 8 Sep 2003 10:58:47 -0000 1.16
***************
*** 6,10 ****
#include "sectors.h"
#include "uobject.h"
! #include "wpconsole.h"
#include "globals.h"
#include "exceptions.h"
--- 6,10 ----
#include "sectors.h"
#include "uobject.h"
! #include "console.h"
#include "globals.h"
#include "exceptions.h"
***************
*** 71,75 ****
if( width == 0 || height == 0 )
{
! clConsole.log( LOG_ERROR, QString( "Invalid Sectormap boundaries (Width: %1, Height: %2)." ).arg( width ).arg( height ) );
return false;
}
--- 71,75 ----
if( width == 0 || height == 0 )
{
! Console::instance()->log( LOG_ERROR, QString( "Invalid Sectormap boundaries (Width: %1, Height: %2)." ).arg( width ).arg( height ) );
return false;
}
***************
*** 487,491 ****
if( it == itemmaps.end() )
{
! clConsole.log( LOG_ERROR, QString( "Couldn't find a map with the id %1. (cSectorMaps::findItems)" ).arg( map ) );
return new cItemSectorIterator( 0, 0 ); // Return an empty iterator
}
--- 487,491 ----
if( it == itemmaps.end() )
{
! Console::instance()->log( LOG_ERROR, QString( "Couldn't find a map with the id %1. (cSectorMaps::findItems)" ).arg( map ) );
return new cItemSectorIterator( 0, 0 ); // Return an empty iterator
}
***************
*** 500,504 ****
if( it == charmaps.end() )
{
! clConsole.log( LOG_ERROR, QString( "Couldn't find a map with the id %1. (cSectorMaps::findChars)" ).arg( map ) );
return new cCharSectorIterator( 0, 0 ); // Return an empty iterator
}
--- 500,504 ----
if( it == charmaps.end() )
{
! Console::instance()->log( LOG_ERROR, QString( "Couldn't find a map with the id %1. (cSectorMaps::findChars)" ).arg( map ) );
return new cCharSectorIterator( 0, 0 ); // Return an empty iterator
}
***************
*** 513,517 ****
if( it == itemmaps.end() )
{
! clConsole.log( LOG_ERROR, QString( "Couldn't find a map with the id %1. (cSectorMaps::findItems)" ).arg( map ) );
return new cItemSectorIterator( 0, 0 ); // Return an empty iterator
}
--- 513,517 ----
if( it == itemmaps.end() )
{
! Console::instance()->log( LOG_ERROR, QString( "Couldn't find a map with the id %1. (cSectorMaps::findItems)" ).arg( map ) );
return new cItemSectorIterator( 0, 0 ); // Return an empty iterator
}
***************
*** 526,530 ****
if( it == charmaps.end() )
{
! clConsole.log( LOG_ERROR, QString( "Couldn't find a map with the id %1. (cSectorMaps::findChars)" ).arg( map ) );
return new cCharSectorIterator( 0, 0 ); // Return an empty iterator
}
--- 526,530 ----
if( it == charmaps.end() )
{
! Console::instance()->log( LOG_ERROR, QString( "Couldn't find a map with the id %1. (cSectorMaps::findChars)" ).arg( map ) );
return new cCharSectorIterator( 0, 0 ); // Return an empty iterator
}
Index: skills.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/skills.cpp,v
retrieving revision 1.207
retrieving revision 1.208
diff -C2 -d -r1.207 -r1.208
*** skills.cpp 7 Sep 2003 19:07:47 -0000 1.207
--- skills.cpp 8 Sep 2003 10:58:47 -0000 1.208
***************
*** 52,56 ****
#include "makemenus.h"
#include "npc.h"
! #include "wpconsole.h"
// System Includes
--- 52,56 ----
#include "makemenus.h"
#include "npc.h"
! #include "console.h"
// System Includes
***************
*** 786,790 ****
if( !stat )
{
! clConsole.log( LOG_ERROR, "Couldn't find strength advancement table." );
}
else
--- 786,790 ----
if( !stat )
{
! Console::instance()->log( LOG_ERROR, "Couldn't find strength advancement table." );
}
else
***************
*** 811,815 ****
if( !stat )
{
! clConsole.log( LOG_ERROR, "Couldn't find dexterity advancement table." );
}
else
--- 811,815 ----
if( !stat )
{
! Console::instance()->log( LOG_ERROR, "Couldn't find dexterity advancement table." );
}
else
***************
*** 836,840 ****
if( !stat )
{
! clConsole.log( LOG_ERROR, "Couldn't find intelligence advancement table." );
}
else
--- 836,840 ----
if( !stat )
{
! Console::instance()->log( LOG_ERROR, "Couldn't find intelligence advancement table." );
}
else
***************
*** 899,903 ****
if( skill >= skills.size() )
{
! clConsole.log( LOG_ERROR, QString( "Skill id out of range: %u" ).arg( skill ) );
return skillTitle;
}
--- 899,903 ----
if( skill >= skills.size() )
{
! Console::instance()->log( LOG_ERROR, QString( "Skill id out of range: %u" ).arg( skill ) );
return skillTitle;
}
***************
*** 918,922 ****
if( skill >= skills.size() )
{
! clConsole.log( LOG_ERROR, QString( "Skill id out of range: %u" ).arg( skill ) );
return QString::null;
}
--- 918,922 ----
if( skill >= skills.size() )
{
! Console::instance()->log( LOG_ERROR, QString( "Skill id out of range: %u" ).arg( skill ) );
return QString::null;
}
***************
*** 942,946 ****
if( skill >= skills.size() )
{
! clConsole.log( LOG_ERROR, QString( "Skill id out of range: %u" ).arg( skill ) );
return QString::null;
}
--- 942,946 ----
if( skill >= skills.size() )
{
! Console::instance()->log( LOG_ERROR, QString( "Skill id out of range: %u" ).arg( skill ) );
return QString::null;
}
Index: spawnregions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/spawnregions.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** spawnregions.cpp 7 Sep 2003 19:07:47 -0000 1.47
--- spawnregions.cpp 8 Sep 2003 10:58:47 -0000 1.48
***************
*** 50,54 ****
#include "world.h"
#include "basics.h"
! #include "wpconsole.h"
//#include "wolfpack.h" // needed for objects Npcs and Items
--- 50,54 ----
#include "world.h"
#include "basics.h"
! #include "console.h"
//#include "wolfpack.h" // needed for objects Npcs and Items
***************
*** 229,233 ****
}
! clConsole.log( LOG_WARNING, QString( "A problem has occured in spawnregion %1. Couldn't find valid spot." ).arg( this->name_ ) );
return false;
}
--- 229,233 ----
}
! Console::instance()->log( LOG_WARNING, QString( "A problem has occured in spawnregion %1. Couldn't find valid spot." ).arg( this->name_ ) );
return false;
}
***************
*** 396,400 ****
if ( toinsert_->cBaseRegion::rectangles().empty() )
{
! clConsole.log( LOG_WARNING, QString( "Top level spawnregion %1 lacks rectangle tag, ignoring region." ).arg( toinsert_->name() ) );
delete toinsert_;
}
--- 396,400 ----
if ( toinsert_->cBaseRegion::rectangles().empty() )
{
! Console::instance()->log( LOG_WARNING, QString( "Top level spawnregion %1 lacks rectangle tag, ignoring region." ).arg( toinsert_->name() ) );
delete toinsert_;
}
Index: speech.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/speech.cpp,v
retrieving revision 1.156
retrieving revision 1.157
diff -C2 -d -r1.156 -r1.157
*** speech.cpp 7 Sep 2003 19:07:47 -0000 1.156
--- speech.cpp 8 Sep 2003 10:58:47 -0000 1.157
***************
*** 54,58 ****
#include "world.h"
#include "inlines.h"
! #include "wpconsole.h"
// Library Includes
--- 54,58 ----
#include "world.h"
#include "inlines.h"
! #include "console.h"
// Library Includes
***************
*** 586,590 ****
if( !pMulti )
{
! clConsole.send( tr( "Player %1 [0x%2] has bad multi serial [0x%1]" ).arg( pPlayer->name() ).arg( pPlayer->serial(), 8, 16 ).arg( pPlayer->multis() ) );
pPlayer->setMultis( INVALID_SERIAL );
return;
--- 586,590 ----
if( !pMulti )
{
! Console::instance()->send( tr( "Player %1 [0x%2] has bad multi serial [0x%1]" ).arg( pPlayer->name() ).arg( pPlayer->serial(), 8, 16 ).arg( pPlayer->multis() ) );
pPlayer->setMultis( INVALID_SERIAL );
return;
Index: territories.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/territories.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** territories.cpp 6 Jul 2003 13:48:02 -0000 1.30
--- territories.cpp 8 Sep 2003 10:58:47 -0000 1.31
***************
*** 38,42 ****
#include "network.h"
#include "basics.h"
! #include "wpconsole.h"
#include "exceptions.h"
#include "basechar.h"
--- 38,42 ----
#include "network.h"
#include "basics.h"
! #include "console.h"
#include "exceptions.h"
#include "basechar.h"
***************
*** 281,285 ****
if ( territory->rectangles().empty() )
{
! clConsole.send( tr("Warning: Top level region %1 lacks rectangle tag, ignoring region").arg(territory->name()) );
delete territory;
}
--- 281,285 ----
if ( territory->rectangles().empty() )
{
! Console::instance()->send( tr("Warning: Top level region %1 lacks rectangle tag, ignoring region").arg(territory->name()) );
delete territory;
}
Index: tilecache.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/tilecache.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** tilecache.cpp 11 May 2003 22:33:15 -0000 1.16
--- tilecache.cpp 8 Sep 2003 10:58:47 -0000 1.17
***************
*** 32,36 ****
#include "tilecache.h"
! #include "wpconsole.h"
#include "globals.h"
#include "exceptions.h"
--- 32,36 ----
#include "tilecache.h"
! #include "console.h"
#include "globals.h"
#include "exceptions.h"
Index: typedefs.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/typedefs.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** typedefs.h 7 Sep 2003 19:07:47 -0000 1.22
--- typedefs.h 8 Sep 2003 10:58:47 -0000 1.23
***************
*** 144,148 ****
--- 144,167 ----
};
+ enum eDamageType
+ {
+ DAMAGE_PHYSICAL = 0,
+ DAMAGE_MAGICAL = 1,
+ DAMAGE_GODLY = 2,
+ DAMAGE_HUNGER = 3
+ };
+
enum enServerState { STARTUP = 0, RUNNING, SCRIPTRELOAD, SHUTDOWN };
+
+ // Log Levels
+ enum eLogLevel
+ {
+ LOG_MESSAGE = 0,
+ LOG_ERROR,
+ LOG_WARNING,
+ LOG_NOTICE,
+ LOG_TRACE,
+ LOG_DEBUG
+ };
#endif
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.218
retrieving revision 1.219
diff -C2 -d -r1.218 -r1.219
*** wolf.dsp 7 Sep 2003 19:07:47 -0000 1.218
--- wolf.dsp 8 Sep 2003 10:58:47 -0000 1.219
***************
*** 77,81 ****
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib /nologo /version:12.9 /subsystem:console /map /debug /machine:I386 /out:"..\Wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
--- 77,81 ----
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib /nologo /version:12.9 /subsystem:console /map /debug /machine:I386 /out:"..\Wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
***************
*** 139,142 ****
--- 139,146 ----
# Begin Source File
+ SOURCE=.\console.cpp
+ # End Source File
+ # Begin Source File
+
SOURCE=.\contextmenu.cpp
# End Source File
***************
*** 291,298 ****
# Begin Source File
- SOURCE=.\storage.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\targetactions.cpp
# End Source File
--- 295,298 ----
***************
*** 351,358 ****
# Begin Source File
- SOURCE=.\wpconsole.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\wpdefmanager.cpp
# End Source File
--- 351,354 ----
***************
*** 456,459 ****
--- 452,459 ----
# Begin Source File
+ SOURCE=.\console.h
+ # End Source File
+ # Begin Source File
+
SOURCE=.\contextmenu.h
# End Source File
***************
*** 1004,1011 ****
SOURCE=.\world.h
- # End Source File
- # Begin Source File
-
- SOURCE=.\wpconsole.h
# End Source File
# Begin Source File
--- 1004,1007 ----
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.456
retrieving revision 1.457
diff -C2 -d -r1.456 -r1.457
*** wolfpack.cpp 7 Sep 2003 19:07:47 -0000 1.456
--- wolfpack.cpp 8 Sep 2003 10:58:47 -0000 1.457
***************
*** 70,74 ****
#include "sectors.h"
#include "basedef.h"
! #include "wpconsole.h"
// Library Includes
--- 70,74 ----
#include "sectors.h"
#include "basedef.h"
! #include "console.h"
// Library Includes
***************
*** 83,93 ****
#include <fstream>
-
- #if defined(Q_OS_UNIX)
- # include <signal.h>
- #else
- # include <conio.h>
- #endif
-
#include "python/utilities.h"
--- 83,86 ----
***************
*** 150,154 ****
void reloadScripts()
{
! clConsole.send( "Reloading scripts...\n" );
SrvParams->reload(); // Reload wolfpack.xml
--- 143,147 ----
void reloadScripts()
{
! Console::instance()->send( "Reloading scripts...\n" );
SrvParams->reload(); // Reload wolfpack.xml
***************
*** 178,311 ****
}
-
- QMutex commandMutex;
- QStringList commandQueue;
-
- class cConsoleThread: public QThread
- {
- QWaitCondition waitCondition;
- public:
- ~cConsoleThread() throw() {
- cancel();
- wait(); // wait for it to stop
- }
-
- void cancel()
- {
- waitCondition.wakeAll();
- }
-
- protected:
- virtual void run() throw()
- {
- #if !defined(__unix__)
- // Check for a new key constantly and put it into the command-queue
- char key = 0;
-
- try
- {
- while( keeprun )
- {
- if ( kbhit() )
- {
- key = getch();
-
- if( key != 0 )
- {
- QMutexLocker lock( &commandMutex ); // Exception safe
- commandQueue.push_back( QString( "%1" ).arg( key ) );
- }
- }
- waitCondition.wait(10);
- }
- }
- catch( ... )
- {
- // commandMutex.release();
- }
- #endif
- }
- };
-
- // This function is used to interpret a command
- // sent by the console.
- void interpretCommand( const QString &command )
- {
- cUOSocket *mSock;
- int i;
- char c = command.latin1()[0];
- c = toupper(c);
-
- if( c == 'S' )
- {
- secure = !secure;
-
- if( !secure )
- clConsole.send("WOLFPACK: Secure mode disabled. Press ? for a commands list.\n");
- else
- clConsole.send("WOLFPACK: Secure mode re-enabled.\n");
-
- return;
- }
-
- // Allow Help in Secure Mode
- if( secure && c != '?' )
- {
- clConsole.send( "WOLFPACK: Secure mode prevents keyboard commands! Press 'S' to disable.\n" );
- return;
- }
-
- switch( c )
- {
- case 'Q':
- clConsole.send("WOLFPACK: Immediate Shutdown initialized!\n");
- keeprun=0;
- break;
-
- case '#':
- World::instance()->save();
- SrvParams->flush();
- break;
-
- case 'W':
- clConsole.send( "Current Users in the World:\n" );
-
- mSock = cNetwork::instance()->first();
- i = 0;
-
- for( mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next() )
- {
- if( mSock->player() )
- clConsole.send( QString("%1) %2 [%3]\n").arg(++i).arg(mSock->player()->name()).arg(QString::number( mSock->player()->serial(), 16) ) );
- }
-
- clConsole.send( tr("Total Users Online: %1\n").arg(cNetwork::instance()->count()) );
- break;
- case 'A': //reload the accounts file
- Accounts::instance()->reload();
- break;
- case 'R':
- reloadScripts();
- break;
- case '?':
- clConsole.send("Console commands:\n");
- clConsole.send(" Q: Shutdown the server.\n");
- clConsole.send(" # - Save world\n" );
- clConsole.send(" W - Display logged in characters\n" );
- clConsole.send(" A - Reload accounts\n" );
- clConsole.send(" R - Reload scripts\n" );
- clConsole.send(" S - Toggle Secure mode " );
- if( secure )
- clConsole.send( "[enabled]\n" );
- else
- clConsole.send( "[disabled]\n" );
- clConsole.send( " ? - Commands list (this)\n" );
- clConsole.send( "End of commands list.\n" );
- break;
- default:
- break;
- }
- }
-
static void parseParameter( const QString ¶m )
{
--- 171,174 ----
***************
*** 363,367 ****
}
else
! clConsole.error( QString("The specified python script [%1] doesn't exist.").arg(param) );
}
--- 226,230 ----
}
else
! Console::instance()->error( QString("The specified python script [%1] doesn't exist.").arg(param) );
}
***************
*** 461,478 ****
serverState = STARTUP;
// Print a seperator somehow
! /*clConsole.send( QString::number( sizeof( cUObject ) ) );
return 0;*/
! clConsole.send( QString( "\n%1 %2 %3 \n\n" ).arg( wp_version.productstring.c_str() ).arg( wp_version.betareleasestring.c_str() ).arg( wp_version.verstring.c_str() ) );
! clConsole.send( "Copyright (C) 1997, 98 Marcus Rating (Cironian)\n");
! clConsole.send( "Copyright (C) 2000-2003 Wolfpack Development Team\n");
! clConsole.send( "Wolfpack Homepage: http://www.wpdev.org/\n");
! clConsole.send( "By using this software you agree to the license accompanying this release.\n");
! clConsole.send( "Compiled on " __DATE__ " " __TIME__ "\n" );
! clConsole.send( "\n" );
QString consoleTitle = QString( "%1 %2 %3" ).arg( wp_version.productstring.c_str() ).arg( wp_version.betareleasestring.c_str() ).arg( wp_version.verstring.c_str() );
! clConsole.setConsoleTitle( consoleTitle );
// Startup normal Classes
--- 324,343 ----
serverState = STARTUP;
// Print a seperator somehow
! /*Console::instance()->send( QString::number( sizeof( cUObject ) ) );
return 0;*/
! Console::instance()->start(); // Startup Console
! Console::instance()->send( QString( "\n%1 %2 %3 \n\n" ).arg( wp_version.productstring.c_str() ).arg( wp_version.betareleasestring.c_str() ).arg( wp_version.verstring.c_str() ) );
!
! Console::instance()->send( "Copyright (C) 1997, 98 Marcus Rating (Cironian)\n");
! Console::instance()->send( "Copyright (C) 2000-2003 Wolfpack Development Team\n");
! Console::instance()->send( "Wolfpack Homepage: http://www.wpdev.org/\n");
! Console::instance()->send( "By using this software you agree to the license accompanying this release.\n");
! Console::instance()->send( "Compiled on " __DATE__ " " __TIME__ "\n" );
! Console::instance()->send( "\n" );
QString consoleTitle = QString( "%1 %2 %3" ).arg( wp_version.productstring.c_str() ).arg( wp_version.betareleasestring.c_str() ).arg( wp_version.verstring.c_str() );
! Console::instance()->setConsoleTitle( consoleTitle );
// Startup normal Classes
***************
*** 484,488 ****
catch( ... )
{
! clConsole.log( LOG_ERROR, "Couldn't start up classes.\n" );
exit( -1 );
}
--- 349,353 ----
catch( ... )
{
! Console::instance()->log( LOG_ERROR, "Couldn't start up classes.\n" );
exit( -1 );
}
***************
*** 500,504 ****
catch( ... )
{
! clConsole.log( LOG_ERROR, "Couldn't load translator.\n" );
exit( -1 );
}
--- 365,369 ----
catch( ... )
{
! Console::instance()->log( LOG_ERROR, "Couldn't load translator.\n" );
exit( -1 );
}
***************
*** 511,515 ****
catch( ... )
{
! clConsole.log( LOG_ERROR, "Couldn't start up python.\n" );
exit( -1 );
}
--- 376,380 ----
catch( ... )
{
! Console::instance()->log( LOG_ERROR, "Couldn't start up python.\n" );
exit( -1 );
}
***************
*** 522,561 ****
// Load data
DefManager->load();
! clConsole.send( "\n" );
// Scriptmanager can't be in the try{} block because it sometimes throws firstchance exceptions
// we don't like
ScriptManager->load();
! clConsole.send( "\n" );
// Try to load several data files
try
{
! clConsole.send( "Loading skills...\n" );
Skills->load();
! clConsole.send( "Loading accounts...\n" );
Accounts::instance()->load();
! clConsole.send( "Loading ip blocking rules...\n" );
cNetwork::instance()->load();
! clConsole.send( "Loading regions...\n" );
AllTerritories::instance()->load();
! clConsole.send( "Loading spawn regions...\n" );
SpawnRegions::instance()->load();
! clConsole.send( "Loading resources...\n" );
Resources::instance()->load();
! clConsole.send( "Loading makemenus...\n" );
MakeMenus::instance()->load();
! clConsole.send( "Loading contextmenus...\n" );
ContextMenus::instance()->reload();
// Load some MUL Data
! clConsole.send( "Loading muls...\n" );
TileCache::instance()->load( SrvParams->mulPath() );
MultiCache::instance()->load( SrvParams->mulPath() );
--- 387,426 ----
// Load data
DefManager->load();
! Console::instance()->send( "\n" );
// Scriptmanager can't be in the try{} block because it sometimes throws firstchance exceptions
// we don't like
ScriptManager->load();
! Console::instance()->send( "\n" );
// Try to load several data files
try
{
! Console::instance()->send( "Loading skills...\n" );
Skills->load();
! Console::instance()->send( "Loading accounts...\n" );
Accounts::instance()->load();
! Console::instance()->send( "Loading ip blocking rules...\n" );
cNetwork::instance()->load();
! Console::instance()->send( "Loading regions...\n" );
AllTerritories::instance()->load();
! Console::instance()->send( "Loading spawn regions...\n" );
SpawnRegions::instance()->load();
! Console::instance()->send( "Loading resources...\n" );
Resources::instance()->load();
! Console::instance()->send( "Loading makemenus...\n" );
MakeMenus::instance()->load();
! Console::instance()->send( "Loading contextmenus...\n" );
ContextMenus::instance()->reload();
// Load some MUL Data
! Console::instance()->send( "Loading muls...\n" );
TileCache::instance()->load( SrvParams->mulPath() );
MultiCache::instance()->load( SrvParams->mulPath() );
***************
*** 572,585 ****
MapObjects::instance()->addMap( 3, 2560, 2048 );
! clConsole.send( "\n" );
}
catch( wpException &exception )
{
! clConsole.log( LOG_ERROR, exception.error() );
exit( -1 );
}
catch( ... )
{
! clConsole.log( LOG_ERROR, "Unknown error while loading data files.\n" );
exit( -1 );
}
--- 437,450 ----
MapObjects::instance()->addMap( 3, 2560, 2048 );
! Console::instance()->send( "\n" );
}
catch( wpException &exception )
{
! Console::instance()->log( LOG_ERROR, exception.error() );
exit( -1 );
}
catch( ... )
{
! Console::instance()->log( LOG_ERROR, "Unknown error while loading data files.\n" );
exit( -1 );
}
***************
*** 596,600 ****
if( !persistentBroker->openDriver( SrvParams->databaseDriver() ) )
{
! clConsole.log( LOG_ERROR, QString("Error trying to open %1 database driver, check your wolfpack.xml").arg(SrvParams->databaseDriver()) );
exit( -1 );
}
--- 461,465 ----
if( !persistentBroker->openDriver( SrvParams->databaseDriver() ) )
{
! Console::instance()->log( LOG_ERROR, QString("Error trying to open %1 database driver, check your wolfpack.xml").arg(SrvParams->databaseDriver()) );
exit( -1 );
}
***************
*** 631,646 ****
catch( QString &error )
{
! clConsole.log( LOG_ERROR, error );
exit( -1 );
}
catch( ... )
{
! clConsole.log( LOG_ERROR, "An unknown error occured while loading the world.\n" );
exit( -1 );
}
! clConsole.PrepareProgress( "Initializing Multis" );
InitMultis();
! clConsole.ProgressDone();
starttime = uiCurrentTime;
--- 496,511 ----
catch( QString &error )
{
! Console::instance()->log( LOG_ERROR, error );
exit( -1 );
}
catch( ... )
{
! Console::instance()->log( LOG_ERROR, "An unknown error occured while loading the world.\n" );
exit( -1 );
}
! Console::instance()->PrepareProgress( "Initializing Multis" );
InitMultis();
! Console::instance()->ProgressDone();
starttime = uiCurrentTime;
***************
*** 654,674 ****
// print allowed clients
! clConsole.send( "Allowed clients: " );
if( SrvParams->clientsAllowed().contains( "ALL" ) )
! clConsole.send( "All\n\n" );
else
! clConsole.send( SrvParams->clientsAllowed().join( ", " ) + "\n\n" );
! clConsole.PrepareProgress( "Starting up Network" );
cNetwork::startup();
! clConsole.ProgressDone();
CIAO_IF_ERROR;
if( SrvParams->enableLogin() )
! clConsole.send( QString( "LoginServer running on port %1\n" ).arg( SrvParams->loginPort() ) );
if( SrvParams->enableGame() )
! clConsole.send( QString( "GameServer running on port %1\n" ).arg( SrvParams->gamePort() ) );
PyThreadState *_save;
--- 519,539 ----
// print allowed clients
! Console::instance()->send( "Allowed clients: " );
if( SrvParams->clientsAllowed().contains( "ALL" ) )
! Console::instance()->send( "All\n\n" );
else
! Console::instance()->send( SrvParams->clientsAllowed().join( ", " ) + "\n\n" );
! Console::instance()->PrepareProgress( "Starting up Network" );
cNetwork::startup();
! Console::instance()->ProgressDone();
CIAO_IF_ERROR;
if( SrvParams->enableLogin() )
! Console::instance()->send( QString( "LoginServer running on port %1\n" ).arg( SrvParams->loginPort() ) );
if( SrvParams->enableGame() )
! Console::instance()->send( QString( "GameServer running on port %1\n" ).arg( SrvParams->gamePort() ) );
PyThreadState *_save;
***************
*** 676,683 ****
ScriptManager->onServerStart();
- // Start the Console Input thread
- cConsoleThread consoleThread;
- consoleThread.start();
-
serverState = RUNNING;
--- 541,544 ----
***************
*** 703,720 ****
PyEval_RestoreThread( _save );
! // It's more likely that we have a new key-press now
! // Checking every 25 loops should be enough.
! #if !defined( __unix__ )
! if( loopTimeCount % 25 == 0 )
! {
! QMutexLocker lock(&commandMutex);
! if( commandQueue.count() > 0 )
! {
! // Interpret Command
! interpretCommand( commandQueue[0] );
! commandQueue.erase( commandQueue.begin() );
! }
! }
! #endif
if( loopTimeCount >= 1000 )
--- 564,568 ----
PyEval_RestoreThread( _save );
! Console::instance()->poll();
if( loopTimeCount >= 1000 )
***************
*** 744,748 ****
if ( player && !player->isGM() && player->clientIdleTime() && player->clientIdleTime() < uiCurrentTime )
{
! clConsole.send( tr("Player %1 disconnected due to inactivity !\n").arg( player->name() ) );
cUOTxMessageWarning packet;
packet.setReason( cUOTxMessageWarning::Idle );
--- 592,596 ----
if ( player && !player->isGM() && player->clientIdleTime() && player->clientIdleTime() < uiCurrentTime )
{
! Console::instance()->send( tr("Player %1 disconnected due to inactivity !\n").arg( player->name() ) );
cUOTxMessageWarning packet;
packet.setReason( cUOTxMessageWarning::Idle );
***************
*** 794,806 ****
serverState = SHUTDOWN;
- consoleThread.cancel();
-
ScriptManager->onServerStop();
cNetwork::instance()->broadcast( tr( "The server is shutting down." ) );
! clConsole.PrepareProgress( tr( "Shutting down network" ) );
cNetwork::shutdown();
! clConsole.ProgressDone();
SrvParams->flush(); // Save config options
--- 642,652 ----
serverState = SHUTDOWN;
ScriptManager->onServerStop();
cNetwork::instance()->broadcast( tr( "The server is shutting down." ) );
! Console::instance()->PrepareProgress( tr( "Shutting down network" ) );
cNetwork::shutdown();
! Console::instance()->ProgressDone();
SrvParams->flush(); // Save config options
***************
*** 812,815 ****
--- 658,663 ----
ScriptManager->unload();
stopPython();
+
+ Console::instance()->stop(); // Stop the Console
return 0;
Index: wolfpack.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** wolfpack.h 24 May 2003 12:44:05 -0000 1.34
--- wolfpack.h 8 Sep 2003 10:58:47 -0000 1.35
***************
*** 51,55 ****
#include "basics.h"
#include "network.h"
! #include "wpconsole.h"
#include "world.h"
--- 51,55 ----
#include "basics.h"
#include "network.h"
! #include "console.h"
#include "world.h"
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.153
retrieving revision 1.154
diff -C2 -d -r1.153 -r1.154
*** wolfpack.pro 7 Sep 2003 19:07:48 -0000 1.153
--- wolfpack.pro 8 Sep 2003 10:58:47 -0000 1.154
***************
*** 67,70 ****
--- 67,71 ----
combat.h \
commands.h \
+ console.h \
dbl_single_click.h \
dbdriver.h \
***************
*** 114,118 ****
verinfo.h \
wolfpack.h \
- wpconsole.h \
tilecache.h \
walking.h \
--- 115,118 ----
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** world.cpp 5 Sep 2003 00:03:46 -0000 1.37
--- world.cpp 8 Sep 2003 10:58:47 -0000 1.38
***************
*** 32,36 ****
#include "pfactory.h"
#include "world.h"
! #include "wpconsole.h"
#include "globals.h"
#include "srvparams.h"
--- 32,36 ----
#include "pfactory.h"
#include "world.h"
! #include "console.h"
#include "globals.h"
#include "srvparams.h"
***************
*** 181,185 ****
void cWorld::load()
{
! clConsole.send( "Loading World...\n" );
persistentBroker->connect( SrvParams->databaseHost(), SrvParams->databaseName(), SrvParams->databaseUsername(), SrvParams->databasePassword() );
--- 181,185 ----
void cWorld::load()
{
! Console::instance()->send( "Loading World...\n" );
persistentBroker->connect( SrvParams->databaseHost(), SrvParams->databaseName(), SrvParams->databaseUsername(), SrvParams->databasePassword() );
***************
*** 209,213 ****
continue; // Move on...
! clConsole.send( "\n"+tr("Loading ") + QString::number( count ) + tr(" objects of type ") + type );
res = persistentBroker->query( UObjectFactory::instance()->findSqlQuery( type ) );
--- 209,213 ----
continue; // Move on...
! Console::instance()->send( "\n"+tr("Loading ") + QString::number( count ) + tr(" objects of type ") + type );
res = persistentBroker->query( UObjectFactory::instance()->findSqlQuery( type ) );
***************
*** 238,242 ****
persistentBroker->driver()->setActiveConnection();
! //clConsole.send( "Loaded %i objects in %i msecs\n", progress.count(), getNormalizedTime() - sTime );
}
--- 238,242 ----
persistentBroker->driver()->setActiveConnection();
! //Console::instance()->send( "Loaded %i objects in %i msecs\n", progress.count(), getNormalizedTime() - sTime );
}
***************
*** 251,255 ****
if ( archive->size() )
{
! clConsole.send( QString( "Loading %1 Temp. Effects...\n" ).arg( archive->size() ) );
progress_display progress( archive->size() );
--- 251,255 ----
if ( archive->size() )
{
! Console::instance()->send( QString( "Loading %1 Temp. Effects...\n" ).arg( archive->size() ) );
progress_display progress( archive->size() );
***************
*** 268,272 ****
else
{
! clConsole.log( LOG_ERROR, tr( "An unknown temporary Effect class was found: %1" ).arg( objectID ) );
...
[truncated message content] |