wpdev-commits Mailing List for Wolfpack Emu (Page 180)
Brought to you by:
rip,
thiagocorrea
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(121) |
Sep
(256) |
Oct
(59) |
Nov
(73) |
Dec
(120) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(259) |
Feb
(381) |
Mar
(501) |
Apr
(355) |
May
(427) |
Jun
(270) |
Jul
(394) |
Aug
(412) |
Sep
(724) |
Oct
(578) |
Nov
(65) |
Dec
|
|
From: <dr...@us...> - 2003-12-22 12:20:51
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1:/tmp/cvs-serv29994/python Modified Files: tempeffect.h Log Message: Newline Warning Fixes Index: tempeffect.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/tempeffect.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tempeffect.h 23 Nov 2003 15:09:45 -0000 1.11 --- tempeffect.h 22 Dec 2003 12:20:42 -0000 1.12 *************** *** 232,234 **** }; ! #endif \ No newline at end of file --- 232,235 ---- }; ! #endif ! |
|
From: <dr...@us...> - 2003-12-22 12:11:38
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv28298 Modified Files: house.cpp Log Message: Newline Warning Fixes Index: house.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/house.cpp,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** house.cpp 26 Nov 2003 01:12:20 -0000 1.118 --- house.cpp 22 Dec 2003 12:11:35 -0000 1.119 *************** *** 392,394 **** socket->send( &deed ); socket->send( &customhouse ); ! } \ No newline at end of file --- 392,395 ---- socket->send( &deed ); socket->send( &customhouse ); ! } ! |
|
From: <co...@us...> - 2003-12-22 11:01:59
|
Update of /cvsroot/wpdev/wolfpack/network
In directory sc8-pr-cvs1:/tmp/cvs-serv17408/network
Modified Files:
uopacket.cpp uopacket.h uotxpackets.cpp
Log Message:
Unicode ToolTips support
Index: uopacket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uopacket.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** uopacket.cpp 11 Sep 2003 12:22:25 -0000 1.37
--- uopacket.cpp 22 Dec 2003 11:01:56 -0000 1.38
***************
*** 485,489 ****
it will be truncated.
*/
! void cUOPacket::setUnicodeString( uint pos, const QString& data, uint maxlen )
{
haveCompressed = false; // changed
--- 485,489 ----
it will be truncated.
*/
! void cUOPacket::setUnicodeString( uint pos, const QString& data, uint maxlen, bool swapbytes )
{
haveCompressed = false; // changed
***************
*** 492,496 ****
for ( uint i = 0; i < length; ++i )
{
! setShort(pos + i * 2, (*(unicodeData + i)).unicode());
}
}
--- 492,505 ----
for ( uint i = 0; i < length; ++i )
{
! if( !swapbytes )
! {
! setShort(pos + i * 2, (*(unicodeData + i)).unicode());
! }
! else
! {
! (*this)[pos + i * 2 + 1] = ( (*(unicodeData + i )).unicode() >> 8 ) & 0xFF;
! (*this)[pos + i * 2] = ( (*(unicodeData + i )).unicode() ) & 0xFF;
! }
!
}
}
Index: uopacket.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uopacket.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** uopacket.h 11 Sep 2003 12:22:25 -0000 1.25
--- uopacket.h 22 Dec 2003 11:01:56 -0000 1.26
***************
*** 71,75 ****
void setInt( uint, uint );
void setShort( uint, ushort );
! void setUnicodeString( uint, const QString&, uint );
void setAsciiString( uint, const char*, uint );
static QCString dump( const QByteArray& );
--- 71,75 ----
void setInt( uint, uint );
void setShort( uint, ushort );
! void setUnicodeString( uint, const QString&, uint, bool swapbytes = false );
void setAsciiString( uint, const char*, uint );
static QCString dump( const QByteArray& );
Index: uotxpackets.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uotxpackets.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -d -r1.71 -r1.72
*** uotxpackets.cpp 23 Jul 2003 22:39:07 -0000 1.71
--- uotxpackets.cpp 22 Dec 2003 11:01:56 -0000 1.72
***************
*** 585,593 ****
setShort( offset + 4, params.length() * 2 );
! for( UINT32 i = 0; i < params.length(); ++i )
! {
! (*this)[offset + 6 + i*2+1] = ( params.unicode()[i].unicode() >> 8 ) & 0xFF;
! (*this)[offset + 6 + i*2] = ( params.unicode()[i].unicode() ) & 0xFF;
! }
// Terminator
--- 585,589 ----
setShort( offset + 4, params.length() * 2 );
! setUnicodeString( offset + 6, params, params.length() * 2, true );
// Terminator
|
|
From: <co...@us...> - 2003-12-22 11:01:59
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv17408/python
Modified Files:
pytooltip.cpp socket.cpp utilities.h
Log Message:
Unicode ToolTips support
Index: pytooltip.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pytooltip.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** pytooltip.cpp 10 Aug 2003 04:26:42 -0000 1.7
--- pytooltip.cpp 22 Dec 2003 11:01:55 -0000 1.8
***************
*** 94,98 ****
return false;
! if( ( !checkArgInt( 0 ) ) || ( !checkArgStr( 1 ) ) )
{
PyErr_BadArgument();
--- 94,121 ----
return false;
! // ( !checkArgStr( 1 ) ) || ( !checkArgUnicode( 1 ) ) )
!
! UINT32 listid;
! QString params;
!
! if( checkArgInt( 0 ) )
! {
! listid = getArgInt( 0 );
! }
! else
! {
! PyErr_BadArgument();
! return NULL;
! }
!
! if( checkArgUnicode( 1 ) )
! {
! params.setUnicodeCodes( (unsigned short*)getArgUnicode( 1 ), getUnicodeSize( 1 ) ) ;
! }
! else if( checkArgStr( 1 ) )
! {
! params = getArgStr( 1 );
! }
! else
{
PyErr_BadArgument();
***************
*** 100,106 ****
}
- UINT32 listid = getArgInt( 0 );
- QString params = getArgStr( 1 );
-
self->list->addLine( listid, params );
--- 123,126 ----
Index: socket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/socket.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** socket.cpp 28 Nov 2003 05:54:20 -0000 1.46
--- socket.cpp 22 Dec 2003 11:01:55 -0000 1.47
***************
*** 112,116 ****
else if( checkArgUnicode( 0 ) )
{
! message.setUnicodeCodes( (unsigned short*)( PyUnicode_AsUnicode( param ) ), PyUnicode_GetSize( param ) ) ;
}
else
--- 112,116 ----
else if( checkArgUnicode( 0 ) )
{
! message.setUnicodeCodes( (unsigned short*)getArgUnicode( 0 ), getUnicodeSize( 0 ) ) ;
}
else
***************
*** 154,158 ****
--- 154,164 ----
if( checkArgStr( 1 ) )
+ {
params = getArgStr( 1 );
+ }
+ else if( checkArgUnicode( 1 ) )
+ {
+ params.setUnicodeCodes( (unsigned short*)getArgUnicode( 1 ), getUnicodeSize( 1 ) ) ;
+ }
if( checkArgInt( 2 ) )
Index: utilities.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/utilities.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** utilities.h 19 Nov 2003 08:47:29 -0000 1.24
--- utilities.h 22 Dec 2003 11:01:55 -0000 1.25
***************
*** 121,124 ****
--- 121,126 ----
#define checkArgUnicode( id ) ( PyTuple_Size( args ) > id && PyUnicode_Check( PyTuple_GetItem( args, id ) ) )
#define getArgStr( id ) PyString_AsString( PyTuple_GetItem( args, id ) )
+ #define getArgUnicode( id ) PyUnicode_AsUnicode( PyTuple_GetItem( args, id ) )
+ #define getUnicodeSize( id ) PyUnicode_GetSize( PyTuple_GetItem( args, id ) )
#define checkArgAccount( id ) ( PyTuple_Size( args ) > id && checkWpAccount( PyTuple_GetItem( args, id ) ) )
#define checkArgRegion( id ) ( PyTuple_Size( args ) > id && checkWpRegion( PyTuple_GetItem( args, id ) ) )
|
|
From: <kh...@us...> - 2003-12-18 16:13:34
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv9099/wolfpack
Modified Files:
player.cpp items.cpp
Log Message:
small bug fix
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** player.cpp 26 Nov 2003 03:53:53 -0000 1.52
--- player.cpp 18 Dec 2003 16:13:28 -0000 1.53
***************
*** 1198,1202 ****
{
pItem->remove();
! Console::instance()->log( LOG_ERROR, QString( "Unrecognized startitem tag '%1' in definition '%2'.").arg( node->name(), element->getAttribute( "id" ) ) );
}
}
--- 1198,1202 ----
{
pItem->remove();
! Console::instance()->log( LOG_ERROR, QString( "Unrecognized startitem tag '%1' in definition '%2'.").arg( node->name() ).arg( element->getAttribute( "id" ) ) );
}
}
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.361
retrieving revision 1.362
diff -C2 -d -r1.361 -r1.362
*** items.cpp 26 Nov 2003 03:53:52 -0000 1.361
--- items.cpp 18 Dec 2003 16:13:28 -0000 1.362
***************
*** 1364,1368 ****
else
{
! Console::instance()->log( LOG_ERROR, QString( "Unknown content element '%1' in item definition '%1'." ).arg( element->name(), element->getTopmostParent()->getAttribute( "id", "unknown" ) ) );
}
}
--- 1364,1368 ----
else
{
! Console::instance()->log( LOG_ERROR, QString( "Unknown content element '%1' in item definition '%2'." ).arg( element->name() ).arg( element->getTopmostParent()->getAttribute( "id", "unknown" ) ) );
}
}
|
|
From: <thi...@us...> - 2003-12-18 13:41:57
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv10499
Modified Files:
wolfpack.pro
Log Message:
Updated SQLite
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.166
retrieving revision 1.167
diff -C2 -d -r1.166 -r1.167
*** wolfpack.pro 26 Sep 2003 13:00:34 -0000 1.166
--- wolfpack.pro 18 Dec 2003 13:41:54 -0000 1.167
***************
*** 54,57 ****
--- 54,61 ----
LIBS += -lmysqlclient
}
+ isEmpty(MYSQL_INCLUDE)
+ {
+ message("MySQL include files not found, support is disabled")
+ }
}
# Python includes. Run configure script to initialize it.
***************
*** 60,64 ****
INCLUDEPATH += $$(PYTHONINC)
}
!
INCLUDEPATH += /usr/local/include/stlport lib/Python sqlite lib/Python/Include network
LIBS += -L. -L/usr/local/lib -Llib/Python -ldl -lpython2.3 -lutil
--- 64,71 ----
INCLUDEPATH += $$(PYTHONINC)
}
! isEmpty($(PYTHONINC))
! {
! message("Error: Could not find Python include files")
! }
INCLUDEPATH += /usr/local/include/stlport lib/Python sqlite lib/Python/Include network
LIBS += -L. -L/usr/local/lib -Llib/Python -ldl -lpython2.3 -lutil
***************
*** 264,305 ****
# SQLite Sources
SOURCES += sqlite/attach.c \
! sqlite/auth.c \
! sqlite/btree.c \
! sqlite/btree_rb.c \
! sqlite/build.c \
! sqlite/copy.c \
! sqlite/delete.c \
! sqlite/expr.c \
! sqlite/func.c \
! sqlite/hash.c \
! sqlite/insert.c \
! sqlite/main.c \
! sqlite/opcodes.c \
! sqlite/os.c \
! sqlite/pager.c \
! sqlite/parse.c \
! sqlite/pragma.c \
! sqlite/printf.c \
! sqlite/random.c \
! sqlite/select.c \
! sqlite/table.c \
! sqlite/tokenize.c \
! sqlite/trigger.c \
! sqlite/update.c \
! sqlite/util.c \
! sqlite/vacuum.c \
! sqlite/vdbe.c \
! sqlite/where.c
!
HEADERS += sqlite/btree.h \
! sqlite/config.h \
! sqlite/hash.h \
! sqlite/opcodes.h \
! sqlite/os.h \
! sqlite/pager.h \
! sqlite/parse.h \
! sqlite/sqlite.h \
! sqlite/sqliteInt.h \
! sqlite/vdbe.h
INTERFACES =
--- 271,315 ----
# SQLite Sources
SOURCES += sqlite/attach.c \
! sqlite/auth.c \
! sqlite/btree.c \
! sqlite/btree_rb.c \
! sqlite/build.c \
! sqlite/copy.c \
! sqlite/date.c \
! sqlite/delete.c \
! sqlite/expr.c \
! sqlite/func.c \
! sqlite/hash.c \
! sqlite/insert.c \
! sqlite/main.c \
! sqlite/opcodes.c \
! sqlite/os.c \
! sqlite/pager.c \
! sqlite/parse.c \
! sqlite/pragma.c \
! sqlite/printf.c \
! sqlite/random.c \
! sqlite/select.c \
! sqlite/table.c \
! sqlite/tokenize.c \
! sqlite/trigger.c \
! sqlite/update.c \
! sqlite/util.c \
! sqlite/vacuum.c \
! sqlite/vdbe.c \
! sqlite/vdbeaux.c \
! sqlite/where.c
!
HEADERS += sqlite/btree.h \
! sqlite/config.h \
! sqlite/hash.h \
! sqlite/opcodes.h \
! sqlite/os.h \
! sqlite/pager.h \
! sqlite/parse.h \
! sqlite/sqlite.h \
! sqlite/sqliteInt.h \
! sqlite/vdbe.h \
! sqlite/vdbeInt.h
INTERFACES =
|
|
From: <thi...@us...> - 2003-12-18 13:27:19
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv7920 Modified Files: wolf.dsp Log Message: Updated to current SQLite Index: wolf.dsp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v retrieving revision 1.243 retrieving revision 1.244 diff -C2 -d -r1.243 -r1.244 *** wolf.dsp 27 Nov 2003 15:17:18 -0000 1.243 --- wolf.dsp 18 Dec 2003 13:27:16 -0000 1.244 *************** *** 897,900 **** --- 897,904 ---- # Begin Source File + SOURCE=.\sqlite\date.c + # End Source File + # Begin Source File + SOURCE=.\sqlite\delete.c # End Source File *************** *** 1010,1013 **** --- 1014,1025 ---- SOURCE=.\sqlite\vdbe.h + # End Source File + # Begin Source File + + SOURCE=.\sqlite\vdbeaux.c + # End Source File + # Begin Source File + + SOURCE=.\sqlite\vdbeInt.h # End Source File # Begin Source File |
Update of /cvsroot/wpdev/wolfpack/sqlite
In directory sc8-pr-cvs1:/tmp/cvs-serv5518
Modified Files:
attach.c auth.c btree.c btree.h btree_rb.c build.c config.h
copy.c delete.c expr.c func.c hash.c hash.h insert.c main.c
opcodes.c opcodes.h os.c pager.c pager.h parse.c parse.h
pragma.c random.c select.c sqlite.h sqliteInt.h table.c
tokenize.c trigger.c update.c util.c vacuum.c vdbe.c vdbe.h
where.c
Added Files:
date.c vdbeInt.h vdbeaux.c
Log Message:
Updated to current SQLite.
--- NEW FILE: date.c ---
/*
** 2003 October 31
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains the C functions that implement date and time
** functions for SQLite.
**
** There is only one exported symbol in this file - the function
** sqliteRegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: date.c,v 1.1 2003/12/18 13:20:23 thiagocorrea Exp $
**
** NOTES:
**
** SQLite processes all times and dates as Julian Day numbers. The
** dates and times are stored as the number of days since noon
** in Greenwich on November 24, 4714 B.C. according to the Gregorian
** calendar system.
**
** 1970-01-01 00:00:00 is JD 2440587.5
** 2000-01-01 00:00:00 is JD 2451544.5
**
** This implemention requires years to be expressed as a 4-digit number
** which means that only dates between 0000-01-01 and 9999-12-31 can
** be represented, even though julian day numbers allow a much wider
** range of dates.
**
** The Gregorian calendar system is used for all dates and times,
** even those that predate the Gregorian calendar. Historians usually
** use the Julian calendar for dates prior to 1582-10-15 and for some
** dates afterwards, depending on locale. Beware of this difference.
**
** The conversion algorithms are implemented based on descriptions
** in the following text:
**
** Jean Meeus
** Astronomical Algorithms, 2nd Edition, 1998
** ISBM 0-943396-61-1
** Willmann-Bell, Inc
** Richmond, Virginia (USA)
*/
#ifndef SQLITE_OMIT_DATETIME_FUNCS
#include <ctype.h>
#include <stdlib.h>
#include <assert.h>
#include "sqliteInt.h"
#include "os.h"
/*
** A structure for holding a single date and time.
*/
typedef struct DateTime DateTime;
struct DateTime {
double rJD; /* The julian day number */
int Y, M, D; /* Year, month, and day */
int h, m; /* Hour and minutes */
int tz; /* Timezone offset in minutes */
double s; /* Seconds */
char validYMD; /* True if Y,M,D are valid */
char validHMS; /* True if h,m,s are valid */
char validJD; /* True if rJD is valid */
char validTZ; /* True if tz is valid */
};
/*
** Convert N digits from zDate into an integer. Return
** -1 if zDate does not begin with N digits.
*/
static int getDigits(const char *zDate, int N){
int val = 0;
while( N-- ){
if( !isdigit(*zDate) ) return -1;
val = val*10 + *zDate - '0';
zDate++;
}
return val;
}
/*
** Read text from z[] and convert into a floating point number. Return
** the number of digits converted.
*/
static int getValue(const char *z, double *pR){
double r = 0.0;
double rDivide = 1.0;
int isNeg = 0;
int nChar = 0;
if( *z=='+' ){
z++;
nChar++;
}else if( *z=='-' ){
z++;
isNeg = 1;
nChar++;
}
if( !isdigit(*z) ) return 0;
while( isdigit(*z) ){
r = r*10.0 + *z - '0';
nChar++;
z++;
}
if( *z=='.' && isdigit(z[1]) ){
z++;
nChar++;
while( isdigit(*z) ){
r = r*10.0 + *z - '0';
rDivide *= 10.0;
nChar++;
z++;
}
r /= rDivide;
}
if( *z!=0 && !isspace(*z) ) return 0;
*pR = isNeg ? -r : r;
return nChar;
}
/*
** Parse a timezone extension on the end of a date-time.
** The extension is of the form:
**
** (+/-)HH:MM
**
** If the parse is successful, write the number of minutes
** of change in *pnMin and return 0. If a parser error occurs,
** return 0.
**
** A missing specifier is not considered an error.
*/
static int parseTimezone(const char *zDate, DateTime *p){
int sgn = 0;
int nHr, nMn;
while( isspace(*zDate) ){ zDate++; }
p->tz = 0;
if( *zDate=='-' ){
sgn = -1;
}else if( *zDate=='+' ){
sgn = +1;
}else{
return *zDate!=0;
}
zDate++;
nHr = getDigits(zDate, 2);
if( nHr<0 || nHr>14 ) return 1;
zDate += 2;
if( zDate[0]!=':' ) return 1;
zDate++;
nMn = getDigits(zDate, 2);
if( nMn<0 || nMn>59 ) return 1;
zDate += 2;
p->tz = sgn*(nMn + nHr*60);
while( isspace(*zDate) ){ zDate++; }
return *zDate!=0;
}
/*
** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.
** The HH, MM, and SS must each be exactly 2 digits. The
** fractional seconds FFFF can be one or more digits.
**
** Return 1 if there is a parsing error and 0 on success.
*/
static int parseHhMmSs(const char *zDate, DateTime *p){
int h, m, s;
double ms = 0.0;
h = getDigits(zDate, 2);
if( h<0 || zDate[2]!=':' ) return 1;
zDate += 3;
m = getDigits(zDate, 2);
if( m<0 || m>59 ) return 1;
zDate += 2;
if( *zDate==':' ){
s = getDigits(&zDate[1], 2);
if( s<0 || s>59 ) return 1;
zDate += 3;
if( *zDate=='.' && isdigit(zDate[1]) ){
double rScale = 1.0;
zDate++;
while( isdigit(*zDate) ){
ms = ms*10.0 + *zDate - '0';
rScale *= 10.0;
zDate++;
}
ms /= rScale;
}
}else{
s = 0;
}
p->validJD = 0;
p->validHMS = 1;
p->h = h;
p->m = m;
p->s = s + ms;
if( parseTimezone(zDate, p) ) return 1;
p->validTZ = p->tz!=0;
return 0;
}
/*
** Convert from YYYY-MM-DD HH:MM:SS to julian day. We always assume
** that the YYYY-MM-DD is according to the Gregorian calendar.
**
** Reference: Meeus page 61
*/
static void computeJD(DateTime *p){
int Y, M, D, A, B, X1, X2;
if( p->validJD ) return;
if( p->validYMD ){
Y = p->Y;
M = p->M;
D = p->D;
}else{
Y = 2000;
M = 1;
D = 1;
}
if( M<=2 ){
Y--;
M += 12;
}
A = Y/100;
B = 2 - A + (A/4);
X1 = 365.25*(Y+4716);
X2 = 30.6001*(M+1);
p->rJD = X1 + X2 + D + B - 1524.5;
p->validJD = 1;
p->validYMD = 0;
if( p->validHMS ){
p->rJD += (p->h*3600.0 + p->m*60.0 + p->s)/86400.0;
if( p->validTZ ){
p->rJD += p->tz*60/86400.0;
p->validHMS = 0;
p->validTZ = 0;
}
}
}
/*
** Parse dates of the form
**
** YYYY-MM-DD HH:MM:SS.FFF
** YYYY-MM-DD HH:MM:SS
** YYYY-MM-DD HH:MM
** YYYY-MM-DD
**
** Write the result into the DateTime structure and return 0
** on success and 1 if the input string is not a well-formed
** date.
*/
static int parseYyyyMmDd(const char *zDate, DateTime *p){
int Y, M, D;
Y = getDigits(zDate, 4);
if( Y<0 || zDate[4]!='-' ) return 1;
zDate += 5;
M = getDigits(zDate, 2);
if( M<=0 || M>12 || zDate[2]!='-' ) return 1;
zDate += 3;
D = getDigits(zDate, 2);
if( D<=0 || D>31 ) return 1;
zDate += 2;
while( isspace(*zDate) ){ zDate++; }
if( isdigit(*zDate) ){
if( parseHhMmSs(zDate, p) ) return 1;
}else if( *zDate==0 ){
p->validHMS = 0;
}else{
return 1;
}
p->validJD = 0;
p->validYMD = 1;
p->Y = Y;
p->M = M;
p->D = D;
if( p->validTZ ){
computeJD(p);
}
return 0;
}
/*
** Attempt to parse the given string into a Julian Day Number. Return
** the number of errors.
**
** The following are acceptable forms for the input string:
**
** YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM
** DDDD.DD
** now
**
** In the first form, the +/-HH:MM is always optional. The fractional
** seconds extension (the ".FFF") is optional. The seconds portion
** (":SS.FFF") is option. The year and date can be omitted as long
** as there is a time string. The time string can be omitted as long
** as there is a year and date.
*/
static int parseDateOrTime(const char *zDate, DateTime *p){
int i;
memset(p, 0, sizeof(*p));
for(i=0; isdigit(zDate[i]); i++){}
if( i==4 && zDate[i]=='-' ){
return parseYyyyMmDd(zDate, p);
}else if( i==2 && zDate[i]==':' ){
return parseHhMmSs(zDate, p);
return 0;
}else if( i==0 && sqliteStrICmp(zDate,"now")==0 ){
double r;
if( sqliteOsCurrentTime(&r)==0 ){
p->rJD = r;
p->validJD = 1;
return 0;
}
return 1;
}else if( sqliteIsNumber(zDate) ){
p->rJD = atof(zDate);
p->validJD = 1;
return 0;
}
return 1;
}
/*
** Compute the Year, Month, and Day from the julian day number.
*/
static void computeYMD(DateTime *p){
int Z, A, B, C, D, E, X1;
if( p->validYMD ) return;
Z = p->rJD + 0.5;
A = (Z - 1867216.25)/36524.25;
A = Z + 1 + A - (A/4);
B = A + 1524;
C = (B - 122.1)/365.25;
D = 365.25*C;
E = (B-D)/30.6001;
X1 = 30.6001*E;
p->D = B - D - X1;
p->M = E<14 ? E-1 : E-13;
p->Y = p->M>2 ? C - 4716 : C - 4715;
p->validYMD = 1;
}
/*
** Compute the Hour, Minute, and Seconds from the julian day number.
*/
static void computeHMS(DateTime *p){
int Z, s;
if( p->validHMS ) return;
Z = p->rJD + 0.5;
s = (p->rJD + 0.5 - Z)*86400000.0 + 0.5;
p->s = 0.001*s;
s = p->s;
p->s -= s;
p->h = s/3600;
s -= p->h*3600;
p->m = s/60;
p->s += s - p->m*60;
p->validHMS = 1;
}
/*
** Process a modifier to a date-time stamp. The modifiers are
** as follows:
**
** NNN days
** NNN hours
** NNN minutes
** NNN.NNNN seconds
** NNN months
** NNN years
** start of month
** start of year
** start of week
** start of day
** weekday N
** unixepoch
**
** Return 0 on success and 1 if there is any kind of error.
*/
static int parseModifier(const char *zMod, DateTime *p){
int rc = 1;
int n;
double r;
char z[30];
for(n=0; n<sizeof(z)-1; n++){
z[n] = tolower(zMod[n]);
}
z[n] = 0;
switch( z[0] ){
case 'u': {
/*
** unixepoch
**
** Treat the current value of p->rJD as the number of
** seconds since 1970. Convert to a real julian day number.
*/
if( strcmp(z, "unixepoch")==0 && p->validJD ){
p->rJD = p->rJD/86400.0 + 2440587.5;
p->validYMD = 0;
p->validHMS = 0;
p->validTZ = 0;
rc = 0;
}
break;
}
case 'w': {
/*
** weekday N
**
** Move the date to the beginning of the next occurrance of
** weekday N where 0==Sunday, 1==Monday, and so forth. If the
** date is already on the appropriate weekday, this is equivalent
** to "start of day".
*/
if( strncmp(z, "weekday ", 8)==0 && getValue(&z[8],&r)>0
&& (n=r)==r && n>=0 && r<7 ){
int Z;
computeYMD(p);
p->validHMS = 0;
p->validTZ = 0;
p->validJD = 0;
computeJD(p);
Z = p->rJD + 1.5;
Z %= 7;
if( Z>n ) Z -= 7;
p->rJD += n - Z;
p->validYMD = 0;
p->validHMS = 0;
rc = 0;
}
break;
}
case 's': {
/*
** start of TTTTT
**
** Move the date backwards to the beginning of the current day,
** or month or year.
*/
if( strncmp(z, "start of ", 9)!=0 ) break;
zMod = &z[9];
computeYMD(p);
p->validHMS = 1;
p->h = p->m = 0;
p->s = 0.0;
p->validTZ = 0;
p->validJD = 0;
if( strcmp(zMod,"month")==0 ){
p->D = 1;
rc = 0;
}else if( strcmp(zMod,"year")==0 ){
computeYMD(p);
p->M = 1;
p->D = 1;
rc = 0;
}else if( strcmp(zMod,"day")==0 ){
rc = 0;
}
break;
}
case '+':
case '-':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': {
n = getValue(z, &r);
if( n<=0 ) break;
zMod = &z[n];
while( isspace(zMod[0]) ) zMod++;
n = strlen(zMod);
if( n>10 || n<3 ) break;
strcpy(z, zMod);
if( z[n-1]=='s' ){ z[n-1] = 0; n--; }
computeJD(p);
rc = 0;
if( n==3 && strcmp(z,"day")==0 ){
p->rJD += r;
}else if( n==4 && strcmp(z,"hour")==0 ){
computeJD(p);
p->rJD += r/24.0;
}else if( n==6 && strcmp(z,"minute")==0 ){
computeJD(p);
p->rJD += r/(24.0*60.0);
}else if( n==6 && strcmp(z,"second")==0 ){
computeJD(p);
p->rJD += r/(24.0*60.0*60.0);
}else if( n==5 && strcmp(z,"month")==0 ){
int x, y;
computeYMD(p);
p->M += r;
x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12;
p->Y += x;
p->M -= x*12;
p->validJD = 0;
computeJD(p);
y = r;
if( y!=r ){
p->rJD += (r - y)*30.0;
}
}else if( n==4 && strcmp(z,"year")==0 ){
computeYMD(p);
p->Y += r;
p->validJD = 0;
computeJD(p);
}else{
rc = 1;
}
p->validYMD = 0;
p->validHMS = 0;
p->validTZ = 0;
break;
}
default: {
break;
}
}
return rc;
}
/*
** Process time function arguments. argv[0] is a date-time stamp.
** argv[1] and following are modifiers. Parse them all and write
** the resulting time into the DateTime structure p. Return 0
** on success and 1 if there are any errors.
*/
static int isDate(int argc, const char **argv, DateTime *p){
int i;
if( argc==0 ) return 1;
if( parseDateOrTime(argv[0], p) ) return 1;
for(i=1; i<argc; i++){
if( parseModifier(argv[i], p) ) return 1;
}
return 0;
}
/*
** The following routines implement the various date and time functions
** of SQLite.
*/
/*
** julianday( TIMESTRING, MOD, MOD, ...)
**
** Return the julian day number of the date specified in the arguments
*/
static void juliandayFunc(sqlite_func *context, int argc, const char **argv){
DateTime x;
if( isDate(argc, argv, &x)==0 ){
computeJD(&x);
sqlite_set_result_double(context, x.rJD);
}
}
/*
** datetime( TIMESTRING, MOD, MOD, ...)
**
** Return YYYY-MM-DD HH:MM:SS
*/
static void datetimeFunc(sqlite_func *context, int argc, const char **argv){
DateTime x;
if( isDate(argc, argv, &x)==0 ){
char zBuf[100];
computeYMD(&x);
computeHMS(&x);
sprintf(zBuf, "%04d-%02d-%02d %02d:%02d:%02d",x.Y, x.M, x.D, x.h, x.m,
(int)(x.s));
sqlite_set_result_string(context, zBuf, -1);
}
}
/*
** time( TIMESTRING, MOD, MOD, ...)
**
** Return HH:MM:SS
*/
static void timeFunc(sqlite_func *context, int argc, const char **argv){
DateTime x;
if( isDate(argc, argv, &x)==0 ){
char zBuf[100];
computeHMS(&x);
sprintf(zBuf, "%02d:%02d:%02d", x.h, x.m, (int)x.s);
sqlite_set_result_string(context, zBuf, -1);
}
}
/*
** date( TIMESTRING, MOD, MOD, ...)
**
** Return YYYY-MM-DD
*/
static void dateFunc(sqlite_func *context, int argc, const char **argv){
DateTime x;
if( isDate(argc, argv, &x)==0 ){
char zBuf[100];
computeYMD(&x);
sprintf(zBuf, "%04d-%02d-%02d", x.Y, x.M, x.D);
sqlite_set_result_string(context, zBuf, -1);
}
}
/*
** strftime( FORMAT, TIMESTRING, MOD, MOD, ...)
**
** Return a string described by FORMAT. Conversions as follows:
**
** %d day of month
** %f ** fractional seconds SS.SSS
** %H hour 00-24
** %j day of year 000-366
** %J ** Julian day number
** %m month 01-12
** %M minute 00-59
** %s seconds since 1970-01-01
** %S seconds 00-59
** %w day of week 0-6 sunday==0
** %W week of year 00-53
** %Y year 0000-9999
** %% %
*/
static void strftimeFunc(sqlite_func *context, int argc, const char **argv){
DateTime x;
int n, i, j;
char *z;
const char *zFmt = argv[0];
char zBuf[100];
if( isDate(argc-1, argv+1, &x) ) return;
for(i=0, n=1; zFmt[i]; i++, n++){
if( zFmt[i]=='%' ){
switch( zFmt[i+1] ){
case 'd':
case 'H':
case 'm':
case 'M':
case 'S':
case 'W':
n++;
/* fall thru */
case 'w':
case '%':
break;
case 'f':
n += 8;
break;
case 'j':
n += 3;
break;
case 'Y':
n += 8;
break;
case 's':
case 'J':
n += 50;
break;
default:
return; /* ERROR. return a NULL */
}
i++;
}
}
if( n<sizeof(zBuf) ){
z = zBuf;
}else{
z = sqliteMalloc( n );
if( z==0 ) return;
}
computeJD(&x);
computeYMD(&x);
computeHMS(&x);
for(i=j=0; zFmt[i]; i++){
if( zFmt[i]!='%' ){
z[j++] = zFmt[i];
}else{
i++;
switch( zFmt[i] ){
case 'd': sprintf(&z[j],"%02d",x.D); j+=2; break;
case 'f': {
int s = x.s;
int ms = (x.s - s)*1000.0;
sprintf(&z[j],"%02d.%03d",s,ms);
j += strlen(&z[j]);
break;
}
case 'H': sprintf(&z[j],"%02d",x.h); j+=2; break;
case 'W': /* Fall thru */
case 'j': {
int n;
DateTime y = x;
y.validJD = 0;
y.M = 1;
y.D = 1;
computeJD(&y);
n = x.rJD - y.rJD + 1;
if( zFmt[i]=='W' ){
sprintf(&z[j],"%02d",(n+6)/7);
j += 2;
}else{
sprintf(&z[j],"%03d",n);
j += 3;
}
break;
}
case 'J': sprintf(&z[j],"%.16g",x.rJD); j+=strlen(&z[j]); break;
case 'm': sprintf(&z[j],"%02d",x.M); j+=2; break;
case 'M': sprintf(&z[j],"%02d",x.m); j+=2; break;
case 's': {
sprintf(&z[j],"%d",(int)((x.rJD-2440587.5)*86400.0));
j += strlen(&z[j]);
break;
}
case 'S': sprintf(&z[j],"%02d",(int)x.s); j+=2; break;
case 'w': z[j++] = (((int)(x.rJD+1.5)) % 7) + '0'; break;
case 'Y': sprintf(&z[j],"%04d",x.Y); j+=strlen(&z[j]); break;
case '%': z[j++] = '%'; break;
}
}
}
z[j] = 0;
sqlite_set_result_string(context, z, -1);
if( z!=zBuf ){
sqliteFree(z);
}
}
#endif /* !defined(SQLITE_OMIT_DATETIME_FUNCS) */
/*
** This function registered all of the above C functions as SQL
** functions. This should be the only routine in this file with
** external linkage.
*/
void sqliteRegisterDateTimeFunctions(sqlite *db){
static struct {
char *zName;
int nArg;
int dataType;
void (*xFunc)(sqlite_func*,int,const char**);
} aFuncs[] = {
#ifndef SQLITE_OMIT_DATETIME_FUNCS
{ "julianday", -1, SQLITE_NUMERIC, juliandayFunc },
{ "date", -1, SQLITE_TEXT, dateFunc },
{ "time", 1, SQLITE_TEXT, timeFunc },
{ "datetime", -1, SQLITE_TEXT, datetimeFunc },
{ "strftime", -1, SQLITE_TEXT, strftimeFunc },
#endif
};
int i;
for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
sqlite_create_function(db, aFuncs[i].zName,
aFuncs[i].nArg, aFuncs[i].xFunc, 0);
if( aFuncs[i].xFunc ){
sqlite_function_type(db, aFuncs[i].zName, aFuncs[i].dataType);
}
}
}
--- NEW FILE: vdbeInt.h ---
/*
** 2003 September 6
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
** This is the header file for information that is private to the
** VDBE. This information used to all be at the top of the single
** source code file "vdbe.c". When that file became too big (over
** 6000 lines long) it was split up into several smaller files and
** this header information was factored out.
*/
/*
** The makefile scans this source file and creates the following
** array of string constants which are the names of all VDBE opcodes.
** This array is defined in a separate source code file named opcode.c
** which is automatically generated by the makefile.
*/
extern char *sqliteOpcodeNames[];
/*
** SQL is translated into a sequence of instructions to be
** executed by a virtual machine. Each instruction is an instance
** of the following structure.
*/
typedef struct VdbeOp Op;
/*
** Boolean values
*/
typedef unsigned char Bool;
/*
** A cursor is a pointer into a single BTree within a database file.
** The cursor can seek to a BTree entry with a particular key, or
** loop over all entries of the Btree. You can also insert new BTree
** entries or retrieve the key or data from the entry that the cursor
** is currently pointing to.
**
** Every cursor that the virtual machine has open is represented by an
** instance of the following structure.
**
** If the Cursor.isTriggerRow flag is set it means that this cursor is
** really a single row that represents the NEW or OLD pseudo-table of
** a row trigger. The data for the row is stored in Cursor.pData and
** the rowid is in Cursor.iKey.
*/
struct Cursor {
BtCursor *pCursor; /* The cursor structure of the backend */
int lastRecno; /* Last recno from a Next or NextIdx operation */
int nextRowid; /* Next rowid returned by OP_NewRowid */
Bool recnoIsValid; /* True if lastRecno is valid */
Bool keyAsData; /* The OP_Column command works on key instead of data */
Bool atFirst; /* True if pointing to first entry */
Bool useRandomRowid; /* Generate new record numbers semi-randomly */
Bool nullRow; /* True if pointing to a row with no data */
Bool nextRowidValid; /* True if the nextRowid field is valid */
Bool pseudoTable; /* This is a NEW or OLD pseudo-tables of a trigger */
Btree *pBt; /* Separate file holding temporary table */
int nData; /* Number of bytes in pData */
char *pData; /* Data for a NEW or OLD pseudo-table */
int iKey; /* Key for the NEW or OLD pseudo-table row */
};
typedef struct Cursor Cursor;
/*
** A sorter builds a list of elements to be sorted. Each element of
** the list is an instance of the following structure.
*/
typedef struct Sorter Sorter;
struct Sorter {
int nKey; /* Number of bytes in the key */
char *zKey; /* The key by which we will sort */
int nData; /* Number of bytes in the data */
char *pData; /* The data associated with this key */
Sorter *pNext; /* Next in the list */
};
/*
** Number of buckets used for merge-sort.
*/
#define NSORT 30
/*
** Number of bytes of string storage space available to each stack
** layer without having to malloc. NBFS is short for Number of Bytes
** For Strings.
*/
#define NBFS 32
/*
** A single level of the stack is an instance of the following
** structure. Except, string values are stored on a separate
** list of of pointers to character. The reason for storing
** strings separately is so that they can be easily passed
** to the callback function.
*/
struct Stack {
int i; /* Integer value */
int n; /* Number of characters in string value, including '\0' */
int flags; /* Some combination of STK_Null, STK_Str, STK_Dyn, etc. */
double r; /* Real value */
char z[NBFS]; /* Space for short strings */
};
typedef struct Stack Stack;
/*
** Memory cells use the same structure as the stack except that space
** for an arbitrary string is added.
*/
struct Mem {
Stack s; /* All values of the memory cell besides string */
char *z; /* String value for this memory cell */
};
typedef struct Mem Mem;
/*
** Allowed values for Stack.flags
*/
#define STK_Null 0x0001 /* Value is NULL */
#define STK_Str 0x0002 /* Value is a string */
#define STK_Int 0x0004 /* Value is an integer */
#define STK_Real 0x0008 /* Value is a real number */
#define STK_Dyn 0x0010 /* Need to call sqliteFree() on zStack[] */
#define STK_Static 0x0020 /* zStack[] points to a static string */
#define STK_Ephem 0x0040 /* zStack[] points to an ephemeral string */
/* The following STK_ value appears only in AggElem.aMem.s.flag fields.
** It indicates that the corresponding AggElem.aMem.z points to a
** aggregate function context that needs to be finalized.
*/
#define STK_AggCtx 0x0040 /* zStack[] points to an agg function context */
/*
** The "context" argument for a installable function. A pointer to an
** instance of this structure is the first argument to the routines used
** implement the SQL functions.
**
** There is a typedef for this structure in sqlite.h. So all routines,
** even the public interface to SQLite, can use a pointer to this structure.
** But this file is the only place where the internal details of this
** structure are known.
**
** This structure is defined inside of vdbe.c because it uses substructures
** (Stack) which are only defined there.
*/
struct sqlite_func {
FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */
Stack s; /* Small strings, ints, and double values go here */
char *z; /* Space for holding dynamic string results */
void *pAgg; /* Aggregate context */
u8 isError; /* Set to true for an error */
u8 isStep; /* Current in the step function */
int cnt; /* Number of times that the step function has been called */
};
/*
** An Agg structure describes an Aggregator. Each Agg consists of
** zero or more Aggregator elements (AggElem). Each AggElem contains
** a key and one or more values. The values are used in processing
** aggregate functions in a SELECT. The key is used to implement
** the GROUP BY clause of a select.
*/
typedef struct Agg Agg;
typedef struct AggElem AggElem;
struct Agg {
int nMem; /* Number of values stored in each AggElem */
AggElem *pCurrent; /* The AggElem currently in focus */
HashElem *pSearch; /* The hash element for pCurrent */
Hash hash; /* Hash table of all aggregate elements */
FuncDef **apFunc; /* Information about aggregate functions */
};
struct AggElem {
char *zKey; /* The key to this AggElem */
int nKey; /* Number of bytes in the key, including '\0' at end */
Mem aMem[1]; /* The values for this AggElem */
};
/*
** A Set structure is used for quick testing to see if a value
** is part of a small set. Sets are used to implement code like
** this:
** x.y IN ('hi','hoo','hum')
*/
typedef struct Set Set;
struct Set {
Hash hash; /* A set is just a hash table */
HashElem *prev; /* Previously accessed hash elemen */
};
/*
** A Keylist is a bunch of keys into a table. The keylist can
** grow without bound. The keylist stores the ROWIDs of database
** records that need to be deleted or updated.
*/
typedef struct Keylist Keylist;
struct Keylist {
int nKey; /* Number of slots in aKey[] */
int nUsed; /* Next unwritten slot in aKey[] */
int nRead; /* Next unread slot in aKey[] */
Keylist *pNext; /* Next block of keys */
int aKey[1]; /* One or more keys. Extra space allocated as needed */
};
/*
** An instance of the virtual machine. This structure contains the complete
** state of the virtual machine.
**
** The "sqlite_vm" structure pointer that is returned by sqlite_compile()
** is really a pointer to an instance of this structure.
*/
struct Vdbe {
sqlite *db; /* The whole database */
Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
FILE *trace; /* Write an execution trace here, if not NULL */
int nOp; /* Number of instructions in the program */
int nOpAlloc; /* Number of slots allocated for aOp[] */
Op *aOp; /* Space to hold the virtual machine's program */
int nLabel; /* Number of labels used */
int nLabelAlloc; /* Number of slots allocated in aLabel[] */
int *aLabel; /* Space to hold the labels */
int tos; /* Index of top of stack */
Stack *aStack; /* The operand stack, except string values */
char **zStack; /* Text or binary values of the stack */
char **azColName; /* Becomes the 4th parameter to callbacks */
int nCursor; /* Number of slots in aCsr[] */
Cursor *aCsr; /* One element of this array for each open cursor */
Sorter *pSort; /* A linked list of objects to be sorted */
FILE *pFile; /* At most one open file handler */
int nField; /* Number of file fields */
char **azField; /* Data for each file field */
int nVar; /* Number of entries in azVariable[] */
char **azVar; /* Values for the OP_Variable opcode */
int *anVar; /* Length of each value in azVariable[] */
u8 *abVar; /* TRUE if azVariable[i] needs to be sqliteFree()ed */
char *zLine; /* A single line from the input file */
int nLineAlloc; /* Number of spaces allocated for zLine */
int magic; /* Magic number for sanity checking */
int nMem; /* Number of memory locations currently allocated */
Mem *aMem; /* The memory locations */
Agg agg; /* Aggregate information */
int nSet; /* Number of sets allocated */
Set *aSet; /* An array of sets */
int nCallback; /* Number of callbacks invoked so far */
Keylist *pList; /* A list of ROWIDs */
int keylistStackDepth; /* The size of the "keylist" stack */
Keylist **keylistStack; /* The stack used by opcodes ListPush & ListPop */
int pc; /* The program counter */
int rc; /* Value to return */
unsigned uniqueCnt; /* Used by OP_MakeRecord when P2!=0 */
int errorAction; /* Recovery action to do in case of an error */
int undoTransOnError; /* If error, either ROLLBACK or COMMIT */
int inTempTrans; /* True if temp database is transactioned */
int returnStack[100]; /* Return address stack for OP_Gosub & OP_Return */
int returnDepth; /* Next unused element in returnStack[] */
int nResColumn; /* Number of columns in one row of the result set */
char **azResColumn; /* Values for one row of result */
int (*xCallback)(void*,int,char**,char**); /* Callback for SELECT results */
void *pCbArg; /* First argument to xCallback() */
int popStack; /* Pop the stack this much on entry to VdbeExec() */
char *zErrMsg; /* Error message written here */
u8 explain; /* True if EXPLAIN present on SQL command */
};
/*
** The following are allowed values for Vdbe.magic
*/
#define VDBE_MAGIC_INIT 0x26bceaa5 /* Building a VDBE program */
#define VDBE_MAGIC_RUN 0xbdf20da3 /* VDBE is ready to execute */
#define VDBE_MAGIC_HALT 0x519c2973 /* VDBE has completed execution */
#define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */
/*
** Here is a macro to handle the common case of popping the stack
** once. This macro only works from within the sqliteVdbeExec()
** function.
*/
#define POPSTACK \
assert(p->tos>=0); \
if( aStack[p->tos].flags & STK_Dyn ) sqliteFree(zStack[p->tos]); \
p->tos--;
/*
** Function prototypes
*/
void sqliteVdbeCleanupCursor(Cursor*);
void sqliteVdbeSorterReset(Vdbe*);
void sqliteVdbeAggReset(Agg*);
void sqliteVdbeKeylistFree(Keylist*);
void sqliteVdbePopStack(Vdbe*,int);
#if !defined(NDEBUG) || defined(VDBE_PROFILE)
void sqliteVdbePrintOp(FILE*, int, Op*);
#endif
--- NEW FILE: vdbeaux.c ---
/*
** 2003 September 6
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains code used for creating, destroying, and populating
** a VDBE (or an "sqlite_vm" as it is known to the outside world.) Prior
** to version 2.8.7, all this code was combined into the vdbe.c source file.
** But that file was getting too big so this subroutines were split out.
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>
#include "vdbeInt.h"
/*
** When debugging the code generator in a symbolic debugger, one can
** set the sqlite_vdbe_addop_trace to 1 and all opcodes will be printed
** as they are added to the instruction stream.
*/
#ifndef NDEBUG
int sqlite_vdbe_addop_trace = 0;
#endif
/*
** Create a new virtual database engine.
*/
Vdbe *sqliteVdbeCreate(sqlite *db){
Vdbe *p;
p = sqliteMalloc( sizeof(Vdbe) );
if( p==0 ) return 0;
p->db = db;
if( db->pVdbe ){
db->pVdbe->pPrev = p;
}
p->pNext = db->pVdbe;
p->pPrev = 0;
db->pVdbe = p;
p->magic = VDBE_MAGIC_INIT;
return p;
}
/*
** Turn tracing on or off
*/
void sqliteVdbeTrace(Vdbe *p, FILE *trace){
p->trace = trace;
}
/*
** Add a new instruction to the list of instructions current in the
** VDBE. Return the address of the new instruction.
**
** Parameters:
**
** p Pointer to the VDBE
**
** op The opcode for this instruction
**
** p1, p2 First two of the three possible operands.
**
** Use the sqliteVdbeResolveLabel() function to fix an address and
** the sqliteVdbeChangeP3() function to change the value of the P3
** operand.
*/
int sqliteVdbeAddOp(Vdbe *p, int op, int p1, int p2){
int i;
i = p->nOp;
p->nOp++;
assert( p->magic==VDBE_MAGIC_INIT );
if( i>=p->nOpAlloc ){
int oldSize = p->nOpAlloc;
Op *aNew;
p->nOpAlloc = p->nOpAlloc*2 + 100;
aNew = sqliteRealloc(p->aOp, p->nOpAlloc*sizeof(Op));
if( aNew==0 ){
p->nOpAlloc = oldSize;
return 0;
}
p->aOp = aNew;
memset(&p->aOp[oldSize], 0, (p->nOpAlloc-oldSize)*sizeof(Op));
}
p->aOp[i].opcode = op;
p->aOp[i].p1 = p1;
if( p2<0 && (-1-p2)<p->nLabel && p->aLabel[-1-p2]>=0 ){
p2 = p->aLabel[-1-p2];
}
p->aOp[i].p2 = p2;
p->aOp[i].p3 = 0;
p->aOp[i].p3type = P3_NOTUSED;
#ifndef NDEBUG
if( sqlite_vdbe_addop_trace ) sqliteVdbePrintOp(0, i, &p->aOp[i]);
#endif
return i;
}
/*
** Create a new symbolic label for an instruction that has yet to be
** coded. The symbolic label is really just a negative number. The
** label can be used as the P2 value of an operation. Later, when
** the label is resolved to a specific address, the VDBE will scan
** through its operation list and change all values of P2 which match
** the label into the resolved address.
**
** The VDBE knows that a P2 value is a label because labels are
** always negative and P2 values are suppose to be non-negative.
** Hence, a negative P2 value is a label that has yet to be resolved.
*/
int sqliteVdbeMakeLabel(Vdbe *p){
int i;
i = p->nLabel++;
assert( p->magic==VDBE_MAGIC_INIT );
if( i>=p->nLabelAlloc ){
int *aNew;
p->nLabelAlloc = p->nLabelAlloc*2 + 10;
aNew = sqliteRealloc( p->aLabel, p->nLabelAlloc*sizeof(p->aLabel[0]));
if( aNew==0 ){
sqliteFree(p->aLabel);
}
p->aLabel = aNew;
}
if( p->aLabel==0 ){
p->nLabel = 0;
p->nLabelAlloc = 0;
return 0;
}
p->aLabel[i] = -1;
return -1-i;
}
/*
** Resolve label "x" to be the address of the next instruction to
** be inserted. The parameter "x" must have been obtained from
** a prior call to sqliteVdbeMakeLabel().
*/
void sqliteVdbeResolveLabel(Vdbe *p, int x){
int j;
assert( p->magic==VDBE_MAGIC_INIT );
if( x<0 && (-x)<=p->nLabel && p->aOp ){
if( p->aLabel[-1-x]==p->nOp ) return;
assert( p->aLabel[-1-x]<0 );
p->aLabel[-1-x] = p->nOp;
for(j=0; j<p->nOp; j++){
if( p->aOp[j].p2==x ) p->aOp[j].p2 = p->nOp;
}
}
}
/*
** Return the address of the next instruction to be inserted.
*/
int sqliteVdbeCurrentAddr(Vdbe *p){
assert( p->magic==VDBE_MAGIC_INIT );
return p->nOp;
}
/*
** Add a whole list of operations to the operation stack. Return the
** address of the first operation added.
*/
int sqliteVdbeAddOpList(Vdbe *p, int nOp, VdbeOp const *aOp){
int addr;
assert( p->magic==VDBE_MAGIC_INIT );
if( p->nOp + nOp >= p->nOpAlloc ){
int oldSize = p->nOpAlloc;
Op *aNew;
p->nOpAlloc = p->nOpAlloc*2 + nOp + 10;
aNew = sqliteRealloc(p->aOp, p->nOpAlloc*sizeof(Op));
if( aNew==0 ){
p->nOpAlloc = oldSize;
return 0;
}
p->aOp = aNew;
memset(&p->aOp[oldSize], 0, (p->nOpAlloc-oldSize)*sizeof(Op));
}
addr = p->nOp;
if( nOp>0 ){
int i;
for(i=0; i<nOp; i++){
int p2 = aOp[i].p2;
p->aOp[i+addr] = aOp[i];
if( p2<0 ) p->aOp[i+addr].p2 = addr + ADDR(p2);
p->aOp[i+addr].p3type = aOp[i].p3 ? P3_STATIC : P3_NOTUSED;
#ifndef NDEBUG
if( sqlite_vdbe_addop_trace ){
sqliteVdbePrintOp(0, i+addr, &p->aOp[i+addr]);
}
#endif
}
p->nOp += nOp;
}
return addr;
}
/*
** Change the value of the P1 operand for a specific instruction.
** This routine is useful when a large program is loaded from a
** static array using sqliteVdbeAddOpList but we want to make a
** few minor changes to the program.
*/
void sqliteVdbeChangeP1(Vdbe *p, int addr, int val){
assert( p->magic==VDBE_MAGIC_INIT );
if( p && addr>=0 && p->nOp>addr && p->aOp ){
p->aOp[addr].p1 = val;
}
}
/*
** Change the value of the P2 operand for a specific instruction.
** This routine is useful for setting a jump destination.
*/
void sqliteVdbeChangeP2(Vdbe *p, int addr, int val){
assert( val>=0 );
assert( p->magic==VDBE_MAGIC_INIT );
if( p && addr>=0 && p->nOp>addr && p->aOp ){
p->aOp[addr].p2 = val;
}
}
/*
** Change the value of the P3 operand for a specific instruction.
** This routine is useful when a large program is loaded from a
** static array using sqliteVdbeAddOpList but we want to make a
** few minor changes to the program.
**
** If n>=0 then the P3 operand is dynamic, meaning that a copy of
** the string is made into memory obtained from sqliteMalloc().
** A value of n==0 means copy bytes of zP3 up to and including the
** first null byte. If n>0 then copy n+1 bytes of zP3.
**
** If n==P3_STATIC it means that zP3 is a pointer to a constant static
** string and we can just copy the pointer. n==P3_POINTER means zP3 is
** a pointer to some object other than a string.
**
** If addr<0 then change P3 on the most recently inserted instruction.
*/
void sqliteVdbeChangeP3(Vdbe *p, int addr, const char *zP3, int n){
Op *pOp;
assert( p->magic==VDBE_MAGIC_INIT );
if( p==0 || p->aOp==0 ) return;
if( addr<0 || addr>=p->nOp ){
addr = p->nOp - 1;
if( addr<0 ) return;
}
pOp = &p->aOp[addr];
if( pOp->p3 && pOp->p3type==P3_DYNAMIC ){
sqliteFree(pOp->p3);
pOp->p3 = 0;
}
if( zP3==0 ){
pOp->p3 = 0;
pOp->p3type = P3_NOTUSED;
}else if( n<0 ){
pOp->p3 = (char*)zP3;
pOp->p3type = n;
}else{
sqliteSetNString(&pOp->p3, zP3, n, 0);
pOp->p3type = P3_DYNAMIC;
}
}
/*
** If the P3 operand to the specified instruction appears
** to be a quoted string token, then this procedure removes
** the quotes.
**
** The quoting operator can be either a grave ascent (ASCII 0x27)
** or a double quote character (ASCII 0x22). Two quotes in a row
** resolve to be a single actual quote character within the string.
*/
void sqliteVdbeDequoteP3(Vdbe *p, int addr){
Op *pOp;
assert( p->magic==VDBE_MAGIC_INIT );
if( p->aOp==0 || addr<0 || addr>=p->nOp ) return;
pOp = &p->aOp[addr];
if( pOp->p3==0 || pOp->p3[0]==0 ) return;
if( pOp->p3type==P3_POINTER ) return;
if( pOp->p3type!=P3_DYNAMIC ){
pOp->p3 = sqliteStrDup(pOp->p3);
pOp->p3type = P3_DYNAMIC;
}
sqliteDequote(pOp->p3);
}
/*
** On the P3 argument of the given instruction, change all
** strings of whitespace characters into a single space and
** delete leading and trailing whitespace.
*/
void sqliteVdbeCompressSpace(Vdbe *p, int addr){
unsigned char *z;
int i, j;
Op *pOp;
assert( p->magic==VDBE_MAGIC_INIT );
if( p->aOp==0 || addr<0 || addr>=p->nOp ) return;
pOp = &p->aOp[addr];
if( pOp->p3type==P3_POINTER ){
return;
}
if( pOp->p3type!=P3_DYNAMIC ){
pOp->p3 = sqliteStrDup(pOp->p3);
pOp->p3type = P3_DYNAMIC;
}
z = (unsigned char*)pOp->p3;
if( z==0 ) return;
i = j = 0;
while( isspace(z[i]) ){ i++; }
while( z[i] ){
if( isspace(z[i]) ){
z[j++] = ' ';
while( isspace(z[++i]) ){}
}else{
z[j++] = z[i++];
}
}
while( j>0 && isspace(z[j-1]) ){ j--; }
z[j] = 0;
}
/*
** Search for the current program for the given opcode and P2
** value. Return the address plus 1 if found and 0 if not found.
*/
int sqliteVdbeFindOp(Vdbe *p, int op, int p2){
int i;
assert( p->magic==VDBE_MAGIC_INIT );
for(i=0; i<p->nOp; i++){
if( p->aOp[i].opcode==op && p->aOp[i].p2==p2 ) return i+1;
}
return 0;
}
/*
** Return the opcode for a given address.
*/
VdbeOp *sqliteVdbeGetOp(Vdbe *p, int addr){
assert( p->magic==VDBE_MAGIC_INIT );
assert( addr>=0 && addr<p->nOp );
return &p->aOp[addr];
}
/*
** The following group or routines are employed by installable functions
** to return their results.
**
** The sqlite_set_result_string() routine can be used to return a string
** value or to return a NULL. To return a NULL, pass in NULL for zResult.
** A copy is made of the string before this routine returns so it is safe
** to pass in an ephemeral string.
**
** sqlite_set_result_error() works like sqlite_set_result_string() except
** that it signals a fatal error. The string argument, if any, is the
** error message. If the argument is NULL a generic substitute error message
** is used.
**
** The sqlite_set_result_int() and sqlite_set_result_double() set the return
** value of the user function to an integer or a double.
**
** These routines are defined here in vdbe.c because they depend on knowing
** the internals of the sqlite_func structure which is only defined in
** this source file.
*/
char *sqlite_set_result_string(sqlite_func *p, const char *zResult, int n){
assert( !p->isStep );
if( p->s.flags & STK_Dyn ){
sqliteFree(p->z);
}
if( zResult==0 ){
p->s.flags = STK_Null;
n = 0;
p->z = 0;
p->s.n = 0;
}else{
if( n<0 ) n = strlen(zResult);
if( n<NBFS-1 ){
memcpy(p->s.z, zResult, n);
p->s.z[n] = 0;
p->s.flags = STK_Str;
p->z = p->s.z;
}else{
p->z = sqliteMallocRaw( n+1 );
if( p->z ){
memcpy(p->z, zResult, n);
p->z[n] = 0;
}
p->s.flags = STK_Str | STK_Dyn;
}
p->s.n = n+1;
}
return p->z;
}
void sqlite_set_result_int(sqlite_func *p, int iResult){
assert( !p->isStep );
if( p->s.flags & STK_Dyn ){
sqliteFree(p->z);
}
p->s.i = iResult;
p->s.flags = STK_Int;
}
void sqlite_set_result_double(sqlite_func *p, double rResult){
assert( !p->isStep );
if( p->s.flags & STK_Dyn ){
sqliteFree(p->z);
}
p->s.r = rResult;
p->s.flags = STK_Real;
}
void sqlite_set_result_error(sqlite_func *p, const char *zMsg, int n){
assert( !p->isStep );
sqlite_set_result_string(p, zMsg, n);
p->isError = 1;
}
/*
** Extract the user data from a sqlite_func structure and return a
** pointer to it.
*/
void *sqlite_user_data(sqlite_func *p){
assert( p && p->pFunc );
return p->pFunc->pUserData;
}
/*
** Allocate or return the aggregate context for a user function. A new
** context is allocated on the first call. Subsequent calls return the
** same context that was returned on prior calls.
**
** This routine is defined here in vdbe.c because it depends on knowing
** the internals of the sqlite_func structure which is only defined in
** this source file.
*/
void *sqlite_aggregate_context(sqlite_func *p, int nByte){
assert( p && p->pFunc && p->pFunc->xStep );
if( p->pAgg==0 ){
if( nByte<=NBFS ){
p->pAgg = (void*)p->z;
}else{
p->pAgg = sqliteMalloc( nByte );
}
}
return p->pAgg;
}
/*
** Return the number of times the Step function of a aggregate has been
** called.
**
** This routine is defined here in vdbe.c because it depends on knowing
** the internals of the sqlite_func structure which is only defined in
** this source file.
*/
int sqlite_aggregate_count(sqlite_func *p){
assert( p && p->pFunc && p->pFunc->xStep );
return p->cnt;
}
#if !defined(NDEBUG) || defined(VDBE_PROFILE)
/*
** Print a single opcode. This routine is used for debugging only.
*/
void sqliteVdbePrintOp(FILE *pOut, int pc, Op *pOp){
char *zP3;
char zPtr[40];
if( pOp->p3type==P3_POINTER ){
sprintf(zPtr, "ptr(%#x)", (int)pOp->p3);
zP3 = zPtr;
}else{
zP3 = pOp->p3;
}
if( pOut==0 ) pOut = stdout;
fprintf(pOut,"%4d %-12s %4d %4d %s\n",
pc, sqliteOpcodeNames[pOp->opcode], pOp->p1, pOp->p2, zP3 ? zP3 : "");
fflush(pOut);
}
#endif
/*
** Give a listing of the program in the virtual machine.
**
** The interface is the same as sqliteVdbeExec(). But instead of
** running the code, it invokes the callback once for each instruction.
** This feature is used to implement "EXPLAIN".
*/
int sqliteVdbeList(
Vdbe *p /* The VDBE */
){
sqlite *db = p->db;
int i;
static char *azColumnNames[] = {
"addr", "opcode", "p1", "p2", "p3",
"int", "text", "int", "int", "text",
0
};
assert( p->popStack==0 );
assert( p->explain );
p->azColName = azColumnNames;
p->azResColumn = p->zStack;
for(i=0; i<5; i++) p->zStack[i] = p->aStack[i].z;
p->rc = SQLITE_OK;
for(i=p->pc; p->rc==SQLITE_OK && i<p->nOp; i++){
if( db->flags & SQLITE_Interrupt ){
db->flags &= ~SQLITE_Interrupt;
if( db->magic!=SQLITE_MAGIC_BUSY ){
p->rc = SQLITE_MISUSE;
}else{
p->rc = SQLITE_INTERRUPT;
}
sqliteSetString(&p->zErrMsg, sqlite_error_string(p->rc), (char*)0);
break;
}
sprintf(p->zStack[0],"%d",i);
sprintf(p->zStack[2],"%d", p->aOp[i].p1);
sprintf(p->zStack[3],"%d", p->aOp[i].p2);
if( p->aOp[i].p3type==P3_POINTER ){
sprintf(p->aStack[4].z, "ptr(%#x)", (int)p->aOp[i].p3);
p->zStack[4] = p->aStack[4].z;
}else{
p->zStack[4] = p->aOp[i].p3;
}
p->zStack[1] = sqliteOpcodeNames[p->aOp[i].opcode];
if( p->xCallback==0 ){
p->pc = i+1;
p->azResColumn = p->zStack;
p->nResColumn = 5;
return SQLITE_ROW;
}
if( sqliteSafetyOff(db) ){
p->rc = SQLITE_MISUSE;
break;
}
if( p->xCallback(p->pCbArg, 5, p->zStack, p->azColName) ){
p->rc = SQLITE_ABORT;
}
if( sqliteSafetyOn(db) ){
p->rc = SQLITE_MISUSE;
}
}
return p->rc==SQLITE_OK ? SQLITE_DONE : SQLITE_ERROR;
}
/*
** Prepare a virtual machine for execution. This involves things such
** as allocating stack space and initializing the program counter.
** After the VDBE has be prepped, it can be executed by one or more
** calls to sqliteVdbeExec().
**
** The behavior of sqliteVdbeExec() is influenced by the parameters to
** this routine. If xCallback is NULL, then sqliteVdbeExec() will return
** with SQLITE_ROW whenever there is a row of the result set ready
** to be delivered. p->azResColumn will point to the row and
** p->nResColumn gives the number of columns in the row. If xCallback
** is not NULL, then the xCallback() routine is invoked to process each
** row in the result set.
*/
void sqliteVdbeMakeReady(
Vdbe *p, /* The VDBE */
int nVar, /* Number of '?' see in the SQL statement */
sqlite_callback xCallback, /* Result callback */
void *pCallbackArg, /* 1st argument to xCallback() */
int isExplain /* True if the EXPLAIN keywords is present */
){
int n;
assert( p!=0 );
assert( p->magic==VDBE_MAGIC_INIT );
/* Add a HALT instruction to the very end of the program.
*/
if( p->nOp==0 || (p->aOp && p->aOp[p->nOp-1].opcode!=OP_Halt) ){
sqliteVdbeAddOp(p, OP_Halt, 0, 0);
}
/* No instruction ever pushes more than a single element onto the
** stack. And the stack never grows on successive executions of the
** same loop. So the total number of instructions is an upper bound
** on the maximum stack depth required.
**
** Allocation all the stack space we will ever need.
*/
if( p->aStack==0 ){
p->nVar = nVar;
assert( nVar>=0 );
n = isExplain ? 10 : p->nOp;
p->aStack = sqliteMalloc(
n*(sizeof(p->aStack[0]) + 2*sizeof(char*)) /* aStack and zStack */
+ p->nVar*(sizeof(char*)+sizeof(int)+1) /* azVar, anVar, abVar */
);
p->zStack = (char**)&p->aStack[n];
p->azColName = (char**)&p->zStack[n];
p->azVar = (char**)&p->azColName[n];
p->anVar = (int*)&p->azVar[p->nVar];
p->abVar = (u8*)&p->anVar[p->nVar];
}
sqliteHashInit(&p->agg.hash, SQLITE_HASH_BINARY, 0);
p->agg.pSearch = 0;
#ifdef MEMORY_DEBUG
if( sqliteOsFileExists("vdbe_trace") ){
p->trace = stdout;
}
#endif
p->tos = -1;
p->pc = 0;
p->rc = SQLITE_OK;
p->uniqueCnt = 0;
p->returnDepth = 0;
p->errorAction = OE_Abort;
p->undoTransOnError = 0;
p->xCallback = xCallback;
p->pCbArg = pCallbackArg;
p->popStack = 0;
p->explain |= isExplain;
p->magic = VDBE_MAGIC_RUN;
#ifdef VDBE_PROFILE
for(i=0; i<p->nOp; i++){
p->aOp[i].cnt = 0;
p->aOp[i].cycles = 0;
}
#endif
}
/*
** Remove any elements that remain on the sorter for the VDBE given.
*/
void sqliteVdbeSorterReset(Vdbe *p){
while( p->pSort ){
Sorter *pSorter = p->pSort;
p->pSort = pSorter->pNext;
sqliteFree(pSorter->zKey);
sqliteFree(pSorter->pData);
sqliteFree(pSorter);
}
}
/*
** Pop the stack N times. Free any memory associated with the
** popped stack elements.
*/
void sqliteVdbePopStack(Vdbe *p, int N){
assert( N>=0 );
if( p->zStack==0 ) return;
assert( p->aStack || sqlite_malloc_failed );
if( p->aStack==0 ) return;
while( N-- > 0 ){
if( p->aStack[p->tos].flags & STK_Dyn ){
sqliteFree(p->zStack[p->tos]);
}
p->aStack[p->tos].flags = 0;
p->zStack[p->tos] = 0;
p->tos--;
}
}
/*
** Reset an Agg structure. Delete all its contents.
**
** For installable aggregate functions, if the step function has been
** called, make sure the finalizer function has also been called. The
** finalizer might need to free memory that was allocated as part of its
** private context. If the finalizer has not been called yet, call it
** now.
*/
void sqliteVdbeAggReset(Agg *pAgg){
int i;
HashElem *p;
for(p = sqliteHashFirst(&pAgg->hash); p; p = sqliteHashNext(p)){
AggElem *pElem = sqliteHashData(p);
assert( pAgg->apFunc!=0 );
for(i=0; i<pAgg->nMem; i++){
Mem *pMem = &pElem->aMem[i];
if( pAgg->apFunc[i] && (pMem->s.flags & STK_AggCtx)!=0 ){
sqlite_func ctx;
ctx.pFunc = pAgg->apFunc[i];
ctx.s.flags = STK_Null;
ctx.z = 0;
ctx.pAgg = pMem->z;
ctx.cnt = pMem->s.i;
ctx.isStep = 0;
ctx.isError = 0;
(*pAgg->apFunc[i]->xFinalize)(&ctx);
if( pMem->z!=0 && pMem->z!=pMem->s.z ){
sqliteFree(pMem->z);
}
}else if( pMem->s.flags & STK_Dyn ){
sqliteFree(pMem->z);
}
}
sqliteFree(pElem);
}
sqliteHashClear(&pAgg->hash);
sqliteFree(pAgg->apFunc);
pAgg->apFunc = 0;
pAgg->pCurrent = 0;
pAgg->pSearch = 0;
pAgg->nMem = 0;
}
/*
** Delete a keylist
*/
void sqliteVdbeKeylistFree(Keylist *p){
while( p ){
Keylist *pNext = p->pNext;
sqliteFree(p);
p = pNext;
}
}
/*
** Close a cursor and release all the resources that cursor happens
** to hold.
*/
void sqliteVdbeCleanupCursor(Cursor *pCx){
if( pCx->pCursor ){
sqliteBtreeCloseCursor(pCx->pCursor);
}
if( pCx->pBt ){
sqliteBtreeClose(pCx->pBt);
}
sqliteFree(pCx->pData);
memset(pCx, 0, sizeof(Cursor));
}
/*
** Close all cursors
*/
static void closeAllCursors(Vdbe *p){
int i;
for(i=0; i<p->nCursor; i++){
sqliteVdbeCleanupCursor(&p->aCsr[i]);
}
sqliteFree(p->aCsr);
p->aCsr = 0;
p->nCursor = 0;
}
/*
** Clean up the VM after execution.
**
** This routine will automatically close any cursors, lists, and/or
** sorters that were left open. It also deletes the values of
** variables in the azVariable[] array.
*/
static void Cleanup(Vdbe *p){
int i;
sqliteVdbePopStack(p, p->tos+1);
closeAllCursors(p);
if( p->aMem ){
for(i=0; i<p->nMem; i++){
if( p->aMem[i].s.flags & STK_Dyn ){
sqliteFree(p->aMem[i].z);
}
}
}
sqliteFree(p->aMem);
p->aMem = 0;
p->nMem = 0;
if( p->pList ){
sqliteVdbeKeylistFree(p->pList);
p->pList = 0;
}
sqliteVdbeSorterReset(p);
if( p->pFile ){
if( p->pFile!=stdin ) fclose(p->pFile);
p->pFile = 0;
}
if( p->azField ){
sqliteFree(p->azField);
p->azField = 0;
}
p->nField = 0;
if( p->zLine ){
sqliteFree(p->zLine);
p->zLine = 0;
}
p->nLineAlloc = 0;
sqliteVdbeAggReset(&p->agg);
if( p->aSet ){
for(i=0; i<p->nSet; i++){
sqliteHashClear(&p->aSet[i].hash);
}
}
sqliteFree(p->aSet);
p->aSet = 0;
p->nSet = 0;
if( p->keylistStack ){
int ii;
for(ii = 0; ii < p->keylistStackDepth; ii++){
sqliteVdbeKeylistFree(p->keylistStack[ii]);
}
sqliteFree(p->keylistStack);
p->keylistStackDepth = 0;
p->keylistStack = 0;
}
sqliteFree(p->zErrMsg);
p->zErrMsg = 0;
}
/*
** Clean up a VDBE after execution but do not delete the VDBE just yet.
** Write any error messages into *pzErrMsg. Return the result code.
**
** After this routine is run, the VDBE should be ready to be executed
** again.
*/
int sqliteVdbeReset(Vdbe *p, char **pzErrMsg){
sqlite *db = p->db;
int i;
if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){
sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0);
return SQLITE_MISUSE;
}
if( p->zErrMsg ){
if( pzErrMsg && *pzErrMsg==0 ){
*pzErrMsg = p->zErrMsg;
}else{
sqliteFree(p->zErrMsg);
}
p->zErrMsg = 0;
}
Cleanup(p);
if( p->rc!=SQLITE_OK ){
switch( p->errorAction ){
case OE_Abort: {
if( !p->undoTransOnError ){
for(i=0; i<db->nDb; i++){
if( db->aDb[i].pBt ){
sqliteBtreeRollbackCkpt(db->aDb[i].pBt);
}
}
break;
}
/* Fall through to ROLLBACK */
}
case OE_Rollback: {
sqliteRollbackAll(db);
db->flags &= ~SQLITE_InTrans;
db->onError = OE_Default;
break;
}
default: {
if( p->undoTransOnError ){
sqliteRollbackAll(db);
db->flags &= ~SQLITE_InTrans;
db->onError = OE_Default;
}
break;
}
}
sqliteRollbackInternalChanges(db);
}
for(i=0; i<db->nDb; i++){
if( db->aDb[i].pBt && db->aDb[i].inTrans==2 ){
sqliteBtreeCommitCkpt(db->aDb[i].pBt);
db->aDb[i].inTrans = 1;
}
}
assert( p->tos<p->pc || sqlite_malloc_failed==1 );
#ifdef VDBE_PROFILE
{
FILE *out = fopen("vdbe_profile.out", "a");
if( out ){
int i;
fprintf(out, "---- ");
for(i=0; i<p->nOp; i++){
fprintf(out, "%02x", p->aOp[i].opcode);
}
fprintf(out, "\n");
for(i=0; i<p->nOp; i++){
fprintf(out, "%6d %10lld %8lld ",
p->aOp[i].cnt,
p->aOp[i].cycles,
p->aOp[i].cnt>0 ? p->aOp[i].cycles/p->aOp[i].cnt : 0
);
sqliteVdbePrintOp(out, i, &p->aOp[i]);
}
fclose(out);
}
}
#endif
p->magic = VDBE_MAGIC_INIT;
return p->rc;
}
/*
** Clean up and delete a VDBE after execution. Return an integer which is
** the result code. Write any error message text into *pzErrMsg.
*/
int sqliteVdbeFinalize(Vdbe *p, char **pzErrMsg){
int rc;
sqlite *db;
if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){
sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0);
return SQLITE_MISUSE;
}
db = p->db;
rc = sqliteVdbeReset(p, pzErrMsg);
sqliteVdbeDelete(p);
if( db->want_to_close && db->pVdbe==0 ){
sqlite_close(db);
}
return rc;
}
/*
** Set the values of all variables. Variable $1 in the original SQL will
** be the string azValue[0]. $2 will have the value azValue[1]. And
** so forth. If a value is out of range (for example $3 when nValue==2)
** then its value will be NULL.
**
** This routine overrides any prior call.
*/
int sqlite_bind(sqlite_vm *pVm, int i, const char *zVal, int len, int copy){
Vdbe *p = (Vdbe*)pVm;
if( p->magic!=VDBE_MAGIC_RUN || p->pc!=0 ){
return SQLITE_MISUSE;
}
if( i<1 || i>p->nVar ){
return SQLITE_RANGE;
}
i--;
if( p->abVar[i] ){
sqliteFree(p->azVar[i]);
}
if( zVal==0 ){
copy = 0;
len = 0;
}
if( len<0 ){
len = strlen(zVal)+1;
}
if( copy ){
p->azVar[i] = sqliteMalloc( len );
if( p->azVar[i] ) memcpy(p->azVar[i], zVal, len);
}else{
p->azVar[i] = (char*)zVal;
}
p->abVar[i] = copy;
p->anVar[i] = len;
return SQLITE_OK;
}
/*
** Delete an entire VDBE.
*/
void sqliteVdbeDelete(Vdbe *p){
int i;
if( p==0 ) return;
Cleanup(p);
if( p->pPrev ){
p->pPrev->pNext = p->pNext;
}else{
assert( p->db->pVdbe==p );
p->db->pVdbe = p->pNext;
}
if( p->pNext ){
p->pNext->pPrev = p->pPrev;
}
p->pPrev = p->pNext = 0;
if( p->nOpAlloc==0 ){
p->aOp = 0;
p->nOp = 0;
}
for(i=0; i<p->nOp; i++){
if( p->aOp[i].p3type==P3_DYNAMIC ){
sqliteFree(p->aOp[i].p3);
}
}
for(i=0; i<p->nVar; i++){
if( p->abVar[i] ) sqliteFree(p->azVar[i]);
}
sqliteFree(p->aOp);
sqliteFree(p->aLabel);
sqliteFree(p->aStack);
p->magic = VDBE_MAGIC_DEAD;
sqliteFree(p);
}
Index: attach.c
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/sqlite/attach.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** attach.c 26 Aug 2003 15:02:43 -0000 1.1
--- attach.c 18 Dec 2003 13:20:23 -0000 1.2
***************
*** 92,97 ****
db->flags &= ~SQLITE_Initialized;
if( pParse->nErr ) return;
! rc = sqliteInit(pParse->db, &pParse->zErrMsg);
if( rc ){
sqliteResetInternalSchema(db, 0);
pParse->nErr++;
--- 92,105 ----
db->flags &= ~SQLITE_Initialized;
if( pParse->nErr ) return;
! if( rc==SQLITE_OK ){
! rc = sqliteInit(pParse->db, &pParse->zErrMsg);
! }
if( rc ){
+ int i = db->nDb - 1;
+ assert( i>=2 );
+ if( db->aDb[i].pBt ){
+ sqliteBtreeClose(db->aDb[i].pBt);
+ db->aDb[i].pBt = 0;
+ }
sqliteResetInternalSchema(db, 0);
pParse->nErr++;
Index: auth.c
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/sqlite/auth.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** auth.c 26 Aug 2003 15:02:43 -0000 1.1
--- auth.c 18 Dec 2003 13:20:23 -0000 1.2
***************
*** 90,94 ****
sqliteSetString(&pParse->zErrMsg, "illegal return value ", zBuf,
" from the authorization function - should be SQLITE_OK, "
! "SQLITE_IGNORE, or SQLITE_DENY", 0);
pParse->nErr++;
pParse->rc = SQLITE_MISUSE;
--- 90,94 ----
sqliteSetString(&pParse->zErrMsg, "illegal return value ", zBuf,
" from the authorization function - should be SQLITE_OK, "
! "SQLITE_IGNORE, or SQLITE_DENY", (char*)0);
pParse->nErr++;
pParse->rc = SQLITE_MISUSE;
***************
*** 152,159 ****
if( db->nDb>2 || pExpr->iDb!=0 ){
sqliteSetString(&pParse->zErrMsg,"access to ", zDBase, ".",
! pTab->zName, ".", zCol, " is prohibited", 0);
}else{
sqliteSetString(&pParse->zErrMsg,"access to ", pTab->zName, ".",
! zCol, " is prohibited", 0);
}
pParse->nErr++;
--- 152,159 ----
if( db->nDb>2 || pExpr->iDb!=0 ){
sqliteSetString(&pParse->zErrMsg,"access to ", zDBase, ".",
! pTab->zName, ".", zCol, " is prohibited", (char*)0);
}else{
sqliteSetString(&pParse->zErrMsg,"access to ", pTab->zName, ".",
! zCol, " is prohibited", (char*)0);
}
pParse->nErr++;
***************
*** 185,189 ****
rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext);
if( rc==SQLITE_DENY ){
! sqliteSetString(&pParse->zErrMsg, "not authorized", 0);
pParse->rc = SQLITE_AUTH;
pParse->nErr++;
--- 185,189 ----
rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext);
if( rc==SQLITE_...
[truncated message content] |
|
From: <co...@us...> - 2003-12-17 12:11:02
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv27541
Modified Files:
uobject.cpp
Log Message:
fixed red npc, wrong backpacks etc
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.119
retrieving revision 1.120
diff -C2 -d -r1.119 -r1.120
*** uobject.cpp 26 Nov 2003 03:53:53 -0000 1.119
--- uobject.cpp 17 Dec 2003 12:10:58 -0000 1.120
***************
*** 463,467 ****
{
cVariant variant( Value );
! //setProperty( TagName, variant );
}
}
--- 463,467 ----
{
cVariant variant( Value );
! setProperty( TagName, variant );
}
}
|
|
From: <thi...@us...> - 2003-12-16 14:33:52
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv5056
Modified Files:
customtags.cpp
Log Message:
doc improvement
Index: customtags.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** customtags.cpp 27 Nov 2003 15:17:18 -0000 1.35
--- customtags.cpp 16 Dec 2003 14:33:48 -0000 1.36
***************
*** 43,116 ****
/*!
! Constructs an invalid variant.
! */
! cVariant::cVariant()
! {
! typ = cVariant::Invalid;
! }
!
! /*!
! Destroys the cVariant and the contained object.
!
! Note that subclasses that reimplement clear() should reimplement
! the destructor to call clear(). This destructor calls clear(), but
! because it is the destructor, cVariant::clear() is called rather than
! a subclass's clear().
! */
! cVariant::~cVariant()
! {
! clear();
! }
! cVariant& cVariant::operator= ( const cVariant &v )
! {
! typ = v.typ;
! // For non pointer types we can simply use the union
! switch( typ )
! {
! case cVariant::String:
! value.ptr = new QString( v.toString() );
! break;
! case cVariant::Coord:
! value.ptr = new Coord_cl( v.toCoord() );
! break;
! default:
! memcpy( &value, &v.value, sizeof( value ) );
! break;
! }
! return *this;
! }
! bool cVariant::operator==( const cVariant &v ) const
! {
! if( typ == v.typ )
! {
! switch( typ )
! {
! case cVariant::String:
! return *(QString*)value.ptr == *(QString*)v.value.ptr;
!
! case cVariant::Coord:
! return *(Coord_cl*)value.ptr == *(Coord_cl*)v.value.ptr;
! case Int:
! return value.i == v.value.i;
! case Double:
! return value.d == v.value.d;
! default:
! return true;
! }
! }
- return false;
- }
! bool cVariant::operator!=( const cVariant &v ) const
{
! return !operator==( v );
}
--- 43,97 ----
/*!
! \class cVariant customtags.h
! \brief The cVariant class acts like a union for the most common Wolfpack data types.
! \ingroup objectmodel
! \ingroup misc
! \mainclass
! Because C++ forbids unions from including types that have
! non-default constructors or destructors, most interesting Wolfpack
! classes cannot be used in unions. Without cVariant, this would be
! a problem for Python properties, Custom tags, etc.
! The methods named toT() (for any supported T, see the \c Type
! documentation for a list) are const. If you ask for the stored
! type, they return a copy of the stored object. If you ask for a
! type that can be generated from the stored type, toT() copies and
! converts and leaves the object itself unchanged. If you ask for a
! type that cannot be generated from the stored type, the result
! depends on the type (see the function documentation for details).
! The asT() functions are not const. They do conversion like the
! toT() methods, set the variant to hold the converted value, and
! return a reference to the new contents of the variant.
! Here is some example code to demonstrate the use of cVariant:
! \code
! cVariant val;
! if( PyString_Check( value ) )
! val = cVariant( PyString_AsString( value ) );
! else if( PyInt_Check( value ) )
! val = cVariant( PyInt_AsLong( value ) );
! else if( checkWpItem( value ) )
! val = cVariant( getWpItem( value ) );
! else if( checkWpChar( value ) )
! val = cVariant( getWpChar( value ) );
! else if( checkWpCoord( value ) )
! val = cVariant( getWpCoord( value ) );
! else if( PyFloat_Check( value ) )
! val = cVariant( PyFloat_AsDouble( value ) );
! \endcode
! */
! /*!
! Constructs an invalid variant.
! */
! cVariant::cVariant()
{
! typ = cVariant::Invalid;
}
***************
*** 181,184 ****
--- 162,243 ----
/*!
+ Destroys the cVariant and the contained object.
+
+ Note that subclasses that reimplement clear() should reimplement
+ the destructor to call clear(). This destructor calls clear(), but
+ because it is the destructor, cVariant::clear() is called rather than
+ a subclass's clear().
+ */
+ cVariant::~cVariant()
+ {
+ cVariant::clear();
+ }
+
+ /*!
+ Assigns the value of the variant \a variant to this variant.
+
+ This is a deep copy of the variant.
+ */
+ cVariant& cVariant::operator= ( const cVariant &v )
+ {
+ typ = v.typ;
+
+ // For non pointer types we can simply use the union
+ switch( typ )
+ {
+ case cVariant::String:
+ value.ptr = new QString( v.toString() );
+ break;
+ case cVariant::Coord:
+ value.ptr = new Coord_cl( v.toCoord() );
+ break;
+ default:
+ memcpy( &value, &v.value, sizeof( value ) );
+ break;
+ }
+
+ return *this;
+ }
+
+ /*!
+ Compares this QVariant with \a v and returns TRUE if they are
+ equal; otherwise returns FALSE.
+ */
+ bool cVariant::operator==( const cVariant &v ) const
+ {
+ if( typ == v.typ )
+ {
+ switch( typ )
+ {
+ case cVariant::String:
+ return *(QString*)value.ptr == *(QString*)v.value.ptr;
+
+ case cVariant::Coord:
+ return *(Coord_cl*)value.ptr == *(Coord_cl*)v.value.ptr;
+
+ case Int:
+ return value.i == v.value.i;
+
+ case Double:
+ return value.d == v.value.d;
+
+ default:
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /*!
+ Compares this QVariant with \a v and returns TRUE if they are not
+ equal; otherwise returns FALSE.
+ */
+ bool cVariant::operator!=( const cVariant &v ) const
+ {
+ return !operator==( v );
+ }
+
+ /*!
Returns the name of the type stored in the variant.
The returned strings describe the C++ datatype used to store the
***************
*** 461,469 ****
}
- #define Q_VARIANT_AS( f ) Q##f& cVariant::as##f() { \
- if ( typ != f ) *this = cVariant( to##f() ); return *((Q##f*)value.ptr);}
-
- Q_VARIANT_AS(String)
-
/*! \fn QString& cVariant::asString()
--- 520,523 ----
***************
*** 475,478 ****
--- 529,538 ----
\sa toString()
*/
+ QString& cVariant::asString()
+ {
+ if ( typ != String )
+ *this = cVariant( toString() );
+ return *((QString*)value.ptr);
+ }
/*!
***************
*** 569,573 ****
--- 629,638 ----
cCustomTags member functions
*****************************************************************************/
+ const cVariant cVariant::null;
+ /*!
+ Copy constructor, accepts \a d cCustomTags and
+ creates a copy of it.
+ */
cCustomTags::cCustomTags( const cCustomTags& d )
{
***************
*** 580,588 ****
}
! cCustomTags& cCustomTags::operator=( const cCustomTags& tags )
{
changed = true;
! if( tags.tags_ )
! tags_ = new QMap< QString, cVariant >( *tags.tags_ );
else
tags_ = 0;
--- 645,665 ----
}
! /*!
! Destructor, free the memory resources allocated by the custom tag
! */
! cCustomTags::~cCustomTags()
! {
! if( tags_ )
! delete tags_;
! }
!
! /*!
! Provides assign semantics for custom tags.
! */
! cCustomTags& cCustomTags::operator=( const cCustomTags& d )
{
changed = true;
! if( d.tags_ )
! tags_ = new QMap< QString, cVariant >( *d.tags_ );
else
tags_ = 0;
***************
*** 591,594 ****
--- 668,675 ----
}
+ /*!
+ Removes the tags from the given serial \a key object from
+ the persistent storage
+ */
void cCustomTags::del( SERIAL key )
{
***************
*** 596,599 ****
--- 677,684 ----
}
+ /*!
+ Saves the custom tags into the persistent storage, under
+ the object identified by the \a key serial.
+ */
void cCustomTags::save( SERIAL key )
{
***************
*** 630,633 ****
--- 715,721 ----
}
+ /*!
+ Loads Custom tags under the \a key serial from the persistent storage
+ */
void cCustomTags::load( SERIAL key )
{
***************
*** 659,662 ****
--- 747,753 ----
}
+ /*!
+ Tests if the \a key tag exists
+ */
bool cCustomTags::has( const QString &key ) const
{
***************
*** 670,673 ****
--- 761,768 ----
}
+ /*!
+ Retrieves the value of the given \a key tag
+ \sa cVariant
+ */
const cVariant &cCustomTags::get( const QString& key ) const
{
***************
*** 682,685 ****
--- 777,781 ----
}
+
void cCustomTags::set( const QString& key, const cVariant& value )
{
***************
*** 749,757 ****
}
- cCustomTags::~cCustomTags()
- {
- if( tags_ )
- delete tags_;
- }
-
- const cVariant cVariant::null;
--- 845,846 ----
|
Update of /cvsroot/wpdev/wolfpack/doc In directory sc8-pr-cvs1:/tmp/cvs-serv11294 Modified Files: doxygen.cfg indices.doc misc.doc modules.doc uorxpackets.doc Added Files: contribute.doc footer.html header.html trademarks.doc Log Message: Updated doxygen doc --- NEW FILE: contribute.doc --- //================================================================================== // // Wolfpack Emu (WP) // UO Server Emulation Program // // Copyright 1997, 98 by Marcus Rating (Cironian) // Copyright 2001 by holders identified in authors.txt // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // * In addition to that license, if you are running this program or modified // * versions of it on a public system you HAVE TO make the complete source of // * the version used by you available or provide people with a location to // * download it. // // // // Wolfpack Homepage: http://wpdev.sf.net/ //======================================================================================== /*! \page contribute.html How to contribute There is a multitude of things you can do depending on your skills: \li answering other people's posts. Every post we don't have to answer ourselves adds to the time we can spend on coding. \li create documentation. If you think it was hard to figure out how something works but now you know, write down your knowledge. \li scripting. Many of the settings in the scripts are not there because the scripters want them to be that way, but because nobody found the time to change them. \li use InsideUO. Looking up the hex-code for a missing sound, animation, item you request is easy but rather time-consuming. \li report bugs. If you experience something that you feel is a bug, take the time to report it, even if you found another solution. \li systematic testing. As opposed to reporting just the bugs you encounter while playing, testing means trying to get bugs. If you have at least a basic knowledge of C/C++ you can also \li make bugs reproducable \li use the debugger to find bugs \li provide bugfixes \li code small features \li do some revamping \li code big features \li help to redesign kernel subsystems \li do profiling and tuning (order of appearance marks difficulty in my humble opinion) Be careful to choose the task that is appropriate to your skill ! Example: If a newbie coder implements a feature in 5 days and an experienced dev spends a total of 5 hours to help him, the newbie will learn a lot and the dev will have fun helping him. But if the dev would have implemented the same feature himself, it might have taken only 2 hours. So this can not be considered a true contribution to Wolfpack. Rule of thumb: If you can do one of these tasks without any help from another dev, the next task in the list will probably be appropriate (needing just a few hints). */ --- NEW FILE: footer.html --- <p><address><hr><div align=center> <table width=100% cellspacing=0 border=0><tr> <td>Copyright © 2003 <a href="wolf.html">Wolfpack</a><td align=center><a href="trademarks.html">Trademarks</a> <td align=right><div align=right>Wolfpack 12.9.x</div> <tr> <td> <!-- Sourceforge Logo --> <a href="http://sourceforge.net/"><img src="http://sourceforge.net/sflogo.php?group_id=38114&type=2" border="0" alt="SourceForge Logo"></a> </td> </tr> </table></div></address></body> </html> --- NEW FILE: header.html --- --- NEW FILE: trademarks.doc --- /*! \page trademarks.html Trademarks Linux® is a trademark of Linus Torvalds. All other products named in the documentation are trademarks of their respective owners. */ Index: doxygen.cfg =================================================================== RCS file: /cvsroot/wpdev/wolfpack/doc/doxygen.cfg,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** doxygen.cfg 26 Sep 2002 01:47:20 -0000 1.2 --- doxygen.cfg 7 Dec 2003 17:35:38 -0000 1.3 *************** *** 1,45 **** ! # Doxyfile 1.2.13-20020210 #--------------------------------------------------------------------------- ! # General configuration options #--------------------------------------------------------------------------- ! PROJECT_NAME = Wolfpack PROJECT_NUMBER = 12.9.0 OUTPUT_DIRECTORY = C:/wolfpack/wolfpack/doc/ OUTPUT_LANGUAGE = English ! EXTRACT_ALL = NO ! EXTRACT_PRIVATE = NO ! EXTRACT_STATIC = NO ! EXTRACT_LOCAL_CLASSES = YES ! HIDE_UNDOC_MEMBERS = NO ! HIDE_UNDOC_CLASSES = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO STRIP_FROM_PATH = - INTERNAL_DOCS = YES - STRIP_CODE_COMMENTS = YES - CASE_SENSE_NAMES = YES SHORT_NAMES = NO - HIDE_SCOPE_NAMES = NO - VERBATIM_HEADERS = YES - SHOW_INCLUDE_FILES = YES JAVADOC_AUTOBRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES - INLINE_INFO = YES - SORT_MEMBER_DOCS = YES DISTRIBUTE_GROUP_DOC = YES TAB_SIZE = 8 GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES ! ALIASES = ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 - OPTIMIZE_OUTPUT_FOR_C = NO - OPTIMIZE_OUTPUT_JAVA = NO SHOW_USED_FILES = YES #--------------------------------------------------------------------------- --- 1,53 ---- ! # Doxyfile 1.3.5 #--------------------------------------------------------------------------- ! # Project related configuration options #--------------------------------------------------------------------------- ! PROJECT_NAME = "Wolfpack Ultima Online Server Software" PROJECT_NUMBER = 12.9.0 OUTPUT_DIRECTORY = C:/wolfpack/wolfpack/doc/ OUTPUT_LANGUAGE = English ! USE_WINDOWS_ENCODING = YES BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES + ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO STRIP_FROM_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO + MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES DISTRIBUTE_GROUP_DOC = YES TAB_SIZE = 8 + ALIASES = + OPTIMIZE_OUTPUT_FOR_C = NO + OPTIMIZE_OUTPUT_JAVA = NO + SUBGROUPING = YES + #--------------------------------------------------------------------------- + # Build related configuration options + #--------------------------------------------------------------------------- + EXTRACT_ALL = NO + EXTRACT_PRIVATE = NO + EXTRACT_STATIC = NO + EXTRACT_LOCAL_CLASSES = YES + HIDE_UNDOC_MEMBERS = NO + HIDE_UNDOC_CLASSES = NO + HIDE_FRIEND_COMPOUNDS = NO + HIDE_IN_BODY_DOCS = NO + INTERNAL_DOCS = YES + CASE_SENSE_NAMES = YES + HIDE_SCOPE_NAMES = NO + SHOW_INCLUDE_FILES = YES + INLINE_INFO = YES + SORT_MEMBER_DOCS = YES GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES ! GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES #--------------------------------------------------------------------------- *************** *** 49,52 **** --- 57,61 ---- WARNINGS = YES WARN_IF_UNDOCUMENTED = NO + WARN_IF_DOC_ERROR = YES WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = *************** *** 75,80 **** --- 84,91 ---- SOURCE_BROWSER = YES INLINE_SOURCES = YES + STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES + VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index *************** *** 94,97 **** --- 105,110 ---- HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO + CHM_FILE = + HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO *************** *** 115,118 **** --- 128,132 ---- USE_PDFLATEX = NO LATEX_BATCHMODE = NO + LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output *************** *** 135,138 **** --- 149,156 ---- #--------------------------------------------------------------------------- GENERATE_XML = NO + XML_OUTPUT = xml + XML_SCHEMA = + XML_DTD = + XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output *************** *** 140,143 **** --- 158,168 ---- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- + # configuration options related to the Perl module output + #--------------------------------------------------------------------------- + GENERATE_PERLMOD = NO + PERLMOD_LATEX = NO + PERLMOD_PRETTY = YES + PERLMOD_MAKEVAR_PREFIX = + #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- *************** *** 167,173 **** --- 192,200 ---- CLASS_GRAPH = YES COLLABORATION_GRAPH = YES + UML_LOOK = YES TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES + CALL_GRAPH = YES GRAPHICAL_HIERARCHY = YES DOT_IMAGE_FORMAT = png *************** *** 176,179 **** --- 203,207 ---- MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 + MAX_DOT_GRAPH_DEPTH = 0 GENERATE_LEGEND = YES DOT_CLEANUP = YES *************** *** 182,189 **** #--------------------------------------------------------------------------- SEARCHENGINE = NO - CGI_NAME = search.cgi - CGI_URL = - DOC_URL = - DOC_ABSPATH = - BIN_ABSPATH = /usr/local/bin/ - EXT_DOC_PATHS = --- 210,211 ---- Index: indices.doc =================================================================== RCS file: /cvsroot/wpdev/wolfpack/doc/indices.doc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** indices.doc 17 Jun 2002 00:25:37 -0000 1.1 --- indices.doc 7 Dec 2003 17:35:38 -0000 1.2 *************** *** 31,43 **** /*! ! \page index.html Wolfpack Reference Documentation - \section general General - \li \link wolfpack.html About Wolfpack\endlink - \li \link bugreport.html How to report a bug\endlink - \section license License - \li \link gpl.html GNU General Public License\endlink */ --- 31,119 ---- /*! + \page index.html Wolfpack Source Reference Documentation ! <table cellpadding=2 cellspacing=1 border=0 width=100% bgcolor=#e5e5e5> ! <tr bgcolor=white> ! <td colspan=3 align=center> ! <b>Notice</b>: This document is intended for <b>developers</b> only</td></tr> ! <tr> ! <th bgcolor=#dae9a1 width=33%> ! Wolfpack Community ! </th> ! <th bgcolor=#dae9a1 width=33%> ! Getting Started ! </th> ! <th bgcolor=#dae9a1 width=33%> ! General ! </th> ! </tr> ! <tr> ! <td valign=top> ! \li \htmlonly <a class="el" href="http://sourceforge.net/mail/?group_id=38114">Mailing lists</a>\endhtmlonly ! \li \htmlonly <a class="el" href="http://wpdev.sourceforge.net/modules.php?op=modload&name=phpBB2&file=index">Forums</a>\endhtmlonly ! \li \link irc.html IRC Channel\endlink ! \li \link bugreport.html How to report a bug\endlink ! </td> ! <td valign=top> ! \li \link compile.html How to compile\endlink ! \li \link contribute.html How to contribute\endlink ! \li \link usingcvs.html Using CVS\endlink ! </td> ! <td valign=top> ! \li \link aboutwp.html About Wolfpack\endlink ! \li \link wolf.html About Developers\endlink ! \li \htmlonly <a class="el" href="http://sourceforge.net/cvs/?group_id=38114">Browse CVS</a>\endhtmlonly ! </td> ! </tr> ! <tr> ! <th bgcolor=#dae9a1> ! API Reference ! </th> ! <th bgcolor=#dae9a1> ! Modules ! <th bgcolor=#dae9a1> ! Overviews ! </tr> ! <tr> ! <td valign=top> ! \li \htmlonly <a class="el" href="classes.html">All Classes</a>\endhtmlonly ! \li \htmlonly <a class="el" href="annotated.html">Annotated Classes</a>\endhtmlonly ! \li \htmlonly <a class="el" href="hierarchy.html">Inheritance Hierarchy</a></li>\endhtmlonly ! \li \htmlonly <a class="el" href="functions.html"> All Functions (long)</a></li>\endhtmlonly ! \li \htmlonly <a class="el" href="files.html"> Source File Index</a></li>\endhtmlonly ! \li \link faq.html FAQs\endlink ! \li \htmlonly <a class="el" href="http://sourceforge.net/mailarchive/forum.php?forum_id=34457">Change History</a>\endhtmlonly ! </td> ! <td valign=top> ! \li \htmlonly <a class="el" href="modules.html">All Modules</a>\endhtmlonly ! \li \htmlonly <a class="el" href="group__network.html">Network Module</a>\endhtmlonly ! </td> ! <td valign=top> ! </tr> ! <tr> ! <th bgcolor=#dae9a1> ! Porting & Platforms ! </th> ! <th bgcolor=#dae9a1> ! Tools ! </th> ! <th bgcolor=#dae9a1> ! Licenses & Credits ! </th> ! </tr> ! <tr> ! <td valign=top> ! \li \link winsystem.html Windows specific notes\endlink ! </td> ! <td valign=top> ! </td> ! <td valign=top> ! \li \link gpl.html GNU General Public License\endlink ! \li \link credits.html Credits\endlink ! </td> ! </tr> ! </table> */ Index: misc.doc =================================================================== RCS file: /cvsroot/wpdev/wolfpack/doc/misc.doc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** misc.doc 17 Jun 2002 00:25:37 -0000 1.1 --- misc.doc 7 Dec 2003 17:35:38 -0000 1.2 *************** *** 33,37 **** If you think you have found a bug in Wolfpack, we would like to hear about it so we can fix it. ! Before reporting a bug, please check the FAQs and Forums on our \link http://www.wpdev.org/ web site\endlink to see if the issue is already known. Always include the following information in your bug report: --- 33,37 ---- If you think you have found a bug in Wolfpack, we would like to hear about it so we can fix it. ! Before reporting a bug, please check the FAQs and Forums on our <a href="http://www.wpdev.org/">web site</a> to see if the issue is already known. Always include the following information in your bug report: *************** *** 43,54 **** ! Please send the bug report to BugTrack system at \link http://www.wpdev.org Wolfpack website\endlink. */ /*! \page gpl.html GNU General Public License ! The Wolfpack is Copyright (C) 1998-2002 Wolfpack Development Team. --- 43,58 ---- ! Please send the bug report to BugTrack system at \link http://www.wpdev.org/ Wolfpack website\endlink. */ + /*! \page irc.html IRC Channel + + Wolfpack users and developers can be found online on the #wolfpack channel at irc.stratics.com + */ /*! \page gpl.html GNU General Public License ! The Wolfpack is Copyright (C) 1998-2004 Wolfpack Development Team. Index: modules.doc =================================================================== RCS file: /cvsroot/wpdev/wolfpack/doc/modules.doc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** modules.doc 30 Jun 2002 03:51:31 -0000 1.1 --- modules.doc 7 Dec 2003 17:35:38 -0000 1.2 *************** *** 1,4 **** /*! - \defgroup network Network Module --- 1,3 ---- *************** *** 9,13 **** /*! ! \defgroup mainclass This group contains the most important classes found in Wolfpack. --- 8,12 ---- /*! ! \defgroup mainclass Main Classes This group contains the most important classes found in Wolfpack. Index: uorxpackets.doc =================================================================== RCS file: /cvsroot/wpdev/wolfpack/doc/uorxpackets.doc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** uorxpackets.doc 3 Jul 2002 03:34:16 -0000 1.3 --- uorxpackets.doc 7 Dec 2003 17:35:38 -0000 1.4 *************** *** 459,462 **** }; - #endif - --- 459,460 ---- |
|
From: <thi...@us...> - 2003-11-30 18:16:03
|
Update of /cvsroot/wpdev/xmlscripts/web In directory sc8-pr-cvs1:/tmp/cvs-serv30965/web Modified Files: login.py Log Message: Fix the POST bug with IE Index: login.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/web/login.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** login.py 5 Jan 2003 18:57:41 -0000 1.1 --- login.py 30 Nov 2003 18:16:00 -0000 1.2 *************** *** 41,45 **** content += """<!-- Login --> ! <form action="login.py" method="GET"> Username:<br /> <input type="text" name="username" /><br /><br /> --- 41,45 ---- content += """<!-- Login --> ! <form action="login.py" method="POST"> Username:<br /> <input type="text" name="username" /><br /><br /> |
|
From: <thi...@us...> - 2003-11-30 18:16:03
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv30965/scripts Modified Files: webadmin.py Log Message: Fix the POST bug with IE Index: webadmin.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/webadmin.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** webadmin.py 8 Oct 2003 01:47:41 -0000 1.12 --- webadmin.py 30 Nov 2003 18:16:00 -0000 1.13 *************** *** 195,198 **** --- 195,205 ---- try: try: + try: + nbytes = int(length) + except (TypeError, ValueError): + nbytes = 0 + # throw away additional data [see bug #427345] + if self.command.lower() == "post" and nbytes > 0: + self.rfile._rbufsize = nbytes + 2 os.environ.update(env) sys.argv = [scriptfile] |
|
From: <dr...@us...> - 2003-11-28 11:53:07
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands
In directory sc8-pr-cvs1:/tmp/cvs-serv25211
Modified Files:
info.py
Log Message:
Now it works again...
Index: info.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/info.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** info.py 28 Nov 2003 08:57:50 -0000 1.12
--- info.py 28 Nov 2003 11:53:04 -0000 1.13
***************
*** 16,25 ****
def info( socket, command, argstring ):
! args = argstring.split(" ")
! if len(argstring) > 0:
# TODO: implement spawnregion info gump and more here
! return 1
! socket.attachtarget( "wolfpack.commands.info.infotargetresponse", args )
return 1
--- 16,25 ----
def info( socket, command, argstring ):
! #args = argstring.split(" ")
! #if len(argstring) > 0:
# TODO: implement spawnregion info gump and more here
! #return 1
! socket.attachtarget( "wolfpack.commands.info.infotargetresponse", argstring )
return 1
***************
*** 144,148 ****
gump.addButton( 120, 340, 0xF9, 0xF8, -1 )
# Cancel button
! gump.addButton( 190, 340, 0xF3, 0xF1, 0 )
page_ = page_ + 1
--- 144,148 ----
gump.addButton( 120, 340, 0xF9, 0xF8, -1 )
# Cancel button
! gump.addButton( 190, 340, 0xF3, 0xF1, 0 )
page_ = page_ + 1
***************
*** 304,312 ****
elif char.gender == 1:
gender = "female"
! else
gender = "male"
! elif not char.gender:
gender = "male"
!
gump.addText( 50, 280, "Gender:", 0x834 )
gump.addInputField( 200, 280, 220, 16, 0x834, 39, gender )
--- 304,312 ----
elif char.gender == 1:
gender = "female"
! else:
gender = "male"
! else:
gender = "male"
!
gump.addText( 50, 280, "Gender:", 0x834 )
gump.addInputField( 200, 280, 220, 16, 0x834, 39, gender )
***************
*** 355,359 ****
gump.addPageButton( 270, 340, 0x0FC, 0x0FC, page_-1 )
! else:
gump.addResizeGump( 195, 120, 0xBB8, 215, 20 )
gump.addResizeGump( 195, 140, 0xBB8, 215, 20 )
--- 355,359 ----
gump.addPageButton( 270, 340, 0x0FC, 0x0FC, page_-1 )
! else:
gump.addResizeGump( 195, 120, 0xBB8, 215, 20 )
gump.addResizeGump( 195, 140, 0xBB8, 215, 20 )
***************
*** 390,397 ****
if choice.button == 0 or not char or not socket:
return 1
!
textentries = choice.text
keys = textentries.keys()
!
for key in keys:
if key == 1:
--- 390,397 ----
if choice.button == 0 or not char or not socket:
return 1
!
textentries = choice.text
keys = textentries.keys()
!
for key in keys:
if key == 1:
|
|
From: <dr...@us...> - 2003-11-28 08:57:53
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands In directory sc8-pr-cvs1:/tmp/cvs-serv27841 Modified Files: info.py Log Message: Syntax fix, oops (Turkey attacking me...) Index: info.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/info.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** info.py 28 Nov 2003 08:52:44 -0000 1.11 --- info.py 28 Nov 2003 08:57:50 -0000 1.12 *************** *** 306,310 **** else gender = "male" ! else gender = "male" --- 306,310 ---- else gender = "male" ! elif not char.gender: gender = "male" |
|
From: <dr...@us...> - 2003-11-28 08:52:47
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands In directory sc8-pr-cvs1:/tmp/cvs-serv27174 Modified Files: info.py Log Message: Gender fixing, removed poison since it's not an item value anymore it seems... Index: info.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/info.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** info.py 23 Sep 2003 12:17:39 -0000 1.10 --- info.py 28 Nov 2003 08:52:44 -0000 1.11 *************** *** 77,81 **** if tile['flag2']&0x04: flags = flags + "stairs, " ! flags = flags[0:len(flags)-2] # cut the last ", " gump.addText( 50, 195, "Properties: "+flags, 0x834 ) --- 77,81 ---- if tile['flag2']&0x04: flags = flags + "stairs, " ! flags = flags[0:len(flags)-2] # cut the last ", " gump.addText( 50, 195, "Properties: "+flags, 0x834 ) *************** *** 299,304 **** gump.addText( 50, 260, "Emote color:", 0x834 ) gump.addInputField( 200, 260, 200, 16, 0x834, 38, hex( char.emotecolor ) ) ! gender = "female" ! if not char.gender: gender = "male" --- 299,310 ---- gump.addText( 50, 260, "Emote color:", 0x834 ) gump.addInputField( 200, 260, 200, 16, 0x834, 38, hex( char.emotecolor ) ) ! if char.gender: ! if char.gender == 0: ! gender = "male" ! elif char.gender == 1: ! gender = "female" ! else ! gender = "male" ! else gender = "male" *************** *** 475,481 **** char.gender = int( hex2dec( textentries[ key ] ) ) elif textentries[key] == "female": - char.gender = 0 - elif textentries[key] == "male": char.gender = 1 if char.npc: --- 481,487 ---- char.gender = int( hex2dec( textentries[ key ] ) ) elif textentries[key] == "female": char.gender = 1 + elif textentries[key] == "male": + char.gender = 0 if char.npc: *************** *** 637,642 **** gump.addText( 50, 260, "Restock:", 0x834 ) gump.addInputField( 200, 260, 200, 16, 0x834, 28, str( item.restock ) ) - gump.addText( 50, 280, "Poisoned:", 0x834 ) - gump.addInputField( 200, 280, 200, 16, 0x834, 29, str( item.poisoned ) ) gump.addText( 310, 340, "Page "+str( page_ )+" of "+str( pages ), 0x834 ) --- 643,646 ---- *************** *** 739,744 **** elif key == 28: item.restock = int( hex2dec( textentries[ key ] ) ) - elif key == 29: - item.poisoned = int( hex2dec( textentries[ key ] ) ) elif key == 30: item.spawnregion = textentries[key] --- 743,746 ---- *************** *** 754,756 **** ! \ No newline at end of file --- 756,758 ---- ! |
|
From: <dr...@us...> - 2003-11-28 08:23:40
|
Update of /cvsroot/wpdev/xmlscripts In directory sc8-pr-cvs1:/tmp/cvs-serv21401 Modified Files: wolfpack.sql Log Message: OK, alphabetized fields = broken database... Let's keep the order working properly :) Index: wolfpack.sql =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/wolfpack.sql,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** wolfpack.sql 23 Nov 2003 22:08:30 -0000 1.31 --- wolfpack.sql 28 Nov 2003 08:23:32 -0000 1.32 *************** *** 1,259 **** CREATE TABLE `boats` ( ! `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', ! `serial` int(11) NOT NULL default '0', ! PRIMARY KEY (`serial`) ); CREATE TABLE `boats_itemids` ( ! `a` tinyint(1) NOT NULL default '0', ! `b` tinyint(1) NOT NULL default '0', ! `id` smallint(6) default '0', ! `serial` int(11) NOT NULL default '0', ! PRIMARY KEY (`serial`) ); CREATE TABLE `boats_itemoffsets` ( ! `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', ! `serial` int(11) NOT NULL default '0', ! PRIMARY KEY (`serial`) ); CREATE TABLE `bookpages` ( ! `page` tinyint(3) NOT NULL default '0', ! `serial` int(11) NOT NULL default '0', ! `text` varchar(255) NOT NULL default '', ! PRIMARY KEY (`serial`,`page`) ); CREATE TABLE `books` ( ! `author` varchar(255) NOT NULL default '', ! `pages` smallint(5) NOT NULL default '0', ! `predefined` tinyint(1) NOT NULL default '0', ! `readonly` tinyint(1) NOT NULL default '0', ! `section` varchar(255) NOT NULL default '', ! `serial` int(11) NOT NULL default '0', ! `title` varchar(255) NOT NULL default '', ! PRIMARY KEY (`serial`) ); CREATE TABLE `characters` ( ! `attacker` int(11) NOT NULL default '-1', ! `body` smallint(5) NOT NULL default '0', ! `combattarget` int(11) NOT NULL default '-1', ! `creationdate` varchar(255) default NULL, ! `criminaltime` int(11) NOT NULL default '0', ! `deaths` int(10) NOT NULL default '0', ! `def` int(10) NOT NULL default '0', ! `dexteritymod` smallint(6) NOT NULL default '0', ! `dexterity` smallint(6) NOT NULL default '0', ! `emotecolor` smallint(5) NOT NULL default '0', ! `fame` int(11) NOT NULL default '0', ! `gender` tinyint(1) NOT NULL default '0', ! `guarding` int(11) NOT NULL default '-1', ! `hitpoints` smallint(6) NOT NULL default '0', ! `hunger` int(11) NOT NULL default '0', ! `intelligencemod` smallint(6) NOT NULL default '0', ! `intelligence` smallint(6) NOT NULL default '0', ! `karma` int(11) NOT NULL default '0', ! `kills` int(10) NOT NULL default '0', ! `mana` smallint(6) default NULL, ! `maxhitpoints` smallint(6) NOT NULL default '0', ! `maxmana` smallint(6) default NULL, ! `maxstamina` smallint(6) NOT NULL default '0', ! `murderertime` int(11) NOT NULL default '0', ! `murderer` int(11) NOT NULL default '-1', ! `name` varchar(255) default NULL, ! `nutriment` int(10) NOT NULL default '0', ! `orgbody` smallint(5) NOT NULL default '0', ! `orgskin` smallint(5) NOT NULL default '0', ! `poisoned` int(10) NOT NULL default '0', ! `poison` int(11) NOT NULL default '0', ! `propertyflags` int(11) NOT NULL default '0', ! `saycolor` smallint(5) NOT NULL default '0', ! `serial` int(11) NOT NULL default '0', ! `skin` smallint(5) NOT NULL default '0', ! `stamina` smallint(6) NOT NULL default '0', ! `strengthmod` smallint(6) NOT NULL default '0', ! `strength` smallint(6) NOT NULL default '0', ! `title` varchar(255) default NULL, ! PRIMARY KEY (`serial`) ); CREATE TABLE `corpses` ( ! `beardcolor` smallint(6) NOT NULL default '0', ! `beardstyle` smallint(6) NOT NULL default '0', ! `bodyid` smallint(6) NOT NULL default '0', ! `haircolor` smallint(6) NOT NULL default '0', ! `hairstyle` smallint(6) NOT NULL default '0', ! `serial` int(11) NOT NULL default '0', ! PRIMARY KEY (`serial`) ); CREATE TABLE `corpses_equipment` ( ! `item` int(11) NOT NULL default '-1', ! `layer` tinyint(3) NOT NULL default '0', ! `serial` int(11) NOT NULL default '0', ! PRIMARY KEY (`serial`,`layer`) ); CREATE TABLE `houses` ( ! `charpos_x` smallint(6) NOT NULL default '0', ! `charpos_y` smallint(6) NOT NULL default '0', ! `charpos_z` smallint(6) NOT NULL default '0', ! `nokey` tinyint(1) NOT NULL default '0', ! `serial` int(11) NOT NULL default '0', ! PRIMARY KEY (`serial`) ); CREATE TABLE `items` ( ! `amount` smallint(5) NOT NULL default '0', ! `baseid` varchar(32) NOT NULL default '', ! `buyprice` int(11) NOT NULL default '0', ! `color` smallint(5) NOT NULL default '0', ! `cont` int(11) NOT NULL default '-1', ! `decaytime` int(10) NOT NULL default '0', ! `def` int(10) NOT NULL default '0', ! `hidamage` smallint(6) NOT NULL default '0', ! `hp` smallint(6) NOT NULL default '0', ! `id` smallint(5) NOT NULL default '0', ! `layer` tinyint(3) NOT NULL default '0', ! `lodamage` smallint(6) NOT NULL default '0', ! `magic` tinyint(3) NOT NULL default '0', ! `maxhp` smallint(6) NOT NULL default '0', ! `owner` int(11) NOT NULL default '-1', ! `poisoned` int(10) NOT NULL default '0', ! `priv` tinyint(3) NOT NULL default '0', ! `restock` smallint(5) NOT NULL default '0', ! `sellprice` int(11) NOT NULL default '0', ! `serial` int(11) NOT NULL default '0', ! `spawnregion` varchar(255) default NULL, ! `speed` int(11) NOT NULL default '0', ! `type2` smallint(5) NOT NULL default '0', ! `type` smallint(5) NOT NULL default '0', ! `visible` tinyint(3) NOT NULL default '0', ! `weight` int(11) NOT NULL default '0', ! PRIMARY KEY (`serial`) ); CREATE TABLE `multis` ( ! `coowner` int(11) NOT NULL default '-1', ! `deedsection` varchar(255) NOT NULL default '', ! `serial` int(11) NOT NULL default '0', ! PRIMARY KEY (`serial`) ); CREATE TABLE `multis_bans` ( ! `ban` int(11) NOT NULL default '-1', ! `serial` int(11) NOT NULL default '0', ! PRIMARY KEY (`serial`,`ban`) ); CREATE TABLE `multis_friends` ( ! `friend` int(11) NOT NULL default '-1', ! `serial` int(11) NOT NULL default '0', ! PRIMARY KEY (`serial`,`friend`) ); CREATE TABLE `npcs` ( ! `additionalflags` int(11) NOT NULL default '0', ! `ai` varchar(255) default NULL, ! `carve` varchar(255) default NULL, ! `fleeat` smallint(3) NOT NULL default '10', ! `lootlist` varchar(255) default NULL, ! `maxdamage` smallint(6) NOT NULL default '0', ! `mindamage` smallint(6) NOT NULL default '0', ! `owner` int(11) NOT NULL default '-1', ! `serial` int(11) NOT NULL default '0', ! `spawnregion` varchar(255) default NULL, ! `spellshigh` int(11) NOT NULL default '0', ! `spellslow` int(11) NOT NULL default '0', ! `stablemaster` int(11) NOT NULL default '-1', ! `summontime` int(11) NOT NULL default '0', ! `tamingminskill` smallint(6) NOT NULL default '0', ! `wanderradius` smallint(6) NOT NULL default '0', ! `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', ! PRIMARY KEY (`serial`) ); CREATE TABLE `players` ( ! `account` varchar(255) default NULL, ! `additionalflags` int(10) NOT NULL default '0', ! `fixedlight` tinyint(3) NOT NULL default '0', ! `profile` longtext, ! `serial` int(11) NOT NULL default '0', ! `visualrange` tinyint(3) NOT NULL default '0', ! PRIMARY KEY (`serial`) ); CREATE TABLE `skills` ( ! `cap` smallint(6) default '0', ! `locktype` tinyint(4) default '0', ! `serial` int(11) NOT NULL default '0', ! `skill` tinyint(3) NOT NULL default '0', ! `value` smallint(6) NOT NULL default '0', ! PRIMARY KEY (`serial`,`skill`) ); CREATE TABLE `tags` ( ! `name` varchar(64) NOT NULL default '', ! `serial` int(11) NOT NULL default '0', ! `type` varchar(6) NOT NULL default '', ! `value` longtext NOT NULL, ! PRIMARY KEY (`serial`,`name`) ); CREATE TABLE `uobject` ( ! `bindmenu` varchar(255) default NULL, ! `direction` char(1) NOT NULL default '0', ! `events` varchar(255) default NULL, ! `havetags` tinyint(1) NOT NULL default '0', ! `multis` int(11) NOT NULL default '-1', ! `name` varchar(255) default NULL, ! `pos_map` tinyint(4) 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', ! `serial` int(11) NOT NULL default '0', ! PRIMARY KEY (`serial`) ); CREATE TABLE `uobjectmap` ( ! `serial` int(11) NOT NULL default '0', ! `type` varchar(80) NOT NULL default '', ! PRIMARY KEY (`serial`) ); CREATE TABLE `effects` ( ! `destination` int(11) NOT NULL default '-1', ! `dispellable` tinyint(4) NOT NULL default '0', ! `expiretime` int(11) NOT NULL default '0', ! `id` int(11) NOT NULL default '0', ! `objectid` varchar(64) NOT NULL default '', ! `source` int(11) NOT NULL default '-1', ! PRIMARY KEY (`id`) ); CREATE TABLE `effects_properties` ( ! `id` int(11) NOT NULL default '0', ! `keyname` varchar(64) NOT NULL default '', ! `type` varchar(64) NOT NULL default '', ! `value` text NOT NULL, ! PRIMARY KEY (`id`,`keyname`) ); --- 1,258 ---- 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`) ); 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`) ); 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`) ); CREATE TABLE `bookpages` ( ! `serial` int(11) NOT NULL default '0', ! `page` tinyint(3) NOT NULL default '0', ! `text` varchar(255) NOT NULL default '', ! PRIMARY KEY (`serial`,`page`) ); CREATE TABLE `books` ( ! `serial` int(11) NOT NULL default '0', ! `title` varchar(255) NOT NULL default '', ! `author` varchar(255) NOT NULL default '', ! `readonly` tinyint(1) NOT NULL default '0', ! `predefined` tinyint(1) NOT NULL default '0', ! `section` varchar(255) NOT NULL default '', ! `pages` smallint(5) NOT NULL default '0', ! PRIMARY KEY (`serial`) ); 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`) ); 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`) ); 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`) ); 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`) ); 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', ! `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', ! `magic` tinyint(3) NOT NULL default '0', ! `owner` int(11) NOT NULL default '-1', ! `visible` tinyint(3) NOT NULL default '0', ! `spawnregion` varchar(255) default NULL, ! `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', ! `baseid` varchar(32) NOT NULL default '', ! PRIMARY KEY (`serial`) ); 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`) ); CREATE TABLE `multis_bans` ( ! `serial` int(11) NOT NULL default '0', ! `ban` int(11) NOT NULL default '-1', ! PRIMARY KEY (`serial`,`ban`) ); CREATE TABLE `multis_friends` ( ! `serial` int(11) NOT NULL default '0', ! `friend` int(11) NOT NULL default '-1', ! PRIMARY KEY (`serial`,`friend`) ); 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`) ); 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`) ); 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`) ); 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`) ); 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`) ); CREATE TABLE `uobjectmap` ( ! `serial` int(11) NOT NULL default '0', ! `type` varchar(80) NOT NULL default '', ! PRIMARY KEY (`serial`) ); 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', ! `keyname` varchar(64) NOT NULL default '', ! `type` varchar(64) NOT NULL default '', ! `value` text NOT NULL, ! PRIMARY KEY (`id`,`keyname`) ); |
|
From: <dr...@us...> - 2003-11-28 05:54:23
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv452
Modified Files:
socket.cpp
Log Message:
Compile Fixes.
Index: socket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/socket.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** socket.cpp 19 Nov 2003 08:47:28 -0000 1.45
--- socket.cpp 28 Nov 2003 05:54:20 -0000 1.46
***************
*** 56,61 ****
sizeof(wpSocketType),
0,
! wpDealloc,
! 0,
(getattrfunc)wpSocket_getAttr,
(setattrfunc)wpSocket_setAttr,
--- 56,61 ----
sizeof(wpSocketType),
0,
! wpDealloc,
! 0,
(getattrfunc)wpSocket_getAttr,
(setattrfunc)wpSocket_setAttr,
***************
*** 112,116 ****
else if( checkArgUnicode( 0 ) )
{
! message.setUnicodeCodes( PyUnicode_AsUnicode(param), PyUnicode_GetSize( param ) ) ;
}
else
--- 112,116 ----
else if( checkArgUnicode( 0 ) )
{
! message.setUnicodeCodes( (unsigned short*)( PyUnicode_AsUnicode( param ) ), PyUnicode_GetSize( param ) ) ;
}
else
|
|
From: <dr...@us...> - 2003-11-28 05:31:21
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv30280 Modified Files: basechar.cpp Log Message: Compile Fixes. Index: basechar.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** basechar.cpp 24 Nov 2003 03:14:51 -0000 1.49 --- basechar.cpp 28 Nov 2003 05:31:18 -0000 1.50 *************** *** 1956,1960 **** if( PyUnicode_Check( result ) ) ! name = QString::fromUcs2( PyUnicode_AS_UNICODE( result ) ); } --- 1956,1960 ---- if( PyUnicode_Check( result ) ) ! name = QString::fromUcs2( (unsigned short*)( PyUnicode_AS_UNICODE( result ) ) ); } |
|
From: <thi...@us...> - 2003-11-27 15:17:21
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv17523 Modified Files: customtags.cpp wolf.dsp Log Message: Just removed unnecessary build rules and includes Index: customtags.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/customtags.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** customtags.cpp 26 Nov 2003 03:53:52 -0000 1.34 --- customtags.cpp 27 Nov 2003 15:17:18 -0000 1.35 *************** *** 41,45 **** #include <math.h> #include <qstring.h> - #include <qshared.h> /*! --- 41,44 ---- Index: wolf.dsp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v retrieving revision 1.242 retrieving revision 1.243 diff -C2 -d -r1.242 -r1.243 *** wolf.dsp 8 Oct 2003 01:37:59 -0000 1.242 --- wolf.dsp 27 Nov 2003 15:17:18 -0000 1.243 *************** *** 1,23 **** # Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 ! # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=wolf - Win32 Debug ! !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE ! !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "wolf.mak". !MESSAGE ! !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben ! !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug" !MESSAGE ! !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE ! !MESSAGE "wolf - Win32 Release" (basierend auf "Win32 (x86) Console Application") ! !MESSAGE "wolf - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE --- 1,23 ---- # Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 ! # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=wolf - Win32 Debug ! !MESSAGE This is not a valid makefile. To build this project using NMAKE, ! !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "wolf.mak". !MESSAGE ! !MESSAGE You can specify a configuration when running NMAKE ! !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug" !MESSAGE ! !MESSAGE Possible choices for configuration are: !MESSAGE ! !MESSAGE "wolf - Win32 Release" (based on "Win32 (x86) Console Application") ! !MESSAGE "wolf - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE *************** *** 69,73 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c ! # ADD CPP /nologo /MD /Gm /GR /GX /Zi /Od /I "sqlite" /I "lib\bugreport" /I "$(QTDIR)\include" /D "_CONSOLE" /D "_MBCS" /D "_DEBUG" /D "WIN32" /D "QT_DLL" /D "QT_NO_STL" /D "QT_THREAD_SUPPORT" /D "MYSQL_DRIVER" /Fr /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" --- 69,73 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c ! # ADD CPP /nologo /MD /Gm /GR /GX /Zi /Od /I "sqlite" /I "lib\bugreport" /I "$(QTDIR)\include" /D "_CONSOLE" /D "_MBCS" /D "_DEBUG" /D "WIN32" /D "QT_DLL" /D "QT_NO_STL" /D "QT_THREAD_SUPPORT" /Fr /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" *************** *** 77,81 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 kernel32.lib user32.lib gdi32.lib ole32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib shell32.lib /nologo /version:12.9 /subsystem:windows /incremental:no /map /debug /machine:I386 /out:"..\wolfpack.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none --- 77,81 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 kernel32.lib user32.lib gdi32.lib ole32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt321.lib shell32.lib /nologo /version:12.9 /subsystem:windows /incremental:no /map /debug /machine:I386 /out:"..\wolfpack.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none *************** *** 459,515 **** SOURCE=.\gumps.h - - !IF "$(CFG)" == "wolf - Win32 Release" - - # PROP Ignore_Default_Tool 1 - # Begin Custom Build - MOCing gumps.h... - InputDir=. - InputPath=.\gumps.h - InputName=gumps - - "$(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 gumps.h... - InputDir=. - InputPath=.\gumps.h - InputName=gumps - - "$(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=.\house.h - - !IF "$(CFG)" == "wolf - Win32 Release" - # PROP Ignore_Default_Tool 1 - # Begin Custom Build - MOCing house.h... - InputDir=. - InputPath=.\house.h - InputName=house - - "$(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 - - !ENDIF - # End Source File # Begin Source File --- 459,468 ---- *************** *** 533,565 **** SOURCE=.\makemenus.h - - !IF "$(CFG)" == "wolf - Win32 Release" - - # PROP Ignore_Default_Tool 1 - # Begin Custom Build - MOCing makemenus.h... - InputDir=. - InputPath=.\makemenus.h - InputName=makemenus - - "$(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 makemenus.h... - InputDir=. - InputPath=.\makemenus.h - InputName=makemenus - - "$(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 --- 486,490 ---- *************** *** 574,606 **** SOURCE=.\multis.h - - !IF "$(CFG)" == "wolf - Win32 Release" - # PROP Ignore_Default_Tool 1 - # Begin Custom Build - MOCing multis.h... - InputDir=. - InputPath=.\multis.h - InputName=multis - - "$(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 multis.h... - InputDir=. - InputPath=.\multis.h - InputName=multis - - "$(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 --- 499,503 ---- *************** *** 628,651 **** SOURCE=.\persistentbroker.h - - !IF "$(CFG)" == "wolf - Win32 Release" - # PROP Ignore_Default_Tool 1 - # Begin Custom Build - MOCing persistentbroker.h... - InputDir=. - InputPath=.\persistentbroker.h - InputName=persistentbroker - - "$(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 - - !ENDIF - # End Source File # Begin Source File --- 525,529 ---- *************** *** 674,706 **** SOURCE=.\resources.h - - !IF "$(CFG)" == "wolf - Win32 Release" - - # PROP Ignore_Default_Tool 1 - # Begin Custom Build - MOCing resources.h... - InputDir=. - InputPath=.\resources.h - InputName=resources - - "$(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 resources.h... - InputDir=. - InputPath=.\resources.h - InputName=resources - - "$(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 --- 552,556 ---- *************** *** 755,820 **** SOURCE=.\targetrequests.h - - !IF "$(CFG)" == "wolf - Win32 Release" - # PROP Ignore_Default_Tool 1 - # Begin Custom Build - MOCing targetrequests.h... - InputDir=. - InputPath=.\targetrequests.h - InputName=targetrequests - - "$(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 targetrequests.h... - InputDir=. - InputPath=.\targetrequests.h - InputName=targetrequests - - "$(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=.\territories.h - - !IF "$(CFG)" == "wolf - Win32 Release" - - # PROP Ignore_Default_Tool 1 - # Begin Custom Build - MOCing territories.h... - InputDir=. - InputPath=.\territories.h - InputName=territories - - "$(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 territories.h... - InputDir=. - InputPath=.\territories.h - InputName=territories - - "$(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 --- 605,614 ---- *************** *** 833,865 **** SOURCE=.\TmpEff.h - - !IF "$(CFG)" == "wolf - Win32 Release" - - # PROP Ignore_Default_Tool 1 - # Begin Custom Build - MOCing TmpEff.h... - InputDir=. - InputPath=.\TmpEff.h - InputName=TmpEff - - "$(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 TmpEff.h... - InputDir=. - InputPath=.\TmpEff.h - InputName=TmpEff - - "$(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 --- 627,631 ---- *************** *** 907,939 **** SOURCE=.\wptargetrequests.h - - !IF "$(CFG)" == "wolf - Win32 Release" - # PROP Ignore_Default_Tool 1 - # Begin Custom Build - MOCing wptargetrequests.h... - InputDir=. - InputPath=.\wptargetrequests.h - InputName=wptargetrequests - - "$(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 wptargetrequests.h... - InputDir=. - InputPath=.\wptargetrequests.h - InputName=wptargetrequests - - "$(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 # End Group --- 673,677 ---- *************** *** 1013,1025 **** # PROP Ignore_Default_Tool 1 - # Begin Custom Build - MOCing uosocket.h... - InputDir=.\network - InputPath=.\network\uosocket.h - InputName=uosocket - - "$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - - # End Custom Build !ENDIF --- 751,754 ---- *************** *** 1130,1169 **** # PROP Default_Filter "" - # Begin Source File - - SOURCE=.\moc_gumps.cpp - # End Source File - # Begin Source File - - SOURCE=.\moc_makemenus.cpp - # End Source File - # Begin Source File - - SOURCE=.\moc_multis.cpp - # End Source File - # Begin Source File - - SOURCE=.\moc_resources.cpp - # End Source File - # Begin Source File - - SOURCE=.\moc_targetrequests.cpp - # End Source File - # Begin Source File - - SOURCE=.\moc_territories.cpp - # End Source File - # Begin Source File - - SOURCE=.\moc_TmpEff.cpp - # End Source File - # Begin Source File - - SOURCE=.\network\moc_uosocket.cpp - # End Source File - # Begin Source File - - SOURCE=.\moc_wptargetrequests.cpp - # End Source File # End Group # Begin Group "SQLite" --- 859,862 ---- |
|
From: <co...@us...> - 2003-11-26 23:06:04
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/monsters In directory sc8-pr-cvs1:/tmp/cvs-serv23089/monsters Modified Files: magicals_summoned.xml Log Message: Fixed invalid id's. Thanks to Riekr Index: magicals_summoned.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/monsters/magicals_summoned.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** magicals_summoned.xml 9 Apr 2003 06:00:49 -0000 1.6 --- magicals_summoned.xml 26 Nov 2003 23:06:01 -0000 1.7 *************** *** 633,637 **** <npc id="elemental_water_weak"> <name>a elemental (water)</name> ! <id>0x00g</id> <category>Monsters\magicals_summoned\elemental water weak</category> <inherit id="monster_base"/> --- 633,637 ---- <npc id="elemental_water_weak"> <name>a elemental (water)</name> ! <id>0x010</id> <category>Monsters\magicals_summoned\elemental water weak</category> <inherit id="monster_base"/> *************** *** 687,691 **** <npc id="elemental_water_medium"> <name>a elemental (water)</name> ! <id>0x00g</id> <category>Monsters\magicals_summoned\elemental water medium</category> <inherit id="monster_base"/> --- 687,691 ---- <npc id="elemental_water_medium"> <name>a elemental (water)</name> ! <id>0x010</id> <category>Monsters\magicals_summoned\elemental water medium</category> <inherit id="monster_base"/> *************** *** 741,745 **** <npc id="elemental_water_hard"> <name>a elemental (water)</name> ! <id>0x00g</id> <category>Monsters\magicals_summoned\elemental water hard</category> <inherit id="monster_base"/> --- 741,745 ---- <npc id="elemental_water_hard"> <name>a elemental (water)</name> ! <id>0x010</id> <category>Monsters\magicals_summoned\elemental water hard</category> <inherit id="monster_base"/> |
|
From: <dar...@us...> - 2003-11-26 03:59:42
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv7784
Modified Files:
wolfpack.cpp
Log Message:
Fixed an annoying cVariant memory leak.
We should consider switching to PyObject soon.
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.476
retrieving revision 1.477
diff -C2 -d -r1.476 -r1.477
*** wolfpack.cpp 26 Nov 2003 03:53:53 -0000 1.476
--- wolfpack.cpp 26 Nov 2003 03:59:39 -0000 1.477
***************
*** 352,375 ****
Console::instance()->send( "\n" );
! Console::instance()->send( "SIZEOF(cItem):" + QString::number( sizeof( cItem ) ) );
!
! int x;
!
! QString id = "e75";
! for( x = 0; x < 100000; ++x )
{
! //cItem *it = new cItem();
! //it->Init( true );
! //cItem *it = cItem::createFromScript( "e75" );
! P_ITEM nItem = new cItem;
! nItem->Init( true );
! /*nItem->base =*/ ItemBases::instance()->getItemBase( id );
! const cElement* section = DefManager->getDefinition( WPDT_ITEM, id );
! nItem->applyDefinition( section );
! nItem->onCreate( id );
}
! return 1;
// Scriptmanager can't be in the try{} block because it sometimes throws firstchance exceptions
--- 352,365 ----
Console::instance()->send( "\n" );
! /* Console::instance()->send( "SIZEOF(cItem):" + QString::number( sizeof( cItem ) ) );
!
! Sleep( 5000 );
! for( int x = 0; x < 400000; ++x )
{
! cItem *it = cItem::createFromScript( "e75" );
}
! return 1;*/
// Scriptmanager can't be in the try{} block because it sometimes throws firstchance exceptions
|
|
From: <dar...@us...> - 2003-11-26 03:53:58
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv7086
Modified Files:
combat.cpp customtags.cpp customtags.h dbl_single_click.cpp
dragdrop.cpp items.cpp items.h player.cpp uobject.cpp
wolfpack.cpp wolfpack.vcproj world.cpp wpdefmanager.cpp
wpdefmanager.h
Log Message:
Fixed an annoying cVariant memory leak.
We should consider switching to PyObject soon.
Index: combat.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/combat.cpp,v
retrieving revision 1.156
retrieving revision 1.157
diff -C2 -d -r1.156 -r1.157
*** combat.cpp 23 Sep 2003 11:53:31 -0000 1.156
--- combat.cpp 26 Nov 2003 03:53:52 -0000 1.157
***************
*** 467,470 ****
--- 467,472 ----
// If we used a poisoned Weapon to deal
// damage, apply the poison here
+ /*
+ We currently do not support poisoned weapons
if( pWeapon && ( pWeapon->poisoned() > 0 ) )
{
***************
*** 474,478 ****
pDefender->setPoisonTime( uiCurrentTime + ( MY_CLOCKS_PER_SEC * ( 40 / pDefender->poisoned() ) ) );
pDefender->setPoisonWearOffTime( pDefender->poisonTime() + ( MY_CLOCKS_PER_SEC * SrvParams->poisonTimer() ) );
! }
// If we item we used was enchantet using
--- 476,480 ----
pDefender->setPoisonTime( uiCurrentTime + ( MY_CLOCKS_PER_SEC * ( 40 / pDefender->poisoned() ) ) );
pDefender->setPoisonWearOffTime( pDefender->poisonTime() + ( MY_CLOCKS_PER_SEC * SrvParams->poisonTimer() ) );
! }*/
// If we item we used was enchantet using
Index: customtags.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** customtags.cpp 23 Sep 2003 23:55:19 -0000 1.33
--- customtags.cpp 26 Nov 2003 03:53:52 -0000 1.34
***************
*** 43,137 ****
#include <qshared.h>
! cVariant::Private::Private()
{
! typ = cVariant::Invalid;
}
! cVariant::Private::Private( Private* d )
! {
!
! switch( d->typ )
! {
! case cVariant::Invalid:
! break;
! case cVariant::String:
! value.ptr = new QString( *((QString*)d->value.ptr) );
! break;
! case cVariant::Int:
! value.i = d->value.i;
! break;
! case cVariant::Double:
! value.d = d->value.d;
! break;
! case cVariant::BaseChar:
! value.ptr = d->value.ptr;
! case cVariant::Item:
! value.ptr = d->value.ptr;
! case cVariant::Coord:
! value.ptr = d->value.ptr;
! default:
! Q_ASSERT( 0 );
! }
!
! typ = d->typ;
! }
! cVariant::Private::~Private()
{
! clear();
}
! void cVariant::Private::clear()
{
switch( typ )
{
case cVariant::String:
! delete (QString*)value.ptr;
break;
- case cVariant::Invalid:
- case cVariant::Int:
- case cVariant::Double:
- case cVariant::BaseChar:
- case cVariant::Item:
- break;
case cVariant::Coord:
! delete (Coord_cl*)value.ptr;
break;
}
! typ = cVariant::Invalid;
}
! /*!
! Constructs an invalid variant.
! */
! cVariant::cVariant()
{
! d = new Private;
! }
! /*!
! Destroys the cVariant and the contained object.
! Note that subclasses that reimplement clear() should reimplement
! the destructor to call clear(). This destructor calls clear(), but
! because it is the destructor, cVariant::clear() is called rather than
! a subclass's clear().
! */
! cVariant::~cVariant()
{
! if ( d->deref() )
! delete d;
}
! /*!
! Constructs a copy of the variant, \a p, passed as the argument to this
! constructor. Usually this is a deep copy, but a shallow copy is made
! if the stored data type is explicitly shared, as e.g. QImage is.
! */
! cVariant::cVariant( const cVariant& p )
{
! d = new Private;
! *this = p;
}
--- 43,122 ----
#include <qshared.h>
! /*!
! Constructs an invalid variant.
! */
! cVariant::cVariant()
{
! typ = cVariant::Invalid;
}
! /*!
! Destroys the cVariant and the contained object.
! Note that subclasses that reimplement clear() should reimplement
! the destructor to call clear(). This destructor calls clear(), but
! because it is the destructor, cVariant::clear() is called rather than
! a subclass's clear().
! */
! cVariant::~cVariant()
{
! clear();
}
! cVariant& cVariant::operator= ( const cVariant &v )
{
+ typ = v.typ;
+
+ // For non pointer types we can simply use the union
switch( typ )
{
case cVariant::String:
! value.ptr = new QString( v.toString() );
break;
case cVariant::Coord:
! value.ptr = new Coord_cl( v.toCoord() );
break;
+ default:
+ memcpy( &value, &v.value, sizeof( value ) );
+ break;
}
! return *this;
}
! bool cVariant::operator==( const cVariant &v ) const
{
! if( typ == v.typ )
! {
! switch( typ )
! {
! case cVariant::String:
! return *(QString*)value.ptr == *(QString*)v.value.ptr;
!
! case cVariant::Coord:
! return *(Coord_cl*)value.ptr == *(Coord_cl*)v.value.ptr;
! case Int:
! return value.i == v.value.i;
! case Double:
! return value.d == v.value.d;
!
! default:
! return true;
! }
! }
!
! return false;
! }
!
! bool cVariant::operator!=( const cVariant &v ) const
{
! return !operator==( v );
}
! cVariant::cVariant( const cVariant &v )
{
! *this = v;
}
***************
*** 141,147 ****
cVariant::cVariant( const QString& val )
{
! d = new Private;
! d->typ = String;
! d->value.ptr = new QString( val );
}
--- 126,131 ----
cVariant::cVariant( const QString& val )
{
! typ = String;
! value.ptr = new QString( val );
}
***************
*** 151,157 ****
cVariant::cVariant( int val )
{
! d = new Private;
! d->typ = Int;
! d->value.i = val;
}
--- 135,140 ----
cVariant::cVariant( int val )
{
! typ = Int;
! value.i = val;
}
***************
*** 161,174 ****
cVariant::cVariant( double val )
{
! d = new Private;
! d->typ = Double;
! d->value.d = val;
}
cVariant::cVariant( long int val )
{
! d = new Private;
! d->typ = Long;
! d->value.d = val;
}
--- 144,155 ----
cVariant::cVariant( double val )
{
! typ = Double;
! value.d = val;
}
cVariant::cVariant( long int val )
{
! typ = Long;
! value.d = val;
}
***************
*** 178,184 ****
cVariant::cVariant( cBaseChar *val )
{
! d = new Private;
! d->typ = BaseChar;
! d->value.ptr = val;
}
--- 159,164 ----
cVariant::cVariant( cBaseChar *val )
{
! typ = BaseChar;
! value.ptr = val;
}
***************
*** 188,194 ****
cVariant::cVariant( cItem *val )
{
! d = new Private;
! d->typ = Item;
! d->value.ptr = val;
}
--- 168,173 ----
cVariant::cVariant( cItem *val )
{
! typ = Item;
! value.ptr = val;
}
***************
*** 198,236 ****
cVariant::cVariant( Coord_cl val )
{
! d = new Private;
! d->typ = Coord;
! d->value.ptr = new Coord_cl( val );
! }
!
! /*!
! Assigns the value of the variant \a variant to this variant.
!
! This is a deep copy of the variant, but note that if the variant
! holds an explicitly shared type such as QImage, a shallow copy
! is performed.
! */
! cVariant& cVariant::operator= ( const cVariant& variant )
! {
! cVariant& other = (cVariant&)variant;
!
! other.d->ref();
! if ( d->deref() )
! delete d;
!
! d = other.d;
!
! return *this;
! }
!
! /*!
! \internal
! */
! void cVariant::detach()
! {
! if ( d->count == 1 )
! return;
!
! d->deref();
! d = new Private( d );
}
--- 177,182 ----
cVariant::cVariant( Coord_cl val )
{
! typ = Coord;
! value.ptr = new Coord_cl( val );
}
***************
*** 243,247 ****
const char* cVariant::typeName() const
{
! return typeToName( d->typ );
}
--- 189,193 ----
const char* cVariant::typeName() const
{
! return typeToName( typ );
}
***************
*** 251,262 ****
void cVariant::clear()
{
! if ( d->count > 1 )
! {
! d->deref();
! d = new Private;
! return;
! }
! d->clear();
}
--- 197,211 ----
void cVariant::clear()
{
! switch( typ )
! {
! case cVariant::String:
! delete (QString*)value.ptr;
! break;
! case cVariant::Coord:
! delete (Coord_cl*)value.ptr;
! break;
! }
! typ = cVariant::Invalid;
}
***************
*** 323,338 ****
const QString cVariant::toString() const
{
! if ( d->typ == Int )
! return QString::number( d->value.i );
! if ( d->typ == Long )
! return QString::number( d->value.d );
! if ( d->typ == Double )
return QString::number( toDouble() );
! if ( d->typ == BaseChar )
{
! P_CHAR pChar = static_cast< P_CHAR >( d->value.ptr );
if( pChar )
return "0x" + QString::number( (unsigned int)pChar->serial(), 16 );
--- 272,287 ----
const QString cVariant::toString() const
{
! if ( typ == Int )
! return QString::number( value.i );
! if ( typ == Long )
! return QString::number( value.d );
! if ( typ == Double )
return QString::number( toDouble() );
! if ( typ == BaseChar )
{
! P_CHAR pChar = static_cast< P_CHAR >( value.ptr );
if( pChar )
return "0x" + QString::number( (unsigned int)pChar->serial(), 16 );
***************
*** 341,347 ****
}
! if ( d->typ == Item )
{
! P_ITEM pItem = static_cast< P_ITEM >( d->value.ptr );
if( pItem )
return "0x" + QString::number( (unsigned int)pItem->serial(), 16 );
--- 290,296 ----
}
! if ( typ == Item )
{
! P_ITEM pItem = static_cast< P_ITEM >( value.ptr );
if( pItem )
return "0x" + QString::number( (unsigned int)pItem->serial(), 16 );
***************
*** 350,362 ****
}
! if ( d->typ == Coord )
{
! Coord_cl *pos = static_cast< Coord_cl* >( d->value.ptr );
return QString( "%1,%2,%3,%4" ).arg( pos->x ).arg( pos->y ).arg( pos->z ).arg( pos->map );
}
! if ( d->typ != String )
return QString::null;
! return *((QString*)d->value.ptr);
}
--- 299,311 ----
}
! if ( typ == Coord )
{
! Coord_cl *pos = static_cast< Coord_cl* >( value.ptr );
return QString( "%1,%2,%3,%4" ).arg( pos->x ).arg( pos->y ).arg( pos->z ).arg( pos->map );
}
! if ( typ != String )
return QString::null;
! return *((QString*)value.ptr);
}
***************
*** 372,399 ****
int cVariant::toInt( bool * ok ) const
{
! if( d->typ == String )
! return hex2dec( *( (QString*)d->value.ptr ) ).toInt( ok );
if ( ok )
*ok = canCast( Int );
! if( d->typ == Int )
! return d->value.i;
! if( d->typ == Long )
! return d->value.d;
! if ( d->typ == Double )
! return (int)d->value.d;
! if ( d->typ == BaseChar )
{
! P_CHAR pChar = static_cast< P_CHAR >( d->value.ptr );
return pChar ? pChar->serial() : INVALID_SERIAL;
}
! if ( d->typ == Item )
{
! P_ITEM pItem = static_cast< P_ITEM >( d->value.ptr );
return pItem ? pItem->serial() : INVALID_SERIAL;
}
--- 321,348 ----
int cVariant::toInt( bool * ok ) const
{
! if( typ == String )
! return hex2dec( *( (QString*)value.ptr ) ).toInt( ok );
if ( ok )
*ok = canCast( Int );
! if( typ == Int )
! return value.i;
! if( typ == Long )
! return value.d;
! if ( typ == Double )
! return (int)value.d;
! if ( typ == BaseChar )
{
! P_CHAR pChar = static_cast< P_CHAR >( value.ptr );
return pChar ? pChar->serial() : INVALID_SERIAL;
}
! if ( typ == Item )
{
! P_ITEM pItem = static_cast< P_ITEM >( value.ptr );
return pItem ? pItem->serial() : INVALID_SERIAL;
}
***************
*** 413,440 ****
double cVariant::toDouble( bool * ok ) const
{
! if( d->typ == String )
! return ((QString*)d->value.ptr)->toDouble( ok );
if ( ok )
*ok = canCast( Double );
! if ( d->typ == Double )
! return d->value.d;
! if ( d->typ == Int )
! return (double)d->value.i;
! if ( d->typ == Long )
! return (double)d->value.d;
! if ( d->typ == BaseChar )
{
! P_CHAR pChar = static_cast< P_CHAR >( d->value.ptr );
return pChar ? (double)pChar->serial() : (double)INVALID_SERIAL;
}
! if ( d->typ == Item )
{
! P_ITEM pItem = static_cast< P_ITEM >( d->value.ptr );
return pItem ? (double)pItem->serial() : (double)INVALID_SERIAL;
}
--- 362,389 ----
double cVariant::toDouble( bool * ok ) const
{
! if( typ == String )
! return ((QString*)value.ptr)->toDouble( ok );
if ( ok )
*ok = canCast( Double );
! if ( typ == Double )
! return value.d;
! if ( typ == Int )
! return (double)value.i;
! if ( typ == Long )
! return (double)value.d;
! if ( typ == BaseChar )
{
! P_CHAR pChar = static_cast< P_CHAR >( value.ptr );
return pChar ? (double)pChar->serial() : (double)INVALID_SERIAL;
}
! if ( typ == Item )
{
! P_ITEM pItem = static_cast< P_ITEM >( value.ptr );
return pItem ? (double)pItem->serial() : (double)INVALID_SERIAL;
}
***************
*** 451,468 ****
cBaseChar *cVariant::toChar() const
{
! if( d->typ == BaseChar )
! return (P_CHAR)d->value.ptr;
! if( d->typ == String )
! return FindCharBySerial( hex2dec( *( (QString*)d->value.ptr ) ).toUInt() );
! if( d->typ == Int )
! return FindCharBySerial( d->value.i );
! if( d->typ == Long )
! return FindCharBySerial( d->value.d );
! if( d->typ == Double )
! return FindCharBySerial( floor( d->value.d ) );
return 0;
--- 400,417 ----
cBaseChar *cVariant::toChar() const
{
! if( typ == BaseChar )
! return (P_CHAR)value.ptr;
! if( typ == String )
! return FindCharBySerial( hex2dec( *( (QString*)value.ptr ) ).toUInt() );
! if( typ == Int )
! return FindCharBySerial( value.i );
! if( typ == Long )
! return FindCharBySerial( value.d );
! if( typ == Double )
! return FindCharBySerial( floor( value.d ) );
return 0;
***************
*** 475,492 ****
cItem *cVariant::toItem() const
{
! if( d->typ == Item )
! return (P_ITEM)d->value.ptr;
! if( d->typ == String )
! return FindItemBySerial( hex2dec( *( (QString*)d->value.ptr ) ).toUInt() );
! if( d->typ == Int )
! return FindItemBySerial( d->value.i );
! if( d->typ == Long )
! return FindItemBySerial( d->value.d );
! if( d->typ == Double )
! return FindItemBySerial( floor( d->value.d ) );
return 0;
--- 424,441 ----
cItem *cVariant::toItem() const
{
! if( typ == Item )
! return (P_ITEM)value.ptr;
! if( typ == String )
! return FindItemBySerial( hex2dec( *( (QString*)value.ptr ) ).toUInt() );
! if( typ == Int )
! return FindItemBySerial( value.i );
! if( typ == Long )
! return FindItemBySerial( value.d );
! if( typ == Double )
! return FindItemBySerial( floor( value.d ) );
return 0;
***************
*** 499,510 ****
Coord_cl cVariant::toCoord() const
{
! if( d->typ == Coord )
! return *( (Coord_cl*)d->value.ptr );
// Parse Coord
! if( d->typ == String )
{
Coord_cl pos;
! if( parseCoordinates( *( (QString*)d->value.ptr ), pos ) )
return pos;
}
--- 448,459 ----
Coord_cl cVariant::toCoord() const
{
! if( typ == Coord )
! return *( (Coord_cl*)value.ptr );
// Parse Coord
! if( typ == String )
{
Coord_cl pos;
! if( parseCoordinates( *( (QString*)value.ptr ), pos ) )
return pos;
}
***************
*** 514,518 ****
#define Q_VARIANT_AS( f ) Q##f& cVariant::as##f() { \
! if ( d->typ != f ) *this = cVariant( to##f() ); else detach(); return *((Q##f*)d->value.ptr);}
Q_VARIANT_AS(String)
--- 463,467 ----
#define Q_VARIANT_AS( f ) Q##f& cVariant::as##f() { \
! if ( typ != f ) *this = cVariant( to##f() ); return *((Q##f*)value.ptr);}
Q_VARIANT_AS(String)
***************
*** 533,544 ****
int& cVariant::asInt()
{
! detach();
! if ( d->typ != Int ) {
int i = toInt();
! d->clear();
! d->value.i = i;
! d->typ = Int;
}
! return d->value.i;
}
--- 482,492 ----
int& cVariant::asInt()
{
! if ( typ != Int ) {
int i = toInt();
! clear();
! value.i = i;
! typ = Int;
}
! return value.i;
}
***************
*** 548,558 ****
double& cVariant::asDouble()
{
! if ( d->typ != Double ) {
double dbl = toDouble();
! d->clear();
! d->value.d = dbl;
! d->typ = Double;
}
! return d->value.d;
}
--- 496,506 ----
double& cVariant::asDouble()
{
! if ( typ != Double ) {
double dbl = toDouble();
! clear();
! value.d = dbl;
! typ = Double;
}
! return value.d;
}
***************
*** 571,587 ****
bool cVariant::canCast( Type t ) const
{
! if ( d->typ == t )
return TRUE;
! if ( t == Int && ( d->typ == Int || d->typ == Long || d->typ == BaseChar || d->typ == Item || d->typ == String || d->typ == Double ) )
return TRUE;
! if ( t == Double && ( d->typ == BaseChar || d->typ == Item || d->typ == Long || d->typ == String || d->typ == Int ) )
return TRUE;
! if ( t == String && ( d->typ == BaseChar || d->typ == Item || d->typ == Long || d->typ == Int || d->typ == Double ) )
return TRUE;
! if ( t == BaseChar && ( d->typ == BaseChar || d->typ == Int || d->typ == Double || d->typ == String || d->typ == Long ) )
return TRUE;
! if ( t == Item && ( d->typ == Item || d->typ == Int || d->typ == Double || d->typ == String || d->typ == Long ) )
return TRUE;
! if ( t == Coord && ( d->typ == String || d->typ == Coord ) )
return TRUE;
--- 519,535 ----
bool cVariant::canCast( Type t ) const
{
! if ( typ == t )
return TRUE;
! if ( t == Int && ( typ == Int || typ == Long || typ == BaseChar || typ == Item || typ == String || typ == Double ) )
return TRUE;
! if ( t == Double && ( typ == BaseChar || typ == Item || typ == Long || typ == String || typ == Int ) )
return TRUE;
! if ( t == String && ( typ == BaseChar || typ == Item || typ == Long || typ == Int || typ == Double ) )
return TRUE;
! if ( t == BaseChar && ( typ == BaseChar || typ == Int || typ == Double || typ == String || typ == Long ) )
return TRUE;
! if ( t == Item && ( typ == Item || typ == Int || typ == Double || typ == String || typ == Long ) )
return TRUE;
! if ( t == Coord && ( typ == String || typ == Coord ) )
return TRUE;
***************
*** 619,654 ****
}
- /*! Compares this cVariant with \a v and returns TRUE if they are
- equal; otherwise returns FALSE.
- */
-
- bool cVariant::operator==( const cVariant &v ) const
- {
- if ( !v.canCast( type() ) )
- return FALSE;
- switch( d->typ ) {
- case String:
- return v.toString() == toString();
- case Int:
- return v.toInt() == toInt();
- case Double:
- return v.toDouble() == toDouble();
- case Invalid:
- break;
- }
- return FALSE;
- }
-
- /*! Compares this cVariant with \a v and returns TRUE if they are
- not equal; otherwise returns FALSE.
- */
-
- bool cVariant::operator!=( const cVariant &v ) const
- {
- return !( v == *this );
- }
-
-
-
/*****************************************************************************
cCustomTags member functions
--- 567,570 ----
***************
*** 781,785 ****
changed = true;
}
! else if( iter.data() != value )
{
iter.data() = value;
--- 697,701 ----
changed = true;
}
! else
{
iter.data() = value;
***************
*** 840,842 ****
}
! cVariant cVariant::null;
--- 756,758 ----
}
! const cVariant cVariant::null;
Index: customtags.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** customtags.h 23 Sep 2003 23:55:20 -0000 1.21
--- customtags.h 26 Nov 2003 03:53:52 -0000 1.22
***************
*** 53,57 ****
{
public:
! static cVariant null;
enum Type
--- 53,58 ----
{
public:
! // Static NULL instance
! static const cVariant null;
enum Type
***************
*** 70,74 ****
~cVariant();
! cVariant( const cVariant& p );
cVariant( const QString& );
cVariant( int );
--- 71,75 ----
~cVariant();
! cVariant( const cVariant &v );
cVariant( const QString& );
cVariant( int );
***************
*** 79,86 ****
cVariant( long int );
- cVariant& operator= ( const cVariant& );
- bool operator==( const cVariant& ) const;
- bool operator!=( const cVariant& ) const;
-
Type type() const;
const char* typeName() const;
--- 80,83 ----
***************
*** 100,103 ****
--- 97,104 ----
Coord_cl toCoord() const;
+ cVariant& operator= ( const cVariant& );
+ bool operator==( const cVariant& ) const;
+ bool operator!=( const cVariant& ) const;
+
QString& asString();
int& asInt();
***************
*** 109,133 ****
bool isString();
private:
! void detach();
!
! class Private : public QShared
! {
! public:
! Private();
! Private( Private* );
! ~Private();
!
! void clear();
!
! Type typ;
! union
! {
! int i;
! double d;
! void *ptr;
! } value;
! };
!
! Private* d;
};
--- 110,120 ----
bool isString();
private:
! Type typ;
!
! union {
! int i;
! double d;
! void *ptr;
! } value;
};
***************
*** 135,144 ****
inline cVariant::Type cVariant::type() const
{
! return d->typ;
}
inline bool cVariant::isValid() const
{
! return (d->typ != Invalid);
}
--- 122,131 ----
inline cVariant::Type cVariant::type() const
{
! return typ;
}
inline bool cVariant::isValid() const
{
! return (typ != Invalid);
}
Index: dbl_single_click.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbl_single_click.cpp,v
retrieving revision 1.226
retrieving revision 1.227
diff -C2 -d -r1.226 -r1.227
*** dbl_single_click.cpp 23 Sep 2003 23:55:20 -0000 1.226
--- dbl_single_click.cpp 26 Nov 2003 03:53:52 -0000 1.227
***************
*** 360,373 ****
}
- if ((pi->poisoned()) &&(pc_currchar->poisoned() < pi->poisoned()))
- {
- socket->sysMessage(tr("You have been poisoned!"));
- pc_currchar->soundEffect( 0x246 ); // poison sound
- pc_currchar->setPoisoned( pi->poisoned() );
- pc_currchar->setPoisonTime( uiCurrentTime +(MY_CLOCKS_PER_SEC*(40/pc_currchar->poisoned()))); // a lev.1 poison takes effect after 40 secs, a deadly pois.(lev.4) takes 40/4 secs - AntiChrist
- pc_currchar->setPoisonWearOffTime( pc_currchar->poisonTime() +(MY_CLOCKS_PER_SEC*SrvParams->poisonTimer()) ); // wear off starts after poison takes effect - AntiChrist
- pc_currchar->resend( false );
- }
-
pi->reduceAmount( 1 ); // Remove a food item
pc_currchar->setHunger( pc_currchar->hunger() + 1 );
--- 360,363 ----
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.207
retrieving revision 1.208
diff -C2 -d -r1.207 -r1.208
*** dragdrop.cpp 25 Nov 2003 19:41:30 -0000 1.207
--- dragdrop.cpp 26 Nov 2003 03:53:52 -0000 1.208
***************
*** 806,825 ****
pChar->soundEffect( 0x3A + RandomNum( 1, 3 ) );
- // If you want to poison a pet... Why not
- if( pItem->poisoned() && pChar->poisoned() < pItem->poisoned() )
- {
- pChar->soundEffect( 0x246 );
- pChar->setPoisoned( pItem->poisoned() );
-
- // a lev.1 poison takes effect after 40 secs, a deadly pois.(lev.4) takes 40/4 secs - AntiChrist
- pChar->setPoisonTime( uiCurrentTime + ( MY_CLOCKS_PER_SEC * ( 40 / pChar->poisoned() ) ) );
-
- //wear off starts after poison takes effect - AntiChrist
- pChar->setPoisonWearOffTime(pChar->poisonTime() + ( MY_CLOCKS_PER_SEC * SrvParams->poisonTimer() ) );
-
- // Refresh the health-bar of our target
- pChar->resend( false );
- }
-
// *You see Snowwhite eating some poisoned apples*
// Color: 0x0026
--- 806,809 ----
***************
*** 849,869 ****
pBeggar->talk( tr("*cough* Thank thee!") );
pBeggar->soundEffect( 0x3A + RandomNum( 1, 3 ) );
-
- // If you want to poison a pet... Why not
- if( pItem->poisoned() && pBeggar->poisoned() < pItem->poisoned() )
- {
- pBeggar->soundEffect( 0x246 );
- pBeggar->setPoisoned( pItem->poisoned() );
-
- // a lev.1 poison takes effect after 40 secs, a deadly pois.(lev.4) takes 40/4 secs - AntiChrist
- pBeggar->setPoisonTime( uiCurrentTime + ( MY_CLOCKS_PER_SEC * ( 40 / pBeggar->poisoned() ) ) );
-
- //wear off starts after poison takes effect - AntiChrist
- pBeggar->setPoisonWearOffTime( pBeggar->poisonTime() + ( MY_CLOCKS_PER_SEC * SrvParams->poisonTimer() ) );
-
- // Refresh the health-bar of our target
- pBeggar->resend( false );
- }
-
// *You see Snowwhite eating some poisoned apples*
--- 833,836 ----
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.360
retrieving revision 1.361
diff -C2 -d -r1.360 -r1.361
*** items.cpp 24 Nov 2003 03:14:52 -0000 1.360
--- items.cpp 26 Nov 2003 03:53:52 -0000 1.361
***************
*** 110,114 ****
// constructor
cItem::cItem(): container_(0), totalweight_(0), sellprice_( 0 ),
! buyprice_( 0 ), restock_( 1 ), antispamtimer_( 0 ), base( 0 )
{
spawnregion_ = QString::null;
--- 110,114 ----
// constructor
cItem::cItem(): container_(0), totalweight_(0), sellprice_( 0 ),
! buyprice_( 0 ), restock_( 1 ), base( 0 )
{
spawnregion_ = QString::null;
***************
*** 129,133 ****
//cItem properties setting
this->amount_ = src.amount_;
- this->antispamtimer_ = src.antispamtimer();
this->buyprice_ = src.buyprice_;
this->changed( TOOLTIP );
--- 129,132 ----
***************
*** 145,149 ****
this->magic_ = src.magic_;
this->maxhp_ = src.maxhp_;
- this->poisoned_ = src.poisoned_;
this->priv_=src.priv_;
this->restock_ = src.restock_;
--- 144,147 ----
***************
*** 471,475 ****
addField("maxhp", maxhp_ );
addField("speed", speed_ );
- addField("poisoned", poisoned_ );
addField("magic", magic_ );
addField("owner", ownserial_ );
--- 469,472 ----
***************
*** 579,583 ****
this->visible_=0; // 0=Normally Visible, 1=Owner & GM Visible, 2=GM Visible
this->priv_ = 0; // Bit 0, nodecay off/on. Bit 1, newbie item off/on. Bit 2 Dispellable
- this->poisoned_ = 0; //AntiChrist -- for poisoning skill
}
--- 576,579 ----
***************
*** 1182,1186 ****
this->setCorpse( false );
! // <id>12f9</id>
else if( TagName == "id" )
{
--- 1178,1182 ----
this->setCorpse( false );
! // <id>0x12f9</id>
else if( TagName == "id" )
{
***************
*** 1671,1682 ****
void cItem::talk( const QString &message, UI16 color, UINT8 type, bool autospam, cUOSocket* socket )
{
- if( autospam )
- {
- if( antispamtimer() < uiCurrentTime )
- setAntispamtimer( uiCurrentTime + MY_CLOCKS_PER_SEC*10 );
- else
- return;
- }
-
QString lang;
--- 1667,1670 ----
***************
*** 1856,1860 ****
maxhp_ = atoi( result[offset++] );
speed_ = atoi( result[offset++] );
- poisoned_ = atoi( result[offset++] );
magic_ = atoi( result[offset++] );
ownserial_ = atoi( result[offset++] );
--- 1844,1847 ----
***************
*** 1882,1886 ****
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.color,items.cont,items.layer,items.type,items.type2,items.amount,items.decaytime,items.def,items.hidamage,items.lodamage,items.weight,items.hp,items.maxhp,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawnregion,items.priv,items.sellprice,items.buyprice,items.restock,items.baseid" );
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
--- 1869,1873 ----
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.color,items.cont,items.layer,items.type,items.type2,items.amount,items.decaytime,items.def,items.hidamage,items.lodamage,items.weight,items.hp,items.maxhp,items.speed,items.magic,items.owner,items.visible,items.spawnregion,items.priv,items.sellprice,items.buyprice,items.restock,items.baseid" );
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
***************
*** 2055,2058 ****
--- 2042,2046 ----
changed( TOOLTIP );
flagChanged();
+
SET_INT_PROPERTY( "id", id_ )
else SET_INT_PROPERTY( "color", color_ )
***************
*** 2104,2108 ****
return 0;
}
- else SET_INT_PROPERTY( "antispamtimer", antispamtimer_ )
else if( name == "container" )
--- 2092,2095 ----
***************
*** 2165,2169 ****
else SET_INT_PROPERTY( "buyprice", buyprice_ )
else SET_INT_PROPERTY( "restock", restock_ )
- else SET_INT_PROPERTY( "poisoned", poisoned_ )
else SET_INT_PROPERTY( "magic", magic_ )
else SET_INT_PROPERTY( "visible", visible_ )
--- 2152,2155 ----
***************
*** 2252,2256 ****
else GET_PROPERTY( "owner", owner() )
else GET_PROPERTY( "totalweight", totalweight_ )
- else GET_PROPERTY( "antispamtimer", (int)antispamtimer_ )
// container
--- 2238,2241 ----
***************
*** 2278,2282 ****
else GET_PROPERTY( "sellprice", sellprice_ )
else GET_PROPERTY( "restock", restock_ )
- else GET_PROPERTY( "poisoned", (int)poisoned_ )
else GET_PROPERTY( "magic", magic_ )
--- 2263,2266 ----
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.180
retrieving revision 1.181
diff -C2 -d -r1.180 -r1.181
*** items.h 24 Nov 2003 02:36:10 -0000 1.180
--- items.h 26 Nov 2003 03:53:53 -0000 1.181
***************
*** 79,93 ****
typedef SingletonHolder< cItemBases > ItemBases;
class cItem : public cUObject
{
private:
bool changed_;
- void flagChanged() { changed_ = true; } // easier to debug, compiler should make it inline;
cItemBase *base;
public:
typedef QValueVector<cItem*> ContainerContent;
- public:
const char *objectID() const
{
--- 79,93 ----
typedef SingletonHolder< cItemBases > ItemBases;
+ #pragma pack(1)
class cItem : public cUObject
{
private:
bool changed_;
cItemBase *base;
+ void flagChanged() { changed_ = true; } // easier to debug, compiler should make it inline;
public:
typedef QValueVector<cItem*> ContainerContent;
const char *objectID() const
{
***************
*** 130,134 ****
P_CHAR owner() const;
int totalweight() const { return totalweight_; }
- uint antispamtimer() const { return antispamtimer_;}
cUObject* container() const { return container_; }
int sellprice() const { return sellprice_; } // Price this item is being bought at by normal vendors
--- 130,133 ----
***************
*** 138,142 ****
uchar magic() const { return magic_; }
uint decaytime() const { return decaytime_; }
- uint poisoned() const { return poisoned_; }
uchar visible() const { return visible_;}
uchar priv() const { return priv_; }
--- 137,140 ----
***************
*** 169,173 ****
void setOwner( P_CHAR nOwner );
void setTotalweight( int data );
- void setAntispamtimer ( uint data ) { antispamtimer_ = data; flagChanged();}
void setSpawnRegion( const QString &data ) { spawnregion_ = data; flagChanged(); }
--- 167,170 ----
***************
*** 179,183 ****
void toBackpack( P_CHAR pChar );
void showName( cUOSocket *socket );
! //*****************************************ADDED SETTERS ***************
void setDef( uint data ) { def_ = data; flagChanged(); changed( TOOLTIP );}
void setMagic( uchar data ) { magic_ = data; flagChanged(); changed( TOOLTIP );}
--- 176,180 ----
void toBackpack( P_CHAR pChar );
void showName( cUOSocket *socket );
!
void setDef( uint data ) { def_ = data; flagChanged(); changed( TOOLTIP );}
void setMagic( uchar data ) { magic_ = data; flagChanged(); changed( TOOLTIP );}
***************
*** 185,196 ****
void setBuyprice( int data ) { buyprice_ = data; flagChanged(); changed( TOOLTIP );}
void setSellprice( int data ) { sellprice_ = data; flagChanged(); changed( TOOLTIP );}
-
- void setPoisoned(uint data) { poisoned_ = data; flagChanged();}
void setVisible( uchar d ) { visible_ = d; flagChanged();}
void setPriv( uchar d ) { priv_ = d; flagChanged(); changed( TOOLTIP );}
void setContainer( cUObject* d ) { container_ = d; flagChanged(); }
- //*******************************************END ADDED SETTERS**********
-
virtual void Init( bool mkser = true );
void setSerial(SERIAL ser);
--- 182,189 ----
***************
*** 272,304 ****
void processModifierNode( const cElement *Tag );
! // Data
! ushort id_;
! ushort color_;
! ushort amount_;
! ushort restock_;
! uchar layer_;
! SI16 lodamage_;
! SI16 hidamage_;
! ushort type_;
! ushort type2_;
! SI16 speed_;
! SI16 weight_;
! SI16 hp_;
! SI16 maxhp_;
! int totalweight_;
! uint antispamtimer_;
! int sellprice_;
! int buyprice_;
! QString spawnregion_;
!
! ContainerContent content_;
! cUObject* container_;
! uint def_; // Item defense
! uchar magic_; // 0=Default as stored in client, 1=Always movable, 2=Never movable, 3=Owner movable, 4=Locked Down
! uint decaytime_;
! uint poisoned_; //AntiChrist -- for poisoning skill
! SERIAL ownserial_;
! uchar visible_; // 0=Normally Visible, 1=Owner & GM Visible, 2=GM Visible
// Bit | Hex | Description
//===================
--- 265,294 ----
void processModifierNode( const cElement *Tag );
! protected:
! unsigned short id_; // Display id of the item
! unsigned short color_; // Color of this item
! unsigned short amount_; // Amount of this item
!
! unsigned char layer_; // The layer this item is equipped on
! unsigned short hp_; // Amount of hitpoints this item has
! unsigned short maxhp_; // The maximum amount of hitpoints this item can have
! int totalweight_; // The weight of this item including all contained items
! ContainerContent content_; // The content of this item
! QString spawnregion_; // The name of the spawnregion this item was spawned into
! cUObject* container_; // The object this item is contained in
+ unsigned char magic_; // Specifies in which manner this item can be moved.
+ // 0: This property is ignored
+ // 1: This item is always movable
+ // 2: This item cannot be moved
+ // 3: This item can only be moved by it's owner
+ // 4: This item has been locked down
+
+ unsigned int decaytime_; // This timer specifies when the item will decay. If this value is 0, the item will never decay
+ SERIAL ownserial_; // This property specifies the owner of this item. If it is INVALID_SERIAL, this item has no owner
+ unsigned char visible_; // This property specifies the visibility of the item.
+ // 0: This property is ignored
+ // 1: This item can only be seen by the owner
+ // 2: This item cannot be seen
// Bit | Hex | Description
//===================
***************
*** 311,316 ****
// 6 | 40 | Corpse
// 7 | 80 | Dye
! uchar priv_;
};
#endif
--- 301,318 ----
// 6 | 40 | Corpse
// 7 | 80 | Dye
! unsigned char priv_;
!
! ushort restock_;
! SI16 lodamage_;
! SI16 hidamage_;
! ushort type_;
! ushort type2_;
! SI16 speed_;
! SI16 weight_;
! uint def_;
! int sellprice_;
! int buyprice_;
};
+ #pragma pack()
#endif
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** player.cpp 26 Nov 2003 01:12:20 -0000 1.51
--- player.cpp 26 Nov 2003 03:53:53 -0000 1.52
***************
*** 707,711 ****
pMount->setFame( pi->lodamage() );
pMount->setKarma( pi->hidamage() );
- pMount->setPoisoned( pi->poisoned() );
pMount->setSummonTime( pi->decaytime() );
--- 707,710 ----
***************
*** 801,805 ****
pMountItem->setLodamage( pMount->fame() );
pMountItem->setHidamage( pMount->karma() );
- pMountItem->setPoisoned( pMount->poisoned() );
if (pMount->summonTime() != 0)
pMountItem->setDecayTime(pMount->summonTime());
--- 800,803 ----
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.118
retrieving revision 1.119
diff -C2 -d -r1.118 -r1.119
*** uobject.cpp 30 Sep 2003 15:06:29 -0000 1.118
--- uobject.cpp 26 Nov 2003 03:53:53 -0000 1.119
***************
*** 461,466 ****
}
else
! setProperty( TagName, Value );
! // qWarning( tr("Unknown tag %1").arg(TagName) );
}
--- 461,468 ----
}
else
! {
! cVariant variant( Value );
! //setProperty( TagName, variant );
! }
}
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.475
retrieving revision 1.476
diff -C2 -d -r1.475 -r1.476
*** wolfpack.cpp 13 Oct 2003 00:11:47 -0000 1.475
--- wolfpack.cpp 26 Nov 2003 03:53:53 -0000 1.476
***************
*** 352,355 ****
--- 352,376 ----
Console::instance()->send( "\n" );
+ Console::instance()->send( "SIZEOF(cItem):" + QString::number( sizeof( cItem ) ) );
+
+ int x;
+
+ QString id = "e75";
+
+ for( x = 0; x < 100000; ++x )
+ {
+ //cItem *it = new cItem();
+ //it->Init( true );
+ //cItem *it = cItem::createFromScript( "e75" );
+ P_ITEM nItem = new cItem;
+ nItem->Init( true );
+ /*nItem->base =*/ ItemBases::instance()->getItemBase( id );
+ const cElement* section = DefManager->getDefinition( WPDT_ITEM, id );
+ nItem->applyDefinition( section );
+ nItem->onCreate( id );
+ }
+
+ return 1;
+
// Scriptmanager can't be in the try{} block because it sometimes throws firstchance exceptions
// we don't like
Index: wolfpack.vcproj
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.vcproj,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** wolfpack.vcproj 24 Nov 2003 03:14:53 -0000 1.4
--- wolfpack.vcproj 26 Nov 2003 03:53:53 -0000 1.5
***************
*** 39,44 ****
ForceConformanceInForLoopScope="0"
RuntimeTypeInfo="1"
! AllOptions="/c /I "sqlite" /Zi /nologo /W1 /Wp64 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "QT_DLL" /D "QT_NO_STL" /D "QT_THREAD_SUPPORT" /D "_MBCS" /Gm /EHsc /RTC1 /MTd /GR /Fo"Debug/" /Fd"Debug/vc70.pdb" /FR"Debug/" /Gd /TP /GR"
! MSOriginalAdditionalOptions="/GR"/>
</Tool>
<Tool
--- 39,43 ----
ForceConformanceInForLoopScope="0"
RuntimeTypeInfo="1"
! AllOptions="/c /I "sqlite" /Zi /nologo /W1 /Wp64 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "QT_DLL" /D "QT_NO_STL" /D "QT_THREAD_SUPPORT" /D "_MBCS" /Gm /EHsc /RTC1 /MTd /GR /Fo"Debug/" /Fd"Debug/vc70.pdb" /FR"Debug/" /Gd /TP /GR"/>
</Tool>
<Tool
***************
*** 53,61 ****
ProgramDatabaseFile="$(OutDir)/wolfpack.pdb"
SubSystem="2"
! TargetMachine="1"
! AdditionalOptions="">
<IntelOptions
! AllOptions="/NOLOGO /OUT:"../wolfpack.exe" /INCREMENTAL qt-mt321.lib ws2_32.lib /DEBUG /PDB:"Debug/wolfpack.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
! MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
--- 52,58 ----
ProgramDatabaseFile="$(OutDir)/wolfpack.pdb"
SubSystem="2"
! TargetMachine="1">
<IntelOptions
! AllOptions="/NOLOGO /OUT:"../wolfpack.exe" /INCREMENTAL qt-mt321.lib ws2_32.lib /DEBUG /PDB:"Debug/wolfpack.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"/>
</Tool>
<Tool
***************
*** 90,115 ****
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;QT_DLL;QT_NO_STL;QT_THREAD_SUPPORT"
! RuntimeLibrary="4"
ForceConformanceInForLoopScope="TRUE"
UsePrecompiledHeader="0"
BrowseInformation="1"
! WarningLevel="3"
! Detect64BitPortabilityProblems="TRUE"
! DebugInformationFormat="3"
! CallingConvention="1"
! AdditionalOptions="">
<IntelOptions
! Optimization="2"
! InlineFunctionExpansion="1"
OmitFramePointers="1"
StringPooling="1"
! RuntimeLibrary="4"
! BufferSecurityCheck="1"
! EnableFunctionLevelLinking="1"
ForceConformanceInForLoopScope="1"
RuntimeTypeInfo="1"
! AllOptions="/c /Zi /nologo /W3 /Wp64 /O2 /Ob1 /Oy /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "QT_DLL" /D "QT_NO_STL" /D "QT_THREAD_SUPPORT" /D "_MBCS" /GF /FD /EHsc /ML /GS /Gy /Zc:forScope /GR /Fo"Release/" /Fd"Release/vc70.pdb" /FR"Release/" /Gr /TP"
! MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
--- 87,121 ----
<Tool
Name="VCCLCompilerTool"
+ AdditionalOptions="/GR"
+ Optimization="3"
+ GlobalOptimizations="TRUE"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="TRUE"
+ FavorSizeOrSpeed="1"
+ OptimizeForWindowsApplication="FALSE"
+ AdditionalIncludeDirectories="sqlite"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;QT_DLL;QT_NO_STL;QT_THREAD_SUPPORT"
! MinimalRebuild="FALSE"
! RuntimeLibrary="0"
! BufferSecurityCheck="FALSE"
! EnableFunctionLevelLinking="FALSE"
ForceConformanceInForLoopScope="TRUE"
UsePrecompiledHeader="0"
BrowseInformation="1"
! WarningLevel="0"
! Detect64BitPortabilityProblems="FALSE"
! DebugInformationFormat="0">
<IntelOptions
! Optimization="4"
! GlobalOptimizations="1"
! InlineFunctionExpansion="2"
! EnableIntrinsicFunctions="1"
! FavorSizeOrSpeed="1"
OmitFramePointers="1"
StringPooling="1"
! RuntimeLibrary="0"
ForceConformanceInForLoopScope="1"
RuntimeTypeInfo="1"
! AllOptions="/c /I "sqlite" /nologo /W0 /Ox /Og /Ob2 /Oi /Ot /Oy /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "QT_DLL" /D "QT_NO_STL" /D "QT_THREAD_SUPPORT" /D "_MBCS" /GF /FD /EHsc /MT /Zc:forScope /GR /Fo"Release/" /Fd"Release/vc70.pdb" /FR"Release/" /Gd /TP /GR"/>
</Tool>
<Tool
***************
*** 118,122 ****
Name="VCLinkerTool"
AdditionalDependencies="qt-mt321.lib ws2_32.lib"
! OutputFile="$(OutDir)/wolfpack.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
--- 124,128 ----
Name="VCLinkerTool"
AdditionalDependencies="qt-mt321.lib ws2_32.lib"
! OutputFile="../wolfpack.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
***************
*** 125,133 ****
OptimizeReferences="2"
EnableCOMDATFolding="2"
! TargetMachine="1"
! AdditionalOptions="">
<IntelOptions
! AllOptions="/NOLOGO /OUT:"Release/wolfpack.exe" /INCREMENTAL:NO qt-mt321.lib ws2_32.lib /DEBUG /PDB:"Release/wolfpack.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /TLBID:1 /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
! MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
--- 131,137 ----
OptimizeReferences="2"
EnableCOMDATFolding="2"
! TargetMachine="1">
<IntelOptions
! AllOptions="/NOLOGO /OUT:"../wolfpack.exe" /INCREMENTAL:NO qt-mt321.lib ws2_32.lib /DEBUG /PDB:"Release/wolfpack.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /TLBID:1 /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"/>
</Tool>
<Tool
***************
*** 151,154 ****
--- 155,160 ----
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ <IntelOptions
+ CompilerName="1"/>
</Configuration>
</Configurations>
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** world.cpp 24 Nov 2003 02:36:10 -0000 1.51
--- world.cpp 26 Nov 2003 03:53:53 -0000 1.52
***************
*** 202,206 ****
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',\
--- 202,205 ----
Index: wpdefmanager.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wpdefmanager.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** wpdefmanager.cpp 24 Nov 2003 03:14:53 -0000 1.72
--- wpdefmanager.cpp 26 Nov 2003 03:53:53 -0000 1.73
***************
*** 599,603 ****
}
! QString cElement::name() const
{
return name_;
--- 599,603 ----
}
! const QCString &cElement::name() const
{
return name_;
***************
*** 638,642 ****
for( unsigned int i = 0; i < childCount_; ++i )
{
! if( children[i]->name() == name )
return children[i];
}
--- 638,642 ----
for( unsigned int i = 0; i < childCount_; ++i )
{
! if( children[i]->name() == name.latin1() )
return children[i];
}
Index: wpdefmanager.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wpdefmanager.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** wpdefmanager.h 24 Nov 2003 03:14:53 -0000 1.34
--- wpdefmanager.h 26 Nov 2003 03:53:53 -0000 1.35
***************
*** 115,119 ****
void setName( const QCString &data );
! QString name() const;
void setText( const QString &data );
--- 115,119 ----
void setName( const QCString &data );
! const QCString &name() const;
void setText( const QString &data );
|
|
From: <dar...@us...> - 2003-11-26 01:25:58
|
Update of /cvsroot/wpdev/xmlscripts/definitions/multis In directory sc8-pr-cvs1:/tmp/cvs-serv15412/multis Modified Files: houses.xml Log Message: Further improved baseid conformance. Index: houses.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/multis/houses.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** houses.xml 13 Sep 2002 20:06:11 -0000 1.2 --- houses.xml 26 Nov 2003 01:25:55 -0000 1.3 *************** *** 13,24 **** <deedsection>house_small</deedsection> <movechar x="0" y="0" z="5" /> ! <item> <!-- door --> ! <inherit id="6c5" /> <type>13</type> <!-- locked door --> <lock /> <position x="0" y="3" z="5" /> </item> ! <item> <!-- wooden sign --> ! <inherit id="bd0" /> <type>222</type> <!-- brings up owner gump on dbl click --> <lock /> --- 13,22 ---- <deedsection>house_small</deedsection> <movechar x="0" y="0" z="5" /> ! <item id="6c5"> <!-- door --> <type>13</type> <!-- locked door --> <lock /> <position x="0" y="3" z="5" /> </item> ! <item id="bd0"> <!-- wooden sign --> <type>222</type> <!-- brings up owner gump on dbl click --> <lock /> |
|
From: <dar...@us...> - 2003-11-26 01:12:24
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv12498
Modified Files:
house.cpp npc.cpp player.cpp targetrequests.cpp
Log Message:
Further improved baseid conformance.
Index: house.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/house.cpp,v
retrieving revision 1.117
retrieving revision 1.118
diff -C2 -d -r1.117 -r1.118
*** house.cpp 24 Nov 2003 03:14:52 -0000 1.117
--- house.cpp 26 Nov 2003 01:12:20 -0000 1.118
***************
*** 29,34 ****
//==================================================================================
! /* House code for deed creation by Tal Strake, revised by Cironian */
!
#include "house.h"
#include "persistentbroker.h"
--- 29,33 ----
//==================================================================================
! #include "console.h"
#include "house.h"
#include "persistentbroker.h"
***************
*** 59,113 ****
void cHouse::processHouseItemNode( const cElement *Tag )
{
! P_CHAR pOwner = FindCharBySerial( ownSerial() );
! P_ITEM nItem = new cItem;
! if( !nItem )
! return;
!
! nItem->Init( true );
! nItem->applyDefinition( Tag );
! if( nItem->type() == 222 )
! nItem->setName( name() );
! nItem->SetOwnSerial( this->ownSerial() );
! addItem( nItem );
! Coord_cl npos = this->pos();
! for( unsigned int i = 0; i < Tag->childCount(); ++i )
! {
! const cElement *childTag = Tag->getChild( i );
!
! QString TagName = childTag->name();
! QString Value = childTag->getValue();
! // <pack />
! if( TagName == "pack" && pOwner )
{
! P_ITEM pBackpack = pOwner->getBackpack();
! pBackpack->addItem( nItem );
! }
! // <lock />
! else if( TagName == "lock" )
! {
! nItem->setMagic(4);
! }
! // <secure />
! else if( TagName == "secure" )
! nItem->setMagic(3);
! // <position x="1" y="5" z="20" />
! else if( TagName == "position" )
! {
! npos.x = npos.x + childTag->getAttribute( "x" ).toShort();
! npos.y = npos.y + childTag->getAttribute( "y" ).toShort();
! npos.z = npos.z + childTag->getAttribute( "z" ).toShort();
}
- }
! nItem->moveTo( npos );
! nItem->update();
}
--- 58,121 ----
void cHouse::processHouseItemNode( const cElement *Tag )
{
! const QString &id = Tag->getAttribute( "id" );
! P_ITEM nItem = 0;
! if( id != QString::null )
! {
! nItem = cItem::createFromScript( id );
! }
! if( nItem )
! {
! P_CHAR pOwner = FindCharBySerial( ownSerial() );
! nItem->applyDefinition( Tag );
! if( nItem->type() == 222 )
! nItem->setName( name() );
! nItem->SetOwnSerial( this->ownSerial() );
! addItem( nItem );
! Coord_cl npos = this->pos();
! for( unsigned int i = 0; i < Tag->childCount(); ++i )
{
! const cElement *childTag = Tag->getChild( i );
!
! QString TagName = childTag->name();
! QString Value = childTag->getValue();
! // <pack />
! if( TagName == "pack" && pOwner )
! {
! P_ITEM pBackpack = pOwner->getBackpack();
! pBackpack->addItem( nItem );
! }
! // <lock />
! else if( TagName == "lock" )
! {
! nItem->setMagic(4);
! }
! // <secure />
! else if( TagName == "secure" )
! nItem->setMagic(3);
!
! // <position x="1" y="5" z="20" />
! else if( TagName == "position" )
! {
! npos.x = npos.x + childTag->getAttribute( "x" ).toShort();
! npos.y = npos.y + childTag->getAttribute( "y" ).toShort();
! npos.z = npos.z + childTag->getAttribute( "z" ).toShort();
! }
}
! nItem->moveTo( npos );
! nItem->update();
! }
! else
! {
! Console::instance()->log( LOG_ERROR, QString( "Invalid item node missing id attribute in multi '%1'." ).arg( Tag->getTopmostParent()->getAttribute( "id", "unknown" ) ) );
! }
}
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** npc.cpp 24 Nov 2003 03:14:52 -0000 1.51
--- npc.cpp 26 Nov 2003 01:12:20 -0000 1.52
***************
*** 808,814 ****
while( total > 0 )
{
! P_ITEM pile = new cItem;
! pile->Init();
! pile->setId( 0xEED );
pile->setAmount( QMIN( total, static_cast<Q_UINT32>(65535) ) );
pCont->addItem( pile );
--- 808,812 ----
while( total > 0 )
{
! P_ITEM pile = cItem::createFromScript( "eed" );
pile->setAmount( QMIN( total, static_cast<Q_UINT32>(65535) ) );
pCont->addItem( pile );
***************
*** 1473,1481 ****
if( !currCont )
{
! currCont = new cItem;
! currCont->Init();
! currCont->setId( 0xE75 );
currCont->setOwner( this );
- currCont->setType( 1 );
addItem( BuyRestockContainer, currCont );
currCont->update();
--- 1471,1476 ----
if( !currCont )
{
! currCont = cItem::createFromScript( "e75" );
currCont->setOwner( this );
addItem( BuyRestockContainer, currCont );
currCont->update();
***************
*** 1485,1493 ****
if( !currCont )
{
! currCont = new cItem;
! currCont->Init();
! currCont->setId( 0xE75 );
currCont->setOwner( this );
- currCont->setType( 1 );
addItem( BuyNoRestockContainer, currCont );
currCont->update();
--- 1480,1485 ----
if( !currCont )
{
! currCont = cItem::createFromScript( "e75" );
currCont->setOwner( this );
addItem( BuyNoRestockContainer, currCont );
currCont->update();
***************
*** 1497,1505 ****
if( !currCont )
{
! currCont = new cItem;
! currCont->Init();
! currCont->setId( 0xE75 );
currCont->setOwner( this );
- currCont->setType( 1 );
addItem( SellContainer, currCont );
currCont->update();
--- 1489,1494 ----
if( !currCont )
{
! currCont = cItem::createFromScript( "e75" );
currCont->setOwner( this );
addItem( SellContainer, currCont );
currCont->update();
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** player.cpp 25 Nov 2003 19:41:30 -0000 1.50
--- player.cpp 26 Nov 2003 01:12:20 -0000 1.51
***************
*** 982,995 ****
P_ITEM pi = atLayer( BankBox );
! if ( pi )
! return pi;
!
! pi = new cItem;
! pi->Init();
! pi->setId( 0x9ab );
! pi->SetOwnSerial( this->serial() );
! pi->setType( 1 );
! pi->setName( tr( "%1's bank box" ).arg( name() ) );
! addItem( BankBox, pi, true, true );
return pi;
--- 982,993 ----
P_ITEM pi = atLayer( BankBox );
! if( !pi )
! {
! pi = cItem::createFromScript( "9ab" );
! pi->setOwner( this );
! pi->setType( 1 );
! pi->setName( tr( "%1's bank box" ).arg( name() ) );
! addItem( BankBox, pi, true, true );
! }
return pi;
Index: targetrequests.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -d -r1.79 -r1.80
*** targetrequests.cpp 23 Sep 2003 12:40:19 -0000 1.79
--- targetrequests.cpp 26 Nov 2003 01:12:20 -0000 1.80
***************
*** 77,81 ****
// Otherwise create our item here
! P_ITEM pItem = NULL;
if( node )
pItem = cItem::createFromScript( item_ );
--- 77,82 ----
// Otherwise create our item here
! P_ITEM pItem = 0;
!
if( node )
pItem = cItem::createFromScript( item_ );
|