wpdev-commits Mailing List for Wolfpack Emu (Page 189)
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: <xs...@us...> - 2003-09-20 12:01:50
|
Update of /cvsroot/wpdev/wolfpack/network
In directory sc8-pr-cvs1:/tmp/cvs-serv28299/network
Modified Files:
uosocket.cpp
Log Message:
introducing guard ai,
fixes performance issues with definition lists
Index: uosocket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v
retrieving revision 1.294
retrieving revision 1.295
diff -C2 -d -r1.294 -r1.295
*** uosocket.cpp 19 Sep 2003 22:02:41 -0000 1.294
--- uosocket.cpp 20 Sep 2003 12:01:44 -0000 1.295
***************
*** 1930,1938 ****
pc_i->callGuards();
}
- else if( pc_i->objectType() == enNPC )//&& pc_i->npcaitype() == 4 )
- {
- _player->makeCriminal();
- pc_i->fight( _player );
- }
else if ((pc_i->objectType() == enNPC || pc_i->isTamed()) && !pc_i->isAtWar() )//&& pc_i->npcaitype() != 4) // changed from 0x40 to 4, cauz 0x40 was removed LB
{
--- 1930,1933 ----
|
|
From: <xs...@us...> - 2003-09-20 12:00:18
|
Update of /cvsroot/wpdev/xmlscripts/definitions/lists In directory sc8-pr-cvs1:/tmp/cvs-serv27971/definitions/lists Modified Files: names.xml Log Message: updates guards ai, fixes female and male names ;) Index: names.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/lists/names.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** names.xml 5 Apr 2003 18:41:43 -0000 1.10 --- names.xml 20 Sep 2003 12:00:09 -0000 1.11 *************** *** 279,283 **** <item>Zunrek</item> </list> ! <list id="NAMES_FEMALE"> <item>Aaron</item> <item>Aasin</item> --- 279,283 ---- <item>Zunrek</item> </list> ! <list id="NAMES_MALE"> <item>Aaron</item> <item>Aasin</item> *************** *** 3065,3069 **** <item>Ytsthih</item> </list> ! <list id="NAMES_MALE"> <item>Aba</item> <item>Abby</item> --- 3065,3069 ---- <item>Ytsthih</item> </list> ! <list id="NAMES_FEMALE"> <item>Aba</item> <item>Abby</item> |
|
From: <xs...@us...> - 2003-09-20 12:00:18
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/humans In directory sc8-pr-cvs1:/tmp/cvs-serv27971/definitions/npcs/humans Modified Files: guards.xml Log Message: updates guards ai, fixes female and male names ;) Index: guards.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/humans/guards.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** guards.xml 3 Jan 2003 10:38:15 -0000 1.3 --- guards.xml 20 Sep 2003 12:00:10 -0000 1.4 *************** *** 12,16 **** <name><random list="NAMES_MALE" /></name> <skin><random list="SKINS_HUMAN" /></skin> ! <ai>4</ai> <direction><random min="0" max="7" /></direction> <!-- Facing a random direction --> <totame>1100</totame> --- 12,16 ---- <name><random list="NAMES_MALE" /></name> <skin><random list="SKINS_HUMAN" /></skin> ! <ai>Human_Guard</ai> <direction><random min="0" max="7" /></direction> <!-- Facing a random direction --> <totame>1100</totame> |
|
From: <dar...@us...> - 2003-09-20 02:22:13
|
Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv6712
Modified Files:
spellbook.py tooltip.py
Log Message:
Several Bugfixes
Index: spellbook.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/spellbook.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** spellbook.py 20 Sep 2003 01:07:32 -0000 1.2
--- spellbook.py 20 Sep 2003 02:22:09 -0000 1.3
***************
*** 59,63 ****
# Does the Spellbook have a specific spell?
def hasspell( item, spell ):
! if item and 'spellbook' in items.events:
circle = int( floor( spell / 8 ) ) + 1 # 0 for first circle
spell = spell % 8
--- 59,63 ----
# Does the Spellbook have a specific spell?
def hasspell( item, spell ):
! if item and 'spellbook' in item.events:
circle = int( floor( spell / 8 ) ) + 1 # 0 for first circle
spell = spell % 8
Index: tooltip.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/tooltip.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** tooltip.py 21 Jul 2003 14:29:24 -0000 1.7
--- tooltip.py 20 Sep 2003 02:22:09 -0000 1.8
***************
*** 76,80 ****
tooltip.add( 1060449, "5" ) #Poison Resist
tooltip.add( 1060446, "3" ) #Energy Resist
! tooltip.add( 1061170, str( target.strength ) ) #Strength Requirement
tooltip.add( 1060639, str( target.health ) + "\t" + str( target.maxhealth ) ) #Durability
--- 76,81 ----
tooltip.add( 1060449, "5" ) #Poison Resist
tooltip.add( 1060446, "3" ) #Energy Resist
! if target.hastag( 'req_str' ):
! tooltip.add( 1061170, str( target.gettag( 'req_str' ) ) ) #Strength Requirement
tooltip.add( 1060639, str( target.health ) + "\t" + str( target.maxhealth ) ) #Durability
***************
*** 89,93 ****
tooltip.add( 1038021, "" ) # Blessed
tooltip.add( 1060448, "1" ) #Physical resist
! tooltip.add( 1061170, str( target.strength ) ) #Strength requirement
tooltip.add( 1060639, str( target.health ) + "\t" + str( target.maxhealth ) ) #Durability
--- 90,95 ----
tooltip.add( 1038021, "" ) # Blessed
tooltip.add( 1060448, "1" ) #Physical resist
! if target.hastag( 'req_str' ):
! tooltip.add( 1061170, str( target.gettag( 'req_str' ) ) ) #Strength Requirement
tooltip.add( 1060639, str( target.health ) + "\t" + str( target.maxhealth ) ) #Durability
***************
*** 101,105 ****
tooltip.add( 1060449, "5" ) #Poison Resist
tooltip.add( 1060446, "3" ) #Energy Resist
! tooltip.add( 1061170, str( target.strength ) ) #Strength requirement
tooltip.add( 1060639, str( target.health ) + "\t" + str( target.maxhealth) ) #Durability
--- 103,108 ----
tooltip.add( 1060449, "5" ) #Poison Resist
tooltip.add( 1060446, "3" ) #Energy Resist
! if target.hastag( 'req_str' ):
! tooltip.add( 1061170, str( target.gettag( 'req_str' ) ) ) #Strength Requirement
tooltip.add( 1060639, str( target.health ) + "\t" + str( target.maxhealth) ) #Durability
***************
*** 112,116 ****
tooltip.add( 1061168, str( target.lodamage ) + " \t" + str(target.hidamage))# Weapon Damage
tooltip.add( 1061167, str( target.speed ))
! tooltip.add( 1061170, str( target.strength ))
if ( target.twohanded ):
tooltip.add( 1061171, "" ) # two-handed
--- 115,120 ----
tooltip.add( 1061168, str( target.lodamage ) + " \t" + str(target.hidamage))# Weapon Damage
tooltip.add( 1061167, str( target.speed ))
! if target.hastag( 'req_str' ):
! tooltip.add( 1061170, str( target.gettag( 'req_str' ) ) ) #Strength Requirement
if ( target.twohanded ):
tooltip.add( 1061171, "" ) # two-handed
|
|
From: <dar...@us...> - 2003-09-20 02:15:12
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv5586 Modified Files: commands.cpp Log Message: Reordered command logging. Index: commands.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v retrieving revision 1.204 retrieving revision 1.205 diff -C2 -d -r1.204 -r1.205 *** commands.cpp 19 Sep 2003 20:41:08 -0000 1.204 --- commands.cpp 20 Sep 2003 02:15:09 -0000 1.205 *************** *** 85,90 **** // Dispatch the command - dispatch( socket, pCommand, pArgs ); socket->log( QString( "Used command '%1'.\n" ).arg( command ) ); } --- 85,90 ---- // Dispatch the command socket->log( QString( "Used command '%1'.\n" ).arg( command ) ); + dispatch( socket, pCommand, pArgs ); } |
|
From: <dar...@us...> - 2003-09-20 02:12:30
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv5062
Modified Files:
dragdrop.cpp
Log Message:
Fixed a drag & drop glitch.
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.202
retrieving revision 1.203
diff -C2 -d -r1.202 -r1.203
*** dragdrop.cpp 20 Sep 2003 02:11:29 -0000 1.202
--- dragdrop.cpp 20 Sep 2003 02:12:26 -0000 1.203
***************
*** 506,517 ****
if( pChar == pOtherChar )
{
- // If we don't send this packet, the client creates some sort of "ghost image" in the container.
- cUOPacket packet( 0x23, 26 );
- packet.setShort( 1, pItem->id() );
- packet.setShort( 6, pItem->amount() );
- packet.setInt( 8, pChar->serial() );
- packet.setInt( 17, pChar->getBackpack()->serial() );
- socket->send( &packet );
-
pItem->toBackpack( pChar );
return;
--- 506,509 ----
|
|
From: <dar...@us...> - 2003-09-20 02:11:34
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv4911
Modified Files:
dragdrop.cpp
Log Message:
Fixed a drag & drop glitch.
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.201
retrieving revision 1.202
diff -C2 -d -r1.201 -r1.202
*** dragdrop.cpp 15 Sep 2003 12:49:05 -0000 1.201
--- dragdrop.cpp 20 Sep 2003 02:11:29 -0000 1.202
***************
*** 483,491 ****
// If not handeled: Equip the item if the NPC is owned by us
- // To prevent bad effects remove it from the clients view first
- cUOTxRemoveObject rObject;
- rObject.setSerial( pItem->serial() );
- socket->send( &rObject );
-
P_CHAR pChar = socket->player();
--- 483,486 ----
***************
*** 511,514 ****
--- 506,517 ----
if( pChar == pOtherChar )
{
+ // If we don't send this packet, the client creates some sort of "ghost image" in the container.
+ cUOPacket packet( 0x23, 26 );
+ packet.setShort( 1, pItem->id() );
+ packet.setShort( 6, pItem->amount() );
+ packet.setInt( 8, pChar->serial() );
+ packet.setInt( 17, pChar->getBackpack()->serial() );
+ socket->send( &packet );
+
pItem->toBackpack( pChar );
return;
***************
*** 737,745 ****
// We may also drop into *any* locked chest
// So we can have post-boxes ;o)
- // Spellbooks are containers for us as well
if( pCont->type() == 1 || pCont->type() == 8 || pCont->type() == 63 || pCont->type() == 65 || pCont->type() == 66 )
{
// If we're dropping it onto the closed container
! if( dropPos.distance( pCont->pos() ) == 0 )
{
pCont->addItem( pItem );
--- 740,747 ----
// We may also drop into *any* locked chest
// So we can have post-boxes ;o)
if( pCont->type() == 1 || pCont->type() == 8 || pCont->type() == 63 || pCont->type() == 65 || pCont->type() == 66 )
{
// If we're dropping it onto the closed container
! if( dropPos.x == 0xFFFF && dropPos.y == 0xFFFF )
{
pCont->addItem( pItem );
|
|
From: <dar...@us...> - 2003-09-20 01:30:50
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv30745
Modified Files:
walking.cpp
Log Message:
Misc
Index: walking.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -C2 -d -r1.91 -r1.92
*** walking.cpp 7 Sep 2003 19:07:47 -0000 1.91
--- walking.cpp 20 Sep 2003 01:30:45 -0000 1.92
***************
*** 483,487 ****
// Check if the char can move to those new coordinates
// It is going to automatically calculate the new coords (!)
! if( !mayWalk( pChar, newCoord ) )
{
if( player && player->socket() )
--- 483,487 ----
// Check if the char can move to those new coordinates
// It is going to automatically calculate the new coords (!)
! if( ( !player || !player->isGM() ) && !mayWalk( pChar, newCoord ) )
{
if( player && player->socket() )
|
|
From: <dar...@us...> - 2003-09-20 01:26:58
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv30061
Modified Files:
console.h console_unix.cpp console_win.cpp log.cpp
Log Message:
Fancy Colors for Linux
Index: console.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** console.h 20 Sep 2003 01:05:10 -0000 1.6
--- console.h 20 Sep 2003 01:26:54 -0000 1.7
***************
*** 61,64 ****
--- 61,65 ----
WPC_YELLOW,
WPC_WHITE,
+ WPC_BROWN
};
Index: console_unix.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_unix.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** console_unix.cpp 13 Sep 2003 01:54:55 -0000 1.8
--- console_unix.cpp 20 Sep 2003 01:26:54 -0000 1.9
***************
*** 177,180 ****
--- 177,182 ----
case WPC_WHITE: cb = "\e[1;37m";
break;
+ case WPC_BROWN: cb = "\e[0;33m";
+ break
default: cb = "\e[0m";
***************
*** 226,229 ****
--- 228,232 ----
#if defined(Q_OS_UNIX) && 0
sMessage.replace("\e[0m", "");
+ sMessage.replace("\e[1;32m", "");
sMessage.replace("\e[1;32m", "");
sMessage.replace("\e[1;31m", "");
Index: console_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console_win.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** console_win.cpp 13 Sep 2003 18:47:25 -0000 1.10
--- console_win.cpp 20 Sep 2003 01:26:54 -0000 1.11
***************
*** 478,481 ****
--- 478,485 ----
break;
+ case WPC_BROWN:
+ cf.crTextColor = RGB( 204, 204, 153 );
+ break;
+
case WPC_NORMAL:
cf.crTextColor = RGB( 0xAF,0xAF,0xAF );
Index: log.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/log.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** log.cpp 20 Sep 2003 01:11:41 -0000 1.7
--- log.cpp 20 Sep 2003 01:26:54 -0000 1.8
***************
*** 183,187 ****
case LOG_PYTHON:
! Console::instance()->setAttributes( false, false, false, 204, 204, 153, 0, FONT_FIXEDWIDTH );
break;
--- 183,187 ----
case LOG_PYTHON:
! Console::instance()->ChangeColor( WPC_BROWN );
break;
|
|
From: <dar...@us...> - 2003-09-20 01:11:45
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv27272
Modified Files:
log.cpp
Log Message:
Added timestamping to python logs.
Index: log.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/log.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** log.cpp 20 Sep 2003 01:05:10 -0000 1.6
--- log.cpp 20 Sep 2003 01:11:41 -0000 1.7
***************
*** 105,109 ****
QCString prelude;
! if( timestamp )
{
prelude.sprintf( "%02u:%02u:", now.hour(), now.minute() );
--- 105,109 ----
QCString prelude;
! if( timestamp || loglevel == LOG_PYTHON )
{
prelude.sprintf( "%02u:%02u:", now.hour(), now.minute() );
|
|
From: <dar...@us...> - 2003-09-20 01:07:55
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/misc
In directory sc8-pr-cvs1:/tmp/cvs-serv26359/items/misc
Modified Files:
animations.xml misc.xml
Log Message:
Removed errorhandler.py
Fixed some malformed xml files.
Index: animations.xml
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/misc/animations.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** animations.xml 25 Dec 2002 23:40:41 -0000 1.5
--- animations.xml 20 Sep 2003 01:07:50 -0000 1.6
***************
*** 110,164 ****
<item id="3818">
<id>0x3818</id>
! <category>Energy</category>
</item>
<item id="3915">
<id>0x3915</id>
! <category>Field of Poison (N/S) 1</category>
</item>
<item id="3e02">
<id>0x3e02</id>
! <category>Field of Poison (N/S) 2</category>
</item>
<item id="3920">
<id>0x3920</id>
! <category>Field of Poison (W/E)</category>
</item>
<item id="3946">
<id>0x3946</id>
! <category>Field of Energy (N/S)</category>
</item>
<item id="3956">
<id>0x3956</id>
! <category>Field of Energy (W/E)</category>
</item>
<item id="3967">
<id>0x3967</id>
! <category>Field of Paralysis (N/S)</category>
</item>
<item id="3979">
<id>0x3979</id>
! <category>Field of Paralysis (W/E)</category>
</item>
<item id="398c">
<id>0x398c</id>
! <category>Field of Fire (N/S) 1</category>
</item>
<item id="3e27">
<id>0x3e27</id>
! <category>Field of Fire (N/S) 2</category>
</item>
<item id="3996">
<id>0x3996</id>
! <category>Field of Fire (W/E)</category>
</item>
--- 110,164 ----
<item id="3818">
<id>0x3818</id>
! <category>Animations\Energy</category>
</item>
<item id="3915">
<id>0x3915</id>
! <category>Animations\Field of Poison (N/S) 1</category>
</item>
<item id="3e02">
<id>0x3e02</id>
! <category>Animations\Field of Poison (N/S) 2</category>
</item>
<item id="3920">
<id>0x3920</id>
! <category>Animations\Field of Poison (W/E)</category>
</item>
<item id="3946">
<id>0x3946</id>
! <category>Animations\Field of Energy (N/S)</category>
</item>
<item id="3956">
<id>0x3956</id>
! <category>Animations\Field of Energy (W/E)</category>
</item>
<item id="3967">
<id>0x3967</id>
! <category>Animations\Field of Paralysis (N/S)</category>
</item>
<item id="3979">
<id>0x3979</id>
! <category>Animations\Field of Paralysis (W/E)</category>
</item>
<item id="398c">
<id>0x398c</id>
! <category>Animations\Field of Fire (N/S) 1</category>
</item>
<item id="3e27">
<id>0x3e27</id>
! <category>Animations\Field of Fire (N/S) 2</category>
</item>
<item id="3996">
<id>0x3996</id>
! <category>Animations\Field of Fire (W/E)</category>
</item>
Index: misc.xml
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/misc/misc.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** misc.xml 25 Dec 2002 23:40:41 -0000 1.5
--- misc.xml 20 Sep 2003 01:07:50 -0000 1.6
***************
*** 200,208 ****
<id>0x1070</id>
<category>Misc\Training Dummy\Training Dummy (N/S)</category>
! </item>
!
! <item id="1071">
! <id>0x1071</id>
! <category>Misc\Training Dummy\Training Dummy (N/S) (Swinging)</category>
</item>
--- 200,204 ----
<id>0x1070</id>
<category>Misc\Training Dummy\Training Dummy (N/S)</category>
! <events>training_dummy</events>
</item>
***************
*** 210,218 ****
<id>0x1074</id>
<category>Misc\Training Dummy\Training Dummy (W/E)</category>
! </item>
!
! <item id="1075">
! <id>0x1075</id>
! <category>Misc\Training Dummy\Training Dummy (W/E) (Swinging)</category>
</item>
--- 206,210 ----
<id>0x1074</id>
<category>Misc\Training Dummy\Training Dummy (W/E)</category>
! <events>training_dummy</events>
</item>
|
|
From: <dar...@us...> - 2003-09-20 01:07:55
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/animals In directory sc8-pr-cvs1:/tmp/cvs-serv26359/npcs/animals Modified Files: land.xml Log Message: Removed errorhandler.py Fixed some malformed xml files. Index: land.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/animals/land.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** land.xml 23 Aug 2003 05:37:54 -0000 1.16 --- land.xml 20 Sep 2003 01:07:51 -0000 1.17 *************** *** 578,582 **** <karma><random min="0" max="624" /></karma> <fame><random min="0" max="1249" /></fame> ! <defense><random min="5" max="10" /</defense> <lodamage>2</lodamage> <hidamage>8</hidamage> --- 578,582 ---- <karma><random min="0" max="624" /></karma> <fame><random min="0" max="1249" /></fame> ! <defense><random min="5" max="10" /></defense> <lodamage>2</lodamage> <hidamage>8</hidamage> |
|
From: <dar...@us...> - 2003-09-20 01:07:55
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/monsters In directory sc8-pr-cvs1:/tmp/cvs-serv26359/npcs/monsters Modified Files: undeads.xml Log Message: Removed errorhandler.py Fixed some malformed xml files. Index: undeads.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/monsters/undeads.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** undeads.xml 15 Sep 2003 15:39:57 -0000 1.12 --- undeads.xml 20 Sep 2003 01:07:51 -0000 1.13 *************** *** 63,67 **** <karma><random min="-0" max="-624"/></karma> <fame><random min="0" max="1249"/></fame> ! <defense><random min="15" max="20"/><</defense> <lodamage>5</lodamage> <hidamage>11</hidamage> --- 63,67 ---- <karma><random min="-0" max="-624"/></karma> <fame><random min="0" max="1249"/></fame> ! <defense><random min="15" max="20"/></defense> <lodamage>5</lodamage> <hidamage>11</hidamage> *************** *** 85,89 **** <karma><random min="-0" max="-624"/></karma> <fame><random min="0" max="1249"/></fame> ! <defense><random min="15" max="20"/><</defense> <lodamage>5</lodamage> <hidamage>11</hidamage> --- 85,89 ---- <karma><random min="-0" max="-624"/></karma> <fame><random min="0" max="1249"/></fame> ! <defense><random min="15" max="20"/></defense> <lodamage>5</lodamage> <hidamage>11</hidamage> *************** *** 107,111 **** <karma><random min="-0" max="-624"/></karma> <fame><random min="0" max="1249"/></fame> ! <defense><random min="35" max="45"/><</defense> <lodamage>18</lodamage> <hidamage>43</hidamage> --- 107,111 ---- <karma><random min="-0" max="-624"/></karma> <fame><random min="0" max="1249"/></fame> ! <defense><random min="35" max="45"/></defense> <lodamage>18</lodamage> <hidamage>43</hidamage> |
|
From: <dar...@us...> - 2003-09-20 01:07:55
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/vegetation
In directory sc8-pr-cvs1:/tmp/cvs-serv26359/items/vegetation
Modified Files:
mushrooms.xml wood.xml
Log Message:
Removed errorhandler.py
Fixed some malformed xml files.
Index: mushrooms.xml
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/vegetation/mushrooms.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mushrooms.xml 25 Dec 2002 23:51:10 -0000 1.2
--- mushrooms.xml 20 Sep 2003 01:07:50 -0000 1.3
***************
*** 9,15 ****
=================================================================
-->
- <!-- Aus der base.xml müssen folgende Items (insgesamt 15) gelöscht werden:
- d0c bis d19
- -->
<definitions>
<item id="d0c">
--- 9,12 ----
Index: wood.xml
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/vegetation/wood.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** wood.xml 25 Dec 2002 23:51:10 -0000 1.2
--- wood.xml 20 Sep 2003 01:07:50 -0000 1.3
***************
*** 9,15 ****
=================================================================
-->
- <!-- Aus der base.xml müssen folgende Items (insgesamt 30) gelöscht werden:
- 1b81 bis 1b9e
- -->
<definitions>
<!-- Wood -->
--- 9,12 ----
|
|
From: <dar...@us...> - 2003-09-20 01:07:55
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1:/tmp/cvs-serv26359 Modified Files: scripts.xml Log Message: Removed errorhandler.py Fixed some malformed xml files. Index: scripts.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/scripts.xml,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** scripts.xml 15 Sep 2003 16:19:16 -0000 1.59 --- scripts.xml 20 Sep 2003 01:07:51 -0000 1.60 *************** *** 90,95 **** <script>skills.peacemaking</script> <script>skills.provocation</script> - - <!-- Load *LAST* thats important --> - <script>errorhandler</script> </definitions> --- 90,92 ---- |
|
From: <dar...@us...> - 2003-09-20 01:07:55
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/buildings
In directory sc8-pr-cvs1:/tmp/cvs-serv26359/items/buildings
Modified Files:
carpets.xml weapons.xml
Log Message:
Removed errorhandler.py
Fixed some malformed xml files.
Index: carpets.xml
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/buildings/carpets.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** carpets.xml 23 Dec 2002 01:36:32 -0000 1.2
--- carpets.xml 20 Sep 2003 01:07:50 -0000 1.3
***************
*** 7,16 ****
=================================================================
-->
- <!-- Aus der base.xml müssen folgende Items gelöscht werden:
- aa9 bis afa
- 1098 bis 10a3
- 1e36 bis 1e5b
- 1dd3 bis 1dfc
- -->
<definitions>
<!-- Rug - Brown -->
--- 7,10 ----
Index: weapons.xml
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/buildings/weapons.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** weapons.xml 25 Dec 2002 15:55:50 -0000 1.3
--- weapons.xml 20 Sep 2003 01:07:50 -0000 1.4
***************
*** 9,17 ****
=================================================================
-->
- <!-- Aus der base.xml müssen folgende Items (insgesamt 46) gelöscht werden:
- 155c bis 1583
- 1634 bis 1637
- 1584, 1585
- -->
<definitions>
<!-- Decorative Weapons -->
--- 9,12 ----
|
|
From: <dar...@us...> - 2003-09-20 01:07:54
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/equipment In directory sc8-pr-cvs1:/tmp/cvs-serv26359/items/equipment Modified Files: food.xml Log Message: Removed errorhandler.py Fixed some malformed xml files. Index: food.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/equipment/food.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** food.xml 8 Feb 2003 18:43:56 -0000 1.6 --- food.xml 20 Sep 2003 01:07:50 -0000 1.7 *************** *** 1109,1113 **** <item id="c78"> ! <inherit id="c78" /> <id>0x0c78</id> <category>Equipment\Food\Carrots 2</category> --- 1109,1113 ---- <item id="c78"> ! <inherit id="c77" /> <id>0x0c78</id> <category>Equipment\Food\Carrots 2</category> |
|
From: <dar...@us...> - 2003-09-20 01:07:36
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv26302 Modified Files: spellbook.py Removed Files: errorhandler.py Log Message: Removed errorhandler.py Preparing for magic update. Index: spellbook.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/spellbook.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** spellbook.py 26 Jul 2003 01:09:25 -0000 1.1 --- spellbook.py 20 Sep 2003 01:07:32 -0000 1.2 *************** *** 56,59 **** --- 56,72 ---- socket.sysmessage( 'Select the spellbook you want to remove the spell from.' ) socket.attachtarget( "spellbook.removespelltarget", [ spell ] ) + + # Does the Spellbook have a specific spell? + def hasspell( item, spell ): + if item and 'spellbook' in items.events: + circle = int( floor( spell / 8 ) ) + 1 # 0 for first circle + spell = spell % 8 + + if item.hastag( 'circle' + str( circle ) ): + spells = int( item.gettag( 'circle' + str( circle ) ) ) + + return spells & ( 0x01 << spell ) + + return 0 # Adds the specified spell to the specified spellbook --- errorhandler.py DELETED --- |
|
From: <dar...@us...> - 2003-09-20 01:07:36
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv26302/wolfpack Modified Files: consts.py Log Message: Removed errorhandler.py Preparing for magic update. Index: consts.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/consts.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** consts.py 16 Sep 2003 18:16:56 -0000 1.24 --- consts.py 20 Sep 2003 01:07:33 -0000 1.25 *************** *** 294,299 **** LOG_MESSAGE = 0 LOG_ERROR = 1 ! LOG_WARNING = 2 ! LOG_NOTICE = 3 ! LOG_TRACE = 4 ! LOG_DEBUG = 5 --- 294,300 ---- LOG_MESSAGE = 0 LOG_ERROR = 1 ! LOG_PYTHON = 2 ! LOG_WARNING = 3 ! LOG_NOTICE = 4 ! LOG_TRACE = 5 ! LOG_DEBUG = 6 |
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv25898
Modified Files:
ai.cpp console.cpp console.h log.cpp pythonscript.cpp
pythonscript.h typedefs.h wolf.dsp
Log Message:
Fixed Memory Leaking in ai.cpp (hopefull).
Implemented advanced logging of Python Errors to the Console and the standard logfile. (Makes errorhandler.py obsolete).
Index: ai.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** ai.cpp 13 Sep 2003 13:37:15 -0000 1.19
--- ai.cpp 20 Sep 2003 01:05:09 -0000 1.20
***************
*** 225,234 ****
PyTuple_SetItem( p_args, 2, PyString_FromString( comm.latin1() ) );
! PyEval_CallObject( pFunc, p_args );
! if( PyErr_Occurred() )
! PyErr_Print();
}
}
}
}
--- 225,238 ----
PyTuple_SetItem( p_args, 2, PyString_FromString( comm.latin1() ) );
! Py_XDECREF( PyEval_CallObject( pFunc, p_args ) );
! Py_XDECREF( p_args );
!
! reportPythonError( sModule );
}
+ Py_XDECREF( pFunc );
}
+
+ Py_XDECREF( pModule );
}
}
***************
*** 258,272 ****
PyObject *p_args = PyTuple_New( 3 );
PyTuple_SetItem( p_args, 0, PyGetCharObject( m_npc ) );
PyObject *returnValue = PyObject_CallObject( pFunc, p_args );
! PyReportError();
if( returnValue == NULL || !PyFloat_Check( returnValue ) )
! return 0.0f;
else
! return PyFloat_AsDouble( returnValue );
}
}
}
}
--- 262,290 ----
PyObject *p_args = PyTuple_New( 3 );
PyTuple_SetItem( p_args, 0, PyGetCharObject( m_npc ) );
+ PyTuple_SetItem( p_args, 1, Py_None );
+ PyTuple_SetItem( p_args, 2, Py_None );
PyObject *returnValue = PyObject_CallObject( pFunc, p_args );
! Py_XDECREF( p_args );
!
! reportPythonError( sModule );
if( returnValue == NULL || !PyFloat_Check( returnValue ) )
! {
! Py_XDECREF( returnValue );
! return 1.0f;
! }
else
! {
! double result = PyFloat_AsDouble( returnValue );
! Py_XDECREF( returnValue );
! return result;
! }
}
+ Py_XDECREF( pFunc );
}
+
+ Py_XDECREF( pModule );
}
}
***************
*** 297,311 ****
PyObject *p_args = PyTuple_New( 3 );
PyTuple_SetItem( p_args, 0, PyGetCharObject( m_npc ) );
PyObject *returnValue = PyObject_CallObject( pFunc, p_args );
! PyReportError();
if( returnValue == NULL || !PyFloat_Check( returnValue ) )
return 1.0f;
else
! return PyFloat_AsDouble( returnValue );
}
}
}
}
--- 315,343 ----
PyObject *p_args = PyTuple_New( 3 );
PyTuple_SetItem( p_args, 0, PyGetCharObject( m_npc ) );
+ PyTuple_SetItem( p_args, 1, Py_None );
+ PyTuple_SetItem( p_args, 2, Py_None );
PyObject *returnValue = PyObject_CallObject( pFunc, p_args );
! Py_XDECREF( p_args );
!
! reportPythonError( sModule );
if( returnValue == NULL || !PyFloat_Check( returnValue ) )
+ {
+ Py_XDECREF( returnValue );
return 1.0f;
+ }
else
! {
! double result = PyFloat_AsDouble( returnValue );
! Py_XDECREF( returnValue );
! return result;
! }
}
+ Py_XDECREF( pFunc );
}
+
+ Py_XDECREF( pModule );
}
}
***************
*** 336,346 ****
PyObject *p_args = PyTuple_New( 3 );
PyTuple_SetItem( p_args, 0, PyGetCharObject( m_npc ) );
! PyEval_CallObject( pFunc, p_args );
! if( PyErr_Occurred() )
! PyErr_Print();
}
}
}
}
--- 368,384 ----
PyObject *p_args = PyTuple_New( 3 );
PyTuple_SetItem( p_args, 0, PyGetCharObject( m_npc ) );
+ PyTuple_SetItem( p_args, 1, Py_None );
+ PyTuple_SetItem( p_args, 2, Py_None );
! Py_XDECREF( PyEval_CallObject( pFunc, p_args ) );
! Py_XDECREF( p_args );
!
! reportPythonError( sModule );
}
+ Py_XDECREF( pFunc );
}
+
+ Py_XDECREF( pModule );
}
}
Index: console.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** console.cpp 11 Sep 2003 16:19:50 -0000 1.5
--- console.cpp 20 Sep 2003 01:05:10 -0000 1.6
***************
*** 83,87 ****
//========================================================================================
! void cConsole::log( UINT8 logLevel, const QString &message )
{
// Legacy Code
--- 83,87 ----
//========================================================================================
! void cConsole::log( UINT8 logLevel, const QString &message, bool timestamp )
{
// Legacy Code
***************
*** 91,95 ****
msg = msg.left( msg.length() - 1 );
! Log::instance()->print( (eLogLevel)logLevel, msg + "\n" );
}
--- 91,95 ----
msg = msg.left( msg.length() - 1 );
! Log::instance()->print( (eLogLevel)logLevel, msg + "\n", timestamp );
}
Index: console.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** console.h 11 Sep 2003 12:22:24 -0000 1.5
--- console.h 20 Sep 2003 01:05:10 -0000 1.6
***************
*** 88,92 ****
// Log a message
! void log( UINT8 logLevel, const QString &message );
// Get input from the console
--- 88,92 ----
// Log a message
! void log( UINT8 logLevel, const QString &message, bool timestamp = true );
// Get input from the console
Index: log.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/log.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** log.cpp 15 Sep 2003 12:49:05 -0000 1.5
--- log.cpp 20 Sep 2003 01:05:10 -0000 1.6
***************
*** 124,127 ****
--- 124,131 ----
break;
+ case LOG_PYTHON:
+ prelude.append( "PYTHON: " );
+ break;
+
default:
prelude.append( " " );
***************
*** 139,143 ****
// Send to the Console too
print( loglevel, 0, string, timestamp );
- log( loglevel, 0, string, timestamp );
}
--- 143,146 ----
***************
*** 179,182 ****
--- 182,189 ----
break;
+ case LOG_PYTHON:
+ Console::instance()->setAttributes( false, false, false, 204, 204, 153, 0, FONT_FIXEDWIDTH );
+ break;
+
default:
if( !prelude.isEmpty() )
***************
*** 185,188 ****
--- 192,200 ----
Console::instance()->send( string );
+
+ if( loglevel == LOG_PYTHON )
+ {
+ Console::instance()->ChangeColor( WPC_NORMAL );
+ }
}
Index: pythonscript.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** pythonscript.cpp 16 Sep 2003 18:15:24 -0000 1.10
--- pythonscript.cpp 20 Sep 2003 01:05:10 -0000 1.11
***************
*** 109,113 ****
PyObject* result = PyObject_CallObject( method, NULL );
! PyReportError();
Py_XDECREF( result ); // void
Py_DECREF( method );
--- 109,113 ----
PyObject* result = PyObject_CallObject( method, NULL );
! reportPythonError( name_ );
Py_XDECREF( result ); // void
Py_DECREF( method );
***************
*** 131,149 ****
setName( name );
! QString moduleName = element->text();
!
! if( moduleName.isNull() || moduleName.isEmpty() )
return false;
! codeModule = PyImport_ImportModule( const_cast<char*>(moduleName.latin1()) );
if( !codeModule )
{
Console::instance()->ProgressFail();
!
! if( PyErr_Occurred() )
! PyErr_Print();
!
! Console::instance()->send( QString( "\nError while compiling module [" + moduleName + "]\n" ) );
Console::instance()->PrepareProgress( "Continuing loading" );
return false;
--- 131,143 ----
setName( name );
! if( name.isNull() || name.isEmpty() )
return false;
! codeModule = PyImport_ImportModule( const_cast<char*>(name.latin1()) );
if( !codeModule )
{
Console::instance()->ProgressFail();
! reportPythonError( name );
Console::instance()->PrepareProgress( "Continuing loading" );
return false;
***************
*** 158,162 ****
{
PyObject* result = PyObject_CallObject( method, NULL );
! PyReportError();
Py_XDECREF( result );
}
--- 152,161 ----
{
PyObject* result = PyObject_CallObject( method, NULL );
! if( PyErr_Occurred() )
! {
! Console::instance()->ProgressFail();
! reportPythonError( name );
! Console::instance()->PrepareProgress( "Continuing loading" );
! }
Py_XDECREF( result );
}
***************
*** 429,433 ****
PyObject *returnValue = PyObject_CallObject( method, args );
! PyReportError();
Py_DECREF( args );
Py_DECREF( method );
--- 428,432 ----
PyObject *returnValue = PyObject_CallObject( method, args );
! reportPythonError( name_ );
Py_DECREF( args );
Py_DECREF( method );
***************
*** 703,707 ****
PyObject *returnValue = PyObject_CallObject( method, tuple );
! PyReportError();
Py_DECREF( tuple );
Py_DECREF( method );
--- 702,706 ----
PyObject *returnValue = PyObject_CallObject( method, tuple );
! reportPythonError( name_ );
Py_DECREF( tuple );
Py_DECREF( method );
Index: pythonscript.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** pythonscript.h 16 Sep 2003 18:15:24 -0000 1.8
--- pythonscript.h 20 Sep 2003 01:05:10 -0000 1.9
***************
*** 159,167 ****
Py_XDECREF( tuple );
Py_DECREF( method );
! if( PyErr_Occurred() )
! {
! PyErr_Print();
! PyErr_Clear();
! }
if( !returnValue )
--- 159,164 ----
Py_XDECREF( tuple );
Py_DECREF( method );
!
! reportPythonError( name_ );
if( !returnValue )
Index: typedefs.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/typedefs.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** typedefs.h 8 Sep 2003 10:58:47 -0000 1.23
--- typedefs.h 20 Sep 2003 01:05:10 -0000 1.24
***************
*** 159,162 ****
--- 159,163 ----
LOG_MESSAGE = 0,
LOG_ERROR,
+ LOG_PYTHON,
LOG_WARNING,
LOG_NOTICE,
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.235
retrieving revision 1.236
diff -C2 -d -r1.235 -r1.236
*** wolf.dsp 19 Sep 2003 22:02:41 -0000 1.235
--- wolf.dsp 20 Sep 2003 01:05:10 -0000 1.236
***************
*** 52,56 ****
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib shell32.lib /nologo /subsystem:windows /map /machine:I386 /out:"c:\wolfpack\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
# SUBTRACT LINK32 /pdb:none
--- 52,56 ----
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib shell32.lib /nologo /subsystem:windows /map /machine:I386 /out:"..\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
# SUBTRACT LINK32 /pdb:none
|
|
From: <dar...@us...> - 2003-09-20 01:05:15
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv25898/python
Modified Files:
engine.cpp engine.h utilities.h
Log Message:
Fixed Memory Leaking in ai.cpp (hopefull).
Implemented advanced logging of Python Errors to the Console and the standard logfile. (Makes errorhandler.py obsolete).
Index: engine.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/engine.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** engine.cpp 8 Sep 2003 10:58:47 -0000 1.16
--- engine.cpp 20 Sep 2003 01:05:10 -0000 1.17
***************
*** 162,163 ****
--- 162,271 ----
PyImport_ReloadModule( PyList_GetItem( mList, i ) );
}
+
+ void reportPythonError( QString moduleName )
+ {
+ // Print the Error
+ if( PyErr_Occurred() )
+ {
+ PyObject *exception, *value, *traceback;
+
+ PyErr_Fetch( &exception, &value, &traceback );
+ PyErr_NormalizeException( &exception, &value, &traceback );
+
+ // Set sys. variables for exception tracking
+ PySys_SetObject( "last_type", exception );
+ PySys_SetObject( "last_value", value );
+ PySys_SetObject( "last_traceback", traceback );
+
+ PyObject *exceptionName = PyObject_GetAttrString( exception, "__name__" );
+
+ // Do we have a detailed description of the error ?
+ PyObject *error = value != 0 ? PyObject_Str( value ) : 0;
+
+ if( !error )
+ {
+ if( !moduleName.isNull() )
+ {
+ Console::instance()->log( LOG_ERROR, QString( "An error occured while compiling \"%1\": %2" ).arg( moduleName ).arg( PyString_AsString( exceptionName ) ) );
+ }
+ else
+ {
+ Console::instance()->log( LOG_ERROR, QString( "An error occured: %1" ).arg( PyString_AsString( exceptionName ) ) );
+ }
+ }
+ else
+ {
+ if( !moduleName.isNull() )
+ {
+ Console::instance()->log( LOG_ERROR, QString( "An error occured in \"%1\": %2" ).arg( moduleName ).arg( PyString_AsString( exceptionName ) ) );
+ }
+ else
+ {
+ Console::instance()->log( LOG_ERROR, QString( "An error occured: %1" ).arg( PyString_AsString( exceptionName ) ) );
+ }
+
+ Console::instance()->log( LOG_PYTHON, QString( "%1: %2" ).arg( PyString_AsString( exceptionName ) ).arg( PyString_AsString( error ) ), false );
+ Py_XDECREF( error );
+ }
+
+ // Don't print a traceback for syntax errors
+ if( PyErr_GivenExceptionMatches( exception, PyExc_SyntaxError ) )
+ {
+ Py_XDECREF( traceback );
+ traceback = 0;
+ }
+
+ // Dump a traceback
+ while( traceback )
+ {
+ if( !PyObject_HasAttrString( traceback, "tb_frame" ) )
+ break;
+
+ PyObject *frame = PyObject_GetAttrString( traceback, "tb_frame" );
+
+ if( !PyObject_HasAttrString( frame, "f_code" ) )
+ {
+ Py_XDECREF( frame );
+ break;
+ }
+
+ PyObject *code = PyObject_GetAttrString( frame, "f_code" );
+
+ if( !PyObject_HasAttrString( code, "co_filename" ) || !PyObject_HasAttrString( code, "co_name" ) )
+ {
+ Py_XDECREF( frame );
+ Py_XDECREF( code );
+ break;
+ }
+
+ PyObject *pyFilename = PyObject_GetAttrString( code, "co_filename" );
+ PyObject *pyFunction = PyObject_GetAttrString( code, "co_name" );
+
+ QString filename = PyString_AsString( pyFilename );
+ QString function = PyString_AsString( pyFunction );
+
+ Py_XDECREF( pyFilename );
+ Py_XDECREF( pyFunction );
+
+ Py_XDECREF( code );
+ Py_XDECREF( frame );
+
+ PyObject *pyLine = PyObject_GetAttrString( traceback, "tb_lineno" );
+ unsigned int line = PyInt_AsLong( pyLine );
+ Py_XDECREF( pyLine );
+
+ // Print it
+ Console::instance()->log( LOG_PYTHON, QString( "File '%1',%2 in '%3'" ).arg( filename ).arg( line ).arg( function ), false );
+
+ // Switch Frames
+ PyObject *newtb = PyObject_GetAttrString( traceback, "tb_next" );
+ Py_XDECREF( traceback );
+ traceback = newtb;
+ }
+
+ Py_XDECREF( exceptionName );
+ Py_XDECREF( exception );
+ Py_XDECREF( value );
+ Py_XDECREF( traceback );
+ }
+ }
Index: engine.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/engine.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** engine.h 4 Aug 2003 07:28:18 -0000 1.7
--- engine.h 20 Sep 2003 01:05:10 -0000 1.8
***************
*** 38,41 ****
--- 38,42 ----
#include <qglobal.h>
+ #include <qstring.h>
//#define DEBUG_PYTHON
***************
*** 53,56 ****
--- 54,59 ----
void stopPython( void );
void startPython( int argc, char* argv[], bool silent = false );
+ void reportPythonError( QString moduleName = QString::null );
+
#endif // __PYTHON_ENGINE_H__
Index: utilities.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/utilities.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** utilities.h 9 Sep 2003 23:09:31 -0000 1.21
--- utilities.h 20 Sep 2003 01:05:10 -0000 1.22
***************
*** 34,37 ****
--- 34,38 ----
#include "engine.h"
#include "pyerrors.h"
+ #include <qstring.h>
#include "../typedefs.h"
***************
*** 63,75 ****
#define getIntProperty( identifier, property ) if( !strcmp( name, identifier ) ) return PyInt_FromLong( self->property );
#define getStrProperty( identifier, property ) if( !strcmp( name, identifier ) ) return PyString_FromString( self->property );
-
- /*!
- This function checks if there has been an error and tries to print it out.
- */
- inline void PyReportError( void )
- {
- if( PyErr_Occurred() )
- PyErr_Print();
- }
inline void wpDealloc( PyObject* self )
--- 64,67 ----
|
|
From: <dar...@us...> - 2003-09-19 22:03:13
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv28426
Modified Files:
basics.h combat.cpp wolf.dsp
Log Message:
Had to rename destroy to destroy_object because of a naming clash with std::destroy in some cases (STLPort)
Index: basics.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basics.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** basics.h 19 Sep 2003 20:41:08 -0000 1.17
--- basics.h 19 Sep 2003 22:02:41 -0000 1.18
***************
*** 86,91 ****
unsigned int getNormalizedTime();
! template<class T>
! struct destroy : std::unary_function<T, void> {
void operator()(T& d) const
{
--- 86,90 ----
unsigned int getNormalizedTime();
! template<class T> struct destroy_obj : std::unary_function<T, void> {
void operator()(T& d) const
{
Index: combat.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/combat.cpp,v
retrieving revision 1.153
retrieving revision 1.154
diff -C2 -d -r1.153 -r1.154
*** combat.cpp 17 Sep 2003 19:15:33 -0000 1.153
--- combat.cpp 19 Sep 2003 22:02:41 -0000 1.154
***************
*** 835,844 ****
if( !pDefender || pDefender->free || pDefender->isHidden() || pDefender->isDead() )
{
! pAttacker->setNextHitTime(0);
if( pDefender )
! pDefender->setAttackerSerial(INVALID_SERIAL);
! pAttacker->setCombatTarget(INVALID_SERIAL);
pAttacker->setAttackFirst( false );
!
// Reset the target
if( pAttacker->objectType() == enPlayer )
--- 835,844 ----
if( !pDefender || pDefender->free || pDefender->isHidden() || pDefender->isDead() )
{
! pAttacker->setNextHitTime( 0 );
if( pDefender )
! pDefender->setAttackerSerial( INVALID_SERIAL );
! pAttacker->setCombatTarget( INVALID_SERIAL );
pAttacker->setAttackFirst( false );
!
// Reset the target
if( pAttacker->objectType() == enPlayer )
***************
*** 852,904 ****
}
}
-
return;
}
- // Some special stuff for guards
- if( pAttacker->objectType() == enNPC && !pAttacker->inRange( pDefender, SrvParams->attack_distance() ) )
- {
- // Guards beam to their target if they are out of range
- #pragma message("reimplement with new npc ai!")
- /* if( pAttacker->npcaitype() == 4 && pDefender->inGuardedArea() )
- {
- pAttacker->removeFromView( false );
- pAttacker->moveTo( pDefender->pos() );
- pAttacker->resend( false );
-
- pAttacker->soundEffect( 0x1FE );
- pAttacker->effect( 0x372A, 0x09, 0x06 );
-
- if( RandomNum( 1, 4 ) == 1 )
- pAttacker->talk( tr("Halt, scoundrel!"), -1, 0, true );
- }
- // If we are out of close range, get out of warmode and stop fighting
- else if( pAttacker->npcaitype() != 4 )
- {
- pAttacker->setCombatTarget( INVALID_SERIAL );
- pAttacker->setSwingTarget( INVALID_SERIAL );
- pAttacker->setNextHitTime(0);
-
- P_CHAR pc = FindCharBySerial( pAttacker->attacker() );
-
- if( pc )
- {
- pc->setAttackFirst( false );
- pc->setAttackerSerial(INVALID_SERIAL);
- }
-
- pAttacker->setAttackerSerial(INVALID_SERIAL);
- pAttacker->setAttackFirst( false );
-
- // We have been at war for sure, so we can
- // update without harm
- pAttacker->setWar( false );
- pAttacker->update();
-
- return;
- }
- */
- }
-
// We have two delay-timers for attacking
// Timer for melee weapons and for
--- 852,858 ----
***************
*** 917,921 ****
--- 871,881 ----
// Only shot if our "head" can see the opponent
if( !pAttacker->pos().lineOfSight( pDefender->pos() ) )
+ {
+ /*
+ This function get's hammerd
+ Maybe a 100 ms delay would be appropiate
+ */
mayAttack = false;
+ }
}
// For other Combat Skills it's enough to stand near the opponent
***************
*** 1324,1335 ****
return;
- // pGuard->setNpcAIType( 4 );
pGuard->setAttackFirst( true );
pGuard->setAttackerSerial(pOffender->serial());
pGuard->setCombatTarget(pOffender->serial());
- // pGuard->setWanderType( enCombatTarget );
pGuard->toggleCombat();
pGuard->setNextMoveTime();
! pGuard->setSummonTime( ( uiCurrentTime + (MY_CLOCKS_PER_SEC*25) ) );
pGuard->soundEffect( 0x1FE );
--- 1284,1293 ----
return;
pGuard->setAttackFirst( true );
pGuard->setAttackerSerial(pOffender->serial());
pGuard->setCombatTarget(pOffender->serial());
pGuard->toggleCombat();
pGuard->setNextMoveTime();
! pGuard->setSummonTime( ( uiCurrentTime + (MY_CLOCKS_PER_SEC*25) ) );
pGuard->soundEffect( 0x1FE );
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.234
retrieving revision 1.235
diff -C2 -d -r1.234 -r1.235
*** wolf.dsp 19 Sep 2003 20:41:08 -0000 1.234
--- wolf.dsp 19 Sep 2003 22:02:41 -0000 1.235
***************
*** 1,23 ****
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE This is not a valid makefile. To build this project using NMAKE,
! !MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE You can specify a configuration when running NMAKE
! !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Possible choices for configuration are:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (based on "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
--- 1,23 ----
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
! !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
! !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Für die Konfiguration stehen zur Auswahl:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (basierend auf "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
!MESSAGE
***************
*** 52,56 ****
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib shell32.lib /nologo /subsystem:windows /map /machine:I386 /out:"c:\wolfpack\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
# SUBTRACT LINK32 /pdb:none
--- 52,56 ----
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib shell32.lib /nologo /subsystem:windows /map /machine:I386 /out:"c:\wolfpack\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
# SUBTRACT LINK32 /pdb:none
|
|
From: <dar...@us...> - 2003-09-19 22:03:13
|
Update of /cvsroot/wpdev/wolfpack/network
In directory sc8-pr-cvs1:/tmp/cvs-serv28426/network
Modified Files:
listener.cpp uosocket.cpp
Log Message:
Had to rename destroy to destroy_object because of a naming clash with std::destroy in some cases (STLPort)
Index: listener.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/listener.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** listener.cpp 19 Sep 2003 20:41:08 -0000 1.14
--- listener.cpp 19 Sep 2003 22:02:41 -0000 1.15
***************
*** 66,70 ****
cListener::~cListener() throw()
{
! std::for_each( readyConnections.begin(), readyConnections.end(), destroy<QSocketDevice*>() );
}
--- 66,70 ----
cListener::~cListener() throw()
{
! std::for_each( readyConnections.begin(), readyConnections.end(), destroy_obj<QSocketDevice*>() );
}
Index: uosocket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v
retrieving revision 1.293
retrieving revision 1.294
diff -C2 -d -r1.293 -r1.294
*** uosocket.cpp 19 Sep 2003 20:41:08 -0000 1.293
--- uosocket.cpp 19 Sep 2003 22:02:41 -0000 1.294
***************
*** 1868,1879 ****
}
- /* // Playervendors are invulnerable
- if( pc_i->npcaitype() == 17 )
- {
- sysMessage( tr( "%1 cannot be harmed." ).arg( pc_i->name() ) );
- send( &attack );
- return;
- }*/
-
_player->setCombatTarget( pc_i->serial() );
_player->unhide();
--- 1868,1871 ----
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv12900
Modified Files:
basics.h commands.cpp preferences.cpp preferences.h
srvparams.cpp srvparams.h srvparams_win.cpp wolf.dsp
Log Message:
reworked Preferences class, nearly complete rewrite.
some fixes, and some cosmetic changes.
Index: basics.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basics.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** basics.h 11 Sep 2003 12:22:24 -0000 1.16
--- basics.h 19 Sep 2003 20:41:08 -0000 1.17
***************
*** 40,43 ****
--- 40,45 ----
#include "platform.h"
+ #include <functional>
+
// Forward definitions
***************
*** 82,87 ****
float RandomFloatNum(float nLowNum, float nHighNum);
-
unsigned int getNormalizedTime();
#endif
--- 84,98 ----
float RandomFloatNum(float nLowNum, float nHighNum);
unsigned int getNormalizedTime();
+ template<class T>
+ struct destroy : std::unary_function<T, void> {
+ void operator()(T& d) const
+ {
+ delete d;
+ d = 0;
+ }
+ };
+
#endif
+
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.203
retrieving revision 1.204
diff -C2 -d -r1.203 -r1.204
*** commands.cpp 14 Sep 2003 16:09:01 -0000 1.203
--- commands.cpp 19 Sep 2003 20:41:08 -0000 1.204
***************
*** 61,66 ****
void cCommands::process( cUOSocket *socket, const QString &command )
{
- socket->log( QString( "Used command '%1'.\n" ).arg( command ) );
-
if( !socket->player() )
return;
--- 61,64 ----
***************
*** 82,85 ****
--- 80,84 ----
{
socket->sysMessage( tr( "Access to command '%1' was denied" ).arg( pCommand.lower() ) );
+ socket->log( QString("Access to command '%1' was denied").arg(pCommand.lower()) );
return;
}
***************
*** 87,90 ****
--- 86,90 ----
// Dispatch the command
dispatch( socket, pCommand, pArgs );
+ socket->log( QString( "Used command '%1'.\n" ).arg( command ) );
}
Index: preferences.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/preferences.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** preferences.cpp 20 May 2003 03:04:49 -0000 1.2
--- preferences.cpp 19 Sep 2003 20:41:08 -0000 1.3
***************
*** 1,98 ****
! /***************************************************************************
! preferences.cc
! -------------------
! A class to access persistant preferences for an application. Utilizes XML/DOM.
! Basic format is:
! <!DOCTYPE preferences>
! <preferences version="0.1" application="MyApp" >
! <group name="Default" >
! <option key="alpha" value="true" />
! <option key="beta" value="99" />
! <option key="gamma" value="test" />
! </group>
! </preferences>
! -------------------
! begin Tue Sep 12 2000
! author David Johnson, da...@us...
! -------------------
! Copyright 2000, David Johnson
! Please see the header file for copyright and license information
! ***************************************************************************/
!
! // version 2
!
! // TODO: fix up to account for worst case scenarios:
! // keys without values in file, and
! // checking for a key that doesn't exist puts it into the map
! // then it gets written out if dirty, possibly corrupting the file
!
! // TODO: Fix up error reporting
#include <qdom.h>
#include <qfile.h>
#include <qtextstream.h>
#include "preferences.h"
! //////////////////////////////////////////////////////////////////////////////
! // Construction //
! //////////////////////////////////////////////////////////////////////////////
! //////////////////////////////////////////////////////////////////////////////
! // Preferences()
! // -------------
! // Constructor. Takes the preferences file name as an argument.
! Preferences::Preferences(const QString& filename,
! const QString& format,
! const QString& version)
! : dirty_(false),
! currentgroup_(),
! file_(filename),
! format_(format),
! version_(version),
! filestate_(false),
! formatstate_(false),
! groups_()
{
readData();
- dirty_ = false;
- currentgroup_ = "Default";
}
- //////////////////////////////////////////////////////////////////////////////
- // ~Preferences()
- // ---------------
- // Destructor
-
Preferences::~Preferences()
{
! if (dirty_) writeData();
! }
!
! //////////////////////////////////////////////////////////////////////////////
! // Settings
! //////////////////////////////////////////////////////////////////////////////
!
! //////////////////////////////////////////////////////////////////////////////
! // getBoolean()
! // ------------
! // Get a boolean value
!
! bool Preferences::getBool(const QString& key, bool def, bool create)
! {
! buffer_ = getString(key, def ? "true" : "false", create);
! if (buffer_.isEmpty())
! {
! if ( create )
! setBool ( key, def );
! return def;
! }
! if (buffer_.contains("true"))
! return true;
! else
! return false;
}
bool Preferences::getBool( const QString& group, const QString& key, bool def, bool create)
{
--- 1,82 ----
! //==================================================================================
! //
! // Wolfpack Emu (WP)
! // UO Server Emulation Program
! //
! // Copyright 2001-2003 by holders identified in authors.txt
! // This program is free software; you can redistribute it and/or modify
! // it under the terms of the GNU General Public License as published by
! // the Free Software Foundation; either version 2 of the License, or
! // (at your option) any later version.
! //
! // This program is distributed in the hope that it will be useful,
! // but WITHOUT ANY WARRANTY; without even the implied warranty of
! // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! // GNU General Public License for more details.
! //
! // You should have received a copy of the GNU General Public License
! // along with this program; if not, write to the Free Software
! // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA.
! //
! // * In addition to that license, if you are running this program or modified
! // * versions of it on a public system you HAVE TO make the complete source of
! // * the version used by you available or provide people with a location to
! // * download it.
! //
! //
! //
! // Wolfpack Homepage: http://wpdev.sf.net/
! //==================================================================================
#include <qdom.h>
#include <qfile.h>
#include <qtextstream.h>
+ #include <qmap.h>
+ #include <qstring.h>
#include "preferences.h"
! class PreferencesPrivate
! {
! public:
! bool dirty_;
! QString currentgroup_;
! QString file_;
! QString format_;
! QString version_;
! QString buffer_;
! bool filestate_;
! bool formatstate_;
! typedef QMap<QString, QString> PrefMap;
! QMap<QString, PrefMap> groups_;
! };
! /*****************************************************************************
! Preferences member functions
! *****************************************************************************/
!
! Preferences::Preferences(const QString& filename, const QString& format, const QString& version)
! : d( new PreferencesPrivate )
{
+ d->dirty_ = false;
+ d->file_ = filename;
+ d->format_ = format;
+ d->version_ = version;
+ d->filestate_ = false;
+ d->formatstate_ = false;
readData();
}
Preferences::~Preferences()
{
! if ( d->dirty_ )
! writeData();
! delete d;
}
+ /*!
+ Get a boolean value
+ */
bool Preferences::getBool( const QString& group, const QString& key, bool def, bool create)
{
***************
*** 104,108 ****
return def;
}
! if ( buffer_.contains("true"))
return true;
else
--- 88,92 ----
return def;
}
! if ( buffer_.contains("true", false) )
return true;
else
***************
*** 110,151 ****
}
! //////////////////////////////////////////////////////////////////////////////
! // setBoolean()
! // ------------
! // Set a boolean value
!
! void Preferences::setBool(const QString& key, bool value)
! {
! groups_[currentgroup_][key] = value ? "true" : "false";
! dirty_ = true;
! }
!
void Preferences::setBool( const QString& group, const QString& key, bool value )
{
! groups_[group][key] = value ? "true" : "false";
! dirty_ = true;
! }
!
! //////////////////////////////////////////////////////////////////////////////
! // getNumber()
! // -----------
! // Get a number value
!
! // TODO: this might be a place for templates
!
! long Preferences::getNumber(const QString& key, long def, bool create)
! {
! buffer_ = getString(key, QString::number(def), create);
! if (buffer_.isEmpty())
! {
! return def;
! }
!
! bool ok;
! long num = buffer_.toLong(&ok);
! if (ok) return num;
! else return def;
}
long Preferences::getNumber(const QString& group, const QString& key, long def, bool create)
{
--- 94,109 ----
}
! /*!
! Set a boolean value
! */
void Preferences::setBool( const QString& group, const QString& key, bool value )
{
! d->groups_[group][key] = value ? "true" : "false";
! d->dirty_ = true;
}
+ /*!
+ Get a number value
+ */
long Preferences::getNumber(const QString& group, const QString& key, long def, bool create)
{
***************
*** 156,205 ****
}
! bool ok;
long num = buffer_.toLong(&ok);
! if ( ok ) return num;
! else return def;
! }
!
! //////////////////////////////////////////////////////////////////////////////
! // setNumber()
! // -----------
! // Set a number value
!
! void Preferences::setNumber(const QString& key, long value)
! {
! buffer_.setNum(value);
!
! groups_[currentgroup_][key] = buffer_;
! dirty_ = true;
}
void Preferences::setNumber( const QString& group, const QString& key, long value)
{
! QString buffer_;
! buffer_.setNum(value);
! groups_[group][key] = buffer_;
! dirty_ = true;
! }
!
! //////////////////////////////////////////////////////////////////////////////
! // getDouble()
! // -----------
! // Get a double value
!
! double Preferences::getDouble(const QString& key, double def, bool create)
! {
! buffer_ = getString(key, QString::number(def), create);
! if (buffer_.isEmpty())
! {
! return def;
! }
!
! bool ok;
! double num = buffer_.toDouble(&ok);
! if (ok) return num;
! else return def;
}
double Preferences::getDouble( const QString& group, const QString& key, double def, bool create)
{
--- 114,134 ----
}
! bool ok = false;
long num = buffer_.toLong(&ok);
! return ok ? num : def;
}
+ /*!
+ Set a number value
+ */
void Preferences::setNumber( const QString& group, const QString& key, long value)
{
! d->groups_[group][key] = QString::number( value );
! d->dirty_ = true;
}
+ /*!
+ Get a double value
+ */
double Preferences::getDouble( const QString& group, const QString& key, double def, bool create)
{
***************
*** 210,274 ****
}
! bool ok;
double num = buffer_.toDouble(&ok);
! if ( ok ) return num;
! else return def;
! }
!
!
! //////////////////////////////////////////////////////////////////////////////
! // setDouble()
! // -----------
! // Set a double value
!
! void Preferences::setDouble(const QString& key, double value)
! {
! buffer_.setNum(value);
!
! groups_[currentgroup_][key] = buffer_;
! dirty_ = true;
}
void Preferences::setDouble(const QString& group, const QString& key, double value)
{
! QString buffer_;
! buffer_.setNum(value);
!
! groups_[group][key] = buffer_;
! dirty_ = true;
! }
!
!
! //////////////////////////////////////////////////////////////////////////////
! // getString()
! // -----------
! // Get a string value
!
! QString Preferences::getString(const QString& key, const QString& def, bool create)
! {
! buffer_ = "";
! if (groups_.contains(currentgroup_)) {
! if (groups_[currentgroup_].contains(key)) {
! buffer_ = groups_[currentgroup_][key];
! }
! }
! if (buffer_.isEmpty())
! {
! if ( create )
! setString( key, def );
! return def;
! }
! return buffer_;
}
QString Preferences::getString( const QString& group, const QString& key, const QString& def, bool create )
{
! QString buffer_ = "";
! if ( groups_.contains(group) )
{
! if ( groups_[group].contains(key) )
! {
! buffer_ = groups_[group][key];
! }
}
if ( buffer_.isEmpty() )
--- 139,165 ----
}
! bool ok = false;
double num = buffer_.toDouble(&ok);
! return ok ? num : def;
}
+ /*!
+ Set a double value
+ */
void Preferences::setDouble(const QString& group, const QString& key, double value)
{
! d->groups_[group][key] = QString::number(value);
! d->dirty_ = true;
}
+ /*!
+ Get a string value
+ */
QString Preferences::getString( const QString& group, const QString& key, const QString& def, bool create )
{
! QString buffer_;
! if ( containKey( group, key ) )
{
! buffer_ = d->groups_[group][key];
}
if ( buffer_.isEmpty() )
***************
*** 281,304 ****
}
! //////////////////////////////////////////////////////////////////////////////
! // setString()
! // -----------
! // Set a string value
!
! void Preferences::setString(const QString& key, const QString& value)
! {
! groups_[currentgroup_][key] = value;
! dirty_ = true;
! }
!
void Preferences::setString(const QString& group, const QString& key, const QString& value)
{
! groups_[group][key] = value;
! dirty_ = true;
}
bool Preferences::containGroup( const QString& group ) const
{
! return groups_.contains( group );
}
--- 172,187 ----
}
! /*!
! Set a string value
! */
void Preferences::setString(const QString& group, const QString& key, const QString& value)
{
! d->groups_[group][key] = value;
! d->dirty_ = true;
}
bool Preferences::containGroup( const QString& group ) const
{
! return d->groups_.contains( group );
}
***************
*** 307,400 ****
if (!containGroup(group))
return false;
! return groups_[group].contains(key);
}
! //////////////////////////////////////////////////////////////////////////////
! // removeValue()
! // -------------
! // Remove a value from the preferences
!
! void Preferences::removeKey(const QString& key)
{
! groups_[currentgroup_].remove(key);
}
! //////////////////////////////////////////////////////////////////////////////
! // removeGroup()
! // -------------
! // Remove a group from the preferences, and all its options
!
! void Preferences::removeGroup()
{
! groups_.remove(currentgroup_);
}
! //////////////////////////////////////////////////////////////////////////////
! // flush()
! // -------
! // Flush the preferences to file
!
void Preferences::flush()
{
! if (dirty_) {
writeData();
! dirty_ = false;
}
}
- //////////////////////////////////////////////////////////////////////////////
- // Serialization //
- //////////////////////////////////////////////////////////////////////////////
-
- //////////////////////////////////////////////////////////////////////////////
- // readData()
- // ----------
- // Read data from the file
-
void Preferences::reload()
{
! dirty_ = false;
! groups_.clear();
readData();
}
void Preferences::readData()
{
// open file
! QFile* datafile = new QFile(file_);
! if (!datafile->open(IO_ReadOnly)) {
// error opening file
! qWarning("Error: cannot open preferences file " + file_);
! datafile->close();
! delete (datafile);
! filestate_ = false;
return;
}
! filestate_ = true;
// open dom document
QDomDocument doc("preferences");
! if (!doc.setContent(datafile)) {
! qWarning("Error: " + file_ + " is not a proper preferences file");
! datafile->close();
! delete (datafile);
! formatstate_ = false;
return;
}
! datafile->close();
! delete (datafile);
// check the doc type and stuff
if (doc.doctype().name() != "preferences") {
// wrong file type
! qWarning("Error: " +file_ + " is not a valid preferences file");
! formatstate_ = false;
return;
}
QDomElement root = doc.documentElement();
! if (root.attribute("application") != format_) {
// right file type, wrong application
! qWarning("Error: " + file_ + " is not a preferences file for " + format_);
! formatstate_ = false;
return;
}
--- 190,269 ----
if (!containGroup(group))
return false;
! return d->groups_[group].contains(key);
}
! /*!
! Remove a value from the preferences
! */
! void Preferences::removeKey(const QString& group, const QString& key)
{
! if ( containGroup(group) )
! d->groups_[group].remove(key);
}
! /*!
! Remove a group from the preferences, and all its options
! */
! void Preferences::removeGroup( const QString& group )
{
! d->groups_.remove(group);
}
! /*!
! Flush the preferences to file
! */
void Preferences::flush()
{
! if ( d->dirty_ ) {
writeData();
! d->dirty_ = false;
}
}
void Preferences::reload()
{
! d->dirty_ = false;
! d->groups_.clear();
readData();
}
+ /*!
+ Read data from the file
+ */
void Preferences::readData()
{
// open file
! QFile datafile(d->file_);
! if (!datafile.open(IO_ReadOnly)) {
// error opening file
! qWarning("Error: cannot open preferences file " + d->file_);
! datafile.close();
! d->filestate_ = false;
return;
}
! d->filestate_ = true;
// open dom document
QDomDocument doc("preferences");
! if (!doc.setContent(&datafile)) {
! qWarning("Error: " + d->file_ + " is not a proper preferences file");
! datafile.close();
! d->formatstate_ = false;
return;
}
! datafile.close();
// check the doc type and stuff
if (doc.doctype().name() != "preferences") {
// wrong file type
! qWarning("Error: " + d->file_ + " is not a valid preferences file");
! d->formatstate_ = false;
return;
}
QDomElement root = doc.documentElement();
! if (root.attribute("application") != d->format_) {
// right file type, wrong application
! qWarning("Error: " + d->file_ + " is not a preferences file for " + d->format_);
! d->formatstate_ = false;
return;
}
***************
*** 406,436 ****
// iterate through the groups
QDomNodeList options;
! for (unsigned n=0; n<nodes.count(); ++n) {
! if (nodes.item(n).isElement()) {
processGroup(nodes.item(n).toElement());
}
}
! formatstate_ = true;
}
! void Preferences::processGroup(QDomElement group)
{
QDomElement elem;
QDomNodeList options;
! currentgroup_ = group.attribute("name", "Default");
options = group.elementsByTagName("option");
for (unsigned n=0; n<options.count(); ++n) {
if (options.item(n).isElement()) {
elem = options.item(n).toElement();
! setString(elem.attribute("key"), elem.attribute("value"));
}
}
}
! //////////////////////////////////////////////////////////////////////////////
! // writeData()
! // -----------
! // Write data out to the file
!
void Preferences::writeData()
{
--- 275,303 ----
// iterate through the groups
QDomNodeList options;
! for ( uint n = 0; n < nodes.count(); ++n ) {
! if ( nodes.item(n).isElement() ) {
processGroup(nodes.item(n).toElement());
}
}
! d->formatstate_ = true;
}
! void Preferences::processGroup( QDomElement& group)
{
QDomElement elem;
QDomNodeList options;
! QString currentgroup_ = group.attribute("name", "Default");
options = group.elementsByTagName("option");
for (unsigned n=0; n<options.count(); ++n) {
if (options.item(n).isElement()) {
elem = options.item(n).toElement();
! setString(currentgroup_, elem.attribute("key"), elem.attribute("value"));
}
}
}
! /*!
! Write data out to the file
! */
void Preferences::writeData()
{
***************
*** 439,450 ****
// create the root element
QDomElement root = doc.createElement(doc.doctype().name());
! root.setAttribute("version", version_);
! root.setAttribute("application", format_);
// now do our options group by group
! QMap<QString, PrefMap>::Iterator git;
! PrefMap::Iterator pit;
QDomElement group, option;
! for (git = groups_.begin(); git != groups_.end(); ++git) {
// create a group element
group = doc.createElement("group");
--- 306,317 ----
// create the root element
QDomElement root = doc.createElement(doc.doctype().name());
! root.setAttribute("version", d->version_);
! root.setAttribute("application", d->format_);
// now do our options group by group
! QMap<QString, PreferencesPrivate::PrefMap>::Iterator git;
! PreferencesPrivate::PrefMap::Iterator pit;
QDomElement group, option;
! for (git = d->groups_.begin(); git != d->groups_.end(); ++git) {
// create a group element
group = doc.createElement("group");
***************
*** 462,481 ****
// open file
! QFile* datafile = new QFile(file_);
! if (!datafile->open(IO_WriteOnly)) {
// error opening file
! qWarning("Error: Cannot open preferences file " + file_);
! datafile->close();
! delete (datafile);
! filestate_ = false;
return;
}
! filestate_ = true;
// write it out
! QTextStream textstream(datafile);
doc.save(textstream, 4);
! datafile->close();
! delete (datafile);
! formatstate_ = true;
}
--- 329,353 ----
// open file
! QFile datafile(d->file_);
! if (!datafile.open(IO_WriteOnly)) {
// error opening file
! qWarning("Error: Cannot open preferences file " + d->file_);
! d->filestate_ = false;
return;
}
! d->filestate_ = true;
// write it out
! QTextStream textstream(&datafile);
doc.save(textstream, 4);
! datafile.close();
! d->formatstate_ = true;
}
+
+ const QString& Preferences::file() { return d->file_; };
+
+ const QString& Preferences::format() { return d->format_; }
+
+ bool Preferences::fileState() { return d->filestate_; }
+
+ bool Preferences::formatState() { return d->formatstate_; }
Index: preferences.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/preferences.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** preferences.h 22 Oct 2002 19:48:24 -0000 1.1
--- preferences.h 19 Sep 2003 20:41:08 -0000 1.2
***************
*** 1,58 ****
! /***************************************************************************
! preferences.h
! -------------------
! A class to access persistant preferences for an application. Utilizes XML/DOM.
! Basic format is:
! <!DOCTYPE preferences>
! <preferences version="0.1" application="MyApp" >
! <group name="Default" >
! <option key="alpha" value="true" />
! <option key="beta" value="99" />
! <option key="gamma" value="test" />
! </group>
! </preferences>
! -------------------
! begin Tue Sep 12 2000
! author David Johnson, da...@us...
! -------------------
! Copyright 2000, David Johnson
! All rights reserved.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
!
! 1. Redistributions of source code must retain the above copyright notice, this
! list of conditions and the following disclaimer.
!
! 2. Redistributions in binary form must reproduce the above copyright notice,
! this list of conditions and the following disclaimer in the documentation
! and/or other materials provided with the distribution.
!
! 3. Neither name of the copyright holders nor the names of its contributors may
! be used to endorse or promote products derived from this software without
! specific prior written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
! FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
! SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
! ***************************************************************************/
!
! // version 2
#ifndef PREFERENCES_H
#define PREFERENCES_H
- #include <qstring.h>
- #include <qmap.h>
-
- class QColor;
class QDomElement;
class Preferences {
--- 1,38 ----
! //==================================================================================
! //
! // Wolfpack Emu (WP)
! // UO Server Emulation Program
! //
! // Copyright 2001-2003 by holders identified in authors.txt
! // This program is free software; you can redistribute it and/or modify
! // it under the terms of the GNU General Public License as published by
! // the Free Software Foundation; either version 2 of the License, or
! // (at your option) any later version.
! //
! // This program is distributed in the hope that it will be useful,
! // but WITHOUT ANY WARRANTY; without even the implied warranty of
! // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! // GNU General Public License for more details.
! //
! // You should have received a copy of the GNU General Public License
! // along with this program; if not, write to the Free Software
! // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA.
! //
! // * In addition to that license, if you are running this program or modified
! // * versions of it on a public system you HAVE TO make the complete source of
! // * the version used by you available or provide people with a location to
! // * download it.
! //
! //
! //
! // Wolfpack Homepage: http://wpdev.sf.net/
! //==================================================================================
#ifndef PREFERENCES_H
#define PREFERENCES_H
class QDomElement;
+ class QString;
+ class PreferencesPrivate;
class Preferences {
***************
*** 72,104 ****
bool formatState();
- // group settings
- const QString& getGroup();
- void setGroup(const QString& group);
-
// boolean data storage
- bool getBool(const QString& key, bool def = false, bool create = false);
bool getBool(const QString& group, const QString& key, bool def = false, bool create = false);
- void setBool(const QString& key, bool value);
void setBool(const QString& group, const QString& key, bool value);
// integer data storage
- long getNumber(const QString& key, long def = 0, bool create = false);
long getNumber(const QString& group, const QString& key, long def, bool create = false);
- void setNumber(const QString& key, long value);
void setNumber( const QString& group, const QString& key, long value);
// double data storage
- double getDouble(const QString& key, double def = 0.0, bool create = false);
double getDouble(const QString& group, const QString& key, double def = 0.0, bool create = false);
- void setDouble(const QString& key, double value);
void setDouble(const QString& group, const QString& key, double value);
// string data storage
- QString getString(const QString& key, const QString& def = "NULL", bool create = false);
QString getString(const QString& group, const QString& key, const QString& def, bool create = false);
- void setString(const QString& key, const QString& value);
void setString(const QString& group, const QString& key, const QString& value);
// remove a key/value from the preferences
! void removeKey(const QString& key);
// remove the current group from the preferences
! void removeGroup();
bool containKey( const QString& group, const QString& key ) const;
bool containGroup( const QString& group ) const;
--- 52,72 ----
bool formatState();
// boolean data storage
bool getBool(const QString& group, const QString& key, bool def = false, bool create = false);
void setBool(const QString& group, const QString& key, bool value);
// integer data storage
long getNumber(const QString& group, const QString& key, long def, bool create = false);
void setNumber( const QString& group, const QString& key, long value);
// double data storage
double getDouble(const QString& group, const QString& key, double def = 0.0, bool create = false);
void setDouble(const QString& group, const QString& key, double value);
// string data storage
QString getString(const QString& group, const QString& key, const QString& def, bool create = false);
void setString(const QString& group, const QString& key, const QString& value);
// remove a key/value from the preferences
! void removeKey(const QString& group, const QString& key);
// remove the current group from the preferences
! void removeGroup( const QString& group );
bool containKey( const QString& group, const QString& key ) const;
bool containGroup( const QString& group ) const;
***************
*** 112,145 ****
void readData();
void writeData();
! void processGroup(QDomElement group);
private:
! bool dirty_;
! QString currentgroup_;
! QString file_;
! QString format_;
! QString version_;
! QString buffer_;
! bool filestate_;
! bool formatstate_;
!
! typedef QMap<QString, QString> PrefMap;
! QMap<QString, PrefMap> groups_;
};
-
- //////////////////////////////////////////////////////////////////////////////
- // Inline methods
-
- inline const QString& Preferences::file() { return file_; };
-
- inline const QString& Preferences::format() { return format_; }
-
- inline bool Preferences::fileState() { return filestate_; }
-
- inline bool Preferences::formatState() { return formatstate_; }
-
- inline void Preferences::setGroup(const QString& group) { currentgroup_ = group; }
-
- inline const QString& Preferences::getGroup() { return currentgroup_; }
#endif // PREFERENCES
--- 80,88 ----
void readData();
void writeData();
! void processGroup(QDomElement& group);
private:
! PreferencesPrivate* d;
};
#endif // PREFERENCES
Index: srvparams.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/srvparams.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -d -r1.89 -r1.90
*** srvparams.cpp 15 Sep 2003 12:49:05 -0000 1.89
--- srvparams.cpp 19 Sep 2003 20:41:08 -0000 1.90
***************
*** 29,36 ****
//==================================================================================
- #ifndef __unix__
- #include "winsock.h"
- #endif
-
#include "srvparams.h"
#include "globals.h"
--- 29,32 ----
***************
*** 47,56 ****
const char preferencesFileVersion[] = "1.0";
! #ifdef __unix__
! #include <arpa/inet.h>
! #include <sys/types.h>
! #include <sys/socket.h>
! #include <netinet/in.h>
! #include <netdb.h>
#endif
--- 43,54 ----
const char preferencesFileVersion[] = "1.0";
! #if defined( Q_OS_WIN32 )
! # include <winsock.h>
! #elif defined ( Q_OS_UNIX )
! # include <arpa/inet.h>
! # include <sys/types.h>
! # include <sys/socket.h>
! # include <netinet/in.h>
! # include <netdb.h>
#endif
***************
*** 230,239 ****
if ( startLocation_.empty() ) // Empty? Try to load
{
- setGroup("StartLocation");
bool bKeepLooping = true;
unsigned int i = 1;
do
{
! QString tmp = getString(QString("Location %1").arg(i++), "").simplifyWhiteSpace();
bKeepLooping = ( tmp != "" );
if ( bKeepLooping ) // valid data.
--- 228,236 ----
if ( startLocation_.empty() ) // Empty? Try to load
{
bool bKeepLooping = true;
unsigned int i = 1;
do
{
! QString tmp = getString("StartLocation", QString("Location %1").arg(i++), "").simplifyWhiteSpace();
bKeepLooping = ( tmp != "" );
if ( bKeepLooping ) // valid data.
***************
*** 332,335 ****
--- 329,338 ----
{
return worldCurrentLevel_;
+ }
+
+ void cSrvParams::guardsActive(bool enabled)
+ {
+ guardsActive_ = enabled;
+ setBool("General", "Guards Enabled", enabled);
}
Index: srvparams.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/srvparams.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** srvparams.h 15 Sep 2003 12:49:05 -0000 1.57
--- srvparams.h 19 Sep 2003 20:41:08 -0000 1.58
***************
*** 40,51 ****
#include "structs.h"
#include "coord.h"
-
- // Library Headers
- #include "qstring.h"
#include "preferences.h"
- #include "qstringlist.h"
! // Forward Declarations
! class Preferences;
// Structs
--- 40,48 ----
#include "structs.h"
#include "coord.h"
#include "preferences.h"
! // Library Headers
! #include <qstring.h>
! #include <qstringlist.h>
// Structs
***************
*** 341,350 ****
{
return guardsActive_;
- }
-
- inline void cSrvParams::guardsActive(bool enabled)
- {
- guardsActive_ = enabled;
- setBool("General" "Guards Enabled", enabled);
}
--- 338,341 ----
Index: srvparams_win.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/srvparams_win.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** srvparams_win.cpp 20 Aug 2003 23:19:43 -0000 1.10
--- srvparams_win.cpp 19 Sep 2003 20:41:08 -0000 1.11
***************
*** 31,34 ****
--- 31,35 ----
#include "srvparams.h"
#include "globals.h"
+ #include "console.h"
// Qt Includes
***************
*** 51,55 ****
const char* Registry3d = "Software\\Origin Worlds Online\\Ultima Online Third Dawn\\1.0";
const char* Registry2d = "Software\\Origin Worlds Online\\Ultima Online\\1.0";
! unsigned char exePath[MAX_PATH];
unsigned long pathLen;
--- 52,56 ----
const char* Registry3d = "Software\\Origin Worlds Online\\Ultima Online Third Dawn\\1.0";
const char* Registry2d = "Software\\Origin Worlds Online\\Ultima Online\\1.0";
! unsigned char exePath[MAX_PATH] = {0,};
unsigned long pathLen;
***************
*** 57,68 ****
// Look for 3D Client Path
! if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, Registry3d, 0, KEY_READ, &tempKey ) == ERROR_SUCCESS )
{
! if( RegQueryValueEx( tempKey, "ExePath", 0, 0, &exePath[0], &pathLen ) == ERROR_SUCCESS )
{
// We found a valid registry key
RegCloseKey( tempKey );
! QString path = (char*)&exePath;
path = path.left( path.findRev( "\\" ) + 1 );
return path;
--- 58,69 ----
// Look for 3D Client Path
! if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, Registry3d, 0, KEY_READ, &tempKey ) == ERROR_SUCCESS )
{
! if( RegQueryValueExA( tempKey, "ExePath", 0, 0, &exePath[0], &pathLen ) == ERROR_SUCCESS )
{
// We found a valid registry key
RegCloseKey( tempKey );
! QString path((char*)&exePath);
path = path.left( path.findRev( "\\" ) + 1 );
return path;
***************
*** 72,83 ****
// Look for 2D Client Path
! if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, Registry2d, 0, KEY_READ, &tempKey ) == ERROR_SUCCESS )
{
! if( RegQueryValueEx( tempKey, "ExePath", 0, 0, &exePath[0], &pathLen ) == ERROR_SUCCESS )
{
// We found a valid registry key
RegCloseKey( tempKey );
! QString path = (char*)&exePath;
path = path.left( path.findRev( "\\" ) + 1 );
return path;
--- 73,84 ----
// Look for 2D Client Path
! if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, Registry2d, 0, KEY_READ, &tempKey ) == ERROR_SUCCESS )
{
! if( RegQueryValueExA( tempKey, "ExePath", 0, 0, &exePath[0], &pathLen ) == ERROR_SUCCESS )
{
// We found a valid registry key
RegCloseKey( tempKey );
! QString path((char*)&exePath);
path = path.left( path.findRev( "\\" ) + 1 );
return path;
***************
*** 100,105 ****
if( !thePath.exists() || thePath.entryList("*.mul").isEmpty() )
{
QString uoPath(getUOPath());
! if( uoPath != QString::null )
{
//mulPath_ = uoPath;
--- 101,107 ----
if( !thePath.exists() || thePath.entryList("*.mul").isEmpty() )
{
+ Console::instance()->log( LOG_WARNING, QString("UO Mul files not found at '%1', trying to locate...\n").arg(mulPath_));
QString uoPath(getUOPath());
! if( !uoPath.isEmpty() )
{
//mulPath_ = uoPath;
***************
*** 108,112 ****
}
else
! qWarning( "Unable to find *.mul files path. Please check wolfpack.xml, section \"General\", key \"MulPath\"" );
}
return mulPath_;
--- 110,114 ----
}
else
! Console::instance()->log( LOG_ERROR, "Unable to find *.mul files path. Please check wolfpack.xml, section \"General\", key \"MulPath\"");
}
return mulPath_;
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.233
retrieving revision 1.234
diff -C2 -d -r1.233 -r1.234
*** wolf.dsp 17 Sep 2003 19:15:34 -0000 1.233
--- wolf.dsp 19 Sep 2003 20:41:08 -0000 1.234
***************
*** 43,47 ****
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MD /GR /GX /O2 /I "lib/Python/PC" /I "sqlite" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
--- 43,47 ----
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MD /GR /GX /O2 /I "lib/Python/PC" /I "sqlite" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "QT_DLL" /D "QT_NO_STL" /D "QT_THREAD_SUPPORT" /D "MYSQL_DRIVER" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
***************
*** 52,56 ****
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib shell32.lib /nologo /subsystem:windows /map /machine:I386 /out:"Release\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
# SUBTRACT LINK32 /pdb:none
--- 52,56 ----
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib shell32.lib /nologo /subsystem:windows /map /machine:I386 /out:"c:\wolfpack\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
# SUBTRACT LINK32 /pdb:none
***************
*** 64,68 ****
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
! # PROP Output_Dir "C:\Software Engineering\wolfpack\"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
--- 64,68 ----
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
! # PROP Output_Dir "C:\wolfpack\"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
***************
*** 77,81 ****
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt320.lib shell32.lib /nologo /version:12.9 /subsystem:windows /map /debug /machine:I386 /out:"C:\Software Engineering\wolfpack\wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
--- 77,81 ----
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib shell32.lib /nologo /version:12.9 /subsystem:windows /map /debug /machine:I386 /out:"C:\wolfpack\wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
***************
*** 404,436 ****
SOURCE=.\commands.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
# PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing commands.h...
- InputDir=.
- InputPath=.\commands.h
- InputName=commands
-
- "$(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 commands.h...
- InputDir=.
- InputPath=.\commands.h
- InputName=commands
-
- "$(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
--- 404,408 ----
***************
*** 1162,1178 ****
# PROP Default_Filter ""
- # Begin Source File
-
- SOURCE=.\moc_commands.cpp
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
- !ELSEIF "$(CFG)" == "wolf - Win32 Debug"
-
- # ADD CPP /GR
-
- !ENDIF
-
- # End Source File
# Begin Source File
--- 1134,1137 ----
|
|
From: <thi...@us...> - 2003-09-19 20:41:14
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv12900/python
Modified Files:
global.cpp
Log Message:
reworked Preferences class, nearly complete rewrite.
some fixes, and some cosmetic changes.
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -C2 -d -r1.92 -r1.93
*** global.cpp 13 Sep 2003 13:08:41 -0000 1.92
--- global.cpp 19 Sep 2003 20:41:08 -0000 1.93
***************
*** 1417,1504 ****
/*!
! Reads a boolean value from wolfpack.xml
! */
static PyObject *wpSettingsGetBool( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! if( !checkArgStr( 0 ) && !checkArgStr( 1 ) && !checkArgInt( 2 ) )
! {
! PyErr_BadArgument();
return 0;
- }
! return PyInt_FromLong( SrvParams->getBool( getArgStr(0), getArgStr(1), getArgInt(2) ) );
}
/*!
! Writes a boolean value to wolfpack.xml
*/
static PyObject *wpSettingsSetBool( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! if ( !checkArgStr(0) && !checkArgStr( 1 ) && !checkArgInt( 2 ) )
! {
! PyErr_BadArgument();
! return PyFalse;
! }
! SrvParams->setBool( getArgStr(0), getArgStr(1), getArgInt(2) );
return PyTrue;
}
/*!
! Reads a numeric value from wolfpack.xml
! */
static PyObject *wpSettingsGetNumber( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! if( !checkArgStr( 0 ) && !checkArgStr( 1 ) && !checkArgInt( 2 ) )
! {
! PyErr_BadArgument();
return 0;
! }
! return PyInt_FromLong( SrvParams->getNumber( getArgStr(0), getArgStr(1), getArgInt(2) ) );
}
/*!
! Writes a boolean value to wolfpack.xml
*/
static PyObject *wpSettingsSetNumber( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! if ( !checkArgStr(0) && !checkArgStr( 1 ) && !checkArgInt( 2 ) )
! {
! PyErr_BadArgument();
! return PyFalse;
! }
! SrvParams->setNumber( getArgStr(0), getArgStr(1), getArgInt(2) );
return PyTrue;
}
/*!
! Reads a numeric value from wolfpack.xml
! */
static PyObject *wpSettingsGetString( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! if( !checkArgStr( 0 ) && !checkArgStr( 1 ) && !checkArgStr( 2 ) )
! {
! PyErr_BadArgument();
return 0;
! }
! return PyString_FromString( SrvParams->getString( getArgStr(0), getArgStr(1), getArgStr(2) ) );
}
/*!
! Writes a boolean value to wolfpack.xml
*/
static PyObject *wpSettingsSetString( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! if ( !checkArgStr(0) && !checkArgStr( 1 ) && !checkArgStr( 2 ) )
! {
! PyErr_BadArgument();
! return PyFalse;
! }
! SrvParams->setString( getArgStr(0), getArgStr(1), getArgStr(2) );
return PyTrue;
}
--- 1417,1520 ----
/*!
! Reads the boolean entry specified by key and group.
! The key is created if it doesn't exist, using the default argument.
! If an error occurs the settings are left unchanged and FALSE is returned;
! otherwise TRUE is returned
! */
static PyObject *wpSettingsGetBool( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! char *pyGroup, *pyKey, pyDef, create = 0;
! if ( !PyArg_ParseTuple(args, "ssb|b:getBool(group, key, default, create)", &pyGroup, &pyKey, &pyDef, &create ) )
return 0;
! return SrvParams->getBool( pyGroup, pyKey, pyDef, create ) ? PyTrue : PyFalse;
}
/*!
! Writes the boolean entry value into specified key and group.
! The key is created if it doesn't exist. Any previous value is overwritten by value.
! If an error occurs the settings are left unchanged and FALSE is returned;
! otherwise TRUE is returned
*/
static PyObject *wpSettingsSetBool( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! char *pyGroup, *pyKey, pyValue;
! if ( !PyArg_ParseTuple(args, "ssb:setBool(group, key, value)", &pyGroup, &pyKey, &pyValue ) )
! return 0;
!
! SrvParams->setBool( pyGroup, pyKey, pyValue );
return PyTrue;
}
/*!
! Reads the numeric entry specified by key and group.
! The key is created if it doesn't exist using the default argument, provided
! that \a create argument is true.
! If an error occurs the settings are left unchanged and FALSE is returned;
! otherwise TRUE is returned
! */
static PyObject *wpSettingsGetNumber( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! char *pyGroup, *pyKey, create = 0;
! int pyDef;
! if ( !PyArg_ParseTuple(args, "ssi|b:getNumber(group, key, default, create)", &pyGroup, &pyKey, &pyDef, &create ) )
return 0;
!
! return PyInt_FromLong( SrvParams->getNumber( pyGroup, pyKey, pyDef, create ) );
}
/*!
! Writes the numeric entry value into specified key and group.
! The key is created if it doesn't exist. Any previous value is overwritten by value.
! If an error occurs the settings are left unchanged and FALSE is returned;
! otherwise TRUE is returned
*/
static PyObject *wpSettingsSetNumber( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! char *pyGroup, *pyKey;
! int pyValue;
! if ( !PyArg_ParseTuple(args, "ssi:setNumber(group, key, value)", &pyGroup, &pyKey, &pyValue ) )
! return 0;
!
! SrvParams->setNumber( pyGroup, pyKey, pyValue );
return PyTrue;
}
/*!
! getString( group, key, default, create )
! Reads the string entry specified by key and group.
! The key is created if it doesn't exist using the default argument, provided that
! \a create argument is true.
! If an error occurs the settings are left unchanged and FALSE is returned;
! otherwise TRUE is returned
! */
static PyObject *wpSettingsGetString( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! char *pyGroup, *pyKey, *pyDef, create = 0;
! if ( !PyArg_ParseTuple(args, "sss|b:getString(group, key, default, create)", &pyGroup, &pyKey, &pyDef, &create ) )
return 0;
!
! return PyString_FromString( SrvParams->getString( pyGroup, pyKey, pyDef, create ) );
}
/*!
! Writes the string entry value into specified key and group.
! The key is created if it doesn't exist. Any previous value is overwritten by value.
! If an error occurs the settings are left unchanged and FALSE is returned;
! otherwise TRUE is returned
*/
static PyObject *wpSettingsSetString( PyObject* self, PyObject* args )
{
Q_UNUSED(self);
! char *pyGroup, *pyKey, *pyValue;
! if ( !PyArg_ParseTuple(args, "sss:setString(group, key, value)", &pyGroup, &pyKey, &pyValue ) )
! return 0;
!
! SrvParams->setString( pyGroup, pyKey, pyValue );
return PyTrue;
}
|