wpdev-commits Mailing List for Wolfpack Emu (Page 62)
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: Jorge P. <ke...@us...> - 2004-08-24 17:18:46
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12217 Modified Files: circle1.py circle2.py circle3.py circle4.py circle5.py circle6.py circle7.py firefield.py nightsight.py poisonfield.py scroll.py spell.py spellbook.py trap.py utilities.py Log Message: Replaced direct access to .events with hasevent(), removeevent() and addevent(), as appropriate. Index: circle4.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle4.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** circle4.py 25 Jul 2004 22:59:08 -0000 1.11 --- circle4.py 24 Aug 2004 17:18:26 -0000 1.12 *************** *** 127,131 **** # We can only recall from recall runes ! if not 'magic.rune' in target.events: char.message(502357) return --- 127,131 ---- # We can only recall from recall runes ! if not target.hasevent( 'magic.rune' ): char.message(502357) return *************** *** 219,223 **** newitem.settag('dispellable_field', 1) newitem.settag('source', char.serial) ! newitem.events = ['magic.firefield'] newitem.update() serials.append(newitem.serial) --- 219,223 ---- newitem.settag('dispellable_field', 1) newitem.settag('source', char.serial) ! newitem.addevent( 'magic.firefield' ) newitem.update() serials.append(newitem.serial) Index: nightsight.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/nightsight.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** nightsight.py 19 Jul 2004 20:13:12 -0000 1.4 --- nightsight.py 24 Aug 2004 17:18:26 -0000 1.5 *************** *** 14,22 **** player.lightbonus = max(0, player.lightbonus - bonus) ! events = player.events ! while 'magic.nightsight' in events: ! events.remove('magic.nightsight') ! player.events = events ! player.deltag('nightsight') player.deltag('nightsight_start') --- 14,18 ---- player.lightbonus = max(0, player.lightbonus - bonus) ! player.removeevent('magic.nightsight') player.deltag('nightsight') player.deltag('nightsight_start') Index: circle6.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle6.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** circle6.py 2 Aug 2004 22:11:56 -0000 1.9 --- circle6.py 24 Aug 2004 17:18:26 -0000 1.10 *************** *** 116,120 **** # We can only mark recall runes ! if not 'magic.rune' in target.events: char.message(501797) return --- 116,120 ---- # We can only mark recall runes ! if not target.hasevent( 'magic.rune' ): char.message(501797) return *************** *** 220,224 **** newitem.settag('dispellable_field', 1) newitem.settag('strength', char.skill[self.damageskill]) ! newitem.events = ['magic.paralyzefield'] newitem.update() serials.append(newitem.serial) --- 220,224 ---- newitem.settag('dispellable_field', 1) newitem.settag('strength', char.skill[self.damageskill]) ! newitem.addevent( 'magic.paralyzefield' ) newitem.update() serials.append(newitem.serial) Index: spell.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/spell.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** spell.py 12 Aug 2004 19:13:49 -0000 1.14 --- spell.py 24 Aug 2004 17:18:26 -0000 1.15 *************** *** 40,46 **** def callback(char, args): ! eventlist = char.events ! eventlist.remove('magic') ! char.events = eventlist # target --- 40,44 ---- def callback(char, args): ! char.removeevent('magic') # target *************** *** 103,107 **** # def precast(self, char, mode=0, args=[], target = None, item = None): - eventlist = char.events socket = char.socket --- 101,104 ---- *************** *** 120,124 **** # We are already casting a spell ! if 'magic' in eventlist or (socket and socket.hastag('cast_target')): char.socket.clilocmessage(502642) return 0 --- 117,121 ---- # We are already casting a spell ! if char.hasevent('magic') or (socket and socket.hastag('cast_target')): char.socket.clilocmessage(502642) return 0 *************** *** 140,144 **** # Precasting ! char.events = ['magic'] + eventlist char.action(self.castaction) --- 137,141 ---- # Precasting ! char.addevent('magic') char.action(self.castaction) Index: circle7.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle7.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** circle7.py 2 Aug 2004 22:25:59 -0000 1.11 --- circle7.py 24 Aug 2004 17:18:26 -0000 1.12 *************** *** 140,144 **** # We can only recall from recall runes ! if not 'magic.rune' in target.events: char.message(502357) return --- 140,144 ---- # We can only recall from recall runes ! if not target.hasevent( 'magic.rune' ): char.message(502357) return *************** *** 185,189 **** gate.moveto(char.pos) gate.settag('dispellable_field', 1) ! gate.events = ['magic.gate'] gate.settag('target', target.gettag('location')) gate.direction = 9 --- 185,189 ---- gate.moveto(char.pos) gate.settag('dispellable_field', 1) ! gate.addevent( 'magic.gate' ) gate.settag('target', target.gettag('location')) gate.direction = 9 *************** *** 197,201 **** gate.settag('target', '%u,%u,%d,%u' % (char.pos.x, char.pos.y, char.pos.z, char.pos.map)) gate.settag('dispellable_field', 1) ! gate.events = ['magic.gate'] gate.direction = 9 gate.update() --- 197,201 ---- gate.settag('target', '%u,%u,%d,%u' % (char.pos.x, char.pos.y, char.pos.z, char.pos.map)) gate.settag('dispellable_field', 1) ! gate.addevent( 'magic.gate' ) gate.direction = 9 gate.update() Index: circle1.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle1.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** circle1.py 25 Jul 2004 22:59:08 -0000 1.10 --- circle1.py 24 Aug 2004 17:18:25 -0000 1.11 *************** *** 118,122 **** return 0 ! if 'magic.nightsight' in target.events: if char.socket: if char == target: --- 118,122 ---- return 0 ! if target.hasevent( 'magic.nightsight' ): if char.socket: if char == target: *************** *** 136,140 **** bonus = min(18, math.floor(18 * (char.skill[MAGERY] / 1000.0))) ! target.events = ['magic.nightsight'] + target.events target.settag("nightsight", bonus) target.settag("nightsight_start", time.minutes()) --- 136,140 ---- bonus = min(18, math.floor(18 * (char.skill[MAGERY] / 1000.0))) ! target.addevent( 'magic.nightsight' ) target.settag("nightsight", bonus) target.settag("nightsight_start", time.minutes()) Index: scroll.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/scroll.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** scroll.py 22 Jul 2004 17:22:06 -0000 1.5 --- scroll.py 24 Aug 2004 17:18:26 -0000 1.6 *************** *** 50,54 **** return False ! if ( 'magic.spellbook' in cont.events ): if spell >= 64: char.socket.sysmessage( "Scroll with invalid spell-id: %d" % spell ) --- 50,54 ---- return False ! if cont.hasevent( 'magic.spellbook' ): if spell >= 64: char.socket.sysmessage( "Scroll with invalid spell-id: %d" % spell ) Index: poisonfield.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/poisonfield.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** poisonfield.py 19 Jul 2004 21:07:36 -0000 1.4 --- poisonfield.py 24 Aug 2004 17:18:26 -0000 1.5 *************** *** 30,34 **** for item in items: ! if 'magic.poisonfield' in item.events: level = 0 if item.hastag('level'): --- 30,34 ---- for item in items: ! if item.hasevent( 'magic.poisonfield' ): level = 0 if item.hastag('level'): Index: circle3.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle3.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** circle3.py 22 Jul 2004 17:22:06 -0000 1.7 --- circle3.py 24 Aug 2004 17:18:26 -0000 1.8 *************** *** 123,127 **** # We can only lock unlocked chests ! if target.type != 1 or 'lock' in target.events or target.container: char.message(501762) return --- 123,127 ---- # We can only lock unlocked chests ! if target.type != 1 or target.hasevent( 'lock' ) or target.container: char.message(501762) return *************** *** 135,142 **** return ! events = target.events ! events.append('lock') ! target.events = events ! target.settag('lock', 'magic') --- 135,139 ---- return ! target.addevent( 'lock' ) target.settag('lock', 'magic') *************** *** 156,160 **** # We can only lock unlocked chests ! if not 'lock' in target.events: char.message(503101) return --- 153,157 ---- # We can only lock unlocked chests ! if not target.hasevent( 'lock' ): char.message(503101) return *************** *** 167,174 **** return ! events = target.events ! events.remove('lock') ! target.events = events ! target.deltag('lock', 'magic') --- 164,168 ---- return ! target.removeevent( 'lock' ) target.deltag('lock', 'magic') Index: firefield.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/firefield.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** firefield.py 19 Jul 2004 21:07:36 -0000 1.5 --- firefield.py 24 Aug 2004 17:18:26 -0000 1.6 *************** *** 27,31 **** for item in items: ! if 'magic.firefield' in item.events: source = None if item.hastag('source'): --- 27,31 ---- for item in items: ! if item.hasevent( 'magic.firefield' ): source = None if item.hastag('source'): Index: circle5.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle5.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** circle5.py 9 Aug 2004 18:51:38 -0000 1.14 --- circle5.py 24 Aug 2004 17:18:26 -0000 1.15 *************** *** 301,305 **** newitem.settag('dispellable_field', 1) newitem.settag('level', level) ! newitem.events = ['magic.poisonfield'] newitem.update() serials.append(newitem.serial) --- 301,305 ---- newitem.settag('dispellable_field', 1) newitem.settag('level', level) ! newitem.addevent( 'magic.poisonfield' ) newitem.update() serials.append(newitem.serial) Index: utilities.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/utilities.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** utilities.py 7 Aug 2004 04:02:53 -0000 1.10 --- utilities.py 24 Aug 2004 17:18:26 -0000 1.11 *************** *** 52,59 **** char.dispel(char, 1, "cast_delay") ! eventlist = char.events ! if 'magic' in eventlist: ! eventlist.remove('magic') ! char.events = eventlist if char.socket: --- 52,56 ---- char.dispel(char, 1, "cast_delay") ! char.removeevent('magic') if char.socket: Index: spellbook.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/spellbook.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** spellbook.py 20 Jul 2004 20:55:13 -0000 1.8 --- spellbook.py 24 Aug 2004 17:18:26 -0000 1.9 *************** *** 79,83 **** def hasspell( item, spell ): if item and ( item.hasevent( 'magic.spellbook' ) or item.hasevent( 'magic.necrospellbook' ) ): ! if 'magic.necrospellbook' in item.events: spell = spell - 100 --- 79,83 ---- def hasspell( item, spell ): if item and ( item.hasevent( 'magic.spellbook' ) or item.hasevent( 'magic.necrospellbook' ) ): ! if item.hasevent( 'magic.necrospellbook' ): spell = spell - 100 *************** *** 106,110 **** # Adds the specified spell to the specified spellbook def addspell( item, spell ): ! if not item or not 'magic.spellbook' in item.events: return 0 --- 106,110 ---- # Adds the specified spell to the specified spellbook def addspell( item, spell ): ! if not item or not item.hasevent( 'magic.spellbook' ): return 0 *************** *** 127,131 **** # Removes the specified spell from the specified spellbook def removespell( item, spell ): ! if not item or not 'magic.spellbook' in item.events: return 0 --- 127,131 ---- # Removes the specified spell from the specified spellbook def removespell( item, spell ): ! if not item or not item.hasevent( 'magic.spellbook' ): return 0 *************** *** 149,157 **** spell = args[0] ! if not target.item or not 'magic.spellbook' in target.item.events: char.socket.sysmessage( 'You need to target a spellbook.' ) return - item = target.item if spell == 'all': --- 149,158 ---- spell = args[0] ! item = target.item ! ! if not item or not item.hasevent( 'magic.spellbook' ): char.socket.sysmessage( 'You need to target a spellbook.' ) return if spell == 'all': *************** *** 174,183 **** spell = args[0] ! if not target.item or not 'magic.spellbook' in target.item.events: char.socket.sysmessage( 'You need to target a spellbook.' ) return - item = target.item - if spell == 'all': for i in range( 1, 9 ): --- 175,184 ---- spell = args[0] ! item = target.item ! ! if not item or not item.hasevent( 'magic.spellbook' ): char.socket.sysmessage( 'You need to target a spellbook.' ) return if spell == 'all': for i in range( 1, 9 ): Index: trap.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/trap.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** trap.py 19 Jul 2004 21:07:36 -0000 1.5 --- trap.py 24 Aug 2004 17:18:26 -0000 1.6 *************** *** 14,35 **** owner = wolfpack.findchar(int(item.gettag('trap_owner'))) except: item.deltag('trap_type') item.deltag('trap_damage') item.deltag('trap_owner') - events = item.events - while 'magic.trap' in events: - events.remove('magic.trap') - item.events = events return 0 item.deltag('trap_type') item.deltag('trap_damage') item.deltag('trap_owner') - events = item.events - while 'magic.trap' in events: - events.remove('magic.trap') - item.events = events - char.message(502999) --- 14,28 ---- owner = wolfpack.findchar(int(item.gettag('trap_owner'))) except: + item.removeevent( 'magic.trap' ) item.deltag('trap_type') item.deltag('trap_damage') item.deltag('trap_owner') return 0 + item.removeevent( 'magic.trap' ) item.deltag('trap_type') item.deltag('trap_damage') item.deltag('trap_owner') char.message(502999) Index: circle2.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle2.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** circle2.py 25 Jul 2004 22:59:08 -0000 1.8 --- circle2.py 24 Aug 2004 17:18:26 -0000 1.9 *************** *** 93,97 **** target.settag('trap_damage', random.randint(10, 50)) target.settag('trap_type', 'magic') ! target.events = target.events + ['magic.trap'] class RemoveTrap (Spell): --- 93,98 ---- target.settag('trap_damage', random.randint(10, 50)) target.settag('trap_type', 'magic') ! target.addevent( 'magic.trap' ) ! class RemoveTrap (Spell): *************** *** 109,113 **** # Already Trapped? ! if not'magic.trap' in target.events: fizzle(char) return --- 110,114 ---- # Already Trapped? ! if not target.hasevent( 'magic.trap' ): fizzle(char) return *************** *** 116,126 **** target.soundeffect(0x1f0) ! # Add the Trap Properties to the Item target.deltag('trap_owner', char.serial) target.deltag('trap_damage', random.randint(10, 50)) target.deltag('trap_type', 'magic') - events = target.events - events.remove('magic.trap') - target.events = events class Protection(Spell): --- 117,125 ---- target.soundeffect(0x1f0) ! # Remove the Trap Properties from the Item ! target.removeevent( 'magic.trap' ) target.deltag('trap_owner', char.serial) target.deltag('trap_damage', random.randint(10, 50)) target.deltag('trap_type', 'magic') class Protection(Spell): |
From: Correa <thi...@us...> - 2004-08-24 00:34:47
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9992 Modified Files: configure.py Log Message: Small fix Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** configure.py 23 Aug 2004 22:25:26 -0000 1.32 --- configure.py 24 Aug 2004 00:34:34 -0000 1.33 *************** *** 311,317 **** else: PY_LIBDIR = buildLibLine( py_libpath, py_libfile ) - config.write("PY_INCDIR = %s\n" % ( py_incpath ) ) config.write("PY_LIBDIR = %s\n" % PY_LIBDIR) ! # Build MySQL Libs and Includes --- 311,316 ---- else: PY_LIBDIR = buildLibLine( py_libpath, py_libfile ) config.write("PY_LIBDIR = %s\n" % PY_LIBDIR) ! config.write("PY_INCDIR = %s\n" % py_incpath ) # Build MySQL Libs and Includes |
From: Correa <thi...@us...> - 2004-08-24 00:24:01
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6599 Modified Files: wolfpack.pro Log Message: Experimental MacOS X support Index: wolfpack.pro =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v retrieving revision 1.208 retrieving revision 1.209 diff -C2 -d -r1.208 -r1.209 *** wolfpack.pro 23 Aug 2004 19:35:31 -0000 1.208 --- wolfpack.pro 24 Aug 2004 00:23:21 -0000 1.209 *************** *** 169,173 **** # Twofish Module ! SOURCES += twofish/twofish2.c INTERFACES = --- 169,173 ---- # Twofish Module ! SOURCES += twofish/twofish2.cpp INTERFACES = |
From: Correa <thi...@us...> - 2004-08-24 00:23:36
|
Update of /cvsroot/wpdev/wolfpack/twofish In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6599/twofish Modified Files: debug.h platform.h Added Files: twofish2.cpp Removed Files: twofish2.c Log Message: Experimental MacOS X support --- NEW FILE: twofish2.cpp --- /*************************************************************************** TWOFISH2.C -- Optimized C API calls for TWOFISH AES submission Submitters: Bruce Schneier, Counterpane Systems Doug Whiting, Hi/fn John Kelsey, Counterpane Systems Chris Hall, Counterpane Systems David Wagner, UC Berkeley Code Author: Doug Whiting, Hi/fn Version 1.00 April 1998 Copyright 1998, Hi/fn and Counterpane Systems. All rights reserved. Notes: * Optimized version * Tab size is set to 4 characters in this file [...1137 lines suppressed...] } } if ( mode == MODE_CBC ) /* restore iv32 to cipher */ BlockCopy( cipher->iv32, IV ) return inputLen; } #ifdef GetCodeSize DWORD TwofishCodeSize( void ) { DWORD x = Here( 0 ); #ifdef USE_ASM if ( useAsm & 3 ) return TwofishAsmCodeSize(); #endif return x - TwofishCodeStart(); }; #endif Index: debug.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/twofish/debug.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** debug.h 12 Aug 2004 12:13:33 -0000 1.4 --- debug.h 24 Aug 2004 00:23:25 -0000 1.5 *************** *** 1,3 **** ! #ifdef DEBUG /* keep these macros common so they are same for both versions */ CONST int debugCompile = 1; extern int debug; --- 1,3 ---- ! #ifdef DEBUG_TWOFISH /* keep these macros common so they are same for both versions */ CONST int debugCompile = 1; extern int debug; --- twofish2.c DELETED --- Index: platform.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/twofish/platform.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** platform.h 30 Sep 2003 15:06:30 -0000 1.4 --- platform.h 24 Aug 2004 00:23:25 -0000 1.5 *************** *** 20,23 **** --- 20,25 ---- ***************************************************************************/ + #include <qglobal.h> + /* use intrinsic rotate if possible */ #define ROL( x, y ) ( ( (x) << (y) ) | ( (x) >> ( 32 - (y) ) ) ) *************** *** 34,38 **** --- 36,42 ---- // Change this to compile on a BigEndian machine + #if !defined(Q_OS_MAC) #define LittleEndian 1 + #endif #define ALIGN32 1 |
From: Correa <thi...@us...> - 2004-08-24 00:23:35
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6599/python Modified Files: global.cpp pyaccount.cpp regioniterator.h Log Message: Experimental MacOS X support Index: regioniterator.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/regioniterator.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** regioniterator.h 10 Aug 2004 03:27:54 -0000 1.13 --- regioniterator.h 24 Aug 2004 00:23:24 -0000 1.14 *************** *** 88,92 **** 0, 0, ! }; --- 88,92 ---- 0, 0, ! 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; *************** *** 164,168 **** 0, 0, ! }; --- 164,168 ---- 0, 0, ! 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; Index: global.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** global.cpp 19 Aug 2004 01:22:57 -0000 1.146 --- global.cpp 24 Aug 2004 00:23:23 -0000 1.147 *************** *** 359,363 **** \description Creates a new item from a given definition id and assigns a new serial to it. */ ! static PyObject* wpAdditem( PyObject* self, PyObject* args ) { char* definition; --- 359,363 ---- \description Creates a new item from a given definition id and assigns a new serial to it. */ ! static PyObject* wpAdditem( PyObject* /*self*/, PyObject* args ) { char* definition; *************** *** 380,384 **** \description Creates a new npc from the given definition and moves it to the given position. */ ! static PyObject* wpAddnpc( PyObject* self, PyObject* args ) { char* definition; --- 380,384 ---- \description Creates a new npc from the given definition and moves it to the given position. */ ! static PyObject* wpAddnpc( PyObject* /*self*/, PyObject* args ) { char* definition; *************** *** 418,424 **** \description Returns a list of all registered guilds in the world. */ ! static PyObject* wpGuilds( PyObject* self, PyObject* args ) { - Q_UNUSED( args ); PyObject* list = PyList_New( 0 ); --- 418,423 ---- \description Returns a list of all registered guilds in the world. */ ! static PyObject* wpGuilds( PyObject* /*self*/, PyObject* /*args*/ ) { PyObject* list = PyList_New( 0 ); *************** *** 480,484 **** \description Tries to find a multi at the given position. Returns None if none can be found. */ ! static PyObject* wpFindmulti( PyObject* self, PyObject* args ) { Coord_cl coord; --- 479,483 ---- \description Tries to find a multi at the given position. Returns None if none can be found. */ ! static PyObject* wpFindmulti( PyObject* /*self*/, PyObject* args ) { Coord_cl coord; *************** *** 994,998 **** hook per event at a time, but a script can hook more than one event to itself. */ ! static PyObject* wpRegisterGlobal( PyObject* self, PyObject* args ) { unsigned int event; --- 993,997 ---- hook per event at a time, but a script can hook more than one event to itself. */ ! static PyObject* wpRegisterGlobal( PyObject* /*self*/, PyObject* args ) { unsigned int event; *************** *** 1037,1041 **** you can implement custom ingame commands. */ ! static PyObject* wpRegisterCommand( PyObject* self, PyObject* args ) { const char* command; --- 1036,1040 ---- you can implement custom ingame commands. */ ! static PyObject* wpRegisterCommand( PyObject* /*self*/, PyObject* args ) { const char* command; *************** *** 1072,1076 **** True in your function, otherwise return False. */ ! static PyObject* wpRegisterPacketHook( PyObject* self, PyObject* args ) { unsigned char packet; --- 1071,1075 ---- True in your function, otherwise return False. */ ! static PyObject* wpRegisterPacketHook( PyObject* /*self*/, PyObject* args ) { unsigned char packet; *************** *** 1125,1129 **** Please note that multis are represented by the item object. */ ! static PyObject* wpAddMulti( PyObject* self, PyObject* args ) { char* definition; --- 1124,1128 ---- Please note that multis are represented by the item object. */ ! static PyObject* wpAddMulti( PyObject* /*self*/, PyObject* args ) { char* definition; *************** *** 1271,1275 **** Please use this function wisely. It is better to use the additem function whenever possible instead. */ ! static PyObject* wpNewItem( PyObject* self, PyObject* args ) { char createSerial = 1; --- 1270,1274 ---- Please use this function wisely. It is better to use the additem function whenever possible instead. */ ! static PyObject* wpNewItem( PyObject* /*self*/, PyObject* args ) { char createSerial = 1; *************** *** 1295,1299 **** Please use this function wisely. It is better to use the addnpc function whenever possible instead. */ ! static PyObject* wpNewNpc( PyObject* self, PyObject* args ) { char createSerial = 1; --- 1294,1298 ---- Please use this function wisely. It is better to use the addnpc function whenever possible instead. */ ! static PyObject* wpNewNpc( PyObject* /*self*/, PyObject* args ) { char createSerial = 1; *************** *** 1315,1321 **** \description This function will create a new guild. */ ! static PyObject* wpNewguild( PyObject* self, PyObject* args ) { - Q_UNUSED( args ); cGuild* guild = new cGuild( true ); Guilds::instance()->registerGuild( guild ); --- 1314,1319 ---- \description This function will create a new guild. */ ! static PyObject* wpNewguild( PyObject* /*self*/, PyObject* /*args*/ ) { cGuild* guild = new cGuild( true ); Guilds::instance()->registerGuild( guild ); *************** *** 1333,1337 **** characters. */ ! static PyObject* wpNewPlayer( PyObject* self, PyObject* args ) { char createSerial = 1; --- 1331,1335 ---- characters. */ ! static PyObject* wpNewPlayer( PyObject* /*self*/, PyObject* args ) { char createSerial = 1; *************** *** 1458,1462 **** an element object to access its data. */ ! static PyObject* wpGetDefinition( PyObject* self, PyObject* args ) { unsigned int type; --- 1456,1460 ---- an element object to access its data. */ ! static PyObject* wpGetDefinition( PyObject* /*self*/, PyObject* args ) { unsigned int type; *************** *** 1489,1497 **** \description This function will compile the ids of all sections of a given type. */ ! static PyObject* wpGetDefinitions( PyObject* self, PyObject* args ) { unsigned int type; ! if ( !PyArg_ParseTuple( args, "I:getdefinitions(type)", &type ) ) { return 0; --- 1487,1495 ---- \description This function will compile the ids of all sections of a given type. */ ! static PyObject* wpGetDefinitions( PyObject* /*self*/, PyObject* args ) { unsigned int type; ! if ( !PyArg_ParseTuple( args, "I:wolfpack.getdefinitions(type)", &type ) ) { return 0; *************** *** 1527,1531 **** \description This function calls an event handler in the given script. */ ! static PyObject* wpCallEvent( PyObject* self, PyObject* args ) { char* script; --- 1525,1529 ---- \description This function calls an event handler in the given script. */ ! static PyObject* wpCallEvent( PyObject* /*self*/, PyObject* args ) { char* script; *************** *** 1564,1568 **** \description This function checks if the given script can handle an event of the given type and returns true if it can. */ ! static PyObject* wpHasEvent( PyObject* self, PyObject* args ) { char* script; --- 1562,1566 ---- \description This function checks if the given script can handle an event of the given type and returns true if it can. */ ! static PyObject* wpHasEvent( PyObject* /*self*/, PyObject* args ) { char* script; *************** *** 1604,1608 **** \description This function calls an event handler in the given script. */ ! static PyObject* wpCallNamedEvent( PyObject* self, PyObject* args ) { char* script; --- 1602,1606 ---- \description This function calls an event handler in the given script. */ ! static PyObject* wpCallNamedEvent( PyObject* /*self*/, PyObject* args ) { char* script; *************** *** 1640,1644 **** \description This function checks if the given script can handle an event with the given name and returns true if it can. */ ! static PyObject* wpHasNamedEvent( PyObject* self, PyObject* args ) { char* script; --- 1638,1642 ---- \description This function checks if the given script can handle an event with the given name and returns true if it can. */ ! static PyObject* wpHasNamedEvent( PyObject* /*self*/, PyObject* args ) { char* script; *************** *** 1679,1685 **** \description This function retrieves an option from the world database. */ ! static PyObject* wpGetOption( PyObject* self, PyObject* args ) { - Q_UNUSED( self ); QString arg_key = getArgStr( 0 ); QString arg_def = getArgStr( 1 ); --- 1677,1682 ---- \description This function retrieves an option from the world database. */ ! static PyObject* wpGetOption( PyObject* /*self*/, PyObject* args ) { QString arg_key = getArgStr( 0 ); QString arg_def = getArgStr( 1 ); *************** *** 1695,1702 **** \description This function sets a given option in the world database. */ ! static PyObject* wpSetOption( PyObject* self, PyObject* args ) { - Q_UNUSED( self ); - QString arg_key = getArgStr( 0 ); QString arg_val = getArgStr( 1 ); --- 1692,1697 ---- \description This function sets a given option in the world database. */ ! static PyObject* wpSetOption( PyObject* /*self*/, PyObject* args ) { QString arg_key = getArgStr( 0 ); QString arg_val = getArgStr( 1 ); *************** *** 1726,1730 **** \description Retrieve information about a given character baseid. */ ! static PyObject* wpCharBase( PyObject* self, PyObject* args ) { char *baseid; --- 1721,1725 ---- \description Retrieve information about a given character baseid. */ ! static PyObject* wpCharBase( PyObject* /*self*/, PyObject* args ) { char *baseid; *************** *** 1822,1829 **** and returns it. */ ! static PyObject* wpSocketsFirst( PyObject* self, PyObject* args ) { - Q_UNUSED( self ); - Q_UNUSED( args ); return PyGetSocketObject( Network::instance()->first() ); } --- 1817,1822 ---- and returns it. */ ! static PyObject* wpSocketsFirst( PyObject* /*self*/, PyObject* /*args*/ ) { return PyGetSocketObject( Network::instance()->first() ); } *************** *** 1835,1842 **** and returns it. If there is no socket available, None is returned. */ ! static PyObject* wpSocketsNext( PyObject* self, PyObject* args ) { - Q_UNUSED( self ); - Q_UNUSED( args ); return PyGetSocketObject( Network::instance()->next() ); } --- 1828,1833 ---- and returns it. If there is no socket available, None is returned. */ ! static PyObject* wpSocketsNext( PyObject* /*self*/, PyObject* /*args*/ ) { return PyGetSocketObject( Network::instance()->next() ); } *************** *** 1872,1876 **** \description This function returns the number of accounts on the server. */ ! static PyObject* wpAccountsCount( PyObject* self, PyObject* args ) { return PyInt_FromLong( Accounts::instance()->count() ); --- 1863,1867 ---- \description This function returns the number of accounts on the server. */ ! static PyObject* wpAccountsCount( PyObject* /*self*/, PyObject* /*args*/ ) { return PyInt_FromLong( Accounts::instance()->count() ); *************** *** 2237,2241 **** \description This function executes the given SQL query in the currently connected database and returns the result. */ ! static PyObject* wpQuery( PyObject* self, PyObject* args ) { char* query; --- 2228,2232 ---- \description This function executes the given SQL query in the currently connected database and returns the result. */ ! static PyObject* wpQuery( PyObject* /*self*/, PyObject* args ) { char* query; *************** *** 2275,2279 **** \description This function executes the given SQL query in the currently connected database and discards the result if there is any. */ ! static PyObject* wpExecute( PyObject* self, PyObject* args ) { char* query; --- 2266,2270 ---- \description This function executes the given SQL query in the currently connected database and discards the result if there is any. */ ! static PyObject* wpExecute( PyObject* /*self*/, PyObject* args ) { char* query; *************** *** 2288,2292 **** PersistentBroker::instance()->executeQuery( query ); } ! catch ( QString e ) { PyMem_Free( query ); --- 2279,2283 ---- PersistentBroker::instance()->executeQuery( query ); } ! catch ( QString& e ) { PyMem_Free( query ); *************** *** 2336,2342 **** \description This function closes the connection to the given database. */ ! static PyObject* wpClose( PyObject* self, PyObject* args ) { - Q_UNUSED( args ); try { --- 2327,2332 ---- \description This function closes the connection to the given database. */ ! static PyObject* wpClose( PyObject* /*self*/, PyObject* /*args*/ ) { try { *************** *** 2357,2361 **** \description This function opens the connection to the given database. */ ! static PyObject* wpOpen( PyObject* self, PyObject* args ) { unsigned int database; --- 2347,2351 ---- \description This function opens the connection to the given database. */ ! static PyObject* wpOpen( PyObject* /*self*/, PyObject* args ) { unsigned int database; *************** *** 2377,2381 **** } } ! catch ( QString e ) { PyErr_SetString( PyExc_RuntimeError, e.latin1() ); --- 2367,2371 ---- } } ! catch ( QString& e ) { PyErr_SetString( PyExc_RuntimeError, e.latin1() ); Index: pyaccount.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/pyaccount.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** pyaccount.cpp 22 Aug 2004 15:12:48 -0000 1.39 --- pyaccount.cpp 24 Aug 2004 00:23:24 -0000 1.40 *************** *** 80,84 **** 0, // Call ( reprfunc ) wpAccount_str, ! 0, }; --- 80,84 ---- 0, // Call ( reprfunc ) wpAccount_str, ! 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; |
From: Correa <thi...@us...> - 2004-08-24 00:23:35
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6599/network Modified Files: encryption.h Log Message: Experimental MacOS X support Index: encryption.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/encryption.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** encryption.h 10 Aug 2004 03:24:29 -0000 1.4 --- encryption.h 24 Aug 2004 00:23:22 -0000 1.5 *************** *** 33,40 **** #include "../singleton.h" - extern "C" - { #include "../twofish/aes.h" - }; struct stLoginKey --- 33,37 ---- |
From: Correa <thi...@us...> - 2004-08-23 22:25:38
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31698/python Modified Files: python.pri Log Message: Ops Index: python.pri =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/python.pri,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** python.pri 23 Aug 2004 19:35:47 -0000 1.1 --- python.pri 23 Aug 2004 22:25:26 -0000 1.2 *************** *** 28,32 **** $$PYTHON_CPP/socket.cpp \ $$PYTHON_CPP/worlditerator.cpp \ - $$PYTHON_CPP/pypacket.cpp \ - $$PYTHON_CPP/pyspawnregion.cpp --- 28,30 ---- |
From: Correa <thi...@us...> - 2004-08-23 22:25:38
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31698 Modified Files: configure.py Log Message: Ops Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** configure.py 23 Aug 2004 21:05:36 -0000 1.31 --- configure.py 23 Aug 2004 22:25:26 -0000 1.32 *************** *** 164,168 **** return True ! def checkPython( options, lookForHeaders = True, lookForLib = True ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): --- 164,168 ---- return True ! def checkPython( options, lookForHeaders, lookForLib ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): *************** *** 237,263 **** sys.stdout.write(yellow("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work\n" ) ! if lookForLib: ! sys.stdout.write( "Searching for Python library... " ) ! global py_libpath ! global py_libfile ! py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) ! if ( py_libfile ): ! sys.stdout.write("%s\n" % os.path.join( py_libpath, py_libfile ) ) ! else: ! sys.stdout.write(red("Not Found!") + "\n") ! sys.exit() ! if lookForHeaders: ! global py_incpath ! py_incfile = None ! sys.stdout.write( "Searching for Python includes... " ) ! py_incfile, py_incpath = findFile( PYTHONINCSEARCHPATH ) ! if ( py_incfile ): ! sys.stdout.write( "%s\n" % py_incpath ) ! else: ! sys.stdout.write(red("Not Found!") + "\n") ! sys.exit() return True --- 237,263 ---- sys.stdout.write(yellow("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work\n" ) ! if lookForLib: ! sys.stdout.write( "Searching for Python library... " ) ! global py_libpath ! global py_libfile ! py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) ! if ( py_libfile ): ! sys.stdout.write("%s\n" % os.path.join( py_libpath, py_libfile ) ) ! else: ! sys.stdout.write(red("Not Found!") + "\n") ! sys.exit() ! if lookForHeaders: ! global py_incpath ! py_incfile = None ! sys.stdout.write( "Searching for Python includes... " ) ! py_incfile, py_incpath = findFile( PYTHONINCSEARCHPATH ) ! if ( py_incfile ): ! sys.stdout.write( "%s\n" % py_incpath ) ! else: ! sys.stdout.write(red("Not Found!") + "\n") ! sys.exit() return True |
From: Sebastian H. <dar...@us...> - 2004-08-23 21:37:51
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16408 Modified Files: ChangeLog serverconfig.cpp serverconfig.h world.cpp world.h Log Message: Binary Save backups and compression. Index: world.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/world.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** world.h 16 Aug 2004 18:18:03 -0000 1.19 --- world.h 23 Aug 2004 21:37:39 -0000 1.20 *************** *** 36,39 **** --- 36,40 ---- #include <qvaluevector.h> #include <qmap.h> + #include <qthread.h> #include "server.h" *************** *** 64,67 **** --- 65,79 ---- }; + class cBackupThread : public QThread { + private: + QString filename; + public: + void run(); + + void setFilename(const QString &name) { + filename = name; + } + }; + class cWorld : public cComponent { *************** *** 80,83 **** --- 92,97 ---- void loadTag( cBufferedReader& reader, unsigned int version ); QMap<QString, QString> options; + void backupWorld( const QString &filename, unsigned int count, bool compress); + QPtrList<cBackupThread> backupThreads; public: Index: serverconfig.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/serverconfig.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** serverconfig.h 10 Aug 2004 03:15:57 -0000 1.3 --- serverconfig.h 23 Aug 2004 21:37:39 -0000 1.4 *************** *** 146,149 **** --- 146,154 ---- unsigned char maxCharsPerAccount_; + // Binary Save Driver + unsigned int binaryBackups_; + QString binarySavepath_; + bool binaryCompressBackups_; + // AI float checkAITime_; *************** *** 232,236 **** signed int maxStealthSteps() const; unsigned int runningStamSteps() const; ! unsigned int hungerRate() const; unsigned int hungerDamageRate() const; unsigned char hungerDamage() const; --- 237,241 ---- signed int maxStealthSteps() const; unsigned int runningStamSteps() const; ! unsigned int hungerRate() const; unsigned int hungerDamageRate() const; unsigned char hungerDamage() const; *************** *** 243,246 **** --- 248,264 ---- } + inline unsigned int binaryBackups() const + { + return binaryBackups_; + } + + inline const QString &binarySavepath() const { + return binarySavepath_; + } + + inline bool binaryCompressBackups() const { + return binaryCompressBackups_; + } + unsigned int shopRestock() const; unsigned int snoopdelay() const; Index: serverconfig.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/serverconfig.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** serverconfig.cpp 13 Aug 2004 08:55:25 -0000 1.4 --- serverconfig.cpp 23 Aug 2004 21:37:39 -0000 1.5 *************** *** 204,207 **** --- 204,212 ---- pathfindFollowMinCost_ = getDouble( "Path Finding", "Follow min. estimated Cost", 1.5, true ); pathfindFleeRadius_ = getNumber( "Path Finding", "Flee Radius", 10, true ); + + // Binary Saves + binarySavepath_ = getString( "Binary Save Driver", "Save Path", "world.bin", true); + binaryBackups_ = getNumber( "Binary Save Driver", "Number Of Backups", 5, true); + binaryCompressBackups_ = getBool( "Binary Save Driver", "Compress Backups", false, true); } Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ChangeLog 22 Aug 2004 16:34:51 -0000 1.12 --- ChangeLog 23 Aug 2004 21:37:39 -0000 1.13 *************** *** 14,17 **** --- 14,20 ---- - .exportdefinitions now exports data about multis to the categories.db database. + - Backup functionality for the binary save driver. + - Binary backups can automatically be compressed using gzip. + - The number of backups kept can be limited. Wolfpack 12.9.8 Beta (19. August 2004) Index: world.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** world.cpp 19 Aug 2004 01:22:54 -0000 1.117 --- world.cpp 23 Aug 2004 21:37:39 -0000 1.118 *************** *** 46,49 **** --- 46,51 ---- #include "basics.h" #include <sqlite.h> + #include <qfileinfo.h> + #include <qdir.h> // Postprocessing stuff, can be deleted later on *************** *** 345,348 **** --- 347,351 ---- _lastCharSerial = 0; _lastItemSerial = ITEM_SPACE; + backupThreads.setAutoDelete(true); } *************** *** 352,355 **** --- 355,363 ---- cWorld::~cWorld() { + cBackupThread *thread; + for (thread = backupThreads.first(); thread; thread = backupThreads.next()) { + thread->wait(); + } + // Free pending objects p->purgePendingObjects(); *************** *** 415,419 **** if ( Config::instance()->databaseDriver() == "binary" ) { ! QString filename = "world.bin"; if ( QFile::exists( filename ) ) --- 423,427 ---- if ( Config::instance()->databaseDriver() == "binary" ) { ! QString filename = Config::instance()->binarySavepath(); if ( QFile::exists( filename ) ) *************** *** 830,836 **** if (Config::instance()->databaseDriver() == "binary") { // Save in binary format cBufferedWriter writer( "WOLFPACK", DATABASE_VERSION ); ! writer.open( "world.bin" ); cCharIterator charIterator; --- 838,847 ---- if (Config::instance()->databaseDriver() == "binary") { + // Make a backup of the old world. + backupWorld(Config::instance()->binarySavepath(), Config::instance()->binaryBackups(), Config::instance()->binaryCompressBackups()); + // Save in binary format cBufferedWriter writer( "WOLFPACK", DATABASE_VERSION ); ! writer.open( Config::instance()->binarySavepath() ); cCharIterator charIterator; *************** *** 869,872 **** --- 880,886 ---- writer.writeByte( 0xFF ); // Terminator Type writer.close(); + + Config::instance()->flush(); + p->purgePendingObjects(); } else { if (!PersistentBroker::instance()->openDriver( Config::instance()->databaseDriver())) { *************** *** 1226,1229 **** --- 1240,1367 ---- } + QMap<QDateTime, QString> listBackups(const QString &filename) { + // Get the path the file is in + QString name = QFileInfo(filename).baseName(false); + + QDir dir = QFileInfo(filename).dir(); + QStringList entries = dir.entryList(name + "*", QDir::Files); + QMap<QDateTime, QString> backups; + + QStringList::iterator sit; + for (sit = entries.begin(); sit != entries.end(); ++sit) { + QString backup = QFileInfo(*sit).baseName(false); + QString timestamp = backup.right(backup.length() - name.length()); + QDate date; + QTime time; + + // Length has to be -YYYYMMDD-HHMM (14 Characters) + if (timestamp.length() != 14) { + continue; + } + + bool ok[5]; + int year = timestamp.mid(1, 4).toInt(&ok[0]); + int month = timestamp.mid(5, 2).toInt(&ok[1]); + int day = timestamp.mid(7, 2).toInt(&ok[2]); + int hour = timestamp.mid(10, 2).toInt(&ok[3]); + int minute = timestamp.mid(12, 2).toInt(&ok[4]); + + if (!ok[0] || !ok[1] || !ok[2] || !ok[3] || !ok[4]) { + continue; + } + + date.setYMD(year, month, day); + time.setHMS(hour, minute, 0); + + backups.insert(QDateTime(date, time), *sit); + } + + return backups; + } + + /* + Backup old worldfile + */ + void cWorld::backupWorld(const QString &filename, unsigned int count, bool compress) { + // Looks like there is nothing to backup + if (count == 0 || !QFile::exists(filename)) { + return; + } + + // Check if we need to remove a previous backup + QMap<QDateTime, QString> backups = listBackups(filename); + + if (backups.count() >= count) { + // Remove the oldest backup + QDateTime current; + QString backup = QString::null; + + QMap<QDateTime, QString>::iterator it; + for (it = backups.begin(); it != backups.end(); ++it) { + if (current.isNull() || it.key() < current) { + current = it.key(); + backup = it.data(); + } + } + + if (!backup.isNull() && !QFile::remove(backup)) { + Console::instance()->log(LOG_ERROR, QString("Unable to remove backup %1. No new backup has been created.\n").arg(backup)); + return; + } + } + + // Rename the old worldfile to the new backup name + QString backupName = QFileInfo(filename).dirPath(true) + QDir::separator() + QFileInfo(filename).baseName(false); + QDateTime current = QDateTime::currentDateTime(); + backupName.append(current.toString("-yyyyMMdd-hhmm")); // Append Timestamp + backupName.append("."); + backupName.append(QFileInfo(filename).extension(true)); // Append Extension + + // Rename the old worldfile + QDir dir = QDir::current(); + dir.rename(filename, backupName, true); + + // Start the compression thread if requested by the user + cBackupThread *backupThread = new cBackupThread(); + backupThread->setFilename(backupName); + backupThread->start(QThread::LowPriority); + } + + extern "C" { + extern void *gzopen(const char *path, const char *mode); + extern int gzwrite(void *file, void *buf, unsigned len); + extern int gzclose(void *file); + }; + + /* + Pipe a backup trough + */ + void cBackupThread::run() { + // Open the backup input file and the backup output file and compress + QFile input(filename); + QString outputName = filename + ".gz"; + + if (!input.open(IO_ReadOnly)) { + return; + } + + void *output = gzopen(outputName.latin1(), "wb"); + if (!output) { + input.close(); + return; + } + + int readSize; + char buffer[4096]; + while ((readSize = input.readBlock(buffer, 4096)) > 0) { + gzwrite(output, buffer, readSize); + } + + input.close(); + gzclose(output); + + input.remove(); + } + /***************************************************************************** cItemIterator member functions |
From: Correa <thi...@us...> - 2004-08-23 21:05:59
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5612 Modified Files: configure.py Log Message: experimental MacOS X support Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** configure.py 23 Aug 2004 19:35:31 -0000 1.30 --- configure.py 23 Aug 2004 21:05:36 -0000 1.31 *************** *** 164,168 **** return True ! def checkPython(options): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): --- 164,168 ---- return True ! def checkPython( options, lookForHeaders = True, lookForLib = True ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): *************** *** 237,261 **** sys.stdout.write(yellow("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work\n" ) ! sys.stdout.write( "Searching for Python library... " ) ! global py_libpath ! global py_libfile ! py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) ! if ( py_libfile ): ! sys.stdout.write("%s\n" % os.path.join( py_libpath, py_libfile ) ) ! else: ! sys.stdout.write(red("Not Found!") + "\n") ! sys.exit() ! global py_incpath ! py_incfile = None ! sys.stdout.write( "Searching for Python includes... " ) ! py_incfile, py_incpath = findFile( PYTHONINCSEARCHPATH ) ! if ( py_incfile ): ! sys.stdout.write( "%s\n" % py_incpath ) ! else: ! sys.stdout.write(red("Not Found!") + "\n") ! sys.exit() return True --- 237,263 ---- sys.stdout.write(yellow("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work\n" ) ! if lookForLib: ! sys.stdout.write( "Searching for Python library... " ) ! global py_libpath ! global py_libfile ! py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) ! if ( py_libfile ): ! sys.stdout.write("%s\n" % os.path.join( py_libpath, py_libfile ) ) ! else: ! sys.stdout.write(red("Not Found!") + "\n") ! sys.exit() ! if lookForHeaders: ! global py_incpath ! py_incfile = None ! sys.stdout.write( "Searching for Python includes... " ) ! py_incfile, py_incpath = findFile( PYTHONINCSEARCHPATH ) ! if ( py_incfile ): ! sys.stdout.write( "%s\n" % py_incpath ) ! else: ! sys.stdout.write(red("Not Found!") + "\n") ! sys.exit() return True *************** *** 283,287 **** nocolor() ! checkPython(options) if options.enable_mysql: CONFIG += "mysql " --- 285,289 ---- nocolor() ! checkPython(options, True, not (sys.platform == "darwin") ) if options.enable_mysql: CONFIG += "mysql " *************** *** 304,310 **** # Build Python LIBS and Includes ! PY_LIBDIR = buildLibLine( py_libpath, py_libfile ) ! config.write("PY_INCDIR = %s\n" % ( py_incpath ) ) ! config.write("PY_LIBDIR = %s\n" % PY_LIBDIR) --- 306,316 ---- # Build Python LIBS and Includes ! if sys.platform == "darwin": ! # MacPython is build as a Framework, not a library :/ ! PY_LIBDIR = distutils.sysconfig.get_config_vars("LINKFORSHARED")[0] ! else: ! PY_LIBDIR = buildLibLine( py_libpath, py_libfile ) ! config.write("PY_INCDIR = %s\n" % ( py_incpath ) ) ! config.write("PY_LIBDIR = %s\n" % PY_LIBDIR) *************** *** 319,325 **** CONFIG += "debug warn_on " else: ! CONFIG += "release warn_off " ! # if --aidebug if options.enable_aidebug: --- 325,331 ---- CONFIG += "debug warn_on " else: ! CONFIG += "release warn_off " ! # if --aidebug if options.enable_aidebug: |
From: Correa <thi...@us...> - 2004-08-23 19:36:14
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9271 Modified Files: .cvsignore configure.py wolfpack.pro Log Message: cleaned up build system and fixed problem with configure.py under windows Index: .cvsignore =================================================================== RCS file: /cvsroot/wpdev/wolfpack/.cvsignore,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** .cvsignore 17 Aug 2004 19:39:41 -0000 1.4 --- .cvsignore 23 Aug 2004 19:35:31 -0000 1.5 *************** *** 6,13 **** Release Debug ! vc70.idb wolfpack.suo wolfpack.ncb ! vc70.pdb wolfpack.exe wolfpack --- 6,13 ---- Release Debug ! vc*.idb wolfpack.suo wolfpack.ncb ! vc*.pdb wolfpack.exe wolfpack Index: wolfpack.pro =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v retrieving revision 1.207 retrieving revision 1.208 diff -C2 -d -r1.207 -r1.208 *** wolfpack.pro 23 Aug 2004 15:58:21 -0000 1.207 --- wolfpack.pro 23 Aug 2004 19:35:31 -0000 1.208 *************** *** 25,29 **** MOC_DIR = obj - INCLUDEPATH += sqlite win32:DEFINES -= UNICODE --- 25,28 ---- *************** *** 34,42 **** # Precompiled header ! precompile_header:PRECOMPILED_HEADER = wolfpack_pch.h # Common files ! HEADERS = \ accounts.h \ basechar.h \ --- 33,65 ---- # Precompiled header ! precompile_header { ! # PRECOMPILED_HEADER = wolfpack_pch.h ! INCLUDEPATH += obj ! } ! ! SQLITE_CPP = sqlite ! SQLITE_H = sqlite ! PYTHON_CPP = python ! PYTHON_H = python ! NETWORK_H = network ! NETWORK_CPP = network ! AI_H = ai ! AI_CPP = ai ! MULS_H = muls ! MULS_CPP = muls + DEPENDPATH += ;$$SQLITE_H;$$PYTHON_H;$$NETWORK_H;$$AI_H;$$MULS_H;. + INCLUDEPATH += $$SQLITE_H + + + #modules + include($$PYTHON_CPP/python.pri) + include($$SQLITE_CPP/sqlite.pri) + include($$NETWORK_CPP/network.pri) + include($$AI_CPP/ai.pri) + include($$MULS_CPP/muls.pri) # Common files ! HEADERS += \ accounts.h \ basechar.h \ *************** *** 57,61 **** definitions.h \ dragdrop.h \ - network/encryption.h \ exceptions.h \ factory.h \ --- 80,83 ---- *************** *** 66,74 **** items.h \ log.h \ - muls/maps.h \ md5.h \ multi.h \ - muls/multiscache.h \ - network/network.h \ npc.h \ pagesystem.h \ --- 88,93 ---- *************** *** 91,95 **** targetrequests.h \ territories.h \ - muls/tilecache.h \ timing.h \ timers.h \ --- 110,113 ---- *************** *** 103,107 **** world.h ! SOURCES = \ accounts.cpp \ basechar.cpp \ --- 121,125 ---- world.h ! SOURCES += \ accounts.cpp \ basechar.cpp \ *************** *** 120,124 **** definitions.cpp \ dragdrop.cpp \ - network/encryption.cpp \ getopts.cpp \ guilds.cpp \ --- 138,141 ---- *************** *** 126,134 **** items.cpp \ log.cpp \ - muls/maps.cpp \ md5.cpp \ multi.cpp \ - muls/multiscache.cpp \ - network/network.cpp \ npc.cpp \ party.cpp \ --- 143,148 ---- *************** *** 146,150 **** targetrequests.cpp \ territories.cpp \ - muls/tilecache.cpp \ timing.cpp \ timers.cpp \ --- 160,163 ---- *************** *** 158,254 **** SOURCES += twofish/twofish2.c - # Network Module - # THIS IS IMPORTANT FOR MOCING! - HEADERS += \ - network/asyncnetio.h \ - network/listener.h \ - network/uopacket.h \ - network/uorxpackets.h \ - network/uosocket.h \ - network/uotxpackets.h - - SOURCES += \ - network/asyncnetio.cpp \ - network/listener.cpp \ - network/uopacket.cpp \ - network/uorxpackets.cpp \ - network/uosocket.cpp \ - network/uotxpackets.cpp - - # AI Module - HEADERS += ai/ai.h - - SOURCES += \ - ai/ai.cpp \ - ai/ai_animals.cpp \ - ai/ai_humans.cpp \ - ai/ai_monsters.cpp - - # Python Module - SOURCES += \ - python/char.cpp \ - python/engine.cpp \ - python/global.cpp \ - python/item.cpp \ - python/pyaccount.cpp \ - python/pyai.cpp \ - python/pycoord.cpp \ - python/pypacket.cpp \ - python/pyspawnregion.cpp \ - python/pyregion.cpp \ - python/pytooltip.cpp \ - python/socket.cpp \ - python/worlditerator.cpp - - HEADERS += \ - python/content.h \ - python/worlditerator.h - - # SQLite Sources - SOURCES += \ - sqlite/attach.c \ - sqlite/auth.c \ - sqlite/btree.c \ - sqlite/btree_rb.c \ - sqlite/build.c \ - sqlite/copy.c \ - sqlite/date.c \ - sqlite/delete.c \ - sqlite/expr.c \ - sqlite/func.c \ - sqlite/hash.c \ - sqlite/insert.c \ - sqlite/main.c \ - sqlite/opcodes.c \ - sqlite/os.c \ - sqlite/pager.c \ - sqlite/parse.c \ - sqlite/pragma.c \ - sqlite/printf.c \ - sqlite/random.c \ - sqlite/select.c \ - sqlite/table.c \ - sqlite/tokenize.c \ - sqlite/trigger.c \ - sqlite/update.c \ - sqlite/util.c \ - sqlite/vacuum.c \ - sqlite/vdbe.c \ - sqlite/vdbeaux.c \ - sqlite/where.c - - HEADERS += \ - sqlite/btree.h \ - sqlite/config.h \ - sqlite/hash.h \ - sqlite/opcodes.h \ - sqlite/os.h \ - sqlite/pager.h \ - sqlite/parse.h \ - sqlite/sqlite.h \ - sqlite/sqliteInt.h \ - sqlite/vdbe.h \ - sqlite/vdbeInt.h - INTERFACES = TRANSLATIONS = \ --- 171,174 ---- Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** configure.py 23 Aug 2004 15:58:21 -0000 1.29 --- configure.py 23 Aug 2004 19:35:31 -0000 1.30 *************** *** 54,58 **** if sys.platform == "win32": ! return path + os.path.pathsep + file else: if file[0:3] == "lib": --- 54,58 ---- if sys.platform == "win32": ! return path + os.path.sep + file else: if file[0:3] == "lib": *************** *** 165,170 **** def checkPython(options): ! PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() ] ! PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] PYTHONLIBSTATICSEARCHPATH = [] if sys.platform == "win32": --- 165,173 ---- def checkPython(options): ! PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] ! if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): ! PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] ! else: ! PYTHONLIBSEARCHPATH = [] PYTHONLIBSTATICSEARCHPATH = [] if sys.platform == "win32": *************** *** 265,269 **** # Setup command line parser ! parser = OptionParser(version="%prog 0.1") parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable color output support on this script") --- 268,272 ---- # Setup command line parser ! parser = OptionParser(version="%prog 0.2") parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable color output support on this script") *************** *** 277,281 **** (options, args) = parser.parse_args() ! if options.nocolor: nocolor() --- 280,284 ---- (options, args) = parser.parse_args() ! if options.nocolor or sys.platform == "win32": nocolor() *************** *** 314,318 **** if options.enable_debug: DEFINES += "_DEBUG " ! CONFIG += "debug " # if --aidebug if options.enable_aidebug: --- 317,325 ---- if options.enable_debug: DEFINES += "_DEBUG " ! CONFIG += "debug warn_on " ! else: ! CONFIG += "release warn_off " ! ! # if --aidebug if options.enable_aidebug: |
From: Correa <thi...@us...> - 2004-08-23 19:36:04
|
Update of /cvsroot/wpdev/wolfpack/sqlite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9271/sqlite Added Files: sqlite.pri Log Message: cleaned up build system and fixed problem with configure.py under windows --- NEW FILE: sqlite.pri --- # Wolfpack sqlite module HEADERS += $$SQLITE_H/btree.h \ $$SQLITE_H/config.h \ $$SQLITE_H/hash.h \ $$SQLITE_H/opcodes.h \ $$SQLITE_H/os.h \ $$SQLITE_H/pager.h \ $$SQLITE_H/parse.h \ $$SQLITE_H/sqlite.h \ $$SQLITE_H/sqliteInt.h \ $$SQLITE_H/vdbe.h \ $$SQLITE_H/vdbeInt.h SOURCES += $$SQLITE_CPP/attach.c \ $$SQLITE_CPP/auth.c \ $$SQLITE_CPP/btree.c \ $$SQLITE_CPP/btree_rb.c \ $$SQLITE_CPP/build.c \ $$SQLITE_CPP/copy.c \ $$SQLITE_CPP/date.c \ $$SQLITE_CPP/delete.c \ $$SQLITE_CPP/expr.c \ $$SQLITE_CPP/func.c \ $$SQLITE_CPP/hash.c \ $$SQLITE_CPP/insert.c \ $$SQLITE_CPP/main.c \ $$SQLITE_CPP/opcodes.c \ $$SQLITE_CPP/os.c \ $$SQLITE_CPP/pager.c \ $$SQLITE_CPP/parse.c \ $$SQLITE_CPP/pragma.c \ $$SQLITE_CPP/printf.c \ $$SQLITE_CPP/random.c \ $$SQLITE_CPP/select.c \ $$SQLITE_CPP/table.c \ $$SQLITE_CPP/tokenize.c \ $$SQLITE_CPP/trigger.c \ $$SQLITE_CPP/update.c \ $$SQLITE_CPP/util.c \ $$SQLITE_CPP/vacuum.c \ $$SQLITE_CPP/vdbe.c \ $$SQLITE_CPP/vdbeaux.c \ $$SQLITE_CPP/where.c |
From: Correa <thi...@us...> - 2004-08-23 19:36:04
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9271/python Added Files: python.pri Log Message: cleaned up build system and fixed problem with configure.py under windows --- NEW FILE: python.pri --- # Wolfpack python module HEADERS += $$PYTHON_H/content.h \ $$PYTHON_H/engine.h \ $$PYTHON_H/gump.h \ $$PYTHON_H/objectcache.h \ $$PYTHON_H/pypacket.h \ $$PYTHON_H/pyspawnregion.h \ $$PYTHON_H/regioniterator.h \ $$PYTHON_H/skills.h \ $$PYTHON_H/target.h \ $$PYTHON_H/tempeffect.h \ $$PYTHON_H/utilities.h \ $$PYTHON_H/worlditerator.h SOURCES += $$PYTHON_CPP/char.cpp \ $$PYTHON_CPP/engine.cpp \ $$PYTHON_CPP/global.cpp \ $$PYTHON_CPP/item.cpp \ $$PYTHON_CPP/pyaccount.cpp \ $$PYTHON_CPP/pyai.cpp \ $$PYTHON_CPP/pycoord.cpp \ $$PYTHON_CPP/pypacket.cpp \ $$PYTHON_CPP/pyregion.cpp \ $$PYTHON_CPP/pyspawnregion.cpp \ $$PYTHON_CPP/pytooltip.cpp \ $$PYTHON_CPP/region.cpp \ $$PYTHON_CPP/socket.cpp \ $$PYTHON_CPP/worlditerator.cpp \ $$PYTHON_CPP/pypacket.cpp \ $$PYTHON_CPP/pyspawnregion.cpp |
From: Correa <thi...@us...> - 2004-08-23 19:36:01
|
Update of /cvsroot/wpdev/wolfpack/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9271/ai Added Files: ai.pri Log Message: cleaned up build system and fixed problem with configure.py under windows --- NEW FILE: ai.pri --- # Input HEADERS += $$AI_H/ai.h SOURCES += $$AI_CPP/ai.cpp \ $$AI_CPP/ai_animals.cpp \ $$AI_CPP/ai_humans.cpp \ $$AI_CPP/ai_monsters.cpp |
From: Correa <thi...@us...> - 2004-08-23 19:36:00
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9271/network Added Files: network.pri Log Message: cleaned up build system and fixed problem with configure.py under windows --- NEW FILE: network.pri --- # Wolfpack network module # Input HEADERS += $$NETWORK_H/asyncnetio.h \ $$NETWORK_H/encryption.h \ $$NETWORK_H/listener.h \ $$NETWORK_H/network.h \ $$NETWORK_H/uopacket.h \ $$NETWORK_H/uorxpackets.h \ $$NETWORK_H/uosocket.h \ $$NETWORK_H/uotxpackets.h SOURCES += $$NETWORK_CPP/asyncnetio.cpp \ $$NETWORK_CPP/encryption.cpp \ $$NETWORK_CPP/listener.cpp \ $$NETWORK_CPP/network.cpp \ $$NETWORK_CPP/uopacket.cpp \ $$NETWORK_CPP/uorxpackets.cpp \ $$NETWORK_CPP/uosocket.cpp \ $$NETWORK_CPP/uotxpackets.cpp |
From: Correa <thi...@us...> - 2004-08-23 19:35:59
|
Update of /cvsroot/wpdev/wolfpack/muls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9271/muls Added Files: muls.pri Log Message: cleaned up build system and fixed problem with configure.py under windows --- NEW FILE: muls.pri --- # Input HEADERS += $$MULS_H/maps.h \ $$MULS_H/multiscache.h \ $$MULS_H/tilecache.h SOURCES += $$MULS_CPP/maps.cpp \ $$MULS_CPP/multiscache.cpp \ $$MULS_CPP/tilecache.cpp |
From: Correa <thi...@us...> - 2004-08-23 15:58:33
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4448 Modified Files: configure.py wolfpack.pro Log Message: Experimental MacOS X support Index: wolfpack.pro =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v retrieving revision 1.206 retrieving revision 1.207 diff -C2 -d -r1.206 -r1.207 *** wolfpack.pro 19 Aug 2004 05:29:06 -0000 1.206 --- wolfpack.pro 23 Aug 2004 15:58:21 -0000 1.207 *************** *** 13,18 **** unix { - LIBS = -ldl -lutil - CONFIG += console --- 13,16 ---- Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** configure.py 23 Aug 2004 05:08:21 -0000 1.28 --- configure.py 23 Aug 2004 15:58:21 -0000 1.29 *************** *** 13,16 **** --- 13,17 ---- import dircache import string + import distutils.sysconfig from optparse import OptionParser *************** *** 31,34 **** --- 32,36 ---- colorcodes["red"] = "\x1b[31;01m" colorcodes["darkred"] = "\x1b[31;06m" + colorcodes["yellow"] = "\x1b[33;01m" def nocolor(): *************** *** 43,47 **** def green( text ): return colorcodes["green"] + text + colorcodes["reset"] ! def buildLibLine( path, file ): --- 45,50 ---- def green( text ): return colorcodes["green"] + text + colorcodes["reset"] ! def yellow( text ): ! return colorcodes["yellow"] + text + colorcodes["reset"] def buildLibLine( path, file ): *************** *** 162,170 **** def checkPython(options): if sys.platform == "win32": ! PYTHONLIBSEARCHPATH = [ sys.prefix + "\Libs\python*.lib" ] ! PYTHONINCSEARCHPATH = [ sys.prefix + "\include\Python.h" ] elif sys.platform == "linux2": ! PYTHONLIBSEARCHPATH = [ "/usr/local/lib/libpython2.3*.so", \ "/usr/local/lib/[Pp]ython*/libpython2.3*.so", \ "/usr/lib/libpython2.3*.so", \ --- 165,176 ---- def checkPython(options): + PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() ] + PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] + PYTHONLIBSTATICSEARCHPATH = [] if sys.platform == "win32": ! PYTHONLIBSEARCHPATH += [ sys.prefix + "\Libs\python*.lib" ] ! PYTHONINCSEARCHPATH += [ sys.prefix + "\include\Python.h" ] elif sys.platform == "linux2": ! PYTHONLIBSEARCHPATH += [ "/usr/local/lib/libpython2.3*.so", \ "/usr/local/lib/[Pp]ython*/libpython2.3*.so", \ "/usr/lib/libpython2.3*.so", \ *************** *** 172,176 **** "/usr/lib/[Pp]ython*/config/libpython2.3*.so", \ "/usr/local/lib/[Pp]ython*/config/libpython2.3*.so"] ! PYTHONLIBSTATICSEARCHPATH = [ "/usr/local/lib/libpython2.3*.a", \ "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.a", \ "/usr/lib/libpython2.3*.a", \ --- 178,182 ---- "/usr/lib/[Pp]ython*/config/libpython2.3*.so", \ "/usr/local/lib/[Pp]ython*/config/libpython2.3*.so"] ! PYTHONLIBSTATICSEARCHPATH += [ "/usr/local/lib/libpython2.3*.a", \ "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.a", \ "/usr/lib/libpython2.3*.a", \ *************** *** 178,185 **** "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.a", \ "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.a"] ! PYTHONINCSEARCHPATH = [ "/usr/local/include/[Pp]ython2.3*/Python.h", \ "/usr/include/[Pp]ython2.3*/Python.h"] elif sys.platform == "freebsd4" or sys.platform == "freebsd5": ! PYTHONLIBSEARCHPATH = [ "/usr/local/lib/libpython2.3*.so", \ "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.so", \ "/usr/lib/libpython2.3*.so", \ --- 184,191 ---- "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.a", \ "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.a"] ! PYTHONINCSEARCHPATH += [ "/usr/local/include/[Pp]ython2.3*/Python.h", \ "/usr/include/[Pp]ython2.3*/Python.h"] elif sys.platform == "freebsd4" or sys.platform == "freebsd5": ! PYTHONLIBSEARCHPATH += [ "/usr/local/lib/libpython2.3*.so", \ "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.so", \ "/usr/lib/libpython2.3*.so", \ *************** *** 187,191 **** "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.so", \ "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.so"] ! PYTHONLIBSTATICSEARCHPATH = [ "/usr/local/lib/libpython2.3*.a", \ "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.a", \ "/usr/lib/libpython2.3*.a", \ --- 193,197 ---- "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.so", \ "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.so"] ! PYTHONLIBSTATICSEARCHPATH += [ "/usr/local/lib/libpython2.3*.a", \ "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.a", \ "/usr/lib/libpython2.3*.a", \ *************** *** 193,202 **** "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.a", \ "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.a"] ! PYTHONINCSEARCHPATH = [ "/usr/local/include/[Pp]ython2.3*/Python.h", \ "/usr/include/[Pp]ython2.3*/Python.h"] elif sys.platform == "darwin": ! PYTHONINCSEARCHPATH = [ "/System/Library/Frameworks/Python.framework/Versions/Current/Headers/Python.h" ] ! PYTHONLIBSEARCHPATH = [ ] ! PYTHONLIBSTATICSEARCHPATH = ["/System/Library/Frameworks/Python.framework/Versions/Current/Python", \ "/System/Library/Frameworks/Python.framework/Versions/Current/lib/[Pp]ython*/config/libpython*.a", \ "/usr/local/lib/[Pp]ython*/config/libpython*.a"] --- 199,208 ---- "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.a", \ "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.a"] ! PYTHONINCSEARCHPATH += [ "/usr/local/include/[Pp]ython2.3*/Python.h", \ "/usr/include/[Pp]ython2.3*/Python.h"] elif sys.platform == "darwin": ! PYTHONINCSEARCHPATH += [ "/System/Library/Frameworks/Python.framework/Versions/Current/Headers/Python.h" ] ! PYTHONLIBSEARCHPATH += [ ] ! PYTHONLIBSTATICSEARCHPATH += ["/System/Library/Frameworks/Python.framework/Versions/Current/Python", \ "/System/Library/Frameworks/Python.framework/Versions/Current/lib/[Pp]ython*/config/libpython*.a", \ "/usr/local/lib/[Pp]ython*/config/libpython*.a"] *************** *** 226,230 **** sys.stdout.write( "Checking CPU byte order... %s\n" % sys.byteorder ) if sys.byteorder != 'little': ! sys.stdout.write(red("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work\n" ) sys.stdout.write( "Searching for Python library... " ) --- 232,236 ---- sys.stdout.write( "Checking CPU byte order... %s\n" % sys.byteorder ) if sys.byteorder != 'little': ! sys.stdout.write(yellow("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work\n" ) sys.stdout.write( "Searching for Python library... " ) |
From: Correa <thi...@us...> - 2004-08-23 05:08:39
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6178 Modified Files: configure.py Log Message: Experimental MacOS X support Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** configure.py 23 Aug 2004 05:02:58 -0000 1.27 --- configure.py 23 Aug 2004 05:08:21 -0000 1.28 *************** *** 227,231 **** if sys.byteorder != 'little': sys.stdout.write(red("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work\n" ) - sys.exit(); sys.stdout.write( "Searching for Python library... " ) --- 227,230 ---- |
From: Correa <thi...@us...> - 2004-08-23 05:03:15
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4651 Modified Files: configure.py Log Message: Experimental MacOS X support Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** configure.py 23 Aug 2004 04:56:39 -0000 1.26 --- configure.py 23 Aug 2004 05:02:58 -0000 1.27 *************** *** 198,202 **** PYTHONINCSEARCHPATH = [ "/System/Library/Frameworks/Python.framework/Versions/Current/Headers/Python.h" ] PYTHONLIBSEARCHPATH = [ ] ! PYTHONLIBSTATICSEARCHPATH = ["/System/Library/Frameworks/Python.framework/Versions/Current/Python", \ "/System/Library/Frameworks/Python.framework/Versions/Current/lib/[Pp]ython*/config/libpython*.a", \ "/usr/local/lib/[Pp]ython*/config/libpython*.a"] --- 198,202 ---- PYTHONINCSEARCHPATH = [ "/System/Library/Frameworks/Python.framework/Versions/Current/Headers/Python.h" ] PYTHONLIBSEARCHPATH = [ ] ! PYTHONLIBSTATICSEARCHPATH = ["/System/Library/Frameworks/Python.framework/Versions/Current/Python", \ "/System/Library/Frameworks/Python.framework/Versions/Current/lib/[Pp]ython*/config/libpython*.a", \ "/usr/local/lib/[Pp]ython*/config/libpython*.a"] |
From: Correa <thi...@us...> - 2004-08-23 04:56:51
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3100 Modified Files: configure.py Log Message: Experimental MacOS X support Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** configure.py 22 Aug 2004 08:56:54 -0000 1.25 --- configure.py 23 Aug 2004 04:56:39 -0000 1.26 *************** *** 82,86 **** sys.stdout.write( "Checking QTDIR enviroment variable..." ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): ! sys.stdout.write( "ok\n" ) else: sys.stdout.write( red("failed") + "\n" ) --- 82,86 ---- sys.stdout.write( "Checking QTDIR enviroment variable..." ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): ! sys.stdout.write( green("ok\n") ) else: sys.stdout.write( red("failed") + "\n" ) *************** *** 198,202 **** PYTHONINCSEARCHPATH = [ "/System/Library/Frameworks/Python.framework/Versions/Current/Headers/Python.h" ] PYTHONLIBSEARCHPATH = [ ] ! PYTHONLIBSTATICSEARCHPATH = [] else: sys.stdout.write(red("ERROR")+": Unknown platform %s to checkPython()\n" % sys.platform ) --- 198,204 ---- PYTHONINCSEARCHPATH = [ "/System/Library/Frameworks/Python.framework/Versions/Current/Headers/Python.h" ] PYTHONLIBSEARCHPATH = [ ] ! PYTHONLIBSTATICSEARCHPATH = ["/System/Library/Frameworks/Python.framework/Versions/Current/Python", \ ! "/System/Library/Frameworks/Python.framework/Versions/Current/lib/[Pp]ython*/config/libpython*.a", \ ! "/usr/local/lib/[Pp]ython*/config/libpython*.a"] else: sys.stdout.write(red("ERROR")+": Unknown platform %s to checkPython()\n" % sys.platform ) *************** *** 215,219 **** sys.stdout.write( "Checking Python version... " ) if sys.hexversion >= 0x020300F0: ! sys.stdout.write("ok\n") else: sys.stdout.write( red("failed") + "\n" ) --- 217,221 ---- sys.stdout.write( "Checking Python version... " ) if sys.hexversion >= 0x020300F0: ! sys.stdout.write(green("ok\n")) else: sys.stdout.write( red("failed") + "\n" ) *************** *** 224,228 **** sys.stdout.write( "Checking CPU byte order... %s\n" % sys.byteorder ) if sys.byteorder != 'little': ! sys.stdout.write("\nError: Wolfpack currently only supports little endian systems\n" ) sys.exit(); --- 226,230 ---- sys.stdout.write( "Checking CPU byte order... %s\n" % sys.byteorder ) if sys.byteorder != 'little': ! sys.stdout.write(red("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work\n" ) sys.exit(); |
From: Richard M. <dr...@us...> - 2004-08-23 03:22:10
|
Update of /cvsroot/wpdev/xmlscripts/documentation/webroot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11842/webroot Modified Files: ChangeLog.wolfpack Log Message: Updates Index: ChangeLog.wolfpack =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/documentation/webroot/ChangeLog.wolfpack,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** ChangeLog.wolfpack 19 Aug 2004 18:13:53 -0000 1.44 --- ChangeLog.wolfpack 23 Aug 2004 03:21:59 -0000 1.45 *************** *** 3,10 **** --- 3,33 ---- Wolfpack 12.9.9 Beta (CVS) * Core Changes: + - Added an email field for accounts. * Definition Changes: * Python Script Changes: + - Added the bolt command, just lightnings the target. + - Added the email command, changes your account's email. + - Added sparkle effects to the heal/restore commands. + - Fixes for the account command: + Fixed a few typos. + Fixed a bug in updating the password + Added support for the email field. + - Tweaked the hunger script. + - Fixed an update bug with npcs and the dye command. + - Fixed a bug with the dupe command. * Misc. Changes: * Known Issues, Bugs, and Missing Features: + - Some skills are still incomplete. + - Spawn regions are incomplete. + We welcome donated OSI-like spawn scripts! + - Town/World regions are incomplete. + We welcome donated OSI-like region scripts! + - Teleport Scripts are incomplete. + We welcome donated OSI-like teleport scripts! + - Possible that a few monsters are missing and/or incomplete. + - Reloading Python too many times can crash the server. + - There are still some memory leaks. + - Large gumps can potentially crash remote clients. + - Multis (Houses/Boats) are not currently supported. Wolfpack 12.9.8 Beta (19. August 2004) |
From: Richard M. <dr...@us...> - 2004-08-23 03:11:23
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8394 Modified Files: scripts.xml Log Message: Updates Index: scripts.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/scripts.xml,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** scripts.xml 19 Aug 2004 13:10:14 -0000 1.156 --- scripts.xml 23 Aug 2004 03:11:10 -0000 1.157 *************** *** 91,94 **** --- 91,95 ---- <script>commands.edit</script> <script>commands.effect</script> + <script>commands.email</script> <script>commands.eval</script> <script>commands.events</script> |
From: Richard M. <dr...@us...> - 2004-08-23 03:10:54
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7923/commands Modified Files: account.py adddecor.py dupe.py dye.py export.py info.py kill.py restore.py stat.py tags.py testlos.py tile.py travel.py Added Files: email.py Log Message: - Added the bolt command, just lightnings the target. - Added the email command, changes your account's email. - Added sparkle effects to the heal/restore commands. - Fixes for the account command: Fixed a few typos. Fixed a bug in updating the password Added support for the email field. - Tweaked the hunger script. - Fixed an update bug with npcs and the dye command. - Fixed a bug with the dupe command. Index: kill.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/kill.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kill.py 15 Jul 2004 22:07:51 -0000 1.3 --- kill.py 23 Aug 2004 03:10:39 -0000 1.4 *************** *** 10,13 **** --- 10,18 ---- \notes You cannot kill invulnerable characters this way. """ + """ + \command bolt + \description Lightning's the selected character. + \notes This does not do any damage. + """ import wolfpack *************** *** 16,19 **** --- 21,25 ---- def onLoad(): wolfpack.registercommand( "kill", commandKill ) + wolfpack.registercommand( "bolt", commandBolt ) return *************** *** 34,35 **** --- 40,52 ---- target.char.kill() return True + + def commandBolt(socket, cmd, args): + socket.sysmessage( "Please select the target to strike with lightning." ) + socket.attachtarget( "commands.kill.dobolt", [] ) + return True + + def dobolt( char, args, target ): + socket = char.socket + if target.char and not target.char.dead: + target.char.lightning() + return True Index: tile.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/tile.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tile.py 26 May 2004 13:07:21 -0000 1.2 --- tile.py 23 Aug 2004 03:10:39 -0000 1.3 *************** *** 1,3 **** - """ \command tile --- 1,2 ---- *************** *** 17,44 **** # def tileResponse(player, arguments, target): ! if len(arguments) < 3: ! player.socket.sysmessage('Please select the second corner.') ! player.socket.attachtarget("commands.tile.tileResponse", list(arguments) + [target.pos]) ! return ! x1 = min(arguments[2].x, target.pos.x) ! x2 = max(arguments[2].x, target.pos.x) ! y1 = min(arguments[2].y, target.pos.y) ! y2 = max(arguments[2].y, target.pos.y) ! z = arguments[0] ! ids = arguments[1] ! player.socket.sysmessage('Creating items from %u,%u to %u,%u at z=%d.' % (x1, y1, x2, y2, z)) ! pos = player.pos ! pos.z = z ! for x in range(x1, x2 + 1): ! for y in range(y1, y2 + 1): ! pos.x = x ! pos.y = y ! item = wolfpack.additem(random.choice(ids)) ! item.moveto(pos) ! item.decay = 0 ! item.update() # --- 16,43 ---- # def tileResponse(player, arguments, target): ! if len(arguments) < 3: ! player.socket.sysmessage('Please select the second corner.') ! player.socket.attachtarget("commands.tile.tileResponse", list(arguments) + [target.pos]) ! return ! x1 = min(arguments[2].x, target.pos.x) ! x2 = max(arguments[2].x, target.pos.x) ! y1 = min(arguments[2].y, target.pos.y) ! y2 = max(arguments[2].y, target.pos.y) ! z = arguments[0] ! ids = arguments[1] ! player.socket.sysmessage('Creating items from %u,%u to %u,%u at z=%d.' % (x1, y1, x2, y2, z)) ! pos = player.pos ! pos.z = z ! for x in range(x1, x2 + 1): ! for y in range(y1, y2 + 1): ! pos.x = x ! pos.y = y ! item = wolfpack.additem(random.choice(ids)) ! item.moveto(pos) ! item.decay = 0 ! item.update() # *************** *** 46,65 **** # def commandTile(socket, command, arguments): ! if arguments.count(' ') != 1: ! socket.sysmessage('Usage: .tile z id{,id}') ! return ! (z, ids) = arguments.split(' ') ! ids = ids.split(',') ! try: ! z = int(z) ! except: ! socket.sysmessage('Invalid z value.') ! return ! socket.sysmessage('Please select the first corner.') ! socket.attachtarget('commands.tile.tileResponse', [z, ids]) # --- 45,64 ---- # def commandTile(socket, command, arguments): ! if arguments.count(' ') != 1: ! socket.sysmessage('Usage: .tile z id{,id}') ! return ! (z, ids) = arguments.split(' ') ! ids = ids.split(',') ! try: ! z = int(z) ! except: ! socket.sysmessage('Invalid z value.') ! return ! socket.sysmessage('Please select the first corner.') ! socket.attachtarget('commands.tile.tileResponse', [z, ids]) # *************** *** 67,69 **** # def onLoad(): ! wolfpack.registercommand("tile", commandTile) --- 66,68 ---- # def onLoad(): ! wolfpack.registercommand("tile", commandTile) Index: adddecor.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/adddecor.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** adddecor.py 17 Aug 2004 19:30:46 -0000 1.5 --- adddecor.py 23 Aug 2004 03:10:39 -0000 1.6 *************** *** 208,212 **** ] flowers_decor = [ ! 'c37', 'c38', 'c45', 'c46', 'c47', 'c48', 'c49', 'c4a', 'c4b', 'c4c', 'c4d', 'c4e', # Small Flowers 'c84', # Foxglove Flowers 'c85', # Orfluer Flowers --- 208,212 ---- ] flowers_decor = [ ! #'c37', 'c38', 'c45', 'c46', 'c47', 'c48', 'c49', 'c4a', 'c4b', 'c4c', 'c4d', 'c4e', # Small Flowers 'c84', # Foxglove Flowers 'c85', # Orfluer Flowers Index: account.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/account.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** account.py 15 Jul 2004 20:08:30 -0000 1.10 --- account.py 23 Aug 2004 03:10:39 -0000 1.11 *************** *** 284,287 **** --- 284,291 ---- char.log( LOG_MESSAGE, "Requested %s.rank.\n" % account.name ) return True + elif key == 'email': + socket.sysmessage( "%s.email = %i" % ( account.name, account.email ) ) + char.log( LOG_MESSAGE, "Requested %s.email.\n" % account.name ) + return True else: socket.sysmessage( "Error: Unknown account key!" ) *************** *** 323,327 **** acl_list = wolfpack.accounts.acls() if not acl_list or len( acl_list ) == 0: ! socket.sysmessage( "Error: No ACLs are defined!" ) return False if not value in acl_list: --- 327,331 ---- acl_list = wolfpack.accounts.acls() if not acl_list or len( acl_list ) == 0: ! socket.sysmessage( "Critical Error: No ACLs are defined!" ) return False if not value in acl_list: *************** *** 346,359 **** socket.sysmessage( "Previous: %s.flags = %s" % ( account.name, account.flags ) ) account.flags = hex2dec(value) ! socket.sysmessage( "Changed: %s.acl = %s" % ( account.name, account.flags ) ) char.log( LOG_MESSAGE, "Modified %s.flags ( %s :: %s ).\n" % ( account.name, oldvalue, value ) ) return True # MultiGems elif key == 'multigems': ! if value.lower() == "true" or value.lower() == "false" or value == 1 or value == 0: oldvalue = account.multigems ! socket.sysmessage( "Previous: %s.acl = %s" % ( account.name, account.multigems ) ) account.multigems = value ! socket.sysmessage( "Changed: %s.acl = %s" % ( account.name, account.multigems ) ) char.log( LOG_MESSAGE, "Modified %s.multigems ( %s :: %s ).\n" % ( account.name, oldvalue, value ) ) return True --- 350,363 ---- socket.sysmessage( "Previous: %s.flags = %s" % ( account.name, account.flags ) ) account.flags = hex2dec(value) ! socket.sysmessage( "Changed: %s.flags = %s" % ( account.name, account.flags ) ) char.log( LOG_MESSAGE, "Modified %s.flags ( %s :: %s ).\n" % ( account.name, oldvalue, value ) ) return True # MultiGems elif key == 'multigems': ! if value.lower() == "true" or value.lower() == "false" or value in [ 0, 1 ]: oldvalue = account.multigems ! socket.sysmessage( "Previous: %s.multigems = %s" % ( account.name, account.multigems ) ) account.multigems = value ! socket.sysmessage( "Changed: %s.multigems = %s" % ( account.name, account.multigems ) ) char.log( LOG_MESSAGE, "Modified %s.multigems ( %s :: %s ).\n" % ( account.name, oldvalue, value ) ) return True *************** *** 372,380 **** oldvalue = account.password account.password = key ! socket.sysmessage( "Changed: %s.password" % ( account.name, account.password ) ) ! char.log( LOG_MESSAGE, "Modified %s.password.\n" % ( char.serial, account.name ) ) return True # READ ONLY VALUES ! elif key == 'name' or key == 'lastlogin' or key == 'inuse' or key == 'characters' or key == 'rank': char.log( LOG_MESSAGE, "Attempted modification of read-only value %s.%s.\n" % ( char.serial, account.name, key ) ) socket.sysmessage( "Error: The account.%s property is read only!" % key ) --- 376,398 ---- oldvalue = account.password account.password = key ! socket.sysmessage( "Changed: %s.password" % account.name ) ! char.log( LOG_MESSAGE, "Modified %s.password.\n" % account.name ) ! return True ! # Email ! elif key == 'email': ! if len( key ) > 255 or len( key ) == 0: ! if len( key ) > 255: ! socket.sysmessage( "Error: Email exceeds the 255 character limit!" ) ! if len( key ) == 0: ! socket.sysmessage( "Error: Email is NULL!" ) ! return False ! else: ! oldvalue = account.email ! account.email = key ! socket.sysmessage( "Changed: %s.email" % account.name ) ! char.log( LOG_MESSAGE, "Modified %s.email.\n" % account.name ) return True # READ ONLY VALUES ! elif key in ['name','lastlogin','inuse','characters','rank']: char.log( LOG_MESSAGE, "Attempted modification of read-only value %s.%s.\n" % ( char.serial, account.name, key ) ) socket.sysmessage( "Error: The account.%s property is read only!" % key ) Index: dupe.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/dupe.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dupe.py 26 May 2004 13:07:21 -0000 1.2 --- dupe.py 23 Aug 2004 03:10:39 -0000 1.3 *************** *** 23,47 **** def dupe(socket, command, arguments): ! arguments = arguments.strip() # Remove trailing and leading whitespaces ! amount = 1 ! if len( arguments ) > 0: ! try: ! amount = hex2dec(arguments) ! except: ! socket.sysmessage( 'Usage: dupe <amount>' ) ! return ! socket.sysmessage( 'Please choose an item to dupe.' ) ! socket.attachtarget( "commands.dupe.callback", [amount] ) def callback(char, args, target): ! if not target.item: ! char.socket.sysmessage('You have to target an item.') ! return ! for i in range(0, args[0]): ! target.item.dupe().update() def onLoad(): ! wolfpack.registercommand("dupe", dupe) --- 23,47 ---- def dupe(socket, command, arguments): ! arguments = arguments.strip() # Remove trailing and leading whitespaces ! amount = 1 ! if len( arguments ) > 0: ! try: ! amount = hex2dec(arguments) ! except: ! socket.sysmessage( 'Usage: dupe <amount>' ) ! return False ! socket.sysmessage( 'Please choose an item to dupe.' ) ! socket.attachtarget( "commands.dupe.callback", [amount] ) def callback(char, args, target): ! if not target.item: ! char.socket.sysmessage('You have to target an item.') ! return False ! for i in range(0, args[0]): ! target.item.dupe().update() def onLoad(): ! wolfpack.registercommand("dupe", dupe) Index: dye.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/dye.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dye.py 9 Jul 2004 21:08:36 -0000 1.4 --- dye.py 23 Aug 2004 03:10:39 -0000 1.5 *************** *** 34,37 **** --- 34,38 ---- if skin == 0: skin = target.char.orgskin + target.char.removefromview() target.char.skin = hex(skin) target.char.update() Index: tags.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/tags.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tags.py 5 Jul 2004 12:55:35 -0000 1.3 --- tags.py 23 Aug 2004 03:10:39 -0000 1.4 *************** *** 1,3 **** - """ \command settag --- 1,2 ---- *************** *** 9,13 **** want to change or attach while value is the desired tag value. """ - """ \command gettag --- 8,11 ---- *************** *** 16,20 **** Shows the type and value of the tag with the given name. """ - """ \command deltag --- 14,17 ---- *************** *** 23,30 **** Deletes the tag with the given name on the selected object. """ - """ \command taginfo ! \description This command shows a menu with all tags assigned to the targetted object. \usage - <code>taginfo</code> --- 20,26 ---- Deletes the tag with the given name on the selected object. """ """ \command taginfo ! \description This command shows a menu with all tags assigned to the targetted object. \usage - <code>taginfo</code> *************** *** 39,46 **** if response.button != 1: return ! ! object = wolfpack.findobject(tagnames[0]) if not object: ! return tagnames = tagnames[1:] --- 35,42 ---- if response.button != 1: return ! ! object = wolfpack.findobject(tagnames[0]) if not object: ! return tagnames = tagnames[1:] *************** *** 54,63 **** object.deltag(tagnames[i]) continue ! if response.text.has_key(i * 2 + 0) and response.text.has_key(i * 2 + 1): # Get value and name of the tag name = response.text[i * 2] value = response.text[i * 2 + 1] ! # Should the value be interpreted as a number? if i * 2 in switches: --- 50,59 ---- object.deltag(tagnames[i]) continue ! if response.text.has_key(i * 2 + 0) and response.text.has_key(i * 2 + 1): # Get value and name of the tag name = response.text[i * 2] value = response.text[i * 2 + 1] ! # Should the value be interpreted as a number? if i * 2 in switches: *************** *** 74,78 **** player.socket.sysmessage("Invalid integer value for tag '%s': '%s'." % (name, value)) continue # Skip to next tag ! try: name = str(name) --- 70,74 ---- player.socket.sysmessage("Invalid integer value for tag '%s': '%s'." % (name, value)) continue # Skip to next tag ! try: name = str(name) *************** *** 80,89 **** player.socket.sysmessage("Invalid tagname: '%s'." % name) continue # Skip to next tag ! # Set the new tag value for the player oldvalue = object.gettag(tagnames[i]) change = (name != tagnames[i]) or (type(oldvalue) != type(value)) or (oldvalue != value) ! ! if change: player.log(LOG_MESSAGE, u"Settings tag '%s' on object 0x%x to '%s' (%s).\n" % (unicode(name), object.serial, unicode(value), type(value).__name__)) object.deltag(tagnames[i]) --- 76,85 ---- player.socket.sysmessage("Invalid tagname: '%s'." % name) continue # Skip to next tag ! # Set the new tag value for the player oldvalue = object.gettag(tagnames[i]) change = (name != tagnames[i]) or (type(oldvalue) != type(value)) or (oldvalue != value) ! ! if change: player.log(LOG_MESSAGE, u"Settings tag '%s' on object 0x%x to '%s' (%s).\n" % (unicode(name), object.serial, unicode(value), type(value).__name__)) object.deltag(tagnames[i]) *************** *** 104,108 **** dialog.setCallback("commands.tags.taginfo_callback") dialog.setArgs([object.serial] + tags) ! dialog.startPage(0) dialog.addResizeGump(35, 12, 9260, 460, 504) --- 100,104 ---- dialog.setCallback("commands.tags.taginfo_callback") dialog.setArgs([object.serial] + tags) ! dialog.startPage(0) dialog.addResizeGump(35, 12, 9260, 460, 504) *************** *** 125,136 **** dialog.addButton(60, 476, 247, 248, 1) dialog.addButton(136, 476, 242, 241, 0) ! # This is a group count = (len(tags) + 3) / 4 ! ! for i in range(0, count): page = i + 1 dialog.startPage(page) ! if page > 1: dialog.addText(88, 445, "Previous Page", 2100) --- 121,132 ---- dialog.addButton(60, 476, 247, 248, 1) dialog.addButton(136, 476, 242, 241, 0) ! # This is a group count = (len(tags) + 3) / 4 ! ! for i in range(0, count): page = i + 1 dialog.startPage(page) ! if page > 1: dialog.addText(88, 445, "Previous Page", 2100) *************** *** 140,163 **** dialog.addText(376, 445, "Next Page", 2100) dialog.addPageButton(448, 445, 9903, 9905, page + 1) ! for j in range(0, 4): ! tagid = i * 4 + j if tagid >= len(tags): continue ! tag = tags[tagid] value = object.gettag(tag) yoffset = j * 80 ! dialog.addResizeGump(65, 109 + yoffset, 9200, 405, 68) ! dialog.addText(78, 117 + yoffset, "Name", 2100) dialog.addText(78, 146 + yoffset, "Value", 2100) dialog.addResizeGump(123, 144 + yoffset, 9300, 250, 26) ! dialog.addInputField(129, 147 + yoffset, 240, 20, 2100, tagid * 2 + 1, unicode(value)) dialog.addResizeGump(123, 115 + yoffset, 9300, 250, 26) dialog.addInputField(128, 118 + yoffset, 240, 20, 2100, tagid * 2 + 0, tag) ! dialog.addCheckbox(380, 118 + yoffset, 208, 209, tagid * 2 + 1, 0) ! dialog.addText(405, 118 + yoffset, "Delete", 2100) ! dialog.addCheckbox(380, 147 + yoffset, 208, 209, tagid * 2 + 0, type(value) == float or type(value) == int) dialog.addText(405, 147 + yoffset, "Number", 2100) --- 136,159 ---- dialog.addText(376, 445, "Next Page", 2100) dialog.addPageButton(448, 445, 9903, 9905, page + 1) ! for j in range(0, 4): ! tagid = i * 4 + j if tagid >= len(tags): continue ! tag = tags[tagid] value = object.gettag(tag) yoffset = j * 80 ! dialog.addResizeGump(65, 109 + yoffset, 9200, 405, 68) ! dialog.addText(78, 117 + yoffset, "Name", 2100) dialog.addText(78, 146 + yoffset, "Value", 2100) dialog.addResizeGump(123, 144 + yoffset, 9300, 250, 26) ! dialog.addInputField(129, 147 + yoffset, 240, 20, 2100, tagid * 2 + 1, unicode(value)) dialog.addResizeGump(123, 115 + yoffset, 9300, 250, 26) dialog.addInputField(128, 118 + yoffset, 240, 20, 2100, tagid * 2 + 0, tag) ! dialog.addCheckbox(380, 118 + yoffset, 208, 209, tagid * 2 + 1, 0) ! dialog.addText(405, 118 + yoffset, "Delete", 2100) ! dialog.addCheckbox(380, 147 + yoffset, 208, 209, tagid * 2 + 0, type(value) == float or type(value) == int) dialog.addText(405, 147 + yoffset, "Number", 2100) *************** *** 171,175 **** socket.sysmessage("Select an object you want to use this command on.") socket.attachtarget("commands.tags.taginfo_response", []) ! # # Target response --- 167,171 ---- socket.sysmessage("Select an object you want to use this command on.") socket.attachtarget("commands.tags.taginfo_response", []) ! # # Target response *************** *** 185,192 **** if not target.char.hastag(name): change = 1 ! else: oldvalue = target.char.gettag(name) change = (type(oldvalue) != type(value)) or (oldvalue != value) ! if change: player.log(LOG_MESSAGE, u"Settings tag '%s' on object 0x%x to '%s' (%s).\n" % (unicode(name), target.char.serial, unicode(value), type(value).__name__)) --- 181,188 ---- if not target.char.hastag(name): change = 1 ! else: oldvalue = target.char.gettag(name) change = (type(oldvalue) != type(value)) or (oldvalue != value) ! if change: player.log(LOG_MESSAGE, u"Settings tag '%s' on object 0x%x to '%s' (%s).\n" % (unicode(name), target.char.serial, unicode(value), type(value).__name__)) *************** *** 197,204 **** if not target.item.hastag(name): change = 1 ! else: oldvalue = target.item.gettag(name) change = (type(oldvalue) != type(value)) or (oldvalue != value) ! if change: player.log(LOG_MESSAGE, u"Settings tag '%s' on object 0x%x to '%s' (%s).\n" % (unicode(name), target.item.serial, unicode(value), type(value).__name__)) --- 193,200 ---- if not target.item.hastag(name): change = 1 ! else: oldvalue = target.item.gettag(name) change = (type(oldvalue) != type(value)) or (oldvalue != value) ! if change: player.log(LOG_MESSAGE, u"Settings tag '%s' on object 0x%x to '%s' (%s).\n" % (unicode(name), target.item.serial, unicode(value), type(value).__name__)) *************** *** 341,343 **** wolfpack.registercommand('gettag', commandGettag) wolfpack.registercommand('deltag', commandDeltag) ! wolfpack.registercommand('taginfo', commandTaginfo) \ No newline at end of file --- 337,339 ---- wolfpack.registercommand('gettag', commandGettag) wolfpack.registercommand('deltag', commandDeltag) ! wolfpack.registercommand('taginfo', commandTaginfo) Index: stat.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/stat.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** stat.py 2 Jul 2004 13:40:45 -0000 1.3 --- stat.py 23 Aug 2004 03:10:39 -0000 1.4 *************** *** 22,28 **** from wolfpack.consts import * ! usage = 'Usage: stat <short-stat-name> <value>' example = 'Example: stat str 100' def stat( socket, command, args ): args = args.strip() # Remove trailing and leading whitespaces --- 22,31 ---- from wolfpack.consts import * ! usage = 'Usage: stat <short-stat-name> <value>' example = 'Example: stat str 100' + def onLoad(): + wolfpack.registercommand( "stat", stat ) + def stat( socket, command, args ): args = args.strip() # Remove trailing and leading whitespaces *************** *** 89,94 **** return True - - def onLoad(): - wolfpack.registercommand( "stat", stat ) - --- 92,93 ---- --- NEW FILE: email.py --- """ \command email \description Change your current account email. \usage - <code>email [value]</code> Value is the new email for your account. Its length is limited to 255 characters. """ import wolfpack import wolfpack.accounts import string from wolfpack.consts import LOG_MESSAGE # Loads the command def onLoad(): wolfpack.registercommand( 'email', commandEmail ) return # Handles the password command def commandEmail( socket, cmd, args ): account = None password = None char = socket.player args = args.strip() account = wolfpack.accounts.find( char.account.name ) email = str( args ) if len( email ) == 0 or len( email ) > 255: if len( email ) > 0: socket.sysmessage( "Usage: email <newemail>" ) elif len( password ) > 255: socket.sysmessage( "Your email can have a maximum of 255 characters." ) return False else: account.email = str( email ) socket.sysmessage( "Your email has been changed." ) char.log( LOG_MESSAGE, "Account %s changed their email.\n" % account.name ) return True Index: export.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/export.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** export.py 15 Aug 2004 08:57:04 -0000 1.11 --- export.py 23 Aug 2004 03:10:39 -0000 1.12 *************** *** 73,77 **** def exportcmd( socket, command, arguments ): - socket.sysmessage( "Target the upper left corner of the area you want to export." ) socket.attachtarget( "commands.export.callback", [] ) --- 73,76 ---- Index: travel.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/travel.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** travel.py 2 Jul 2004 13:40:45 -0000 1.2 --- travel.py 23 Aug 2004 03:10:39 -0000 1.3 *************** *** 14,20 **** import wolfpack ! import string ! from moongate import * ! from wolfpack.consts import * def travel( socket, command, args ): --- 14,18 ---- import wolfpack ! from moongate import sendGump def travel( socket, command, args ): Index: restore.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/restore.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** restore.py 9 Jul 2004 21:08:36 -0000 1.2 --- restore.py 23 Aug 2004 03:10:39 -0000 1.3 *************** *** 42,45 **** --- 42,47 ---- target.char.mana = int( target.char.maxmana ) target.char.updatestats() + target.effect(0x376A, 9, 32) + target.soundeffect(0x202) char.log( LOG_MESSAGE, "Restored 0x%x.\n" % target.char.serial ) *************** *** 57,59 **** --- 59,63 ---- target.char.hitpoints = int( target.char.maxhitpoints ) target.char.updatestats() + target.effect(0x376A, 9, 32) + target.soundeffect(0x202) char.log( LOG_MESSAGE, "Healed 0x%x.\n" % target.char.serial ) Index: info.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/info.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** info.py 7 Aug 2004 05:35:47 -0000 1.16 --- info.py 23 Aug 2004 03:10:39 -0000 1.17 *************** *** 23,29 **** def str2bool( str ): ! if str.upper() == "TRUE": ! return True ! return False def info( socket, command, argstring ): --- 23,29 ---- def str2bool( str ): ! if str.upper() == "TRUE": ! return True ! return False def info( socket, command, argstring ): Index: testlos.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/testlos.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testlos.py 20 Jun 2004 20:22:17 -0000 1.2 --- testlos.py 23 Aug 2004 03:10:39 -0000 1.3 *************** *** 12,23 **** """ - import wolfpack ! from wolfpack import * ! from wolfpack.consts import * ! def testlos( socket, command, arguments ): ! wolfpack.console.log( LOG_MESSAGE, "Message" ) def onLoad(): --- 12,20 ---- """ import wolfpack ! from wolfpack.consts import LOG_MESSAGE def testlos( socket, command, arguments ): ! wolfpack.console.log( LOG_MESSAGE, "Message" ) def onLoad(): |
From: Richard M. <dr...@us...> - 2004-08-23 03:10:49
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7923/system Modified Files: hunger.py Log Message: - Added the bolt command, just lightnings the target. - Added the email command, changes your account's email. - Added sparkle effects to the heal/restore commands. - Fixes for the account command: Fixed a few typos. Fixed a bug in updating the password Added support for the email field. - Tweaked the hunger script. - Fixed an update bug with npcs and the dye command. - Fixed a bug with the dupe command. Index: hunger.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/hunger.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** hunger.py 12 Aug 2004 20:03:29 -0000 1.3 --- hunger.py 23 Aug 2004 03:10:40 -0000 1.4 *************** *** 5,14 **** def onTimeChange( player ): ! if player.socket: ! if player.hunger >= 1 and player.hunger <= 6: ! player.hunger -= 1 ! player.socket.sysmessage( "Your stomach growls..." ) ! elif player.hunger == 0: ! player.damage( 3, random.randint( 0, 3 ) ) ! player.socket.sysmessage( "Your stomach hurts from the lack of food..." ) return False --- 5,15 ---- def onTimeChange( player ): ! if wolfpack.time.hour() in [ 0, 3, 6, 9, 12, 15, 18, 21 ]: ! if player.socket: ! if player.hunger >= 1 and player.hunger <= 6: ! player.hunger -= 1 ! player.socket.sysmessage( "Your stomach growls..." ) ! elif player.hunger == 0: ! player.damage( 3, random.randint( 0, 3 ) ) ! player.socket.sysmessage( "Your stomach hurts from the lack of food..." ) return False |
From: Sebastian H. <dar...@us...> - 2004-08-22 16:35:12
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14586 Modified Files: ChangeLog commands.cpp Log Message: Multi export Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ChangeLog 22 Aug 2004 15:15:07 -0000 1.11 --- ChangeLog 22 Aug 2004 16:34:51 -0000 1.12 *************** *** 12,15 **** --- 12,17 ---- - .exportdefinitions now exports data about NPCS and their equipment to the categories.db database. + - .exportdefinitions now exports data about multis to the + categories.db database. Wolfpack 12.9.8 Beta (19. August 2004) Index: commands.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v retrieving revision 1.261 retrieving revision 1.262 diff -C2 -d -r1.261 -r1.262 *** commands.cpp 22 Aug 2004 02:29:50 -0000 1.261 --- commands.cpp 22 Aug 2004 16:34:51 -0000 1.262 *************** *** 676,679 **** --- 676,729 ---- /* + Recursive processing function to get neccesary information about multis. + */ + static void processMulti( QMap<QCString, QString> &item, const cElement *node ) + { + // If there is an inherit tag, inherit a parent item definition. + QString inherit = node->getAttribute( "inherit" ); + if ( inherit != QString::null ) + { + const cElement *parent = Definitions::instance()->getDefinition( WPDT_MULTI, inherit ); + if ( parent ) { + processMulti( item, parent ); + } + } + + int count = node->childCount(); + int i; + for ( i = 0; i < count; ++i ) { + const cElement *child = node->getChild( i ); + + // Inherit properties from another item definition + if ( child->name() == "inherit" ) + { + const cElement *parent = 0; + + if ( child->hasAttribute("id") ) + { + parent = Definitions::instance()->getDefinition( WPDT_MULTI, child->getAttribute( "id" ) ); + } + else + { + parent = Definitions::instance()->getDefinition( WPDT_MULTI, child->text() ); + } + + if ( parent ) + { + processMulti( item, parent ); + } + } + else if ( child->name() == "id" ) + { + item[ "dispid" ] = child->value(); + } + else if ( child->name() == "name" ) + { + item[ "name" ] = child->text(); + } + } + } + + /* Recursive processing function to get neccesary information about items. */ *************** *** 930,933 **** --- 980,990 ---- );" ); + driver.exec( "CREATE TABLE multis (\ + id INTEGER PRIMARY KEY,\ + name varchar(255) NULL,\ + addid varchar(255) NULL,\ + multiid int NOT NULL\ + );" ); + unsigned int lastcategory = 0; QMap<QString, unsigned int> categories; *************** *** 1201,1204 **** --- 1258,1285 ---- } + sections = Definitions::instance()->getSections( WPDT_MULTI ); + for ( sectionIt = sections.begin(); sectionIt != sections.end(); ++sectionIt ) + { + const cElement *element = Definitions::instance()->getDefinition( WPDT_MULTI, *sectionIt ); + + item.clear(); + item.insert( "name", QString::null ); + item.insert( "dispid", "0" ); + + processMulti( item, element ); + + if (item["name"].isNull() || item["dispid"].toInt() < 0x4000) { + continue; + } + + // Insert the item into the table. + QString section = *sectionIt; + QString sql = QString( "INSERT INTO multis VALUES(NULL,'%1','%2',%3);" ) + .arg( item[ "name" ].replace( "'", "''" ) ) + .arg( section.replace( "'", "''" ) ) + .arg( item[ "dispid" ].toInt() ); + driver.exec( sql ); + } + socket->sysMessage( "Finished exporting definitions to categories.db." ); } |