wpdev-commits Mailing List for Wolfpack Emu (Page 193)
Brought to you by:
rip,
thiagocorrea
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(121) |
Sep
(256) |
Oct
(59) |
Nov
(73) |
Dec
(120) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(259) |
Feb
(381) |
Mar
(501) |
Apr
(355) |
May
(427) |
Jun
(270) |
Jul
(394) |
Aug
(412) |
Sep
(724) |
Oct
(578) |
Nov
(65) |
Dec
|
|
From: <dr...@us...> - 2003-09-10 20:28:56
|
Update of /cvsroot/wpdev/xmlscripts In directory sc8-pr-cvs1:/tmp/cvs-serv22939 Modified Files: accounts.sql Log Message: Hmm unique logins might be useful... Index: accounts.sql =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/accounts.sql,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** accounts.sql 9 Sep 2003 23:20:33 -0000 1.1 --- accounts.sql 10 Sep 2003 18:00:18 -0000 1.2 *************** *** 1,9 **** ! CREATE TABLE accounts ( ! login varchar(255) NOT NULL default '', ! password varchar(255) NOT NULL default '', ! flags int NOT NULL default '0', ! acl varchar(255) NOT NULL default 'player', ! lastlogin int NOT NULL default '', ! blockuntil int NOT NULL default '', ! PRIMARY KEY (login) ! ); --- 1,10 ---- ! CREATE TABLE `accounts` ( ! `login` varchar(255) NOT NULL default '', ! `PASSWORD` varchar(255) NOT NULL default '', ! `flags` int(11) NOT NULL default '0', ! `acl` varchar(255) NOT NULL default 'player', ! `lastlogin` int(11) NOT NULL default '0', ! `blockuntil` int(11) NOT NULL default '0', ! PRIMARY KEY (`login`), ! UNIQUE KEY `login` (`login`) ! ) TYPE=MyISAM; |
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv9847
Modified Files:
Timing.cpp accounts.cpp accounts.h commands.cpp console.cpp
console.h console_win.cpp globals.cpp globals.h items.cpp
npc.cpp persistentbroker.cpp persistentbroker.h player.cpp
player.h speech.cpp srvparams.cpp srvparams.h wolf.dsp
wolfpack.cpp world.cpp wpdefmanager.cpp
Log Message:
Implemented saving of Accounts to the Database and cleaned up a lot of srvparams.h and globals.h
Index: Timing.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/Timing.cpp,v
retrieving revision 1.178
retrieving revision 1.179
diff -C2 -d -r1.178 -r1.179
*** Timing.cpp 7 Sep 2003 19:07:46 -0000 1.178
--- Timing.cpp 9 Sep 2003 23:09:30 -0000 1.179
***************
*** 66,78 ****
#define DBGFILE "Timing.cpp"
- void checktimers() // Check shutdown timers
- {
- if (endtime)
- {
- if (endtime <= uiCurrentTime) keeprun = 0;
- }
- lclock = uiCurrentTime;
- }
-
void restockNPC( UINT32 currenttime, P_NPC pc_i )
{
--- 66,69 ----
***************
*** 578,588 ****
}
- //Time functions
- if( uotickcount <= currenttime )
- {
- uoTime.addSecs(1);
- uotickcount = currenttime + SrvParams->secondsPerUOMinute()*MY_CLOCKS_PER_SEC;
- }
-
// Recalculate and Resend Lightlevel
if( lighttime <= currenttime )
--- 569,572 ----
***************
*** 711,722 ****
if( checknpcs <= currenttime ) checknpcs=(unsigned int)((double)(SrvParams->checkNPCTime()*MY_CLOCKS_PER_SEC+currenttime)); //lb
! if( checktamednpcs <= currenttime ) checktamednpcs=(unsigned int)((double) currenttime+(SrvParams->checkTammedTime()*MY_CLOCKS_PER_SEC)); //AntiChrist
if( checknpcfollow <= currenttime ) checknpcfollow=(unsigned int)((double) currenttime+(SrvParams->checkFollowTime()*MY_CLOCKS_PER_SEC)); //Ripper
if( checkitemstime <= currenttime ) checkitemstime=(unsigned int)((double)(SrvParams->checkItemTime()*MY_CLOCKS_PER_SEC+currenttime)); //lb
if( shoprestocktime <= currenttime )
shoprestocktime = currenttime + MY_CLOCKS_PER_SEC * 60 * 20;
-
- // Update the delay for the next field-effect (every 500ms)
- if( nextfieldeffecttime <= currenttime )
- nextfieldeffecttime = (unsigned int) ( currenttime + ( 0.5 * MY_CLOCKS_PER_SEC ) );
}
--- 695,702 ----
if( checknpcs <= currenttime ) checknpcs=(unsigned int)((double)(SrvParams->checkNPCTime()*MY_CLOCKS_PER_SEC+currenttime)); //lb
! if( checktamednpcs <= currenttime ) checktamednpcs=(unsigned int)((double) currenttime+(SrvParams->checkTamedTime()*MY_CLOCKS_PER_SEC)); //AntiChrist
if( checknpcfollow <= currenttime ) checknpcfollow=(unsigned int)((double) currenttime+(SrvParams->checkFollowTime()*MY_CLOCKS_PER_SEC)); //Ripper
if( checkitemstime <= currenttime ) checkitemstime=(unsigned int)((double)(SrvParams->checkItemTime()*MY_CLOCKS_PER_SEC+currenttime)); //lb
if( shoprestocktime <= currenttime )
shoprestocktime = currenttime + MY_CLOCKS_PER_SEC * 60 * 20;
}
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** accounts.cpp 9 Sep 2003 03:24:15 -0000 1.64
--- accounts.cpp 9 Sep 2003 23:09:30 -0000 1.65
***************
*** 32,55 ****
#include "accounts.h"
#include "srvparams.h"
- #include "pfactory.h"
#include "network/uosocket.h"
!
#include "commands.h"
#include "player.h"
#include "network.h"
- #include "exceptions.h"
#include "globals.h"
#include "world.h"
/*****************************************************************************
! AccountRecord member functions
*****************************************************************************/
! AccountRecord::AccountRecord()
: acl_(0), inUse_(false), flags_(0)
{
}
! void AccountRecord::Serialize( ISerialization& archive )
{
if ( archive.isReading() )
--- 32,55 ----
#include "accounts.h"
#include "srvparams.h"
#include "network/uosocket.h"
! #include "dbdriver.h"
! #include "console.h"
#include "commands.h"
#include "player.h"
#include "network.h"
#include "globals.h"
+ #include "persistentbroker.h"
#include "world.h"
/*****************************************************************************
! cAccount member functions
*****************************************************************************/
! cAccount::cAccount()
: acl_(0), inUse_(false), flags_(0)
{
}
! /*void cAccount::Serialize( ISerialization& archive )
{
if ( archive.isReading() )
***************
*** 87,93 ****
}
cSerializable::Serialize( archive );
! }
! bool AccountRecord::isBlocked() const
{
if ( (blockUntil.isValid() && blockUntil < QDateTime::currentDateTime()) || flags_&0x00000001 )
--- 87,93 ----
}
cSerializable::Serialize( archive );
! }*/
! bool cAccount::isBlocked() const
{
if ( (blockUntil.isValid() && blockUntil < QDateTime::currentDateTime()) || flags_&0x00000001 )
***************
*** 97,101 ****
}
! uint AccountRecord::secsToUnblock() const
{
if ( isBlocked() )
--- 97,101 ----
}
! uint cAccount::secsToUnblock() const
{
if ( isBlocked() )
***************
*** 106,110 ****
}
! bool AccountRecord::addCharacter( P_PLAYER d )
{
if( qFind( characters_.begin(), characters_.end(), d ) == characters_.end() )
--- 106,110 ----
}
! bool cAccount::addCharacter( P_PLAYER d )
{
if( qFind( characters_.begin(), characters_.end(), d ) == characters_.end() )
***************
*** 116,120 ****
}
! bool AccountRecord::removeCharacter( P_PLAYER d )
{
QValueVector<P_PLAYER>::iterator it = qFind( characters_.begin(), characters_.end(), d );
--- 116,120 ----
}
! bool cAccount::removeCharacter( P_PLAYER d )
{
QValueVector<P_PLAYER>::iterator it = qFind( characters_.begin(), characters_.end(), d );
***************
*** 127,131 ****
}
! bool AccountRecord::authorized( const QString& group, const QString& value ) const
{
// No Valid ACL specified
--- 127,131 ----
}
! bool cAccount::authorized( const QString& group, const QString& value ) const
{
// No Valid ACL specified
***************
*** 160,169 ****
}
! void AccountRecord::remove()
{
Accounts::instance()->remove( this );
}
! void cAccounts::remove( AccountRecord *record )
{
if( accounts.contains( record->login() ) )
--- 160,169 ----
}
! void cAccount::remove()
{
Accounts::instance()->remove( this );
}
! void cAccounts::remove( cAccount *record )
{
if( accounts.contains( record->login() ) )
***************
*** 172,206 ****
}
! void AccountRecord::refreshAcl()
{
acl_ = cCommands::instance()->getACL( aclName_ );
}
! bool AccountRecord::isAllMove() const
{
return flags_&0x00000002;
}
! bool AccountRecord::isAllShow() const
{
return flags_&0x00000004;
}
! bool AccountRecord::isShowSerials() const
{
return flags_&0x00000008;
}
! bool AccountRecord::isPageNotify() const
{
return flags_&0x00000010;
}
! bool AccountRecord::isStaff() const
{
return flags_&0x00000020;
}
! void AccountRecord::setBlocked( bool data )
{
if( data )
--- 172,206 ----
}
! void cAccount::refreshAcl()
{
acl_ = cCommands::instance()->getACL( aclName_ );
}
! bool cAccount::isAllMove() const
{
return flags_&0x00000002;
}
! bool cAccount::isAllShow() const
{
return flags_&0x00000004;
}
! bool cAccount::isShowSerials() const
{
return flags_&0x00000008;
}
! bool cAccount::isPageNotify() const
{
return flags_&0x00000010;
}
! bool cAccount::isStaff() const
{
return flags_&0x00000020;
}
! void cAccount::setBlocked( bool data )
{
if( data )
***************
*** 210,214 ****
}
! void AccountRecord::setAllMove( bool data )
{
if( data )
--- 210,214 ----
}
! void cAccount::setAllMove( bool data )
{
if( data )
***************
*** 218,222 ****
}
! void AccountRecord::setAllShow( bool data )
{
if( data )
--- 218,222 ----
}
! void cAccount::setAllShow( bool data )
{
if( data )
***************
*** 226,230 ****
}
! void AccountRecord::setShowSerials( bool data )
{
if( data )
--- 226,230 ----
}
! void cAccount::setShowSerials( bool data )
{
if( data )
***************
*** 234,238 ****
}
! void AccountRecord::setPageNotify( bool data )
{
if( data )
--- 234,238 ----
}
! void cAccount::setPageNotify( bool data )
{
if( data )
***************
*** 242,246 ****
}
! void AccountRecord::setStaff( bool data )
{
if( data )
--- 242,246 ----
}
! void cAccount::setStaff( bool data )
{
if( data )
***************
*** 263,271 ****
iterator it = accounts.begin();
for (; it != accounts.end(); ++it)
! delete it.data();
!
}
! AccountRecord* cAccounts::authenticate(const QString& login, const QString& password, enErrorCode* error) const
{
const_iterator it = accounts.find(login);
--- 263,270 ----
iterator it = accounts.begin();
for (; it != accounts.end(); ++it)
! delete it.data();
}
! cAccount* cAccounts::authenticate(const QString& login, const QString& password, enErrorCode* error) const
{
const_iterator it = accounts.find(login);
***************
*** 298,309 ****
else
{
- // it.data()->loginAttemped();
if( error )
*error = BadPassword;
! // Now we check for the number of attempts;
! // if ( it.data()->loginAttempts() > SrvParams->MaxLoginAttempts() )
! // {
! // it.data()->block(SrvParams->AccountBlockTime());
! // }
return 0;
}
--- 297,303 ----
else
{
if( error )
*error = BadPassword;
!
return 0;
}
***************
*** 319,353 ****
void cAccounts::save()
{
! ISerialization* archive = cPluginFactory::serializationArchiver( SrvParams->accountsArchiver());
! archive->prepareWritting("accounts");
! // Now save accounts
! iterator it = accounts.begin();
! for (; it != accounts.end(); ++it )
{
! archive->writeObject( it.data() );
}
! archive->close();
! delete archive;
}
void cAccounts::load()
{
! ISerialization* archive = cPluginFactory::serializationArchiver( SrvParams->accountsArchiver());
! archive->prepareReading("accounts");
! for (uint i = 0; i < archive->size(); ++i)
{
! QString objectID;
! archive->readObjectID( objectID );
! if ( objectID == "ACCOUNT" )
{
! AccountRecord* d = new AccountRecord;
! archive->readObject( d );
! accounts.insert( d->login(), d );
}
- else
- throw wpException( "Error parsing account records." );
}
! archive->close();
! delete archive;
}
--- 313,408 ----
void cAccounts::save()
{
! // Open the Account Driver
! if( !persistentBroker->openDriver( SrvParams->accountsDriver() ) )
{
! Console::instance()->log( LOG_ERROR, QString( "Unknown Account Database Driver '%1', check your wolfpack.xml").arg( SrvParams->accountsDriver() ) );
! return;
}
!
! bool connected = false;
!
! try
! {
! persistentBroker->connect( SrvParams->accountsHost(), SrvParams->accountsName(), SrvParams->accountsUsername(), SrvParams->accountsPassword() );
! connected = true;
!
! persistentBroker->executeQuery( "BEGIN;" );
!
! persistentBroker->executeQuery( "DELETE FROM accounts;" );
!
! iterator it = accounts.begin();
! for (; it != accounts.end(); ++it)
! {
! // INSERT
! cAccount *account = it.data();
!
! QString sql( "INSERT INTO accounts VALUES( '%1', '%2', %3, '%4', %5, %6 );" );
!
! sql = sql.arg( account->login_ ).arg( account->password_ ).arg( account->flags_ ).arg( account->aclName_ ).arg( !account->lastLogin_.isNull() ? account->lastLogin_.toTime_t() : 0 ).arg( !account->blockUntil.isNull() ? account->blockUntil.toTime_t() : 0 );
!
! persistentBroker->executeQuery( sql );
! }
!
! persistentBroker->executeQuery( "COMMIT;" );
! }
! catch( QString &error )
! {
! if( connected )
! persistentBroker->executeQuery( "ROLLBACK;" );
! Console::instance()->log( LOG_ERROR, QString( "Error while saving Accounts: %1." ).arg( error ) );
! }
! catch( ... )
! {
! if( connected )
! persistentBroker->executeQuery( "ROLLBACK;" );
! Console::instance()->log( LOG_ERROR, "Unknown error while saving Accounts." );
! }
}
void cAccounts::load()
{
! // Open the Account Driver
! if( !persistentBroker->openDriver( SrvParams->accountsDriver() ) )
{
! Console::instance()->log( LOG_ERROR, QString( "Unknown Account Database Driver '%1', check your wolfpack.xml").arg( SrvParams->accountsDriver() ) );
! return;
! }
!
! // Load all Accounts
! try
! {
! persistentBroker->connect( SrvParams->accountsHost(), SrvParams->accountsName(), SrvParams->accountsUsername(), SrvParams->accountsPassword() );
!
! cDBResult result = persistentBroker->query( "SELECT accounts.login,accounts.password,accounts.flags,accounts.acl,accounts.lastlogin,accounts.blockuntil FROM accounts;" );
!
! // Clear Accounts HERE
! // Here we can be pretty sure that we have a valid datasource for accounts
! clear();
!
! while( result.fetchrow() )
{
! cAccount *account = new cAccount;
! account->login_ = result.getString( 0 );
! account->password_ = result.getString( 1 );
! account->flags_ = result.getInt( 2 );
! account->aclName_ = result.getString( 3 );
! account->refreshAcl();
! if( result.getInt( 4 ) != 0 )
! account->lastLogin_.setTime_t( result.getInt( 4 ) );
!
! if( result.getInt( 5 ) != 0 )
! account->blockUntil.setTime_t( result.getInt( 5 ) );
!
! accounts.insert( account->login_, account );
}
}
! catch( QString &error )
! {
! Console::instance()->log( LOG_ERROR, QString( "Error while loading Accounts: %1" ).arg( error ) );
! }
! catch( ... )
! {
! Console::instance()->log( LOG_ERROR, "Unknown error while loading Accounts" );
! }
}
***************
*** 377,381 ****
}
- clear();
load();
--- 432,435 ----
***************
*** 396,405 ****
++sit;
}
-
}
! AccountRecord* cAccounts::createAccount( const QString& login, const QString& password )
{
! AccountRecord* d = new AccountRecord;
d->login_ = login;
d->password_ = password;
--- 450,458 ----
++sit;
}
}
! cAccount* cAccounts::createAccount( const QString& login, const QString& password )
{
! cAccount* d = new cAccount;
d->login_ = login;
d->password_ = password;
***************
*** 419,423 ****
}
! AccountRecord* cAccounts::getRecord( const QString& login )
{
iterator it = accounts.find( login );
--- 472,476 ----
}
! cAccount* cAccounts::getRecord( const QString& login )
{
iterator it = accounts.find( login );
Index: accounts.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** accounts.h 9 Sep 2003 03:24:15 -0000 1.30
--- accounts.h 9 Sep 2003 23:09:30 -0000 1.31
***************
*** 54,58 ****
class cAcl;
! class AccountRecord : public cSerializable
{
friend class cAccounts; // my manager
--- 54,58 ----
class cAcl;
! class cAccount
{
friend class cAccounts; // my manager
***************
*** 78,82 ****
public:
! AccountRecord();
QString login() const;
--- 78,82 ----
public:
! cAccount();
QString login() const;
***************
*** 105,111 ****
UINT32 flags() const;
QDateTime blockedUntil() const { return blockUntil; }
-
- void Serialize( ISerialization& );
- QString objectID( void ) const;
// Flag Setters/Getters
--- 105,108 ----
***************
*** 129,134 ****
{
private:
! QMap<QString, AccountRecord*> accounts;
! typedef QMap<QString, AccountRecord*>::iterator iterator;
public:
enum enErrorCode {LoginNotFound, BadPassword, Banned, Wipped, AlreadyInUse, NoError};
--- 126,131 ----
{
private:
! QMap<QString, cAccount*> accounts;
! typedef QMap<QString, cAccount*>::iterator iterator;
public:
enum enErrorCode {LoginNotFound, BadPassword, Banned, Wipped, AlreadyInUse, NoError};
***************
*** 136,145 ****
public:
~cAccounts();
! AccountRecord* authenticate(const QString& login, const QString& password, enErrorCode* = 0) const;
! AccountRecord* getRecord( const QString& );
! AccountRecord* createAccount( const QString& login, const QString& password );
uint count();
! void remove( AccountRecord *record );
void save();
--- 133,142 ----
public:
~cAccounts();
! cAccount* authenticate(const QString& login, const QString& password, enErrorCode* = 0) const;
! cAccount* getRecord( const QString& );
! cAccount* createAccount( const QString& login, const QString& password );
uint count();
! void remove( cAccount *record );
void save();
***************
*** 148,152 ****
void clear();
! typedef QMap<QString, AccountRecord*>::const_iterator const_iterator;
const_iterator begin() const { return accounts.begin(); }
const_iterator end() const { return accounts.end(); }
--- 145,149 ----
void clear();
! typedef QMap<QString, cAccount*>::const_iterator const_iterator;
const_iterator begin() const { return accounts.begin(); }
const_iterator end() const { return accounts.end(); }
***************
*** 154,228 ****
// inline members
! inline QString AccountRecord::acl() const
{
return aclName_;
}
! inline QString AccountRecord::login() const
{
return login_;
}
! inline QString AccountRecord::password() const
{
return password_;
}
! inline void AccountRecord::setPassword( const QString& data )
{
password_ = data;
}
! inline QValueVector<P_PLAYER> AccountRecord::caracterList() const
{
return characters_;
}
! inline QString AccountRecord::objectID( void ) const
! {
! return "ACCOUNT";
! }
!
! inline void AccountRecord::setAcl( const QString &d )
{
aclName_ = d;
}
! inline void AccountRecord::block( int seconds )
{
blockUntil = QDateTime::currentDateTime().addSecs( seconds );
}
! inline QDateTime AccountRecord::lastLogin() const
{
return lastLogin_;
}
! inline UINT32 AccountRecord::flags() const
{
return flags_;
}
! inline void AccountRecord::setLastLogin( const QDateTime& d )
{
lastLogin_ = d;
}
! inline bool AccountRecord::inUse() const
{
return inUse_;
}
! inline void AccountRecord::setInUse( bool data )
{
inUse_ = data;
}
! inline void AccountRecord::setBlockUntil( const QDateTime &d )
{
blockUntil = d;
}
! inline void AccountRecord::setFlags( UINT32 data )
{
flags_ = data;
--- 151,220 ----
// inline members
! inline QString cAccount::acl() const
{
return aclName_;
}
! inline QString cAccount::login() const
{
return login_;
}
! inline QString cAccount::password() const
{
return password_;
}
! inline void cAccount::setPassword( const QString& data )
{
password_ = data;
}
! inline QValueVector<P_PLAYER> cAccount::caracterList() const
{
return characters_;
}
! inline void cAccount::setAcl( const QString &d )
{
aclName_ = d;
}
! inline void cAccount::block( int seconds )
{
blockUntil = QDateTime::currentDateTime().addSecs( seconds );
}
! inline QDateTime cAccount::lastLogin() const
{
return lastLogin_;
}
! inline UINT32 cAccount::flags() const
{
return flags_;
}
! inline void cAccount::setLastLogin( const QDateTime& d )
{
lastLogin_ = d;
}
! inline bool cAccount::inUse() const
{
return inUse_;
}
! inline void cAccount::setInUse( bool data )
{
inUse_ = data;
}
! inline void cAccount::setBlockUntil( const QDateTime &d )
{
blockUntil = d;
}
! inline void cAccount::setFlags( UINT32 data )
{
flags_ = data;
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.200
retrieving revision 1.201
diff -C2 -d -r1.200 -r1.201
*** commands.cpp 9 Sep 2003 03:24:15 -0000 1.200
--- commands.cpp 9 Sep 2003 23:09:30 -0000 1.201
***************
*** 409,413 ****
else
{
! AccountRecord *account = Accounts::instance()->getRecord( args[1].left( 30 ) );
QValueVector<P_PLAYER> characters = account->caracterList();
Accounts::instance()->remove( account );
--- 409,413 ----
else
{
! cAccount *account = Accounts::instance()->getRecord( args[1].left( 30 ) );
QValueVector<P_PLAYER> characters = account->caracterList();
Accounts::instance()->remove( account );
***************
*** 434,438 ****
else
{
! AccountRecord *account = Accounts::instance()->getRecord( args[1].left( 30 ) );
QString key = args[2];
QString value = args[3];
--- 434,438 ----
else
{
! cAccount *account = Accounts::instance()->getRecord( args[1].left( 30 ) );
QString key = args[2];
QString value = args[3];
***************
*** 502,506 ****
else
{
! AccountRecord *account = Accounts::instance()->getRecord( args[1].left( 30 ) );
QString key = args[2];
--- 502,506 ----
else
{
! cAccount *account = Accounts::instance()->getRecord( args[1].left( 30 ) );
QString key = args[2];
Index: console.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** console.cpp 8 Sep 2003 23:38:49 -0000 1.2
--- console.cpp 9 Sep 2003 23:09:30 -0000 1.3
***************
*** 247,248 ****
--- 247,256 ----
return true;
}
+
+ void cConsole::queueCommand( const QString &command )
+ {
+ commandMutex.lock();
+ commandQueue.push_back( command );
+ commandMutex.unlock();
+ }
+
Index: console.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** console.h 9 Sep 2003 15:17:07 -0000 1.3
--- console.h 9 Sep 2003 23:09:30 -0000 1.4
***************
*** 42,45 ****
--- 42,46 ----
#include <qstringlist.h>
#include <qstring.h>
+ #include <qmutex.h>
// Third Party includes
***************
*** 74,77 ****
--- 75,81 ----
QStringList linebuffer_;
QString incompleteLine_;
+ QStringList commandQueue;
+ QMutex commandMutex;
+
public:
cConsole();
***************
*** 100,107 ****
virtual void ChangeColor( WPC_ColorKeys Color );
virtual void setConsoleTitle( const QString& data );
-
QStringList linebuffer() const { return linebuffer_; }
!
! bool handleCommand( const QString &command, bool silentFail = false );
virtual void start();
virtual void poll();
--- 104,110 ----
virtual void ChangeColor( WPC_ColorKeys Color );
virtual void setConsoleTitle( const QString& data );
QStringList linebuffer() const { return linebuffer_; }
! void queueCommand( const QString &command ); // Thread-Safe
!
virtual void start();
virtual void poll();
***************
*** 114,117 ****
--- 117,121 ----
std::ostream *outputstrm;
bool bEnabled;
+ bool handleCommand( const QString &command, bool silentFail = false );
};
Index: console_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_win.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** console_win.cpp 9 Sep 2003 15:33:07 -0000 1.6
--- console_win.cpp 9 Sep 2003 23:09:30 -0000 1.7
***************
*** 84,87 ****
--- 84,90 ----
LRESULT CALLBACK wpWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
+ if( mainWindow && hwnd != mainWindow )
+ return DefWindowProc( hwnd, msg, wparam, lparam );
+
CHARFORMAT cf;
LOGFONT lfont;
***************
*** 201,204 ****
--- 204,211 ----
return 0;
+ case WM_CLOSE:
+ keeprun = 0;
+ return 1;
+
case WM_DESTROY:
keeprun = 0;
***************
*** 336,342 ****
GetWindowText( inputWindow, command, 512 );
SetWindowText( inputWindow, "" );
!
! // Process Command
! Console::instance()->handleCommand( command );
}
--- 343,349 ----
GetWindowText( inputWindow, command, 512 );
SetWindowText( inputWindow, "" );
!
! // We are in a different Thread. Remember that.
! Console::instance()->queueCommand( command );
}
***************
*** 361,364 ****
--- 368,382 ----
void cConsole::poll()
{
+ // Poll for new Commands
+ commandMutex.lock();
+ QStringList commands = commandQueue;
+ commandQueue.clear();
+ commandMutex.unlock();
+
+ while( commands.count() > 0 )
+ {
+ handleCommand( commands.front() );
+ commands.pop_front();
+ }
}
***************
*** 520,521 ****
--- 538,540 ----
SendMessage( logWindow, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf );
}
+
Index: globals.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/globals.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -d -r1.102 -r1.103
*** globals.cpp 9 Sep 2003 03:24:15 -0000 1.102
--- globals.cpp 9 Sep 2003 23:09:30 -0000 1.103
***************
*** 50,146 ****
#include <qdatetime.h>
-
- using namespace std;
-
enServerState serverState;
!
! // Instantiate our console object
! cConsole clConsole;
!
! time_t oldtime, newtime;
!
! unsigned int polyduration=90;
!
! //Time variables
QDateTime uoTime;
! int secondsperuominute=5; //Number of seconds for a WOLFPACK minute.
! int uotickcount=1;
! unsigned long initialserversec ;
! unsigned long initialservermill ;
! //int goldamount;
! unsigned int nextfieldeffecttime=0;
! unsigned int nextnpcaitime=0;
!
! // MSVC fails to compile WOLFPACK if this is unsigned, change it then
! int autosaved, saveinterval;
! int dosavewarning=0;
! bool heartbeat;
!
! int err, error;
volatile int keeprun;
- //int now;
-
- int secure; // Secure mode
-
- // - the below structure is for looking up items based on serial #
- // - item's serial, owner's serial, char's serial, and container's serial
-
- unsigned int raindroptime;
-
- int tnum;
-
- unsigned int starttime, endtime, lclock;
-
- unsigned int shoprestocktime=0;
-
- //int *spawnedguards;
- // Profiling
- int networkTime = 0;
- int timerTime = 0;
- int autoTime = 0;
- int loopTime = 0;
- int networkTimeCount = 1000;
- int timerTimeCount = 1000;
- int autoTimeCount = 1000;
- int loopTimeCount = 1000;
-
- unsigned long int serverstarttime;
-
- // Script files that need to be cached
- // Crackerjack Jul 31/99
-
- int escortRegions = 0;
-
-
- unsigned int hungerdamagetimer=0; // For hunger damage
-
- //-=-=-=-=-=-=-Classes Definitions=-=-=-=-=-=//
cSrvParams *SrvParams;
Maps *Map;
cSkills *Skills;
cSpeech *Speech;
- cBounty *Bounty;
cScriptManager *ScriptManager;
WPDefManager *DefManager;
PersistentBroker* persistentBroker;
!
! // - the below structure is for looking up items based on serial #
! // - item's serial, owner's serial, char's serial, and container's serial
!
! list<SERIAL> guilds;
!
! /******************************************************/
!
! ///////////////////////////////////////////
! /// and the rest /
! ///////////////////////////////////////////
! std::vector<std::string> clientsAllowed; // client version controll system
!
! /////////////////////////////////////////
! ///////////// global string vars /////////
! /////////////////////////////////////////
!
! char temp[1024];
--- 50,72 ----
#include <qdatetime.h>
enServerState serverState;
! time_t oldtime;
! time_t newtime;
QDateTime uoTime;
! int autosaved;
! int secure = 1;
! int dosavewarning = 0;
volatile int keeprun;
+ unsigned int shoprestocktime = 0;
+ unsigned int hungerdamagetimer = 0;
cSrvParams *SrvParams;
Maps *Map;
cSkills *Skills;
cSpeech *Speech;
cScriptManager *ScriptManager;
WPDefManager *DefManager;
PersistentBroker* persistentBroker;
! char temp[1024];
Index: globals.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/globals.h,v
retrieving revision 1.76
retrieving revision 1.77
diff -C2 -d -r1.76 -r1.77
*** globals.h 9 Sep 2003 03:24:16 -0000 1.76
--- globals.h 9 Sep 2003 23:09:30 -0000 1.77
***************
*** 32,37 ****
#if !defined(__GLOBALS_H__)
#define __GLOBALS_H__
! // Platform specifics
#include "platform.h"
// System Includes
--- 32,39 ----
#if !defined(__GLOBALS_H__)
#define __GLOBALS_H__
!
! // Wolfpack Includes
#include "platform.h"
+ #include "structs.h"
// System Includes
***************
*** 44,118 ****
#include <termios.h>
#endif
- // Third Party
-
-
- //Forward Class Declaration
class QDateTime;
class cScriptManager;
class WPDefManager;
- #include "structs.h"
-
// Global Variables
-
extern enServerState serverState;
-
extern unsigned int uiCurrentTime;
- extern unsigned int raindroptime;
- extern unsigned int polyduration;
- //extern wp_version_info wp_version;
-
- //Time variables
extern QDateTime uoTime;
- extern int uotickcount;
-
- //extern int goldamount;
- extern unsigned int nextfieldeffecttime;
extern unsigned int nextnpcaitime;
extern int autosaved, dosavewarning;
- extern int err, error;
extern volatile int keeprun;
- //extern int now;
- extern int secure; // Secure mode
! extern unsigned int starttime, endtime, lclock;
extern unsigned int shoprestocktime;
extern unsigned int hungerdamagetimer; // Used for hunger damage
- // Profiling
- extern int networkTime;
- extern int timerTime;
- extern int autoTime;
- extern int loopTime;
- extern int networkTimeCount;
- extern int timerTimeCount;
- extern int autoTimeCount;
- extern int loopTimeCount;
-
- extern unsigned long int serverstarttime;
-
- extern unsigned long initialserversec;
- extern unsigned long initialservermill ;
-
-
-
- // - the below structure is for looking up items based on serial #
- // - item's serial, owner's serial, char's serial, and container's serial
-
- extern std::list<SERIAL> guilds;
-
- /******************************************************/
-
- /////////////////////////////////////////
- ///////////// global string vars /////////
- /////////////////////////////////////////
extern char temp[1024];
- // Forward declarations
class cSrvParams;
class cBoat;
--- 46,73 ----
#include <termios.h>
#endif
+ // Forward Class Declaration
class QDateTime;
class cScriptManager;
class WPDefManager;
// Global Variables
extern enServerState serverState;
extern unsigned int uiCurrentTime;
extern QDateTime uoTime;
extern unsigned int nextnpcaitime;
extern int autosaved, dosavewarning;
extern volatile int keeprun;
! extern int secure; // Secure mode
extern unsigned int shoprestocktime;
extern unsigned int hungerdamagetimer; // Used for hunger damage
extern char temp[1024];
class cSrvParams;
class cBoat;
***************
*** 120,142 ****
class Maps;
class cSkills;
- class cTargets;
- class cMovement;
class cSpeech;
- class cBounty;
- class cAccounts;
class PersistentBroker;
- //-=-=-=-=-=-=-Classes Definitions=-=-=-=-=-=//
extern cSrvParams *SrvParams;
extern Maps *Map;
extern cSkills *Skills;
extern cSpeech *Speech;
- extern cBounty *Bounty;
extern cScriptManager *ScriptManager;
extern WPDefManager *DefManager;
extern PersistentBroker *persistentBroker;
- // END
- //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-//
-
#endif
--- 75,88 ----
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.348
retrieving revision 1.349
diff -C2 -d -r1.348 -r1.349
*** items.cpp 8 Sep 2003 10:58:47 -0000 1.348
--- items.cpp 9 Sep 2003 23:09:30 -0000 1.349
***************
*** 1877,1883 ****
World::instance()->registerObject( pi );
- if( pi->objectID() == "cGuildStone" ) // register as guild as well
- guilds.push_back(pi->serial());
-
// Set the outside indices
pi->SetSpawnSerial( pi->spawnserial );
--- 1877,1880 ----
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** npc.cpp 9 Sep 2003 17:22:55 -0000 1.42
--- npc.cpp 9 Sep 2003 23:09:30 -0000 1.43
***************
*** 645,651 ****
if( mSock->player() && mSock->player()->inRange( this, mSock->player()->visualRange() ) )
{
! if( SrvParams->showDeathAnim() )
! mSock->send( &dAction );
!
mSock->send( &rObject );
}
--- 645,649 ----
if( mSock->player() && mSock->player()->inRange( this, mSock->player()->visualRange() ) )
{
! mSock->send( &dAction );
mSock->send( &rObject );
}
Index: persistentbroker.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** persistentbroker.cpp 9 Sep 2003 03:24:16 -0000 1.26
--- persistentbroker.cpp 9 Sep 2003 23:09:30 -0000 1.27
***************
*** 117,140 ****
bool PersistentBroker::saveObject( PersistentObject* object )
{
! // Start Transaction
! if( sqlite )
! connection->exec( "BEGIN TRANSACTION;" );
!
! try
! {
! object->save();
! }
! catch( ... )
! {
! // Rollback
! if( sqlite )
! connection->exec( "ROLLBACK TRANSACTION;" );
! throw;
! }
!
! // Commit
! if( sqlite )
! connection->exec( "COMMIT TRANSACTION;" );
!
return true;
}
--- 117,121 ----
bool PersistentBroker::saveObject( PersistentObject* object )
{
! object->save();
return true;
}
***************
*** 233,235 ****
--- 214,234 ----
{
connection->unlockTable( table );
+ }
+
+ void PersistentBroker::startTransaction()
+ {
+ if( sqlite )
+ executeQuery( "BEGIN;" );
+ }
+
+ void PersistentBroker::commitTransaction()
+ {
+ if( sqlite )
+ executeQuery( "END;" );
+ }
+
+ void PersistentBroker::rollbackTransaction()
+ {
+ if( sqlite )
+ executeQuery( "ROLLBACK;" );
}
Index: persistentbroker.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** persistentbroker.h 31 Aug 2003 18:47:26 -0000 1.22
--- persistentbroker.h 9 Sep 2003 23:09:30 -0000 1.23
***************
*** 83,86 ****
--- 83,90 ----
QString lastError() const;
cDBDriver* driver() const;
+
+ void startTransaction();
+ void commitTransaction();
+ void rollbackTransaction();
};
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** player.cpp 8 Sep 2003 10:58:47 -0000 1.37
--- player.cpp 9 Sep 2003 23:09:30 -0000 1.38
***************
*** 645,651 ****
if( mSock->player() && mSock->player()->inRange( this, mSock->player()->visualRange() ) && ( mSock != socket_ ) )
{
! if( SrvParams->showDeathAnim() )
! mSock->send( &dAction );
!
mSock->send( &rObject );
}
--- 645,649 ----
if( mSock->player() && mSock->player()->inRange( this, mSock->player()->visualRange() ) && ( mSock != socket_ ) )
{
! mSock->send( &dAction );
mSock->send( &rObject );
}
Index: player.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** player.h 5 Sep 2003 00:03:45 -0000 1.22
--- player.h 9 Sep 2003 23:09:30 -0000 1.23
***************
*** 116,120 ****
// getters
! AccountRecord* account() const;
UINT32 additionalFlags() const;
UINT32 clientIdleTime() const;
--- 116,120 ----
// getters
! cAccount* account() const;
UINT32 additionalFlags() const;
UINT32 clientIdleTime() const;
***************
*** 142,146 ****
// setters
! void setAccount(AccountRecord* data, bool moveFromAccToAcc = true);
void setAdditionalFlags(UINT32 data);
void setClientIdleTime(UINT32 data);
--- 142,146 ----
// setters
! void setAccount(cAccount* data, bool moveFromAccToAcc = true);
void setAdditionalFlags(UINT32 data);
void setClientIdleTime(UINT32 data);
***************
*** 184,188 ****
// The account object including this char.
// cOldChar::account_
! AccountRecord* account_;
// time till char will be logged out
--- 184,188 ----
// The account object including this char.
// cOldChar::account_
! cAccount* account_;
// time till char will be logged out
***************
*** 242,251 ****
};
! inline AccountRecord* cPlayer::account() const
{
return account_;
}
! inline void cPlayer::setAccount(AccountRecord* data, bool moveFromAccToAcc)
{
if( moveFromAccToAcc && account_ != 0 )
--- 242,251 ----
};
! inline cAccount* cPlayer::account() const
{
return account_;
}
! inline void cPlayer::setAccount(cAccount* data, bool moveFromAccToAcc)
{
if( moveFromAccToAcc && account_ != 0 )
Index: speech.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/speech.cpp,v
retrieving revision 1.157
retrieving revision 1.158
diff -C2 -d -r1.157 -r1.158
*** speech.cpp 8 Sep 2003 10:58:47 -0000 1.157
--- speech.cpp 9 Sep 2003 23:09:30 -0000 1.158
***************
*** 737,753 ****
pChar->setSaycolor( color );
- if( SrvParams->speechLog() )
- {
- QFile lFile( "speech.log" );
-
- if( lFile.open( IO_Append ) )
- {
- QString logMessage( "[%1] %2: %3 [%4, 0x%5]" );
- logMessage = logMessage.arg( QDateTime::currentDateTime().toString() ).arg( pChar->name() ).arg( speech ).arg( pChar->account()->login() ).arg( pChar->serial(), 8, 16 );
- lFile.writeBlock( logMessage.latin1(), logMessage.length() );
- lFile.close();
- }
- }
-
if( pChar->onTalk( type, color, font, speech, lang ) )
return;
--- 737,740 ----
Index: srvparams.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/srvparams.cpp,v
retrieving revision 1.87
retrieving revision 1.88
diff -C2 -d -r1.87 -r1.88
*** srvparams.cpp 5 Sep 2003 00:03:45 -0000 1.87
--- srvparams.cpp 9 Sep 2003 23:09:30 -0000 1.88
***************
*** 101,117 ****
{
// Account Group
! autoAccountCreate_ = getBool("Accounts", "Auto Create", false, true);
! autoAccountReload_ = getNumber("Accounts", "Auto Reload", 10, true);
! checkCharAge_ = getBool("Accounts", "Check Delete Age", true, true);
! maxLoginAttempts_ = getNumber("Accounts", "Max Login Attempts", 5, true);
! resetAttemptCount_ = getNumber("Accounts", "Reset Attempts Count", 3*60, true);
! accountsBlockTime_ = getNumber("Accounts", "Block Failed Logins", 3*60, true);
! accountsArchiver_ = getString("Accounts", "Archiver Module", "xml", true);
!
// AI
! checkAITime_ = getDouble("AI", "Default AI Check Time", 1.2, true);
! stablemasterRefreshTime_ = getNumber( "AI", "Refresh time in sec (Stablemasters)", 60, true );
! stablemasterGoldPerRefresh_ = getDouble( "AI", "Gold cost per refresh cycle (Stablemaster)", 0.2, true );
! animalWildFleeRange_ = getNumber("AI", "Wild animals flee range", 8, true );
// Persistency
--- 101,114 ----
{
// Account Group
! autoAccountCreate_ = getBool("Accounts", "Auto Create", false, true );
! accountsDriver_ = getString( "Accounts", "Database Driver", "sqlite", true );
! accountsHost_ = getString( "Accounts", "Database Host", "", true );
! accountsName_ = getString( "Accounts", "Database Name", "accounts.db", true );
! accountsUsername_ = getString( "Accounts", "Database Username", "", true );
! accountsPassword_ = getString( "Accounts", "Database Password", "", true );
!
// AI
! checkAITime_ = getDouble( "AI", "Default AI Check Time", 1.2, true );
! animalWildFleeRange_ = getNumber( "AI", "Wild animals flee range", 8, true );
// Persistency
***************
*** 131,135 ****
checkItemTime_ = getDouble("Game Speed", "Items Check Time", 1.1, true);
checkNPCTime_ = getDouble("Game Speed", "NPCs Check Time", 1.0, true);
! checkTammedTime_ = getDouble("Game Speed", "Tamed Check Time", 0.5, true);
niceLevel_ = getNumber("Game Speed", "Nice Level", 2, true);
skillDelay_ = getNumber("Game Speed", "SkillDelay", 7, true);
--- 128,132 ----
checkItemTime_ = getDouble("Game Speed", "Items Check Time", 1.1, true);
checkNPCTime_ = getDouble("Game Speed", "NPCs Check Time", 1.0, true);
! checkTamedTime_ = getDouble("Game Speed", "Tamed Check Time", 0.5, true);
niceLevel_ = getNumber("Game Speed", "Nice Level", 2, true);
skillDelay_ = getNumber("Game Speed", "SkillDelay", 7, true);
***************
*** 143,147 ****
snoopdelay_ = getNumber("Game Speed", "Snoop Delay", 7, true);
housedecay_secs_ = getNumber("Game Speed", "House Decay-Sec.", 604800, true);
- default_jail_time_ = getNumber("Game Speed", "Default Jail Time", 86400, true);
spawnRegionCheckTime_ = getNumber("Game Speed", "SpawnRegion Check Time", 300, true);
itemDecayTime_ = getNumber("Game Speed", "Item Decay Time", 300, true);
--- 140,143 ----
***************
*** 149,159 ****
secondsPerUOMinute_ = getNumber("Game Speed", "Seconds Per UO Minute", 5, true);
- beggingTime_ = getNumber("Game Speed", "Begging Time", 120, true);
- checkTammedTime_ = getDouble("Game Speed", "Tamed Check Time", 1.0, true);
npcMoveTime_ = getDouble("Game Speed", "NPC Move Time", 3.0, true );
tamedNpcMoveTime_ = getDouble("Game Speed", "Tamed NPC Move Time", 0.6, true );
// General Group
! showSkillTitles_ = getBool("General", "ShowSkillTitles", true, true );
skillcap_ = getNumber("General", "SkillCap", 700, true);
statcap_ = getNumber("General", "StatsCap", 300, true);
--- 145,153 ----
secondsPerUOMinute_ = getNumber("Game Speed", "Seconds Per UO Minute", 5, true);
npcMoveTime_ = getDouble("Game Speed", "NPC Move Time", 3.0, true );
tamedNpcMoveTime_ = getDouble("Game Speed", "Tamed NPC Move Time", 0.6, true );
// General Group
! showSkillTitles_ = getBool("General", "ShowSkillTitles", true, true );
skillcap_ = getNumber("General", "SkillCap", 700, true);
statcap_ = getNumber("General", "StatsCap", 300, true);
***************
*** 161,185 ****
skillAdvanceModifier_ = getNumber("General", "Skill Advance Modifier", 1000, true);
statsAdvanceModifier_ = getNumber("General", "Stats Advance Modifier", 500, true);
- bgSound_ = getNumber("General", "BackGround Sound Chance", 2, true);
stealing_ = getBool("General", "Stealing Enabled", true, true);
guardsActive_ = getBool("General", "Guards Enabled", true, true);
- partMsg_ = getBool("General", "PartMessage", true, true);
- joinMsg_ = getBool("General", "JoinMessage", true, true);
saveSpawns_ = getBool("General", "Save Spawned Regions", true, true);
- stablingFee_ = getDouble("General", "StablingFee", 0.25, true);
- announceWorldSaves_ = getBool("General", "Announce WorldSaves", true, true);
- goldWeight_ = getDouble("General", "Gold Weight", 0.001000, true);
lootdecayswithcorpse_ = getBool("General", "Loot Decays With Corpse", true, true);
invisTimer_ = getDouble("General", "InvisTimer", 60, true);
bandageInCombat_ = getBool("General", "Bandage In Combat", true, true);
- gateTimer_ = getDouble("General", "GateTimer", 30, true);
- inactivityTimeout_ = getNumber("General", "Inactivity Timeout", 300, true);
- showDeathAnim_ = getNumber("General", "Show Death Animation", 1, true);
poisonTimer_ = getNumber("General", "PoisonTimer", 180, true);
- serverLog_ = getBool("General", "Server Log", false, true);
- speechLog_ = getBool("General", "Speech Log", false, true);
- pvpLog_ = getBool("General", "PvP Log", false, true);
- gmLog_ = getBool("General", "GM Log", false, true);
- backupSaveRatio_ = getNumber("General", "Backup Save Ratio", 1, true);
hungerDamage_ = getNumber("General", "Hunger Damage", 0, true);
persecute_ = getNumber("General", "Persecution", 1, true);
--- 155,165 ----
***************
*** 187,247 ****
houseInTown_ = getNumber("General", "House In Town", 0, true);
shopRestock_ = getNumber("General", "Shop Restock", 1, true);
- badNpcsRed_ = getNumber("General", "Bad Npcs Red", 1, true);
- slotAmount_ = getNumber("General", "Slot Amount", 5, true);
- hungeraffectsskills_ = getBool("General", "Hunger affects Skills", true, true);
- belowminskillfails_ = getBool("General", "Below Min Skill Fails", false, true);
- escortactive_ = getNumber("General", "Escort Active", 1, true);
- escortinitexpire_ = getNumber("General", "Escorting Expire", 86400, true);
- escortactiveexpire_ = getNumber("General", "Escort Active Expire", 1800, true);
- escortdoneexpire_ = getNumber("General", "Escort Done Expire", 1800, true);
- bountysactive_ = getNumber("General", "Bounty Active", 1, true);
- bountysexpire_ = getNumber("General", "Bounty Expire", 0, true);
quittime_ = getNumber("General", "Char Time Out", 300, true);
- errors_to_console_ = getNumber("General", "Errors To Console", 0, true);
- showCVCS_ = getNumber("General", "Show CVCS", 0, true);
cacheMulFiles_ = getBool ("General", "Cache Mul Files", true, true);
- beggingRange_ = getNumber("General", "Begging Range", 3, true);
- clientsAllowed_ = QStringList::split(",", getString("General", "Allowed Clients", "SERVER_DEFAULT", true).upper());
categoryTagAddMenu_ = getBool ("General", "Build AddMenu by Category Tags", true, true);
// We're saving the elapsed seconds since server-start (INGAME SECONDS!)
// fromString( QString::number(FIRST_YEAR) + "-" + getString("General", "Initial Date/Time", "01-18T01:00:00", true), Qt::ISODate);
uoTime.setTime_t( getNumber( "General", "UO Time", 0, true ) );
saveInterval_ = getNumber("General", "Save Interval", 900, true);
- heartBeat_ = getBool("General", "HeartBeat", false, true);
- defaultpriv2_ = getNumber("General", "DefaultPrivileage2", 0, true);
mulPath_ = QDir::convertSeparators( getString("General", "MulPath", "./muls/", true) );
logPath_ = QDir::convertSeparators( getString("General", "LogPath", "./logs/", true ) );
// Network
! loginPort_ = getNumber( "Network", "Loginserver Port", 2593, true );
! gamePort_ = getNumber( "Network", "Gameserver Port", 2592, true );
! enableLogin_ = getBool( "Network", "Enable Loginserver", true, true );
! enableGame_ = getBool( "Network", "Enable Gameserver", true, true );
! allowUnencryptedClients_ = getBool("Network", "Allow Unencrypted Clients", true, true );
// Combat
- combatHitMessage_ = getBool("Combat", "Hit Message", true, true );
- maxAbsorbtion_ = getNumber("Combat", "Max Absorbtion", 20, true );
- maxnohabsorbtion_ = getNumber("Combat", "Max Non Human Absorbtion", 100, true );
- monsters_vs_animals_ = getNumber("Combat", "Monsters vs Animals", 0, true );
- animals_attack_chance_ = getNumber("Combat", "Animals Attack Chance", 15, true );
- animals_guarded_ = getNumber("Combat", "Animals Guarded", 0, true );
- npcdamage_ = getNumber("Combat", "Npc Damage", 2, true );
- npc_base_fleeat_ = getNumber("Combat", "Npc Base Flee At", 20, true );
- npc_base_reattackat_ = getNumber("Combat", "Npc Base Reattack At", 40, true );
attackstamina_ = getNumber("Combat", "Attack Stamina", -2, true );
attack_distance_ = getNumber("Combat", "Attack Distance", 13, true );
- // Vendor
- sellbyname_ = getNumber("Vendor", "Sell By Name", 1, true );
- sellmaxitem_ = getNumber("Vendor", "Sell Max Item", 5, true );
- trade_system_ = getNumber("Vendor", "Trade System", 0, true );
- rank_system_ = getNumber("Vendor", "Rank System", 0, true );
- checkBank_ = getNumber("Vendor", "Check Bank", 2000, true );
- vendorGreet_ = getNumber("Vendor", "Vendor Greet", 1, true );
- showNpcTitles_ = getNumber("Vendor", "Show Npc Titles", 1, true);
-
// Regenerate
hitpointrate_ = getNumber("Regenerate", "Hitpoints Regenerate", 8, true);
--- 167,197 ----
houseInTown_ = getNumber("General", "House In Town", 0, true);
shopRestock_ = getNumber("General", "Shop Restock", 1, true);
quittime_ = getNumber("General", "Char Time Out", 300, true);
cacheMulFiles_ = getBool ("General", "Cache Mul Files", true, true);
categoryTagAddMenu_ = getBool ("General", "Build AddMenu by Category Tags", true, true);
+ showNpcTitles_ = getNumber("General", "Show Npc Titles", 1, true);
// We're saving the elapsed seconds since server-start (INGAME SECONDS!)
// fromString( QString::number(FIRST_YEAR) + "-" + getString("General", "Initial Date/Time", "01-18T01:00:00", true), Qt::ISODate);
+ /*
+ NOTE: This SHOULD be saved in the worldsave instead
+ */
uoTime.setTime_t( getNumber( "General", "UO Time", 0, true ) );
saveInterval_ = getNumber("General", "Save Interval", 900, true);
mulPath_ = QDir::convertSeparators( getString("General", "MulPath", "./muls/", true) );
logPath_ = QDir::convertSeparators( getString("General", "LogPath", "./logs/", true ) );
// Network
! loginPort_ = getNumber( "Network", "Loginserver Port", 2593, true );
! gamePort_ = getNumber( "Network", "Gameserver Port", 2592, true );
! enableLogin_ = getBool( "Network", "Enable Loginserver", true, true );
! enableGame_ = getBool( "Network", "Enable Gameserver", true, true );
! allowUnencryptedClients_ = getBool( "Network", "Allow Unencrypted Clients", true, true );
// Combat
attackstamina_ = getNumber("Combat", "Attack Stamina", -2, true );
attack_distance_ = getNumber("Combat", "Attack Distance", 13, true );
// Regenerate
hitpointrate_ = getNumber("Regenerate", "Hitpoints Regenerate", 8, true);
***************
*** 253,262 ****
resourceitemdecaytime_ = getNumber("Resources", "ResourceItem Decay Time (not empty)", 60*60*12, true);
- // Tracking
- baserange_ = getNumber("Tracking", "Base Tracking Range", 10, true);
- maxtargets_ = getNumber("Tracking", "Max Tracking Targets", 20, true);
- basetimer_ = getNumber("Tracking", "Base Tracking Time", 5, true);
- redisplaytime_ = getNumber("Tracking", "Tracking Message Redisplay Time", 5, true);
-
// Light
worldBrightLevel_ = getNumber("Light", "World Bright Level", 1, true);
--- 203,206 ----
***************
*** 264,273 ****
worldDarkLevel_ = getNumber("Light", "World Dark Level", 18, true);
dungeonLightLevel_ = getNumber("Light", "Dungeon Level", 18, true);
- season_ = getNumber("Light", "Set Season", 0, true);
-
- // Magic
- cutScrollReq_ = getBool( "Magic", "Cut Scroll Requirements", false, true );
- walkDisturbsCast_ = getBool( "Magic", "Walking Disturbs Casting", true, true );
- precasting_ = getBool( "Magic", "Precasting", true, true );
// Path Finding
--- 208,211 ----
***************
*** 391,405 ****
setString("General", "LogPath", data );
flush();
- }
-
- bool cSrvParams::isClientAllowed( const QString& data )
- {
- if ( clientsAllowed_.contains(data))
- return true;
- else if ( clientsAllowed_.contains("ALL"))
- return true;
- else if ( data == wp_version.clientsupportedstring && clientsAllowed_.contains("SERVER_DEFAULT"))
- return true;
- return false;
}
--- 329,332 ----
Index: srvparams.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/srvparams.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** srvparams.h 5 Sep 2003 00:03:45 -0000 1.55
--- srvparams.h 9 Sep 2003 23:09:30 -0000 1.56
***************
*** 65,69 ****
std::vector<ServerList_st> serverList_;
std::vector<StartLocation_st> startLocation_;
- QStringList clientsAllowed_;
// loaded data
--- 65,68 ----
***************
*** 76,98 ****
unsigned int statsAdvanceModifier_;
unsigned short objectDelay_;
[...962 lines suppressed...]
! inline QString cSrvParams::accountsHost() const
{
! return accountsHost_;
}
! inline QString cSrvParams::accountsName() const
{
! return accountsName_;
}
! inline QString cSrvParams::accountsUsername() const
{
! return accountsUsername_;
}
! inline QString cSrvParams::accountsPassword() const
{
! return accountsPassword_;
}
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.223
retrieving revision 1.224
diff -C2 -d -r1.223 -r1.224
*** wolf.dsp 9 Sep 2003 15:17:07 -0000 1.223
--- wolf.dsp 9 Sep 2003 23:09:30 -0000 1.224
***************
*** 53,57 ****
# 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 /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
! # SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "wolf - Win32 Debug"
--- 53,57 ----
# 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 /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
! # SUBTRACT LINK32 /pdb:none /debug
!ELSEIF "$(CFG)" == "wolf - Win32 Debug"
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.461
retrieving revision 1.462
diff -C2 -d -r1.461 -r1.462
*** wolfpack.cpp 9 Sep 2003 15:33:07 -0000 1.461
--- wolfpack.cpp 9 Sep 2003 23:09:31 -0000 1.462
***************
*** 268,274 ****
void SetGlobalVars()
{
! keeprun=1;
! error=0;
! secure=1;
autosaved = 0;
dosavewarning = 0;
--- 268,273 ----
void SetGlobalVars()
{
! keeprun = 1;
! secure = 1;
autosaved = 0;
dosavewarning = 0;
***************
*** 316,332 ****
signal( SIGTERM, &signal_handler ); // Terminate Server
signal( SIGPIPE, SIG_IGN ); // Ignore SIGPIPE
! #endif
!
! #define CIAO_IF_ERROR if (error==1) { cNetwork::instance()->shutdown(); exit( -1 ); }
!
! unsigned long tempSecs;
! unsigned long loopSecs;
! unsigned long tempTime;
! uiCurrentTime = serverstarttime = getNormalizedTime();
serverState = STARTUP;
- // Print a seperator somehow
- /*Console::instance()->send( QString::number( sizeof( cUObject ) ) );
- return 0;*/
Console::instance()->setAttributes( true, false, true, 60, 140, 70, 12, FONT_NOSERIF );
--- 315,321 ----
signal( SIGTERM, &signal_handler ); // Terminate Server
signal( SIGPIPE, SIG_IGN ); // Ignore SIGPIPE
! #endif
serverState = STARTUP;
Console::instance()->setAttributes( true, false, true, 60, 140, 70, 12, FONT_NOSERIF );
***************
*** 458,468 ****
// initial randomization call
srand( uiCurrentTime );
- serverstarttime = getNormalizedTime();
! // Try to open our driver
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 );
}
--- 447,464 ----
// initial randomization call
srand( uiCurrentTime );
! /*
! Check for valid database driers.
! */
if( !persistentBroker->openDriver( SrvParams->databaseDriver() ) )
{
! Console::instance()->log( LOG_ERROR, QString( "Unknown Worldsave Database Driver '%1', check your wolfpack.xml").arg( SrvParams->databaseDriver() ) );
! return 1;
! }
!
! if( !persistentBroker->openDriver( SrvParams->accountsDriver() ) )
! {
! Console::instance()->log( LOG_ERROR, QString( "Unknown Account Database Driver '%1', check your wolfpack.xml").arg( SrvParams->accountsDriver() ) );
! return 1;
}
***************
*** 511,535 ****
Console::instance()->ProgressDone();
- starttime = uiCurrentTime;
- endtime = 0;
- lclock = 0;
-
uiCurrentTime = getNormalizedTime();
- serverstarttime = getNormalizedTime(); // dont remove, its absolutly necassairy that its 3 times in the startup sequence for several timing reasons.
-
- CIAO_IF_ERROR;
-
- // 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() )
--- 507,515 ----
***************
*** 570,591 ****
Console::instance()->poll();
- if( loopTimeCount >= 1000 )
- {
- loopTimeCount = 0;
- loopTime = 0;
- }
-
- ++loopTimeCount;
-
- loopSecs = getNormalizedTime(); // Starting time
-
- if( networkTimeCount >= 1000 )
- {
- networkTimeCount = 0;
- networkTime = 0;
- }
-
- tempSecs = getNormalizedTime();
-
// Process any Network Events
cNetwork::instance()->poll();
--- 550,553 ----
***************
*** 604,644 ****
}
- tempTime = getNormalizedTime() - tempSecs ;
- networkTime += tempTime;
- ++networkTimeCount;
-
- if( timerTimeCount >= 1000 )
- {
- timerTimeCount = 0;
- timerTime = 0;
- }
-
- tempSecs = getNormalizedTime() ;
-
- checktimers();
-
- uiCurrentTime = getNormalizedTime();
- tempTime = getNormalizedTime() - tempSecs;
- timerTime += tempTime;
- ++timerTimeCount;
-
- if( autoTimeCount >= 1000 )
- {
- autoTimeCount = 0;
- autoTime = 0;
- }
-
- tempSecs = getNormalizedTime() ;
-
checkauto();
-
- tempTime = getNormalizedTime() - tempSecs;
- autoTime += tempTime;
- ++autoTimeCount;
-
- tempTime = getNormalizedTime() - loopSecs;
-
- loopTime += tempTime;
-
qApp->processEvents( 40 );
}
--- 566,570 ----
***************
*** 775,791 ****
{
pp->makeCriminal();
- }
- }
- else if (pc->objectType() == enNPC) // && ((pc->npcaitype() == 2) || // bad npc
- //(pc->npcaitype() == 3) || // bad healer
- //(pc->npcaitype() == 50))) // EV & BS
- {
- if (SrvParams->badNpcsRed() == 0)
- {
- pc->setCriminalTime( uiCurrentTime + SrvParams->crimtime() * MY_CLOCKS_PER_SEC );
- }
- else
- {
- pc->setMurdererTime( uiCurrentTime + SrvParams->murderdecay() * MY_CLOCKS_PER_SEC );
}
}
--- 701,704 ----
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** world.cpp 8 Sep 2003 10:58:47 -0000 1.38
--- world.cpp 9 Sep 2003 23:09:31 -0000 1.39
***************
*** 183,186 ****
--- 183,192 ----
Console::instance()->send( "Loading World...\n" );
+ if( !persistentBroker->openDriver( SrvParams...
[truncated message content] |
|
From: <dar...@us...> - 2003-09-09 23:10:02
|
Update of /cvsroot/wpdev/wolfpack/network
In directory sc8-pr-cvs1:/tmp/cvs-serv9847/network
Modified Files:
uosocket.cpp uosocket.h
Log Message:
Implemented saving of Accounts to the Database and cleaned up a lot of srvparams.h and globals.h
Index: uosocket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v
retrieving revision 1.283
retrieving revision 1.284
diff -C2 -d -r1.283 -r1.284
*** uosocket.cpp 8 Sep 2003 10:58:47 -0000 1.283
--- uosocket.cpp 9 Sep 2003 23:09:31 -0000 1.284
***************
*** 362,375 ****
{
_player->onLogout();
-
- cUOSocket* mSocket = 0;
- QPtrListIterator<cUOSocket> it( cNetwork::instance()->getIterator() );
- while ( ( mSocket = it.current() ) )
- {
- ++it;
- if ( mSocket == this || !SrvParams->joinMsg() || !mSocket->player() || !mSocket->player()->isGMorCounselor() )
- continue;
- mSocket->sysMessage( tr("%1 left the world!").arg( _player->name() ), 0x25 );
- }
_player->setSocket( NULL );
_player->account()->setInUse( false );
--- 362,365 ----
***************
*** 602,609 ****
pChar->sendTooltip( this );
-
- for( cUOSocket *mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next() )
- if( mSock != this && SrvParams->joinMsg() && mSock->player() && mSock->player()->isGMorCounselor() )
- mSock->sysMessage( tr("%1 entered the world!").arg( pChar->name() ), 0x48 );
}
--- 592,595 ----
***************
*** 617,621 ****
{
cAccounts::enErrorCode error = cAccounts::NoError;
! AccountRecord* authRet = Accounts::instance()->authenticate( username, password, &error );
// Reject login
--- 603,607 ----
{
cAccounts::enErrorCode error = cAccounts::NoError;
! cAccount* authRet = Accounts::instance()->authenticate( username, password, &error );
// Reject login
Index: uosocket.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.h,v
retrieving revision 1.94
retrieving revision 1.95
diff -C2 -d -r1.94 -r1.95
*** uosocket.h 8 Sep 2003 10:58:47 -0000 1.94
--- uosocket.h 9 Sep 2003 23:09:31 -0000 1.95
***************
*** 42,46 ****
// Forward Declarations
class cUOPacket;
! class AccountRecord;
class cTargetRequest;
class cGump;
--- 42,46 ----
// Forward Declarations
class cUOPacket;
! class cAccount;
class cTargetRequest;
class cGump;
***************
*** 72,76 ****
QSocketDevice *_socket;
UINT32 _rxBytes, _txBytes, _uniqueId;
! AccountRecord* _account;
P_PLAYER _player;
eSocketState _state;
--- 72,76 ----
QSocketDevice *_socket;
UINT32 _rxBytes, _txBytes, _uniqueId;
! cAccount* _account;
P_PLAYER _player;
eSocketState _state;
***************
*** 115,120 ****
P_PLAYER player( void ) const;
P_ITEM dragging() const;
! AccountRecord* account( void ) const { return _account; }
! void setAccount( AccountRecord* data ) { _account = data; }
--- 115,120 ----
P_PLAYER player( void ) const;
P_ITEM dragging() const;
! cAccount* account( void ) const { return _account; }
! void setAccount( cAccount* data ) { _account = data; }
|
|
From: <dar...@us...> - 2003-09-09 23:10:02
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv9847/python
Modified Files:
global.cpp pyaccount.cpp utilities.h
Log Message:
Implemented saving of Accounts to the Database and cleaned up a lot of srvparams.h and globals.h
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.88
retrieving revision 1.89
diff -C2 -d -r1.88 -r1.89
*** global.cpp 8 Sep 2003 10:58:48 -0000 1.88
--- global.cpp 9 Sep 2003 23:09:31 -0000 1.89
***************
*** 1269,1273 ****
}
! AccountRecord* account = Accounts::instance()->getRecord( getArgStr( 0 ) );
return PyGetAccountObject( account );
}
--- 1269,1273 ----
}
! cAccount* account = Accounts::instance()->getRecord( getArgStr( 0 ) );
return PyGetAccountObject( account );
}
***************
*** 1368,1372 ****
return PyFalse;
! AccountRecord *account = Accounts::instance()->getRecord( login );
if( account )
--- 1368,1372 ----
return PyFalse;
! cAccount *account = Accounts::instance()->getRecord( login );
if( account )
Index: pyaccount.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyaccount.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** pyaccount.cpp 10 Aug 2003 04:26:42 -0000 1.17
--- pyaccount.cpp 9 Sep 2003 23:09:31 -0000 1.18
***************
*** 40,48 ****
/*!
! The object for Wolfpack AccountRecord items
*/
typedef struct {
PyObject_HEAD;
! AccountRecord *account;
} wpAccount;
--- 40,48 ----
/*!
! The object for Wolfpack cAccount items
*/
typedef struct {
PyObject_HEAD;
! cAccount *account;
} wpAccount;
***************
*** 254,258 ****
}
! PyObject* PyGetAccountObject( AccountRecord *account )
{
if( !account )
--- 254,258 ----
}
! PyObject* PyGetAccountObject( cAccount *account )
{
if( !account )
***************
*** 267,271 ****
}
! AccountRecord* getWpAccount( PyObject *wpaccount )
{
if( !wpaccount )
--- 267,271 ----
}
! cAccount* getWpAccount( PyObject *wpaccount )
{
if( !wpaccount )
Index: utilities.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/utilities.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** utilities.h 26 Aug 2003 03:55:13 -0000 1.20
--- utilities.h 9 Sep 2003 23:09:31 -0000 1.21
***************
*** 41,45 ****
class cBaseChar;
class Coord_cl;
! class AccountRecord;
class cTerritory;
class cUOTxTooltipList;
--- 41,45 ----
class cBaseChar;
class Coord_cl;
! class cAccount;
class cTerritory;
class cUOTxTooltipList;
***************
*** 99,104 ****
bool checkWpAccount( PyObject *object );
! PyObject* PyGetAccountObject( AccountRecord* );
! AccountRecord* getWpAccount( PyObject* );
bool checkWpRegion( PyObject *object );
--- 99,104 ----
bool checkWpAccount( PyObject *object );
! PyObject* PyGetAccountObject( cAccount* );
! cAccount* getWpAccount( PyObject* );
bool checkWpRegion( PyObject *object );
|
|
From: <thi...@us...> - 2003-09-09 22:18:02
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv32485
Modified Files:
console_unix.cpp
Log Message:
Fix console command handling
Index: console_unix.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_unix.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** console_unix.cpp 9 Sep 2003 22:04:48 -0000 1.2
--- console_unix.cpp 9 Sep 2003 22:17:59 -0000 1.3
***************
*** 49,54 ****
while( serverState < SHUTDOWN )
{
! char c = cin.peek();
!
if( c > 0 && serverState == RUNNING )
{
--- 49,53 ----
while( serverState < SHUTDOWN )
{
! char c = cin.get();
if( c > 0 && serverState == RUNNING )
{
|
|
From: <thi...@us...> - 2003-09-09 22:04:52
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv29053 Modified Files: console_unix.cpp wolfpack.pro Log Message: Linux compile fixes Index: console_unix.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/console_unix.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** console_unix.cpp 9 Sep 2003 20:56:53 -0000 1.1 --- console_unix.cpp 9 Sep 2003 22:04:48 -0000 1.2 *************** *** 29,34 **** --- 29,42 ---- // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== + // Qt Includes + #include <qthread.h> + // Wolfpack includes #include "console.h" + #include "globals.h" + + #include <iostream> + + using namespace std; class cConsoleThread : public QThread *************** *** 41,45 **** while( serverState < SHUTDOWN ) { ! char c = getch(); if( c > 0 && serverState == RUNNING ) --- 49,53 ---- while( serverState < SHUTDOWN ) { ! char c = cin.peek(); if( c > 0 && serverState == RUNNING ) *************** *** 49,53 **** else { ! Sleep( 100 ); } } --- 57,61 ---- else { ! msleep( 100 ); } } *************** *** 179,183 **** } ! void cConsole::setAttributes( bool bold, bool italic, unsigned char r, unsigned char g, unsigned char b, unsigned char size ) { } --- 187,192 ---- } ! void cConsole::setAttributes( bool bold, bool italic, bool, unsigned char r, unsigned char g, unsigned char b, unsigned char, eFontType ) { } + Index: wolfpack.pro =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** wolfpack.pro 9 Sep 2003 20:56:54 -0000 1.156 --- wolfpack.pro 9 Sep 2003 22:04:48 -0000 1.157 *************** *** 13,27 **** unix { ! # Common unix settings ! INCLUDEPATH += /usr/local/include/stlport lib/Python sqlite /usr/include/mysql /usr/local/lib/mysql/include/mysql lib/Python/Include network LIBS += -L/usr/local/lib/mysql/lib/mysql -L/usr/local/lib -Llib/Python -L/usr/lib/mysql -ldl -lpython2.2 -lmysqlclient -lutil # Optional compile modes ! release:debug:error(You can't have release and debug at the same time!) release { CONFIG += warn_off linux { ! QMAKE_CXXFLAGS -= -O2 QMAKE_CXXFLAGS += -march=athlon-xp -O3 -pipe -fomit-frame-pointer -falign-functions=16 -falign-labels=8 -falign-loops=8 -falign-jumps=8 -fsched-spec-load -frerun-loop-opt -finline-limit=800 -funroll-loops -fprefetch-loop-arrays -ffast-math -mfpmath=sse -msse -m3dnow -fschedule-insns2 -fexpensive-optimizations -fmove-all-movables -fdelete-null-pointer-checks --- 13,42 ---- unix { ! # Common unix settings ! # Lets try to figure some paths ! ! # MySQL includes first ! exists(/usr/include/mysql/mysql.h) { ! message("MySQL files found, support enabled") ! INCLUDEPATH += /usr/include/mysql ! DEFINES += MYSQL_DRIVER ! } exists(/usr/local/lib/mysql/include/mysql/mysql.h) { ! message("MySQL files found, support enabled") ! INCLUDEPATH += /usr/local/lib/mysql/include/mysql ! DEFINES += MYSQL_DRIVER ! } ! ! INCLUDEPATH += /usr/local/include/stlport lib/Python sqlite lib/Python/Include network LIBS += -L/usr/local/lib/mysql/lib/mysql -L/usr/local/lib -Llib/Python -L/usr/lib/mysql -ldl -lpython2.2 -lmysqlclient -lutil + # we dont use those. + QMAKE_LIBS_X11 -= -lX11 -lXext -lm # Optional compile modes ! release:debug:error(You cant have release and debug at the same time!) release { CONFIG += warn_off linux { ! QMAKE_CFLAGS_RELEASE = -O3 QMAKE_CXXFLAGS += -march=athlon-xp -O3 -pipe -fomit-frame-pointer -falign-functions=16 -falign-labels=8 -falign-loops=8 -falign-jumps=8 -fsched-spec-load -frerun-loop-opt -finline-limit=800 -funroll-loops -fprefetch-loop-arrays -ffast-math -mfpmath=sse -msse -m3dnow -fschedule-insns2 -fexpensive-optimizations -fmove-all-movables -fdelete-null-pointer-checks *************** *** 51,56 **** win32-borland:LIBS += ws2_32.lib - DEFINES += MYSQL_DRIVER - # Common files --- 66,69 ---- *************** *** 135,138 **** --- 148,152 ---- combat.cpp \ commands.cpp \ + console.cpp \ contextmenu.cpp \ coord.cpp \ |
|
From: <thi...@us...> - 2003-09-09 20:57:03
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv13059 Modified Files: basechar.h wolfpack.pro Added Files: console_unix.cpp Removed Files: console_linux.cpp Log Message: Renamed --- NEW FILE: console_unix.cpp --- //================================================================================== // // Wolfpack Emu (WP) // UO Server Emulation Program // // Copyright 1997, 98 by Marcus Rating (Cironian) // Copyright 2001-2003 by holders identified in authors.txt // 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 2 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, write to the Free Software // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. // // * In addition to that license, if you are running this program or modified // * versions of it on a public system you HAVE TO make the complete source of // * the version used by you available or provide people with a location to // * download it. // // // // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== #include "console.h" class cConsoleThread : public QThread { protected: virtual void run() { try { while( serverState < SHUTDOWN ) { char c = getch(); if( c > 0 && serverState == RUNNING ) { Console::instance()->handleCommand( QChar( c ) ); } else { Sleep( 100 ); } } } // If there is any error: Quit. // It's better to have no console input // than a deadlocking server. catch( ... ) { } } }; cConsoleThread *thread = 0; void cConsole::start() { thread = new cConsoleThread; thread->start(); } void cConsole::poll() { // Normally we would check if there is a command in the command queue and execute it } void cConsole::stop() { thread->wait(); delete thread; } void cConsole::setConsoleTitle( const QString& data ) { #if defined(Q_OS_WIN32) SetConsoleTitle( data.latin1() ); #endif } //========================================================================================= // Change the console Color void cConsole::ChangeColor( WPC_ColorKeys Color ) { #if defined(Q_OS_UNIX) QString cb = "\e[0m"; switch( Color ) { case WPC_GREEN: cb = "\e[1;32m"; break; case WPC_RED: cb = "\e[1;31m"; break; case WPC_YELLOW:cb = "\e[1;33m"; break; case WPC_NORMAL:cb = "\e[0m"; break; case WPC_WHITE: cb = "\e[1;37m"; break; default: cb = "\e[0m"; } send( cb ); #elif defined(Q_OS_WIN32) HANDLE ConsoleHandle = GetStdHandle( STD_OUTPUT_HANDLE ); UI16 ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE; switch( Color ) { case WPC_GREEN: ColorKey = FOREGROUND_GREEN | FOREGROUND_INTENSITY; break; case WPC_RED: ColorKey = FOREGROUND_RED | FOREGROUND_INTENSITY; break; case WPC_YELLOW: ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY; break; case WPC_NORMAL: ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE; break; case WPC_WHITE: ColorKey = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY; break; default: break; } SetConsoleTextAttribute( ConsoleHandle, ColorKey ); #endif } //======================================================================================== // Send a message to the console void cConsole::send(const QString &sMessage) { if( outputstrm != NULL ) { (*outputstrm) << sMessage.latin1(); flush( *outputstrm ); } if( sMessage.contains( "\n" ) ) { #if defined(Q_OS_UNIX) && 0 sMessage.replace("\e[0m", ""); sMessage.replace("\e[1;32m", ""); sMessage.replace("\e[1;31m", ""); sMessage.replace("\e[1;33m", ""); sMessage.replace("\e[1;37m", ""); #endif incompleteLine_.append( sMessage ); // Split by \n QStringList lines = QStringList::split( "\n", incompleteLine_, true ); // Insert all except the last element for( int i = 0; i < lines.count()-1; ++i ) linebuffer_.push_back( lines[i] ); incompleteLine_ = lines[ lines.count() - 1 ]; } else { incompleteLine_.append( sMessage ); } } void cConsole::setAttributes( bool bold, bool italic, unsigned char r, unsigned char g, unsigned char b, unsigned char size ) { } Index: basechar.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** basechar.h 8 Sep 2003 10:58:46 -0000 1.31 --- basechar.h 9 Sep 2003 20:56:53 -0000 1.32 *************** *** 45,48 **** --- 45,49 ---- #include "TmpEff.h" #include "territories.h" + #include "log.h" class cUOTxTooltipList; Index: wolfpack.pro =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v retrieving revision 1.155 retrieving revision 1.156 diff -C2 -d -r1.155 -r1.156 *** wolfpack.pro 9 Sep 2003 03:24:16 -0000 1.155 --- wolfpack.pro 9 Sep 2003 20:56:54 -0000 1.156 *************** *** 23,27 **** CONFIG += warn_off linux { ! QMAKE_CXXFLAGS -= -O3 QMAKE_CXXFLAGS += -march=athlon-xp -O3 -pipe -fomit-frame-pointer -falign-functions=16 -falign-labels=8 -falign-loops=8 -falign-jumps=8 -fsched-spec-load -frerun-loop-opt -finline-limit=800 -funroll-loops -fprefetch-loop-arrays -ffast-math -mfpmath=sse -msse -m3dnow -fschedule-insns2 -fexpensive-optimizations -fmove-all-movables -fdelete-null-pointer-checks --- 23,27 ---- CONFIG += warn_off linux { ! QMAKE_CXXFLAGS -= -O2 QMAKE_CXXFLAGS += -march=athlon-xp -O3 -pipe -fomit-frame-pointer -falign-functions=16 -falign-labels=8 -falign-loops=8 -falign-jumps=8 -fsched-spec-load -frerun-loop-opt -finline-limit=800 -funroll-loops -fprefetch-loop-arrays -ffast-math -mfpmath=sse -msse -m3dnow -fschedule-insns2 -fexpensive-optimizations -fmove-all-movables -fdelete-null-pointer-checks *************** *** 172,176 **** spawnregions.cpp \ srvparams.cpp \ - storage.cpp \ targetactions.cpp \ targetrequests.cpp \ --- 172,175 ---- --- console_linux.cpp DELETED --- |
|
From: <dar...@us...> - 2003-09-09 17:22:59
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv1125
Modified Files:
ai.h npc.cpp
Log Message:
Added a notority override.
Index: ai.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** ai.h 9 Jul 2003 20:23:16 -0000 1.16
--- ai.h 9 Sep 2003 17:22:55 -0000 1.17
***************
*** 91,98 ****
{
protected:
! AbstractAI() : m_npc( NULL ), m_currentAction( NULL ) { m_actions.setAutoDelete( true ); }
public:
! AbstractAI( P_NPC npc ) : m_npc( npc ), m_currentAction( NULL ) { m_actions.setAutoDelete( true ); }
virtual ~AbstractAI() {} // virtual destructor.
--- 91,98 ----
{
protected:
! AbstractAI() : m_npc( NULL ), m_currentAction( NULL ), notorityOverride_( 0 ) { m_actions.setAutoDelete( true ); }
public:
! AbstractAI( P_NPC npc ) : m_npc( npc ), m_currentAction( NULL ), notorityOverride_( 0 ) { m_actions.setAutoDelete( true ); }
virtual ~AbstractAI() {} // virtual destructor.
***************
*** 108,111 ****
--- 108,114 ----
void setNPC( P_NPC npc ) { m_npc = npc; }
+ unsigned char notorityOverride() const { return notorityOverride_; }
+ void setNotorityOverride( unsigned char value ) { notorityOverride_ = value; }
+
// This is for creating AI interfaces through the AIFactory
virtual void init( P_NPC npc )
***************
*** 123,126 ****
--- 126,130 ----
AbstractAction* m_currentAction;
QPtrList< AbstractAction > m_actions;
+ unsigned char notorityOverride_;
};
***************
*** 219,226 ****
{
protected:
! Monster_Aggressive() : AbstractAI(), m_currentVictim( NULL ) {}
public:
! Monster_Aggressive( P_NPC npc ) : AbstractAI( npc ), m_currentVictim( NULL ) {}
virtual void check();
--- 223,236 ----
{
protected:
! Monster_Aggressive() : AbstractAI(), m_currentVictim( NULL )
! {
! notorityOverride_ = 6;
! }
public:
! Monster_Aggressive( P_NPC npc ) : AbstractAI( npc ), m_currentVictim( NULL )
! {
! notorityOverride_ = 6;
! }
virtual void check();
***************
*** 256,260 ****
{
protected:
! Monster_Aggressive_L1() : Monster_Aggressive() {}
public:
--- 266,270 ----
{
protected:
! Monster_Aggressive_L1() : Monster_Aggressive(){}
public:
***************
*** 277,285 ****
{
protected:
! Human_Vendor() : AbstractAI() {}
public:
! Human_Vendor( P_NPC npc ) : AbstractAI( npc )
{
m_actions.append( new Action_Wander( npc, this ) );
m_actions.append( new Action_FleeAttacker( npc, this ) );
--- 287,299 ----
{
protected:
! Human_Vendor() : AbstractAI()
! {
! notorityOverride_ = 1;
! }
public:
! Human_Vendor( P_NPC npc ) : AbstractAI( npc )
{
+ notorityOverride_ = 1;
m_actions.append( new Action_Wander( npc, this ) );
m_actions.append( new Action_FleeAttacker( npc, this ) );
***************
*** 297,301 ****
{
protected:
! Human_Stablemaster() : AbstractAI() {}
public:
--- 311,318 ----
{
protected:
! Human_Stablemaster() : AbstractAI()
! {
! notorityOverride_ = 1;
! }
public:
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** npc.cpp 8 Sep 2003 10:58:47 -0000 1.41
--- npc.cpp 9 Sep 2003 17:22:55 -0000 1.42
***************
*** 369,372 ****
--- 369,375 ----
// return 0x06; // 6 = Red -> Monster
+ if( ai_ && ai_->notorityOverride() )
+ return ai_->notorityOverride();
+
if( pChar->kills() > SrvParams->maxkills() )
result = 0x06; // 6 = Red -> Murderer
|
|
From: <dar...@us...> - 2003-09-09 15:33:12
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv3791
Modified Files:
console_win.cpp wolfpack.cpp
Log Message:
Trying out new console code.
Index: console_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_win.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** console_win.cpp 9 Sep 2003 15:17:07 -0000 1.5
--- console_win.cpp 9 Sep 2003 15:33:07 -0000 1.6
***************
*** 106,109 ****
--- 106,110 ----
ZeroMemory( &lfont, sizeof( LOGFONT ) );
qstrcpy( lfont.lfFaceName, "Fixedsys" );
+ lfont.lfQuality = ANTIALIASED_QUALITY;
font = CreateFontIndirect( &lfont );
if ( !font )
***************
*** 277,281 ****
returnValue_ = main( argc, argv.data() );
! PostQuitMessage( returnValue_ );
}
};
--- 278,282 ----
returnValue_ = main( argc, argv.data() );
! PostMessage( mainWindow, WM_QUIT, 0, 0 );
}
};
***************
*** 372,377 ****
// Check for the caret
! CHARRANGE range;
! SendMessage( logWindow, EM_EXGETSEL, 0, (LPARAM)&range );
// Delete lines from the beginning if we exceed the maximum limit.
--- 373,377 ----
// Check for the caret
! SendMessage( logWindow, EM_SETSEL, ctrlLength, ctrlLength );
// Delete lines from the beginning if we exceed the maximum limit.
***************
*** 498,502 ****
{
cf.dwMask |= CFM_SIZE;
! cf.yHeight = size;
}
--- 498,502 ----
{
cf.dwMask |= CFM_SIZE;
! cf.yHeight = size * 20;
}
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.460
retrieving revision 1.461
diff -C2 -d -r1.460 -r1.461
*** wolfpack.cpp 9 Sep 2003 15:17:07 -0000 1.460
--- wolfpack.cpp 9 Sep 2003 15:33:07 -0000 1.461
***************
*** 330,335 ****
return 0;*/
! Console::instance()->setAttributes( true, false, false, 0, 0, 255, 0, FONT_FIXEDWIDTH );
! 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");
--- 330,335 ----
return 0;*/
! Console::instance()->setAttributes( true, false, true, 60, 140, 70, 12, FONT_NOSERIF );
! 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");
|
|
From: <dar...@us...> - 2003-09-09 15:17:12
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv31009
Modified Files:
console.h console_linux.cpp console_win.cpp wolf.dsp
wolfpack.cpp
Log Message:
Trying out new console code.
Index: console.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** console.h 8 Sep 2003 23:38:49 -0000 1.2
--- console.h 9 Sep 2003 15:17:07 -0000 1.3
***************
*** 62,65 ****
--- 62,72 ----
};
+ enum eFontType
+ {
+ FONT_SERIF = 0,
+ FONT_NOSERIF,
+ FONT_FIXEDWIDTH
+ };
+
class cConsole
{
***************
*** 100,103 ****
--- 107,112 ----
virtual void poll();
virtual void stop();
+
+ void setAttributes( bool bold, bool italic, bool underlined, unsigned char r, unsigned char g, unsigned char b, unsigned char size, eFontType font );
private:
Index: console_linux.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_linux.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** console_linux.cpp 9 Sep 2003 03:24:15 -0000 1.2
--- console_linux.cpp 9 Sep 2003 15:17:07 -0000 1.3
***************
*** 178,179 ****
--- 178,183 ----
}
}
+
+ void cConsole::setAttributes( bool bold, bool italic, unsigned char r, unsigned char g, unsigned char b, unsigned char size )
+ {
+ }
Index: console_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_win.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** console_win.cpp 9 Sep 2003 11:17:56 -0000 1.4
--- console_win.cpp 9 Sep 2003 15:17:07 -0000 1.5
***************
*** 162,169 ****
return 1;
- case WM_SETFOCUS:
- SendMessage( inputWindow, WM_SETFOCUS, 0, 0 );
- return 1;
-
case WM_NOTIFY:
if( wparam == CONTROL_LOGWINDOW )
--- 162,165 ----
***************
*** 206,209 ****
--- 202,206 ----
case WM_DESTROY:
keeprun = 0;
+ PostQuitMessage( 0 );
return 0;
***************
*** 329,336 ****
MSG msg;
! while( GetMessage( &msg, mainWindow, 0, 0 ) > 0 )
{
! if( msg.message == WM_CHAR && msg.hwnd == inputWindow && msg.lParam == '\r' )
continue;
TranslateMessage( &msg );
--- 326,345 ----
MSG msg;
! while( GetMessage( &msg, 0, 0, 0 ) > 0 )
{
! if( msg.message == WM_CHAR && msg.hwnd == inputWindow && msg.wParam == '\r' )
! {
! if( serverState == RUNNING )
! {
! char command[512] = { 0, };
! GetWindowText( inputWindow, command, 512 );
! SetWindowText( inputWindow, "" );
!
! // Process Command
! Console::instance()->handleCommand( command );
! }
!
continue;
+ }
TranslateMessage( &msg );
***************
*** 341,345 ****
guiThread.wait();
- FreeLibrary( hRiched );
return guiThread.returnValue();
--- 350,353 ----
***************
*** 385,388 ****
--- 393,399 ----
}
+ // Place the Caret at the End of the Text
+
+
// process \b properly
if ( sMessage.contains("\b") )
***************
*** 404,410 ****
}
! range.cpMin = GetWindowTextLength( logWindow );
! range.cpMax = GetWindowTextLength( logWindow );
! SendMessage( logWindow, EM_EXSETSEL, 0, (LPARAM)&range );
// Now it will get right, even if the user had selected sth.
--- 415,420 ----
}
! unsigned int tLength = GetWindowTextLength( logWindow );
! SendMessage( logWindow, EM_SETSEL, tLength, tLength );
// Now it will get right, even if the user had selected sth.
***************
*** 413,419 ****
// And ofcourse if not some control is currently capturing the input
if( !GetCapture() )
! {
! SendMessage( logWindow, EM_LINESCROLL, 0, SendMessage( logWindow, EM_LINEFROMCHAR, ( ctrlLength + textLength ) - 1, 0 ) );
! }
}
--- 423,427 ----
// And ofcourse if not some control is currently capturing the input
if( !GetCapture() )
! SendMessage( logWindow, WM_VSCROLL, SB_BOTTOM, 0 );
}
***************
*** 455,457 ****
--- 463,521 ----
{
SetWindowText( mainWindow, data.latin1() );
+ }
+
+ // Extended Attributes
+ void cConsole::setAttributes( bool bold, bool italic, bool underlined, unsigned char r, unsigned char g, unsigned char b, unsigned char size, eFontType font )
+ {
+ CHARFORMAT cf;
+ ZeroMemory( &cf, sizeof( CHARFORMAT ) );
+ cf.cbSize = sizeof( CHARFORMAT );
+
+ SendMessage( logWindow, EM_GETCHARFORMAT, SCF_SELECTION, (WPARAM)&cf );
+
+ if( bold )
+ {
+ cf.dwMask |= CFM_BOLD;
+ cf.dwEffects |= CFE_BOLD;
+ }
+
+ if( italic )
+ {
+ cf.dwMask |= CFM_ITALIC;
+ cf.dwEffects |= CFE_ITALIC;
+ }
+
+ if( underlined )
+ {
+ cf.dwMask |= CFM_UNDERLINE;
+ cf.dwEffects |= CFE_UNDERLINE;
+ }
+
+ cf.dwMask |= CFM_COLOR;
+ cf.crTextColor = RGB( r, g, b );
+
+ if( size )
+ {
+ cf.dwMask |= CFM_SIZE;
+ cf.yHeight = size;
+ }
+
+ cf.dwMask |= CFM_FACE;
+
+ switch( font )
+ {
+ case FONT_SERIF:
+ strcpy( cf.szFaceName, "Courier" );
+ break;
+
+ case FONT_NOSERIF:
+ strcpy( cf.szFaceName, "Arial" );
+ break;
+
+ case FONT_FIXEDWIDTH:
+ strcpy( cf.szFaceName, "Fixedsys" );
+ break;
+ }
+
+ SendMessage( logWindow, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf );
}
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.222
retrieving revision 1.223
diff -C2 -d -r1.222 -r1.223
*** wolf.dsp 9 Sep 2003 03:24:16 -0000 1.222
--- wolf.dsp 9 Sep 2003 15:17:07 -0000 1.223
***************
*** 1,23 ****
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE This is not a valid makefile. To build this project using NMAKE,
! !MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE You can specify a configuration when running NMAKE
! !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Possible choices for configuration are:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (based on "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
--- 1,23 ----
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
! !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
! !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Für die Konfiguration stehen zur Auswahl:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (basierend auf "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
!MESSAGE
***************
*** 26,30 ****
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=xicl6.exe
RSC=rc.exe
--- 26,30 ----
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=cl.exe
RSC=rc.exe
***************
*** 50,54 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.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 /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
--- 50,54 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! 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 /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
***************
*** 64,68 ****
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
! # PROP Output_Dir "c:\wolfpack"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
--- 64,68 ----
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
! # PROP Output_Dir "D:\wolfpack\"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
***************
*** 75,81 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.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 gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib /nologo /version:12.9 /subsystem:windows /map /debug /machine:I386 /out:"c:\Wolfpack\wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
--- 75,81 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! 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 gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib /nologo /version:12.9 /subsystem:windows /map /debug /machine:I386 /out:"..\wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.459
retrieving revision 1.460
diff -C2 -d -r1.459 -r1.460
*** wolfpack.cpp 8 Sep 2003 23:38:49 -0000 1.459
--- wolfpack.cpp 9 Sep 2003 15:17:07 -0000 1.460
***************
*** 330,333 ****
--- 330,334 ----
return 0;*/
+ Console::instance()->setAttributes( true, false, false, 0, 0, 255, 0, FONT_FIXEDWIDTH );
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() ) );
|
|
From: <dar...@us...> - 2003-09-09 11:18:00
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv17395
Modified Files:
console_win.cpp
Log Message:
Trying out new console code.
Index: console_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_win.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** console_win.cpp 9 Sep 2003 03:24:15 -0000 1.3
--- console_win.cpp 9 Sep 2003 11:17:56 -0000 1.4
***************
*** 54,57 ****
--- 54,58 ----
// Variables important for this GUI implementation
#define CONTROL_LOGWINDOW 0x10
+ #define CONTROL_INPUT 0x11
HWND logWindow = 0; // Log Window
***************
*** 61,64 ****
--- 62,66 ----
HFONT font = 0; // The font we'll use
unsigned int inputHeight = 0; // For measuring the height of the input field
+ unsigned int logLimit = 0; // How many characters fit into the log window
/*
***************
*** 82,87 ****
LRESULT CALLBACK wpWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
! CHARFORMAT cf;
LOGFONT lfont;
switch( msg )
--- 84,90 ----
LRESULT CALLBACK wpWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
! CHARFORMAT cf;
LOGFONT lfont;
+ NMHDR *notify = (NMHDR*)lparam;
switch( msg )
***************
*** 98,101 ****
--- 101,106 ----
}
+ logLimit = SendMessage( logWindow, EM_GETLIMITTEXT, 0, 0 );
+
// Set up the fonts we need
ZeroMemory( &lfont, sizeof( LOGFONT ) );
***************
*** 124,128 ****
// Create InputWindow
! inputWindow = CreateWindow( "EDIT", 0, ES_LEFT|ES_AUTOHSCROLL|ES_AUTOVSCROLL|ES_NOHIDESEL|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP, 0, 0, 10, 10, hwnd, 0, appInstance, 0 );
return 0;
--- 129,133 ----
// Create InputWindow
! inputWindow = CreateWindow( "EDIT", 0, ES_LEFT|ES_AUTOHSCROLL|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP, 0, 0, 10, 10, hwnd, (HMENU)CONTROL_INPUT, appInstance, 0 );
return 0;
***************
*** 163,169 ****
case WM_NOTIFY:
if( wparam == CONTROL_LOGWINDOW )
! {
! NMHDR *notify = (NMHDR*)lparam;
!
if( notify->code == EN_LINK )
{
--- 168,172 ----
case WM_NOTIFY:
if( wparam == CONTROL_LOGWINDOW )
! {
if( notify->code == EN_LINK )
{
***************
*** 187,191 ****
--- 190,206 ----
}
}
+ else if( notify->code == EN_MSGFILTER )
+ {
+ MSGFILTER *msg = (MSGFILTER*)notify;
+
+ // Append to the Input Control
+ if( msg->msg == WM_CHAR )
+ {
+ SendMessage( inputWindow, WM_SETFOCUS, 0, 0 );
+ SendMessage( inputWindow, WM_CHAR, msg->wParam, msg->lParam );
+ }
+ }
}
+ return 0;
case WM_DESTROY:
***************
*** 316,319 ****
--- 331,337 ----
while( GetMessage( &msg, mainWindow, 0, 0 ) > 0 )
{
+ if( msg.message == WM_CHAR && msg.hwnd == inputWindow && msg.lParam == '\r' )
+ continue;
+
TranslateMessage( &msg );
DispatchMessage( &msg );
***************
*** 342,345 ****
--- 360,388 ----
void cConsole::send(const QString &sMessage)
{
+ unsigned int ctrlLength = GetWindowTextLength( logWindow );
+ unsigned int textLength = sMessage.length();
+
+ // Check for the caret
+ CHARRANGE range;
+ SendMessage( logWindow, EM_EXGETSEL, 0, (LPARAM)&range );
+
+ // Delete lines from the beginning if we exceed the maximum limit.
+ if( ctrlLength + textLength > logLimit )
+ {
+ unsigned int linecount = 0;
+ unsigned int textcount = 0;
+
+ do
+ {
+ char buffer[1024] = { 0, };
+ ((short*)buffer)[0] = 1024;
+ textcount += SendMessage( logWindow, EM_GETLINE, linecount++, (WPARAM)buffer );
+ }
+ while( textcount < ( ctrlLength + textLength ) - logLimit );
+
+ SendMessage( logWindow, EM_SETSEL, 0, textcount );
+ SendMessage( logWindow, EM_REPLACESEL, FALSE, (LPARAM)"" );
+ }
+
// process \b properly
if ( sMessage.contains("\b") )
***************
*** 360,372 ****
}
}
! // Make sure we append, so move to last character.
! int nLines = SendMessage(logWindow, EM_GETLINECOUNT, 0, 0);
! LONG nLastChar = SendMessage(logWindow, EM_LINEINDEX, nLines, 0);
! CHARRANGE range;
! range.cpMin = nLastChar;
! range.cpMax = nLastChar;
! SendMessage( logWindow, EM_EXSETSEL, 0, (LPARAM) &range);
// Now it will get right, even if the user had selected sth.
SendMessage( logWindow, EM_REPLACESEL, FALSE, (LPARAM)sMessage.latin1() );
}
--- 403,419 ----
}
}
!
! range.cpMin = GetWindowTextLength( logWindow );
! range.cpMax = GetWindowTextLength( logWindow );
! SendMessage( logWindow, EM_EXSETSEL, 0, (LPARAM)&range );
!
// Now it will get right, even if the user had selected sth.
SendMessage( logWindow, EM_REPLACESEL, FALSE, (LPARAM)sMessage.latin1() );
+
+ // And ofcourse if not some control is currently capturing the input
+ if( !GetCapture() )
+ {
+ SendMessage( logWindow, EM_LINESCROLL, 0, SendMessage( logWindow, EM_LINEFROMCHAR, ( ctrlLength + textLength ) - 1, 0 ) );
+ }
}
|
|
From: <dar...@us...> - 2003-09-09 05:05:04
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv7649 Modified Files: wolf.dsp Log Message: Trying out new console code. Index: wolf.dsp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v retrieving revision 1.220 retrieving revision 1.221 diff -C2 -d -r1.220 -r1.221 *** wolf.dsp 8 Sep 2003 23:38:49 -0000 1.220 --- wolf.dsp 8 Sep 2003 23:39:25 -0000 1.221 *************** *** 52,56 **** 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 /machine:I386 ! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:console /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98 # SUBTRACT LINK32 /pdb:none --- 52,56 ---- 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 /machine:I386 ! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98 # SUBTRACT LINK32 /pdb:none |
|
From: <dar...@us...> - 2003-09-09 03:42:40
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv32514 Added Files: console.cpp console.h Log Message: Trying out new console code. --- NEW FILE: console.cpp --- //================================================================================== // // Wolfpack Emu (WP) // UO Server Emulation Program // // Copyright 1997, 98 by Marcus Rating (Cironian) // Copyright 2001-2003 by holders identified in authors.txt // 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 2 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, write to the Free Software // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. // // * In addition to that license, if you are running this program or modified // * versions of it on a public system you HAVE TO make the complete source of // * the version used by you available or provide people with a location to // * download it. // // // // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== // Wolfpack Includes #include "console.h" #include "pythonscript.h" #include "log.h" #include "globals.h" #include "world.h" #include "network.h" #include "srvparams.h" #include "player.h" #include "accounts.h" #include "prototypes.h" #include "inlines.h" // Library Includes #include <qstring.h> #include <qglobal.h> #include <qthread.h> #include <iostream> #if defined(Q_OS_WIN32) # include <windows.h> # include <conio.h> #endif #if defined(Q_OS_UNIX) #include <sys/types.h> #include <sys/time.h> #include <unistd.h> #else #endif using namespace std; //======================================================================================== // Constructor cConsole::cConsole() { bEnabled = true; // do nothing at the moment setStreams( &cin, &cout, &cerr, &cout ); } //======================================================================================== // Destuctor cConsole::~cConsole() { // Clean up any terminal settings } void cConsole::enabled(bool bState) { bEnabled = bState; } void cConsole::setStreams(istream *in, ostream *out, ostream *error, ostream *log) { inputstrm = in; outputstrm = out; errorstrm = error; logstrm = log; } //======================================================================================== // Send a message to the console void cConsole::send(const QString &sMessage) { if( outputstrm != NULL ) { (*outputstrm) << sMessage.latin1(); flush( *outputstrm ); } if( sMessage.contains( "\n" ) ) { #if defined(Q_OS_UNIX) && 0 sMessage.replace("\e[0m", ""); sMessage.replace("\e[1;32m", ""); sMessage.replace("\e[1;31m", ""); sMessage.replace("\e[1;33m", ""); sMessage.replace("\e[1;37m", ""); #endif incompleteLine_.append( sMessage ); // Split by \n QStringList lines = QStringList::split( "\n", incompleteLine_, true ); // Insert all except the last element for( int i = 0; i < lines.count()-1; ++i ) linebuffer_.push_back( lines[i] ); incompleteLine_ = lines[ lines.count() - 1 ]; } else { incompleteLine_.append( sMessage ); } } //======================================================================================== void cConsole::log( UINT8 logLevel, const QString &message ) { // Legacy Code QString msg = message; if( msg.endsWith( "\n" ) ) msg = msg.left( msg.length() - 1 ); Log::instance()->print( (eLogLevel)logLevel, msg + "\n" ); } //======================================================================================== // Send a message to the console void cConsole::error(const QString& sMessage) { if (errorstrm != NULL) (*errorstrm) << sMessage.latin1(); } //========================================================================================= // Get input from the console UI08 cConsole::getkey(void) { UI08 key = 0; // if (cin.peek()) // key = cin.get(); return key; } //========================================================================================= // Prepare a "progess" line void cConsole::PrepareProgress( const QString &sMessage ) { UI08 PrintedChars = sMessage.length() + 1; // one spacer send( sMessage.right(59) + " " ); ChangeColor( WPC_WHITE ); // Fill up the remaining chars with "....." for( UI08 i = 0; i < 60 - PrintedChars; i++ ) send( "." ); ChangeColor( WPC_NORMAL ); send( " [____]" ); } //========================================================================================= // Print Progress Done void cConsole::ProgressDone( void ) { send( "\b\b\b\b\b" ); // Go 5 Characters back ChangeColor( WPC_GREEN ); send( "done" ); ChangeColor( WPC_NORMAL ); send( "]\n" ); } //========================================================================================= // Print "Fail" void cConsole::ProgressFail( void ) { send( "\b\b\b\b\b" ); // Go 5 Characters back ChangeColor( WPC_RED ); send( "fail" ); ChangeColor( WPC_NORMAL ); send( "]\n" ); } //========================================================================================= // Print "Skip" (maps etc.) void cConsole::ProgressSkip( void ) { send( "\b\b\b\b\b" ); // Go 5 Characters back ChangeColor( WPC_YELLOW ); send( "skip" ); ChangeColor( WPC_NORMAL ); send( "]\n" ); } //========================================================================================= // Change the console Color void cConsole::ChangeColor( WPC_ColorKeys Color ) { #if defined(Q_OS_UNIX) QString cb = "\e[0m"; switch( Color ) { case WPC_GREEN: cb = "\e[1;32m"; break; case WPC_RED: cb = "\e[1;31m"; break; case WPC_YELLOW:cb = "\e[1;33m"; break; case WPC_NORMAL:cb = "\e[0m"; break; case WPC_WHITE: cb = "\e[1;37m"; break; default: cb = "\e[0m"; } send( cb ); #elif defined(Q_OS_WIN32) HANDLE ConsoleHandle = GetStdHandle( STD_OUTPUT_HANDLE ); UI16 ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE; switch( Color ) { case WPC_GREEN: ColorKey = FOREGROUND_GREEN | FOREGROUND_INTENSITY; break; case WPC_RED: ColorKey = FOREGROUND_RED | FOREGROUND_INTENSITY; break; case WPC_YELLOW: ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY; break; case WPC_NORMAL: ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE; break; case WPC_WHITE: ColorKey = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY; break; default: break; } SetConsoleTextAttribute( ConsoleHandle, ColorKey ); #endif } void cConsole::setConsoleTitle( const QString& data ) { #if defined(Q_OS_WIN32) SetConsoleTitle( data.latin1() ); #endif } bool cConsole::handleCommand( const QString &command, bool silentFail ) { cUOSocket *mSock; int i; char c = command.latin1()[0]; c = toupper(c); if( c == 'S' ) { secure = !secure; if( !secure ) Console::instance()->send("WOLFPACK: Secure mode disabled. Press ? for a commands list.\n"); else Console::instance()->send("WOLFPACK: Secure mode re-enabled.\n"); return true; } // Allow Help in Secure Mode if( secure && c != '?' ) { Console::instance()->send( "WOLFPACK: Secure mode prevents keyboard commands! Press 'S' to disable.\n" ); return false; } switch( c ) { case 'Q': Console::instance()->send("WOLFPACK: Immediate Shutdown initialized!\n"); keeprun=0; break; case '#': World::instance()->save(); SrvParams->flush(); break; case 'W': Console::instance()->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() ) Console::instance()->send( QString("%1) %2 [%3]\n").arg(++i).arg(mSock->player()->name()).arg(QString::number( mSock->player()->serial(), 16) ) ); } Console::instance()->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 '?': Console::instance()->send("Console commands:\n"); Console::instance()->send(" Q: Shutdown the server.\n"); Console::instance()->send(" # - Save world\n" ); Console::instance()->send(" W - Display logged in characters\n" ); Console::instance()->send(" A - Reload accounts\n" ); Console::instance()->send(" R - Reload scripts\n" ); Console::instance()->send(" S - Toggle Secure mode " ); if( secure ) Console::instance()->send( "[enabled]\n" ); else Console::instance()->send( "[disabled]\n" ); Console::instance()->send( " ? - Commands list (this)\n" ); Console::instance()->send( "End of commands list.\n" ); break; default: break; } return true; } class cConsoleThread : public QThread { protected: virtual void run() { try { while( serverState < SHUTDOWN ) { char c = getch(); if( c > 0 && serverState == RUNNING ) { Console::instance()->send( QChar( c ) ); } else { Sleep( 100 ); } } } catch( ... ) { } } }; cConsoleThread *thread = 0; void cConsole::start() { thread = new cConsoleThread; thread->start(); } void cConsole::poll() { // Normally we would check if there is a command in the command queue and execute it } void cConsole::stop() { thread->wait(); delete thread; } --- NEW FILE: console.h --- //================================================================================== // // Wolfpack Emu (WP) // UO Server Emulation Program // // Copyright 1997, 98 by Marcus Rating (Cironian) // Copyright 2001-2003 by holders identified in authors.txt // 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 2 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, write to the Free Software // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. // // * In addition to that license, if you are running this program or modified // * versions of it on a public system you HAVE TO make the complete source of // * the version used by you available or provide people with a location to // * download it. // // // // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== #if !defined(__WPCONSOLE_H__) #define __WPCONSOLE_H__ // Platform specifics #include "platform.h" // System Includes #include <iosfwd> #include <cstdarg> #include <cstdio> #include <qstringlist.h> #include <qstring.h> // Third Party includes // Forward class declaration class cPythonScript; // Wolfpack Includes #include "singleton.h" // Class definitions enum WPC_ColorKeys { WPC_NORMAL = 0, WPC_RED, WPC_GREEN, WPC_YELLOW, WPC_WHITE, }; class cConsole { private: QStringList linebuffer_; QString incompleteLine_; public: cConsole(); virtual ~cConsole(); void enabled(bool); void setStreams( std::istream *in, std::ostream *out, std::ostream *error, std::ostream *log ); // Send a message to the console void send(const QString &sMessage); // Log a message void log( UINT8 logLevel, const QString &message ); // Flag an error void error(const QString&); // Get input from the console UI08 getkey(void); // Prepare a // xxxxx -----------------------[ ] // line void PrepareProgress( const QString &sMessage ); void ProgressDone( void ); void ProgressFail( void ); void ProgressSkip( void ); void ChangeColor( WPC_ColorKeys Color ); void setConsoleTitle( const QString& data ); QStringList linebuffer() const { return linebuffer_; } bool handleCommand( const QString &command, bool silentFail = false ); void start(); void poll(); void stop(); private: std::istream *inputstrm; std::ostream *outputstrm; std::ostream *errorstrm; std::ostream *logstrm; bool bEnabled; }; typedef SingletonHolder< cConsole > Console; #endif |
|
From: <thi...@us...> - 2003-09-09 03:24:26
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv8572
Modified Files:
accounts.cpp accounts.h commands.cpp console_linux.cpp
console_win.cpp globals.cpp globals.h persistentbroker.cpp
wolf.dsp wolfpack.pro
Log Message:
- Improved the Windows console.
- Added missing license info
- Possibly fix linux link issues
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** accounts.cpp 31 Aug 2003 20:06:42 -0000 1.63
--- accounts.cpp 9 Sep 2003 03:24:15 -0000 1.64
***************
*** 131,136 ****
// No Valid ACL specified
if( !acl_ )
! return false;
!
// No group? No Access!
QMap< QString, QMap< QString, bool > >::iterator groupIter = acl_->groups.find( group );
--- 131,145 ----
// No Valid ACL specified
if( !acl_ )
! {// Let's try harder get one.
! acl_ = cCommands::instance()->getACL( aclName_ ); // loads if there was any specified.
! if ( !acl_ )
! {
! acl_ = cCommands::instance()->getACL( "player" );
! if ( acl_ )
! aclName_ = "player";
! else
! return false;
! }
! }
// No group? No Access!
QMap< QString, QMap< QString, bool > >::iterator groupIter = acl_->groups.find( group );
***************
*** 148,152 ****
return aGroup[ "any" ];
- // TODO: Implement Group any here
return false;
}
--- 157,160 ----
Index: accounts.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** accounts.h 31 Aug 2003 20:06:42 -0000 1.29
--- accounts.h 9 Sep 2003 03:24:15 -0000 1.30
***************
*** 60,65 ****
QString login_;
QString password_;
! cAcl *acl_;
! QString aclName_;
QValueVector<P_PLAYER> characters_;
QDateTime lastLogin_;
--- 60,65 ----
QString login_;
QString password_;
! mutable cAcl *acl_;
! mutable QString aclName_;
QValueVector<P_PLAYER> characters_;
QDateTime lastLogin_;
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.199
retrieving revision 1.200
diff -C2 -d -r1.199 -r1.200
*** commands.cpp 8 Sep 2003 10:58:47 -0000 1.199
--- commands.cpp 9 Sep 2003 03:24:15 -0000 1.200
***************
*** 156,160 ****
{
const cElement *childTag = Tag->getChild( i );
-
if( childTag->name() == "group" )
{
--- 156,159 ----
***************
*** 164,168 ****
{
const cElement *groupTag = childTag->getChild( j );
!
if( groupTag->name() == "action" )
{
--- 163,167 ----
{
const cElement *groupTag = childTag->getChild( j );
!
if( groupTag->name() == "action" )
{
***************
*** 180,184 ****
}
}
-
_acls.insert( ACLname, acl );
}
--- 179,182 ----
Index: console_linux.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_linux.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** console_linux.cpp 8 Sep 2003 23:38:49 -0000 1.1
--- console_linux.cpp 9 Sep 2003 03:24:15 -0000 1.2
***************
*** 1,2 ****
--- 1,32 ----
+ //==================================================================================
+ //
+ // Wolfpack Emu (WP)
+ // UO Server Emulation Program
+ //
+ // Copyright 1997, 98 by Marcus Rating (Cironian)
+ // Copyright 2001-2003 by holders identified in authors.txt
+ // 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 2 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, write to the Free Software
+ // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA.
+ //
+ // * In addition to that license, if you are running this program or modified
+ // * versions of it on a public system you HAVE TO make the complete source of
+ // * the version used by you available or provide people with a location to
+ // * download it.
+ //
+ //
+ //
+ // Wolfpack Homepage: http://wpdev.sf.net/
+ //==================================================================================
#include "console.h"
Index: console_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_win.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** console_win.cpp 8 Sep 2003 23:59:59 -0000 1.2
--- console_win.cpp 9 Sep 2003 03:24:15 -0000 1.3
***************
*** 1,2 ****
--- 1,31 ----
+ //==================================================================================
+ //
+ // Wolfpack Emu (WP)
+ // UO Server Emulation Program
+ //
+ // Copyright 2001-2003 by holders identified in authors.txt
+ // 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 2 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, write to the Free Software
+ // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA.
+ //
+ // * In addition to that license, if you are running this program or modified
+ // * versions of it on a public system you HAVE TO make the complete source of
+ // * the version used by you available or provide people with a location to
+ // * download it.
+ //
+ //
+ //
+ // Wolfpack Homepage: http://wpdev.sf.net/
+ //==================================================================================
// System Includes
***************
*** 71,76 ****
// Set up the fonts we need
ZeroMemory( &lfont, sizeof( LOGFONT ) );
! qstrcpy( lfont.lfFaceName, "Courier" );
font = CreateFontIndirect( &lfont );
// Set the font of our logwindow
--- 100,111 ----
// Set up the fonts we need
ZeroMemory( &lfont, sizeof( LOGFONT ) );
! qstrcpy( lfont.lfFaceName, "Fixedsys" );
font = CreateFontIndirect( &lfont );
+ if ( !font )
+ {
+ ZeroMemory( &lfont, sizeof( LOGFONT ) );
+ qstrcpy( lfont.lfFaceName, "Courier" );
+ font = CreateFontIndirect( &lfont );
+ }
// Set the font of our logwindow
***************
*** 85,93 ****
SendMessage( logWindow, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf );
! SendMessage( logWindow, EM_AUTOURLDETECT, 1, 0 );
SendMessage( logWindow, EM_SETEVENTMASK, 0, ENM_LINK|ENM_MOUSEEVENTS|ENM_KEYEVENTS );
// Create InputWindow
! inputWindow = CreateWindow( "EDIT", 0, ES_LEFT|ES_AUTOHSCROLL|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP, 0, 0, 10, 10, hwnd, 0, appInstance, 0 );
return 0;
--- 120,128 ----
SendMessage( logWindow, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf );
! SendMessage( logWindow, EM_AUTOURLDETECT, TRUE, 0 );
SendMessage( logWindow, EM_SETEVENTMASK, 0, ENM_LINK|ENM_MOUSEEVENTS|ENM_KEYEVENTS );
// Create InputWindow
! inputWindow = CreateWindow( "EDIT", 0, ES_LEFT|ES_AUTOHSCROLL|ES_AUTOVSCROLL|ES_NOHIDESEL|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP, 0, 0, 10, 10, hwnd, 0, appInstance, 0 );
return 0;
***************
*** 165,186 ****
class cGuiThread : public QThread
{
protected:
! virtual void run()
{
! char **argv = (char**)malloc( 1 * sizeof( char* ) );
! argv[0] = "wolfpack.exe";
int argc = 1;
! main( argc, argv );
! free( argv[0] );
! free( argv );
! PostQuitMessage( 0 );
}
};
- cGuiThread *guiThread = 0;
-
int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
--- 200,272 ----
class cGuiThread : public QThread
{
+ LPSTR cmdLine;
+ int returnValue_;
+
+ public:
+
+ cGuiThread( LPSTR lpCmdLine ) : cmdLine( lpCmdLine ) {}
+
+ int returnValue() { return returnValue_; }
+
protected:
!
! void run()
{
! QMemArray<pchar> argv( 8 );
! /*
! Since Windows programs don't get passed the command name as the
! first argument, we need to fetch it explicitly.
! */
! static char appFileName[256];
! GetModuleFileNameA( 0, appFileName, sizeof(appFileName) );
int argc = 1;
+ argv[0] = appFileName;
! /*
! Parse the Windows command line string. If an argument begins with a
! double quote, then spaces are considered part of the argument until the
! next double quote. The argument terminates at the second quote. Note
! that this is different from the usual Unix semantics.
! */
! char *p = cmdLine;
! char *p_end = p + strlen(p);
!
! while ( *p && p < p_end )
! {
! while ( isspace( (uchar)*p ) ) // skip whitespace
! p++;
! if (*p == '\0')
! break;
!
! if (*p == '"')
! {
! p++;
! if ( argc >= (int)argv.size()-1 )
! argv.resize( argv.size()*2 );
! argv[argc++] = p;
! while ( (*p != '\0') && (*p != '"') )
! p++;
! } else {
! if ( argc >= (int)argv.size()-1 )
! argv.resize( argv.size()*2 );
! argv[argc++] = p;
! while (*p != '\0' && !isspace( (uchar)*p ) )
! p++;
! }
! if (*p != '\0') {
! *p = '\0';
! p++;
! }
! }
! argv[argc] = 0;
!
! returnValue_ = main( argc, argv.data() );
!
! PostQuitMessage( returnValue_ );
}
};
int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
***************
*** 223,228 ****
ShowWindow( mainWindow, SW_NORMAL );
! guiThread = new cGuiThread;
! guiThread->start();
MSG msg;
--- 309,314 ----
ShowWindow( mainWindow, SW_NORMAL );
! cGuiThread guiThread( lpCmdLine );
! guiThread.start();
MSG msg;
***************
*** 236,243 ****
keeprun = 0; // We quit, so let's quit the server too
! guiThread->wait();
! delete guiThread;
!
! return 0;
}
--- 322,329 ----
keeprun = 0; // We quit, so let's quit the server too
! guiThread.wait();
! FreeLibrary( hRiched );
!
! return guiThread.returnValue();
}
***************
*** 257,260 ****
--- 343,371 ----
{
// process \b properly
+ if ( sMessage.contains("\b") )
+ {
+ // Split the message
+ uint pos = sMessage.find("\b");
+ if ( pos > 0 )
+ send( sMessage.right(pos));
+ else
+ {
+ CHARRANGE range;
+ SendMessage( logWindow, EM_EXGETSEL, 0, (LPARAM)&range );
+ range.cpMin -= 1;
+ SendMessage( logWindow, EM_EXSETSEL, 0, (LPARAM)&range );
+ SendMessage( logWindow, EM_REPLACESEL, FALSE, 0 );
+ send( sMessage.left( sMessage.length() - 1 ) );
+ return;
+ }
+ }
+ // Make sure we append, so move to last character.
+ int nLines = SendMessage(logWindow, EM_GETLINECOUNT, 0, 0);
+ LONG nLastChar = SendMessage(logWindow, EM_LINEINDEX, nLines, 0);
+ CHARRANGE range;
+ range.cpMin = nLastChar;
+ range.cpMax = nLastChar;
+ SendMessage( logWindow, EM_EXSETSEL, 0, (LPARAM) &range);
+ // Now it will get right, even if the user had selected sth.
SendMessage( logWindow, EM_REPLACESEL, FALSE, (LPARAM)sMessage.latin1() );
}
Index: globals.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/globals.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -C2 -d -r1.101 -r1.102
*** globals.cpp 8 Sep 2003 10:58:47 -0000 1.101
--- globals.cpp 9 Sep 2003 03:24:15 -0000 1.102
***************
*** 78,82 ****
int err, error;
! int keeprun;
//int now;
--- 78,82 ----
int err, error;
! volatile int keeprun;
//int now;
Index: globals.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/globals.h,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -d -r1.75 -r1.76
*** globals.h 8 Sep 2003 10:58:47 -0000 1.75
--- globals.h 9 Sep 2003 03:24:16 -0000 1.76
***************
*** 75,79 ****
extern int autosaved, dosavewarning;
extern int err, error;
! extern int keeprun;
//extern int now;
extern int secure; // Secure mode
--- 75,79 ----
extern int autosaved, dosavewarning;
extern int err, error;
! extern volatile int keeprun;
//extern int now;
extern int secure; // Secure mode
Index: persistentbroker.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** persistentbroker.cpp 8 Sep 2003 10:58:47 -0000 1.25
--- persistentbroker.cpp 9 Sep 2003 03:24:16 -0000 1.26
***************
*** 103,106 ****
--- 103,107 ----
connection->exec( "PRAGMA full_column_names = OFF;" );
connection->exec( "PRAGMA show_datatypes = OFF;" );
+ connection->exec( "PRAGMA parser_trace = OFF;" );
}
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.221
retrieving revision 1.222
diff -C2 -d -r1.221 -r1.222
*** wolf.dsp 8 Sep 2003 23:39:25 -0000 1.221
--- wolf.dsp 9 Sep 2003 03:24:16 -0000 1.222
***************
*** 1,23 ****
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
! !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
! !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Für die Konfiguration stehen zur Auswahl:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (basierend auf "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
!MESSAGE
--- 1,23 ----
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE This is not a valid makefile. To build this project using NMAKE,
! !MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE You can specify a configuration when running NMAKE
! !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Possible choices for configuration are:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (based on "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
***************
*** 26,30 ****
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=cl.exe
RSC=rc.exe
--- 26,30 ----
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=xicl6.exe
RSC=rc.exe
***************
*** 50,54 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! 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 /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
--- 50,54 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.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 /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
***************
*** 75,81 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! 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 gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib /nologo /version:12.9 /subsystem:windows /map /debug /machine:I386 /out:"D:\Wolfpack\wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
--- 75,81 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.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 gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib /nologo /version:12.9 /subsystem:windows /map /debug /machine:I386 /out:"c:\Wolfpack\wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.154
retrieving revision 1.155
diff -C2 -d -r1.154 -r1.155
*** wolfpack.pro 8 Sep 2003 10:58:47 -0000 1.154
--- wolfpack.pro 9 Sep 2003 03:24:16 -0000 1.155
***************
*** 184,188 ****
utilsys.cpp \
wolfpack.cpp \
- wpconsole.cpp \
walking.cpp \
world.cpp \
--- 184,187 ----
***************
*** 277,281 ****
languages/wolfpack_ge.ts
! unix:SOURCES += srvparams_unix.cpp
! win32:SOURCES += srvparams_win.cpp
--- 276,283 ----
languages/wolfpack_ge.ts
! unix:SOURCES += srvparams_unix.cpp \
! console_unix.cpp
!
! win32:SOURCES += srvparams_win.cpp \
! console_win.cpp
|
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] |
|
From: <dar...@us...> - 2003-09-09 01:28:19
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv10316
Modified Files:
console_win.cpp
Log Message:
Trying out new console code.
Index: console_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_win.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** console_win.cpp 8 Sep 2003 23:38:49 -0000 1.1
--- console_win.cpp 8 Sep 2003 23:59:59 -0000 1.2
***************
*** 24,27 ****
--- 24,29 ----
// Variables important for this GUI implementation
+ #define CONTROL_LOGWINDOW 0x10
+
HWND logWindow = 0; // Log Window
HWND inputWindow = 0; // Input Textfield
***************
*** 38,42 ****
LPVOID lpMsgBuf;
! if( !FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, 0, GetLastError(), MAKELANGID( LANG_NEUTRAL , SUBLANG_DEFAULT ), (LPTSTR)&lpMsgBuf, 0, 0 ) )
return QString( "Unknown Error" );
--- 40,44 ----
LPVOID lpMsgBuf;
! if( !FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, 0, GetLastError(), MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), (LPTSTR)&lpMsgBuf, 0, 0 ) )
return QString( "Unknown Error" );
***************
*** 58,62 ****
case WM_CREATE:
// Create Richedit Box
! logWindow = CreateWindow( RICHEDIT_CLASS, 0, ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE | WS_VSCROLL, 0, 0, 10, 10, hwnd, 0, appInstance, 0 );
if( logWindow == 0 )
--- 60,64 ----
case WM_CREATE:
// Create Richedit Box
! logWindow = CreateWindow( RICHEDIT_CLASS, 0, ES_LEFT|ES_MULTILINE|ES_AUTOVSCROLL|ES_AUTOHSCROLL|ES_READONLY|WS_CHILD|WS_VISIBLE|WS_VSCROLL, 0, 0, 10, 10, hwnd, (HMENU)CONTROL_LOGWINDOW, appInstance, 0 );
if( logWindow == 0 )
***************
*** 91,94 ****
--- 93,97 ----
return 0;
+ // Autosize our Window Elements
case WM_SIZE:
if( logWindow && inputWindow && wparam != SIZE_MINIMIZED && wparam != SIZE_MAXHIDE )
***************
*** 115,118 ****
--- 118,156 ----
return 0;
+
+ case WM_ERASEBKGND:
+ return 1;
+
+ case WM_SETFOCUS:
+ SendMessage( inputWindow, WM_SETFOCUS, 0, 0 );
+ return 1;
+
+ case WM_NOTIFY:
+ if( wparam == CONTROL_LOGWINDOW )
+ {
+ NMHDR *notify = (NMHDR*)lparam;
+
+ if( notify->code == EN_LINK )
+ {
+ ENLINK *link = (ENLINK*)notify;
+
+ if( link->msg == WM_LBUTTONDOWN )
+ {
+ char *string = new char[ ( link->chrg.cpMax - link->chrg.cpMin ) + 1 ];
+
+ TEXTRANGE tr;
+ tr.chrg = link->chrg;
+ tr.lpstrText = string;
+
+ SendMessage( logWindow, EM_GETTEXTRANGE, 0, (LPARAM)&tr );
+
+ // String contains the link
+
+ delete [] string;
+
+ // Reset selection to the end
+ }
+ }
+ }
case WM_DESTROY:
***************
*** 175,179 ****
// Create the Window itself
! mainWindow = CreateWindow( WOLFPACK_CLASS, "Wolfpack", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 500, 400, NULL, 0, hInstance, NULL );
if( mainWindow == 0 )
--- 213,217 ----
// Create the Window itself
! mainWindow = CreateWindow( WOLFPACK_CLASS, "Wolfpack", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 640, 480, NULL, 0, hInstance, NULL );
if( mainWindow == 0 )
***************
*** 219,223 ****
{
// process \b properly
-
SendMessage( logWindow, EM_REPLACESEL, FALSE, (LPARAM)sMessage.latin1() );
}
--- 257,260 ----
***************
*** 251,254 ****
--- 288,292 ----
cf.crTextColor = RGB( 0xFF,0xFF,0xFF );
break;
+
};
|
|
From: <thi...@us...> - 2003-09-09 01:10:33
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv5212
Modified Files:
wolfpack.cpp
Log Message:
Linux compile fix.
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.457
retrieving revision 1.458
diff -C2 -d -r1.457 -r1.458
*** wolfpack.cpp 8 Sep 2003 10:58:47 -0000 1.457
--- wolfpack.cpp 8 Sep 2003 20:50:22 -0000 1.458
***************
*** 91,94 ****
--- 91,97 ----
// signal handlers
#if defined( Q_OS_UNIX )
+
+ #include <signal.h>
+
void signal_handler(int signal)
{
|
|
From: <dar...@us...> - 2003-09-09 00:36:39
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv7549
Modified Files:
console.cpp console.h wolf.dsp wolfpack.cpp
Added Files:
console_linux.cpp console_win.cpp
Log Message:
Trying out new console code.
--- NEW FILE: console_linux.cpp ---
#include "console.h"
class cConsoleThread : public QThread
{
protected:
virtual void run()
{
try
{
while( serverState < SHUTDOWN )
{
char c = getch();
if( c > 0 && serverState == RUNNING )
{
Console::instance()->handleCommand( QChar( c ) );
}
else
{
Sleep( 100 );
}
}
}
// If there is any error: Quit.
// It's better to have no console input
// than a deadlocking server.
catch( ... )
{
}
}
};
cConsoleThread *thread = 0;
void cConsole::start()
{
thread = new cConsoleThread;
thread->start();
}
void cConsole::poll()
{
// Normally we would check if there is a command in the command queue and execute it
}
void cConsole::stop()
{
thread->wait();
delete thread;
}
void cConsole::setConsoleTitle( const QString& data )
{
#if defined(Q_OS_WIN32)
SetConsoleTitle( data.latin1() );
#endif
}
//=========================================================================================
// Change the console Color
void cConsole::ChangeColor( WPC_ColorKeys Color )
{
#if defined(Q_OS_UNIX)
QString cb = "\e[0m";
switch( Color )
{
case WPC_GREEN: cb = "\e[1;32m";
break;
case WPC_RED: cb = "\e[1;31m";
break;
case WPC_YELLOW:cb = "\e[1;33m";
break;
case WPC_NORMAL:cb = "\e[0m";
break;
case WPC_WHITE: cb = "\e[1;37m";
break;
default: cb = "\e[0m";
}
send( cb );
#elif defined(Q_OS_WIN32)
HANDLE ConsoleHandle = GetStdHandle( STD_OUTPUT_HANDLE );
UI16 ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE;
switch( Color )
{
case WPC_GREEN:
ColorKey = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
break;
case WPC_RED:
ColorKey = FOREGROUND_RED | FOREGROUND_INTENSITY;
break;
case WPC_YELLOW:
ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY;
break;
case WPC_NORMAL:
ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE;
break;
case WPC_WHITE:
ColorKey = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY;
break;
default:
break;
}
SetConsoleTextAttribute( ConsoleHandle, ColorKey );
#endif
}
//========================================================================================
// Send a message to the console
void cConsole::send(const QString &sMessage)
{
if( outputstrm != NULL )
{
(*outputstrm) << sMessage.latin1();
flush( *outputstrm );
}
if( sMessage.contains( "\n" ) )
{
#if defined(Q_OS_UNIX) && 0
sMessage.replace("\e[0m", "");
sMessage.replace("\e[1;32m", "");
sMessage.replace("\e[1;31m", "");
sMessage.replace("\e[1;33m", "");
sMessage.replace("\e[1;37m", "");
#endif
incompleteLine_.append( sMessage ); // Split by \n
QStringList lines = QStringList::split( "\n", incompleteLine_, true );
// Insert all except the last element
for( int i = 0; i < lines.count()-1; ++i )
linebuffer_.push_back( lines[i] );
incompleteLine_ = lines[ lines.count() - 1 ];
}
else
{
incompleteLine_.append( sMessage );
}
}
--- NEW FILE: console_win.cpp ---
// System Includes
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <richedit.h>
#include <qthread.h>
// Wolfpack Includes
#include "console.h"
#include "resource.h"
#include "globals.h"
/*
This file includes the Windows GUI implementation of our Console.
*/
#define WOLFPACK_CLASS "wolfpack_class"
extern int main( int argc, char **argv );
// Variables important for this GUI implementation
HWND logWindow = 0; // Log Window
HWND inputWindow = 0; // Input Textfield
HWND mainWindow = 0; // Main Window
HINSTANCE appInstance = 0; // Application Instance
HFONT font = 0; // The font we'll use
unsigned int inputHeight = 0; // For measuring the height of the input field
/*
Directly taken from MSDN
*/
static QString getErrorString()
{
LPVOID lpMsgBuf;
if( !FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, 0, GetLastError(), MAKELANGID( LANG_NEUTRAL , SUBLANG_DEFAULT ), (LPTSTR)&lpMsgBuf, 0, 0 ) )
return QString( "Unknown Error" );
QString result( (char*)lpMsgBuf );
// Free the buffer.
LocalFree( lpMsgBuf );
return result;
}
LRESULT CALLBACK wpWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
CHARFORMAT cf;
LOGFONT lfont;
switch( msg )
{
case WM_CREATE:
// Create Richedit Box
logWindow = CreateWindow( RICHEDIT_CLASS, 0, ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | WS_CHILD | WS_VISIBLE | WS_VSCROLL, 0, 0, 10, 10, hwnd, 0, appInstance, 0 );
if( logWindow == 0 )
{
MessageBox( 0, QString( "Couldn't create the logwindow: " + getErrorString() ).latin1(), "Wolfpack", MB_OK|MB_ICONERROR );
DestroyWindow( hwnd );
return TRUE;
}
// Set up the fonts we need
ZeroMemory( &lfont, sizeof( LOGFONT ) );
qstrcpy( lfont.lfFaceName, "Courier" );
font = CreateFontIndirect( &lfont );
// Set the font of our logwindow
SendMessage( logWindow, WM_SETFONT, (WPARAM)font, 0 );
SendMessage( logWindow, EM_SETBKGNDCOLOR, 0, (LPARAM)RGB(0,0,0) );
// Default Charformat
ZeroMemory( &cf, sizeof( CHARFORMAT ) );
cf.cbSize = sizeof( CHARFORMAT );
cf.dwMask = CFM_COLOR;
cf.crTextColor = RGB( 0xAF,0xAF,0xAF );
SendMessage( logWindow, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf );
SendMessage( logWindow, EM_AUTOURLDETECT, 1, 0 );
SendMessage( logWindow, EM_SETEVENTMASK, 0, ENM_LINK|ENM_MOUSEEVENTS|ENM_KEYEVENTS );
// Create InputWindow
inputWindow = CreateWindow( "EDIT", 0, ES_LEFT|ES_AUTOHSCROLL|WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP, 0, 0, 10, 10, hwnd, 0, appInstance, 0 );
return 0;
case WM_SIZE:
if( logWindow && inputWindow && wparam != SIZE_MINIMIZED && wparam != SIZE_MAXHIDE )
{
unsigned int width = LOWORD( lparam );
unsigned int height = HIWORD( lparam );
// Measure the Height of our Input Field
if( !inputHeight )
{
HFONT font = (HFONT)SendMessage( mainWindow, WM_GETFONT, 0, 0 );
if( !font )
font = (HFONT)GetStockObject( SYSTEM_FONT );
LOGFONT logfont;
if( GetObject( font, sizeof( LOGFONT ), &logfont ) == sizeof( LOGFONT ) )
inputHeight = logfont.lfHeight + 4;
}
MoveWindow( logWindow, 0, 0, width, height - inputHeight, TRUE );
MoveWindow( inputWindow, 0, height - inputHeight, width, inputHeight, TRUE );
}
return 0;
case WM_DESTROY:
keeprun = 0;
return 0;
default:
return DefWindowProc( hwnd, msg, wparam, lparam );
}
}
class cGuiThread : public QThread
{
protected:
virtual void run()
{
char **argv = (char**)malloc( 1 * sizeof( char* ) );
argv[0] = "wolfpack.exe";
int argc = 1;
main( argc, argv );
free( argv[0] );
free( argv );
PostQuitMessage( 0 );
}
};
cGuiThread *guiThread = 0;
int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
appInstance = hInstance;
// Try to load riched20.dll
HMODULE hRiched = LoadLibrary( "riched20.dll" );
if( hRiched == 0 )
{
MessageBox( 0, "The riched20.dll library could not be found on your system.\nPlease install Microsoft Internet Explorer 4.0 or later.", "Riched missing", MB_OK|MB_ICONERROR );
return 1;
}
// Create the WindowClass
WNDCLASS wpClass;
ZeroMemory( &wpClass, sizeof( WNDCLASS ) );
wpClass.hInstance = hInstance;
wpClass.lpfnWndProc = wpWindowProc;
wpClass.hIcon = LoadIcon( hInstance, MAKEINTRESOURCE( IDI_ICON2 ) );
wpClass.hbrBackground = GetSysColorBrush( COLOR_BTNFACE );
wpClass.lpszClassName = WOLFPACK_CLASS;
wpClass.style = CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW;
if( !RegisterClass( &wpClass ) )
{
MessageBox( 0, "Couldn't register Window Class.", "Window Class", MB_OK|MB_ICONERROR );
return 1;
}
// Create the Window itself
mainWindow = CreateWindow( WOLFPACK_CLASS, "Wolfpack", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 500, 400, NULL, 0, hInstance, NULL );
if( mainWindow == 0 )
{
MessageBox( 0, QString( "Couldn't create the window: " + getErrorString() ).latin1(), "Wolfpack", MB_OK|MB_ICONERROR );
return 1;
}
ShowWindow( mainWindow, SW_NORMAL );
guiThread = new cGuiThread;
guiThread->start();
MSG msg;
while( GetMessage( &msg, mainWindow, 0, 0 ) > 0 )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
keeprun = 0; // We quit, so let's quit the server too
guiThread->wait();
delete guiThread;
return 0;
}
void cConsole::start()
{
}
void cConsole::poll()
{
}
void cConsole::stop()
{
}
void cConsole::send(const QString &sMessage)
{
// process \b properly
SendMessage( logWindow, EM_REPLACESEL, FALSE, (LPARAM)sMessage.latin1() );
}
void cConsole::ChangeColor( WPC_ColorKeys color )
{
CHARFORMAT cf;
ZeroMemory( &cf, sizeof( CHARFORMAT ) );
cf.cbSize = sizeof( CHARFORMAT );
cf.dwMask = CFM_COLOR;
switch( color )
{
case WPC_GREEN:
cf.crTextColor = RGB( 0x00,0xFF,0x00 );
break;
case WPC_RED:
cf.crTextColor = RGB( 0xFF,0x00,0x00 );
break;
case WPC_YELLOW:
cf.crTextColor = RGB( 0x00,0xFF,0xFF );
break;
case WPC_NORMAL:
cf.crTextColor = RGB( 0xAF,0xAF,0xAF );
break;
case WPC_WHITE:
cf.crTextColor = RGB( 0xFF,0xFF,0xFF );
break;
};
SendMessage( logWindow, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf );
}
void cConsole::setConsoleTitle( const QString& data )
{
SetWindowText( mainWindow, data.latin1() );
}
Index: console.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** console.cpp 8 Sep 2003 11:46:24 -0000 1.1
--- console.cpp 8 Sep 2003 23:38:49 -0000 1.2
***************
*** 71,75 ****
bEnabled = true;
// do nothing at the moment
! setStreams( &cin, &cout, &cerr, &cout );
}
--- 71,75 ----
bEnabled = true;
// do nothing at the moment
! setStreams( &cin, &cout );
}
***************
*** 86,129 ****
}
! void cConsole::setStreams(istream *in, ostream *out, ostream *error, ostream *log)
{
inputstrm = in;
outputstrm = out;
- errorstrm = error;
- logstrm = log;
- }
-
- //========================================================================================
- // Send a message to the console
- void cConsole::send(const QString &sMessage)
- {
- if( outputstrm != NULL )
- {
- (*outputstrm) << sMessage.latin1();
- flush( *outputstrm );
- }
-
- if( sMessage.contains( "\n" ) )
- {
- #if defined(Q_OS_UNIX) && 0
- sMessage.replace("\e[0m", "");
- sMessage.replace("\e[1;32m", "");
- sMessage.replace("\e[1;31m", "");
- sMessage.replace("\e[1;33m", "");
- sMessage.replace("\e[1;37m", "");
- #endif
- incompleteLine_.append( sMessage ); // Split by \n
- QStringList lines = QStringList::split( "\n", incompleteLine_, true );
-
- // Insert all except the last element
- for( int i = 0; i < lines.count()-1; ++i )
- linebuffer_.push_back( lines[i] );
-
- incompleteLine_ = lines[ lines.count() - 1 ];
- }
- else
- {
- incompleteLine_.append( sMessage );
- }
}
--- 86,93 ----
}
! void cConsole::setStreams(istream *in, ostream *out)
{
inputstrm = in;
outputstrm = out;
}
***************
*** 140,151 ****
}
- //========================================================================================
- // Send a message to the console
- void cConsole::error(const QString& sMessage)
- {
- if (errorstrm != NULL)
- (*errorstrm) << sMessage.latin1();
- }
-
//=========================================================================================
// Get input from the console
--- 104,107 ----
***************
*** 211,276 ****
}
- //=========================================================================================
- // Change the console Color
- void cConsole::ChangeColor( WPC_ColorKeys Color )
- {
- #if defined(Q_OS_UNIX)
- QString cb = "\e[0m";
- switch( Color )
- {
- case WPC_GREEN: cb = "\e[1;32m";
- break;
- case WPC_RED: cb = "\e[1;31m";
- break;
- case WPC_YELLOW:cb = "\e[1;33m";
- break;
- case WPC_NORMAL:cb = "\e[0m";
- break;
- case WPC_WHITE: cb = "\e[1;37m";
- break;
- default: cb = "\e[0m";
-
- }
- send( cb );
- #elif defined(Q_OS_WIN32)
- HANDLE ConsoleHandle = GetStdHandle( STD_OUTPUT_HANDLE );
- UI16 ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE;
-
- switch( Color )
- {
- case WPC_GREEN:
- ColorKey = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
- break;
-
- case WPC_RED:
- ColorKey = FOREGROUND_RED | FOREGROUND_INTENSITY;
- break;
-
- case WPC_YELLOW:
- ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY;
- break;
-
- case WPC_NORMAL:
- ColorKey = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE;
- break;
-
- case WPC_WHITE:
- ColorKey = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY;
- break;
-
- default:
- break;
- }
-
- SetConsoleTextAttribute( ConsoleHandle, ColorKey );
- #endif
- }
-
- void cConsole::setConsoleTitle( const QString& data )
- {
- #if defined(Q_OS_WIN32)
- SetConsoleTitle( data.latin1() );
- #endif
- }
bool cConsole::handleCommand( const QString &command, bool silentFail )
--- 167,170 ----
***************
*** 352,400 ****
return true;
- }
-
- class cConsoleThread : public QThread
- {
- protected:
- virtual void run()
- {
- try
- {
- while( serverState < SHUTDOWN )
- {
- char c = getch();
-
- if( c > 0 && serverState == RUNNING )
- {
- Console::instance()->send( QChar( c ) );
- }
- else
- {
- Sleep( 100 );
- }
- }
- }
- catch( ... )
- {
- }
- }
- };
-
- cConsoleThread *thread = 0;
-
- void cConsole::start()
- {
- thread = new cConsoleThread;
- thread->start();
- }
-
- void cConsole::poll()
- {
- // Normally we would check if there is a command in the command queue and execute it
- }
-
- void cConsole::stop()
- {
- thread->wait();
- delete thread;
}
--- 246,248 ----
Index: console.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** console.h 8 Sep 2003 11:46:24 -0000 1.1
--- console.h 8 Sep 2003 23:38:49 -0000 1.2
***************
*** 72,87 ****
void enabled(bool);
! void setStreams( std::istream *in, std::ostream *out, std::ostream *error, std::ostream *log );
// Send a message to the console
! void send(const QString &sMessage);
!
// Log a message
void log( UINT8 logLevel, const QString &message );
- // Flag an error
- void error(const QString&);
-
// Get input from the console
UI08 getkey(void);
--- 72,83 ----
void enabled(bool);
! void setStreams( std::istream *in, std::ostream *out );
// Send a message to the console
! virtual void send(const QString &sMessage);
// Log a message
void log( UINT8 logLevel, const QString &message );
// Get input from the console
UI08 getkey(void);
***************
*** 95,113 ****
void ProgressSkip( void );
! void ChangeColor( WPC_ColorKeys Color );
! void setConsoleTitle( const QString& data );
QStringList linebuffer() const { return linebuffer_; }
bool handleCommand( const QString &command, bool silentFail = false );
! void start();
! void poll();
! void stop();
private:
std::istream *inputstrm;
std::ostream *outputstrm;
- std::ostream *errorstrm;
- std::ostream *logstrm;
bool bEnabled;
};
--- 91,107 ----
void ProgressSkip( void );
! virtual void ChangeColor( WPC_ColorKeys Color );
! virtual void setConsoleTitle( const QString& data );
QStringList linebuffer() const { return linebuffer_; }
bool handleCommand( const QString &command, bool silentFail = false );
! virtual void start();
! virtual void poll();
! virtual void stop();
private:
std::istream *inputstrm;
std::ostream *outputstrm;
bool bEnabled;
};
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.219
retrieving revision 1.220
diff -C2 -d -r1.219 -r1.220
*** wolf.dsp 8 Sep 2003 10:58:47 -0000 1.219
--- wolf.dsp 8 Sep 2003 23:38:49 -0000 1.220
***************
*** 52,56 ****
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 /machine:I386
! # ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:console /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"D:\wolfpack\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
# SUBTRACT LINK32 /pdb:none
--- 52,56 ----
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 /machine:I386
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib /nologo /subsystem:console /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
# 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
--- 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 gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib /nologo /version:12.9 /subsystem:windows /map /debug /machine:I386 /out:"D:\Wolfpack\wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
***************
*** 143,146 ****
--- 143,150 ----
# Begin Source File
+ SOURCE=.\console_win.cpp
+ # End Source File
+ # Begin Source File
+
SOURCE=.\contextmenu.cpp
# End Source File
***************
*** 453,456 ****
--- 457,464 ----
SOURCE=.\console.h
+ # End Source File
+ # Begin Source File
+
+ SOURCE=.\console_win.h
# End Source File
# Begin Source File
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.458
retrieving revision 1.459
diff -C2 -d -r1.458 -r1.459
*** wolfpack.cpp 8 Sep 2003 20:50:22 -0000 1.458
--- wolfpack.cpp 8 Sep 2003 23:38:49 -0000 1.459
***************
*** 229,233 ****
}
else
! Console::instance()->error( QString("The specified python script [%1] doesn't exist.").arg(param) );
}
--- 229,233 ----
}
else
! Console::instance()->send( QString("The specified python script [%1] doesn't exist.").arg(param) );
}
***************
*** 330,335 ****
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() ) );
--- 330,333 ----
***************
*** 545,548 ****
--- 543,548 ----
serverState = RUNNING;
+
+ Console::instance()->start(); // Startup Console
QWaitCondition niceLevel;
|
|
From: <dar...@us...> - 2003-09-09 00:26:52
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv23381/python
Modified Files:
engine.cpp global.cpp
Log Message:
Trying out new console code.
Index: engine.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/engine.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** engine.cpp 12 Jun 2003 02:19:39 -0000 1.15
--- engine.cpp 8 Sep 2003 10:58:47 -0000 1.16
***************
*** 31,35 ****
#include "engine.h"
! #include "../wpconsole.h"
#include "../globals.h"
--- 31,35 ----
#include "engine.h"
! #include "../console.h"
#include "../globals.h"
***************
*** 62,66 ****
{
if( !silent )
! clConsole.PrepareProgress( "Starting Python interpreter" );
Py_SetProgramName( argv[ 0 ] );
--- 62,66 ----
{
if( !silent )
! Console::instance()->PrepareProgress( "Starting Python interpreter" );
Py_SetProgramName( argv[ 0 ] );
***************
*** 82,87 ****
{
if( !silent )
! clConsole.ProgressSkip();
! clConsole.send( "Unable to open python.xml!\n" );
return;
}
--- 82,87 ----
{
if( !silent )
! Console::instance()->ProgressSkip();
! Console::instance()->send( "Unable to open python.xml!\n" );
return;
}
***************
*** 91,96 ****
if( !silent )
! clConsole.ProgressSkip();
! clConsole.send( "Unable to parse python.xml" );
return;
--- 91,96 ----
if( !silent )
! Console::instance()->ProgressSkip();
! Console::instance()->send( "Unable to parse python.xml" );
return;
***************
*** 121,125 ****
if( m == NULL )
{
! clConsole.ProgressFail();
if( PyErr_Occurred() )
PyErr_Print();
--- 121,125 ----
if( m == NULL )
{
! Console::instance()->ProgressFail();
if( PyErr_Occurred() )
PyErr_Print();
***************
*** 139,149 ****
{
if( !silent )
! clConsole.ProgressFail();
! clConsole.send( "Failed to initialize the python extension modules\n" );
return;
}
if( !silent )
! clConsole.ProgressDone();
}
--- 139,149 ----
{
if( !silent )
! Console::instance()->ProgressFail();
! Console::instance()->send( "Failed to initialize the python extension modules\n" );
return;
}
if( !silent )
! Console::instance()->ProgressDone();
}
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.87
retrieving revision 1.88
diff -C2 -d -r1.87 -r1.88
*** global.cpp 5 Sep 2003 20:21:32 -0000 1.87
--- global.cpp 8 Sep 2003 10:58:48 -0000 1.88
***************
*** 34,38 ****
#include "../network/uosocket.h"
#include "../network/uotxpackets.h"
! #include "../wpconsole.h"
#include "../TmpEff.h"
#include "../sectors.h"
--- 34,38 ----
#include "../network/uosocket.h"
#include "../network/uotxpackets.h"
! #include "../console.h"
#include "../TmpEff.h"
#include "../sectors.h"
***************
*** 134,138 ****
return PyFalse;
! clConsole.send( PyString_AS_STRING( pyMessage ) );
return PyTrue;
--- 134,138 ----
return PyFalse;
! Console::instance()->send( PyString_AS_STRING( pyMessage ) );
return PyTrue;
***************
*** 153,157 ****
return PyFalse;
! clConsole.PrepareProgress( PyString_AS_STRING( pyMessage ) );
return PyInt_FromLong( 1 );
--- 153,157 ----
return PyFalse;
! Console::instance()->PrepareProgress( PyString_AS_STRING( pyMessage ) );
return PyInt_FromLong( 1 );
***************
*** 165,169 ****
Q_UNUSED(self);
Q_UNUSED(args);
! clConsole.ProgressDone();
return PyInt_FromLong( 1 );
}
--- 165,169 ----
Q_UNUSED(self);
Q_UNUSED(args);
! Console::instance()->ProgressDone();
return PyInt_FromLong( 1 );
}
***************
*** 176,180 ****
Q_UNUSED(self);
Q_UNUSED(args);
! clConsole.ProgressFail();
return PyInt_FromLong( 1 );
}
--- 176,180 ----
Q_UNUSED(self);
Q_UNUSED(args);
! Console::instance()->ProgressFail();
return PyInt_FromLong( 1 );
}
***************
*** 187,191 ****
Q_UNUSED(self);
Q_UNUSED(args);
! clConsole.ProgressSkip();
return PyInt_FromLong( 1 );
}
--- 187,191 ----
Q_UNUSED(self);
Q_UNUSED(args);
! Console::instance()->ProgressSkip();
return PyInt_FromLong( 1 );
}
***************
*** 198,202 ****
Q_UNUSED(self);
Q_UNUSED(args);
! QStringList linebuffer = clConsole.linebuffer();
PyObject *list = PyList_New( linebuffer.count() );
--- 198,202 ----
Q_UNUSED(self);
Q_UNUSED(args);
! QStringList linebuffer = Console::instance()->linebuffer();
PyObject *list = PyList_New( linebuffer.count() );
***************
*** 210,231 ****
}
- extern QStringList commandQueue;
- extern QMutex commandMutex;
static PyObject* wpConsole_reloadScripts( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
Q_UNUSED(args);
- // Temporary implementation while thread comunication is not done
- QMutexLocker lock(&commandMutex);
! if ( !secure )
! commandQueue.push_back( "R" );
! else
! {
! commandQueue.push_back("S");
! commandQueue.push_back("R");
! commandQueue.push_back("S");
! }
!
return PyInt_FromLong( 1 );
}
--- 210,220 ----
}
static PyObject* wpConsole_reloadScripts( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
Q_UNUSED(args);
! reloadScripts();
!
return PyInt_FromLong( 1 );
}
|
|
From: <dar...@us...> - 2003-09-08 23:56:02
|
Update of /cvsroot/wpdev/wolfpack/network
In directory sc8-pr-cvs1:/tmp/cvs-serv23381/network
Modified Files:
uosocket.cpp uosocket.h
Log Message:
Trying out new console code.
Index: uosocket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v
retrieving revision 1.282
retrieving revision 1.283
diff -C2 -d -r1.282 -r1.283
*** uosocket.cpp 5 Sep 2003 00:03:46 -0000 1.282
--- uosocket.cpp 8 Sep 2003 10:58:47 -0000 1.283
***************
*** 301,305 ****
handleUpdateBook( dynamic_cast< cUORxBookInfo* >( packet ) ); break;
default:
! packet->print( &cout );
break;
}
--- 301,305 ----
handleUpdateBook( dynamic_cast< cUORxBookInfo* >( packet ) ); break;
default:
! Console::instance()->send( packet->dump( packet->uncompressed() ) );
break;
}
Index: uosocket.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.h,v
retrieving revision 1.93
retrieving revision 1.94
diff -C2 -d -r1.93 -r1.94
*** uosocket.h 5 Sep 2003 00:03:46 -0000 1.93
--- uosocket.h 8 Sep 2003 10:58:47 -0000 1.94
***************
*** 55,60 ****
#include "../customtags.h"
- enum eLogLevel;
-
struct stTargetItem
{
--- 55,58 ----
|
|
From: <ri...@us...> - 2003-09-07 22:03:21
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/humans In directory sc8-pr-cvs1:/tmp/cvs-serv31604/definitions/npcs/humans Modified Files: civilists.xml vendors.xml Log Message: npcs now can walk again :) Index: civilists.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/humans/civilists.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** civilists.xml 6 Sep 2003 20:44:40 -0000 1.4 --- civilists.xml 7 Sep 2003 22:00:17 -0000 1.5 *************** *** 14,18 **** <name><random list="NAMES_MALE" /></name> <skin><random list="SKINS_HUMAN" /></skin> ! <direction><random min="0" max="7" /></direction> <!-- Facing a random direction --> --- 14,18 ---- <name><random list="NAMES_MALE" /></name> <skin><random list="SKINS_HUMAN" /></skin> ! <wandertype>1</wandertype> <direction><random min="0" max="7" /></direction> <!-- Facing a random direction --> *************** *** 37,41 **** <name><random list="NAMES_FEMALE" /></name> <skin><random list="SKINS_HUMAN" /></skin> ! <direction><random min="0" max="7" /></direction> <!-- Facing a random direction --> --- 37,41 ---- <name><random list="NAMES_FEMALE" /></name> <skin><random list="SKINS_HUMAN" /></skin> ! <wandertype>1</wandertype> <direction><random min="0" max="7" /></direction> <!-- Facing a random direction --> Index: vendors.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/humans/vendors.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** vendors.xml 5 Sep 2003 11:04:30 -0000 1.19 --- vendors.xml 7 Sep 2003 22:00:18 -0000 1.20 *************** *** 16,28 **** <bindmenu>banker_menu</bindmenu> <ai>Human_Vendor</ai> - <swordsmanship> - <random min="150" max="380"/> - </swordsmanship> - <itemid> - <random min="500" max="700"/> - </itemid> - <tactics> - <random min="150" max="380"/> - </tactics> <category>Vendors\Banker (Male)</category> </npc> --- 16,19 ---- *************** *** 33,45 **** <bindmenu>banker_menu</bindmenu> <ai>Human_Vendor</ai> - <swordsmanship> - <random min="150" max="380"/> - </swordsmanship> - <itemid> - <random min="500" max="700"/> - </itemid> - <tactics> - <random min="150" max="380"/> - </tactics> <category>Vendors\Banker (Female)</category> </npc> --- 24,27 ---- *************** *** 49,73 **** <title>the Barber</title> <events>speech_barber</events> - <fencing> - <random min="150" max="380"/> - </fencing> - <parrying> - <random min="450" max="680"/> - </parrying> - <swordsmanship> - <random min="150" max="380"/> - </swordsmanship> - <wrestling> - <random min="150" max="380"/> - </wrestling> - <macefighting> - <random min="150" max="380"/> - </macefighting> - <magicresistance> - <random min="450" max="680"/> - </magicresistance> - <tactics> - <random min="450" max="680"/> - </tactics> <category>Vendors\Barber (Male)</category> </npc> --- 31,34 ---- *************** *** 76,100 **** <title>the Barber</title> <events>speech_barber</events> - <fencing> - <random min="150" max="380"/> - </fencing> - <parrying> - <random min="450" max="680"/> - </parrying> - <swordsmanship> - <random min="150" max="380"/> - </swordsmanship> - <wrestling> - <random min="150" max="380"/> - </wrestling> - <macefighting> - <random min="150" max="380"/> - </macefighting> - <magicresistance> - <random min="450" max="680"/> - </magicresistance> - <tactics> - <random min="450" max="680"/> - </tactics> <category>Vendors\Barber (Female)</category> </npc> --- 37,40 ---- |
|
From: <ri...@us...> - 2003-09-07 22:02:20
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/monsters In directory sc8-pr-cvs1:/tmp/cvs-serv31604/definitions/npcs/monsters Modified Files: base.xml undeads.xml Log Message: npcs now can walk again :) Index: base.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/monsters/base.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** base.xml 16 Jun 2003 13:35:34 -0000 1.5 --- base.xml 7 Sep 2003 22:00:19 -0000 1.6 *************** *** 13,17 **** <ai>Monster_Aggressive_L1</ai> <totame>1100</totame> ! <npcwander type="circle" radius="20"/> <direction> <random min="0" max="7"/> --- 13,17 ---- <ai>Monster_Aggressive_L1</ai> <totame>1100</totame> ! <wandertype>1</wandertype> <direction> <random min="0" max="7"/> Index: undeads.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/monsters/undeads.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** undeads.xml 23 Aug 2003 07:07:25 -0000 1.10 --- undeads.xml 7 Sep 2003 22:00:19 -0000 1.11 *************** *** 11,15 **** <npc id="undead_base"> <ai>2</ai> ! <npcwander type="circle" radius="20"/> <totame>1100</totame> </npc> --- 11,15 ---- <npc id="undead_base"> <ai>2</ai> ! <wandertype>"circle" radius="20"</wandertype> <totame>1100</totame> </npc> |
|
From: <ri...@us...> - 2003-09-07 22:02:19
|
Update of /cvsroot/wpdev/xmlscripts/definitions/spawnregions In directory sc8-pr-cvs1:/tmp/cvs-serv31604/definitions/spawnregions Modified Files: graveyards.xml Log Message: npcs now can walk again :) Index: graveyards.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/spawnregions/graveyards.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** graveyards.xml 1 Jan 2003 19:34:35 -0000 1.3 --- graveyards.xml 7 Sep 2003 22:00:20 -0000 1.4 *************** *** 25,32 **** <mintime>10</mintime> <maxtime>30</maxtime> ! <!-- 3/4 headless, 1/4 skeleton --> <npcs> ! <npc mult="3">orc_weak</npc> ! <npc mult="1">orc_medium</npc> </npcs> --- 25,32 ---- <mintime>10</mintime> <maxtime>30</maxtime> ! <!-- 3/4 orc1, 1/4 orc2 --> <npcs> ! <npc mult="3">orc_1</npc> ! <npc mult="1">orc_2</npc> </npcs> |
|
From: <ri...@us...> - 2003-09-07 22:02:13
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/equipment In directory sc8-pr-cvs1:/tmp/cvs-serv31604/definitions/items/equipment Modified Files: clothes.xml Log Message: npcs now can walk again :) Index: clothes.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/equipment/clothes.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** clothes.xml 23 Aug 2003 22:05:24 -0000 1.6 --- clothes.xml 7 Sep 2003 22:00:15 -0000 1.7 *************** *** 13,16 **** --- 13,17 ---- <id>0x1515</id> <dye /> + <color><random list="COLORS_MISC" /></color> <buyprice>43</buyprice> <sellprice>21</sellprice> *************** *** 21,28 **** <item id="1530"> <inherit id="1515" /> <category>Clothes\Accessories\Cloak (W/E)</category> <id>0x1530</id> </item> ! <!-- Beads --> <item id="108b"> --- 22,30 ---- <item id="1530"> <inherit id="1515" /> + <color><random list="COLORS_MISC" /></color> <category>Clothes\Accessories\Cloak (W/E)</category> <id>0x1530</id> </item> ! <!-- Beads --> <item id="108b"> *************** *** 37,40 **** --- 39,43 ---- <item id="1516"> <inherit id="1531" /> + <color><random list="COLORS_MISC" /></color> <category>Clothes\Legs\Skirt (N/S)</category> <id>0x1516</id> *************** *** 46,49 **** --- 49,53 ---- <id>0x1517</id> <dye /> + <color><random list="COLORS_MISC" /></color> <buyprice>37</buyprice> <sellprice>18</sellprice> *************** *** 54,57 **** --- 58,62 ---- <item id="1518"> <inherit id="1517" /> + <color><random list="COLORS_MISC" /></color> <category>Clothes\Torso\Plain Shirt (W/E)</category> <id>0x1518</id> *************** *** 63,66 **** --- 68,72 ---- <id>0x152e</id> <dye /> + <color><random list="COLORS_MISC" /></color> <buyprice>24</buyprice> <sellprice>12</sellprice> *************** *** 71,74 **** --- 77,81 ---- <item id="152f"> <inherit id="152e" /> + <color><random list="COLORS_MISC" /></color> <category>Clothes\Legs\Short Pants (W/E)</category> <id>0x152f</id> *************** *** 80,88 **** <id>0x1531</id> <dye /> <buyprice>33</buyprice> <sellprice>16</sellprice> <weight>4.0</weight> </item> ! <!-- Gold Belt n/s --> <!-- Can't be equipped --> --- 87,96 ---- <id>0x1531</id> <dye /> + <color><random list="COLORS_MISC" /></color> <buyprice>33</buyprice> <sellprice>16</sellprice> <weight>4.0</weight> </item> ! <!-- Gold Belt n/s --> <!-- Can't be equipped --> *************** *** 104,107 **** --- 112,116 ---- <id>0x1537</id> <dye /> + <color><random list="COLORS_MISC" /></color> <buyprice>31</buyprice> <sellprice>15</sellprice> *************** *** 112,115 **** --- 121,125 ---- <item id="1538"> <inherit id="1537" /> + <color><random list="COLORS_MISC" /></color> <category>Clothes\Legs\Kilt (W/E)</category> <id>0x1538</id> *************** *** 121,124 **** --- 131,135 ---- <id>0x1539</id> <dye /> + <color><random list="COLORS_MISC" /></color> <buyprice>34</buyprice> <sellprice>17</sellprice> *************** *** 129,132 **** --- 140,144 ---- <item id="153a"> <inherit id="1539" /> + <color><random list="COLORS_MISC" /></color> <category>Clothes\Legs\Long Pants (W/E)</category> <id>0x153a</id> *************** *** 172,175 **** --- 184,188 ---- <id>0x153f</id> <dye /> + <color><random list="COLORS_MISC" /></color> <defense>0</defense> <requires type='str'>10</requires> *************** *** 184,187 **** --- 197,201 ---- <inherit id="153f" /> <id>0x1540</id> + <color><random list="COLORS_MISC" /></color> <category>Clothes\Headwear\Bandana (W/E)</category> </item> *************** *** 191,194 **** --- 205,209 ---- <category>Clothes\Accessories\Body Sash (N/S)</category> <id>0x1541</id> + <color><random list="COLORS_MISC" /></color> <dye /> </item> *************** *** 199,202 **** --- 214,218 ---- <category>Clothes\Accessories\Body Sash (W/E)</category> <id>0x1542</id> + <color><random list="COLORS_MISC" /></color> </item> *************** *** 206,209 **** --- 222,226 ---- <id>0x1543</id> <dye /> + <color><random list="COLORS_MISC" /></color> <defense>0</defense> <requires type='str'>10</requires> *************** *** 219,222 **** --- 236,240 ---- <category>Clothes\Headwear\Skull Cap (W/E)</category> <id>0x1544</id> + <color><random list="COLORS_MISC" /></color> </item> *************** *** 338,342 **** </item> ! <!-- Necklace --> <item id="1088"> <category>Clothes\Accessories\Necklace (Round)</category> --- 356,360 ---- </item> ! <!-- Necklace --> <item id="1088"> <category>Clothes\Accessories\Necklace (Round)</category> *************** *** 591,595 **** <weight>1.0</weight> </item> ! <!-- Jester Hat --> <item id="172e"> --- 609,613 ---- <weight>1.0</weight> </item> ! <!-- Jester Hat --> <item id="172e"> *************** *** 600,605 **** <durability><random min="20" max="25" /></durability> <requires type='str'>10</requires> ! </item> ! <!-- Fancy Shirt n/s --> <item id="1efd"> --- 618,623 ---- <durability><random min="20" max="25" /></durability> <requires type='str'>10</requires> ! </item> ! <!-- Fancy Shirt n/s --> <item id="1efd"> *************** *** 607,610 **** --- 625,629 ---- <category>Clothes\Torso\Fancy Shirt (N/S)</category> <dye /> + <color><random list="COLORS_MISC" /></color> <buyprice>55</buyprice> <sellprice>27</sellprice> *************** *** 617,620 **** --- 636,640 ---- <category>Clothes\Torso\Fancy Shirt (W/E)</category> <id>0x1efe</id> + <color><random list="COLORS_MISC" /></color> </item> *************** *** 624,627 **** --- 644,648 ---- <id>0x1eff</id> <dye /> + <color><random list="COLORS_MISC" /></color> <buyprice>25</buyprice> <sellprice>12</sellprice> *************** *** 634,637 **** --- 655,659 ---- <category>Clothes\Torso\Fancy Dress (N/S)</category> <id>0x1f00</id> + <color><random list="COLORS_MISC" /></color> </item> *************** *** 641,644 **** --- 663,667 ---- <id>0x1f01</id> <dye /> + <color><random list="COLORS_MISC" /></color> <buyprice>56</buyprice> <sellprice>28</sellprice> *************** *** 647,654 **** <!-- Plain Dress w/e --> ! <item id="1f02"> <inherit id="1f01" /> <category>Clothes\Torso\Plain Dress (W/E)</category> <id>0x1f02</id> </item> --- 670,678 ---- <!-- Plain Dress w/e --> ! <item id="1f02"> <inherit id="1f01" /> <category>Clothes\Torso\Plain Dress (W/E)</category> <id>0x1f02</id> + <color><random list="COLORS_MISC" /></color> </item> *************** *** 658,666 **** <id>0x1f03</id> <dye /> <buyprice>68</buyprice> <sellprice>34</sellprice> <weight>3.0</weight> </item> ! <!-- Robe w/e --> <item id="1f04"> --- 682,691 ---- <id>0x1f03</id> <dye /> + <color><random list="COLORS_MISC" /></color> <buyprice>68</buyprice> <sellprice>34</sellprice> <weight>3.0</weight> </item> ! <!-- Robe w/e --> <item id="1f04"> *************** *** 668,673 **** <category>Clothes\Torso\Robe (W/E)</category> <id>0x1f04</id> </item> ! <!-- Jester Suit n/s --> <item id="1f9f"> --- 693,699 ---- <category>Clothes\Torso\Robe (W/E)</category> <id>0x1f04</id> + <color><random list="COLORS_MISC" /></color> </item> ! <!-- Jester Suit n/s --> <item id="1f9f"> *************** *** 681,685 **** <!-- Jester Suit w/e --> ! <item id="1fa0"> <inherit id="1f9f" /> <category>Clothes\Torso\Jester Suit (W/E)</category> --- 707,711 ---- <!-- Jester Suit w/e --> ! <item id="1fa0"> <inherit id="1f9f" /> <category>Clothes\Torso\Jester Suit (W/E)</category> *************** *** 692,695 **** --- 718,722 ---- <id>0x1fa1</id> <dye /> + <color><random list="COLORS_MISC" /></color> <buyprice>33</buyprice> <sellprice>16</sellprice> *************** *** 702,705 **** --- 729,733 ---- <category>Clothes\Torso\Tunic (W/E)</category> <id>0x1fa2</id> + <color><random list="COLORS_MISC" /></color> </item> *************** *** 708,712 **** <category>Clothes\Torso\Doublet (N/S)</category> <id>0x1f7b</id> ! <dye /> <buyprice>25</buyprice> <sellprice>12</sellprice> --- 736,741 ---- <category>Clothes\Torso\Doublet (N/S)</category> <id>0x1f7b</id> ! <dye /> ! <color><random list="COLORS_MISC" /></color> <buyprice>25</buyprice> <sellprice>12</sellprice> *************** *** 719,724 **** <category>Clothes\Torso\Doublet (W/E)</category> <id>0x1f7c</id> ! </item> ! <!-- Surcoat n/s --> <item id="1ffd"> --- 748,754 ---- <category>Clothes\Torso\Doublet (W/E)</category> <id>0x1f7c</id> ! <color><random list="COLORS_MISC" /></color> ! </item> ! <!-- Surcoat n/s --> <item id="1ffd"> *************** *** 726,729 **** --- 756,760 ---- <id>0x1ffd</id> <dye /> + <color><random list="COLORS_MISC" /></color> </item> *************** *** 733,742 **** <category>Clothes\Torso\Surcoat (W/E)</category> <id>0x1ffe</id> </item> ! <!-- Lord British --> <item id="2042"> <category>Clothes\Special\Lord British</category> ! <id>0x2042</id> </item> --- 764,774 ---- <category>Clothes\Torso\Surcoat (W/E)</category> <id>0x1ffe</id> + <color><random list="COLORS_MISC" /></color> </item> ! <!-- Lord British --> <item id="2042"> <category>Clothes\Special\Lord British</category> ! <id>0x2042</id> </item> *************** *** 744,750 **** <item id="2043"> <category>Clothes\Special\Lord Blackthorne</category> ! <id>0x2043</id> ! </item> ! <!-- Death Shroud --> <item id="204e"> --- 776,782 ---- <item id="2043"> <category>Clothes\Special\Lord Blackthorne</category> ! <id>0x2043</id> ! </item> ! <!-- Death Shroud --> <item id="204e"> |
|
From: <ri...@us...> - 2003-09-07 22:02:13
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/animals In directory sc8-pr-cvs1:/tmp/cvs-serv31604/definitions/npcs/animals Modified Files: base.xml Log Message: npcs now can walk again :) Index: base.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/animals/base.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** base.xml 31 Dec 2002 15:14:28 -0000 1.1 --- base.xml 7 Sep 2003 22:00:17 -0000 1.2 *************** *** 10,14 **** <!-- animal_base --> <npc id="animal_base"> ! <npcwander type="circle" radius="20" /> <direction><random min="0" max="7" /></direction> </npc> --- 10,14 ---- <!-- animal_base --> <npc id="animal_base"> ! <wandertype>1</wandertype> <direction><random min="0" max="7" /></direction> </npc> |