wpdev-commits Mailing List for Wolfpack Emu (Page 56)
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: Sebastian H. <dar...@us...> - 2004-08-31 15:18:44
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14700 Modified Files: basechar.cpp basechar.h walking.cpp walking.h Log Message: Exchanged runningSteps property with a running boolean property. Index: walking.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/walking.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** walking.h 3 Jun 2004 14:43:00 -0000 1.27 --- walking.h 31 Aug 2004 15:18:25 -0000 1.28 *************** *** 65,69 **** bool checkObstacles( P_CHAR pChar, const Coord_cl& newPos, bool running ); bool verifySequence( cUOSocket* socket, Q_UINT8 sequence ) throw(); - void checkRunning( cUOSocket*, P_CHAR, Q_UINT8 ); void checkStealth( P_CHAR ); void sendWalkToOther( P_PLAYER pChar, P_CHAR pWalker, const Coord_cl& oldpos ); --- 65,68 ---- Index: walking.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** walking.cpp 29 Aug 2004 20:40:50 -0000 1.141 --- walking.cpp 31 Aug 2004 15:18:25 -0000 1.142 *************** *** 470,473 **** --- 470,475 ---- dir = dir & 0x7F; // Remove the running flag + pChar->setRunning(running); + bool turning = dir != pChar->direction(); *************** *** 623,645 **** } - // This only gets called when running - void cMovement::checkRunning( cUOSocket* socket, P_CHAR pChar, Q_UINT8 /*dir*/ ) - { - // Don't regenerate stamina while running - pChar->setRegenStaminaTime( ( uint )( Server::instance()->time() + floor( pChar->getStaminaRate() * 1000 ) ) ); - pChar->setRunningSteps( pChar->runningSteps() + 1 ); - - // If we're running on our feet, check for stamina loss - // Crap - if ( !pChar->isDead() && !pChar->atLayer( cBaseChar::Mount ) && pChar->runningSteps() > ( Config::instance()->runningStamSteps() ) * 2 ) - { - // The *2 it's because i noticed that a step(animation) correspond to 2 walking calls - // ^^ WTF? - pChar->setRunningSteps( 0 ); - pChar->setStamina( pChar->stamina() - 1 ); - socket->updateStamina(); - } - } - void cMovement::checkStealth( P_CHAR pChar ) { --- 625,628 ---- Index: basechar.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** basechar.cpp 31 Aug 2004 14:04:53 -0000 1.138 --- basechar.cpp 31 Aug 2004 15:18:25 -0000 1.139 *************** *** 92,96 **** creationDate_ = QDateTime::currentDateTime(); stealthedSteps_ = 0; ! runningSteps_ = 0; murdererTime_ = 0; criminalTime_ = 0; --- 92,96 ---- creationDate_ = QDateTime::currentDateTime(); stealthedSteps_ = 0; ! running_ = false; murdererTime_ = 0; criminalTime_ = 0; *************** *** 1632,1639 **** SET_INT_PROPERTY( "stealthedsteps", stealthedSteps_ ) /* ! \property char.runningsteps This integer property indicates how many steps the character is running so far. */ ! else ! SET_INT_PROPERTY( "runningsteps", runningSteps_ ) /* \property char.tamed This boolean property indicates whether the character is tamed or not. --- 1632,1641 ---- SET_INT_PROPERTY( "stealthedsteps", stealthedSteps_ ) /* ! \property char.running This boolean property indicates whether this character was running when he made his last step. */ ! else if (name == "running") { ! setRunning( value.toInt() != 0 ); ! return 0; ! } /* \property char.tamed This boolean property indicates whether the character is tamed or not. *************** *** 1985,1989 **** PY_PROPERTY( "creationdate", creationDate_.toString() ) PY_PROPERTY( "stealthedsteps", stealthedSteps_ ) ! PY_PROPERTY( "runningsteps", runningSteps_ ) PY_PROPERTY( "tamed", isTamed() ) PY_PROPERTY( "guarding", guarding_ ) --- 1987,1991 ---- PY_PROPERTY( "creationdate", creationDate_.toString() ) PY_PROPERTY( "stealthedsteps", stealthedSteps_ ) ! PY_PROPERTY( "running", running_ ) PY_PROPERTY( "tamed", isTamed() ) PY_PROPERTY( "guarding", guarding_ ) Index: basechar.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** basechar.h 29 Aug 2004 20:40:50 -0000 1.82 --- basechar.h 31 Aug 2004 15:18:25 -0000 1.83 *************** *** 390,394 **** uint regenManaTime() const; cTerritory* region() const; ! uint runningSteps() const; ushort saycolor() const; uint skillDelay() const; --- 390,394 ---- uint regenManaTime() const; cTerritory* region() const; ! bool running() const; ushort saycolor() const; uint skillDelay() const; *************** *** 472,476 **** void setRegenManaTime( uint data ); void setRegion( cTerritory* data ); ! void setRunningSteps( uint data ); void setSaycolor( ushort data ); void setSkillDelay( uint data ); --- 472,476 ---- void setRegenManaTime( uint data ); void setRegion( cTerritory* data ); ! void setRunning( bool data ); void setSaycolor( ushort data ); void setSkillDelay( uint data ); *************** *** 782,786 **** // Saves the number of steps the char ran. ! uint runningSteps_; // Time, till murderer flag disappears. cOldChar::murderrate_ --- 782,786 ---- // Saves the number of steps the char ran. ! bool running_; // Time, till murderer flag disappears. cOldChar::murderrate_ *************** *** 1179,1190 **** } ! inline uint cBaseChar::runningSteps() const { ! return runningSteps_; } ! inline void cBaseChar::setRunningSteps( uint data ) { ! runningSteps_ = data; } --- 1179,1190 ---- } ! inline bool cBaseChar::running() const { ! return running_; } ! inline void cBaseChar::setRunning( bool data ) { ! running_ = data; } |
From: Sebastian H. <dar...@us...> - 2004-08-31 15:18:44
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14700/network Modified Files: uotxpackets.cpp Log Message: Exchanged runningSteps property with a running boolean property. Index: uotxpackets.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uotxpackets.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** uotxpackets.cpp 13 Aug 2004 08:55:27 -0000 1.101 --- uotxpackets.cpp 31 Aug 2004 15:18:25 -0000 1.102 *************** *** 168,172 **** setSerial( pChar->serial() ); ! setDirection( pChar->direction() ); setX( pChar->pos().x ); setY( pChar->pos().y ); --- 168,172 ---- setSerial( pChar->serial() ); ! setDirection( pChar->running() ? (pChar->direction() | 0x80) : pChar->direction() ); setX( pChar->pos().x ); setY( pChar->pos().y ); *************** *** 247,251 **** { setCoord( pChar->pos() ); ! setDirection( pChar->direction() ); } --- 247,251 ---- { setCoord( pChar->pos() ); ! setDirection( pChar->running() ? (pChar->direction() | 0x80) : pChar->direction() ); } *************** *** 278,282 **** // If he's runningSteps we need to take that into account here // ->runningSteps() is greater than zero in that case ! setDirection( pChar->runningSteps() ? pChar->direction() | 0x80 : pChar->direction() ); setFlag( 0 ); --- 278,282 ---- // If he's runningSteps we need to take that into account here // ->runningSteps() is greater than zero in that case ! setDirection( pChar->running() ? (pChar->direction() | 0x80) : pChar->direction() ); setFlag( 0 ); *************** *** 342,346 **** setY( pChar->pos().y ); setZ( pChar->pos().z ); ! setDirection( pChar->direction() ); setFlag( 0 ); --- 342,346 ---- setY( pChar->pos().y ); setZ( pChar->pos().z ); ! setDirection( pChar->running() ? (pChar->direction() | 0x80) : pChar->direction() ); setFlag( 0 ); *************** *** 452,456 **** setY( pChar->pos().y ); setZ( pChar->pos().z ); ! setDirection( pChar->direction() ); //void setFlags( unsigned char data ) { rawPacket[ 10 ] = data; } // // 10 = 0=normal, 4=poison, 9 = invul,0x40=attack, 0x80=hidden CHARMODE_WAR } --- 452,456 ---- setY( pChar->pos().y ); setZ( pChar->pos().z ); ! setDirection( pChar->running() ? (pChar->direction() | 0x80) : pChar->direction() ); //void setFlags( unsigned char data ) { rawPacket[ 10 ] = data; } // // 10 = 0=normal, 4=poison, 9 = invul,0x40=attack, 0x80=hidden CHARMODE_WAR } |
From: Sebastian H. <dar...@us...> - 2004-08-31 14:09:02
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1639 Modified Files: player.cpp Log Message: Another basescripts and memory leak bugfix. Index: player.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** player.cpp 31 Aug 2004 14:05:04 -0000 1.124 --- player.cpp 31 Aug 2004 14:08:50 -0000 1.125 *************** *** 1667,1674 **** if ( events & EventTime ) { ! if ( cPythonScript::canChainHandleEvent( EVENT_TIMECHANGE, scriptChain ) ) { PyObject* args = Py_BuildValue( "(N)", getPyObject() ); ! cPythonScript::callChainedEventHandler( EVENT_TIMECHANGE, scriptChain, args ); } } --- 1667,1675 ---- if ( events & EventTime ) { ! if ( canHandleEvent( EVENT_TIMECHANGE ) ) { PyObject* args = Py_BuildValue( "(N)", getPyObject() ); ! callEventHandler( EVENT_TIMECHANGE, args ); ! Py_DECREF(args); } } |
From: Sebastian H. <dar...@us...> - 2004-08-31 14:05:21
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv955 Modified Files: basechar.cpp items.cpp player.cpp Log Message: More fixes for basescripts event handlers. Index: player.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** player.cpp 29 Aug 2004 20:40:50 -0000 1.123 --- player.cpp 31 Aug 2004 14:05:04 -0000 1.124 *************** *** 942,957 **** bool cPlayer::onTradeStart( P_PLAYER partner, P_ITEM firstitem ) { - cPythonScript* global = ScriptManager::instance()->getGlobalHook( EVENT_TRADESTART ); bool result = false; ! if ( scriptChain || global ) ! { PyObject* args = Py_BuildValue( "(O&O&O&)", PyGetCharObject, this, PyGetCharObject, partner, PyGetItemObject, firstitem ); ! ! result = cPythonScript::callChainedEventHandler( EVENT_TRADESTART, scriptChain, args ); ! ! if ( !result && global ) ! result = global->callEventHandler( EVENT_TRADESTART, args ); ! Py_DECREF( args ); } --- 942,950 ---- bool cPlayer::onTradeStart( P_PLAYER partner, P_ITEM firstitem ) { bool result = false; ! if (canHandleEvent(EVENT_TRADESTART)) { PyObject* args = Py_BuildValue( "(O&O&O&)", PyGetCharObject, this, PyGetCharObject, partner, PyGetItemObject, firstitem ); ! result = callEventHandler( EVENT_TRADESTART, args ); Py_DECREF( args ); } *************** *** 962,976 **** bool cPlayer::onTrade( unsigned int type, unsigned int buttonstate, SERIAL itemserial ) { - cPythonScript* global = ScriptManager::instance()->getGlobalHook( EVENT_TRADE ); bool result = false; ! if ( scriptChain || global ) { PyObject* args = Py_BuildValue( "(O&iii)", PyGetCharObject, this, type, buttonstate, itemserial ); ! result = cPythonScript::callChainedEventHandler( EVENT_TRADE, scriptChain, args ); ! ! if ( !result && global ) ! result = global->callEventHandler( EVENT_TRADE, args ); Py_DECREF( args ); --- 955,965 ---- bool cPlayer::onTrade( unsigned int type, unsigned int buttonstate, SERIAL itemserial ) { bool result = false; ! if ( canHandleEvent(EVENT_TRADE) ) { PyObject* args = Py_BuildValue( "(O&iii)", PyGetCharObject, this, type, buttonstate, itemserial ); ! result = callEventHandler(EVENT_TRADE, args ); Py_DECREF( args ); *************** *** 983,991 **** bool result = false; ! if ( scriptChain ) { PyObject* args = Py_BuildValue( "O&O&", PyGetCharObject, this, PyGetItemObject, pItem ); ! result = cPythonScript::callChainedEventHandler( EVENT_PICKUP, scriptChain, args ); Py_DECREF( args ); --- 972,980 ---- bool result = false; ! if ( canHandleEvent(EVENT_PICKUP) ) { PyObject* args = Py_BuildValue( "O&O&", PyGetCharObject, this, PyGetItemObject, pItem ); ! result = callEventHandler( EVENT_PICKUP, args ); Py_DECREF( args ); *************** *** 997,1012 **** bool cPlayer::onLogin( void ) { - cPythonScript* global = ScriptManager::instance()->getGlobalHook( EVENT_LOGIN ); bool result = false; ! if ( scriptChain || global ) { PyObject* args = Py_BuildValue( "(O&)", PyGetCharObject, this ); ! ! result = cPythonScript::callChainedEventHandler( EVENT_LOGIN, scriptChain, args ); ! ! if ( !result && global ) ! result = global->callEventHandler( EVENT_LOGIN, args ); ! Py_DECREF( args ); } --- 986,995 ---- bool cPlayer::onLogin( void ) { bool result = false; ! if ( canHandleEvent( EVENT_LOGIN ) ) { PyObject* args = Py_BuildValue( "(O&)", PyGetCharObject, this ); ! result = callEventHandler( EVENT_LOGIN, args ); Py_DECREF( args ); } *************** *** 1017,1032 **** bool cPlayer::onCastSpell( unsigned int spell ) { - cPythonScript* global = ScriptManager::instance()->getGlobalHook( EVENT_CASTSPELL ); bool result = false; ! if ( scriptChain || global ) { PyObject* args = Py_BuildValue( "O&i", PyGetCharObject, this, spell ); ! ! result = cPythonScript::callChainedEventHandler( EVENT_CASTSPELL, scriptChain, args ); ! ! if ( !result && global ) ! result = global->callEventHandler( EVENT_CASTSPELL, args ); ! Py_DECREF( args ); } --- 1000,1009 ---- bool cPlayer::onCastSpell( unsigned int spell ) { bool result = false; ! if ( canHandleEvent( EVENT_CASTSPELL ) ) { PyObject* args = Py_BuildValue( "O&i", PyGetCharObject, this, spell ); ! result = callEventHandler( EVENT_CASTSPELL, args ); Py_DECREF( args ); } *************** *** 1037,1052 **** bool cPlayer::onLogout( void ) { - cPythonScript* global = ScriptManager::instance()->getGlobalHook( EVENT_LOGOUT ); bool result = false; ! if ( scriptChain || global ) { PyObject* args = Py_BuildValue( "(O&)", PyGetCharObject, this ); ! ! result = cPythonScript::callChainedEventHandler( EVENT_LOGOUT, scriptChain, args ); ! ! if ( !result && global ) ! result = global->callEventHandler( EVENT_LOGOUT, args ); ! Py_DECREF( args ); } --- 1014,1023 ---- bool cPlayer::onLogout( void ) { bool result = false; ! if ( canHandleEvent( EVENT_LOGOUT ) ) { PyObject* args = Py_BuildValue( "(O&)", PyGetCharObject, this ); ! result = callEventHandler( EVENT_LOGOUT, args ); Py_DECREF( args ); } *************** *** 1058,1072 **** bool cPlayer::onHelp( void ) { - cPythonScript* global = ScriptManager::instance()->getGlobalHook( EVENT_HELP ); bool result = false; ! if ( scriptChain || global ) { PyObject* args = Py_BuildValue( "(O&)", PyGetCharObject, this ); ! result = cPythonScript::callChainedEventHandler( EVENT_HELP, scriptChain, args ); ! ! if ( !result && global ) ! result = global->callEventHandler( EVENT_HELP, args ); Py_DECREF( args ); --- 1029,1039 ---- bool cPlayer::onHelp( void ) { bool result = false; ! if ( canHandleEvent(EVENT_HELP) ) { PyObject* args = Py_BuildValue( "(O&)", PyGetCharObject, this ); ! result = callEventHandler( EVENT_HELP, args ); Py_DECREF( args ); *************** *** 1079,1094 **** bool cPlayer::onChat( void ) { - cPythonScript* global = ScriptManager::instance()->getGlobalHook( EVENT_CHAT ); bool result = false; ! if ( scriptChain || global ) { PyObject* args = Py_BuildValue( "(O&)", PyGetCharObject, this ); ! ! result = cPythonScript::callChainedEventHandler( EVENT_CHAT, scriptChain, args ); ! ! if ( !result && global ) ! result = global->callEventHandler( EVENT_CHAT, args ); ! Py_DECREF( args ); } --- 1046,1055 ---- bool cPlayer::onChat( void ) { bool result = false; ! if ( canHandleEvent( EVENT_CHAT ) ) { PyObject* args = Py_BuildValue( "(O&)", PyGetCharObject, this ); ! result = callEventHandler( EVENT_CHAT, args ); Py_DECREF( args ); } *************** *** 1101,1108 **** bool result = false; ! if ( scriptChain ) { PyObject* args = Py_BuildValue( "O&O&", PyGetCharObject, this, PyGetItemObject, pItem ); ! result = cPythonScript::callChainedEventHandler( EVENT_USE, scriptChain, args ); Py_DECREF( args ); } --- 1062,1069 ---- bool result = false; ! if ( canHandleEvent(EVENT_USE) ) { PyObject* args = Py_BuildValue( "O&O&", PyGetCharObject, this, PyGetItemObject, pItem ); ! result = callEventHandler( EVENT_USE, args ); Py_DECREF( args ); } Index: items.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v retrieving revision 1.444 retrieving revision 1.445 diff -C2 -d -r1.444 -r1.445 *** items.cpp 29 Aug 2004 16:44:39 -0000 1.444 --- items.cpp 31 Aug 2004 14:04:53 -0000 1.445 *************** *** 527,534 **** } ! if ( cPythonScript::canChainHandleEvent( EVENT_DELETE, scriptChain ) ) { PyObject* args = Py_BuildValue( "(N)", getPyObject() ); ! cPythonScript::callChainedEventHandler( EVENT_DELETE, scriptChain, args ); Py_DECREF( args ); } --- 527,534 ---- } ! if ( canHandleEvent( EVENT_DELETE ) ) { PyObject* args = Py_BuildValue( "(N)", getPyObject() ); ! callEventHandler( EVENT_DELETE, args ); Py_DECREF( args ); } Index: basechar.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** basechar.cpp 29 Aug 2004 20:40:50 -0000 1.137 --- basechar.cpp 31 Aug 2004 14:04:53 -0000 1.138 *************** *** 3368,3374 **** // Call the onDelete event. ! PyObject* args = Py_BuildValue( "(N)", getPyObject() ); ! cPythonScript::callChainedEventHandler( EVENT_DELETE, scriptChain, args ); ! Py_DECREF( args ); removeFromView( false ); --- 3368,3376 ---- // Call the onDelete event. ! if (canHandleEvent(EVENT_DELETE)) { ! PyObject* args = Py_BuildValue( "(N)", getPyObject() ); ! callEventHandler( EVENT_DELETE, args ); ! Py_DECREF( args ); ! } removeFromView( false ); |
From: Sebastian H. <dar...@us...> - 2004-08-31 14:05:20
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv955/network Modified Files: uosocket.cpp Log Message: More fixes for basescripts event handlers. Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.402 retrieving revision 1.403 diff -C2 -d -r1.402 -r1.403 *** uosocket.cpp 31 Aug 2004 00:16:14 -0000 1.402 --- uosocket.cpp 31 Aug 2004 14:05:05 -0000 1.403 *************** *** 3026,3035 **** void cUOSocket::handleChat( cUOPacket* packet ) { ! if ( _player->canHandleEvent( EVENT_CHAT ) ) ! { ! PyObject* args = Py_BuildValue( "(N)", _player->getPyObject() ); ! _player->callEventHandler(EVENT_CHAT, args); ! Py_DECREF( args ); ! } } --- 3026,3030 ---- void cUOSocket::handleChat( cUOPacket* packet ) { ! _player->onChat(); } |
From: Sebastian H. <dar...@us...> - 2004-08-31 13:50:07
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30749 Modified Files: ChangeLog Log Message: Fixed an issue with account names being saved incorrectly. Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ChangeLog 29 Aug 2004 20:42:25 -0000 1.16 --- ChangeLog 31 Aug 2004 13:49:53 -0000 1.17 *************** *** 32,35 **** --- 32,36 ---- - Overweight prevents walking now. - Walking is denied if stamina is 0. + - Fixed an issue with account names containing foreign characters on save. Wolfpack 12.9.8 Beta (19. August 2004) |
From: Sebastian H. <dar...@us...> - 2004-08-31 13:47:49
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30360 Modified Files: accounts.cpp Log Message: Fixed an issue with account names being saved incorrectly. Index: accounts.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** accounts.cpp 31 Aug 2004 01:09:51 -0000 1.101 --- accounts.cpp 31 Aug 2004 13:47:36 -0000 1.102 *************** *** 367,374 **** QString sql( "REPLACE INTO accounts VALUES( '%1', '%2', %3, '%4', %5, %6, '%7' );" ); ! sql = sql.arg( account->login_.lower() ) ! .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 ) --- 367,374 ---- QString sql( "REPLACE INTO accounts VALUES( '%1', '%2', %3, '%4', %5, %6, '%7' );" ); ! sql = sql.arg( PersistentBroker::instance()->quoteString(account->login_) ) ! .arg( PersistentBroker::instance()->quoteString(account->password_) ) .arg( account->flags_ ) ! .arg( PersistentBroker::instance()->quoteString(account->aclName_) ) .arg( !account->lastLogin_.isNull() ? account->lastLogin_.toTime_t() : 0 ) .arg( !account->blockUntil.isNull() ? account->blockUntil.toTime_t() : 0 ) |
From: Sebastian H. <dar...@us...> - 2004-08-31 13:07:03
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21835/python Modified Files: global.cpp Log Message: Some fixes for accounts. Index: global.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v retrieving revision 1.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** global.cpp 31 Aug 2004 00:54:32 -0000 1.150 --- global.cpp 31 Aug 2004 13:06:45 -0000 1.151 *************** *** 142,151 **** char loglevel; ! char* text; ! if ( !PyArg_ParseTuple( args, "bs:wolfpack.console.log( loglevel, text )", &loglevel, &text ) ) return 0; ! Console::instance()->log( ( eLogLevel ) loglevel, text ); Py_RETURN_TRUE; --- 142,151 ---- char loglevel; ! PyObject *text; ! if ( !PyArg_ParseTuple( args, "bO:wolfpack.console.log( loglevel, text )", &loglevel, &text ) ) return 0; ! Console::instance()->log( ( eLogLevel ) loglevel, Python2QString(text) ); Py_RETURN_TRUE; *************** *** 1902,1908 **** while ( it != Accounts::instance()->end() ) { ! QString login = ( *it )->login(); ! if ( login != QString::null ) ! PyList_Append( list, PyString_FromString( login.latin1() ) ); ++it; } --- 1902,1908 ---- while ( it != Accounts::instance()->end() ) { ! const QString &login = ( *it )->login(); ! if ( !login.isNull() ) ! PyList_Append( list, QString2Python( login ) ); ++it; } |
From: Richard M. <dr...@us...> - 2004-08-31 01:55:57
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10706/skills Modified Files: hiding.py Log Message: Fix for hiding after an invis spell. Index: hiding.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/hiding.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** hiding.py 16 Jul 2004 07:09:27 -0000 1.11 --- hiding.py 31 Aug 2004 01:55:37 -0000 1.12 *************** *** 32,35 **** --- 32,36 ---- char.hidden = 1 char.update() + char.dispel( None, 1, "invisibility_reveal" ) else: char.socket.clilocmessage( 501237, "", 0x3b2, 4, char ) |
From: Richard M. <dr...@us...> - 2004-08-31 01:48:54
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9645 Modified Files: equipment.py Log Message: Equiping by double clicking should now update stats. Index: equipment.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/equipment.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** equipment.py 29 Aug 2004 16:36:38 -0000 1.30 --- equipment.py 31 Aug 2004 01:48:43 -0000 1.31 *************** *** 341,348 **** tile = wolfpack.tiledata(item.id) ! if not tile.has_key('layer'): return 0 ! layer = tile['layer'] --- 341,348 ---- tile = wolfpack.tiledata(item.id) ! if not tile.has_key('layer'): return 0 ! layer = tile['layer'] *************** *** 385,388 **** --- 385,389 ---- item.update() item.soundeffect(0x57) + player.updatestats() for script in scripts[scripts.index("equipment")+1:]: |
From: Sebastian H. <dar...@us...> - 2004-08-31 01:10:02
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3581 Modified Files: accounts.cpp Log Message: rawpassword property Index: accounts.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** accounts.cpp 22 Aug 2004 15:12:34 -0000 1.100 --- accounts.cpp 31 Aug 2004 01:09:51 -0000 1.101 *************** *** 605,608 **** --- 605,609 ---- PY_PROPERTY("multigems", isMultiGems() ); PY_PROPERTY("password", password()); + PY_PROPERTY("rawpassword", password()); PY_PROPERTY("flags", flags()); /* *************** *** 653,656 **** --- 654,666 ---- } /* + \property account.rawpassword If you use MD5 hashing this property is the hashed password and no + conversions will be done automatically if you set this property. If you don't use MD5 hashing, + this property is equivalent to the password property. + */ + else if (name == "rawpassword") { + password_ = value.toString(); + return 0; + } + /* \property account.flags This property provides direct access to the flags of this account. Possible flags are: |
From: Richard M. <dr...@us...> - 2004-08-31 01:02:07
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2227 Modified Files: scripts.xml Log Message: Removed my crappy script. Index: scripts.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/scripts.xml,v retrieving revision 1.157 retrieving revision 1.158 diff -C2 -d -r1.157 -r1.158 *** scripts.xml 23 Aug 2004 03:11:10 -0000 1.157 --- scripts.xml 31 Aug 2004 01:01:42 -0000 1.158 *************** *** 176,180 **** <!-- <script>system.mysql_backup_db</script> ! <script>system.mysql_optimize_db</script> --> <script>system.players</script> --- 176,180 ---- <!-- <script>system.mysql_backup_db</script> ! --> <script>system.players</script> |
From: Richard M. <dr...@us...> - 2004-08-31 01:00:06
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1869 Removed Files: mysql_optimize_db.py Log Message: We should really just have an optimize/save ratio in the settings for this... --- mysql_optimize_db.py DELETED --- |
From: Richard M. <dr...@us...> - 2004-08-31 00:56:37
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1526 Modified Files: COPYRIGHT Log Message: Update Index: COPYRIGHT =================================================================== RCS file: /cvsroot/wpdev/wolfpack/COPYRIGHT,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** COPYRIGHT 12 Aug 2004 18:39:56 -0000 1.3 --- COPYRIGHT 31 Aug 2004 00:56:26 -0000 1.4 *************** *** 11,14 **** --- 11,16 ---- your name to this list. This is for both the core code and the scripts. + Last, First (Alias) :: Email + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Identified Contributers: *************** *** 37,38 **** --- 39,42 ---- Unknown (Kid_Sk8) Unknown (Incanus) + Unknown (spddmn) + |
From: Richard M. <dr...@us...> - 2004-08-31 00:55:37
|
Update of /cvsroot/wpdev/xmlscripts/scripts/speech In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1349/scripts/speech Modified Files: pets.py Log Message: great fix/improvement by spddmn. :) Index: pets.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/speech/pets.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** pets.py 25 Aug 2004 17:03:06 -0000 1.15 --- pets.py 31 Aug 2004 00:55:25 -0000 1.16 *************** *** 12,21 **** def stopfight(pet): ! if pet.attacktarget: ! pet.attacktarget = None ! if pet.war: ! pet.war = 0 ! pet.updateflags() def come(char, pet, all=0): --- 12,23 ---- def stopfight(pet): ! pet.attacktarget = None ! pet.war = 0 ! pet.updateflags() ! def startfight(pet, targetchar): ! pet.attacktarget = targetchar ! pet.war = 1 ! pet.updateflags() def come(char, pet, all=0): *************** *** 43,47 **** for follower in char.followers: follow_me(char, follower, 0) ! elif pet and pet.owner == char and pet.distanceto(char) < 18: stopfight(pet) pet.follow(char) --- 45,49 ---- for follower in char.followers: follow_me(char, follower, 0) ! if pet and pet.owner == char and pet.distanceto(char) < 18: stopfight(pet) pet.follow(char) *************** *** 52,60 **** if all: for follower in char.followers: ! if follower.distanceto(char) < 18: ! stopfight(follower) ! follower.guarding = None ! follower.goto(target.pos) ! follower.sound(SND_ATTACK) else: pet = wolfpack.findchar(pet) --- 54,58 ---- if all: for follower in char.followers: ! go_target(char, [follower.serial, 0], target) else: pet = wolfpack.findchar(pet) *************** *** 66,75 **** def go(char, pet, all=0): ! char.socket.sysmessage('Please select a destination?') char.socket.attachtarget("speech.pets.go_target", [pet.serial, all]) def attack_target(char, arguments, target): if not target.char or target.char == char: ! char.socket.sysmessage('Your pets can''t attack that.') return --- 64,73 ---- def go(char, pet, all=0): ! char.socket.sysmessage('Please select a destination.') char.socket.attachtarget("speech.pets.go_target", [pet.serial, all]) def attack_target(char, arguments, target): if not target.char or target.char == char: ! char.socket.sysmessage('Your pets cannot attack that.') return *************** *** 77,86 **** if all: for follower in char.followers: ! follower.fight(target.char) ! follower.sound(SND_ATTACK) else: pet = wolfpack.findchar(pet) if pet and pet.owner == char and pet.distanceto(char) < 18: pet.fight(target.char) pet.sound(SND_ATTACK) --- 75,94 ---- if all: for follower in char.followers: ! attack_target(char, [follower.serial, 0], target) else: pet = wolfpack.findchar(pet) + if target.char == pet: + char.socket.sysmessage('Your pet refuses to kill itself.') + return if pet and pet.owner == char and pet.distanceto(char) < 18: + startfight(pet, target.char) pet.fight(target.char) + + # right here we need to not interrupt the target, but i cant register a fight unless i do, right? not sure. + target.char.fight(pet) + target.char.follow(pet) + + go_target(char, arguments, target) + follow_target(char, arguments, target) pet.sound(SND_ATTACK) *************** *** 121,141 **** (pet, all) = arguments if all: for follower in char.followers: ! if follower.distanceto(char) < 18: ! stopfight(follower) ! follower.guarding = None ! follower.follow(target.char) ! follower.sound(SND_ATTACK) ! else: ! pet = wolfpack.findchar(pet) ! if pet and pet.owner == char and pet.distanceto(char) < 18: ! stopfight(pet) ! pet.guarding = None ! pet.follow(target.char) ! pet.sound(SND_ATTACK) def follow(char, pet, all=0): ! char.socket.sysmessage('Who do you want your pet to follow?') char.socket.attachtarget("speech.pets.follow_target", [pet.serial, all]) --- 129,148 ---- (pet, all) = arguments + pet = wolfpack.findchar(pet) if all: for follower in char.followers: ! go_target(char, [follower.serial, 0], target) ! elif pet and pet.owner == char and pet.distanceto(char) < 18: ! #char.socket.sysmessage('Pet following:' + str(target.char.serial)) ! pet.guarding = None ! pet.follow(target.char) ! pet.sound(SND_ATTACK) def follow(char, pet, all=0): ! if all == 1: ! char.socket.sysmessage('Who do you want your pets to follow?') ! else: ! char.socket.sysmessage('Who do you want your pet to follow?') ! char.socket.attachtarget("speech.pets.follow_target", [pet.serial, all]) *************** *** 156,247 **** return 0 ! # Check if the pet is owned by char if ( not pet.owner or pet.owner != char ) and not char.gm: return 0 # Check for keywords ! checkname = not text.startswith('all ') ! text = text.lower() ! ! # for all* commands we dont need to check for the name ! if not checkname: ! for keyword in keywords: ! if (keyword >= 356 and keyword <= 364) or keyword == 368: ! checkname = 0 ! ! # Check if we are mean't by this command ! if checkname: ! if not text.startswith(pet.name.lower() + " "): ! return 0 ! ! # Come (341) ! if 341 in keywords: ! come(char, pet, 0) ! return 1 ! ! # All Come (356) ! elif 356 in keywords: ! come(char, pet, 1) ! return 1 ! ! # All Go ! elif text == 'all go': ! go(char, pet, 1) ! return 1 ! ! # Go ! elif text.endswith('go'): ! go(char, pet, 0) ! return 1 ! # All Kill, All Attack ! elif 360 in keywords or 361 in keywords: ! attack(char, pet, 1) ! return 1 ! # Kill, Attack ! elif 349 in keywords or 350 in keywords: ! attack(char, pet, 0) ! return 1 ! # Transfer ! elif 366 in keywords: ! transfer(char, pet) ! return 1 ! # Release ! elif 365 in keywords: ! release(char, pet) ! return 1 ! # All Stay, All Stop ! elif 368 in keywords or 359 in keywords: ! stop(char, pet, 1) ! return 1 ! # Stay, Stop ! elif 353 in keywords or 367 in keywords: ! stop(char, pet, 0) ! return 1 ! # Follow Me ! elif 355 in keywords: ! follow_me(char, pet, 0) ! return 1 ! # All Follow Me ! elif 364 in keywords: ! follow_me(char, pet, 1) ! return 1 ! # All Follow ! elif 357 in keywords: ! follow(char, pet, 1) ! return 1 ! # Follow ! elif 346 in keywords: ! follow(char, pet, 1) ! return 1 ! return 0 --- 163,264 ---- return 0 ! # Test Ownership / Allow GMs to control if ( not pet.owner or pet.owner != char ) and not char.gm: return 0 + # Test All # Check for keywords ! ! all = text.startswith('all ') ! ! if all: ! text = text.lower() ! #char.socket.sysmessage('zzz ALL') ! # begin all # ! # All Follow Me ! if 232 in keywords and 355 in keywords and 364 in keywords: ! #char.socket.sysmessage('zzz all follow me') ! follow_me(char, pet, 1) ! return 1 ! ! # All Follow ! elif 232 in keywords and 346 in keywords and 357 in keywords: ! #char.socket.sysmessage('zzz all follow') ! follow(char, pet, 1) ! return 1 ! ! # All Kill, All Attack ! elif (360 in keywords and 349 in keywords) or (361 in keywords and 350 in keywords): ! #char.socket.sysmessage('zzz all attack') ! attack(char, pet, 1) ! return 1 ! # All Come (356) ! elif 356 in keywords and 341 in keywords: ! #char.socket.sysmessage('zzz all come') ! come(char, pet, 1) ! return 1 ! # All Stay, All Stop ! elif (368 in keywords and 367 in keywords) or (359 in keywords and 353 in keywords): ! #char.socket.sysmessage('zzz all stay') ! stop(char, pet, 1) ! return 1 ! # All Go ! elif text == 'all go': ! #char.socket.sysmessage('zzz all go') ! go(char, pet, 1) ! return 1 ! # end all # ! else: ! # begin not all # ! # Test Name if not all, return false if false ! if not text.startswith(pet.name.lower() + " "): ! return 0 ! # Follow Me ! elif 232 in keywords and 355 in keywords: ! #char.socket.sysmessage('zzz Follow me') ! follow_me(char, pet, 0) ! return 1 ! # Follow ! elif 232 in keywords and 346 in keywords: ! #char.socket.sysmessage('zzz Follow') ! follow(char, pet, 0) ! return 1 ! ! # Kill, Attack ! elif 349 in keywords or 350 in keywords: ! attack(char, pet, 0) ! return 1 ! # Stay, Stop ! elif 353 in keywords or 367 in keywords: ! stop(char, pet, 0) ! return 1 ! # Come (341) ! if 341 in keywords: ! come(char, pet, 0) ! return 1 ! # Go ! elif text.endswith('go'): ! go(char, pet, 0) ! return 1 ! ! # Transfer ! elif 366 in keywords: ! transfer(char, pet) ! return 1 ! # Release ! elif 365 in keywords: ! release(char, pet) ! return 1 ! # end some # ! return 0 \ No newline at end of file |
From: Sebastian H. <dar...@us...> - 2004-08-31 00:54:43
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1296/python Modified Files: global.cpp Removed Files: pyaccounts.h Log Message: accounts iterator Index: global.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v retrieving revision 1.149 retrieving revision 1.150 diff -C2 -d -r1.149 -r1.150 *** global.cpp 31 Aug 2004 00:48:05 -0000 1.149 --- global.cpp 31 Aug 2004 00:54:32 -0000 1.150 *************** *** 56,60 **** #include "../basedef.h" - #include "pyaccounts.h" #include "pypacket.h" #include "regioniterator.h" --- 56,59 ---- *************** *** 2042,2059 **** } - /* - \function wolfpack.accounts.iterator - \description Return an iterator object to iterate trough all account objects. - */ - static PyObject* wpAccountsIterator( PyObject* self, PyObject* args ) - { - Q_UNUSED( self ); - Q_UNUSED( args ); - - wpAccountsIter *obj = PyObject_New(wpAccountsIter, &wpAccountsIterType); - obj->it = 0; - return (PyObject*)obj; - } - /*! wolfpack.accounts --- 2041,2044 ---- *************** *** 2062,2066 **** static PyMethodDef wpAccounts[] = { - { "iterator", wpAccountsIterator, METH_VARARGS, "" }, { "count", wpAccountsCount, METH_VARARGS, "" }, { "find", wpAccountsFind, METH_VARARGS, "Finds an account object." }, --- 2047,2050 ---- --- pyaccounts.h DELETED --- |
From: Sebastian H. <dar...@us...> - 2004-08-31 00:48:15
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv316/python Modified Files: global.cpp pyaccounts.h Log Message: accounts iterator Index: global.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v retrieving revision 1.148 retrieving revision 1.149 diff -C2 -d -r1.148 -r1.149 *** global.cpp 31 Aug 2004 00:42:31 -0000 1.148 --- global.cpp 31 Aug 2004 00:48:05 -0000 1.149 *************** *** 2052,2055 **** --- 2052,2056 ---- wpAccountsIter *obj = PyObject_New(wpAccountsIter, &wpAccountsIterType); + obj->it = 0; return (PyObject*)obj; } Index: pyaccounts.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/pyaccounts.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pyaccounts.h 31 Aug 2004 00:42:36 -0000 1.1 --- pyaccounts.h 31 Aug 2004 00:48:05 -0000 1.2 *************** *** 39,59 **** { PyObject_HEAD; ! cAccounts::const_iterator it; } wpAccountsIter; static PyObject *wpAccountsIter_First(wpAccountsIter *self) { ! self->it = Accounts::instance()->begin(); return (PyObject*)self; } static PyObject *wpAccountsIter_Next(wpAccountsIter *self) { ! if (self->it == Accounts::instance()->end()) { PyErr_SetNone(PyExc_StopIteration); return 0; } else { ! return PyGetAccountObject(*(self->it++)); } } static PyTypeObject wpAccountsIterType = { --- 39,70 ---- { PyObject_HEAD; ! cAccounts::const_iterator *it; } wpAccountsIter; static PyObject *wpAccountsIter_First(wpAccountsIter *self) { ! delete self->it; ! self->it = new cAccounts::const_iterator(Accounts::instance()->begin()); return (PyObject*)self; } static PyObject *wpAccountsIter_Next(wpAccountsIter *self) { ! if (!self->it) { ! PyErr_SetNone(PyExc_StopIteration); ! return 0; ! } ! ! if ((*self->it) == Accounts::instance()->end()) { PyErr_SetNone(PyExc_StopIteration); return 0; } else { ! return PyGetAccountObject(*((*self->it)++)); } } + void wpAccountsIterDealloc( wpAccountsIter* self ) { + delete self->it; + wpDealloc((PyObject*)self); + } + static PyTypeObject wpAccountsIterType = { *************** *** 63,67 **** sizeof( wpAccountsIterType ), 0, ! wpDealloc, 0, 0, --- 74,78 ---- sizeof( wpAccountsIterType ), 0, ! (destructor)wpAccountsIterDealloc, 0, 0, |
From: Sebastian H. <dar...@us...> - 2004-08-31 00:42:45
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32108/python Modified Files: global.cpp Added Files: pyaccounts.h Log Message: accounts iterator Index: global.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** global.cpp 24 Aug 2004 00:23:23 -0000 1.147 --- global.cpp 31 Aug 2004 00:42:31 -0000 1.148 *************** *** 56,59 **** --- 56,60 ---- #include "../basedef.h" + #include "pyaccounts.h" #include "pypacket.h" #include "regioniterator.h" *************** *** 2041,2044 **** --- 2042,2058 ---- } + /* + \function wolfpack.accounts.iterator + \description Return an iterator object to iterate trough all account objects. + */ + static PyObject* wpAccountsIterator( PyObject* self, PyObject* args ) + { + Q_UNUSED( self ); + Q_UNUSED( args ); + + wpAccountsIter *obj = PyObject_New(wpAccountsIter, &wpAccountsIterType); + return (PyObject*)obj; + } + /*! wolfpack.accounts *************** *** 2047,2050 **** --- 2061,2065 ---- static PyMethodDef wpAccounts[] = { + { "iterator", wpAccountsIterator, METH_VARARGS, "" }, { "count", wpAccountsCount, METH_VARARGS, "" }, { "find", wpAccountsFind, METH_VARARGS, "Finds an account object." }, --- NEW FILE: pyaccounts.h --- /* * Wolfpack Emu (WP) * UO Server Emulation Program * * Copyright 2001-2004 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/ */ #ifndef __CONTENT_H__ #define __CONTENT_H__ #include "../defines.h" #include "../accounts.h" #include "../items.h" #include "../world.h" #include "../basechar.h" #include "utilities.h" typedef struct { PyObject_HEAD; cAccounts::const_iterator it; } wpAccountsIter; static PyObject *wpAccountsIter_First(wpAccountsIter *self) { self->it = Accounts::instance()->begin(); return (PyObject*)self; } static PyObject *wpAccountsIter_Next(wpAccountsIter *self) { if (self->it == Accounts::instance()->end()) { PyErr_SetNone(PyExc_StopIteration); return 0; } else { return PyGetAccountObject(*(self->it++)); } } static PyTypeObject wpAccountsIterType = { PyObject_HEAD_INIT( NULL ) 0, "wpAccountsIter", sizeof( wpAccountsIterType ), 0, wpDealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_HAVE_ITER, 0, 0, 0, 0, 0, (getiterfunc)wpAccountsIter_First, (iternextfunc)wpAccountsIter_Next, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; #endif |
From: Sebastian H. <dar...@us...> - 2004-08-31 00:16:25
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27687/network Modified Files: uosocket.cpp Log Message: Fixes for local connections. Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.401 retrieving revision 1.402 diff -C2 -d -r1.401 -r1.402 *** uosocket.cpp 29 Aug 2004 20:40:50 -0000 1.401 --- uosocket.cpp 31 Aug 2004 00:16:14 -0000 1.402 *************** *** 438,443 **** vector<ServerList_st> shards = Config::instance()->serverList(); ! for ( Q_UINT8 i = 0; i < shards.size(); ++i ) ! shardList.addServer( i, shards[i].sServer, 0x00, shards[i].uiTime, shards[i].ip ); send( &shardList ); --- 438,450 ---- vector<ServerList_st> shards = Config::instance()->serverList(); ! for ( Q_UINT8 i = 0; i < shards.size(); ++i ) { ! ServerList_st server = shards[i]; ! // we are connecting from the same ip, send 127.0.0.1 as the ip ! if (server.sIP == ip().latin1()) { ! shardList.addServer( i, server.sServer, 0x00, server.uiTime, 0x7F000001 ); ! } else { ! shardList.addServer( i, server.sServer, 0x00, server.uiTime, server.ip ); ! } ! } send( &shardList ); |
From: Sebastian H. <dar...@us...> - 2004-08-31 00:16:25
|
Update of /cvsroot/wpdev/wolfpack/win In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27687/win Modified Files: config_win.cpp Log Message: Fixes for local connections. Index: config_win.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/win/config_win.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** config_win.cpp 10 Aug 2004 03:19:08 -0000 1.5 --- config_win.cpp 31 Aug 2004 00:16:15 -0000 1.6 *************** *** 192,197 **** // Fall back to localhost ! if ( !server.sIP ) ! server.sIP = 0x7F000001; } serverList_.push_back( server ); --- 192,199 ---- // Fall back to localhost ! if ( !server.ip ) { ! server.ip = 0x7F000001; ! server.sIP = "127.0.0.1"; ! } } serverList_.push_back( server ); |
From: Sebastian H. <dar...@us...> - 2004-08-30 23:37:18
|
Update of /cvsroot/wpdev/wolfpack/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22424/data Added Files: banner.psd Log Message: account synchro --- NEW FILE: banner.psd --- (This appears to be a binary file; contents omitted.) |
From: Sebastian H. <dar...@us...> - 2004-08-30 14:24:34
|
Update of /cvsroot/wpdev/xmlscripts/definitions/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9702/system Modified Files: access.xml Log Message: axl fixes Index: access.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/system/access.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** access.xml 28 Aug 2004 14:52:32 -0000 1.3 --- access.xml 30 Aug 2004 14:24:22 -0000 1.4 *************** *** 31,34 **** --- 31,35 ---- <action name="DECORATION" permit="false" /> <action name="DOORGEN" permit="false" /> + <action name="EVAL" permit="false" /> <action name="EXPORT" permit="false" /> <action name="IMPORT" permit="false" /> *************** *** 48,55 **** <action name="ACCOUNT" permit="false" /> <action name="ALLMOVE" permit="false" /> ! <action name="ALLSHOW" permit="false" /> <action name="DECORATION" permit="false" /> <action name="DOORGEN" permit="false" /> <action name="EDIT" permit="false" /> <action name="EXPORT" permit="false" /> <action name="GMTALK" permit="false" /> --- 49,57 ---- <action name="ACCOUNT" permit="false" /> <action name="ALLMOVE" permit="false" /> ! <action name="ALLSHOW" permit="false" /> <action name="DECORATION" permit="false" /> <action name="DOORGEN" permit="false" /> <action name="EDIT" permit="false" /> + <action name="EVAL" permit="false" /> <action name="EXPORT" permit="false" /> <action name="GMTALK" permit="false" /> *************** *** 100,103 **** --- 102,106 ---- <action name="ACTION" permit="true" /> <action name="FIX" permit="true" /> + <action name="EMAIL" permit="true" /> <action name="PASSWORD" permit="true" /> <action name="TIME" permit="true" /> |
From: Sebastian H. <dar...@us...> - 2004-08-29 20:42:35
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1489 Modified Files: ChangeLog Log Message: overweight Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ChangeLog 27 Aug 2004 18:56:59 -0000 1.15 --- ChangeLog 29 Aug 2004 20:42:25 -0000 1.16 *************** *** 26,30 **** - added a new property .basescripts to get a comma separated list of all scripts in the basescripts list. ! Wolfpack 12.9.8 Beta (19. August 2004) --- 26,35 ---- - added a new property .basescripts to get a comma separated list of all scripts in the basescripts list. ! - New property: char.overweight Returns true if the character is overloaded. ! - New property: char.maxweight Returns the maximum stones a character can carry. ! - Stamina loss while walking. ! - Stamina loss when taking damage. ! - Overweight prevents walking now. ! - Walking is denied if stamina is 0. Wolfpack 12.9.8 Beta (19. August 2004) |
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1196 Modified Files: basechar.cpp basechar.h defines.h npc.cpp npc.h player.cpp player.h territories.cpp timers.cpp walking.cpp Log Message: overweight Index: player.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/player.h,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** player.h 19 Aug 2004 01:55:56 -0000 1.57 --- player.h 29 Aug 2004 20:40:50 -0000 1.58 *************** *** 97,100 **** --- 97,102 ---- void awardFame( short amount ); void awardKarma( P_CHAR pKilled, short amount ); + bool isOverloaded(); + unsigned int maxWeight(); // other public methods *************** *** 115,118 **** --- 117,121 ---- void createTooltip( cUOTxTooltipList& tooltip, cPlayer* player ); unsigned char controlslots() const; + unsigned int damage( eDamageType type, unsigned int amount, cUObject* source = 0 ); // Wrapper events Index: defines.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/defines.h,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** defines.h 10 Aug 2004 03:15:56 -0000 1.57 --- defines.h 29 Aug 2004 20:40:50 -0000 1.58 *************** *** 127,132 **** }; - #define WEIGHT_PER_STR 4 - #define DEFAULTWEBPAGE "http://www.wpdev.org/" --- 127,130 ---- Index: territories.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/territories.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** territories.cpp 25 Aug 2004 17:01:23 -0000 1.53 --- territories.cpp 29 Aug 2004 20:40:50 -0000 1.54 *************** *** 389,393 **** PyObject* args = Py_BuildValue( "(NNN)", PyGetCharObject( pc ), PyGetRegionObject( lastRegion ), PyGetRegionObject( currRegion ) ); ! if ( !cPythonScript::callChainedEventHandler( EVENT_CHANGEREGION, pc->getScripts(), args ) && socket ) { if ( lastRegion && !lastRegion->name().isEmpty() && !lastRegion->isNoEnterMessage() ) --- 389,393 ---- PyObject* args = Py_BuildValue( "(NNN)", PyGetCharObject( pc ), PyGetRegionObject( lastRegion ), PyGetRegionObject( currRegion ) ); ! if ( !pc->callEventHandler( EVENT_CHANGEREGION, args ) && socket ) { if ( lastRegion && !lastRegion->name().isEmpty() && !lastRegion->isNoEnterMessage() ) Index: basechar.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** basechar.cpp 27 Aug 2004 14:41:15 -0000 1.136 --- basechar.cpp 29 Aug 2004 20:40:50 -0000 1.137 *************** *** 60,63 **** --- 60,64 ---- fights_.setAutoDelete( false ); basedef_ = 0; + stepsTaken_ = 0; lastMovement_ = 0; attackTarget_ = 0; *************** *** 1965,1968 **** --- 1966,1977 ---- PyObject* cBaseChar::getProperty( const QString& name ) { + // \rproperty char.overloaded This boolean property indicates whether the character is overloaded or not. + PY_PROPERTY( "overloaded", isOverloaded() ) + // \rproperty char.maxweight The maximum weight this character can carry with his current strength. + PY_PROPERTY( "maxweight", maxWeight() ) + /* \rproperty char.stepstaken The number of steps this character walked since the server started. + This value is not saved between server downs. + */ + PY_PROPERTY( "stepstaken", stepsTaken() ) PY_PROPERTY( "orgname", orgName_ ) PY_PROPERTY( "direction", direction_ ) *************** *** 2248,2252 **** // to modify the damage if needed // ! if ( scriptChain ) { PyObject* args = 0; --- 2257,2261 ---- // to modify the damage if needed // ! if ( canHandleEvent(EVENT_DAMAGE) ) { PyObject* args = 0; *************** *** 2258,2262 **** args = Py_BuildValue( "O&iiO", PyGetCharObject, this, ( unsigned int ) type, amount, Py_None ); ! PyObject* result = cPythonScript::callChainedEvent( EVENT_DAMAGE, scriptChain, args ); if ( result ) --- 2267,2271 ---- args = Py_BuildValue( "O&iiO", PyGetCharObject, this, ( unsigned int ) type, amount, Py_None ); ! PyObject* result = callEvent(EVENT_DAMAGE, args); if ( result ) Index: npc.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/npc.h,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** npc.h 19 Aug 2004 01:55:56 -0000 1.58 --- npc.h 29 Aug 2004 20:40:50 -0000 1.59 *************** *** 94,98 **** void postload( unsigned int version ); void load( cBufferedReader& reader ); ! virtual enCharTypes objectType(); virtual void update( bool excludeself = false ); --- 94,100 ---- void postload( unsigned int version ); void load( cBufferedReader& reader ); ! ! bool isOverloaded(); ! unsigned int maxWeight(); virtual enCharTypes objectType(); virtual void update( bool excludeself = false ); *************** *** 121,124 **** --- 123,127 ---- virtual bool isInnocent(); void createTooltip( cUOTxTooltipList& tooltip, cPlayer* player ); + unsigned int damage( eDamageType type, unsigned int amount, cUObject* source = 0 ); // other public methods Index: player.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** player.cpp 22 Aug 2004 15:12:34 -0000 1.122 --- player.cpp 29 Aug 2004 20:40:50 -0000 1.123 *************** *** 1769,1770 **** --- 1769,1800 ---- cBaseChar::remove(); } + + unsigned int cPlayer::damage( eDamageType type, unsigned int amount, cUObject* source ) { + amount = cBaseChar::damage(type, amount, source); + + if (amount != 0) { + // the more stamina we have, the more we loose + // the more hitpoints we have, the less we loose + int value = (int)(amount * (100.0 / hitpoints_) * (stamina_ / 100.0)) - 5; + if (value > 0) { + stamina_ = QMAX(0, stamina_ - value); + if (socket_) { + socket_->updateStamina(); + } + } + } + + return amount; + } + + bool cPlayer::isOverloaded() { + if (isDead() || isGMorCounselor()) { + return false; + } + + return weight_ > maxWeight(); + } + + unsigned int cPlayer::maxWeight() { + return 40 + strength_ * 3.5; + } Index: timers.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/timers.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** timers.cpp 25 Aug 2004 18:46:15 -0000 1.13 --- timers.cpp 29 Aug 2004 20:40:50 -0000 1.14 *************** *** 317,321 **** void cTimers::dispel( P_CHAR pc_dest, P_CHAR pSource, bool silent ) { ! if ( cPythonScript::canChainHandleEvent( EVENT_DISPEL, pc_dest->getScripts() ) ) { PyObject* source; --- 317,321 ---- void cTimers::dispel( P_CHAR pc_dest, P_CHAR pSource, bool silent ) { ! if ( pc_dest->canHandleEvent( EVENT_DISPEL ) ) { PyObject* source; *************** *** 331,335 **** PyObject* args = Py_BuildValue( "(NNBBsN", pc_dest->getPyObject(), source, silent ? 1 : 0, 0, "", PyTuple_New( 0 ) ); ! bool result = cPythonScript::callChainedEventHandler( EVENT_DISPEL, pc_dest->getScripts(), args ); Py_DECREF( args ); --- 331,335 ---- PyObject* args = Py_BuildValue( "(NNBBsN", pc_dest->getPyObject(), source, silent ? 1 : 0, 0, "", PyTuple_New( 0 ) ); ! bool result = pc_dest->callEventHandler( EVENT_DISPEL, args ); Py_DECREF( args ); Index: basechar.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** basechar.h 27 Aug 2004 14:41:15 -0000 1.81 --- basechar.h 29 Aug 2004 20:40:50 -0000 1.82 *************** *** 238,241 **** --- 238,243 ---- virtual bool inWorld() = 0; + virtual unsigned int maxWeight() = 0; + virtual bool isOverloaded() = 0; virtual void showName( cUOSocket* socket ) = 0; virtual void soundEffect( UI16 soundId, bool hearAll = true ) = 0; *************** *** 244,248 **** virtual void log( eLogLevel, const QString& string ) = 0; virtual void log( const QString& string ) = 0; ! unsigned int damage( eDamageType type, unsigned int amount, cUObject* source = 0 ); // other public methods --- 246,250 ---- virtual void log( eLogLevel, const QString& string ) = 0; virtual void log( const QString& string ) = 0; ! virtual unsigned int damage( eDamageType type, unsigned int amount, cUObject* source = 0 ); // other public methods *************** *** 416,419 **** --- 418,422 ---- bool isInvulnerable() const; unsigned char direction() const; + unsigned int stepsTaken() const; // advanced getters for data structures *************** *** 463,466 **** --- 466,470 ---- void setLastMovement( unsigned int data ); void setPoison( signed char data ); + void setStepsTaken(unsigned int value); void setPropertyFlags( uint data ); void setRegenHitpointsTime( uint data ); *************** *** 770,773 **** --- 774,780 ---- QDateTime creationDate_; + // Number of steps taken since login. + unsigned int stepsTaken_; + // Saves the number of steps that were stealthed. value -1 indicates that // the char will be revealed *************** *** 896,899 **** --- 903,915 ---- } + inline unsigned int cBaseChar::stepsTaken() const + { + return stepsTaken_; + } + + inline void cBaseChar::setStepsTaken(unsigned int value) { + stepsTaken_ = value; + } + inline uint cBaseChar::criminalTime() const { Index: walking.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** walking.cpp 28 Aug 2004 20:59:35 -0000 1.140 --- walking.cpp 29 Aug 2004 20:40:50 -0000 1.141 *************** *** 521,524 **** --- 521,525 ---- // We moved so let's update our location pChar->moveTo( newCoord ); + pChar->setStepsTaken( pChar->stepsTaken() + 1 ); pChar->setLastMovement( Server::instance()->time() ); checkStealth( pChar ); // Reveals the user if neccesary *************** *** 722,759 **** passed character. */ ! bool cMovement::consumeStamina( P_PLAYER pChar, bool running ) ! { ! // TODO: Stamina loss is disabled for now -- Weight system needs to be rediscussed ! // return true; ! // Weight percent ! float allowedWeight = ( pChar->strength() * WEIGHT_PER_STR ) + 30; ! float load = ceilf( ( pChar->weight() / allowedWeight ) * 100 ) / 100; ! if ( running ) ! load = ceilf( load * 200 ) / 100; ! // 200% load is too much ! if ( load >= 200 ) ! { ! pChar->socket()->sysMessage( tr( "You are too overloaded to move." ) ); ! return false; ! } ! // 20% overweight = ( 0.20 * 0.10 ) * (Weight carrying) = Stamina needed to move ! float overweight = load - 100; ! // We're not overloaded so we dont need additional stamina ! if ( overweight < 0 ) ! return true; ! float requiredStamina = ceilf( ( float ) ( ( double ) ( ( double ) overweight * 0.10f ) * ( double ) pChar->weight() ) * 100 ) / 100; ! if ( pChar->stamina() < requiredStamina ) ! { ! pChar->sysmessage( tr( "You are too exhausted to move" ) ); return false; } return true; } --- 723,788 ---- passed character. */ ! bool cMovement::consumeStamina( P_PLAYER pChar, bool running ) { ! // Dead people and gms don't care about weight ! if (pChar->isDead() || pChar->isGMorCounselor()) { ! return true; ! } ! // Calculate the stones we weight too much ! int overWeight = pChar->weight() - pChar->maxWeight(); ! bool mounted = pChar->atLayer(cBaseChar::Mount) != 0; ! bool update = false; ! // We carry too much ! if (overWeight > 0) { ! // How much stamina we loose ! int amount = 5 + (overWeight / 25); ! // Only one third loss if mounted ! if (mounted) { ! amount = amount / 3; ! } ! // Double loss if running ! if (running) { ! amount = amount * 2; ! } ! // Set the new stamina ! pChar->setStamina(QMAX(0, pChar->stamina() - amount), false); ! update = true; ! // We are overloaded ! if (pChar->stamina() == 0) { ! pChar->socket()->updateStamina(); ! pChar->socket()->clilocMessage(500109); ! return false; ! } ! } ! // If we have less than 10% stamina left, we loose ! // stamina more quickly ! if ( (pChar->stamina() * 100) / QMAX(1, pChar->maxStamina()) < 10 ) { ! pChar->setStamina(QMAX(0, pChar->stamina() - 1), false); ! update = true; ! } ! ! // We can't move anymore because we are exhausted ! if ( pChar->stamina() == 0 ) { ! pChar->socket()->updateStamina(); ! pChar->socket()->clilocMessage( 500110 ); return false; } + // Normally reduce stamina every few steps + if ( pChar->stepsTaken() % ( mounted ? 48 : 16 ) == 0 ) { + pChar->setStamina( QMAX( 0, pChar->stamina() - 1 ) ); + update = true; + } + + if (update) { + pChar->socket()->updateStamina(); + } + return true; } Index: npc.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** npc.cpp 22 Aug 2004 02:29:50 -0000 1.109 --- npc.cpp 29 Aug 2004 20:40:50 -0000 1.110 *************** *** 1430,1431 **** --- 1430,1454 ---- cBaseChar::remove(); } + + unsigned int cNPC::damage( eDamageType type, unsigned int amount, cUObject* source ) { + amount = cBaseChar::damage(type, amount, source); + + if (amount != 0) { + // the more stamina we have, the more we loose + // the more hitpoints we have, the less we loose + int value = (int)(amount * (100.0 / hitpoints_) * (stamina_ / 100.0)) - 5; + if (value > 0) { + stamina_ = QMAX(0, stamina_ - value); + } + } + + return amount; + } + + bool cNPC::isOverloaded() { + return false; + } + + unsigned int cNPC::maxWeight() { + return 0; + } |
From: Sebastian H. <dar...@us...> - 2004-08-29 20:40:59
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1196/python Modified Files: char.cpp Log Message: overweight Index: char.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v retrieving revision 1.185 retrieving revision 1.186 diff -C2 -d -r1.185 -r1.186 *** char.cpp 27 Aug 2004 14:41:17 -0000 1.185 --- char.cpp 29 Aug 2004 20:40:50 -0000 1.186 *************** *** 1451,1455 **** dispelargs = PyTuple_New( 0 ); ! if ( cPythonScript::canChainHandleEvent( EVENT_DISPEL, self->pChar->getScripts() ) ) { PyObject* source; --- 1451,1455 ---- dispelargs = PyTuple_New( 0 ); ! if ( self->pChar->canHandleEvent(EVENT_DISPEL) ) { PyObject* source; *************** *** 1470,1474 **** PyObject* args = Py_BuildValue( "(NNBBsN", self->pChar->getPyObject(), source, 0, force ? 1 : 0, ptype, dispelargs ); ! bool result = cPythonScript::callChainedEventHandler( EVENT_DISPEL, self->pChar->getScripts(), args ); Py_DECREF( args ); --- 1470,1474 ---- PyObject* args = Py_BuildValue( "(NNBBsN", self->pChar->getPyObject(), source, 0, force ? 1 : 0, ptype, dispelargs ); ! bool result = self->pChar->callEventHandler( EVENT_DISPEL, args ); Py_DECREF( args ); |