wpdev-commits Mailing List for Wolfpack Emu (Page 192)
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: <dar...@us...> - 2003-09-13 01:47:02
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv9755
Modified Files:
accounts.cpp
Log Message:
fixed a startup crash bug
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** accounts.cpp 12 Sep 2003 20:02:44 -0000 1.67
--- accounts.cpp 13 Sep 2003 01:46:58 -0000 1.68
***************
*** 350,359 ****
try
{
if( !persistentBroker->tableExists( "accounts" ) )
{
persistentBroker->executeQuery( createSql );
}
-
- 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;" );
--- 350,359 ----
try
{
+ persistentBroker->connect( SrvParams->accountsHost(), SrvParams->accountsName(), SrvParams->accountsUsername(), SrvParams->accountsPassword() );
+
if( !persistentBroker->tableExists( "accounts" ) )
{
persistentBroker->executeQuery( createSql );
}
cDBResult result = persistentBroker->query( "SELECT accounts.login,accounts.password,accounts.flags,accounts.acl,accounts.lastlogin,accounts.blockuntil FROM accounts;" );
|
|
From: <dar...@us...> - 2003-09-13 01:15:06
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv4600
Modified Files:
wolfpack.pro
Log Message:
Fixed an issue with wolfpack.pro
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.161
retrieving revision 1.162
diff -C2 -d -r1.161 -r1.162
*** wolfpack.pro 12 Sep 2003 22:11:47 -0000 1.161
--- wolfpack.pro 13 Sep 2003 01:15:03 -0000 1.162
***************
*** 21,32 ****
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. -L/usr/local/lib/mysql/lib/mysql -L/usr/local/lib -Llib/Python -L/usr/lib/mysql -ldl -lpython2.3 -lmysqlclient -lutil
# we dont use those.
QMAKE_LIBS_X11 -= -lX11 -lXext -lm
--- 21,34 ----
INCLUDEPATH += /usr/include/mysql
DEFINES += MYSQL_DRIVER
+ LIBS += -lmysqlclient
} 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
+ LIBS += -lmysqlclient
}
INCLUDEPATH += /usr/local/include/stlport lib/Python sqlite lib/Python/Include network
! LIBS += -L. -L/usr/local/lib/mysql/lib/mysql -L/usr/local/lib -Llib/Python -L/usr/lib/mysql -ldl -lpython2.3 -lutil
# we dont use those.
QMAKE_LIBS_X11 -= -lX11 -lXext -lm
|
|
From: <dr...@us...> - 2003-09-12 22:12:44
|
Update of /cvsroot/wpdev/xmlscripts In directory sc8-pr-cvs1:/tmp/cvs-serv660 Modified Files: wolfpack.sql Log Message: Updates Index: wolfpack.sql =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/wolfpack.sql,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wolfpack.sql 29 Aug 2003 11:21:54 -0000 1.25 --- wolfpack.sql 12 Sep 2003 22:12:41 -0000 1.26 *************** *** 109,142 **** ); - CREATE TABLE guildstones ( - serial int(11) NOT NULL default '0', - guildname varchar(255) NOT NULL default '', - abbreviation varchar(255) NOT NULL default '', - guildtype tinyint(1) NOT NULL default '0', - charter longtext NOT NULL, - webpage varchar(255) NOT NULL default 'http://www.wpdev.org', - master int(11) NOT NULL default '-1', - priv int(11) NOT NULL default '-1', - PRIMARY KEY (serial) - ); - - CREATE TABLE guildstones_members ( - serial int(11) NOT NULL default '0', - member int(11) NOT NULL default '-1', - PRIMARY KEY (serial,member) - ); - - CREATE TABLE guildstones_recruits ( - serial int(11) NOT NULL default '0', - recruit int(11) NOT NULL default '-1', - PRIMARY KEY (serial,recruit) - ); - - CREATE TABLE guildstones_war ( - serial int(11) NOT NULL default '0', - enemy int(11) NOT NULL default '-1', - PRIMARY KEY (serial,enemy) - ); - CREATE TABLE houses ( serial int(11) NOT NULL default '0', --- 109,112 ---- *************** *** 270,273 **** ); - --- 240,260 ---- ); + CREATE TABLE `effects` ( + `id` int(11) NOT NULL default '0', + `objectid` varchar(64) NOT NULL default '', + `expiretime` int(11) NOT NULL default '0', + `dispellable` tinyint(4) NOT NULL default '0', + `source` int(11) NOT NULL default '-1', + `destination` int(11) NOT NULL default '-1', + PRIMARY KEY (`id`) + ); + + CREATE TABLE `effects_properties` ( + `id` int(11) NOT NULL default '0', + `key` varchar(64) NOT NULL default '', + `type` varchar(64) NOT NULL default '', + `value` text NOT NULL, + PRIMARY KEY (`id`,`key`) + ); + |
|
From: <dar...@us...> - 2003-09-12 22:11:50
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv525 Modified Files: console_unix.cpp uobject.cpp wolfpack.pro Log Message: Probably Fixed Linux Behaviour of Console Index: console_unix.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/console_unix.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** console_unix.cpp 12 Sep 2003 21:51:53 -0000 1.6 --- console_unix.cpp 12 Sep 2003 22:11:47 -0000 1.7 *************** *** 29,33 **** --- 29,39 ---- // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== + + // System Includes + #include <sys/time.h> #include <stdio.h> + #include <unistd.h> + #include <termios.h> + // Qt Includes #include <qthread.h> *************** *** 39,42 **** --- 45,63 ---- using namespace std; + void setNonBlockingIo() + { + termios term_caps; + + if( tcgetattr( STDIN_FILENO, &term_caps ) < 0 ) + return; + + term_caps.c_lflag &= ~ICANON; + + if( tcsetattr( STDIN_FILENO, TCSANOW, &term_caps ) < 0 ) + return; + + setbuf( stdin, NULL ); + } + class cConsoleThread : public QThread { *************** *** 46,58 **** try { while( serverState < SHUTDOWN ) { ! char c = fgetc( stdin ); ! if( c > 0 && serverState == RUNNING ) { ! Console::instance()->queueCommand( QChar( c ) ); } else ! { msleep( 100 ); } --- 67,95 ---- try { + setNonBlockingIo(); + while( serverState < SHUTDOWN ) { ! // Do a select operation on the stdin handle and see ! // if there is any input waiting. ! fd_set consoleFds; ! FD_ZERO( &consoleFds ); ! FD_SET( STDIN_FILENO, &consoleFds ); ! ! timeval tvTimeout; ! tvTimeout.tv_sec = 0; ! tvTimeout.tv_usec = 1; ! ! if( select( 1, &consoleFds, 0, 0, &tvTimeout ) > 0 ) { ! char c = fgetc( stdin ); ! ! if( c > 0 && serverState == RUNNING ) ! { ! Console::instance()->queueCommand( QChar( c ) ); ! } } else ! { msleep( 100 ); } Index: uobject.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** uobject.cpp 12 Sep 2003 15:39:55 -0000 1.113 --- uobject.cpp 12 Sep 2003 22:11:47 -0000 1.114 *************** *** 114,118 **** void cUObject::load( char **result, UINT16 &offset ) { ! name_ = result[offset] == 0 ? QString::null : result[offset]; offset++; serial_ = atoi(result[offset++]); --- 114,118 ---- void cUObject::load( char **result, UINT16 &offset ) { ! name_ = ( result[offset] == 0 ) ? QString::null : QString( result[offset] ); offset++; serial_ = atoi(result[offset++]); *************** *** 123,127 **** pos_.z = atoi(result[offset++]); pos_.map = atoi(result[offset++]); ! eventList_ = result[offset] == 0 ? QString::null : result[offset]; offset++; bindmenu_ = result[offset++]; --- 123,127 ---- pos_.z = atoi(result[offset++]); pos_.map = atoi(result[offset++]); ! eventList_ = ( result[offset] == 0 ) ? QString::null : QString( result[offset] ); offset++; bindmenu_ = result[offset++]; Index: wolfpack.pro =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** wolfpack.pro 12 Sep 2003 17:30:57 -0000 1.160 --- wolfpack.pro 12 Sep 2003 22:11:47 -0000 1.161 *************** *** 28,32 **** 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 --- 28,32 ---- INCLUDEPATH += /usr/local/include/stlport lib/Python sqlite lib/Python/Include network ! LIBS += -L. -L/usr/local/lib/mysql/lib/mysql -L/usr/local/lib -Llib/Python -L/usr/lib/mysql -ldl -lpython2.3 -lmysqlclient -lutil # we dont use those. QMAKE_LIBS_X11 -= -lX11 -lXext -lm |
|
From: <dr...@us...> - 2003-09-12 21:51:57
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv29493 Modified Files: console_unix.cpp Log Message: Temp compile fix by Dark-Storm Index: console_unix.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/console_unix.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** console_unix.cpp 12 Sep 2003 21:04:12 -0000 1.5 --- console_unix.cpp 12 Sep 2003 21:51:53 -0000 1.6 *************** *** 29,32 **** --- 29,33 ---- // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== + #include <stdio.h> // Qt Includes #include <qthread.h> *************** *** 47,51 **** while( serverState < SHUTDOWN ) { ! char c = getch(); if( c > 0 && serverState == RUNNING ) { --- 48,52 ---- while( serverState < SHUTDOWN ) { ! char c = fgetc( stdin ); if( c > 0 && serverState == RUNNING ) { |
|
From: <dar...@us...> - 2003-09-12 21:04:15
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv19159
Modified Files:
console_unix.cpp
Log Message:
Probably fixed a linux bug.
Index: console_unix.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_unix.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** console_unix.cpp 11 Sep 2003 12:22:24 -0000 1.4
--- console_unix.cpp 12 Sep 2003 21:04:12 -0000 1.5
***************
*** 47,54 ****
while( serverState < SHUTDOWN )
{
! char c = cin.get();
if( c > 0 && serverState == RUNNING )
{
! Console::instance()->handleCommand( QChar( c ) );
}
else
--- 47,54 ----
while( serverState < SHUTDOWN )
{
! char c = getch();
if( c > 0 && serverState == RUNNING )
{
! Console::instance()->queueCommand( QChar( c ) );
}
else
***************
*** 77,81 ****
void cConsole::poll()
{
! // Normally we would check if there is a command in the command queue and execute it
}
--- 77,91 ----
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();
! }
}
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv6052
Modified Files:
accounts.cpp dbdriver.cpp dbdriver.h persistentbroker.cpp
persistentbroker.h wolf.dsp world.cpp
Log Message:
Implemented a rudimentary db autocreation.
This is subject to change later but will solve some issues for now.
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** accounts.cpp 11 Sep 2003 12:22:24 -0000 1.66
--- accounts.cpp 12 Sep 2003 20:02:44 -0000 1.67
***************
*** 42,45 ****
--- 42,56 ----
#include "world.h"
+ // DB AutoCreation
+ const char *createSql = "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)\
+ );";
+
/*****************************************************************************
cAccount member functions
***************
*** 289,292 ****
--- 300,308 ----
connected = true;
+ if( !persistentBroker->tableExists( "accounts" ) )
+ {
+ persistentBroker->executeQuery( createSql );
+ }
+
persistentBroker->executeQuery( "BEGIN;" );
***************
*** 334,337 ****
--- 350,358 ----
try
{
+ if( !persistentBroker->tableExists( "accounts" ) )
+ {
+ persistentBroker->executeQuery( createSql );
+ }
+
persistentBroker->connect( SrvParams->accountsHost(), SrvParams->accountsName(), SrvParams->accountsUsername(), SrvParams->accountsPassword() );
Index: dbdriver.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbdriver.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** dbdriver.cpp 3 Sep 2003 20:58:17 -0000 1.22
--- dbdriver.cpp 12 Sep 2003 20:02:44 -0000 1.23
***************
*** 241,244 ****
--- 241,255 ----
}
+ bool cSQLiteDriver::tableExists( const QString &table )
+ {
+ cDBResult result = query( QString( "PRAGMA table_info('%1');" ).arg( table ) );
+
+ bool res = result.fetchrow(); // Every table has at least one field
+
+ result.free();
+
+ return res;
+ }
+
/*****************************************************************************
cMySQLDriver member functions
***************
*** 333,336 ****
--- 344,355 ----
connection = connections[ id ];
}
+ }
+
+ /*!
+ No checking done for MySQL yet.
+ */
+ bool cMySQLDriver::tableExists( const QString &table )
+ {
+ return true;
}
Index: dbdriver.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbdriver.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** dbdriver.h 2 Sep 2003 01:07:44 -0000 1.13
--- dbdriver.h 12 Sep 2003 20:02:44 -0000 1.14
***************
*** 70,73 ****
--- 70,74 ----
virtual void unlockTable( const QString& table );
virtual QString error(); // Returns an error (if there is one), uses the current connection
+ virtual bool tableExists( const QString &table ) = 0;
// Setters + Getters
***************
*** 96,99 ****
--- 97,101 ----
void lockTable( const QString &table ) {}
void unlockTable( const QString &table ) {}
+ bool tableExists( const QString &table );
QString error() { return QString::null; }
***************
*** 116,119 ****
--- 118,122 ----
void lockTable( const QString& table );
void unlockTable( const QString& table );
+ bool tableExists( const QString &table );
QString error();
void setActiveConnection( int id );
Index: persistentbroker.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** persistentbroker.cpp 9 Sep 2003 23:09:30 -0000 1.27
--- persistentbroker.cpp 12 Sep 2003 20:02:44 -0000 1.28
***************
*** 152,160 ****
if( !result )
{
! qWarning( query );
! Console::instance()->ChangeColor( WPC_RED );
! Console::instance()->send( "ERROR" );
! Console::instance()->ChangeColor( WPC_NORMAL );
! Console::instance()->send( ":" + connection->error() + "\n" );
}
return result;
--- 152,156 ----
if( !result )
{
! Console::instance()->log( LOG_ERROR, connection->error() );
}
return result;
***************
*** 232,234 ****
--- 228,235 ----
if( sqlite )
executeQuery( "ROLLBACK;" );
+ }
+
+ bool PersistentBroker::tableExists( const QString &table )
+ {
+ return connection->tableExists( table );
}
Index: persistentbroker.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** persistentbroker.h 9 Sep 2003 23:09:30 -0000 1.23
--- persistentbroker.h 12 Sep 2003 20:02:44 -0000 1.24
***************
*** 78,81 ****
--- 78,82 ----
void lockTable( const QString& table ) const;
void unlockTable( const QString& table ) const;
+ bool tableExists( const QString& table );
bool saveObject( PersistentObject* );
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.229
retrieving revision 1.230
diff -C2 -d -r1.229 -r1.230
*** wolf.dsp 12 Sep 2003 15:39:55 -0000 1.229
--- wolf.dsp 12 Sep 2003 20:02:44 -0000 1.230
***************
*** 239,246 ****
# Begin Source File
- SOURCE=.\pfactory.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\player.cpp
# End Source File
--- 239,242 ----
***************
*** 697,704 ****
SOURCE=.\persistentobject.h
# PROP Ignore_Default_Tool 1
- # End Source File
- # Begin Source File
-
- SOURCE=.\pfactory.h
# End Source File
# Begin Source File
--- 693,696 ----
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** world.cpp 12 Sep 2003 15:39:56 -0000 1.44
--- world.cpp 12 Sep 2003 20:02:44 -0000 1.45
***************
*** 30,34 ****
// Wolfpack Includes
- #include "pfactory.h"
#include "world.h"
#include "console.h"
--- 30,33 ----
***************
*** 78,81 ****
--- 77,330 ----
#endif
+ // This is used for autocreating the tables
+ struct {
+ const char *name;
+ const char *create;
+ } tableInfo[] =
+ {
+ { "boats", "CREATE TABLE boats ( \
+ serial int(11) NOT NULL default '0', \
+ autosail tinyint(1) NOT NULL default '0', \
+ boatdir tinyint(1) NOT NULL default '0', \
+ itemserial1 int(11) NOT NULL default '-1', \
+ itemserial2 int(11) NOT NULL default '-1', \
+ itemserial3 int(11) NOT NULL default '-1', \
+ itemserial4 int(11) NOT NULL default '-1', \
+ multi1 smallint(6) default '0', \
+ multi2 smallint(6) default '0', \
+ multi3 smallint(6) default '0', \
+ multi4 smallint(6) default '0', \
+ PRIMARY KEY (serial) \
+ );" },
+
+ { "boats_itemids", "CREATE TABLE boats_itemids ( \
+ serial int(11) NOT NULL default '0', \
+ a tinyint(1) NOT NULL default '0', \
+ b tinyint(1) NOT NULL default '0', \
+ id smallint(6) default '0', \
+ PRIMARY KEY (serial) \
+ );" },
+
+ { "boats_itemoffsets", "CREATE TABLE boats_itemoffsets (\
+ serial int(11) NOT NULL default '0',\
+ a tinyint(1) NOT NULL default '0',\
+ b tinyint(1) NOT NULL default '0',\
+ c tinyint(1) NOT NULL default '0',\
+ offset smallint(6) default '0',\
+ PRIMARY KEY (serial)\
+ );" },
+
+ { "characters", "CREATE TABLE characters (\
+ serial int(11) NOT NULL default '0',\
+ name varchar(255) default NULL,\
+ title varchar(255) default NULL,\
+ creationdate varchar(255) default NULL,\
+ body smallint(5) NOT NULL default '0',\
+ orgbody smallint(5) NOT NULL default '0',\
+ skin smallint(5) NOT NULL default '0',\
+ orgskin smallint(5) NOT NULL default '0',\
+ saycolor smallint(5) NOT NULL default '0',\
+ emotecolor smallint(5) NOT NULL default '0',\
+ strength smallint(6) NOT NULL default '0',\
+ strengthmod smallint(6) NOT NULL default '0',\
+ dexterity smallint(6) NOT NULL default '0',\
+ dexteritymod smallint(6) NOT NULL default '0',\
+ intelligence smallint(6) NOT NULL default '0',\
+ intelligencemod smallint(6) NOT NULL default '0',\
+ maxhitpoints smallint(6) NOT NULL default '0',\
+ hitpoints smallint(6) NOT NULL default '0',\
+ maxstamina smallint(6) NOT NULL default '0',\
+ stamina smallint(6) NOT NULL default '0',\
+ maxmana smallint(6) default NULL,\
+ mana smallint(6) default NULL,\
+ karma int(11) NOT NULL default '0',\
+ fame int(11) NOT NULL default '0',\
+ kills int(10) NOT NULL default '0',\
+ deaths int(10) NOT NULL default '0',\
+ def int(10) NOT NULL default '0',\
+ hunger int(11) NOT NULL default '0',\
+ poison int(11) NOT NULL default '0',\
+ poisoned int(10) NOT NULL default '0',\
+ murderertime int(11) NOT NULL default '0',\
+ criminaltime int(11) NOT NULL default '0',\
+ nutriment int(10) NOT NULL default '0',\
+ gender tinyint(1) NOT NULL default '0',\
+ propertyflags int(11) NOT NULL default '0',\
+ attacker int(11) NOT NULL default '-1',\
+ combattarget int(11) NOT NULL default '-1',\
+ murderer int(11) NOT NULL default '-1',\
+ guarding int(11) NOT NULL default '-1',\
+ PRIMARY KEY (serial)\
+ );" },
+
+ { "corpses", "CREATE TABLE corpses (\
+ serial int(11) NOT NULL default '0',\
+ bodyid smallint(6) NOT NULL default '0',\
+ hairstyle smallint(6) NOT NULL default '0',\
+ haircolor smallint(6) NOT NULL default '0',\
+ beardstyle smallint(6) NOT NULL default '0',\
+ beardcolor smallint(6) NOT NULL default '0',\
+ PRIMARY KEY (serial)\
+ );" },
+
+ { "corpses_equipment", "CREATE TABLE corpses_equipment (\
+ serial int(11) NOT NULL default '0',\
+ layer tinyint(3) NOT NULL default '0',\
+ item int(11) NOT NULL default '-1', \
+ PRIMARY KEY (serial,layer)\
+ );" },
+
+ { "houses", "CREATE TABLE houses (\
+ serial int(11) NOT NULL default '0',\
+ nokey tinyint(1) NOT NULL default '0',\
+ charpos_x smallint(6) NOT NULL default '0',\
+ charpos_y smallint(6) NOT NULL default '0',\
+ charpos_z smallint(6) NOT NULL default '0',\
+ PRIMARY KEY (serial)\
+ );" },
+
+ { "items", "CREATE TABLE items (\
+ serial int(11) NOT NULL default '0',\
+ id smallint(5) NOT NULL default '0',\
+ color smallint(5) NOT NULL default '0',\
+ cont int(11) NOT NULL default '-1',\
+ layer tinyint(3) NOT NULL default '0',\
+ type smallint(5) NOT NULL default '0',\
+ type2 smallint(5) NOT NULL default '0',\
+ amount smallint(5) NOT NULL default '0',\
+ decaytime int(10) NOT NULL default '0',\
+ def int(10) NOT NULL default '0',\
+ hidamage smallint(6) NOT NULL default '0',\
+ lodamage smallint(6) NOT NULL default '0',\
+ time_unused int(10) NOT NULL default '0',\
+ weight int(11) NOT NULL default '0',\
+ hp smallint(6) NOT NULL default '0',\
+ maxhp smallint(6) NOT NULL default '0',\
+ speed int(11) NOT NULL default '0',\
+ poisoned int(10) NOT NULL default '0',\
+ magic tinyint(3) NOT NULL default '0',\
+ owner int(11) NOT NULL default '-1',\
+ visible tinyint(3) NOT NULL default '0',\
+ spawn int(11) NOT NULL default '-1',\
+ priv tinyint(3) NOT NULL default '0',\
+ sellprice int(11) NOT NULL default '0',\
+ buyprice int(11) NOT NULL default '0',\
+ restock smallint(5) NOT NULL default '0',\
+ PRIMARY KEY (serial)\
+ );" },
+
+ { "multis", "CREATE TABLE multis (\
+ serial int(11) NOT NULL default '0',\
+ coowner int(11) NOT NULL default '-1',\
+ deedsection varchar(255) NOT NULL default '',\
+ PRIMARY KEY (serial)\
+ );" },
+
+ { "multis_bans", "CREATE TABLE multis_bans (\
+ serial int(11) NOT NULL default '0',\
+ ban int(11) NOT NULL default '-1',\
+ PRIMARY KEY (serial,ban)\
+ );" },
+
+ { "multis_friends", "CREATE TABLE multis_friends (\
+ serial int(11) NOT NULL default '0',\
+ friend int(11) NOT NULL default '-1',\
+ PRIMARY KEY (serial,friend)\
+ );" },
+
+ { "npcs", "CREATE TABLE npcs (\
+ serial int(11) NOT NULL default '0',\
+ mindamage smallint(6) NOT NULL default '0',\
+ maxdamage smallint(6) NOT NULL default '0',\
+ tamingminskill smallint(6) NOT NULL default '0',\
+ summontime int(11) NOT NULL default '0',\
+ additionalflags int(11) NOT NULL default '0',\
+ owner int(11) NOT NULL default '-1',\
+ carve varchar(255) default NULL,\
+ spawnregion varchar(255) default NULL,\
+ stablemaster int(11) NOT NULL default '-1',\
+ lootlist varchar(255) default NULL,\
+ ai varchar(255) default NULL,\
+ wandertype smallint(3) NOT NULL default '0',\
+ wanderx1 smallint(6) NOT NULL default '0',\
+ wanderx2 smallint(6) NOT NULL default '0',\
+ wandery1 smallint(6) NOT NULL default '0',\
+ wandery2 smallint(6) NOT NULL default '0',\
+ wanderradius smallint(6) NOT NULL default '0',\
+ fleeat smallint(3) NOT NULL default '10',\
+ spellslow int(11) NOT NULL default '0',\
+ spellshigh int(11) NOT NULL default '0',\
+ PRIMARY KEY (serial)\
+ );" },
+
+ { "players", "CREATE TABLE players (\
+ serial int(11) NOT NULL default '0',\
+ account varchar(255) default NULL,\
+ additionalflags int(10) NOT NULL default '0',\
+ visualrange tinyint(3) NOT NULL default '0',\
+ profile longtext,\
+ fixedlight tinyint(3) NOT NULL default '0',\
+ PRIMARY KEY (serial)\
+ );" },
+
+ { "skills", "CREATE TABLE skills (\
+ serial int(11) NOT NULL default '0',\
+ skill tinyint(3) NOT NULL default '0',\
+ value smallint(6) NOT NULL default '0',\
+ locktype tinyint(4) default '0',\
+ cap smallint(6) default '0',\
+ PRIMARY KEY (serial,skill)\
+ );" },
+
+ { "tags", "CREATE TABLE tags (\
+ serial int(11) NOT NULL default '0',\
+ name varchar(64) NOT NULL default '',\
+ type varchar(6) NOT NULL default '',\
+ value longtext NOT NULL,\
+ PRIMARY KEY (serial,name)\
+ );" },
+
+ { "uobject", "CREATE TABLE uobject (\
+ name varchar(255) default NULL,\
+ serial int(11) NOT NULL default '0',\
+ multis int(11) NOT NULL default '-1',\
+ direction char(1) NOT NULL default '0',\
+ pos_x smallint(6) NOT NULL default '0',\
+ pos_y smallint(6) NOT NULL default '0',\
+ pos_z smallint(6) NOT NULL default '0',\
+ pos_map tinyint(4) NOT NULL default '0', \
+ events varchar(255) default NULL,\
+ bindmenu varchar(255) default NULL,\
+ havetags tinyint(1) NOT NULL default '0',\
+ PRIMARY KEY (serial)\
+ );" },
+
+ { "uobjectmap", "CREATE TABLE uobjectmap (\
+ serial int(11) NOT NULL default '0',\
+ type varchar(80) NOT NULL default '',\
+ PRIMARY KEY (serial)\
+ );" },
+
+ { "effects", "CREATE TABLE effects (\
+ id int NOT NULL,\
+ objectid varchar(64) NOT NULL,\
+ expiretime int NOT NULL,\
+ dispellable tinyint NOT NULL default '0',\
+ source int NOT NULL default '-1',\
+ destination int NOT NULL default '-1',\
+ PRIMARY KEY (id)\
+ );" },
+
+ { "effects_properties", "CREATE TABLE effects_properties (\
+ id int NOT NULL,\
+ key varchar(64) NOT NULL,\
+ type varchar(64) NOT NULL,\
+ value text NOT NULL,\
+ PRIMARY KEY (id,key)\
+ );" },
+
+ { NULL, NULL }
+ };
+
/*****************************************************************************
cWorldPrivate member functions
***************
*** 193,196 ****
--- 442,455 ----
register unsigned int i = 0;
+ while( tableInfo[i].name )
+ {
+ if( !persistentBroker->tableExists( tableInfo[i].name ) )
+ {
+ persistentBroker->executeQuery( tableInfo[i].create );
+ }
+
+ ++i;
+ }
+
QStringList types = UObjectFactory::instance()->objectTypes();
***************
*** 428,431 ****
--- 687,702 ----
Console::instance()->log( LOG_ERROR, QString( "Couldn't open the database: %1\n" ).arg( e ) );
return;
+ }
+
+ unsigned int i = 0;
+
+ while( tableInfo[i].name )
+ {
+ if( !persistentBroker->tableExists( tableInfo[i].name ) )
+ {
+ persistentBroker->executeQuery( tableInfo[i].create );
+ }
+
+ ++i;
}
|
|
From: <dr...@us...> - 2003-09-12 17:31:01
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv6166
Modified Files:
wolfpack.pro
Log Message:
Fixed warnings.
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.159
retrieving revision 1.160
diff -C2 -d -r1.159 -r1.160
*** wolfpack.pro 12 Sep 2003 15:39:55 -0000 1.159
--- wolfpack.pro 12 Sep 2003 17:30:57 -0000 1.160
***************
*** 113,117 ****
srvparams.h \
skills.h \
- stream.h \
structs.h \
targetrequests.h \
--- 113,116 ----
***************
*** 120,124 ****
typedefs.h \
uobject.h \
- utilsys.h \
verinfo.h \
wolfpack.h \
--- 119,122 ----
***************
*** 186,190 ****
Trade.cpp \
uobject.cpp \
- utilsys.cpp \
wolfpack.cpp \
walking.cpp \
--- 184,187 ----
|
|
From: <dar...@us...> - 2003-09-12 15:39:59
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv14030
Modified Files:
TmpEff.h accounts.h items.cpp resources.h tmpeff.cpp
uobject.cpp wolf.dsp wolfpack.pro world.cpp
Removed Files:
pfactory.cpp pfactory.h
Log Message:
Implemented serialization of effects to the database (experimental!).
Index: TmpEff.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/TmpEff.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** TmpEff.h 12 Sep 2003 15:28:59 -0000 1.38
--- TmpEff.h 12 Sep 2003 15:39:55 -0000 1.39
***************
*** 52,56 ****
// Wolfpack includes
#include "typedefs.h"
- #include "iserialization.h"
#include "singleton.h"
--- 52,55 ----
***************
*** 136,139 ****
--- 135,139 ----
public:
cDelayedHideChar( SERIAL serial );
+ cDelayedHideChar();
void Expire();
QString objectID() const { return "cDelayedHideChar"; }
Index: accounts.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** accounts.h 9 Sep 2003 23:09:30 -0000 1.31
--- accounts.h 12 Sep 2003 15:39:55 -0000 1.32
***************
*** 35,40 ****
#define __ACCOUNTS_H__
-
- #include "iserialization.h"
#include "typedefs.h"
#include "singleton.h"
--- 35,38 ----
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.350
retrieving revision 1.351
diff -C2 -d -r1.350 -r1.351
*** items.cpp 11 Sep 2003 12:22:24 -0000 1.350
--- items.cpp 12 Sep 2003 15:39:55 -0000 1.351
***************
*** 37,41 ****
#include "network/uosocket.h"
#include "network/uotxpackets.h"
- #include "iserialization.h"
#include "items.h"
#include "tilecache.h"
--- 37,40 ----
Index: resources.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/resources.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** resources.h 27 Aug 2003 20:35:10 -0000 1.17
--- resources.h 12 Sep 2003 15:39:55 -0000 1.18
***************
*** 34,38 ****
#include "definable.h"
- #include "iserialization.h"
#include "items.h"
#include "wptargetrequests.h"
--- 34,37 ----
Index: tmpeff.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/tmpeff.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -C2 -d -r1.62 -r1.63
*** tmpeff.cpp 12 Sep 2003 15:29:00 -0000 1.62
--- tmpeff.cpp 12 Sep 2003 15:39:55 -0000 1.63
***************
*** 39,43 ****
#include "globals.h"
#include "srvparams.h"
- #include "iserialization.h"
#include "network.h"
#include "wpdefmanager.h"
--- 39,42 ----
***************
*** 188,191 ****
--- 187,192 ----
sourSer = atol( result[offset++] );
destSer = atol( result[offset++] );
+
+ serializable = true;
}
***************
*** 308,312 ****
while( it != teffects.end() )
{
! (*it)->save( id++ );
++it;
}
--- 309,315 ----
while( it != teffects.end() )
{
! if( (*it)->isSerializable() )
! (*it)->save( id++ );
!
++it;
}
***************
*** 326,329 ****
--- 329,337 ----
}
+ cDelayedHideChar::cDelayedHideChar()
+ {
+ setSerializable( true );
+ }
+
void cDelayedHideChar::Expire()
{
***************
*** 334,369 ****
pc->setHidden( 1 );
pc->resend( true );
- }
-
- // cTimedSpellAction
- cTimedSpellAction::cTimedSpellAction( SERIAL serial, UI08 nAction )
- {
- if( !isCharSerial( serial ) )
- {
- character = INVALID_SERIAL;
- return;
- }
-
- // Display the animation once
- P_CHAR pc = FindCharBySerial( serial );
- if( !pc )
- {
- character = INVALID_SERIAL;
- return;
- }
- pc->action( nAction );
-
- // Save our data
- character = serial;
- action = nAction;
- serializable = false;
- expiretime = uiCurrentTime + 750;
- }
-
- // Insert a new action if there are more than 75 ticks left
- void cTimedSpellAction::Expire()
- {
- if( character != INVALID_SERIAL )
- TempEffects::instance()->insert( new cTimedSpellAction( character, action ) );
}
--- 342,345 ----
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -C2 -d -r1.112 -r1.113
*** uobject.cpp 7 Sep 2003 19:07:47 -0000 1.112
--- uobject.cpp 12 Sep 2003 15:39:55 -0000 1.113
***************
*** 36,40 ****
#include "coord.h"
#include "uobject.h"
- #include "iserialization.h"
#include "globals.h"
#include "network.h"
--- 36,39 ----
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.228
retrieving revision 1.229
diff -C2 -d -r1.228 -r1.229
*** wolf.dsp 12 Sep 2003 15:29:00 -0000 1.228
--- wolf.dsp 12 Sep 2003 15:39:55 -0000 1.229
***************
*** 195,202 ****
# Begin Source File
- SOURCE=.\iserialization.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\itemid.cpp
# End Source File
--- 195,198 ----
***************
*** 271,278 ****
# Begin Source File
- SOURCE=.\serxmlfile.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\skills.cpp
# End Source File
--- 267,270 ----
***************
*** 571,607 ****
# Begin Source File
- SOURCE=.\iserialization.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
- # PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing iserialization.h...
- InputDir=.
- InputPath=.\iserialization.h
- InputName=iserialization
-
- "$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp
-
- # End Custom Build
-
- !ELSEIF "$(CFG)" == "wolf - Win32 Debug"
-
- # PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing iserialization.h...
- InputDir=.
- InputPath=.\iserialization.h
- InputName=iserialization
-
- "$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp
-
- # End Custom Build
-
- !ENDIF
-
- # End Source File
- # Begin Source File
-
SOURCE=.\itemid.h
# End Source File
--- 563,566 ----
***************
*** 807,814 ****
# Begin Source File
- SOURCE=.\serxmlfile.h
- # End Source File
- # Begin Source File
-
SOURCE=.\singleton.h
# End Source File
--- 766,769 ----
***************
*** 1235,1242 ****
SOURCE=.\moc_gumps.cpp
- # End Source File
- # Begin Source File
-
- SOURCE=.\moc_iserialization.cpp
# End Source File
# Begin Source File
--- 1190,1193 ----
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.158
retrieving revision 1.159
diff -C2 -d -r1.158 -r1.159
*** wolfpack.pro 11 Sep 2003 16:19:50 -0000 1.158
--- wolfpack.pro 12 Sep 2003 15:39:55 -0000 1.159
***************
*** 92,96 ****
house.h \
inlines.h \
- iserialization.h \
itemid.h \
items.h \
--- 92,95 ----
***************
*** 100,104 ****
network.h \
npc.h \
- pfactory.h \
platform.h \
persistentbroker.h \
--- 99,102 ----
***************
*** 114,118 ****
speech.h \
srvparams.h \
- serxmlfile.h \
skills.h \
stream.h \
--- 112,115 ----
***************
*** 158,162 ****
gumps.cpp \
house.cpp \
- iserialization.cpp \
itemid.cpp \
items.cpp \
--- 155,158 ----
***************
*** 169,173 ****
npc.cpp \
encryption.cpp \
- pfactory.cpp \
persistentbroker.cpp \
persistentobject.cpp \
--- 165,168 ----
***************
*** 177,181 ****
resources.cpp \
sectors.cpp \
- serxmlfile.cpp \
scriptmanager.cpp \
skills.cpp \
--- 172,175 ----
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** world.cpp 12 Sep 2003 15:29:00 -0000 1.43
--- world.cpp 12 Sep 2003 15:39:56 -0000 1.44
***************
*** 37,41 ****
#include "dbdriver.h"
#include "progress.h"
- #include "iserialization.h"
#include "persistentbroker.h"
#include "accounts.h"
--- 37,40 ----
***************
*** 190,195 ****
persistentBroker->connect( SrvParams->databaseHost(), SrvParams->databaseName(), SrvParams->databaseUsername(), SrvParams->databasePassword() );
-
- ISerialization* archive = cPluginFactory::serializationArchiver( "xml" );
QString objectID;
--- 189,192 ----
--- pfactory.cpp DELETED ---
--- pfactory.h DELETED ---
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv11737
Modified Files:
TmpEff.h basics.cpp tmpeff.cpp wolf.dsp wolfpack.cpp world.cpp
Removed Files:
iserialization.cpp iserialization.h serxmlfile.cpp
serxmlfile.h
Log Message:
Implemented serialization of effects to the database (experimental!).
Index: TmpEff.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/TmpEff.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** TmpEff.h 27 Jun 2003 18:25:03 -0000 1.37
--- TmpEff.h 12 Sep 2003 15:28:59 -0000 1.38
***************
*** 48,52 ****
class cTempEffect;
class cScriptEffect;
- class cTimedSpellAction;
class cTempEffects;
--- 48,51 ----
***************
*** 56,62 ****
#include "singleton.h"
! class cTempEffect : public cSerializable
{
- Q_OBJECT
protected:
SERIAL sourSer;
--- 55,62 ----
#include "singleton.h"
! class cDBResult;
!
! class cTempEffect
{
protected:
SERIAL sourSer;
***************
*** 76,80 ****
unsigned int rank;
bool marker;
!
public:
// cTempEffect() { serializable = true; }
--- 76,90 ----
unsigned int rank;
bool marker;
!
! /*
! Provided for subclasses to save additional information.
! */
! void saveFloat( unsigned int id, QString key, double value );
! void saveInt( unsigned int id, QString key, int value );
! void saveString( unsigned int id, QString key, const QString &value );
! bool loadFloat( unsigned int id, QString key, double &value );
! bool loadInt( unsigned int id, QString key, int &value );
! bool loadString( unsigned int id, QString key, QString &value );
!
public:
// cTempEffect() { serializable = true; }
***************
*** 93,96 ****
--- 103,107 ----
rank = rank_;
marker = marker_;
+ dispellable = false; // Most Effects are NOT dispellable by default
}
***************
*** 110,114 ****
void Off(P_CHAR pc) { Q_UNUSED(pc); }
virtual void Expire() = 0;
- virtual void Serialize(ISerialization &archive);
virtual void Dispel( P_CHAR pSource, bool silent = false ) { Q_UNUSED(pSource); Q_UNUSED(silent); }
virtual QString objectID() const { return objectid;}
--- 121,124 ----
***************
*** 116,119 ****
--- 126,132 ----
void setSerializable( bool data ) { serializable = data; }
+ virtual void load( unsigned int id, const char **result );
+ virtual void save( unsigned int id );
+
std::vector< cTempEffect* > asVector();
};
***************
*** 121,169 ****
class cDelayedHideChar : public cTempEffect
{
- Q_OBJECT
public:
cDelayedHideChar( SERIAL serial );
! virtual void Expire();
! virtual void Serialize(ISerialization &archive);
! virtual QString objectID() const { return "HIDECHAR";}
! SERIAL character;
! };
!
! class cTimedSpellAction : public cTempEffect
! {
! Q_OBJECT
! private:
! SERIAL character;
! UI08 action;
! public:
! // Do that as long as we're casting
! cTimedSpellAction( SERIAL serial, UI08 nAction );
! virtual void Expire();
! };
!
! /*
! class cTmpEffFibHeap
! {
! public:
! cTmpEffFibHeap() : head(0) {}
! cTmpEffFibHeap( cTempEffect* head_ ) { head = head_; }
!
! // methods
! cTempEffect* accessMin();
! void deleteMin();
! void erase( cTempEffect* pT );
! void insert( cTempEffect* pT );
! cTempEffect* meld( cTmpEffFibHeap &nFheap );
!
! std::vector< cTempEffect* > asVector();
!
! private:
! void decrease( cTempEffect* pT, int diffTime );
!
! public:
! // variables
! cTempEffect* head;
};
- */
class cTempEffects
--- 134,142 ----
class cDelayedHideChar : public cTempEffect
{
public:
cDelayedHideChar( SERIAL serial );
! void Expire();
! QString objectID() const { return "cDelayedHideChar"; }
};
class cTempEffects
***************
*** 181,190 ****
public:
cTempEffects() { std::make_heap( teffects.begin(), teffects.end(), cTempEffects::ComparePredicate() ); } // No temp effects to start with
- // cTmpEffFibHeap teffects;
- // QPtrVector< cTempEffect > vector;
std::vector< cTempEffect* > teffects;
void check();
- void serialize(ISerialization &archive);
void dispel( P_CHAR pc_dest, P_CHAR pSource, bool silent = false );
void dispel( P_CHAR pc_dest, P_CHAR pSource, const QString &type, bool silent = false, bool onlyDispellable = true );
--- 154,163 ----
public:
cTempEffects() { std::make_heap( teffects.begin(), teffects.end(), cTempEffects::ComparePredicate() ); } // No temp effects to start with
std::vector< cTempEffect* > teffects;
+ void load();
+ void save();
+
void check();
void dispel( P_CHAR pc_dest, P_CHAR pSource, bool silent = false );
void dispel( P_CHAR pc_dest, P_CHAR pSource, const QString &type, bool silent = false, bool onlyDispellable = true );
***************
*** 217,221 ****
class cRepeatAction: public cTempEffect
{
- Q_OBJECT
private:
SERIAL _mage;
--- 190,193 ----
***************
*** 225,229 ****
cRepeatAction( P_CHAR mage, UINT8 anim, UINT32 delay );
virtual void Expire();
- virtual QString objectID() const { return "repeataction"; }
};
--- 197,200 ----
Index: basics.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basics.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** basics.cpp 11 Sep 2003 12:22:24 -0000 1.26
--- basics.cpp 12 Sep 2003 15:29:00 -0000 1.27
***************
*** 163,170 ****
{
timeval tTime;
- timezone tZone;
// Error handling wouldn't have much sense here.
! gettimeofday( &tTime, &tZone );
return ( tTime.tv_sec * 1000 ) + (unsigned int)( tTime.tv_usec / 1000 );
--- 163,169 ----
{
timeval tTime;
// Error handling wouldn't have much sense here.
! gettimeofday( &tTime, NULL );
return ( tTime.tv_sec * 1000 ) + (unsigned int)( tTime.tv_usec / 1000 );
Index: tmpeff.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/tmpeff.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** tmpeff.cpp 7 Sep 2003 19:07:47 -0000 1.61
--- tmpeff.cpp 12 Sep 2003 15:29:00 -0000 1.62
***************
*** 30,36 ****
//==================================================================================
! //////////////////////////////////////////////////////////////////////
! // TmpEff.cpp: implementation of temporary effects
! // cut from Wolfpack.cpp by Duke, 25.10.2000
#include "platform.h"
--- 30,34 ----
//==================================================================================
! #include "python/tempeffect.h"
#include "platform.h"
***************
*** 45,48 ****
--- 43,48 ----
#include "wpdefmanager.h"
#include "network/uosocket.h"
+ #include "dbdriver.h"
+ #include "persistentbroker.h"
#include "skills.h"
#include "sectors.h"
***************
*** 51,55 ****
--- 51,57 ----
#include "npc.h"
#include "ai.h"
+ #include "basics.h"
#include "world.h"
+ #include "inlines.h"
#include <algorithm>
***************
*** 57,63 ****
#include <math.h>
- #undef DBGFILE
- #define DBGFILE "tmpeff.cpp"
-
int cTempEffect::getDest()
{
--- 59,62 ----
***************
*** 90,111 ****
}
! void cTempEffect::Serialize(ISerialization &archive)
{
! if (archive.isReading())
{
! archive.read( "expiretime", this->expiretime ); // exptime must be subtracted from current server clock time, so it can be recalculated on next server startup
! archive.read( "dispellable", this->dispellable );
! archive.read( "srcserial", this->sourSer );
! archive.read( "destserial", this->destSer );
! this->expiretime += uiCurrentTime;
}
! else if( archive.isWritting() )
{
! archive.write( "expiretime", ( this->expiretime - uiCurrentTime ) ); // exptime must be subtracted from current server clock time, so it can be recalculated on next server startup
! archive.write( "dispellable", this->dispellable );
! archive.write( "srcserial", this->getSour() );
! archive.write( "destserial", this->getDest() );
}
! cSerializable::Serialize( archive );
}
--- 89,191 ----
}
! /*
! Save a float to the effects_properties table.
! */
! void cTempEffect::saveFloat( unsigned int id, QString key, double value )
{
! persistentBroker->executeQuery( QString( "INSERT INTO effects_properties VALUES(%1,'%2','%3','%4');" ).arg( id ).arg( persistentBroker->quoteString( key ) ).arg( "float" ).arg( value ) );
! }
!
! /*
! Save an integer to the effects_properties table.
! */
! void cTempEffect::saveInt( unsigned int id, QString key, int value )
! {
! persistentBroker->executeQuery( QString( "INSERT INTO effects_properties VALUES(%1,'%2','%3','%4');" ).arg( id ).arg( persistentBroker->quoteString( key ) ).arg( "int" ).arg( value ) );
! }
!
! /*
! Save a string to the effects_properties table.
! */
! void cTempEffect::saveString( unsigned int id, QString key, const QString &value )
! {
! persistentBroker->executeQuery( QString( "INSERT INTO effects_properties VALUES(%1,'%2','%3','%4');" ).arg( id ).arg( persistentBroker->quoteString( key ) ).arg( "string" ).arg( persistentBroker->quoteString( value.utf8() ) ) );
! }
!
! /*
! Load a float from the effects_properties table.
! */
! bool cTempEffect::loadFloat( unsigned int id, QString key, double &value )
! {
! cDBResult result = persistentBroker->query( QString( "SELECT value FROM effects_properties WHERE id = '%1' AND key = '%2' AND type = 'float'" ).arg( id ).arg( persistentBroker->quoteString( key ) ) );
!
! if( !result.fetchrow() )
{
! result.free();
! return false;
}
!
! value = result.getString( 0 ).toFloat();
!
! result.free();
!
! return true;
! }
!
! /*
! Load an integer from the effects_properties table.
! */
! bool cTempEffect::loadInt( unsigned int id, QString key, int &value )
! {
! cDBResult result = persistentBroker->query( QString( "SELECT value FROM effects_properties WHERE id = '%1' AND key = '%2' AND type = 'int'" ).arg( id ).arg( persistentBroker->quoteString( key ) ) );
!
! if( !result.fetchrow() )
{
! result.free();
! return false;
}
!
! value = result.getString( 0 ).toInt();
!
! result.free();
!
! return true;
! }
!
! /*
! Load a string from the effects_properties table.
! */
! bool cTempEffect::loadString( unsigned int id, QString key, QString &value )
! {
! cDBResult result = persistentBroker->query( QString( "SELECT value FROM effects_properties WHERE id = '%1' AND key = '%2' AND type = 'string'" ).arg( id ).arg( persistentBroker->quoteString( key ) ) );
!
! if( !result.fetchrow() )
! {
! result.free();
! return false;
! }
!
! value = result.getString( 0 );
!
! result.free();
!
! return true;
! }
!
! #include "console.h"
!
! void cTempEffect::save( unsigned int id )
! {
! persistentBroker->executeQuery( QString( "INSERT INTO effects VALUES(%1,'%2',%3,%4,%5,%6);" ).arg( id ).arg( persistentBroker->quoteString( objectID() ) ).arg( expiretime - uiCurrentTime ).arg( dispellable ? 1 : 0 ).arg( sourSer ).arg( destSer ) );
! }
!
! void cTempEffect::load( unsigned int id, const char **result )
! {
! unsigned int offset = 2;
!
! expiretime = atol( result[offset++] ) + uiCurrentTime;
! dispellable = atol( result[offset++] ) == 0 ? false : true;
! sourSer = atol( result[offset++] );
! destSer = atol( result[offset++] );
}
***************
*** 138,153 ****
break;
}
-
- }
-
- void cTempEffects::serialize(ISerialization &archive)
- {
- std::vector< cTempEffect* >::iterator it = teffects.begin();
- while( it != teffects.end() )
- {
- if( (*it)->isSerializable() )
- archive.writeObject( (*it) );
- ++it;
- }
}
--- 218,221 ----
***************
*** 197,228 ****
}
! // cDelayedHideChar
! cDelayedHideChar::cDelayedHideChar( SERIAL serial )
{
! if( !isCharSerial( serial ) || !FindCharBySerial( serial ) )
{
! character = INVALID_SERIAL;
! return;
}
- character = serial;
- setSerializable( true );
}
! void cDelayedHideChar::Serialize( ISerialization &archive )
{
! if( archive.isReading() )
{
! archive.read( "charserial", character );
}
! else
{
! archive.write( "charserial", character );
}
! cTempEffect::Serialize( archive );
}
void cDelayedHideChar::Expire()
{
! P_PLAYER pc = dynamic_cast<P_PLAYER>(FindCharBySerial( character ));
if( !pc || pc->socket() ) // break if the char has relogged in the meantime
return;
--- 265,332 ----
}
! void cTempEffects::load()
{
! // Query the Database
!
! cDBResult result = persistentBroker->query( "SELECT id,objectid,expiretime,dispellable,source,destination FROM effects ORDER BY expiretime ASC;" );
!
! while( result.fetchrow() )
{
! unsigned int id = result.getInt( 0 );
! QString objectId = result.getString( 1 );
!
! cTempEffect *effect = 0;
!
! if( objectId == "cPythonEffect" )
! {
! effect = new cPythonEffect;
! }
! else if( objectId == "cDelayedHideChar" )
! {
! effect = new cDelayedHideChar;
! }
! else
! {
! throw QString( "Unknown TempEffect Type: %1" ).arg( objectId );
! }
!
! const char **res = (const char**)result.data(); // Skip id, objectid
! effect->load( id, res );
!
! insert( effect );
}
}
! void cTempEffects::save()
{
! persistentBroker->executeQuery( "DELETE FROM effects;" );
! persistentBroker->executeQuery( "DELETE FROM effects_properties;" );
!
! std::vector< cTempEffect* >::iterator it = teffects.begin();
! unsigned int id = 0;
!
! while( it != teffects.end() )
{
! (*it)->save( id++ );
! ++it;
}
! }
!
! // cDelayedHideChar
! cDelayedHideChar::cDelayedHideChar( SERIAL serial )
! {
! if( !isCharSerial( serial ) || !FindCharBySerial( serial ) )
{
! destSer = INVALID_SERIAL;
! return;
}
!
! destSer = serial;
! setSerializable( true );
}
void cDelayedHideChar::Expire()
{
! P_PLAYER pc = dynamic_cast<P_PLAYER>(FindCharBySerial( destSer ));
if( !pc || pc->socket() ) // break if the char has relogged in the meantime
return;
***************
*** 264,531 ****
}
- /*
- // Fibonacci Heap implementation
- //
- // 18.07.2002, Joerg Stueckler (sereg)
- // email: jo...@gm...
- //
- // based on "Algorithms and Data Structures", T.Ottmann/P.Widmayer, 4th Edition
- // Ch. 6.1.5., page 410
- cTempEffect* cTmpEffFibHeap::accessMin() // O(1)!
- {
- return head;
- }
-
- void cTmpEffFibHeap::insert( cTempEffect* pT ) // O(1) too!
- {
- cTmpEffFibHeap toMeld = cTmpEffFibHeap( pT );
- this->meld( toMeld );
- }
-
- cTempEffect* cTmpEffFibHeap::meld( cTmpEffFibHeap &nFheap ) // O(1) !!!
- {
- if( !this->head )
- {
- this->head = nFheap.head;
- }
- else if( this->head && nFheap.head )
- {
- cTempEffect* minHead = NULL;
- cTempEffect* maxHead = NULL;
- if( this->head->expiretime < nFheap.head->expiretime )
- {
- minHead = this->head;
- maxHead = nFheap.head;
- }
- else
- {
- maxHead = this->head;
- minHead = nFheap.head;
- }
- minHead->left->right = maxHead;
- cTempEffect* rightElement = maxHead->left;
- maxHead->left = minHead->left;
- minHead->left = rightElement;
- rightElement->right = minHead;
-
- this->head = minHead;
- }
-
- return this->head;
- }
-
- void cTmpEffFibHeap::deleteMin() // amortized O( lg N )
- {
- if( this->head )
- {
- if( this->head->left == this->head ) // only one element in the heap
- {
- delete this->head;
- this->head = NULL;
- return;
- }
- else
- {
- if( this->head->son ) // min element has a son
- {
- // replace the head with its sons in the list
- this->head->right->left = this->head->son->left;
- this->head->son->left->right = this->head->right;
- this->head->son->left = this->head->left;
- this->head->left->right = this->head->son;
-
- cTempEffect* newHead = this->head->son;
- delete this->head;
- this->head = newHead;
- }
- else
- {
- // unlink the head from the list
- this->head->right->left = this->head->left;
- this->head->left->right = this->head->right;
-
- cTempEffect* newHead = this->head->right;
- delete this->head;
- this->head = newHead;
- }
-
- // now we have to iterate through the root list to find two trees with equal rank
- // we use an array to find collisions.
- cTempEffect* ranks[RANK_ARRAY_SIZE];
- memset( &ranks, 0, sizeof( ranks ) );
-
- cTempEffect* it = this->head;
- cTempEffect* minNode = it;
- cTempEffect* coll = NULL;
-
- bool collision = false;
- do
- {
- collision = false;
- it->father = NULL; // reset the fathers of the inserted sons of head (see above)
- if( it->expiretime < minNode->expiretime )
- minNode = it; // find the min node by the way :)
-
- if( ranks[ it->rank ] && ranks[ it->rank ] != it ) // there is already another address stored in the array!
- {
- coll = ranks[ it->rank ];
- ranks[ it->rank ] = NULL;
-
- if( coll->expiretime < it->expiretime )
- {
- cTempEffect* templeft = NULL;
- cTempEffect* tempright = NULL;
- if( coll->left == it )
- {
- if( coll->right != it )
- {
- templeft = it->left;
- tempright = coll->right;
-
- templeft->right = coll;
- tempright->left = it;
- it->left = coll;
- it->right = tempright;
- coll->left = templeft;
- coll->right = it;
- }
- }
- else if( coll->right == it )
- {
- templeft = coll->left;
- tempright = it->right;
-
- templeft->right = it;
- tempright->left = coll;
- it->left = templeft;
- it->right = coll;
- coll->left = it;
- coll->right = tempright;
- }
- else
- {
- // swap the min element into it position
- templeft = coll->left;
- tempright = coll->right;
-
- it->left->right = coll;
- it->right->left = coll;
- coll->right = it->right;
- coll->left = it->left;
-
- templeft->right = it;
- tempright->left = it;
- it->right = tempright;
- it->left = templeft;
- }
- templeft = it;
- it = coll;
- coll = templeft;
- }
-
- // delete max element (coll) out of the list
- // if coll was head move the head one node right
- if( coll == this->head )
- this->head = coll->right;
- coll->left->right = coll->right;
- coll->right->left = coll->left;
-
- // insert max into the list of sons of min
- if( it->son )
- {
- cTempEffect* rightElement = it->son->left;
- coll->left = rightElement;
- it->son->left = coll;
- rightElement->right = coll;
- coll->right = it->son;
- }
- else
- {
- it->son = coll;
- coll->left = coll;
- coll->right = coll;
- }
- coll->father = it;
-
- it->rank = it->rank + 1;
-
- it->marker = false; // reset the marker cause the node got an additional son
-
- it = it->left;
- collision = true;
- }
- else
- {
- ranks[ it->rank ] = it;
- }
- it = it->right;
- } while( it != this->head || collision);
-
- this->head = minNode;
- }
- }
- }
-
- void cTmpEffFibHeap::decrease( cTempEffect* pT, int diffTime ) // O( 1 )
- {
- if( !pT )
- return;
-
- pT->expiretime -= diffTime;
- if( pT->father )
- {
- // first cut pT out and insert it into the root list
- // mark the father, if the father is already marked,
- // run decrease(...) recursively with diffTime = 0
- pT->left->right = pT->right;
- pT->right->left = pT->left;
-
- this->insert( pT );
-
- if( pT->father->marker )
- this->decrease( pT->father, 0 );
- else
- pT->father->marker = true;
-
- pT->father = NULL;
- pT->marker = false;
- }
- }
-
- void cTmpEffFibHeap::erase( cTempEffect *pT ) // O( lg N )
- {
- this->decrease( pT, (pT->expiretime - this->head->expiretime) + 1 );
- this->deleteMin();
- }
-
- std::vector< cTempEffect* > cTempEffect::asVector()
- {
- std::vector< cTempEffect* > list_ = std::vector< cTempEffect* >();
-
- cTempEffect* iterNode = this;
-
- do
- {
- list_.push_back( iterNode );
- if( iterNode->son )
- {
- std::vector< cTempEffect* > sons_ = iterNode->son->asVector();
- list_.insert( list_.end(), sons_.begin(), sons_.end() );
- }
- iterNode = iterNode->right;
- } while( iterNode != this );
-
- return list_;
- }
-
- std::vector< cTempEffect* > cTmpEffFibHeap::asVector()
- {
- if( this->head )
- return this->head->asVector();
- else
- return std::vector< cTempEffect* >();
- }
- */
-
cRepeatAction::cRepeatAction( P_CHAR mage, UINT8 anim, UINT32 delay )
{
--- 368,371 ----
***************
*** 636,677 ****
}
}
-
- /*
- cFleeReset::cFleeReset( P_NPC pNPC, UINT32 time )
- {
- m_npc = pNPC;
- objectid = "cFleeReset";
- serializable = true;
- dispellable = false;
- expiretime = uiCurrentTime + time * MY_CLOCKS_PER_SEC;
- }
-
- void cFleeReset::Expire()
- {
- if( m_npc )
- {
- cNPC_AI* ai = m_npc->ai();
- if( ai && ai->currState() )
- {
- ai->currState()->ceaseFlee();
- ai->updateState();
- }
- }
- }
-
- void cFleeReset::Serialize( ISerialization &archive )
- {
- if( archive.isReading() )
- {
- SERIAL character = INVALID_SERIAL;
- archive.read( "charserial", character );
- m_npc = dynamic_cast<P_NPC>(World::instance()->findChar( character ));
- }
- else
- {
- archive.write( "charserial", m_npc ? m_npc->serial() : INVALID_SERIAL );
- }
-
- cTempEffect::Serialize( archive );
- }
- */
\ No newline at end of file
--- 476,477 ----
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.227
retrieving revision 1.228
diff -C2 -d -r1.227 -r1.228
*** wolf.dsp 11 Sep 2003 16:21:26 -0000 1.227
--- wolf.dsp 12 Sep 2003 15:29:00 -0000 1.228
***************
*** 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-mt320.lib python22.lib /nologo /subsystem:windows /map /machine:I386 /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-mt320.lib /nologo /subsystem:windows /map /machine:I386 /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
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.464
retrieving revision 1.465
diff -C2 -d -r1.464 -r1.465
*** wolfpack.cpp 11 Sep 2003 15:33:58 -0000 1.464
--- wolfpack.cpp 12 Sep 2003 15:29:00 -0000 1.465
***************
*** 539,542 ****
--- 539,545 ----
PyEval_RestoreThread( _save );
+ // Update our currenttime
+ uiCurrentTime = getNormalizedTime();
+
Console::instance()->poll();
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** world.cpp 11 Sep 2003 15:33:58 -0000 1.42
--- world.cpp 12 Sep 2003 15:29:00 -0000 1.43
***************
*** 254,293 ****
// Load Temporary Effects
! archive = cPluginFactory::serializationArchiver( "xml" );
!
! archive->prepareReading( "effects" );
!
! if ( archive->size() )
! {
! Console::instance()->send( QString( "Loading %1 Temp. Effects...\n" ).arg( archive->size() ) );
! progress_display progress( archive->size() );
!
! for ( i = 0; i < archive->size(); ++progress, ++i)
! {
! archive->readObjectID(objectID);
!
! cTempEffect* pTE = NULL;
!
! if( objectID == "HIDECHAR" )
! pTE = new cDelayedHideChar( INVALID_SERIAL );
!
! else if( objectID == "cPythonEffect" )
! pTE = new cPythonEffect;
!
! else
! {
! Console::instance()->log( LOG_ERROR, tr( "An unknown temporary Effect class was found: %1" ).arg( objectID ) );
! continue; // Skip the class, not a good habit but at the moment the user couldn't really debug the error
! }
!
! archive->readObject( pTE );
! TempEffects::instance()->insert( pTE );
! }
! }
!
! archive->close();
! delete archive;
! Console::instance()->PrepareProgress( tr("Postprocessing") );
P_ITEM pi;
--- 254,260 ----
// Load Temporary Effects
! TempEffects::instance()->load();
! Console::instance()->PrepareProgress( "Postprocessing" );
P_ITEM pi;
***************
*** 488,491 ****
--- 455,460 ----
persistentBroker->saveObject( pChar );
+ TempEffects::instance()->save();
+
persistentBroker->commitTransaction();
}
***************
*** 495,499 ****
Console::instance()->ChangeColor( WPC_RED );
! Console::instance()->send( " Failed" );
Console::instance()->ChangeColor( WPC_NORMAL );
--- 464,468 ----
Console::instance()->ChangeColor( WPC_RED );
! Console::instance()->send( " Failed\n" );
Console::instance()->ChangeColor( WPC_NORMAL );
***************
*** 502,511 ****
}
- ISerialization *archive = cPluginFactory::serializationArchiver( "xml" );
- archive->prepareWritting( "effects" );
- TempEffects::instance()->serialize( *archive );
- archive->close();
- delete archive;
-
// Save the accounts
Accounts::instance()->save();
--- 471,474 ----
***************
*** 519,523 ****
persistentBroker->disconnect();
! Console::instance()->send( QString( " [%1ms]\n" ).arg( getNormalizedTime() - startTime ) );
}
--- 482,486 ----
persistentBroker->disconnect();
! Console::instance()->send( QString( " [%1ms]\n" ).arg( uiCurrentTime - startTime ) );
}
--- iserialization.cpp DELETED ---
--- iserialization.h DELETED ---
--- serxmlfile.cpp DELETED ---
--- serxmlfile.h DELETED ---
|
|
From: <dar...@us...> - 2003-09-12 15:29:34
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv11737/python
Modified Files:
tempeffect.h
Log Message:
Implemented serialization of effects to the database (experimental!).
Index: tempeffect.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/tempeffect.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** tempeffect.h 11 Sep 2003 16:19:51 -0000 1.8
--- tempeffect.h 12 Sep 2003 15:29:00 -0000 1.9
***************
*** 32,37 ****
--- 32,44 ----
#define __TEMPEFFECT_H__
+ #include "engine.h"
+ #include "utilities.h"
+
#include "../TmpEff.h"
+ #include "../persistentbroker.h"
+ #include "../globals.h"
+ #include "../dbdriver.h"
#include "../world.h"
+ #include "../console.h"
class cPythonEffect : public cTempEffect
***************
*** 149,215 ****
}
! void Serialize( ISerialization &archive )
{
! if( archive.isReading() )
{
! archive.read( "functionname", functionName );
! archive.read( "dispelfunc", dispelFunc_ );
! archive.read( "dispelid", dispelId_ );
! UINT32 pCount;
! QString type;
! archive.read( "pcount", pCount );
! args = PyTuple_New( pCount );
! for( UINT32 i = 0; i < pCount; ++i )
! {
! archive.read( QString( "pt%1" ).arg( i ), type );
! // Read an integer
! if( type == "i" )
! {
! INT32 data;
! archive.read( QString( "pv%1" ).arg( i ), data );
! PyObject *obj = PyInt_FromLong( data );
! PyTuple_SetItem( args, i, PyInt_FromLong( data ) );
! }
! // Read a string
! else if( type == "s" )
! {
! QString data;
! archive.read( QString( "pv%1" ).arg( i ), data );
! PyObject *obj = PyString_FromString( data.latin1() );
! PyTuple_SetItem( args, i, obj );
! }
! }
! }
! else if( archive.isWritting() )
{
! archive.write( "functionname", functionName );
! archive.write( "dispelfunc", dispelFunc_ );
! archive.write( "dispelid", dispelId_ );
! archive.write( "pcount", PyTuple_Size( args ) );
! // Serialize the py object
! for( UINT32 i = 0; i < PyTuple_Size( args ); ++i )
! {
! if( PyInt_Check( PyTuple_GetItem( args, i ) ) )
! {
! archive.write( QString( "pt%1" ).arg( i ), QString( "i" ) );
! archive.write( QString( "pv%1" ).arg( i ), (int)PyInt_AsLong( PyTuple_GetItem( args, i ) ) );
! }
! else if( PyString_Check( PyTuple_GetItem( args, i ) ) )
! {
! archive.write( QString( "pt%1" ).arg( i ), QString( "s" ) );
! archive.write( QString( "pv%1" ).arg( i ), PyString_AsString( PyTuple_GetItem( args, i ) ) );
! }
! // Something we can't save -> Py_None on load
! else
! archive.write( QString( "pt%1" ).arg( i ), QString( "n" ) );
! }
}
! cTempEffect::Serialize( archive );
}
};
--- 156,225 ----
}
! void save( unsigned int id )
{
! saveString( id, "functionname", functionName );
! saveString( id, "dispelfunc", dispelFunc_ );
! saveString( id, "dispelid", dispelId_ );
! saveInt( id, "pycount", PyTuple_Size( args ) );
!
! // Serialize the py object
! for( int i = 0; i < PyTuple_Size( args ); ++i )
{
! if( PyInt_Check( PyTuple_GetItem( args, i ) ) )
! {
! saveInt( id, "pyarg_" + QString::number( i ), (int)PyInt_AsLong( PyTuple_GetItem( args, i ) ) );
! }
! else if( PyString_Check( PyTuple_GetItem( args, i ) ) )
! {
! saveString( id, "pyarg_" + QString::number( i ), PyString_AsString( PyTuple_GetItem( args, i ) ) );
! }
! else if( PyFloat_Check( PyTuple_GetItem( args, i ) ) )
! {
! saveFloat( id, "pyarg_" + QString::number( i ), PyFloat_AsDouble( PyTuple_GetItem( args, i ) ) );
! }
! }
! cTempEffect::save( id );
! }
! void load( unsigned int id, const char **result )
! {
! // Load the Base Properties and then Select
! loadString( id, "functionname", functionName );
! loadString( id, "dispelfunc", dispelFunc_ );
! loadString( id, "dispelid", dispelId_ );
!
! int count;
! loadInt( id, "pycount", count );
! args = PyTuple_New( count );
!
! for( int i = 0; i < count; ++i )
! PyTuple_SetItem( args, i, Py_None );
!
! cDBResult res = persistentBroker->query( QString( "SELECT key,type,value FROM effects_properties WHERE id = %1 AND key LIKE 'pyarg_%'" ).arg( id ) );
!
! while( res.fetchrow() )
{
! QString key = res.getString( 0 );
! QString type = res.getString( 1 );
! QString value = res.getString( 2 );
! int id = key.right( key.length() - 3 ).toInt();
! if( id >= count )
! continue;
!
! if( type == "string" )
! PyTuple_SetItem( args, id, PyString_FromString( value.latin1() ) );
! else if( type == "int" )
! PyTuple_SetItem( args, id, PyInt_FromLong( value.toInt() ) );
! else if( type == "float" )
! PyTuple_SetItem( args, id, PyFloat_FromDouble( value.toFloat() ) );
}
! res.free();
!
! cTempEffect::load( id, result );
}
};
|
|
From: <dar...@us...> - 2003-09-11 16:47:28
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/monsters In directory sc8-pr-cvs1:/tmp/cvs-serv7504/npcs/monsters Modified Files: base.xml Log Message: Index: base.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/monsters/base.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** base.xml 7 Sep 2003 22:00:19 -0000 1.6 --- base.xml 11 Sep 2003 16:47:22 -0000 1.7 *************** *** 1,3 **** - <!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by Kosha (SiH) --> <!-- ================================================================= --- 1,2 ---- |
|
From: <dar...@us...> - 2003-09-11 16:24:41
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv2859 Modified Files: pfactory.cpp Log Message: Updated the Project File. Index: pfactory.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/pfactory.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pfactory.cpp 11 Sep 2003 12:22:24 -0000 1.4 --- pfactory.cpp 11 Sep 2003 16:24:38 -0000 1.5 *************** *** 32,36 **** #include "pfactory.h" #include "iserialization.h" - #include "serbinfile.h" #include "serxmlfile.h" --- 32,35 ---- |
|
From: <dar...@us...> - 2003-09-11 16:21:29
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv2442 Modified Files: wolf.dsp Log Message: Updated the Project File. Index: wolf.dsp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v retrieving revision 1.226 retrieving revision 1.227 diff -C2 -d -r1.226 -r1.227 *** wolf.dsp 11 Sep 2003 15:33:58 -0000 1.226 --- wolf.dsp 11 Sep 2003 16:21:26 -0000 1.227 *************** *** 271,278 **** # Begin Source File - SOURCE=.\serbinfile.cpp - # End Source File - # Begin Source File - SOURCE=.\serxmlfile.cpp # End Source File --- 271,274 ---- *************** *** 762,769 **** # Begin Source File - SOURCE=.\prototypes.h - # End Source File - # Begin Source File - SOURCE=.\pythonscript.h # End Source File --- 758,761 ---- *************** *** 812,819 **** SOURCE=.\sectors.h - # End Source File - # Begin Source File - - SOURCE=.\serbinfile.h # End Source File # Begin Source File --- 804,807 ---- |
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv2086
Modified Files:
basechar.cpp basechar.h basedef.cpp console.cpp corpse.cpp
dbl_single_click.cpp definable.cpp encryption.cpp gumps.cpp
house.cpp makemenus.h resources.cpp spawnregions.cpp
targetactions.cpp wolfpack.h wolfpack.pro wpdefmanager.cpp
Removed Files:
prototypes.h serbinfile.cpp serbinfile.h
Log Message:
Removed prototypes.h and reintroduced wolfpack.h with intelligent content.
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** basechar.cpp 11 Sep 2003 15:33:58 -0000 1.42
--- basechar.cpp 11 Sep 2003 16:19:49 -0000 1.43
***************
*** 32,35 ****
--- 32,36 ----
#include "basechar.h"
#include "basedef.h"
+ #include "npc.h"
#include "player.h"
#include "globals.h"
***************
*** 39,42 ****
--- 40,44 ----
#include "console.h"
#include "maps.h"
+ #include "inlines.h"
#include "chars.h"
#include "sectors.h"
***************
*** 2013,2015 ****
--- 2015,2105 ----
soundEffect( sound, hearall );
+ }
+
+ void cBaseChar::showPaperdoll( cUOSocket *source, bool hotkey )
+ {
+ if( !source )
+ return;
+
+ P_PLAYER pChar = source->player();
+
+ if( !pChar || onShowPaperdoll( pChar ) )
+ return;
+
+ // For players we'll always show the Paperdoll
+ if( isHuman() || objectType() != enNPC )
+ {
+ // If we're mounted (item on layer 25) and *not* using a hotkey
+ // We're trying to unmount ourself
+ if( !hotkey && ( this == pChar ) && pChar->unmount() )
+ return; // We have been unmounted
+
+ source->sendPaperdoll( this );
+ }
+
+ // Is that faster ??
+
+ switch( bodyID_ )
+ {
+ case 0x0034:
+ case 0x004E:
+ case 0x0050:
+ case 0x003A:
+ case 0x0039:
+ case 0x003B:
+ case 0x0074:
+ case 0x0075:
+ case 0x0072:
+ case 0x007A:
+ case 0x0084:
+ case 0x0073:
+ case 0x0076:
+ case 0x0077:
+ case 0x0078:
+ case 0x0079:
+ case 0x00AA:
+ case 0x00AB:
+ case 0x00BB:
+ case 0x0090:
+ case 0x00C8:
+ case 0x00E2:
+ case 0x00E4:
+ case 0x00CC:
+ case 0x00DC:
+ case 0x00D2:
+ case 0x00DA:
+ case 0x00DB:
+ case 0x0317:
+ case 0x0319:
+ case 0x031A:
+ case 0x031F:
+ // Try to mount the rideable animal
+ if( dist( pChar ) < 2 || pChar->isGM() )
+ {
+ if( !pChar->isHuman() )
+ {
+ source->sysMessage( tr( "You are unable to ride an animal." ) );
+ return;
+ }
+
+ if( pChar->isDead() )
+ {
+ source->clilocMessage( 0x7A4D5, "", 0x3b2 ); // You can't do that when you're dead.
+ return;
+ }
+
+ if( isAtWar() )
+ source->sysMessage( tr( "Your pet is in battle right now!" ) );
+ else
+ pChar->mount( dynamic_cast<P_NPC>( this ) );
+ }
+ else
+ source->sysMessage( tr( "This is too far away" ) );
+
+ break;
+ case 0x123:
+ case 0x124:
+ if( objectType() == enNPC && dynamic_cast<P_NPC>(this)->owner() == pChar )
+ source->sendContainer( getBackpack() );
+ };
}
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** basechar.h 11 Sep 2003 15:33:58 -0000 1.33
--- basechar.h 11 Sep 2003 16:19:50 -0000 1.34
***************
*** 148,151 ****
--- 148,152 ----
void bark( enBark ); // Play a body dependant sound
void goldSound( unsigned short amount, bool hearall = true ); // Play a sound for dropping goldcoins depending on the amount
+ void showPaperdoll( cUOSocket *source, bool hotkey );
virtual bool checkSkill( UI16 skill, SI32 min, SI32 max, bool advance = true );
cItem* atLayer( enLayer layer ) const;
Index: basedef.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basedef.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** basedef.cpp 7 Sep 2003 19:07:46 -0000 1.3
--- basedef.cpp 11 Sep 2003 16:19:50 -0000 1.4
***************
*** 33,37 ****
#include "globals.h"
#include "wpdefmanager.h"
- #include "prototypes.h"
#include "basics.h"
--- 33,36 ----
Index: console.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** console.cpp 11 Sep 2003 12:22:24 -0000 1.4
--- console.cpp 11 Sep 2003 16:19:50 -0000 1.5
***************
*** 40,45 ****
#include "player.h"
#include "accounts.h"
- #include "prototypes.h"
#include "inlines.h"
// Library Includes
--- 40,45 ----
#include "player.h"
#include "accounts.h"
#include "inlines.h"
+ #include "wolfpack.h"
// Library Includes
Index: corpse.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/corpse.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** corpse.cpp 27 Aug 2003 23:20:56 -0000 1.34
--- corpse.cpp 11 Sep 2003 16:19:50 -0000 1.35
***************
*** 36,40 ****
#include "persistentbroker.h"
#include "globals.h"
- #include "prototypes.h"
#include "world.h"
#include "player.h"
--- 36,39 ----
Index: dbl_single_click.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbl_single_click.cpp,v
retrieving revision 1.223
retrieving revision 1.224
diff -C2 -d -r1.223 -r1.224
*** dbl_single_click.cpp 11 Sep 2003 12:25:23 -0000 1.223
--- dbl_single_click.cpp 11 Sep 2003 16:19:50 -0000 1.224
***************
*** 690,799 ****
socket->sysMessage( tr( "You can't think of a way to use that item." ) );
}
-
- /*!
- Handles Double clicks over PC/NPCs
- */
- void showPaperdoll( cUOSocket *socket, P_CHAR pTarget, bool hotkey )
- {
- if( !socket )
- return;
-
- P_PLAYER pChar = socket->player();
-
- if( !pChar || !pTarget )
- return;
-
- if( pTarget->onShowPaperdoll( pChar ) )
- return;
-
- // For players we'll always show the Paperdoll
- if( pTarget->isHuman() || pTarget->objectType() != enNPC )
- {
- /* // Theres one exception for player vendors, when you double click them
- // Their packs should open instead of their paperdoll
- if( pTarget->npcaitype() == 17 )
- {
- pTarget->talk( tr( "Take a look at my goods" ) );
-
- if( pTarget->getBackpack() )
- socket->sendContainer( pTarget->getBackpack() );
-
- return;
- }
- */
-
- // If we're mounted (item on layer 25) and *not* using a hotkey
- // We're trying to unmount ourself
- if( !hotkey && ( pTarget == pChar ) && pChar->unmount() )
- return; // We have been unmounted
-
- socket->sendPaperdoll( pTarget );
- }
-
- UINT16 body = pTarget->bodyID();
-
- // Is that faster ??
-
- switch( body )
- {
- case 0x0034:
- case 0x004E:
- case 0x0050:
- case 0x003A:
- case 0x0039:
- case 0x003B:
- case 0x0074:
- case 0x0075:
- case 0x0072:
- case 0x007A:
- case 0x0084:
- case 0x0073:
- case 0x0076:
- case 0x0077:
- case 0x0078:
- case 0x0079:
- case 0x00AA:
- case 0x00AB:
- case 0x00BB:
- case 0x0090:
- case 0x00C8:
- case 0x00E2:
- case 0x00E4:
- case 0x00CC:
- case 0x00DC:
- case 0x00D2:
- case 0x00DA:
- case 0x00DB:
- case 0x0317:
- case 0x0319:
- case 0x031A:
- case 0x031F:
- // Try to mount the rideable animal
- if( pChar->dist( pTarget ) < 2 || pChar->isGM() )
- {
- if( !pChar->isHuman() )
- {
- socket->sysMessage( tr( "You are unable to ride an animal" ) );
- return;
- }
- if( pChar->isDead() )
- {
- socket->clilocMessage( 0x7A4D5, "", 0x3b2 ); // You can't do that when you're dead.
-
- return;
- }
- if( pTarget->isAtWar() )
- socket->sysMessage( tr("Your pet is in battle right now!" ) );
- else
- pChar->mount( dynamic_cast<P_NPC>(pTarget) );
- }
- else
- socket->sysMessage( tr( "This is too far away" ) );
-
- break;
- case 0x123:
- case 0x124:
- if( pTarget->objectType() == enNPC && dynamic_cast<P_NPC>(pTarget)->owner() == pChar )
- socket->sendContainer( pTarget->getBackpack() );
- };
- }
--- 690,691 ----
Index: definable.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/definable.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** definable.cpp 6 Jul 2003 13:48:01 -0000 1.13
--- definable.cpp 11 Sep 2003 16:19:50 -0000 1.14
***************
*** 34,38 ****
#include "globals.h"
#include "basics.h"
- #include "prototypes.h"
// Qt Includes
--- 34,37 ----
Index: encryption.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/encryption.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** encryption.cpp 8 Sep 2003 10:58:47 -0000 1.14
--- encryption.cpp 11 Sep 2003 16:19:50 -0000 1.15
***************
*** 41,45 ****
#include "console.h"
#include "globals.h"
- #include "prototypes.h"
#include "log.h"
#include "basics.h"
--- 41,44 ----
Index: gumps.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/gumps.cpp,v
retrieving revision 1.143
retrieving revision 1.144
diff -C2 -d -r1.143 -r1.144
*** gumps.cpp 7 Sep 2003 19:07:46 -0000 1.143
--- gumps.cpp 11 Sep 2003 16:19:50 -0000 1.144
***************
*** 31,35 ****
#include "accounts.h"
- #include "prototypes.h"
#include "globals.h"
#include "gumps.h"
--- 31,34 ----
Index: house.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/house.cpp,v
retrieving revision 1.115
retrieving revision 1.116
diff -C2 -d -r1.115 -r1.116
*** house.cpp 11 Sep 2003 12:22:24 -0000 1.115
--- house.cpp 11 Sep 2003 16:19:50 -0000 1.116
***************
*** 31,35 ****
/* House code for deed creation by Tal Strake, revised by Cironian */
- //#include "wolfpack.h"
#include "house.h"
#include "persistentbroker.h"
--- 31,34 ----
Index: makemenus.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/makemenus.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** makemenus.h 4 Sep 2003 20:10:03 -0000 1.29
--- makemenus.h 11 Sep 2003 16:19:50 -0000 1.30
***************
*** 36,40 ****
#include "definable.h"
#include "gumps.h"
- #include "prototypes.h"
#include "singleton.h"
--- 36,39 ----
Index: resources.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/resources.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** resources.cpp 8 Sep 2003 10:58:47 -0000 1.46
--- resources.cpp 11 Sep 2003 16:19:50 -0000 1.47
***************
*** 34,38 ****
#include "globals.h"
- #include "prototypes.h"
#include "wpdefmanager.h"
#include "network/uosocket.h"
--- 34,37 ----
Index: spawnregions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/spawnregions.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** spawnregions.cpp 11 Sep 2003 12:22:24 -0000 1.49
--- spawnregions.cpp 11 Sep 2003 16:19:50 -0000 1.50
***************
*** 50,54 ****
#include "basics.h"
#include "console.h"
- //#include "wolfpack.h" // needed for objects Npcs and Items
using namespace std;
--- 50,53 ----
Index: targetactions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetactions.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** targetactions.cpp 7 Sep 2003 19:07:47 -0000 1.29
--- targetactions.cpp 11 Sep 2003 16:19:50 -0000 1.30
***************
*** 32,36 ****
#include "srvparams.h"
#include "skills.h"
- #include "prototypes.h"
#include "TmpEff.h"
#include "items.h"
--- 32,35 ----
Index: wolfpack.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** wolfpack.h 8 Sep 2003 10:58:47 -0000 1.35
--- wolfpack.h 11 Sep 2003 16:19:50 -0000 1.36
***************
*** 30,58 ****
//==================================================================================
! #ifndef __WOLFPACK_H
! #define __WOLFPACK_H
! // Platform specifics
! #include "platform.h"
- #if defined (__unix__)
- #include <termios.h>
- #include <stdio.h>
- #include <fcntl.h>
#endif
-
- #include "typedefs.h"
- #include "defines.h"
- #include "structs.h"
- #include "globals.h"
- #include "prototypes.h"
- #include "inlines.h"
- #include "items.h"
- #include "basics.h"
- #include "network.h"
- #include "console.h"
- #include "world.h"
-
-
- #endif // __WOLFPACK_H
-
--- 30,37 ----
//==================================================================================
! #if !defined( __WOLFPACK_H__ )
! #define __WOLFPACK_H__
! void reloadScripts();
#endif
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.157
retrieving revision 1.158
diff -C2 -d -r1.157 -r1.158
*** wolfpack.pro 9 Sep 2003 22:04:48 -0000 1.157
--- wolfpack.pro 11 Sep 2003 16:19:50 -0000 1.158
***************
*** 102,106 ****
pfactory.h \
platform.h \
- prototypes.h \
persistentbroker.h \
persistentobject.h \
--- 102,105 ----
***************
*** 116,120 ****
srvparams.h \
serxmlfile.h \
- serbinfile.h \
skills.h \
stream.h \
--- 115,118 ----
***************
*** 180,184 ****
sectors.cpp \
serxmlfile.cpp \
- serbinfile.cpp \
scriptmanager.cpp \
skills.cpp \
--- 178,181 ----
Index: wpdefmanager.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wpdefmanager.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** wpdefmanager.cpp 11 Sep 2003 12:22:25 -0000 1.64
--- wpdefmanager.cpp 11 Sep 2003 16:19:50 -0000 1.65
***************
*** 41,45 ****
#include "wpdefmanager.h"
#include "globals.h"
- #include "prototypes.h"
#include "basics.h"
#include "inlines.h"
--- 41,44 ----
--- prototypes.h DELETED ---
--- serbinfile.cpp DELETED ---
--- serbinfile.h DELETED ---
|
|
From: <dar...@us...> - 2003-09-11 16:19:54
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1:/tmp/cvs-serv2086/python Modified Files: char.cpp content.h global.cpp item.cpp multi.cpp tempeffect.h Log Message: Removed prototypes.h and reintroduced wolfpack.h with intelligent content. Index: char.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** char.cpp 11 Sep 2003 15:33:58 -0000 1.102 --- char.cpp 11 Sep 2003 16:19:50 -0000 1.103 *************** *** 35,40 **** #include "../territories.h" - #include "../prototypes.h" - #include "../wolfpack.h" #include "../skills.h" #include "../combat.h" --- 35,38 ---- Index: content.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/content.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** content.h 4 Aug 2003 07:28:18 -0000 1.7 --- content.h 11 Sep 2003 16:19:50 -0000 1.8 *************** *** 35,39 **** #include "../defines.h" #include "../globals.h" ! #include "../wolfpack.h" #include "../basechar.h" #include "utilities.h" --- 35,40 ---- #include "../defines.h" #include "../globals.h" ! #include "../items.h" ! #include "../world.h" #include "../basechar.h" #include "utilities.h" Index: global.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** global.cpp 11 Sep 2003 12:22:25 -0000 1.90 --- global.cpp 11 Sep 2003 16:19:50 -0000 1.91 *************** *** 60,63 **** --- 60,64 ---- #include "../targetrequests.h" #include "../basedef.h" + #include "../wolfpack.h" #include "pypacket.h" Index: item.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** item.cpp 30 Aug 2003 17:00:13 -0000 1.73 --- item.cpp 11 Sep 2003 16:19:51 -0000 1.74 *************** *** 33,38 **** #include "../items.h" #include "../tilecache.h" - #include "../prototypes.h" - #include "../wolfpack.h" #include "../scriptmanager.h" #include "../itemid.h" --- 33,36 ---- Index: multi.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/multi.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** multi.cpp 23 Aug 2003 15:20:29 -0000 1.17 --- multi.cpp 11 Sep 2003 16:19:51 -0000 1.18 *************** *** 33,38 **** #include "../items.h" #include "../tilecache.h" - #include "../prototypes.h" - #include "../wolfpack.h" #include "../scriptmanager.h" #include "../itemid.h" --- 33,36 ---- *************** *** 41,44 **** --- 39,43 ---- #include "../basechar.h" #include "../network/uotxpackets.h" + #include "../network/uosocket.h" #include "utilities.h" Index: tempeffect.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/tempeffect.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tempeffect.h 5 May 2003 11:59:15 -0000 1.7 --- tempeffect.h 11 Sep 2003 16:19:51 -0000 1.8 *************** *** 33,37 **** #include "../TmpEff.h" - #include "../prototypes.h" #include "../world.h" --- 33,36 ---- |
|
From: <dar...@us...> - 2003-09-11 16:19:53
|
Update of /cvsroot/wpdev/wolfpack/network
In directory sc8-pr-cvs1:/tmp/cvs-serv2086/network
Modified Files:
uosocket.cpp
Log Message:
Removed prototypes.h and reintroduced wolfpack.h with intelligent content.
Index: uosocket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v
retrieving revision 1.285
retrieving revision 1.286
diff -C2 -d -r1.285 -r1.286
*** uosocket.cpp 11 Sep 2003 12:22:25 -0000 1.285
--- uosocket.cpp 11 Sep 2003 16:19:50 -0000 1.286
***************
*** 40,44 ****
#include "../accounts.h"
#include "../globals.h"
! #include "../wolfpack.h"
#include "../territories.h"
#include "../sectors.h"
--- 40,45 ----
#include "../accounts.h"
#include "../globals.h"
! #include "../basics.h"
! #include "../console.h"
#include "../territories.h"
#include "../sectors.h"
***************
*** 1307,1312 ****
void cUOSocket::handleDoubleClick( cUORxDoubleClick* packet )
{
! if ( isCharSerial(packet->serial() ) )
! showPaperdoll( this, FindCharBySerial( packet->serial() ), packet->keyboard() );
else
{
--- 1308,1317 ----
void cUOSocket::handleDoubleClick( cUORxDoubleClick* packet )
{
! P_CHAR pChar = World::instance()->findChar( packet->serial() );
!
! if( pChar )
! {
! pChar->showPaperdoll( this, packet->keyboard() );
! }
else
{
|
|
From: <dar...@us...> - 2003-09-11 15:34:03
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv24987
Modified Files:
Timing.cpp ai_animals.cpp basechar.cpp basechar.h combat.cpp
defines.h dragdrop.cpp npc.cpp player.cpp prototypes.h
targetrequests.cpp wolf.dsp wolfpack.cpp world.cpp
Log Message:
Cleaned up the code alot.
Index: Timing.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/Timing.cpp,v
retrieving revision 1.180
retrieving revision 1.181
diff -C2 -d -r1.180 -r1.181
*** Timing.cpp 11 Sep 2003 12:22:24 -0000 1.180
--- Timing.cpp 11 Sep 2003 15:33:58 -0000 1.181
***************
*** 320,376 ****
}
- setcharflag( pc );
-
- /* still needed !?
- if( pc->isPlayer() && pc->casting() )//PC casting a spell
- {
- pc->setNextact( pc->nextact() - 1 );
- if( pc->spelltime() <= currenttime )//Spell is complete target it
- {
- // TODO: Reactivate when spellcasting is redone
- //Magic->AfterSpellDelay( s, pc );
- }
- else if( pc->nextact() <= 0 )//redo the spell action
- {
- pc->setNextact( 75 );
- pc->action( pc->spellaction() );
- }
- }
- */
- /*
- // Reset spirit-speak
- if( pc->spiritspeaktimer() > 0 && pc->spiritspeaktimer() <= uiCurrentTime )
- pc->setSpiritSpeakTimer(0);
- */
-
- #pragma message("TODO: jail reimplementation with python")
- /*
- // Jail stuff
- if( pc->cell() > 0 )
- {
- if( ( pc->jailtimer() > 0 ) && ( pc->jailtimer() <= uiCurrentTime ) )
- {
- socket->sysMessage( tr( "Your jail time is over!" ) );
-
- if( pc )
- {
- jails[ pc->cell() ].occupied = false;
-
- pc->removeFromView( false );
- pc->moveTo( jails[ pc->cell() ].oldpos );
- pc->resend( false );
-
- pc->setCell(0);
- pc->setJailSecs(0);
- pc->setJailTimer(0);
- pc->setPriv2(0);
-
- savelog( tr( "%1 [0x%2] is automatically released from jail." ).arg( pc->name() ).arg( pc->serial(), 8, 16 ), "server.log" );
- socket->sysMessage( tr( "You have been released." ) );
- }
- }
- }
- */
-
if( SrvParams->hungerRate() > 1 && ( pc->hungerTime() <= currenttime ) )
{
--- 320,323 ----
***************
*** 422,427 ****
pc->ai()->check();
}
-
- setcharflag( pc );
// We are at war and want to prepare a new swing
--- 369,372 ----
Index: ai_animals.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai_animals.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ai_animals.cpp 20 Aug 2003 17:10:48 -0000 1.5
--- ai_animals.cpp 11 Sep 2003 15:33:58 -0000 1.6
***************
*** 78,82 ****
m_npc->setWanderFollowTarget( pTalker );
m_npc->setWanderType( enFollowTarget );
! playmonstersound( m_npc, m_npc->bodyID(), SND_STARTATTACK );
}
else
--- 78,82 ----
m_npc->setWanderFollowTarget( pTalker );
m_npc->setWanderType( enFollowTarget );
! m_npc->bark( cBaseChar::Bark_Attacking );
}
else
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** basechar.cpp 8 Sep 2003 10:58:46 -0000 1.41
--- basechar.cpp 11 Sep 2003 15:33:58 -0000 1.42
***************
*** 31,34 ****
--- 31,35 ----
// wolfpack includes
#include "basechar.h"
+ #include "basedef.h"
#include "player.h"
#include "globals.h"
***************
*** 532,536 ****
else
{
! playmonstersound( this, orgBodyID_, SND_DIE );
}
}
--- 533,537 ----
else
{
! bark( Bark_Death );
}
}
***************
*** 1965,1967 ****
--- 1966,2015 ----
return amount;
+ }
+
+ void cBaseChar::bark( enBark type )
+ {
+ cCharBaseDef *basedef = BaseDefManager::instance()->getCharBaseDef( bodyID_ );
+
+ if( !basedef || !basedef->basesound() ) // Nothing known about this creature
+ return;
+
+ switch( basedef->soundmode() )
+ {
+ // Only Attack, Hit and Death sounds available (Falltrough!)
+ case 2:
+ if( type == Bark_GetHit )
+ return;
+
+ // Only Attack, Hit, GetHit and Death
+ case 3:
+ if( type == Bark_Idle )
+ return;
+
+ break;
+
+ // Only the first sound is available
+ case 4:
+ if( type != Bark_Attacking )
+ return;
+
+ default:
+ break;
+ }
+
+ soundEffect( basedef->basesound() + (unsigned char)type );
+ }
+
+ void cBaseChar::goldSound( unsigned short amount, bool hearall )
+ {
+ unsigned short sound;
+
+ if( amount == 1 )
+ sound = 0x35;
+ else if( amount > 1 && amount < 6 )
+ sound = 0x36;
+ else
+ sound = 0x37;
+
+ soundEffect( sound, hearall );
}
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** basechar.h 9 Sep 2003 20:56:53 -0000 1.32
--- basechar.h 11 Sep 2003 15:33:58 -0000 1.33
***************
*** 77,80 ****
--- 77,88 ----
BuyNoRestockContainer, SellContainer, BankBox, Dragging };
+ enum enBark {
+ Bark_Attacking= 0,
+ Bark_Idle,
+ Bark_Hit,
+ Bark_GetHit,
+ Bark_Death
+ };
+
// implementation of interfaces
void load( char **, ushort& );
***************
*** 138,141 ****
--- 146,151 ----
P_ITEM rightHandItem() const;
P_ITEM leftHandItem() const;
+ void bark( enBark ); // Play a body dependant sound
+ void goldSound( unsigned short amount, bool hearall = true ); // Play a sound for dropping goldcoins depending on the amount
virtual bool checkSkill( UI16 skill, SI32 min, SI32 max, bool advance = true );
cItem* atLayer( enLayer layer ) const;
Index: combat.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/combat.cpp,v
retrieving revision 1.150
retrieving revision 1.151
diff -C2 -d -r1.150 -r1.151
*** combat.cpp 11 Sep 2003 12:22:24 -0000 1.150
--- combat.cpp 11 Sep 2003 15:33:58 -0000 1.151
***************
*** 189,193 ****
}
else
! playmonstersound( pChar, pChar->bodyID(), SND_DEFEND );
}
--- 189,193 ----
}
else
! pChar->bark( cBaseChar::Bark_GetHit );
}
***************
*** 1108,1112 ****
pAttacker->action( action );
! playmonstersound( pAttacker, pAttacker->bodyID(), SND_ATTACK );
}
else if (pAttacker->atLayer(cBaseChar::Mount))
--- 1108,1112 ----
pAttacker->action( action );
! pAttacker->bark( cBaseChar::Bark_Hit );
}
else if (pAttacker->atLayer(cBaseChar::Mount))
Index: defines.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/defines.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** defines.h 11 Jun 2003 10:54:07 -0000 1.41
--- defines.h 11 Sep 2003 15:33:58 -0000 1.42
***************
*** 93,104 ****
//////////////////
-
- // List of monster sounds
- #define SND_STARTATTACK 0
- #define SND_IDLE 1
- #define SND_ATTACK 2
- #define SND_DEFEND 3
- #define SND_DIE 4
-
// List of skill numbers (For later implementation)
#define ALCHEMY 0
--- 93,96 ----
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.198
retrieving revision 1.199
diff -C2 -d -r1.198 -r1.199
*** dragdrop.cpp 7 Sep 2003 19:07:46 -0000 1.198
--- dragdrop.cpp 11 Sep 2003 15:33:58 -0000 1.199
***************
*** 468,472 ****
// Handle the sound-effect
if( pItem->id() == 0xEED )
! goldsfx( socket, pItem->amount(), true );
// Update our weight.
--- 468,472 ----
// Handle the sound-effect
if( pItem->id() == 0xEED )
! pChar->goldSound( pItem->amount() );
// Update our weight.
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** npc.cpp 9 Sep 2003 23:09:30 -0000 1.43
--- npc.cpp 11 Sep 2003 15:33:58 -0000 1.44
***************
*** 831,835 ****
return;
! playmonstersound( this, bodyID_, SND_STARTATTACK );
unsigned int cdist=0 ;
--- 831,835 ----
return;
! bark( Bark_Attacking );
unsigned int cdist=0 ;
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** player.cpp 9 Sep 2003 23:09:30 -0000 1.38
--- player.cpp 11 Sep 2003 15:33:58 -0000 1.39
***************
*** 470,477 ****
if( pp_t->kills_ >= SrvParams->maxkills() )
pp_t->socket()->sysMessage( tr( "You are now a murderer!" ) );
}
-
- setcharflag( pp_t );
}
}
--- 470,480 ----
if( pp_t->kills_ >= SrvParams->maxkills() )
+ {
pp_t->socket()->sysMessage( tr( "You are now a murderer!" ) );
+
+ // Set the Murder Decay Time
+ pp_t->setMurdererTime( getNormalizedTime() + SrvParams->murderdecay() * MY_CLOCKS_PER_SEC );
+ }
}
}
}
***************
*** 1063,1068 ****
}
! if( socket_ )
! goldsfx( socket_, amount, false );
}
--- 1066,1070 ----
}
! goldSound( amount, false );
}
***************
*** 1084,1089 ****
}
! if( socket_ )
! goldsfx( socket_, dAmount, false );
return dAmount;
--- 1086,1090 ----
}
! goldSound( amount, false );
return dAmount;
Index: prototypes.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/prototypes.h,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -d -r1.110 -r1.111
*** prototypes.h 7 Sep 2003 19:07:47 -0000 1.110
--- prototypes.h 11 Sep 2003 15:33:58 -0000 1.111
***************
*** 37,47 ****
void showPaperdoll( cUOSocket *socket, P_CHAR pTarget, bool hotkey );
-
- void goldsfx( cUOSocket *socket, UINT16 amount, bool hearall );
-
- void playmonstersound(P_CHAR monster, unsigned short id, int sfx);
void reloadScripts();
-
- void setcharflag(P_CHAR pc);
#endif
--- 37,41 ----
Index: targetrequests.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** targetrequests.cpp 7 Sep 2003 19:07:47 -0000 1.77
--- targetrequests.cpp 11 Sep 2003 15:33:58 -0000 1.78
***************
*** 152,156 ****
// Send the char to it's surroundings
- setcharflag( pChar );
pChar->resend( false ); // It's new so no need to remove it first
--- 152,155 ----
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.225
retrieving revision 1.226
diff -C2 -d -r1.225 -r1.226
*** wolf.dsp 11 Sep 2003 12:22:24 -0000 1.225
--- wolf.dsp 11 Sep 2003 15:33:58 -0000 1.226
***************
*** 43,47 ****
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MT /GR /GX /O2 /Ob0 /I "lib/Python/PC" /I "sqlite" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
--- 43,47 ----
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MD /GR /GX /O2 /Ob0 /I "lib/Python/PC" /I "sqlite" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
***************
*** 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 wsock32.lib $(QTDIR)\lib\qt-mt320.lib python22.lib /nologo /subsystem:windows /map /machine:I386 /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-mt320.lib python22.lib /nologo /subsystem:windows /map /machine:I386 /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
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.463
retrieving revision 1.464
diff -C2 -d -r1.463 -r1.464
*** wolfpack.cpp 11 Sep 2003 12:22:24 -0000 1.463
--- wolfpack.cpp 11 Sep 2003 15:33:58 -0000 1.464
***************
*** 30,74 ****
//==================================================================================
! #include "world.h"
! #include "verinfo.h"
! #include "speech.h"
! #include "territories.h"
#include "basics.h"
! #include "TmpEff.h"
! #include "combat.h"
! #include "sectors.h"
! #include "srvparams.h"
! #include "network.h"
! #include "exceptions.h"
! #include "gumps.h"
#include "commands.h"
! #include "spawnregions.h"
! #include "Timing.h"
! #include "tilecache.h"
! #include "accounts.h"
! #include "makemenus.h"
! #include "skills.h"
! #include "resources.h"
#include "contextmenu.h"
- #include "maps.h"
- #include "wpdefmanager.h"
- #include "log.h"
- #include "scriptmanager.h"
- #include "wptargetrequests.h"
- #include "python/engine.h"
- #include "persistentbroker.h"
#include "corpse.h"
#include "house.h"
! #include "boats.h"
#include "multiscache.h"
! #include "Trade.h"
! #include "network/uotxpackets.h"
! #include "basechar.h"
! #include "player.h"
#include "npc.h"
! #include "ai.h"
#include "sectors.h"
! #include "basedef.h"
! #include "console.h"
// Library Includes
--- 30,67 ----
//==================================================================================
! #include "accounts.h"
! #include "ai.h"
! #include "basedef.h"
#include "basics.h"
! #include "boats.h"
#include "commands.h"
! #include "console.h"
#include "contextmenu.h"
#include "corpse.h"
#include "house.h"
! #include "inlines.h"
! #include "log.h"
! #include "makemenus.h"
! #include "maps.h"
#include "multiscache.h"
! #include "network.h"
#include "npc.h"
! #include "persistentbroker.h"
! #include "player.h"
! #include "resources.h"
! #include "scriptmanager.h"
#include "sectors.h"
! #include "skills.h"
! #include "spawnregions.h"
! #include "srvparams.h"
! #include "territories.h"
! #include "tilecache.h"
! #include "Timing.h"
! #include "verinfo.h"
! #include "world.h"
! #include "wpdefmanager.h"
!
! #include "python/engine.h"
! #include "python/utilities.h"
// Library Includes
***************
*** 82,87 ****
#include <qthread.h>
- #include "python/utilities.h"
-
using namespace std;
--- 75,78 ----
***************
*** 592,751 ****
return 0;
- }
-
- void goldsfx( cUOSocket *socket, UINT16 amount, bool hearall )
- {
- if( !socket || !socket->player() )
- return;
-
- UINT16 sEffect = 0x37;
-
- if( amount == 1 )
- sEffect = 0x35;
- else if( amount > 1 && amount < 6 )
- sEffect = 0x36;
-
- if( !hearall )
- socket->soundEffect( sEffect );
- else
- {
- for( cUOSocket *mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next() )
- if( mSock->inRange( socket ) )
- mSock->soundEffect( sEffect );
- }
- }
-
- void playmonstersound(P_CHAR monster, unsigned short id, int sfx)
- {
- int basesound=0,x;
- char sf; short offset;
-
- cCharBaseDef *basedef = BaseDefManager::instance()->getCharBaseDef( id );
-
- if( !basedef ) // Nothing known about this creature
- return;
-
- x=id;
- basesound=basedef->basesound();
- sf=basedef->soundmode();
- offset=sfx;
-
- if (basesound != 0)
- {
- switch(sf)
- {
- case 0: break; // in normal case the offset is correct
- case 1: break; // birds sounds will be implmented later
-
- case 2: // only start-attack, attack & dýing sounds available
- if (sfx==1 || sfx==3) offset=-1; // idle, defend ? play nothing
- else if (sfx==2) offset=1; // correct offset
- else if (sfx==4) offset=2;
- break;
- case 3: // only start-attack, attack, defense & dying
- if (sfx==1) offset=-1; // idle -> play nothing
- else if (sfx==2) offset=1; // otherwise correct offsets
- else if (sfx==3) offset=2;
- else if (sfx==4) offset=3;
- break;
- case 4: // only a single sound
-
- if (sfx!=0) offset=-1; else offset=0;
-
- break;
- }
- basesound += offset;
- if (offset!=-1)
- monster->soundEffect( basesound );
- return;
- }
- }
-
- /*!
- Update the flagging of this character based
- on his reputation.
- */
- void setcharflag( P_CHAR pc )
- {
- //First, let's see their karma.
- if( pc->karma() <= -200 )
- {
- pc->setMurdererTime( uiCurrentTime + SrvParams->murderdecay() * MY_CLOCKS_PER_SEC );
- }
-
- if( pc->objectType() == enPlayer )
- {
- P_PLAYER pp = dynamic_cast<P_PLAYER>(pc);
- if (pp->isGMorCounselor())
- {
- pp->setMurdererTime( 0 );
- pp->setCriminalTime( 0 );
- return;
- }
- else if (pc->kills() >= (unsigned) SrvParams->maxkills())
- {
- pp->setMurdererTime( uiCurrentTime + SrvParams->murderdecay() * MY_CLOCKS_PER_SEC );
- return;
- }
- else if (pc->criminalTime() == 0)
- {
- pp->setMurdererTime( 0 );
- return;
- }
- else if (pc->criminalTime() > 0)
- {
- pp->makeCriminal();
- return;
- }
- else
- {
- pp->makeCriminal();
- }
- }
- else
- {
- /* switch (pc->npcaitype())
- {
- case 2: // bad npcs
- case 3: // bad healers
- case 50: // EV & BS
- pc->setMurderer();
- break;
- case 1: // good healers
- case 4: // teleport guard
- case 5: // beggars
- case 6: // chaos guard
- case 7: // order guard
- case 8: // banker
- case 9: // town guard
- case 11: // good npcs
- case 17: // player vendor
- case 18: // escort npcs
- case 19: // real estate brokers
- pc->setInnocent();
- break;
- default:
- if (pc->isHuman())
- {
- pc->setMurdererTime( 0 );
- pc->setCriminalTime( 0 );
- return;
- }
- if (SrvParams->animals_guarded() == 1 && pc->npcaitype() == 0 && !pc->isHuman() && !pc->tamed())
- {
- if (pc->inGuardedArea()) // in a guarded region, with guarded animals, animals == blue
- pc->setMurdererTime( 0 );
- pc->setCriminalTime( 0 );
- else // if the region's not guarded, they're gray
- pc->criminal();
- }
- else if( pc->owner() && !pc->isHuman() )
- {
- pc->setFlag( pc->owner()->flag() );
- }
- else
- pc->criminal();
- break;
- }*/
- }
}
--- 583,585 ----
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** world.cpp 11 Sep 2003 12:45:28 -0000 1.41
--- world.cpp 11 Sep 2003 15:33:58 -0000 1.42
***************
*** 419,425 ****
pChar->setRegion( region );
- // Now that we have our owner set correctly
- // do the charflags
- setcharflag( pChar );
pChar->flagUnchanged(); // We've just loaded, nothing changes
}
--- 419,422 ----
|
|
From: <dar...@us...> - 2003-09-11 15:34:02
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1:/tmp/cvs-serv24987/python Modified Files: char.cpp Log Message: Cleaned up the code alot. Index: char.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** char.cpp 3 Sep 2003 14:44:22 -0000 1.101 --- char.cpp 11 Sep 2003 15:33:58 -0000 1.102 *************** *** 257,261 **** } ! playmonstersound( self->pChar, self->pChar->bodyID(), getArgInt( 0 ) ); return PyTrue; } --- 257,266 ---- } ! unsigned char arg = getArgInt( 0 ); ! ! if( arg > cBaseChar::Bark_Death ) ! return PyFalse; ! ! self->pChar->bark( (cBaseChar::enBark)arg ); return PyTrue; } |
|
From: <dar...@us...> - 2003-09-11 12:45:32
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv20408 Modified Files: world.cpp Log Message: Fixed a progress inconsistency. Index: world.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** world.cpp 11 Sep 2003 12:22:24 -0000 1.40 --- world.cpp 11 Sep 2003 12:45:28 -0000 1.41 *************** *** 241,244 **** --- 241,247 ---- } + while( progress.count() < progress.expected_count() ) + ++progress; + res.free(); persistentBroker->driver()->setActiveConnection(); |
|
From: <xs...@us...> - 2003-09-11 12:25:28
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv16236
Modified Files:
dbl_single_click.cpp
Log Message:
Index: dbl_single_click.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbl_single_click.cpp,v
retrieving revision 1.222
retrieving revision 1.223
diff -C2 -d -r1.222 -r1.223
*** dbl_single_click.cpp 8 Sep 2003 10:58:47 -0000 1.222
--- dbl_single_click.cpp 11 Sep 2003 12:25:23 -0000 1.223
***************
*** 77,81 ****
P_PLAYER pc_currchar = socket->player();
! if( !pc_currchar->isGM() && pc_currchar->objectDelay() > 10 && pc_currchar->objectDelay() >= uiCurrentTime )
{
socket->sysMessage(tr("You must wait to perform another action."));
--- 77,81 ----
P_PLAYER pc_currchar = socket->player();
! if( !pc_currchar->isGM() && /*pc_currchar->objectDelay() > 10 && ???*/ pc_currchar->objectDelay() >= uiCurrentTime )
{
socket->sysMessage(tr("You must wait to perform another action."));
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv15450
Modified Files:
Timing.cpp Trade.h accounts.cpp basics.cpp basics.h combat.cpp
console.cpp console.h console_unix.cpp house.cpp
iserialization.h items.cpp pfactory.cpp serbinfile.cpp
serbinfile.h serxmlfile.cpp serxmlfile.h spawnregions.cpp
speech.h territories.cpp verinfo.h wolf.dsp wolfpack.cpp
world.cpp wpdefmanager.cpp
Removed Files:
stream.h utilsys.cpp utilsys.h wpconsole.cpp wpconsole.h
Log Message:
Removed references to STL strings and iostreams.
Index: Timing.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/Timing.cpp,v
retrieving revision 1.179
retrieving revision 1.180
diff -C2 -d -r1.179 -r1.180
*** Timing.cpp 9 Sep 2003 23:09:30 -0000 1.179
--- Timing.cpp 11 Sep 2003 12:22:24 -0000 1.180
***************
*** 35,39 ****
#include "Timing.h"
! #include "walking.h"
#include "TmpEff.h"
#include "combat.h"
--- 35,39 ----
#include "Timing.h"
! #include "basics.h"
#include "TmpEff.h"
#include "combat.h"
***************
*** 54,63 ****
#include "ai.h"
#include "inlines.h"
#include "world.h"
- #include "utilsys.h"
// Library Includes
#include <qdatetime.h>
#include <math.h>
using namespace std;
--- 54,64 ----
#include "ai.h"
#include "inlines.h"
+ #include "walking.h"
#include "world.h"
// Library Includes
#include <qdatetime.h>
#include <math.h>
+ #include <time.h>
using namespace std;
Index: Trade.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/Trade.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** Trade.h 7 Sep 2003 19:07:46 -0000 1.17
--- Trade.h 11 Sep 2003 12:22:24 -0000 1.18
***************
*** 37,43 ****
#include "inlines.h"
- //system includes
- #include <iostream>
-
// Wolfpack includes
#include "itemid.h"
--- 37,40 ----
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** accounts.cpp 9 Sep 2003 23:09:30 -0000 1.65
--- accounts.cpp 11 Sep 2003 12:22:24 -0000 1.66
***************
*** 51,92 ****
}
- /*void cAccount::Serialize( ISerialization& archive )
- {
- if ( archive.isReading() )
- {
- archive.read("login", login_);
- archive.read("password", password_);
- archive.read("flags", flags_);
- archive.read("acl", aclName_);
- QString temp;
- archive.read("lastlogin", temp);
- if( !temp.isNull() && !temp.isEmpty() && temp != "0" )
- lastLogin_ = QDateTime::fromString( temp, Qt::ISODate );
-
- archive.read("blockuntil", temp);
- if( !temp.isNull() && !temp.isEmpty() && temp != "0" )
- blockUntil = QDateTime::fromString( temp, Qt::ISODate );
-
- refreshAcl(); // Reload our ACL
- }
- else // Writting
- {
- archive.write( "login", login_ );
- archive.write( "password", password_ );
- archive.write( "flags", flags_ );
- archive.write( "acl", aclName_ );
-
- if( lastLogin_.isValid() )
- archive.write( "lastlogin", lastLogin_.toString( Qt::ISODate ) );
- else
- archive.write( "lastlogin", QString( "0" ) );
- if( blockUntil.isValid() )
- archive.write( "blockuntil", blockUntil.toString( Qt::ISODate ) );
- else
- archive.write( "blockuntil", QString( "0" ) );
- }
- cSerializable::Serialize( archive );
- }*/
-
bool cAccount::isBlocked() const
{
--- 51,54 ----
***************
*** 339,343 ****
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 );
--- 301,305 ----
QString sql( "INSERT INTO accounts VALUES( '%1', '%2', %3, '%4', %5, %6 );" );
! 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 );
persistentBroker->executeQuery( sql );
***************
*** 383,387 ****
{
cAccount *account = new cAccount;
! account->login_ = result.getString( 0 );
account->password_ = result.getString( 1 );
account->flags_ = result.getInt( 2 );
--- 345,349 ----
{
cAccount *account = new cAccount;
! account->login_ = result.getString( 0 ).lower();
account->password_ = result.getString( 1 );
account->flags_ = result.getInt( 2 );
Index: basics.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basics.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** basics.cpp 27 Feb 2003 16:31:52 -0000 1.25
--- basics.cpp 11 Sep 2003 12:22:24 -0000 1.26
***************
*** 30,39 ****
//==================================================================================
- ////////////////////////
- // name: basics.cpp
- // purpose: implementation of basic functions (that don't need wolfpack definitions)
- //
- //
-
// Wolfpack Includes
#include "basics.h"
--- 30,33 ----
***************
*** 47,50 ****
--- 41,50 ----
#include <stdlib.h>
+ #if defined( Q_OS_WIN32 )
+ #include <windows.h>
+ #else
+ #include <sys/time.h>
+ #endif
+
/*!
Returns a random number between \a nLowNum
***************
*** 145,147 ****
--- 145,186 ----
else
return value;
+ }
+
+ #if defined( Q_OS_WIN32 )
+
+ // Windows Version
+ // Return time in ms since system startup
+ static unsigned int getPlatformTime()
+ {
+ return GetTickCount();
+ }
+
+ #else
+
+ // Linux Version
+ // Return time in ms since system startup
+ static unsigned int getPlatformTime()
+ {
+ timeval tTime;
+ timezone tZone;
+
+ // Error handling wouldn't have much sense here.
+ gettimeofday( &tTime, &tZone );
+
+ return ( tTime.tv_sec * 1000 ) + (unsigned int)( tTime.tv_usec / 1000 );
+ }
+
+ #endif
+
+ unsigned int getNormalizedTime()
+ {
+ static unsigned int startTime = 0;
+
+ if( !startTime )
+ {
+ startTime = getPlatformTime();
+ return 0;
+ }
+
+ return getPlatformTime() - startTime;
}
Index: basics.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basics.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** basics.h 7 Sep 2003 19:07:46 -0000 1.15
--- basics.h 11 Sep 2003 12:22:24 -0000 1.16
***************
*** 83,85 ****
--- 83,87 ----
float RandomFloatNum(float nLowNum, float nHighNum);
+ unsigned int getNormalizedTime();
+
#endif
Index: combat.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/combat.cpp,v
retrieving revision 1.149
retrieving revision 1.150
diff -C2 -d -r1.149 -r1.150
*** combat.cpp 7 Sep 2003 19:07:46 -0000 1.149
--- combat.cpp 11 Sep 2003 12:22:24 -0000 1.150
***************
*** 36,40 ****
#include "itemid.h"
- #include "utilsys.h"
#include "sectors.h"
#include "combat.h"
--- 36,39 ----
Index: console.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** console.cpp 9 Sep 2003 23:09:30 -0000 1.3
--- console.cpp 11 Sep 2003 12:22:24 -0000 1.4
***************
*** 48,53 ****
#include <qthread.h>
- #include <iostream>
-
#if defined(Q_OS_WIN32)
# include <windows.h>
--- 48,51 ----
***************
*** 70,75 ****
{
bEnabled = true;
- // do nothing at the moment
- setStreams( &cin, &cout );
}
--- 68,71 ----
***************
*** 84,93 ****
{
bEnabled = bState;
- }
-
- void cConsole::setStreams(istream *in, ostream *out)
- {
- inputstrm = in;
- outputstrm = out;
}
--- 80,83 ----
Index: console.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** console.h 9 Sep 2003 23:09:30 -0000 1.4
--- console.h 11 Sep 2003 12:22:24 -0000 1.5
***************
*** 83,87 ****
void enabled(bool);
- void setStreams( std::istream *in, std::ostream *out );
// Send a message to the console
--- 83,86 ----
***************
*** 113,119 ****
void setAttributes( bool bold, bool italic, bool underlined, unsigned char r, unsigned char g, unsigned char b, unsigned char size, eFontType font );
private:
-
- std::istream *inputstrm;
- std::ostream *outputstrm;
bool bEnabled;
bool handleCommand( const QString &command, bool silentFail = false );
--- 112,115 ----
Index: console_unix.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_unix.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** console_unix.cpp 9 Sep 2003 22:17:59 -0000 1.3
--- console_unix.cpp 11 Sep 2003 12:22:24 -0000 1.4
***************
*** 36,41 ****
#include "globals.h"
- #include <iostream>
-
using namespace std;
--- 36,39 ----
***************
*** 156,164 ****
void cConsole::send(const QString &sMessage)
{
! if( outputstrm != NULL )
! {
! (*outputstrm) << sMessage.latin1();
! flush( *outputstrm );
! }
if( sMessage.contains( "\n" ) )
--- 154,159 ----
void cConsole::send(const QString &sMessage)
{
! fprintf( stdout, sMessage.latin1() );
! fflush( stdout );
if( sMessage.contains( "\n" ) )
Index: house.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/house.cpp,v
retrieving revision 1.114
retrieving revision 1.115
diff -C2 -d -r1.114 -r1.115
*** house.cpp 7 Sep 2003 19:07:47 -0000 1.114
--- house.cpp 11 Sep 2003 12:22:24 -0000 1.115
***************
*** 38,42 ****
#include "maps.h"
#include "tilecache.h"
- #include "utilsys.h"
#include "network.h"
#include "network/uosocket.h"
--- 38,41 ----
Index: iserialization.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/iserialization.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** iserialization.h 19 Jan 2003 16:08:59 -0000 1.24
--- iserialization.h 11 Sep 2003 12:22:24 -0000 1.25
***************
*** 85,90 ****
virtual ~ISerialization(){}
! virtual void prepareReading(std::string ident, int bLevel = 0 ) { Q_UNUSED(bLevel); _state = enReading; }
! virtual void prepareWritting(std::string ident) { _state = enWritting; }
virtual bool isReading() { return (_state == enReading); }
--- 85,90 ----
virtual ~ISerialization(){}
! virtual void prepareReading( const QString &ident, int bLevel = 0 ) { Q_UNUSED(bLevel); _state = enReading; }
! virtual void prepareWritting( const QString &ident ) { _state = enWritting; }
virtual bool isReading() { return (_state == enReading); }
***************
*** 102,106 ****
// Write Methods
virtual void writeObjectID( const QString& ) = 0;
! virtual void write(const char* Key, std::string &data) = 0;
virtual void write(const char* Key, unsigned int data) = 0;
virtual void write(const char* Key, signed int data) = 0;
--- 102,106 ----
// Write Methods
virtual void writeObjectID( const QString& ) = 0;
! virtual void write(const char* Key, const QString &data) = 0;
virtual void write(const char* Key, unsigned int data) = 0;
virtual void write(const char* Key, signed int data) = 0;
***************
*** 115,119 ****
virtual void readObjectID(QString &data) = 0;
! virtual void read(const char* Key, std::string &data) = 0;
virtual void read(const char* Key, unsigned int &data) = 0;
virtual void read(const char* Key, signed int &data) = 0;
--- 115,119 ----
virtual void readObjectID(QString &data) = 0;
! virtual void read(const char* Key, QString &data) = 0;
virtual void read(const char* Key, unsigned int &data) = 0;
virtual void read(const char* Key, signed int &data) = 0;
***************
*** 124,147 ****
virtual void read(const char* Key, bool &data) = 0;
virtual void read(const char* Key, double &data) = 0;
-
- // I hate to polute it but, as a temp measure:
- virtual void read( const char* Key, QString &data )
- {
- std::string temp;
- read( Key, temp );
- data = temp.c_str();
- }
-
- virtual void write(const char* Key, const QString &data)
- {
- std::string temp;
-
- if( data.isNull() )
- temp = "";
- else
- temp = data.latin1();
-
- write( Key, temp );
- }
protected:
--- 124,127 ----
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.349
retrieving revision 1.350
diff -C2 -d -r1.349 -r1.350
*** items.cpp 9 Sep 2003 23:09:30 -0000 1.349
--- items.cpp 11 Sep 2003 12:22:24 -0000 1.350
***************
*** 37,41 ****
#include "network/uosocket.h"
#include "network/uotxpackets.h"
- #include "utilsys.h"
#include "iserialization.h"
#include "items.h"
--- 37,40 ----
Index: pfactory.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pfactory.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pfactory.cpp 12 Jan 2003 18:11:32 -0000 1.3
--- pfactory.cpp 11 Sep 2003 12:22:24 -0000 1.4
***************
*** 38,48 ****
ISerialization* cPluginFactory::serializationArchiver( const QString& name )
{
! // for now only hardcoded stuff.
! if ( name == "binary")
! return new serBinFile;
! else if ( name == "xml")
! return new serXmlFile;
! else
! return new serBinFile; // return default.
}
--- 38,42 ----
ISerialization* cPluginFactory::serializationArchiver( const QString& name )
{
! return new serXmlFile;
}
Index: serbinfile.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/serbinfile.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** serbinfile.cpp 7 Sep 2003 19:07:47 -0000 1.26
--- serbinfile.cpp 11 Sep 2003 12:22:24 -0000 1.27
***************
*** 29,261 ****
// Wolfpack Homepage: http://wpdev.sf.net/
//==================================================================================
-
- #include "platform.h"
-
- // Wolfpack Includes
- #include "globals.h"
- #include "srvparams.h"
- #include "serbinfile.h"
-
- // Library Includes
- #include <qfile.h>
- #include <qstring.h>
-
- using namespace std;
-
- const unsigned int backuplevel = 4;
-
- void serBinFile::setVersion(unsigned int __version)
- {
- _version = __version;
- }
-
- unsigned int serBinFile::getVersion()
- {
- return _version;
- }
-
- unsigned int serBinFile::size()
- {
- return _count;
- }
-
- void serBinFile::prepareReading(std::string ident, int bLevel)
- {
- // do not recurse forever
- if ( bLevel >= backuplevel )
- return; // nothing more can be done.
-
- QString fileName( QString( "%1%2" ).arg( SrvParams->getString( "General", "SavePath", "./", true ) ).arg( ident.c_str() ) );
-
- if ( bLevel != 0 )
- fileName += QString("-%1").arg(bLevel);
- fileName.append(".bin");
- if ( !QFile::exists(fileName) )
- {
- prepareReading( ident.c_str(), ++bLevel );
- return;
- }
-
- file.open( fileName.latin1(), ios::in | ios::binary );
-
- if ( !file.is_open() )
- qWarning("Failled to open file %s for reading", fileName.latin1());
-
- file.read((char*)&_version, 4);
- file.read((char*)&_count, 4);
- if ( _count == 0 ) // has not finished writting.
- {
- file.close();
- prepareReading( ident.c_str(), ++bLevel );
- return;
- }
-
- ISerialization::prepareReading(ident);
- }
-
- void serBinFile::prepareWritting(std::string ident)
- {
- QString fileName( QString( "%1%2" ).arg( SrvParams->getString( "General", "SavePath", "./", true ) ).arg( ident.c_str() ) );
-
- // perform backups
- unsigned int i;
- QFile::remove( ident.c_str() + QString("-%1.%2").arg(backuplevel).arg("bin"));
- for ( i = backuplevel - 1; i > 0; --i )
- {
- QString from = ident.c_str() + QString("-%1.%2").arg(i).arg("bin");
- QString to = ident.c_str() + QString("-%1.%2").arg(i + 1).arg("bin");
- rename( from.latin1(), to.latin1() );
- }
- rename ( ident.c_str() + QString(".bin"), ident.c_str() + QString("-1%1").arg(".bin"));
- fileName.append(".bin");
- file.open( fileName.latin1(), ios::out | ios::binary );
- if ( !file.is_open() )
- qWarning("Critical Error: could not open %s for writting", fileName.latin1());
- _count = 0;
- // First line in file is version
- file.write((char*)&_version, 4);
- file.write((char*)&_count, 4);
- ISerialization::prepareWritting(ident);
- }
-
- void serBinFile::close()
- {
- if ( isWritting() )
- {
- file.seekp(4);
- file.write((char*)&_count, 4);
- }
- file.close();
- }
-
- void serBinFile::writeObjectID( const QString& data )
- {
- ISerialization::write("objectID", data);
- if( _objectlevel == 0 )
- ++_count;
- ++_objectlevel;
- }
-
- void serBinFile::write(const char* Key, std::string &data)
- {
- UI32 uiSize = data.size();
- file.write((char*)&uiSize, 4);
- if (uiSize != 0)
- file.write((char*)data.c_str(), uiSize);
- }
-
- void serBinFile::write(const char* Key, unsigned int data)
- {
- file.write((char*)&data, 4);
- }
-
- void serBinFile::write(const char* Key, signed int data)
- {
- file.write((char*)&data, 4);
- }
-
- void serBinFile::write(const char* Key, signed short data)
- {
- file.write((char*)&data, 2);
- }
-
- void serBinFile::write(const char* Key, unsigned short data)
- {
- file.write((char*)&data, 2);
- }
-
- void serBinFile::write(const char* Key, unsigned char data)
- {
- file.write((char*)&data, 1);
- }
-
- void serBinFile::write(const char* Key, signed char data)
- {
- file.write((char*)&data, 1);
- }
-
- void serBinFile::write(const char* Key, bool data)
- {
- file.write((char*)&data, 1);
- }
-
- void serBinFile::write(const char* Key, double data)
- {
- file.write((char*)&data, 8);
- }
-
- void serBinFile::done()
- {
- --_objectlevel;
- }
-
- void serBinFile::readObjectID(QString &data)
- {
- ISerialization::read("objectID", data);
- }
-
- void serBinFile::read(const char* Key, string& data)
- {
- UI32 uiSize = 0;
- file.read((char*)&uiSize, 4);
- if (!file.fail())
- {
- if ( uiSize != 0 )
- {
- char* c_Str = new char[uiSize + 1];
- if( c_Str )
- {
- file.read(c_Str, uiSize);
- c_Str[uiSize] = 0;
- data = c_Str;
- delete [] c_Str;
- }
- else
- {
- qFatal( QString( "Out of memory, couldn't allocate %1 bytes of memory." ).arg( uiSize ) );
- }
- }
- }
- else
- data = "";
- }
-
- void serBinFile::read(const char* Key, unsigned int &data)
- {
- file.read((char*)&data, 4);
- }
-
- void serBinFile::read(const char* Key, signed int &data)
- {
- file.read((char*)&data, 4);
- }
-
- void serBinFile::read(const char* Key, signed short &data)
- {
- file.read((char*)&data, 2);
- }
-
- void serBinFile::read(const char* Key, unsigned short &data)
- {
- file.read((char*)&data, 2);
- }
-
- void serBinFile::read(const char* Key, unsigned char &data)
- {
- file.read((char*)&data, 1);
- }
-
- void serBinFile::read(const char* Key, signed char &data)
- {
- file.read((char*)&data, 1);
- }
-
- void serBinFile::read(const char* Key, bool &data)
- {
- file.read((char*)&data, 1);
- }
-
- void serBinFile::read(const char* Key, double &data)
- {
- file.read((char*)&data, 8);
- }
--- 29,30 ----
Index: serbinfile.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/serbinfile.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** serbinfile.h 12 Jan 2003 18:11:32 -0000 1.14
--- serbinfile.h 11 Sep 2003 12:22:24 -0000 1.15
***************
*** 33,122 ****
#define __SERBINFILE_H__
- #include "iserialization.h"
-
- #include <fstream>
- #include <cstdio>
-
- // Forward declarations
- class QString;
-
- /*!
- CLASS
-
-
- This class provides an implementation for Binary file serialization implementation.
-
-
- USAGE
- <More detailed description of the class and
- a summary of it's (public) operations>.
-
- */
- class serBinFile : public ISerialization
- {
- protected:
- std::fstream file;
- unsigned int _version;
- unsigned int _count;
- unsigned int _objectlevel;
- public:
- serBinFile() : _version(0), _count(0), _objectlevel(0) {}
- virtual ~serBinFile() {}
-
- virtual void prepareReading(std::string ident, int bLevel = 0);
- virtual void prepareWritting(std::string ident);
- virtual void close();
-
- virtual unsigned int getVersion();
- virtual unsigned int size();
- virtual void setVersion(unsigned int);
-
- // Write Methods
- virtual void writeObjectID( const QString &data );
-
- virtual void write(const char* Key, std::string &data);
- virtual void write(const char* Key, unsigned int data);
- virtual void write(const char* Key, signed int data);
- virtual void write(const char* Key, signed short data);
- virtual void write(const char* Key, unsigned short data);
- virtual void write(const char* Key, unsigned char data);
- virtual void write(const char* Key, signed char data);
- virtual void write(const char* Key, bool data);
- virtual void write(const char* Key, double data);
-
- virtual void done();
-
- // Read Methods
- virtual void readObjectID(QString &data);
-
- virtual void read(const char* Key, std::string &data);
- virtual void read(const char* Key, unsigned int &data);
- virtual void read(const char* Key, signed int &data);
- virtual void read(const char* Key, unsigned short &data);
- virtual void read(const char* Key, signed short &data);
- virtual void read(const char* Key, unsigned char &data);
- virtual void read(const char* Key, signed char &data);
- virtual void read(const char* Key, bool &data);
- virtual void read(const char* Key, double &data);
-
- /* virtual void read( const char* Key, QString &data )
- {
- std::string temp;
- read( Key, temp );
- data = temp.c_str();
- }
-
- virtual void write(const char* Key, QString &data)
- {
- std::string temp;
-
- if( data.latin1() == NULL )
- temp = "";
- else
- temp = data.latin1();
-
- write( Key, temp );
- }*/
- };
-
#endif // __SERBINFILE_H__
--- 33,35 ----
Index: serxmlfile.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/serxmlfile.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** serxmlfile.cpp 7 Sep 2003 19:07:47 -0000 1.22
--- serxmlfile.cpp 11 Sep 2003 12:22:24 -0000 1.23
***************
*** 144,148 ****
}
! void serXmlFile::prepareReading(std::string ident, int bLevel)
{
// do not recurse forever
--- 144,148 ----
}
! void serXmlFile::prepareReading( const QString &ident, int bLevel)
{
// do not recurse forever
***************
*** 150,154 ****
return; // nothing more can be done.
! QString fileName( QString( "%1%2" ).arg( SrvParams->getString( "General", "SavePath", "./", true ) ).arg( ident.c_str() ) );
if ( bLevel != 0 )
--- 150,154 ----
return; // nothing more can be done.
! QString fileName( QString( "%1%2" ).arg( SrvParams->getString( "General", "SavePath", "./", true ) ).arg( ident ) );
if ( bLevel != 0 )
***************
*** 157,161 ****
if ( !QFile::exists(fileName) )
{
! prepareReading( ident.c_str(), ++bLevel );
return;
}
--- 157,161 ----
if ( !QFile::exists(fileName) )
{
! prepareReading( ident, ++bLevel );
return;
}
***************
*** 186,190 ****
file->close();
document = NULL;
! prepareReading( ident.c_str(), ++bLevel );
}
node = root;
--- 186,190 ----
file->close();
document = NULL;
! prepareReading( ident, ++bLevel );
}
node = root;
***************
*** 192,209 ****
}
! void serXmlFile::prepareWritting(std::string ident)
{
! QString fileName( QString( "%1%2" ).arg( SrvParams->getString( "General", "SavePath", "./", true ) ).arg( ident.c_str() ) );
// perform backups
unsigned int i;
! QFile::remove( ident.c_str() + QString("-%1.%2").arg(backuplevel).arg("xml"));
for ( i = backuplevel - 1; i > 0; --i )
{
! QString from = ident.c_str() + QString("-%1.%2").arg(i).arg("xml");
! QString to = ident.c_str() + QString("-%1.%2").arg(i + 1).arg("xml");
rename( from.latin1(), to.latin1() );
}
! rename ( ident.c_str() + QString(".bin"), ident.c_str() + QString("-1%1").arg(".xml"));
fileName.append(".xml");
file = new QFile(fileName);
--- 192,209 ----
}
! void serXmlFile::prepareWritting(const QString &ident)
{
! QString fileName( QString( "%1%2" ).arg( SrvParams->getString( "General", "SavePath", "./", true ) ).arg( ident ) );
// perform backups
unsigned int i;
! QFile::remove( ident + QString("-%1.%2").arg(backuplevel).arg("xml"));
for ( i = backuplevel - 1; i > 0; --i )
{
! QString from = ident + QString("-%1.%2").arg(i).arg("xml");
! QString to = ident + QString("-%1.%2").arg(i + 1).arg("xml");
rename( from.latin1(), to.latin1() );
}
! rename ( ident + QString(".bin"), ident + QString("-1%1").arg(".xml"));
fileName.append(".xml");
file = new QFile(fileName);
***************
*** 212,216 ****
_count = 0;
! document = new QDomDocument(ident.c_str());
root = document->createElement(document->doctype().name());
root.setAttribute( "version", _version );
--- 212,216 ----
_count = 0;
! document = new QDomDocument(ident );
root = document->createElement(document->doctype().name());
root.setAttribute( "version", _version );
***************
*** 268,275 ****
}
! void serXmlFile::write(const char* Key, std::string &data)
{
QDomElement newNode = document->createElement(Key);
! newNode.setAttribute( "value", data.c_str() );
node.appendChild( newNode );
}
--- 268,275 ----
}
! void serXmlFile::write(const char* Key, const QString &data)
{
QDomElement newNode = document->createElement(Key);
! newNode.setAttribute( "value", data );
node.appendChild( newNode );
}
***************
*** 372,376 ****
}
! void serXmlFile::read(const char* Key, std::string& data)
{
QDomNodeList nodeList = node.elementsByTagName( Key );
--- 372,376 ----
}
! void serXmlFile::read(const char* Key, QString& data)
{
QDomNodeList nodeList = node.elementsByTagName( Key );
Index: serxmlfile.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/serxmlfile.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** serxmlfile.h 12 Jan 2003 18:11:32 -0000 1.8
--- serxmlfile.h 11 Sep 2003 12:22:24 -0000 1.9
***************
*** 95,100 ****
virtual ~serXmlFile();
! virtual void prepareReading(std::string ident, int bLevel = 0);
! virtual void prepareWritting(std::string ident);
virtual void close();
--- 95,100 ----
virtual ~serXmlFile();
! virtual void prepareReading( const QString &ident, int bLevel = 0);
! virtual void prepareWritting( const QString &ident);
virtual void close();
***************
*** 106,110 ****
virtual void writeObjectID( const QString& data );
! virtual void write(const char* Key, std::string &data);
virtual void write(const char* Key, unsigned int data);
virtual void write(const char* Key, signed int data);
--- 106,110 ----
virtual void writeObjectID( const QString& data );
! virtual void write(const char* Key, const QString &data);
virtual void write(const char* Key, unsigned int data);
virtual void write(const char* Key, signed int data);
***************
*** 121,125 ****
virtual void readObjectID(QString &data);
! virtual void read(const char* Key, std::string &data);
virtual void read(const char* Key, unsigned int &data);
virtual void read(const char* Key, signed int &data);
--- 121,125 ----
virtual void readObjectID(QString &data);
! virtual void read(const char* Key, QString &data);
virtual void read(const char* Key, unsigned int &data);
virtual void read(const char* Key, signed int &data);
Index: spawnregions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/spawnregions.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** spawnregions.cpp 8 Sep 2003 10:58:47 -0000 1.48
--- spawnregions.cpp 11 Sep 2003 12:22:24 -0000 1.49
***************
*** 45,49 ****
#include "walking.h"
#include "log.h"
- #include "utilsys.h"
#include "chars.h"
#include "npc.h"
--- 45,48 ----
Index: speech.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/speech.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** speech.h 7 Sep 2003 19:07:47 -0000 1.20
--- speech.h 11 Sep 2003 12:22:24 -0000 1.21
***************
*** 42,46 ****
// System includes
#include <vector>
- #include <iostream>
// QT
--- 42,45 ----
***************
*** 49,53 ****
//Wolfpack Includes
#include "speech.h"
- #include "utilsys.h"
#include "typedefs.h"
--- 48,51 ----
Index: territories.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/territories.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** territories.cpp 8 Sep 2003 10:58:47 -0000 1.31
--- territories.cpp 11 Sep 2003 12:22:24 -0000 1.32
***************
*** 34,38 ****
#include "network/uosocket.h"
#include "defines.h"
- #include "utilsys.h"
#include "srvparams.h"
#include "network.h"
--- 34,37 ----
Index: verinfo.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/verinfo.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** verinfo.h 20 Jul 2003 00:04:51 -0000 1.27
--- verinfo.h 11 Sep 2003 12:22:24 -0000 1.28
***************
*** 127,138 ****
unsigned int vernumber;
wpversion_32bit verstruct;
! std::string verstring;
! std::string productstring;
! std::string betareleasestring;
QString clientsupportedstring;
! std::string timezonestring;
! std::string compiledbystring;
! std::string codersstring;
! std::string emailstring;
wp_version_info()
--- 127,138 ----
unsigned int vernumber;
wpversion_32bit verstruct;
! QString verstring;
! QString productstring;
! QString betareleasestring;
QString clientsupportedstring;
! QString timezonestring;
! QString compiledbystring;
! QString codersstring;
! QString emailstring;
wp_version_info()
***************
*** 147,160 ****
verstruct.derivate = WOLF;
! vernumber = to_32bitver(verstruct);
! /// code for auto generation of verstring, productstring and betareleasestring coming soon (LB) ...
! verstring = "12.9.3"; // Wolfpack version
productstring = "Wolfpack"; // selfexplainatory, isnt't it :)
betareleasestring = "Beta"; // release status
-
- //////////////////////////////////////////////////
-
- clientsupportedstring = "3.0.8z";
// SUPPORTED_CLIENT is part of the client version control system.
--- 147,155 ----
verstruct.derivate = WOLF;
! vernumber = to_32bitver(verstruct);
! verstring = "12.9.4"; // Wolfpack version
productstring = "Wolfpack"; // selfexplainatory, isnt't it :)
betareleasestring = "Beta"; // release status
// SUPPORTED_CLIENT is part of the client version control system.
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.224
retrieving revision 1.225
diff -C2 -d -r1.224 -r1.225
*** wolf.dsp 9 Sep 2003 23:09:30 -0000 1.224
--- wolf.dsp 11 Sep 2003 12:22:24 -0000 1.225
***************
*** 43,47 ****
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MD /GR /GX /O2 /Ob0 /I "lib/Python/PC" /I "sqlite" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "ZTHREAD_SHARED" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
--- 43,47 ----
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MT /GR /GX /O2 /Ob0 /I "lib/Python/PC" /I "sqlite" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
***************
*** 52,57 ****
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 /debug
!ELSEIF "$(CFG)" == "wolf - Win32 Debug"
--- 52,57 ----
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 wsock32.lib $(QTDIR)\lib\qt-mt320.lib python22.lib /nologo /subsystem:windows /map /machine:I386 /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"
***************
*** 339,346 ****
# Begin Source File
- SOURCE=.\utilsys.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\walking.cpp
# End Source File
--- 339,342 ----
***************
*** 992,999 ****
SOURCE=.\uobject.h
# PROP Ignore_Default_Tool 1
- # End Source File
- # Begin Source File
-
- SOURCE=.\utilsys.h
# End Source File
# Begin Source File
--- 988,991 ----
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.462
retrieving revision 1.463
diff -C2 -d -r1.462 -r1.463
*** wolfpack.cpp 9 Sep 2003 23:09:31 -0000 1.462
--- wolfpack.cpp 11 Sep 2003 12:22:24 -0000 1.463
***************
*** 34,38 ****
#include "speech.h"
#include "territories.h"
!
#include "TmpEff.h"
#include "combat.h"
--- 34,38 ----
#include "speech.h"
#include "territories.h"
! #include "basics.h"
#include "TmpEff.h"
#include "combat.h"
***************
*** 81,85 ****
#include <qmutex.h>
#include <qthread.h>
- #include <fstream>
#include "python/utilities.h"
--- 81,84 ----
***************
*** 320,324 ****
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");
--- 319,323 ----
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.latin1() ).arg( wp_version.betareleasestring.latin1() ).arg( wp_version.verstring.latin1() ) );
Console::instance()->send( "Copyright (C) 1997, 98 Marcus Rating (Cironian)\n");
***************
*** 329,333 ****
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 );
--- 328,332 ----
Console::instance()->send( "\n" );
! QString consoleTitle = QString( "%1 %2 %3" ).arg( wp_version.productstring.latin1() ).arg( wp_version.betareleasestring.latin1() ).arg( wp_version.verstring.latin1() );
Console::instance()->setConsoleTitle( consoleTitle );
***************
*** 528,531 ****
--- 527,531 ----
QWaitCondition niceLevel;
+
// This is our main loop
while( keeprun )
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** world.cpp 9 Sep 2003 23:09:31 -0000 1.39
--- world.cpp 11 Sep 2003 12:22:24 -0000 1.40
***************
*** 39,43 ****
#include "iserialization.h"
#include "persistentbroker.h"
- #include "utilsys.h" // What the heck do we need this file for ?!
#include "accounts.h"
#include "inlines.h"
--- 39,42 ----
***************
*** 46,49 ****
--- 45,49 ----
#include "npc.h"
#include "log.h"
+ #include "basics.h"
#include <sqlite.h>
Index: wpdefmanager.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wpdefmanager.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** wpdefmanager.cpp 9 Sep 2003 23:09:31 -0000 1.63
--- wpdefmanager.cpp 11 Sep 2003 12:22:25 -0000 1.64
***************
*** 30,33 ****
--- 30,42 ----
//==================================================================================
+ // Library Includes
+ #include <qdom.h>
+ #include <qxml.h>
+ #include <qfile.h>
+ #include <qptrstack.h>
+ #include <qregexp.h>
+ #include <qstringlist.h>
+ #include <qvaluevector.h>
+
#include "wpdefmanager.h"
#include "globals.h"
***************
*** 41,52 ****
#include "log.h"
! // Library Includes
! #include <qdom.h>
! #include <qxml.h>
! #include <qfile.h>
! #include <qptrstack.h>
! #include <qregexp.h>
! #include <qstringlist.h>
! #include <qvaluevector.h>
struct stCategory
--- 50,54 ----
#include "log.h"
! #include <stdlib.h>
struct stCategory
***************
*** 414,418 ****
attrCount_ = 0;
! free( attributes );
attributes = 0;
}
--- 416,420 ----
attrCount_ = 0;
! delete [] attributes;
attributes = 0;
}
***************
*** 427,431 ****
childCount_ = 0;
! free( children );
children = 0;
}
--- 429,433 ----
childCount_ = 0;
! delete [] children;
children = 0;
}
***************
*** 457,463 ****
attrCount_ = attributes.count();
! if( attrCount_> 0 )
{
! this->attributes = (stAttribute**)malloc( sizeof( stAttribute* ) * attrCount_ );
for( unsigned int i = 0; i < attrCount_; ++i )
--- 459,465 ----
attrCount_ = attributes.count();
! if( attrCount_ > 0 )
{
! this->attributes = new stAttribute*[ attrCount_ ];
for( unsigned int i = 0; i < attrCount_; ++i )
***************
*** 475,485 ****
{
childCount_ = 1;
! children = (cElement**)malloc( sizeof( cElement* ) );
children[0] = element;
}
else
{
! children = (cElement**)realloc( children, sizeof( cElement* ) * ( childCount_ + 1 ) );
! children[childCount_++] = element;
}
}
--- 477,493 ----
{
childCount_ = 1;
! children = new cElement*[ 1 ];
children[0] = element;
}
else
{
! cElement **newChildren = new cElement* [ childCount_ + 1 ];
!
! // Copy over the old list
! memcpy( newChildren, children, childCount_ * sizeof( cElement* ) );
! newChildren[ childCount_++ ] = element;
!
! delete [] children;
! children = newChildren;
}
}
***************
*** 494,498 ****
unsigned int offset = 0;
! cElement **newChildren = (cElement**)malloc( ( childCount_ - 1 ) * sizeof( cElement* ) );
for( unsigned int j = 0; j < childCount_; ++j )
--- 502,506 ----
unsigned int offset = 0;
! cElement **newChildren = new cElement* [ childCount_ - 1 ];
for( unsigned int j = 0; j < childCount_; ++j )
***************
*** 501,505 ****
childCount_--;
! free( children );
children = newChildren;
return;
--- 509,513 ----
childCount_--;
! delete [] children;
children = newChildren;
return;
--- stream.h DELETED ---
--- utilsys.cpp DELETED ---
--- utilsys.h DELETED ---
--- wpconsole.cpp DELETED ---
--- wpconsole.h DELETED ---
|
|
From: <dar...@us...> - 2003-09-11 12:22:57
|
Update of /cvsroot/wpdev/wolfpack/network
In directory sc8-pr-cvs1:/tmp/cvs-serv15450/network
Modified Files:
uopacket.cpp uopacket.h uosocket.cpp
Log Message:
Removed references to STL strings and iostreams.
Index: uopacket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uopacket.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** uopacket.cpp 24 Jul 2003 04:03:48 -0000 1.36
--- uopacket.cpp 11 Sep 2003 12:22:25 -0000 1.37
***************
*** 35,39 ****
#include <ctype.h>
- #include <iostream>
/*****************************************************************************
--- 35,38 ----
***************
*** 557,573 ****
0100: 00 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- : ..
\endverbatim
- */
- void cUOPacket::print( std::ostream* s )
- {
- if ( s )
- (*s) << dump( rawPacket ).data() << std::endl;
- }
-
-
- /*!
- This is a debug method. It will dump a numerical hexa and ascii representation of the packet
- at \a data as well as a right table of offsets and return that as a QString.
- This method behaves just like print method.
- \sa print()
*/
QCString cUOPacket::dump( const QByteArray &data )
--- 556,559 ----
Index: uopacket.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uopacket.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** uopacket.h 26 Jul 2003 01:10:55 -0000 1.24
--- uopacket.h 11 Sep 2003 12:22:25 -0000 1.25
***************
*** 75,80 ****
static QCString dump( const QByteArray& );
- virtual void print( std::ostream* );
-
// Operators
char& operator []( uint );
--- 75,78 ----
Index: uosocket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v
retrieving revision 1.284
retrieving revision 1.285
diff -C2 -d -r1.284 -r1.285
*** uosocket.cpp 9 Sep 2003 23:09:31 -0000 1.284
--- uosocket.cpp 11 Sep 2003 12:22:25 -0000 1.285
***************
*** 67,72 ****
#include "../ai.h"
- //#include <conio.h>
- #include <iostream>
#include <stdlib.h>
#include <qhostaddress.h>
--- 67,70 ----
***************
*** 971,978 ****
handleCustomHouseRequest( dynamic_cast< cUORxCustomHouseRequest* >( packet ) ); break;
default:
! {
! packet->print( &cout ); // Dump the packet
! return;
! }
};
}
--- 969,973 ----
handleCustomHouseRequest( dynamic_cast< cUORxCustomHouseRequest* >( packet ) ); break;
default:
! Console::instance()->log( LOG_WARNING, packet->dump( packet->uncompressed() ) );
};
}
|
|
From: <dar...@us...> - 2003-09-11 12:22:56
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv15450/python
Modified Files:
global.cpp
Log Message:
Removed references to STL strings and iostreams.
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -d -r1.89 -r1.90
*** global.cpp 9 Sep 2003 23:09:31 -0000 1.89
--- global.cpp 11 Sep 2003 12:22:25 -0000 1.90
***************
*** 31,34 ****
--- 31,35 ----
#include "engine.h"
+ #include "../basics.h"
#include "../globals.h"
#include "../network/uosocket.h"
***************
*** 58,62 ****
#include "../npc.h"
#include "../targetrequests.h"
- #include "../utilsys.h"
#include "../basedef.h"
--- 59,62 ----
***************
*** 848,852 ****
Q_UNUSED(args);
wp_version_info wpversioninfo;
! return PyString_FromString( QString("%1 %2 %3").arg( wpversioninfo.productstring.c_str() ).arg( wpversioninfo.betareleasestring.c_str() ).arg( wpversioninfo.verstring.c_str() ).latin1() );
}
--- 848,852 ----
Q_UNUSED(args);
wp_version_info wpversioninfo;
! return PyString_FromString( QString("%1 %2 %3").arg( wpversioninfo.productstring ).arg( wpversioninfo.betareleasestring ).arg( wpversioninfo.verstring ).latin1() );
}
|
|
From: <thi...@us...> - 2003-09-10 21:09:29
|
Update of /cvsroot/wpdev/xmlscripts In directory sc8-pr-cvs1:/tmp/cvs-serv2213 Modified Files: accounts.sql Log Message: fix to work with sqlite Index: accounts.sql =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/accounts.sql,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** accounts.sql 10 Sep 2003 18:00:18 -0000 1.2 --- accounts.sql 10 Sep 2003 21:09:20 -0000 1.3 *************** *** 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; --- 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 '0', ! blockuntil int NOT NULL default '0', ! PRIMARY KEY (login) ! ); |