wpdev-commits Mailing List for Wolfpack Emu (Page 3)
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: Richard M. <dr...@us...> - 2004-11-03 01:55:52
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27316/network Modified Files: network.pri Log Message: Cleanups, trying to fix an odd display bug... Index: network.pri =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/network.pri,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** network.pri 23 Aug 2004 19:35:47 -0000 1.1 --- network.pri 3 Nov 2004 01:55:40 -0000 1.2 *************** *** 3,20 **** # 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 --- 3,20 ---- # 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: Richard M. <dr...@us...> - 2004-11-03 01:55:52
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27316/python Modified Files: python.pri Log Message: Cleanups, trying to fix an odd display bug... Index: python.pri =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/python.pri,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** python.pri 16 Sep 2004 01:40:19 -0000 1.4 --- python.pri 3 Nov 2004 01:55:40 -0000 1.5 *************** *** 2,33 **** # Wolfpack python module ! HEADERS += $$PYTHON_H/content.h \ ! $$PYTHON_H/engine.h \ ! $$PYTHON_H/gump.h \ ! $$PYTHON_H/objectcache.h \ ! $$PYTHON_H/pyaction.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/pyaction.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/target.cpp \ ! $$PYTHON_CPP/worlditerator.cpp \ --- 2,33 ---- # Wolfpack python module ! HEADERS += $$PYTHON_H/engine.h \ ! $$PYTHON_H/gump.h \ ! $$PYTHON_H/objectcache.h \ ! $$PYTHON_H/pyaction.h \ ! $$PYTHON_H/pycontent.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/pyaction.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/target.cpp \ + $$PYTHON_CPP/worlditerator.cpp |
From: Richard M. <dr...@us...> - 2004-11-03 01:55:51
|
Update of /cvsroot/wpdev/wolfpack/muls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27316/muls Modified Files: muls.pri Log Message: Cleanups, trying to fix an odd display bug... Index: muls.pri =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/muls.pri,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** muls.pri 23 Aug 2004 19:35:46 -0000 1.1 --- muls.pri 3 Nov 2004 01:55:40 -0000 1.2 *************** *** 2,8 **** # 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 --- 2,9 ---- # 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: Richard M. <dr...@us...> - 2004-11-03 01:55:50
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27316 Modified Files: configure.py Log Message: Cleanups, trying to fix an odd display bug... Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** configure.py 22 Oct 2004 12:29:46 -0000 1.40 --- configure.py 3 Nov 2004 01:55:39 -0000 1.41 *************** *** 6,9 **** --- 6,22 ---- # ( ( ;._ \\ ctr # Last Modification: check cvs logs # ################################################################# + # # + ################################################################# + # A note about the search paths... # + # The order of searching should be: # + # /usr/local/{include,lib}/{*.h,*.so,*.a} # + # /usr/local/{include,lib}/{package}/{*.h,*.so,*.a} # + # /usr/{include,lib}/{*.h,*.so,*.a} # + # /usr/{include,lib}/{package}/{*.h,*.so,*.a} # + # # + # This will allow local installations to be searched first # + # followed by the system's default package files. # + # # + ################################################################# import os *************** *** 17,29 **** # Older Python lib work arounds... try: ! from optparse import OptionParser except: ! sys.path.append( './tools/scripts' ) ! from optparse import OptionParser try: ! osHasPathDotSep = os.path.sep except: ! os.path.sep = '/' # These are the variables we are trying to figure out --- 30,42 ---- # Older Python lib work arounds... try: ! from optparse import OptionParser except: ! sys.path.append( './tools/scripts' ) ! from optparse import OptionParser try: ! osHasPathDotSep = os.path.sep except: ! os.path.sep = '/' # These are the variables we are trying to figure out *************** *** 81,90 **** for entry in searchpath: pathexp, fileexp = os.path.split( entry ) ! for path in glob.glob(pathexp): ! if os.path.exists(path): ! for file in dircache.listdir(path): if fnmatch.fnmatch( file, fileexp ): ! return (file, path) ! return (None, None) --- 94,103 ---- for entry in searchpath: pathexp, fileexp = os.path.split( entry ) ! for path in glob.glob( pathexp ): ! if os.path.exists( path ): ! for file in dircache.listdir( path ): if fnmatch.fnmatch( file, fileexp ): ! return ( file, path ) ! return ( None, None ) *************** *** 122,150 **** MySQL_INCSEARCHPATH = [ sys.prefix + "\include\mysql.h" ] elif sys.platform == "linux2": ! MySQL_LIBSEARCHPATH = [ "/usr/local/lib/mysql/libmysqlclient*.so", \ ! "/usr/lib/mysql/libmysqlclient*.so", \ ! "/usr/local/lib/libmysqlclient*.so", \ ! "/usr/lib/libmysqlclient*.so" ] ! MySQL_LIBSTATICSEARCHPATH = [ "/usr/local/lib/mysql/libmysqlclient*.a", \ ! "/usr/lib/mysql/libmysqlclient*.a", \ ! "/usr/local/lib/libmysqlclient*.a", \ ! "/usr/lib/libmysqlclient*.a" ] ! MySQL_INCSEARCHPATH = [ "/usr/local/include/mysql/mysql.h", \ ! "/usr/include/mysql/mysql.h", \ ! "/usr/local/include/mysql.h", \ ! "/usr/include/mysql.h" ] elif sys.platform == "freebsd4" or sys.platform == "freebsd5": ! MySQL_LIBSEARCHPATH = [ "/usr/local/lib/mysql/libmysqlclient*.so", \ ! "/usr/lib/mysql/libmysqlclient*.so", \ ! "/usr/local/lib/libmysqlclient*.so", \ ! "/usr/lib/libmysqlclient*.so" ] ! MySQL_LIBSTATICSEARCHPATH = [ "/usr/local/lib/mysql/libmysqlclient*.a", \ ! "/usr/lib/mysql/libmysqlclient*.a", \ ! "/usr/local/lib/libmysqlclient*.a", \ ! "/usr/lib/libmysqlclient*.a" ] ! MySQL_INCSEARCHPATH = [ "/usr/local/include/mysql/mysql.h", \ ! "/usr/include/mysql/mysql.h", \ ! "/usr/local/include/mysql.h", \ ! "/usr/include/mysql.h" ] else: sys.stdout.write("ERROR: Unknown platform %s to checkMySQL()\n" % sys.platform ) --- 135,169 ---- MySQL_INCSEARCHPATH = [ sys.prefix + "\include\mysql.h" ] elif sys.platform == "linux2": ! MySQL_LIBSEARCHPATH = [ \ ! "/usr/local/lib/libmysqlclient*.so", \ ! "/usr/local/lib/mysql/libmysqlclient*.so", \ ! "/usr/lib/libmysqlclient*.so", \ ! "/usr/lib/mysql/libmysqlclient*.so" ] ! MySQL_LIBSTATICSEARCHPATH = [ \ ! "/usr/local/lib/libmysqlclient*.a", \ ! "/usr/local/lib/mysql/libmysqlclient*.a", \ ! "/usr/lib/libmysqlclient*.a", \ ! "/usr/lib/mysql/libmysqlclient*.a" ] ! MySQL_INCSEARCHPATH = [ \ ! "/usr/local/include/mysql.h", \ ! "/usr/local/include/mysql/mysql.h", \ ! "/usr/include/mysql.h", \ ! "/usr/include/mysql/mysql.h" ] elif sys.platform == "freebsd4" or sys.platform == "freebsd5": ! MySQL_LIBSEARCHPATH = [ \ ! "/usr/local/lib/libmysqlclient*.so", \ ! "/usr/local/lib/mysql/libmysqlclient*.so", \ ! "/usr/lib/libmysqlclient*.so", \ ! "/usr/lib/mysql/libmysqlclient*.so" ] ! MySQL_LIBSTATICSEARCHPATH = [ \ ! "/usr/local/lib/libmysqlclient*.a", \ ! "/usr/local/lib/mysql/libmysqlclient*.a", \ ! "/usr/lib/libmysqlclient*.a", \ ! "/usr/lib/mysql/libmysqlclient*.a" ] ! MySQL_INCSEARCHPATH = [ \ ! "/usr/local/include/mysql.h", \ ! "/usr/local/include/mysql/mysql.h", \ ! "/usr/include/mysql.h", \ ! "/usr/include/mysql/mysql.h" ] else: sys.stdout.write("ERROR: Unknown platform %s to checkMySQL()\n" % sys.platform ) *************** *** 188,226 **** 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", \ ! "/usr/lib/[Pp]ython*/libpython2.3*.so", \ ! "/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", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/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", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.so", \ ! "/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", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/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"] else: sys.stdout.write(red("ERROR")+": Unknown platform %s to checkPython()\n" % sys.platform ) --- 207,253 ---- 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/local/lib/[Pp]ython*/config/libpython2.3*.so", \ ! "/usr/lib/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython*/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython*/config/libpython2.3*.so" ] ! PYTHONLIBSTATICSEARCHPATH += [ \ ! "/usr/local/lib/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.a", \ ! "/usr/lib/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/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/local/lib/[Pp]ython2.3*/config/libpython2.3*.so", \ ! "/usr/lib/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.so", \ ! "/usr/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/local/lib/[Pp]ython2.3*/config/libpython2.3*.a", \ ! "/usr/lib/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/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 += [ \ ! "/usr/local/lib/[Pp]ython*/config/libpython*.a", \ ! "/System/Library/Frameworks/Python.framework/Versions/Current/Python", \ ! "/System/Library/Frameworks/Python.framework/Versions/Current/lib/[Pp]ython*/config/libpython*.a" ] else: sys.stdout.write(red("ERROR")+": Unknown platform %s to checkPython()\n" % sys.platform ) *************** *** 229,259 **** # if --static if options.staticlink: PYTHONLIBSEARCHPATH = PYTHONLIBSTATICSEARCHPATH # if it was overiden... if options.py_incpath: PYTHONINCSEARCHPATH = [ options.py_incpath ] if options.py_libpath: PYTHONLIBSEARCHPATH = [ options.py_libpath ] sys.stdout.write( "Checking Python version... " ) if sys.hexversion >= 0x020200F0: ! sys.stdout.write(green("ok\n")) else: ! sys.stdout.write( red("failed") + "\n" ) sys.stdout.write( bold("Wolfpack requires Python version greater than 2.2.0 ") ) sys.exit(); - 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" ) if lookForLib: sys.stdout.write( "Searching for Python library... " ) - global py_libpath global py_libfile ! py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) if ( py_libfile ): --- 256,288 ---- # if --static if options.staticlink: + PYTHONLIBSEARCHPATH = None PYTHONLIBSEARCHPATH = PYTHONLIBSTATICSEARCHPATH # if it was overiden... if options.py_incpath: + PYTHONINCSEARCHPATH = None PYTHONINCSEARCHPATH = [ options.py_incpath ] if options.py_libpath: + PYTHONLIBSEARCHPATH = None PYTHONLIBSEARCHPATH = [ options.py_libpath ] sys.stdout.write( "Checking Python version... " ) if sys.hexversion >= 0x020200F0: ! sys.stdout.write(green("Pass\n")) else: ! sys.stdout.write( red("Fail") + "\n" ) sys.stdout.write( bold("Wolfpack requires Python version greater than 2.2.0 ") ) sys.exit(); 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" ) if lookForLib: sys.stdout.write( "Searching for Python library... " ) global py_libpath global py_libfile ! py_libfile = None ! py_libpath = None py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) if ( py_libfile ): *************** *** 265,269 **** --- 294,300 ---- if lookForHeaders: global py_incpath + global py_incfile py_incfile = None + py_incpath = None sys.stdout.write( "Searching for Python includes... " ) py_incfile, py_incpath = findFile( PYTHONINCSEARCHPATH ) *************** *** 274,277 **** --- 305,309 ---- sys.exit() + return True *************** *** 286,290 **** 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") ! parser.add_option("--python-includes", dest="py_incpath", help="Python include directory") parser.add_option("--python-libraries", dest="py_libpath", help="Python library path") parser.add_option("--qt-directory", dest="qt_dir", help="Base directory of Qt") --- 318,322 ---- 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") ! parser.add_option("--python-includes", dest="py_incpath", help="Python include path") parser.add_option("--python-libraries", dest="py_libpath", help="Python library path") parser.add_option("--qt-directory", dest="qt_dir", help="Base directory of Qt") *************** *** 293,297 **** parser.add_option("--enable-aidebug", action="store_true", dest="enable_aidebug", help="Enabled debugging of NPC AI.") parser.add_option("--enable-mysql", action="store_true", dest="enable_mysql", help="Enables MySQL support.") ! parser.add_option("--disable-translation", action="store_true", dest="disable_translation", help="Disable non-English language support.") (options, args) = parser.parse_args() --- 325,329 ---- parser.add_option("--enable-aidebug", action="store_true", dest="enable_aidebug", help="Enabled debugging of NPC AI.") parser.add_option("--enable-mysql", action="store_true", dest="enable_mysql", help="Enables MySQL support.") ! parser.add_option("--enable-translation", action="store_true", dest="enable_translation", help="Enable non-English language support.") (options, args) = parser.parse_args() *************** *** 299,303 **** nocolor() ! checkPython(options, True, not (sys.platform == "darwin") ) if options.enable_mysql: CONFIG += "mysql " --- 331,341 ---- nocolor() ! pyIncSearch = True ! pyLibSearch = True ! if sys.platform == "darwin": ! pyLibSearch = False ! ! checkPython( options, pyIncSearch, pyLibSearch ) ! if options.enable_mysql: CONFIG += "mysql " *************** *** 306,311 **** checkQt() ! if options.disable_translation: ! DEFINES += "QT_NO_TRANSLATION " # Create config.pri --- 344,349 ---- checkQt() ! if not options.enable_translation: ! DEFINES += "QT_NO_TRANSLATION " # Create config.pri *************** *** 320,324 **** config = file("config.pri", "w") config.write("# WARNING: This file was automatically generated by configure.py\n") ! config.write("# any changes to this file will be lost!\n") # Build Python LIBS and Includes --- 358,362 ---- config = file("config.pri", "w") config.write("# WARNING: This file was automatically generated by configure.py\n") ! config.write("# any changes to this file will be lost!\n\n") # Build Python LIBS and Includes *************** *** 355,365 **** config.close() ! sys.stdout.write(green("Generating makefile...")) sys.stdout.flush() os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro"]) if options.dsp: ! sys.stdout.write("Generating Visual Studio project files...\n") os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro", "-t vcapp"]) ! sys.stdout.write(bold("Done\n")) sys.stdout.write(bold("Configure finished. Please run 'make' now.\n")) --- 393,403 ---- config.close() ! sys.stdout.write("Generating makefile... ") sys.stdout.flush() os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro"]) if options.dsp: ! sys.stdout.write("Generating Visual Studio project files... \n") os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro", "-t vcapp"]) ! sys.stdout.write(bold(green("Done\n"))) sys.stdout.write(bold("Configure finished. Please run 'make' now.\n")) |
From: Richard M. <dr...@us...> - 2004-11-03 01:55:50
|
Update of /cvsroot/wpdev/wolfpack/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27316/ai Modified Files: ai.pri Log Message: Cleanups, trying to fix an odd display bug... Index: ai.pri =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ai/ai.pri,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ai.pri 16 Oct 2004 19:06:07 -0000 1.3 --- ai.pri 3 Nov 2004 01:55:39 -0000 1.4 *************** *** 2,9 **** # Input HEADERS += $$AI_H/ai.h \ ! $$AI_H/ai_mage.h SOURCES += $$AI_CPP/ai.cpp \ ! $$AI_CPP/ai_animals.cpp \ ! $$AI_CPP/ai_humans.cpp \ ! $$AI_CPP/ai_monsters.cpp \ ! $$AI_CPP/ai_mage.cpp --- 2,10 ---- # Input HEADERS += $$AI_H/ai.h \ ! $$AI_H/ai_mage.h ! SOURCES += $$AI_CPP/ai.cpp \ ! $$AI_CPP/ai_animals.cpp \ ! $$AI_CPP/ai_humans.cpp \ ! $$AI_CPP/ai_monsters.cpp \ ! $$AI_CPP/ai_mage.cpp |
From: Sebastian H. <dar...@us...> - 2004-11-02 20:50:18
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29990 Modified Files: wolfpack.pro Log Message: Index: wolfpack.pro =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v retrieving revision 1.214 retrieving revision 1.215 diff -C2 -d -r1.214 -r1.215 *** wolfpack.pro 8 Oct 2004 10:57:10 -0000 1.214 --- wolfpack.pro 2 Nov 2004 20:50:08 -0000 1.215 *************** *** 130,133 **** --- 130,134 ---- combat.cpp \ commands.cpp \ + content.cpp \ serverconfig.cpp \ console.cpp \ |
From: Sebastian H. <dar...@us...> - 2004-11-02 20:46:39
|
Update of /cvsroot/wpdev/wolfpack/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28950/ai Modified Files: ai_humans.cpp Log Message: Container content changes Index: ai_humans.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ai/ai_humans.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ai_humans.cpp 27 Oct 2004 14:06:54 -0000 1.27 --- ai_humans.cpp 2 Nov 2004 20:45:40 -0000 1.28 *************** *** 113,156 **** P_ITEM pPack = m_npc->getBankbox(); ! cItem::ContainerContent stableitems; if ( pPack ) ! { ! cItem::ContainerContent content = pPack->content(); ! cItem::ContainerContent::const_iterator it( content.begin() ); ! while ( it != content.end() ) ! { if ( !( *it )->hasTag( "player" ) || !( *it )->hasTag( "pet" ) ) continue; if ( ( *it ) && ( uint )( *it )->getTag( "player" ).toInt() == pTalker->serial() ) ! stableitems.push_back( ( *it ) ); ! ++it; } } ! if ( !stableitems.empty() ) { ! cItem::ContainerContent::const_iterator it( stableitems.begin() ); ! while ( it != stableitems.end() ) ! { ! if ( ( *it ) ) ! { ! P_NPC pPet = dynamic_cast<P_NPC>( World::instance()->findChar( ( *it )->getTag( "pet" ).toInt() ) ); ! if ( pPet ) ! { ! if (pTalker->pets().count() + pPet->controlSlots() > pTalker->maxControlSlots()) { ! m_npc->talk(1049612, pPet->name()); ! } else { ! pPet->free = false; ! // we need this for db saves ! pPet->setStablemasterSerial( INVALID_SERIAL ); ! pPet->setOwner( pTalker ); // This is important... ! pPet->moveTo( m_npc->pos() ); ! pPet->resend(); ! } } - ( *it )->remove(); } ! ++it; } --- 113,145 ---- P_ITEM pPack = m_npc->getBankbox(); ! QPtrList<cItem> stableitems; if ( pPack ) ! { ! for (ContainerIterator it(pPack); !it.atEnd(); ++it) { if ( !( *it )->hasTag( "player" ) || !( *it )->hasTag( "pet" ) ) continue; if ( ( *it ) && ( uint )( *it )->getTag( "player" ).toInt() == pTalker->serial() ) ! stableitems.append( ( *it ) ); } } ! if ( !stableitems.isEmpty() ) { ! for (P_ITEM pItem = stableitems.first(); pItem; pItem = stableitems.next()) { ! P_NPC pPet = dynamic_cast<P_NPC>( World::instance()->findChar( pItem->getTag( "pet" ).toInt() ) ); ! if ( pPet ) { ! if (pTalker->pets().count() + pPet->controlSlots() > pTalker->maxControlSlots()) { ! m_npc->talk(1049612, pPet->name()); ! } else { ! pPet->free = false; ! // we need this for db saves ! pPet->setStablemasterSerial( INVALID_SERIAL ); ! pPet->setOwner( pTalker ); // This is important... ! pPet->moveTo( m_npc->pos() ); ! pPet->resend(); } } ! pItem->remove(); } |
From: Sebastian H. <dar...@us...> - 2004-11-02 20:45:59
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28950/python Modified Files: item.cpp pyai.cpp Added Files: pycontent.h Removed Files: content.h Log Message: Container content changes --- content.h DELETED --- Index: item.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** item.cpp 29 Oct 2004 23:44:05 -0000 1.140 --- item.cpp 2 Nov 2004 20:45:46 -0000 1.141 *************** *** 36,40 **** #include "utilities.h" ! #include "content.h" #include "tempeffect.h" #include "objectcache.h" --- 36,40 ---- #include "utilities.h" ! #include "pycontent.h" #include "tempeffect.h" #include "objectcache.h" *************** *** 746,750 **** } ! return PyInt_FromLong( self->pItem->content().size() ); } --- 746,750 ---- } ! return PyInt_FromLong( self->pItem->content().count() ); } *************** *** 1238,1245 **** if ( !strcmp( "content", name ) ) { ! cItem::ContainerContent content = self->pItem->content(); ! PyObject* list = PyList_New( content.size() ); ! for ( uint i = 0; i < content.size(); ++i ) ! PyList_SetItem( list, i, PyGetItemObject( content[i] ) ); return list; } --- 1238,1246 ---- if ( !strcmp( "content", name ) ) { ! const ContainerContent &content = self->pItem->content(); ! PyObject* list = PyList_New( content.count() ); ! unsigned int i = 0; ! for (ContainerIterator it(content); !it.atEnd(); ++it) ! PyList_SetItem( list, i++, PyGetItemObject( *it ) ); return list; } Index: pyai.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/pyai.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pyai.cpp 22 Aug 2004 02:29:52 -0000 1.10 --- pyai.cpp 2 Nov 2004 20:45:47 -0000 1.11 *************** *** 32,38 **** #include "../player.h" #include "../singleton.h" #include "utilities.h" ! #include "content.h" #include "tempeffect.h" #include "objectcache.h" --- 32,39 ---- #include "../player.h" #include "../singleton.h" + #include "../items.h" #include "utilities.h" ! #include "pycontent.h" #include "tempeffect.h" #include "objectcache.h" --- NEW FILE: pycontent.h --- /* * Wolfpack Emu (WP) * UO Server Emulation Program * * Copyright 2001-2004 by holders identified in AUTHORS.txt * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. * * In addition to that license, if you are running this program or modified * versions of it on a public system you HAVE TO make the complete source of * the version used by you available or provide people with a location to * download it. * * Wolfpack Homepage: http://wpdev.sf.net/ */ #ifndef __CONTENT_H__ #define __CONTENT_H__ #include "../defines.h" #include "../content.h" #include "../items.h" #include "../world.h" #include "../basechar.h" #include "utilities.h" typedef struct { PyObject_HEAD; SERIAL contserial; } wpContent; static int wpContent_length( wpContent* self ) { P_ITEM pi = FindItemBySerial( self->contserial ); if ( pi ) return pi->content().count(); else { P_CHAR pc = FindCharBySerial( self->contserial ); if ( pc ) return pc->content().size(); } return 0; } static PyObject* wpContent_get( wpContent* self, int id ) { if ( isCharSerial( self->contserial ) ) { P_CHAR pc = FindCharBySerial( self->contserial ); if ( !pc ) goto error; cBaseChar::ItemContainer container = pc->content(); if ( id < 0 || static_cast<uint>( id ) >= container.size() ) goto error; cBaseChar::ItemContainer::const_iterator it( container.begin() ); /* * Ask Correa before trying to `optimize` this, * there isn't much standard complient options here. */ for ( int i = 0; i < id && it != container.end(); ++i ) ++it; if ( it != container.end() ) return PyGetItemObject( *it ); else goto error; } else { P_ITEM pi = FindItemBySerial( self->contserial ); if ( !pi ) goto error; const ContainerContent &container = pi->content(); if ( id < 0 || static_cast<uint>( id ) >= container.count() ) goto error; ContainerIterator it(container); if (!it.atEnd()) return (*it)->getPyObject(); else goto error; } error: Py_RETURN_NONE; } static PySequenceMethods wpContentSequence = { ( inquiry ) wpContent_length, 0, 0, ( intargfunc ) wpContent_get, 0, 0, 0, 0, 0, 0, }; static PyTypeObject wpContentType = { PyObject_HEAD_INIT( NULL ) 0, "wpContent", sizeof( wpContentType ), 0, wpDealloc, 0, 0, 0, 0, 0, 0,& wpContentSequence, 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, }; #endif |
From: Sebastian H. <dar...@us...> - 2004-11-02 20:45:58
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28950 Modified Files: basechar.cpp corpse.cpp items.cpp items.h npc.cpp server.cpp trade.cpp wolfpack.vcproj world.cpp Added Files: content.cpp content.h Log Message: Container content changes --- NEW FILE: content.h --- #if !defined(__CONTENT_H__) #define __CONTENT_H__ // Forward declarations class ContainerIterator; class ContainerContent; class cItem; class QString; #include <functional> /* Use this to make sure that a certain item type exists in a container. */ class ContainerComparer { public: virtual bool operator() (cItem *item) const { return false; } }; // This class manages the content of a container class ContainerContent { friend class ContainerIterator; friend class ContainerCopyIterator; private: cItem **content; public: ContainerContent(const ContainerContent &src) { // Copy content if (!src.content) { content = 0; } else { size_t count = src.maxCount() + 2; // How many slots content = new cItem* [count]; for (size_t i = 0; i < count; ++i) { content[i] = src.content[i]; } } } ContainerContent() { content = 0; } ~ContainerContent() { clear(); } // Tries to find an item in the container using the given ternary function. inline bool match(const ContainerComparer &functor) { bool result = false; size_t count = this->count(); for (size_t i = 2; i < 2 + count; ++i) { if (functor(content[i])) { result = true; break; } } return result; } inline size_t count() const { if (!content) { return 0; } else { return reinterpret_cast<size_t>(content[0]); } } inline size_t maxCount() const { if (!content) { return 0; } else { return reinterpret_cast<size_t>(content[1]); } } /* This method truncates the array or adds new elements to it. */ inline void ensureCapacity(size_t count) { // Round up to the nearest multiple of 16 for the item part size_t maxcount = ((count + 15) / 16) * 16 + 2; // 2 for real size and used size // Nothing at all... if (maxcount == 2) { clear(); } else if (maxcount != maxCount()) { if (content) { // Save old pointer cItem **oldContent = content; content = new cItem*[maxcount]; // Set the new size and maxsize content[0] = reinterpret_cast<cItem*>(count); // Write the _new_ count. content[1] = reinterpret_cast<cItem*>(maxcount); // Copy old items over size_t oldCount = reinterpret_cast<size_t>(oldContent[0]); for (size_t i = 2; (i < oldCount + 2) && (i < 2 + count); ++i) { content[i] = oldContent[i]; } // Delete old content delete [] oldContent; } else { content = new cItem*[maxcount]; content[0] = reinterpret_cast<cItem*>(count); content[1] = reinterpret_cast<cItem*>(maxcount); } } else if (content) { content[0] = reinterpret_cast<cItem*>(count); } } /* Checks if this item container contains the given item. */ inline bool contains(const cItem *item) const { bool result = false; size_t count = this->count(); // If there is no content, this will always be zero for (int i = 2; i < count + 2; ++i) { if (content[i] == item) { result = true; break; } } return result; } /* Removes an item from the array */ inline void remove(const cItem *item) { bool found = false; size_t count = this->count(); // Iterate trough all items. for (int i = 2; i < 2 + count; ++i) { if (content[i] != item) { continue; // Skip this item } // We found the item we want to remove here // What we do now is seek ahead and write all following items in the array // one index downwards for (int j = i + 1; j < 2 + count; ++j) { content[j - 1] = content[j]; // Swap Values } found = true; break; // It's insured that there is only once instance of an item here } if (found) { ensureCapacity(count - 1); // Decrease itemcount } } /* Adds an item to the array if it's not already there. */ inline void add(cItem *item) { if (!contains(item)) { size_t count = this->count(); // Retrieve current count ensureCapacity(count + 1); // Resize array and write the new count content[2 + count] = item; // Write to the end of the array } } /* Clear the array. */ inline void clear() { delete [] content; content = 0; } /* Return a string representation of the array. */ QString dump(); }; // This class manages an iteration over the content of an item. // This iterator is not invalidated by removing items from a container. However, // the iterator could skip an item if it points to an item behind the deleted // item. class ContainerIterator { private: size_t pos; // Position within the items array const ContainerContent &content; public: /* Iterate over the content of an item. */ ContainerIterator::ContainerIterator(const cItem *item); /* Iterate over a ContainerContent instance. */ ContainerIterator(const ContainerContent &container) : content(container), pos(0) { } // Get the current element cItem *operator *() { size_t count = content.count(); if (pos >= count) { return 0; } else { return content.content[2 + pos]; } } // Jump back to the first item in the iteration void reset() { pos = 0; } // Step to the next position ContainerIterator &operator ++() { pos++; return *this; } // Step to the previous position ContainerIterator &operator --() { pos++; return *this; } // Is this iterator at the end? bool atEnd() { size_t count = content.count(); return pos >= count; } // Utility Wrapper size_t count() { return content.count(); } // Seek to a given position in the array void seek(size_t pos) { this->pos = pos; } }; // This class works as mentioned above but contains a copy // of the content. class ContainerCopyIterator { private: size_t pos; // Position within the items array ContainerContent content; public: /* Iterate over the content of an item. */ ContainerCopyIterator::ContainerCopyIterator(const cItem *item); /* Iterate over a ContainerContent instance. */ ContainerCopyIterator(const ContainerContent &container) : pos(0) { content = ContainerContent(container); } // Get the current element cItem *operator *() { size_t count = content.count(); if (pos >= count) { return 0; } else { return content.content[2 + pos]; } } // Jump back to the first item in the iteration void reset() { pos = 0; } // Step to the next position ContainerCopyIterator &operator ++() { pos++; return *this; } // Step to the previous position ContainerCopyIterator &operator --() { pos++; return *this; } // Is this iterator at the end? bool atEnd() { size_t count = content.count(); return pos >= count; } // Utility Wrapper size_t count() { return content.count(); } // Seek to a given position in the array void seek(size_t pos) { this->pos = pos; } }; #endif Index: trade.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/trade.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** trade.cpp 30 Oct 2004 16:03:20 -0000 1.15 --- trade.cpp 2 Nov 2004 20:45:44 -0000 1.16 *************** *** 100,113 **** P_ITEM pStock = pVendor->getItemOnLayer( 0x1A ); - cItem::ContainerContent sContent; - - if ( pStock ) - sContent = pStock->content(); - P_ITEM pBought = pVendor->getItemOnLayer( 0x1B ); - cItem::ContainerContent bContent; - - if ( pBought ) - bContent = pBought->content(); Q_UINT32 totalValue = 0; --- 100,104 ---- *************** *** 130,158 **** // First check: is the item on the vendor in the specified layer ! if ( layer == 0x1A ) ! { ! if ( find_if( sContent.begin(), sContent.end(), bind2nd( MatchItemAndSerial(), pItem->serial() ) ) == sContent.end() ) ! { ! socket->sysMessage( tr( "Invalid item bought." ) ); ! socket->send( &clearBuy ); ! return; ! } ! amount = QMIN(pItem->restock(), amount); ! } ! else if ( layer == 0x1B ) ! { ! if ( find_if( bContent.begin(), bContent.end(), bind2nd( MatchItemAndSerial(), pItem->serial() ) ) == bContent.end() ) ! { ! socket->sysMessage( tr( "Invalid item bought." ) ); ! socket->send( &clearBuy ); ! return; ! } ! // Not enough of that item is left amount = QMIN(pItem->amount(), amount); ! } ! else ! { socket->sysMessage( tr( "Invalid item bought." ) ); socket->send( &clearBuy ); --- 121,130 ---- // First check: is the item on the vendor in the specified layer ! if (layer == cBaseChar::BuyRestockContainer) { amount = QMIN(pItem->restock(), amount); ! } else if (layer == cBaseChar::BuyNoRestockContainer) { // Not enough of that item is left amount = QMIN(pItem->amount(), amount); ! } else { socket->sysMessage( tr( "Invalid item bought." ) ); socket->send( &clearBuy ); *************** *** 292,297 **** return; } - cItem::ContainerContent sContent; - cItem::ContainerContent::const_iterator it; Q_UINT32 totalValue = 0; --- 264,267 ---- *************** *** 313,320 **** // First an equal item with higher amount must be in the vendors sell container! - sContent = pPurchase->content(); - bool found = false; ! for ( it = sContent.begin(); it != sContent.end(); ++it ) { if ( !( *it ) ) --- 283,288 ---- // First an equal item with higher amount must be in the vendors sell container! bool found = false; ! for (ContainerIterator it(pPurchase); !it.atEnd(); ++it) { if ( !( *it ) ) *************** *** 400,404 **** }*/ ! if ( pItem->isPileable() ) { P_ITEM pSold = pItem->dupe(); --- 368,372 ---- }*/ ! if ( pItem->isPileable() && amount < pItem->amount() ) { P_ITEM pSold = pItem->dupe(); *************** *** 408,411 **** --- 376,380 ---- pBought->addItem( pSold ); pSold->update(); + if ( pItem->amount() <= amount ) { pItem->remove(); *************** *** 417,421 **** else { - pPack->removeItem( pItem ); pBought->addItem( pItem ); pItem->update(); --- 386,389 ---- Index: basechar.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v retrieving revision 1.171 retrieving revision 1.172 diff -C2 -d -r1.171 -r1.172 *** basechar.cpp 27 Oct 2004 14:56:00 -0000 1.171 --- basechar.cpp 2 Nov 2004 20:45:42 -0000 1.172 *************** *** 827,833 **** // Move all items from the corpse to the backpack and then look for // previous equipment ! cItem::ContainerContent content = corpse->content(); ! cItem::ContainerContent::iterator it; ! for ( it = content.begin(); it != content.end(); ++it ) { backpack->addItem( *it, false ); --- 827,831 ---- // Move all items from the corpse to the backpack and then look for // previous equipment ! for (ContainerIterator it(corpse); !it.atEnd(); ++it) { backpack->addItem( *it, false ); *************** *** 2878,2885 **** // Create Loot - Either on the corpse or on the ground ! cItem::ContainerContent content = backpack->content(); ! cItem::ContainerContent::iterator it; ! ! for ( it = content.begin(); it != content.end(); ++it ) { P_ITEM item = *it; --- 2876,2880 ---- // Create Loot - Either on the corpse or on the ground ! for (ContainerIterator it(backpack); !it.atEnd(); ++it) { P_ITEM item = *it; Index: wolfpack.vcproj =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.vcproj,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** wolfpack.vcproj 16 Oct 2004 18:19:40 -0000 1.53 --- wolfpack.vcproj 2 Nov 2004 20:45:44 -0000 1.54 *************** *** 292,295 **** --- 292,301 ---- </File> <File + RelativePath=".\content.cpp"> + </File> + <File + RelativePath=".\content.h"> + </File> + <File RelativePath=".\contextmenu.cpp"> </File> *************** *** 665,671 **** </File> <File - RelativePath=".\python\content.h"> - </File> - <File RelativePath=".\python\engine.cpp"> </File> --- 671,674 ---- *************** *** 698,701 **** --- 701,707 ---- </File> <File + RelativePath=".\python\pycontent.h"> + </File> + <File RelativePath=".\python\pycoord.cpp"> </File> Index: items.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v retrieving revision 1.457 retrieving revision 1.458 diff -C2 -d -r1.457 -r1.458 *** items.cpp 30 Oct 2004 16:03:20 -0000 1.457 --- items.cpp 2 Nov 2004 20:45:43 -0000 1.458 *************** *** 280,287 **** bool cItem::containerPileItem( cItem* pItem ) { ! cItem::ContainerContent::const_iterator it( content_.begin() ); ! cItem::ContainerContent::const_iterator end( content_.end() ); ! for ( ; it != end; ++it ) ! { if ( ( *it )->pileItem( pItem ) ) return true; --- 280,284 ---- bool cItem::containerPileItem( cItem* pItem ) { ! for (ContainerIterator it(this); !it.atEnd(); ++it) { if ( ( *it )->pileItem( pItem ) ) return true; *************** *** 330,338 **** unsigned int rest = amount; P_ITEM pi; ! cItem::ContainerContent container( this->content() ); ! cItem::ContainerContent::const_iterator it( container.begin() ); ! cItem::ContainerContent::const_iterator end( container.end() ); ! for ( ; it != end; ++it ) ! { pi = *it; if ( pi->type() == 1 ) --- 327,331 ---- unsigned int rest = amount; P_ITEM pi; ! for (ContainerCopyIterator it(this); !it.atEnd(); ++it) { pi = *it; if ( pi->type() == 1 ) *************** *** 584,590 **** // Create a copy of the content so we don't accidently change our working copy ! ContainerContent container( content() ); ! ContainerContent::const_iterator it2; ! for ( it2 = container.begin(); it2 != container.end(); ++it2 ) ( *it2 )->remove(); --- 577,581 ---- // Create a copy of the content so we don't accidently change our working copy ! for (ContainerCopyIterator it2(this); !it2.atEnd(); ++it2) ( *it2 )->remove(); *************** *** 1084,1087 **** --- 1075,1079 ---- P_ITEM nItem = new cItem( *this ); nItem->setSerial( World::instance()->findItemSerial() ); + nItem->container_ = 0; if ( container_ ) *************** *** 1091,1095 **** if ( pchar ) { - nItem->container_ = 0; nItem->moveTo( pchar->pos(), true ); } --- 1083,1086 ---- *************** *** 1098,1103 **** P_ITEM item = dynamic_cast<P_ITEM>( container_ ); ! if ( item ) ! item->addItem( nItem, false, true, false ); } } --- 1089,1095 ---- P_ITEM item = dynamic_cast<P_ITEM>( container_ ); ! if ( item ) { ! item->addItem( nItem, false, true, false, false ); ! } } } *************** *** 1274,1283 **** QPtrList< cItem > cItem::getContainment() const { - ContainerContent containment = content(); - ContainerContent::iterator it = containment.begin(); QPtrList<cItem> itemlist; ! while ( it != containment.end() ) ! { P_ITEM pItem = *it; --- 1266,1272 ---- QPtrList< cItem > cItem::getContainment() const { QPtrList<cItem> itemlist; ! for (ContainerIterator it(content_); !it.atEnd(); ++it) { P_ITEM pItem = *it; *************** *** 1299,1304 **** else itemlist.append( pItem ); - - ++it; } --- 1288,1291 ---- *************** *** 1407,1415 **** } ! content_.push_back( pItem ); ! pItem->layer_ = 0; ! pItem->container_ = this; ! ! if ( handleWeight ) { // Increase the totalweight upward recursively --- 1394,1398 ---- } ! if ( !content_.contains(pItem) && handleWeight ) { // Increase the totalweight upward recursively *************** *** 1417,1420 **** --- 1400,1407 ---- } + content_.add( pItem ); + pItem->layer_ = 0; + pItem->container_ = this; + // If the Server is running and this happens, resend the tooltip of us and // all our parent containers. *************** *** 1432,1449 **** void cItem::removeItem( cItem* pItem, bool handleWeight ) { ! //ContainerContent::iterator it = std::find(content_.begin(), content_.end(), pItem); ! ContainerContent::iterator it = content_.begin(); ! while ( it != content_.end() ) ! { ! if ( ( *it ) == pItem ) ! { ! content_.erase( it ); ! if ( handleWeight ) ! { ! setTotalweight( this->totalweight() - pItem->totalweight() ); ! } ! break; } - ++it; } --- 1419,1428 ---- void cItem::removeItem( cItem* pItem, bool handleWeight ) { ! // only do this if it's really in the container ! if (content_.contains(pItem)) { ! content_.remove(pItem); ! if ( handleWeight ) { ! setTotalweight( this->totalweight() - pItem->totalweight() ); } } *************** *** 1466,1470 **** } ! cItem::ContainerContent cItem::content() const { return content_; --- 1445,1449 ---- } ! const ContainerContent &cItem::content() const { return content_; *************** *** 1473,1478 **** bool cItem::contains( const cItem* pItem ) const { ! ContainerContent::const_iterator it = std::find( content_.begin(), content_.end(), pItem ); ! return it != content_.end(); } --- 1452,1456 ---- bool cItem::contains( const cItem* pItem ) const { ! return content_.contains(pItem); } *************** *** 2032,2036 **** if ( type() == 1 ) { ! unsigned int count = content_.size(); unsigned int weight = ( unsigned int ) floor( totalweight_ ); tooltip.addLine( 1050044, QString( "%1\t%2" ).arg( count ).arg( weight ) ); --- 2010,2014 ---- if ( type() == 1 ) { ! unsigned int count = content_.count(); unsigned int weight = ( unsigned int ) floor( totalweight_ ); tooltip.addLine( 1050044, QString( "%1\t%2" ).arg( count ).arg( weight ) ); *************** *** 2095,2102 **** } ! ContainerContent::const_iterator it(content_.begin()); ! ContainerContent::const_iterator end(content_.end()); ! for ( ; it != end; ++it ) ! { count += ( *it )->countItems( baseids ); } --- 2073,2077 ---- } ! for (ContainerIterator it(this); !it.atEnd(); ++it) { count += ( *it )->countItems( baseids ); } *************** *** 2145,2157 **** } ! if ( content().size() > 0 ) ! { ! ContainerContent content( this->content() ); ! ContainerContent::iterator it = content.begin(); ! while ( amount > 0 && it != content.end() ) ! { ! amount = ( *it )->removeItems( baseids, amount ); ! ++it; ! } } --- 2120,2125 ---- } ! for (ContainerCopyIterator it(this); !it.atEnd(); ++it) { ! amount = ( *it )->removeItems( baseids, amount ); } *************** *** 2238,2244 **** cUObject::save(writer); ! // Save container content ! ContainerContent::iterator it = content_.begin(); ! for (; it != content_.end(); ++it) { (*it)->save(writer); } --- 2206,2211 ---- cUObject::save(writer); ! // Save container content ! for (ContainerIterator it(this); !it.atEnd(); ++it) { (*it)->save(writer); } Index: corpse.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/corpse.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** corpse.cpp 19 Aug 2004 01:55:55 -0000 1.65 --- corpse.cpp 2 Nov 2004 20:45:43 -0000 1.66 *************** *** 194,200 **** void cCorpse::update( cUOSocket* mSock ) { - // Do not send a normal item update here but something else instead - cItem::ContainerContent content = cItem::content(); - cUOTxCorpseEquipment corpseEquip; cUOTxItemContent corpseContent; --- 194,197 ---- Index: items.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/items.h,v retrieving revision 1.220 retrieving revision 1.221 diff -C2 -d -r1.220 -r1.221 *** items.h 10 Oct 2004 20:10:02 -0000 1.220 --- items.h 2 Nov 2004 20:45:44 -0000 1.221 *************** *** 36,39 **** --- 36,40 ---- #include "singleton.h" #include "objectdef.h" + #include "content.h" // Library Includes *************** *** 85,90 **** } - typedef QValueVector<cItem*> ContainerContent; - inline const char* objectID() const { --- 86,89 ---- *************** *** 371,375 **** void removeItem( cItem*, bool handleWeight = true ); void removeFromCont( bool handleWeight = true ); ! ContainerContent content() const; bool contains( const cItem* ) const; unsigned int countItems( const QStringList& baseids ) const; --- 370,374 ---- void removeItem( cItem*, bool handleWeight = true ); void removeFromCont( bool handleWeight = true ); ! const ContainerContent &content() const; // Return a reference to the container content object bool contains( const cItem* ) const; unsigned int countItems( const QStringList& baseids ) const; Index: server.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/server.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** server.cpp 21 Oct 2004 12:11:18 -0000 1.34 --- server.cpp 2 Nov 2004 20:45:44 -0000 1.35 *************** *** 80,83 **** --- 80,85 ---- #endif + #include "content.h" + cComponent::cComponent() { *************** *** 264,268 **** bool cServer::run( int argc, char** argv ) ! { // If have no idea where i should put this otherwise #if defined(Q_OS_UNIX) --- 266,270 ---- bool cServer::run( int argc, char** argv ) ! { // If have no idea where i should put this otherwise #if defined(Q_OS_UNIX) *************** *** 276,279 **** --- 278,308 ---- d->app = new QApplication ( argc, argv, false ); + /* cItem *item1 = (cItem*)0; + cItem *item2 = (cItem*)1; + cItem *item3 = (cItem*)2; + + ContainerContent content; + for (int i = 0; i < 18; ++i) { + content.add((cItem*)i); + } + + content.remove((cItem*)16); + content.remove((cItem*)15); + content.remove((cItem*)16); + content.remove((cItem*)17); + + Console::instance()->send(content.dump()); + + ContainerIterator it(content); + while (!it.atEnd()) { + Console::instance()->send(QString::number(reinterpret_cast<size_t>(*it)) + "\n"); + if ((*it) == item3) { + content.remove(item3); + } + ++it; + } + + return false;*/ + // Load wolfpack.xml Config::instance()->load(); --- NEW FILE: content.cpp --- #include "content.h" #include "items.h" #include <qstring.h> /* Iterate over the content of an item. */ ContainerIterator::ContainerIterator(const cItem *item) : content(item->content()), pos(0) { } ContainerCopyIterator::ContainerCopyIterator(const cItem *item) : pos(0) { content = ContainerContent(item->content()); } QString ContainerContent::dump() { QString result = "Content of array:\n"; result += QString("Count: %1; MaxCount: %2\n").arg(count()).arg(maxCount()); size_t count = this->count(); for (size_t i = 2; i < 2 + count; ++i) { result += QString("At %1: 0x%2\n").arg(i - 2).arg(reinterpret_cast<size_t>(content[i]), 0, 16); } return result; } Index: world.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** world.cpp 12 Oct 2004 23:59:28 -0000 1.135 --- world.cpp 2 Nov 2004 20:45:44 -0000 1.136 *************** *** 379,387 **** // Also delete all items inside if it's a container. ! cItem::ContainerContent container( pi->content() ); ! cItem::ContainerContent::const_iterator it( container.begin() ); ! cItem::ContainerContent::const_iterator end( container.end() ); ! for ( ; it != end; ++it ) ! quickdelete( *it ); // if it is within a multi, delete it from the multis vector --- 379,384 ---- // Also delete all items inside if it's a container. ! for (ContainerIterator it(pi); !it.atEnd(); ++it) ! quickdelete(*it); // if it is within a multi, delete it from the multis vector Index: npc.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** npc.cpp 26 Oct 2004 18:37:34 -0000 1.124 --- npc.cpp 2 Nov 2004 20:45:44 -0000 1.125 *************** *** 1358,1362 **** P_ITEM pContC = getItemOnLayer( cBaseChar::SellContainer ); ! if ( !pContC || pContC->content().size() == 0 ) { talk( 501550, 0, 0, false, saycolor_, player->socket() ); --- 1358,1362 ---- P_ITEM pContC = getItemOnLayer( cBaseChar::SellContainer ); ! if ( !pContC || pContC->content().count() == 0 ) { talk( 501550, 0, 0, false, saycolor_, player->socket() ); |
From: Sebastian H. <dar...@us...> - 2004-11-02 20:45:58
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28950/network Modified Files: uosocket.cpp Log Message: Container content changes Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.436 retrieving revision 1.437 diff -C2 -d -r1.436 -r1.437 *** uosocket.cpp 30 Oct 2004 16:03:21 -0000 1.436 --- uosocket.cpp 2 Nov 2004 20:45:46 -0000 1.437 *************** *** 2031,2042 **** Q_INT32 count = 0; - cItem::ContainerContent container = pCont->content(); - cItem::ContainerContent::const_iterator it( container.begin() ); - cItem::ContainerContent::const_iterator end( container.end() ); QPtrList<cItem> tooltipItems; ! tooltipItems.setAutoDelete( false ); ! ! for ( ; it != end; ++it ) ! { P_ITEM pItem = *it; --- 2031,2037 ---- Q_INT32 count = 0; QPtrList<cItem> tooltipItems; ! ! for (ContainerIterator it(pCont); !it.atEnd(); ++it) { P_ITEM pItem = *it; *************** *** 2634,2644 **** QPtrList<cItem> items; - cItem::ContainerContent container = pItem->content(); - cItem::ContainerContent::const_iterator it( container.begin() ); - cItem::ContainerContent::const_iterator end( container.end() ); - SortedSerialList sortedList; ! for ( ; it != end; ++it ) ! { sortedList.append( *it ); } --- 2629,2634 ---- QPtrList<cItem> items; SortedSerialList sortedList; ! for ( ContainerIterator it(pItem); !it.atEnd(); ++it) { sortedList.append( *it ); } *************** *** 2704,2710 **** pStock->setTag("last_restock_time", Server::instance()->time()); // Set the last restock time ! cItem::ContainerContent::iterator it; ! cItem::ContainerContent pStockContent = pStock->content(); // We need a copy since we are modifying the array ! for (it = pStockContent.begin(); it != pStockContent.end(); ++it) { P_ITEM pItem = *it; --- 2694,2698 ---- pStock->setTag("last_restock_time", Server::instance()->time()); // Set the last restock time ! for ( ContainerIterator it(pStock); !it.atEnd(); ++it) { P_ITEM pItem = *it; *************** *** 2732,2740 **** // Build the list of items to be sent. SortedSerialList itemList; - cItem::ContainerContent::iterator it; - cItem::ContainerContent pStockContent = pStock->content(); // We need a copy since we are modifying the array // Process all items for sale first ! for (it = pStockContent.begin(); it != pStockContent.end(); ++it) { if (itemList.count() >= 250) { break; // Only 250 items fit into the buy packet --- 2720,2726 ---- // Build the list of items to be sent. SortedSerialList itemList; // Process all items for sale first ! for ( ContainerIterator it(pStock); !it.atEnd(); ++it) { if (itemList.count() >= 250) { break; // Only 250 items fit into the buy packet *************** *** 2749,2754 **** // Now process all items that have been bought by the vendor ! cItem::ContainerContent pBoughtContent = pBought->content(); // We need a copy since we are modifying the array ! for (it = pBoughtContent.begin(); it != pBoughtContent.end(); ++it) { // Check all bought items if they decayed (one hour) int buy_time = (*it)->getTag("buy_time").toInt(); --- 2735,2739 ---- // Now process all items that have been bought by the vendor ! for (ContainerCopyIterator it(pBought); !it.atEnd(); ++it) { // Check all bought items if they decayed (one hour) int buy_time = (*it)->getTag("buy_time").toInt(); *************** *** 2838,2859 **** static void walkSellItems(P_ITEM pCont, P_ITEM pPurchase, QPtrList<cItem> &items) { - cItem::ContainerContent container = pPurchase->content(); - cItem::ContainerContent::const_iterator it( container.begin() ); - cItem::ContainerContent::const_iterator end( container.end() ); - - cItem::ContainerContent packcont = pCont->content(); - cItem::ContainerContent::const_iterator pit; - // For every pack item search for an equivalent sellitem ! pit = packcont.begin(); ! while ( pit != packcont.end() ) { P_ITEM pItem = *pit; // Containers with content are walked and _not_ sold ! if (pItem->type() == 1 && pItem->content().size() > 0) { walkSellItems(pItem, pPurchase, items); } else { // Search all sellable items ! for (it = container.begin(); it != container.end(); ++it) { P_ITEM mItem = *it; if ( pItem->baseid() == mItem->baseid() && pItem->scriptList() == mItem->scriptList() ) { --- 2823,2836 ---- static void walkSellItems(P_ITEM pCont, P_ITEM pPurchase, QPtrList<cItem> &items) { // For every pack item search for an equivalent sellitem ! for ( ContainerIterator pit(pCont); !pit.atEnd(); ++pit) { P_ITEM pItem = *pit; // Containers with content are walked and _not_ sold ! if (pItem->type() == 1 && pItem->content().count() > 0) { walkSellItems(pItem, pPurchase, items); } else { // Search all sellable items ! for ( ContainerIterator it(pPurchase); !it.atEnd(); ++it) { P_ITEM mItem = *it; if ( pItem->baseid() == mItem->baseid() && pItem->scriptList() == mItem->scriptList() ) { *************** *** 2863,2868 **** } } - - ++pit; } } --- 2840,2843 ---- |
From: Sebastian H. <dar...@us...> - 2004-11-01 17:23:01
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5451/commands Modified Files: tele.py Log Message: Index: tele.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/tele.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tele.py 1 Nov 2004 17:21:10 -0000 1.6 --- tele.py 1 Nov 2004 17:22:47 -0000 1.7 *************** *** 47,51 **** if args[0]: char.socket.sysmessage( 'Select your teleport destination.' ) ! char.socket.attachtarget( "commands.tele.teleport", [multi] ) return True --- 47,51 ---- if args[0]: char.socket.sysmessage( 'Select your teleport destination.' ) ! char.socket.attachtarget( "commands.tele.teleport", [True] ) return True |
From: Sebastian H. <dar...@us...> - 2004-11-01 17:21:35
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5076/commands Modified Files: tele.py Log Message: Index: tele.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/tele.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tele.py 1 Nov 2004 17:17:50 -0000 1.5 --- tele.py 1 Nov 2004 17:21:10 -0000 1.6 *************** *** 16,27 **** def onLoad(): wolfpack.registercommand( "tele", commandTele ) ! wolfpack.registercommand( "telem", commandTele ) return def commandTele( socket, cmd, args ): - multi = cmd == 'telem' - socket.sysmessage( 'Select your teleport destination.' ) ! socket.attachtarget( "commands.tele.teleport", [multi] ) return True --- 16,30 ---- def onLoad(): wolfpack.registercommand( "tele", commandTele ) ! wolfpack.registercommand( "telem", commandTeleM ) return + def commandTeleM( socket, cmd, args ): + socket.sysmessage( 'Select your teleport destination.' ) + socket.attachtarget( "commands.tele.teleport", [True] ) + return True + def commandTele( socket, cmd, args ): socket.sysmessage( 'Select your teleport destination.' ) ! socket.attachtarget( "commands.tele.teleport", [False] ) return True |
From: Sebastian H. <dar...@us...> - 2004-11-01 17:18:04
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4012/commands Modified Files: tele.py Log Message: Index: tele.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/tele.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tele.py 1 Nov 2004 17:16:13 -0000 1.4 --- tele.py 1 Nov 2004 17:17:50 -0000 1.5 *************** *** 43,48 **** if args[0]: ! socket.sysmessage( 'Select your teleport destination.' ) ! socket.attachtarget( "commands.tele.teleport", [multi] ) return True --- 43,48 ---- if args[0]: ! char.socket.sysmessage( 'Select your teleport destination.' ) ! char.socket.attachtarget( "commands.tele.teleport", [multi] ) return True |
From: Sebastian H. <dar...@us...> - 2004-11-01 17:16:22
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3597/commands Modified Files: tele.py Log Message: Added telem command Index: tele.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/tele.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tele.py 23 Sep 2004 00:27:55 -0000 1.3 --- tele.py 1 Nov 2004 17:16:13 -0000 1.4 *************** *** 4,7 **** --- 4,14 ---- """ + """ + \command telem + \description Transports you directly to the targetted location. + In addition, the target cursor is displayed again once you choose + a new location to allow you consecutive teleportation. + """ + import wolfpack from wolfpack import utilities *************** *** 9,17 **** def onLoad(): wolfpack.registercommand( "tele", commandTele ) return def commandTele( socket, cmd, args ): socket.sysmessage( 'Select your teleport destination.' ) ! socket.attachtarget( "commands.tele.teleport", [] ) return True --- 16,27 ---- def onLoad(): wolfpack.registercommand( "tele", commandTele ) + wolfpack.registercommand( "telem", commandTele ) return def commandTele( socket, cmd, args ): + multi = cmd == 'telem' + socket.sysmessage( 'Select your teleport destination.' ) ! socket.attachtarget( "commands.tele.teleport", [multi] ) return True *************** *** 31,33 **** --- 41,48 ---- utilities.smokepuff(char, source) utilities.smokepuff(char, target) + + if args[0]: + socket.sysmessage( 'Select your teleport destination.' ) + socket.attachtarget( "commands.tele.teleport", [multi] ) + return True |
From: Sebastian H. <dar...@us...> - 2004-11-01 17:16:13
|
Update of /cvsroot/wpdev/xmlscripts/documentation/webroot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3485/webroot Modified Files: ChangeLog.wolfpack Log Message: Added telem command Index: ChangeLog.wolfpack =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/documentation/webroot/ChangeLog.wolfpack,v retrieving revision 1.176 retrieving revision 1.177 diff -C2 -d -r1.176 -r1.177 *** ChangeLog.wolfpack 29 Oct 2004 22:12:31 -0000 1.176 --- ChangeLog.wolfpack 1 Nov 2004 17:16:02 -0000 1.177 *************** *** 8,11 **** --- 8,12 ---- - Male NPCs now have a 75% chance of getting a beard when created. - Made shrink potions craftable. + - Changed the color of shrink potions. * Python Script Changes: - Fixed bug #0000369. (Equip possible although item.movable = 3) *************** *** 23,27 **** --- 24,32 ---- - Fixed a skill check bug with lumberjacking. - Implemented shrink potions. + - Fixed the tooltip of alchemy tools not being resend. + - Fixed the input system trying to call not existent scripts. + - Fixed the color of shrunken pets. - Implemented shrink command. + - Implemented telem command. * Misc. Changes: - FAQ Updates. |
From: Klaus M. <nad...@us...> - 2004-10-31 22:21:21
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3603/definitions/items Modified Files: system.xml Log Message: documented shrink command added a category tag for trashcans Index: system.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/system.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** system.xml 17 Oct 2004 17:45:22 -0000 1.12 --- system.xml 31 Oct 2004 22:21:10 -0000 1.13 *************** *** 44,47 **** --- 44,48 ---- <movable>2</movable> <type>1</type> + <category>Equipment\Containers\Trashcan</category> </item> |
From: Klaus M. <nad...@us...> - 2004-10-31 22:21:20
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3603/scripts Modified Files: figurine.py Log Message: documented shrink command added a category tag for trashcans Index: figurine.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/figurine.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** figurine.py 29 Oct 2004 16:52:30 -0000 1.5 --- figurine.py 31 Oct 2004 22:21:10 -0000 1.6 *************** *** 119,120 **** --- 119,128 ---- def onLoad(): wolfpack.registercommand('shrink', shrink) + + """ + \command shrink + \description With this command you can shrink a NPC. + \usage - <code>shrink</code> + A figurine will be created at the point you shrinked it. + \notes This command cannot be used on players. + """ |
From: Sebastian H. <dar...@us...> - 2004-10-30 16:58:21
|
Update of /cvsroot/wpdev/xmlscripts/scripts/speech In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12395/speech Modified Files: banker.py Log Message: Speech fix. Index: banker.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/speech/banker.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** banker.py 12 Oct 2004 10:43:28 -0000 1.15 --- banker.py 30 Oct 2004 16:58:08 -0000 1.16 *************** *** 139,145 **** # Resend Status (Money changed) speaker.socket.resendstatus() ! break ! return 1 # An item has been dropped on us --- 139,145 ---- # Resend Status (Money changed) speaker.socket.resendstatus() ! return 1 ! return False # An item has been dropped on us |
From: Sebastian H. <dar...@us...> - 2004-10-30 16:22:14
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4774/magic Modified Files: runebook.py Log Message: runebook fix for playervendors Index: runebook.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/runebook.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** runebook.py 26 Oct 2004 20:43:55 -0000 1.18 --- runebook.py 30 Oct 2004 16:22:03 -0000 1.19 *************** *** 44,49 **** # def onShowTooltip(player, runebook, tooltip): - tooltip.reset() - tooltip.add(1028901, '') if runebook.hastag('description'): description = unicode(runebook.gettag('description')) --- 44,47 ---- |
From: Sebastian H. <dar...@us...> - 2004-10-30 16:22:07
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/professions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4720/items/professions Modified Files: mage.xml Log Message: runebook fix for playervendor Index: mage.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/professions/mage.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** mage.xml 21 Oct 2004 15:55:54 -0000 1.22 --- mage.xml 30 Oct 2004 16:21:58 -0000 1.23 *************** *** 37,40 **** --- 37,41 ---- <!-- Runebook --> <item id="22c5"> + <name>#1028901</name> <id>0x22c5</id> <color>0x461</color> |
From: Sebastian H. <dar...@us...> - 2004-10-30 16:09:08
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/humans/vendors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1588/npcs/humans/vendors Modified Files: leatherworker.xml Log Message: Index: leatherworker.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/humans/vendors/leatherworker.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** leatherworker.xml 19 Oct 2004 13:32:33 -0000 1.5 --- leatherworker.xml 30 Oct 2004 16:08:58 -0000 1.6 *************** *** 11,19 **** <shopkeeper> <restockable> ! <item id="1078"><amount>999</amount></item> <item id="1711"><amount>10</amount></item> </restockable> <sellable> - <item id="1078"/> <item id="1081"/> <item id="leather_cut"/> --- 11,18 ---- <shopkeeper> <restockable> ! <item id="leather_hides"><amount>999</amount></item> <item id="1711"><amount>10</amount></item> </restockable> <sellable> <item id="1081"/> <item id="leather_cut"/> |
From: Sebastian H. <dar...@us...> - 2004-10-30 16:09:05
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1547 Modified Files: book.py Log Message: Fixes for player vendors Index: book.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/book.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** book.py 9 Jul 2004 21:47:45 -0000 1.11 --- book.py 30 Oct 2004 16:08:49 -0000 1.12 *************** *** 29,32 **** --- 29,43 ---- def onUse(char, item): char.objectdelay = 0 + protected = False + + # If it's within another characters pack. This is true for player vendors for + # instance. + outmost = item.getoutmostchar() + + if outmost and outmost != char: + protected = True + + if item.hastag('protected'): + protected = True # Send BookOpen packet *************** *** 48,55 **** packet.setint(3, item.serial) # Book Serial ! if not item.hastag('protected'): packet.setbyte(7, 1) # Flag Writeable packet.setbyte(8, 1) # dito - pass pages = 64 --- 59,65 ---- packet.setint(3, item.serial) # Book Serial ! if not protected: packet.setbyte(7, 1) # Flag Writeable packet.setbyte(8, 1) # dito pages = 64 *************** *** 59,63 **** packet.setshort(9, pages) - packet.setshort(11, len(title) + 1) packet.setascii(13, title) --- 69,72 ---- *************** *** 68,74 **** packet.send(char.socket) ! if item.hastag('protected'): return 1 ! # Send a packet for each page !! # We could easily create packets bigger than 65k otherwise... --- 77,83 ---- packet.send(char.socket) ! if protected: return 1 ! # Send a packet for each page !! # We could easily create packets bigger than 65k otherwise... *************** *** 107,111 **** content = [] ! sendPage(socket, item.serial, page) # The client wants to update the page. --- 116,120 ---- content = [] ! sendPage(socket, item.serial, page, content) # The client wants to update the page. *************** *** 114,117 **** --- 123,132 ---- socket.sysmessage('This book is read only.') return 1 + + outmost = item.getoutmostchar() + + if outmost and outmost != socket.player: + socket.sysmessage('This book is read only.') + return 1 # Not writeable if item.hastag('pages'): *************** *** 173,176 **** --- 188,197 ---- char.message('This book is read only.') return 1 + + outmost = item.getoutmostchar() + + if outmost and outmost != socket.player: + socket.sysmessage('This book is read only.') + return 1 # Not writeable if len(author) == 0: |
From: Sebastian H. <dar...@us...> - 2004-10-30 16:09:04
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1547/system Modified Files: input.py Log Message: Fixes for player vendors Index: input.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/input.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** input.py 29 Oct 2004 14:49:13 -0000 1.2 --- input.py 30 Oct 2004 16:08:50 -0000 1.3 *************** *** 14,17 **** --- 14,18 ---- from wolfpack import console from wolfpack.consts import * + from wolfpack import tr # |
From: Sebastian H. <dar...@us...> - 2004-10-30 16:03:40
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv452 Modified Files: ChangeLog items.cpp serverconfig.cpp trade.cpp Log Message: Rewrote vendor buy handling. Index: trade.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/trade.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** trade.cpp 8 Oct 2004 01:13:16 -0000 1.14 --- trade.cpp 30 Oct 2004 16:03:20 -0000 1.15 *************** *** 127,131 **** Q_UINT16 amount = packet->iAmount( i ); ! Q_UINT8 layer = packet->iLayer( i ); // First check: is the item on the vendor in the specified layer --- 127,131 ---- Q_UINT16 amount = packet->iAmount( i ); ! Q_UINT8 layer = pItem->getOutmostItem()->layer(); // First check: is the item on the vendor in the specified layer *************** *** 138,141 **** --- 138,143 ---- return; } + + amount = QMIN(pItem->restock(), amount); } else if ( layer == 0x1B ) *************** *** 147,150 **** --- 149,155 ---- return; } + + // Not enough of that item is left + amount = QMIN(pItem->amount(), amount); } else *************** *** 155,174 **** } ! // Check amount ! if ( pItem->restock() > pItem->amount() ) ! pItem->setRestock( pItem->amount() ); ! ! // Nothing of that item left ! if ( pItem->restock() == 0 ) ! continue; ! ! totalValue += amount * pItem->buyprice(); ! ! if ( amount ) items.insert( make_pair( pItem->serial(), amount ) ); } ! if ( !items.size() ) ! { socket->send( &clearBuy ); pVendor->talk( 500190, 0, 0, false, 0xFFFF, pChar->socket() ); // Thou hast bought nothing! --- 160,170 ---- } ! if (amount) { ! totalValue += amount * pItem->buyprice(); items.insert( make_pair( pItem->serial(), amount ) ); + } } ! if ( !items.size() ) { socket->send( &clearBuy ); pVendor->talk( 500190, 0, 0, false, 0xFFFF, pChar->socket() ); // Thou hast bought nothing! *************** *** 206,212 **** { P_ITEM pItem = FindItemBySerial( iter->first ); ! Q_UINT16 amount = QMIN( iter->second, pItem->restock() ); ! ! pItem->setRestock( pItem->restock() - amount ); // Reduce the items in stock P_ITEM pSold; --- 202,206 ---- { P_ITEM pItem = FindItemBySerial( iter->first ); ! Q_UINT16 amount = iter->second; // we already checked if there is enough in stock P_ITEM pSold; *************** *** 215,218 **** --- 209,213 ---- pSold = pItem->dupe(); pSold->removeTag( "restock" ); // Remove the restock tag; + pSold->removeTag( "buy_time" ); pSold->setAmount( iter->second ); pPack->addItem( pSold ); *************** *** 226,229 **** --- 221,225 ---- pSold = pItem->dupe(); pSold->removeTag( "restock" ); // Remove the restock tag; + pSold->removeTag( "buy_time" ); pSold->setAmount( 1 ); pPack->addItem( pSold ); *************** *** 233,237 **** } ! //socket->sysMessage( tr( "You put the %1 into your pack" ).arg( pItem->getName() ) ); } --- 229,238 ---- } ! P_ITEM pCont = (P_ITEM)pItem->container(); ! if (pCont->layer() == cBaseChar::BuyRestockContainer) { ! pItem->setRestock( pItem->restock() - amount ); // Reduce the items in stock ! } else { ! pItem->reduceAmount( amount ); ! } } *************** *** 343,347 **** unsigned int sellprice = pItem->getSellPrice(pVendor); ! if (!sellprice) { socket->sysMessage( tr( "Invalid item sold." ) ); socket->send( &clearBuy ); --- 344,348 ---- unsigned int sellprice = pItem->getSellPrice(pVendor); ! if (!sellprice || !pItem->buyprice()) { socket->sysMessage( tr( "Invalid item sold." ) ); socket->send( &clearBuy ); *************** *** 361,365 **** { P_ITEM pItem = FindItemBySerial( iter->first ); ! Q_UINT16 amount = iter->second; if ( pItem->isPileable() ) --- 362,402 ---- { P_ITEM pItem = FindItemBySerial( iter->first ); ! Q_UINT16 amount = QMIN(pItem->amount(), iter->second); ! ! // If we can find something to stack with that is already in the vendors ! // no restock container, increase the amount of that item instead. ! // otherwise use the oldsytle handling. ! /*if (pItem->isPileable()) { ! bool processed = false; ! cItem::ContainerContent packContent = pBought->content(); ! cItem::ContainerContent::const_iterator cit; ! for (cit = packContent.begin(); cit != packContent.end(); ++cit) { ! P_ITEM pOtherItem = *cit; ! if (pItem->canStack(pOtherItem) && pOtherItem->amount() < 65000) { ! unsigned int realAmount = QMIN(65000 - pOtherItem->amount(), amount); ! ! pOtherItem->setAmount(pOtherItem->amount() + realAmount); ! pOtherItem->setTag("buy_time", Server::instance()->time()); ! ! if ( pItem->amount() <= realAmount ) { ! pItem->remove(); ! } else { ! pItem->setAmount( pItem->amount() - realAmount ); ! pItem->update(); ! } ! ! if (realAmount == amount) { ! processed = true; ! break; ! } else { ! amount -= realAmount; ! } ! } ! } ! ! if (processed) { ! continue; // Next item ! } ! }*/ if ( pItem->isPileable() ) *************** *** 367,378 **** P_ITEM pSold = pItem->dupe(); pSold->removeTag( "restock" ); ! pSold->setAmount( iter->second ); pBought->addItem( pSold ); pSold->update(); ! if ( pItem->amount() <= iter->second ) pItem->remove(); ! else ! pItem->setAmount( pItem->amount() - iter->second ); ! pItem->update(); } else --- 404,417 ---- P_ITEM pSold = pItem->dupe(); pSold->removeTag( "restock" ); ! pSold->setAmount( amount ); ! pSold->setTag("buy_time", Server::instance()->time()); pBought->addItem( pSold ); pSold->update(); ! if ( pItem->amount() <= amount ) { pItem->remove(); ! } else { ! pItem->setAmount( pItem->amount() - amount ); ! pItem->update(); ! } } else Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** ChangeLog 30 Oct 2004 11:04:42 -0000 1.127 --- ChangeLog 30 Oct 2004 16:03:20 -0000 1.128 *************** *** 16,19 **** --- 16,21 ---- open a container. - Fixed shop restock. + - Fixed bug #0000364. (Vendors not selling items they bought) + - Rewrote the vendor buy handler code. Wolfpack 12.9.12 Beta (18. October 2004) Index: items.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v retrieving revision 1.456 retrieving revision 1.457 diff -C2 -d -r1.456 -r1.457 *** items.cpp 27 Oct 2004 15:04:42 -0000 1.456 --- items.cpp 30 Oct 2004 16:03:20 -0000 1.457 *************** *** 2069,2073 **** // Do some basic checks and see if the item is a // container (they never stack). ! if ( id() != pItem->id() || color() != pItem->color() || type() == 1 || type() != pItem->type() || bindmenu() != pItem->bindmenu() || scriptList() != pItem->scriptList() || baseid() != pItem->baseid() ) { return false; --- 2069,2073 ---- // Do some basic checks and see if the item is a // container (they never stack). ! if ( name() != pItem->name() || id() != pItem->id() || color() != pItem->color() || type() == 1 || scriptList() != pItem->scriptList() || baseid() != pItem->baseid() ) { return false; *************** *** 2075,2082 **** // Check Tags (rather expensive) ! if ( tags_ != pItem->tags_ ) { return false; ! } return true; --- 2075,2082 ---- // Check Tags (rather expensive) ! /*if ( tags_ != pItem->tags_ ) { return false; ! }*/ return true; Index: serverconfig.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/serverconfig.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** serverconfig.cpp 30 Oct 2004 11:04:42 -0000 1.17 --- serverconfig.cpp 30 Oct 2004 16:03:20 -0000 1.18 *************** *** 160,164 **** tamedDisappear_ = getNumber( "General", "Tamed Disappear", 0, true ); houseInTown_ = getNumber( "General", "House In Town", 0, true ); ! shopRestock_ = getNumber( "General", "Shop Restock", 30, true ); quittime_ = getNumber( "General", "Char Time Out", 300, true ); cacheMulFiles_ = getBool( "General", "Cache Mul Files", true, true ); --- 160,164 ---- tamedDisappear_ = getNumber( "General", "Tamed Disappear", 0, true ); houseInTown_ = getNumber( "General", "House In Town", 0, true ); ! shopRestock_ = getNumber( "General", "Shop Restock", 60, true ); quittime_ = getNumber( "General", "Char Time Out", 300, true ); cacheMulFiles_ = getBool( "General", "Cache Mul Files", true, true ); |
From: Sebastian H. <dar...@us...> - 2004-10-30 16:03:39
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv452/network Modified Files: uosocket.cpp Log Message: Rewrote vendor buy handling. Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.435 retrieving revision 1.436 diff -C2 -d -r1.435 -r1.436 *** uosocket.cpp 30 Oct 2004 11:04:43 -0000 1.435 --- uosocket.cpp 30 Oct 2004 16:03:21 -0000 1.436 *************** *** 2621,2626 **** }; ! void cUOSocket::sendVendorCont( P_ITEM pItem ) ! { pItem->update( this ); // Make sure it's visible to the client --- 2621,2625 ---- }; ! void cUOSocket::sendVendorCont( P_ITEM pItem ) { pItem->update( this ); // Make sure it's visible to the client *************** *** 2668,2680 **** if ( amount >= 1 && mItem->buyprice() > 0 ) { ! itemContent.addItem( mItem->serial(), mItem->id(), mItem->color(), i, 1, amount, pItem->serial() ); ! ! // change how the name is displayed ! /*QString name = mItem->getName(true); ! name[0] = name[0].upper(); ! for ( uint j = 1; j < name.length() - 1; ++j ) ! if ( name.at(j).isSpace() ) ! name.at(j+1) = name.at(j+1).upper();*/ ! items.append( mItem ); ++i; --- 2667,2671 ---- if ( amount >= 1 && mItem->buyprice() > 0 ) { ! itemContent.addItem( mItem->serial(), mItem->id(), mItem->color(), i + 1, 1, amount, pItem->serial() ); items.append( mItem ); ++i; *************** *** 2687,2691 **** for ( P_ITEM item = items.last(); item; item = items.prev() ) { ! vendorBuy.addItem( item->buyprice(), " " ); item->sendTooltip( this ); } --- 2678,2682 ---- for ( P_ITEM item = items.last(); item; item = items.prev() ) { ! vendorBuy.addItem( item->buyprice(), "" ); item->sendTooltip( this ); } *************** *** 2693,2706 **** } ! void cUOSocket::sendBuyWindow( P_NPC pVendor ) ! { P_ITEM pBought = pVendor->atLayer( cBaseChar::BuyNoRestockContainer ); P_ITEM pStock = pVendor->atLayer( cBaseChar::BuyRestockContainer ); ! if ( pBought ) ! sendVendorCont( pBought ); ! if ( pStock ) ! sendVendorCont( pStock ); cUOTxDrawContainer drawContainer; --- 2684,2825 ---- } ! void cUOSocket::sendBuyWindow( P_NPC pVendor ) { P_ITEM pBought = pVendor->atLayer( cBaseChar::BuyNoRestockContainer ); P_ITEM pStock = pVendor->atLayer( cBaseChar::BuyRestockContainer ); + P_ITEM pSell = pVendor->atLayer( cBaseChar::SellContainer ); ! if (!pBought || !pStock || !pSell) { ! return; ! } ! unsigned int restockInterval = Config::instance()->shopRestock() * 60 * MY_CLOCKS_PER_SEC; ! unsigned int inventoryDecay = 60 * 60 * MY_CLOCKS_PER_SEC; ! ! // Perform maintaineance ! int lastRestockTime = pStock->getTag("last_restock_time").toInt(); ! ! // If the next restock interval has been reached or if the last restock time is in the future (server restart) ! // restock the vendor ! if (lastRestockTime + restockInterval < Server::instance()->time() || lastRestockTime > Server::instance()->time()) { ! pStock->setTag("last_restock_time", Server::instance()->time()); // Set the last restock time ! ! cItem::ContainerContent::iterator it; ! cItem::ContainerContent pStockContent = pStock->content(); // We need a copy since we are modifying the array ! for (it = pStockContent.begin(); it != pStockContent.end(); ++it) { ! P_ITEM pItem = *it; ! ! // This increases the maximum amount of this item by a factor of 2 if ! // it has been sold out ! if (pItem->restock() <= 0) { ! pItem->setAmount(pItem->amount() * 2); ! if (pItem->amount() > 999) { ! pItem->setAmount(999); ! } ! // If more than half of the items were still in stock when restocking ! // was issued, half the amount ! } else if (pItem->restock() >= pItem->amount() / 2) { ! if (pItem->amount() == 999) { ! pItem->setAmount(640); ! } else if (pItem->amount() > 10) { ! pItem->setAmount(pItem->amount() / 2); ! } ! } ! ! pItem->setRestock(pItem->amount()); // Restock full ! } ! } ! ! // Build the list of items to be sent. ! SortedSerialList itemList; ! cItem::ContainerContent::iterator it; ! cItem::ContainerContent pStockContent = pStock->content(); // We need a copy since we are modifying the array ! ! // Process all items for sale first ! for (it = pStockContent.begin(); it != pStockContent.end(); ++it) { ! if (itemList.count() >= 250) { ! break; // Only 250 items fit into the buy packet ! } ! ! if ((*it)->buyprice() <= 0 || (*it)->restock() <= 0) { ! continue; // This item is not for sale ! } ! ! itemList.append(*it); ! } ! ! // Now process all items that have been bought by the vendor ! cItem::ContainerContent pBoughtContent = pBought->content(); // We need a copy since we are modifying the array ! for (it = pBoughtContent.begin(); it != pBoughtContent.end(); ++it) { ! // Check all bought items if they decayed (one hour) ! int buy_time = (*it)->getTag("buy_time").toInt(); ! ! // Remove the item from the vendors inventory if its there for more than one hour or if it has been ! // bought in the future. ! if (buy_time + inventoryDecay < Server::instance()->time() || buy_time > Server::instance()->time()) { ! (*it)->remove(); ! continue; ! } ! ! // Only 250 items fit into the buy list ! if (itemList.count() < 250) { ! if ((*it)->buyprice() <= 0) { ! continue; // This item is not for sale ! } ! ! itemList.append(*it); ! } ! } ! ! // Process the items we found for sale ! if (itemList.count() == 0) { ! return; // Nothing for sale ! } ! ! // Send both containers to the client ! pBought->update(this); ! pStock->update(this); ! pSell->update(this); ! ! itemList.sort(); // Organize the container content by serial ! ! // Create the container content ! cUOTxItemContent containerContent; ! containerContent.resize(5 + itemList.count() * 19); ! containerContent.setShort(1, containerContent.size()); ! containerContent.setShort(3, itemList.count()); ! unsigned int pOffset = containerContent.size() - 19; // Start at the last item ! unsigned int i = itemList.count(); ! ! // This packet has the pricing information ! cUOTxVendorBuy vendorBuy; ! vendorBuy.setSerial(pStock->serial()); ! ! // This is something i dont understand. Why does it have to be backwards?? ! SortedSerialList::const_iterator cit(itemList.begin()); ! while (cit != itemList.end()) { ! P_ITEM pItem = *(cit++); // Get the current item and advance to the next ! containerContent.setInt(pOffset, pItem->serial()); ! containerContent.setShort(pOffset + 4, pItem->id()); ! containerContent[pOffset + 6] = 0; // Unknown ! ! if (pItem->hasTag("restock")) { ! containerContent.setShort(pOffset + 7, pItem->restock()); ! } else { ! containerContent.setShort(pOffset + 7, pItem->amount()); ! } ! containerContent.setShort(pOffset + 9, i--); // Item Id in packet (1 to n) ! containerContent.setShort(pOffset + 11, pItem->amount()); ! containerContent.setInt(pOffset + 13, pStock->serial()); ! containerContent.setShort(pOffset + 17, pItem->color()); ! pOffset -= 19; // Previous item ! ! if (!pItem->name().isEmpty()) ! vendorBuy.addItem(pItem->buyprice(), pItem->name()); // add it to the other packet as well ! else ! vendorBuy.addItem(pItem->buyprice(), QString::number(1020000 + pItem->id())); ! } ! ! send(&containerContent); // Send container content ! send(&vendorBuy); // Send pricing information cUOTxDrawContainer drawContainer; *************** *** 2709,2712 **** --- 2828,2836 ---- send( &drawContainer ); + cit = itemList.begin(); + while (cit != itemList.end()) { + (*(cit++))->sendTooltip(this); + } + // Send status gump with gold info sendStatWindow(); |