From: <mua...@us...> - 2009-08-18 20:52:15
|
Revision: 7 http://polserver.svn.sourceforge.net/polserver/?rev=7&view=rev Author: muaddib_pol Date: 2009-08-18 20:52:08 +0000 (Tue, 18 Aug 2009) Log Message: ----------- + Linux makefiles. Dount makefile and makefile2 are needed anylonger that I can tell, but oh well :o Added Paths: ----------- trunk/pol-core/bin/ trunk/pol-core/makefile.gcc trunk/pol-core/makefile2.gcc trunk/pol-core/makefile3.gcc trunk/pol-core/mk-debian trunk/pol-core/mk-redhat trunk/pol-core/mk-redhat-gprof trunk/pol-core/mk-redhat-stlport trunk/pol-core/mk-slackware trunk/pol-core/mk-slackware-openssl trunk/pol-core/mk.ksh Added: trunk/pol-core/makefile.gcc =================================================================== --- trunk/pol-core/makefile.gcc (rev 0) +++ trunk/pol-core/makefile.gcc 2009-08-18 20:52:08 UTC (rev 7) @@ -0,0 +1,231 @@ +### +### POL makefile.gcc +### + +### +### normal build: +### CC=gcc-3.0 make -f makefile.gcc +### + +target: release dynrelease + +all: release debug dynrelease dyndebug + +# for debugging: +# CXX_OPTS=-ggdb + +INC_STLPORT=-I/usr/local/include/stlport +# +CXX_OPTS=-gstabs+ -DINC_PASSERT=1 -Wall -Werror $(CXX_MORE_OPTS) + +CXX_RELEASE_OPTS=$(CXX_OPTS) + +CXX_DEBUG_OPTS=$(CXX_OPTS) + +CXX_OPTS_NOWARN=-gstabs+ -DINC_PASSERT=1 + + +cpp_sources = \ + pol/account.cpp pol/accounts.cpp pol/acscrobj.cpp pol/allocd.cpp pol/armor.cpp pol/attack.cpp \ + pol/attribute.cpp pol/auxclient.cpp \ + pol/bannedips.cpp pol/boat.cpp pol/boatcomp.cpp pol/boatemod.cpp pol/bowsalut.cpp \ + pol/binaryfilescrobj.cpp \ + pol/cfgemod.cpp pol/cfgrepos.cpp pol/cgdata.cpp pol/charactr.cpp pol/checkpnt.cpp \ + pol/chrcast.cpp \ + pol/chrituse.cpp pol/chrskuse.cpp \ + pol/client.cpp pol/clientio.cpp pol/cliface.cpp pol/cmbtcfg.cpp pol/cmdlevel.cpp \ + pol/containr.cpp pol/corpse.cpp \ + pol/create.cpp \ + pol/cryptengine.cpp \ + pol/crypt/crypt1264.cpp pol/crypt/crypt200.cpp pol/crypt/cryptignt.cpp \ + pol/ctable.cpp \ + pol/datastore.cpp \ + pol/dblclick.cpp pol/decay.cpp pol/dice.cpp pol/door.cpp pol/dropitem.cpp \ + pol/dye.cpp \ + pol/eqpitem.cpp pol/equipdsc.cpp pol/equipmnt.cpp clib/esignal.cpp pol/exscrobj.cpp \ + pol/extcmd.cpp \ + pol/fnsearch.cpp \ + pol/gameclck.cpp pol/getitem.cpp pol/getmsg.cpp pol/gflag.cpp pol/gprepos.cpp pol/guardrgn.cpp\ + pol/guilds.cpp \ + pol/heaven.cpp pol/help.cpp pol/house.cpp \ + pol/iostats.cpp \ + pol/irequest.cpp pol/item.cpp pol/item00.cpp pol/itemcr.cpp pol/itemdesc.cpp \ + pol/listenpt.cpp pol/loadunld.cpp pol/lockable.cpp pol/logfiles.cpp \ + pol/login.cpp pol/los.cpp pol/los2.cpp \ + pol/menu.cpp pol/menuinst.cpp pol/menusel.cpp pol/miscmsg.cpp pol/miscrgn.cpp \ + pol/mkscrobj.cpp \ + pol/movecost.cpp pol/movement.cpp \ + pol/msgfiltr.cpp \ + pol/multicfg.cpp pol/multicr.cpp pol/multidef.cpp pol/multis.cpp pol/musicrgn.cpp \ + pol/npc.cpp pol/npctmpl.cpp \ + pol/pkg.cpp pol/pol.cpp pol/polcfg.cpp pol/polclock.cpp pol/poldbg.cpp pol/polfile1.cpp \ + pol/polsem.cpp \ + pol/polsig.cpp pol/polstats.cpp pol/polsystememod.cpp \ + pol/poltest.cpp pol/polvar.cpp pol/polver.cpp pol/polwww.cpp \ + pol/profile.cpp pol/proplist.cpp \ + pol/readcfg.cpp pol/region.cpp pol/repsys.cpp pol/resource.cpp \ + pol/schedule.cpp pol/scrdef.cpp pol/scrsched.cpp pol/scrstore.cpp \ + pol/skilladv.cpp pol/sngclick.cpp \ + pol/sockio.cpp pol/speech.cpp \ + pol/spelbook.cpp pol/spells.cpp pol/ssopt.cpp pol/startloc.cpp pol/statmsg.cpp pol/storage.cpp \ + pol/syshook.cpp pol/systemhookscript.cpp \ + pol/target.cpp pol/tasks.cpp pol/testenv.cpp pol/textcmd.cpp pol/tildecmd.cpp pol/tiplstwn.cpp \ + pol/tips.cpp \ + pol/tmpvars.cpp pol/tooltips.cpp \ + pol/ucrypto.cpp pol/ufunc.cpp pol/ufunc2.cpp pol/uimport.cpp \ + pol/umap.cpp pol/uobjcnt.cpp pol/uobject.cpp pol/uobjhelp.cpp pol/uoclient.cpp \ + pol/uoemod.cpp pol/uoemod2.cpp pol/uoemod3.cpp pol/uoexhelp.cpp pol/uofile00.cpp \ + pol/uofile01.cpp pol/uofile02.cpp pol/uofile03.cpp pol/uoscrobj.cpp pol/uoskills.cpp \ + pol/useskill.cpp pol/utilemod.cpp pol/uvars.cpp \ + pol/uworld.cpp \ + pol/vital.cpp \ + pol/weapon.cpp \ + clib/xlate.cpp clib/xmain.cpp \ + pol/zone.cpp \ + bscript/basicio.cpp bscript/basicmod.cpp \ + bscript/berror.cpp bscript/blong.cpp bscript/bstruct.cpp \ + bscript/compctx.cpp bscript/eprog_read.cpp bscript/eprog2.cpp \ + bscript/dbl.cpp bscript/dict.cpp bscript/eprog.cpp bscript/escrutil.cpp \ + bscript/fmodule.cpp \ + bscript/escript_config.cpp \ + bscript/escriptv.cpp bscript/execmodl.cpp bscript/executor.cpp \ + bscript/object.cpp bscript/ofstrm.cpp \ + bscript/objstrm.cpp bscript/mathemod.cpp \ + bscript/str.cpp bscript/symcont.cpp bscript/tkn_strm.cpp \ + bscript/token.cpp bscript/userfunc.cpp \ + clib/cfgfile.cpp clib/cfgsect.cpp clib/dirlist.cpp clib/dualbuf.cpp \ + clib/fileutil.cpp \ + clib/mlog.cpp clib/nlogfile.cpp \ + clib/opnew.cpp clib/passert.cpp \ + clib/rarray.cpp clib/sckutil.cpp \ + clib/strexcpt.cpp clib/strset.cpp clib/strutil.cpp clib/tracebuf.cpp \ + clib/wnsckt.cpp \ + gp/gendef.cpp gp/gphelp.cpp gp/gtree.cpp gp/treegen.cpp + + +hold_cpp_sources = \ + uvars.cpp target.cpp ufunc.cpp ucrypto.cpp \ + speech.cpp tips.cpp login.cpp \ + dropitem.cpp getitem.cpp eqpitem.cpp \ + sockio.cpp clientio.cpp \ + stubdata.cpp + +c_sources = clib/endian.c clib/logfile.c clib/fdump.c clib/stracpy.c \ + clib/random.c clib/cmdargs.c + +ecompile_sources=ecompile/ecompile.cpp \ + bscript/compiler.cpp bscript/parser.cpp \ + bscript/token.cpp bscript/symcont.cpp \ + bscript/compctx.cpp bscript/tkn_strm.cpp \ + bscript/eprog.cpp bscript/eprog2.cpp bscript/userfunc.cpp \ + bscript/escriptv.cpp bscript/eprog3.cpp \ + bscript/fmodule.cpp bscript/eprog_read.cpp \ + clib/dirlist.cpp clib/fileutil.cpp \ + clib/strutil.cpp clib/rarray.cpp clib/filecont.cpp \ + clib/passert.cpp clib/xmain.cpp \ + clib/strexcpt.cpp + +runecl_sources=runecl/runecl.cpp \ + bscript/executor.cpp bscript/execmodl.cpp bscript/dbl.cpp \ + bscript/basicio.cpp bscript/basicmod.cpp bscript/berror.cpp \ + bscript/blong.cpp bscript/bstruct.cpp bscript/compctx.cpp \ + bscript/dict.cpp bscript/eprog.cpp bscript/eprog2.cpp \ + bscript/eprog3.cpp bscript/eprog_read.cpp bscript/escript_config.cpp \ + bscript/escriptv.cpp bscript/escrutil.cpp bscript/fmodule.cpp \ + bscript/mathemod.cpp bscript/object.cpp bscript/objstrm.cpp \ + bscript/ofstrm.cpp bscript/str.cpp bscript/symcont.cpp \ + bscript/tkn_strm.cpp bscript/token.cpp bscript/userfunc.cpp \ + clib/passert.cpp clib/rarray.cpp clib/strutil.cpp \ + clib/mlog.cpp clib/xmain.cpp clib/strexcpt.cpp + +ecompile_objects=$(ecompile_sources:.cpp=.o) $(c_sources:.c=.o) + +runecl_objects=$(runecl_sources:.cpp=.o) $(c_sources:.c=.o) + +objects = $(cpp_sources:.cpp=.o) $(c_sources:.c=.o) + +objects_debug = $(cpp_sources:.cpp=.debug.o) $(c_sources:.c=.debug.o) + +clib_objects = clib/dllist.o clib/logfile.o clib/drarray.o \ + clib/rarray.o clib/endian.o clib/fdump.o \ + clib/stracpy.o + +release: bin/pol + +bin/pol: $(objects) + $(CC) $(CXX_OPTS) -static -o bin/pol $(objects) -lpthread -lstdc++ -lm + +bin/ecompile: $(ecompile_objects) + $(CC) $(CXX_OPTS) -static -o bin/ecompile $(ecompile_objects) -lstdc++ -lm + +bin/runecl: $(runecl_objects) + $(CC) $(CXX_OPTS) -static -o bin/runecl $(runecl_objects) -lstdc++ -lm + +debug: $(objects_debug) + $(CC) $(CXX_OPTS) -static -o bin/poldebug $(objects_debug) -lpthread -lstdc++ -lm + +dynrelease: $(objects) + $(CC) $(CXX_OPTS) -o bin/poldynrelease $(objects) -lpthread -lstdc++ + +dyndebug: $(objects_debug) + $(CC) $(CXX_OPTS) -o bin/poldyndebug $(objects_debug) -lpthread -lstdc++ + +all: pol poldyn + +clean: + rm -f $(objects) $(clib_objects) + +gzipfile: bin/pol bin/ecompile bin/runecl + strip -o dist/pol bin/pol + strip -o dist/ecompile bin/ecompile + strip -o dist/runecl bin/runecl + (cd dist ; tar -cv pol ecompile runecl | gzip >pol-linuxbin-`date +%Y-%m-%d`.tar.gz ) + +# $(clib_objects) + +clib_library: + $(MAKE) -C clib + +#include $(c_sources:.c=.d) +#include $(cpp_sources:.cpp=.d) + + +## +## How to build C sources +## +%.o: %.c + $(CC) $(CXX_OPTS) -c -I . -o $@ $< + +## +## How to build C++ sources +## +%.o: %.cpp + $(CC) -x c++ $(CXX_RELEASE_OPTS) -c -I. -o $@ $< + +%.debug.o: %.cpp + $(CC) -x c++ $(CXX_DEBUG_OPTS) -c -I. -o $@ $< + +pol/crypwrap.o: pol/crypwrap.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt1264.o: pol/crypt/crypt1264.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt200.o: pol/crypt/crypt200.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/cryptignt.o: pol/crypt/cryptignt.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypwrap.debug.o: pol/crypwrap.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt1264.debug.o: pol/crypt/crypt1264.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt200.debug.o: pol/crypt/crypt200.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/cryptignt.debug.o: pol/crypt/cryptignt.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + Added: trunk/pol-core/makefile2.gcc =================================================================== --- trunk/pol-core/makefile2.gcc (rev 0) +++ trunk/pol-core/makefile2.gcc 2009-08-18 20:52:08 UTC (rev 7) @@ -0,0 +1,243 @@ +### +### POL makefile.gcc +### + +### +### normal build: +### CC=gcc-3.0 make -f makefile.gcc +### + +target: release dynrelease + +all: release debug dynrelease dyndebug + +# for debugging: +# CXX_OPTS=-ggdb + +INC_STLPORT=-I/usr/local/include/stlport +# +CXX_OPTS=-gstabs+ -DINC_PASSERT=1 -Wall -Werror $(CXX_MORE_OPTS) + +CXX_RELEASE_OPTS=$(CXX_OPTS) + +CXX_DEBUG_OPTS=$(CXX_OPTS) + +CXX_OPTS_NOWARN=-gstabs+ -DINC_PASSERT=1 + +VPATH=pol:bscript:clib:ecompile:runecl:gp + +sources = \ + account.cpp accounts.cpp acscrobj.cpp allocd.cpp armor.cpp attack.cpp \ + attribute.cpp auxclient.cpp \ + bannedips.cpp boat.cpp boatcomp.cpp boatemod.cpp bowsalut.cpp \ + binaryfilescrobj.cpp \ + cfgemod.cpp cfgrepos.cpp cgdata.cpp charactr.cpp checkpnt.cpp \ + chrcast.cpp \ + chrituse.cpp chrskuse.cpp \ + client.cpp clientio.cpp cliface.cpp cmbtcfg.cpp cmdlevel.cpp \ + containr.cpp corpse.cpp \ + create.cpp \ + cryptengine.cpp \ + crypt/crypt1264.cpp crypt/crypt200.cpp crypt/cryptignt.cpp \ + ctable.cpp \ + datastore.cpp \ + dblclick.cpp decay.cpp dice.cpp door.cpp dropitem.cpp \ + dye.cpp \ + eqpitem.cpp equipdsc.cpp equipmnt.cpp esignal.cpp exscrobj.cpp \ + extcmd.cpp \ + fnsearch.cpp \ + gameclck.cpp getitem.cpp getmsg.cpp gflag.cpp gprepos.cpp guardrgn.cpp\ + guilds.cpp \ + heaven.cpp help.cpp house.cpp \ + iostats.cpp \ + irequest.cpp item.cpp item00.cpp itemcr.cpp itemdesc.cpp \ + listenpt.cpp loadunld.cpp lockable.cpp logfiles.cpp \ + login.cpp los.cpp los2.cpp \ + menu.cpp menuinst.cpp menusel.cpp miscmsg.cpp miscrgn.cpp \ + mkscrobj.cpp \ + movecost.cpp movement.cpp \ + msgfiltr.cpp \ + multicfg.cpp multicr.cpp multidef.cpp multis.cpp musicrgn.cpp \ + npc.cpp npctmpl.cpp \ + pkg.cpp pol.cpp polcfg.cpp polclock.cpp poldbg.cpp polfile1.cpp \ + polsem.cpp \ + polsig.cpp polstats.cpp polsystememod.cpp \ + poltest.cpp polvar.cpp polver.cpp polwww.cpp \ + profile.cpp proplist.cpp \ + readcfg.cpp region.cpp repsys.cpp resource.cpp \ + schedule.cpp scrdef.cpp scrsched.cpp scrstore.cpp \ + skilladv.cpp sngclick.cpp \ + sockio.cpp speech.cpp \ + spelbook.cpp spells.cpp ssopt.cpp startloc.cpp statmsg.cpp storage.cpp \ + syshook.cpp systemhookscript.cpp \ + target.cpp tasks.cpp testenv.cpp textcmd.cpp tildecmd.cpp tiplstwn.cpp \ + tips.cpp \ + tmpvars.cpp tooltips.cpp \ + ucrypto.cpp ufunc.cpp ufunc2.cpp uimport.cpp \ + umap.cpp uobjcnt.cpp uobject.cpp uobjhelp.cpp uoclient.cpp \ + uoemod.cpp uoemod2.cpp uoemod3.cpp uoexhelp.cpp uofile00.cpp \ + uofile01.cpp uofile02.cpp uofile03.cpp uoscrobj.cpp uoskills.cpp \ + useskill.cpp utilemod.cpp uvars.cpp \ + uworld.cpp \ + vital.cpp \ + weapon.cpp \ + xlate.cpp xmain.cpp \ + zone.cpp \ + basicio.cpp basicmod.cpp \ + berror.cpp blong.cpp bstruct.cpp \ + compctx.cpp eprog_read.cpp eprog2.cpp \ + dbl.cpp dict.cpp eprog.cpp escrutil.cpp \ + fmodule.cpp \ + escript_config.cpp \ + escriptv.cpp execmodl.cpp executor.cpp \ + object.cpp ofstrm.cpp \ + objstrm.cpp mathemod.cpp \ + str.cpp symcont.cpp tkn_strm.cpp \ + token.cpp userfunc.cpp \ + cfgfile.cpp cfgsect.cpp dirlist.cpp dualbuf.cpp \ + fileutil.cpp \ + mlog.cpp nlogfile.cpp \ + opnew.cpp passert.cpp \ + rarray.cpp sckutil.cpp \ + strexcpt.cpp strset.cpp strutil.cpp tracebuf.cpp \ + wnsckt.cpp \ + gendef.cpp gphelp.cpp gtree.cpp treegen.cpp \ + endian.c logfile.c fdump.c stracpy.c \ + random.c cmdargs.c + +ecompile_sources=ecompile/ecompile.cpp \ + bscript/compiler.cpp bscript/parser.cpp \ + bscript/token.cpp bscript/symcont.cpp \ + bscript/compctx.cpp bscript/tkn_strm.cpp \ + bscript/eprog.cpp bscript/eprog2.cpp bscript/userfunc.cpp \ + bscript/escriptv.cpp bscript/eprog3.cpp \ + bscript/fmodule.cpp bscript/eprog_read.cpp \ + clib/dirlist.cpp clib/fileutil.cpp \ + clib/strutil.cpp clib/rarray.cpp clib/filecont.cpp \ + clib/passert.cpp clib/xmain.cpp \ + clib/strexcpt.cpp + +runecl_sources=runecl/runecl.cpp \ + bscript/executor.cpp bscript/execmodl.cpp bscript/dbl.cpp \ + bscript/basicio.cpp bscript/basicmod.cpp bscript/berror.cpp \ + bscript/blong.cpp bscript/bstruct.cpp bscript/compctx.cpp \ + bscript/dict.cpp bscript/eprog.cpp bscript/eprog2.cpp \ + bscript/eprog3.cpp bscript/eprog_read.cpp bscript/escript_config.cpp \ + bscript/escriptv.cpp bscript/escrutil.cpp bscript/fmodule.cpp \ + bscript/mathemod.cpp bscript/object.cpp bscript/objstrm.cpp \ + bscript/ofstrm.cpp bscript/str.cpp bscript/symcont.cpp \ + bscript/tkn_strm.cpp bscript/token.cpp bscript/userfunc.cpp \ + clib/passert.cpp clib/rarray.cpp clib/strutil.cpp \ + clib/mlog.cpp clib/xmain.cpp clib/strexcpt.cpp + +ecompile_objects=$(ecompile_sources:.cpp=.o) $(c_sources:.c=.o) + +runecl_objects=$(runecl_sources:.cpp=.o) $(c_sources:.c=.o) + +objects1 = $(sources:.cpp=.o) $(c_sources:.c=.o) + +objects1 = $(patsubst %.cpp,%.o,$(sources)) +objects2 = $(patsubst %.c,%.o,$(objects1)) + +objects = $(objects2) + + + +objects_debug = $(cpp_sources:.cpp=.debug.o) $(c_sources:.c=.debug.o) + +clib_objects = clib/dllist.o clib/logfile.o clib/drarray.o \ + clib/rarray.o clib/endian.o clib/fdump.o \ + clib/stracpy.o + +release: bin/pol + +bin/pol: $(objects) + $(CC) $(CXX_OPTS) -static -o bin/pol $(objects) -lpthread -lstdc++ -lm + +bin/ecompile: $(ecompile_objects) + $(CC) $(CXX_OPTS) -static -o bin/ecompile $(ecompile_objects) -lstdc++ -lm + +bin/runecl: $(runecl_objects) + $(CC) $(CXX_OPTS) -static -o bin/runecl $(runecl_objects) -lstdc++ -lm + +debug: $(objects_debug) + $(CC) $(CXX_OPTS) -static -o bin/poldebug $(objects_debug) -lpthread -lstdc++ -lm + +dynrelease: $(objects) + $(CC) $(CXX_OPTS) -o bin/poldynrelease $(objects) -lpthread -lstdc++ + +dyndebug: $(objects_debug) + $(CC) $(CXX_OPTS) -o bin/poldyndebug $(objects_debug) -lpthread -lstdc++ + +all: pol poldyn + +clean: + rm -f $(objects) $(clib_objects) + +gzipfile: bin/pol bin/ecompile bin/runecl + strip -o dist/pol bin/pol + strip -o dist/ecompile bin/ecompile + strip -o dist/runecl bin/runecl + (cd dist ; tar -cv pol ecompile runecl | gzip >pol-linuxbin-`date +%Y-%m-%d`.tar.gz ) + +# $(clib_objects) + +clib_library: + $(MAKE) -C clib + +#include $(c_sources:.c=.d) +#include $(cpp_sources:.cpp=.d) + + +## +## How to build C sources +## +%.o: %.c + $(CC) $(CXX_OPTS) -c -I . -o $@ $< + +## +## How to build C++ sources +## +%.o: %.cpp + $(CC) -x c++ $(CXX_RELEASE_OPTS) -c -I. -o $@ $< + +%.debug.o: %.cpp + $(CC) -x c++ $(CXX_DEBUG_OPTS) -c -I. -o $@ $< + +pol/crypwrap.o: pol/crypwrap.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt1264.o: pol/crypt/crypt1264.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt200.o: pol/crypt/crypt200.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/cryptignt.o: pol/crypt/cryptignt.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypwrap.debug.o: pol/crypwrap.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt1264.debug.o: pol/crypt/crypt1264.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt200.debug.o: pol/crypt/crypt200.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/cryptignt.debug.o: pol/crypt/cryptignt.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + + + +%.d: %.cpp + set -e; $(CC) -x c++ $(CPPFLAGS) -I. -MM $< \ + | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \ + [ -s $@ ] || rm -f $@ + +%.d: %.c + set -e; $(CC) $(CPPFLAGS) -I. -MM $< \ + | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \ + [ -s $@ ] || rm -f $@ + +include $(objects:.o=.d) Added: trunk/pol-core/makefile3.gcc =================================================================== --- trunk/pol-core/makefile3.gcc (rev 0) +++ trunk/pol-core/makefile3.gcc 2009-08-18 20:52:08 UTC (rev 7) @@ -0,0 +1,420 @@ +### +### POL makefile.gcc +### + +### +### normal build: +### CC=gcc-3.0 make -f makefile.gcc +### + +target: release dynrelease + +all: release debug dynrelease dyndebug + +dist: gzipfile gzipfile-dynamic + +# for debugging: +# CXX_OPTS=-ggdb + +POL_RELEASE=097 + +ifdef USE_STLPORT +LIB_STL=stlport +INC_STL=-I/usr/local/include/stlport +else +LIB_STL=stdc++ +INC_STL=-I. +endif + +ifdef FREEBSD +POL_BUILDNAME=freebsd +LIB_MORE=-lexecinfo +else +POL_BUILDNAME=linux +LIB_MORE= +endif + +CXX_OPTS=-gstabs+ -DINC_PASSERT=1 -Wall -Werror $(CXX_MORE_OPTS) $(INC_STL) + +CXX_RELEASE_OPTS=$(CXX_OPTS) + +CXX_DEBUG_OPTS=$(CXX_OPTS) + +CXX_OPTS_NOWARN=-gstabs+ -DINC_PASSERT=1 $(CXX_MORE_OPTS) $(INC_STL) + +ifndef LINKER +LINKER=g++ +endif + +cpp_sources = \ + clib/progver.cpp plib/polver.cpp \ + pol/account.cpp pol/accounts.cpp pol/acscrobj.cpp pol/allocd.cpp \ + pol/armor.cpp pol/attack.cpp \ + pol/attribute.cpp pol/auxclient.cpp \ + pol/bannedips.cpp pol/boat.cpp pol/boatcomp.cpp pol/boatemod.cpp \ + pol/bowsalut.cpp \ + pol/binaryfilescrobj.cpp \ + pol/cfgemod.cpp pol/cfgrepos.cpp pol/cgdata.cpp pol/charactr.cpp \ + pol/checkpnt.cpp \ + pol/chrcast.cpp pol/chrituse.cpp pol/chrskuse.cpp pol/client.cpp \ + pol/clientio.cpp \ + pol/cliface.cpp pol/cmbtcfg.cpp pol/cmdlevel.cpp pol/containr.cpp \ + pol/console.cpp pol/core.cpp pol/corpse.cpp \ + pol/create.cpp \ + pol/cryptengine.cpp pol/crypt/cryptbase.cpp pol/crypt/cryptkey.cpp \ + pol/crypt/nocrypt.cpp pol/crypt/blowfish.cpp pol/crypt/twofish.cpp \ + pol/ctable.cpp \ + pol/customhouses.cpp pol/customhousehelp.cpp \ + pol/datastore.cpp pol/dblclick.cpp pol/decay.cpp pol/dice.cpp \ + pol/door.cpp pol/dropitem.cpp \ + pol/dye.cpp \ + pol/eqpitem.cpp pol/equipdsc.cpp pol/equipmnt.cpp clib/esignal.cpp \ + pol/exscrobj.cpp \ + pol/extcmd.cpp \ + pol/fileaccess.cpp pol/fnsearch.cpp \ + pol/gameclck.cpp pol/getitem.cpp pol/getmsg.cpp pol/gflag.cpp \ + pol/gprepos.cpp pol/guardrgn.cpp\ + pol/guilds.cpp \ + pol/help.cpp pol/house.cpp \ + pol/iostats.cpp pol/irequest.cpp pol/item.cpp pol/item00.cpp \ + pol/itemcr.cpp pol/itemdesc.cpp \ + pol/landtile.cpp \ + pol/listenpt.cpp pol/loadunld.cpp pol/lockable.cpp pol/logfiles.cpp \ + pol/loaddata.cpp pol/login.cpp \ + pol/menu.cpp pol/menusel.cpp pol/miscmsg.cpp \ + pol/miscrgn.cpp pol/mkscrobj.cpp \ + pol/movecost.cpp pol/movement.cpp pol/msgfiltr.cpp \ + pol/multicfg.cpp pol/multicr.cpp pol/multidef.cpp pol/multis.cpp \ + pol/multidef2.cpp \ + pol/musicrgn.cpp \ + pol/npc.cpp pol/npctmpl.cpp pol/npctemplates.cpp \ + pol/objecthash.cpp \ + pol/packethooks.cpp pol/packetscrobj.cpp party.cpp \ + pol/pol.cpp pol/polcfg.cpp pol/polclock.cpp pol/poldbg.cpp \ + pol/polfile2.cpp pol/polsem.cpp pol/polsig.cpp pol/polstats.cpp \ + pol/polsystememod.cpp \ + pol/poltest.cpp pol/polvar.cpp pol/polwww.cpp pol/profile.cpp \ + pol/proplist.cpp \ + pol/reftypes.cpp pol/readcfg.cpp pol/region.cpp pol/repsys.cpp \ + pol/resource.cpp \ + pol/realms.cpp \ + pol/savedata.cpp \ + pol/schedule.cpp pol/scrdef.cpp pol/scrsched.cpp pol/scrstore.cpp \ + pol/skilladv.cpp \ + pol/sngclick.cpp pol/sockio.cpp pol/speech.cpp pol/spelbook.cpp \ + pol/spells.cpp pol/ssopt.cpp \ + clib/socketsvc.cpp pol/stackcfg.cpp \ + pol/startloc.cpp pol/statmsg.cpp pol/storage.cpp pol/syshook.cpp \ + pol/systemhookscript.cpp \ + pol/target.cpp pol/tasks.cpp plib/testenv.cpp pol/textcmd.cpp \ + pol/tildecmd.cpp pol/tiles.cpp pol/tiplstwn.cpp \ + pol/tips.cpp pol/tmpvars.cpp pol/tooltips.cpp \ + pol/ucrypto.cpp pol/ufunc.cpp pol/ufunc2.cpp pol/uimport.cpp \ + pol/umap.cpp pol/uniemod.cpp \ + pol/uobjcnt.cpp pol/uobject.cpp pol/uobjhelp.cpp pol/uoclient.cpp \ + pol/uoemod.cpp pol/uoemod2.cpp \ + pol/uoemod3.cpp pol/uoemod4.cpp pol/uoexhelp.cpp \ + pol/uolisten.cpp \ + pol/uoscrobj.cpp pol/uoskills.cpp pol/useskill.cpp \ + pol/utilemod.cpp \ + pol/uvars.cpp pol/uworld.cpp \ + pol/vital.cpp \ + pol/weapon.cpp \ + pol/zone.cpp \ + pol/attributemod.cpp pol/clemod.cpp pol/clfunc.cpp pol/storagemod.cpp pol/vitalmod.cpp \ + plib/mapfunc.cpp plib/mapserver.cpp plib/pkg.cpp plib/realm.cpp \ + plib/filemapserver.cpp plib/inmemorymapserver.cpp \ + plib/realmfunc.cpp \ + plib/maptileserver.cpp plib/realmdescriptor.cpp plib/staticserver.cpp \ + plib/testdrop1.cpp plib/testwalk1.cpp \ + plib/testlos1.cpp plib/realmlos.cpp plib/realmlos2.cpp \ + bscript/basicio.cpp bscript/basicmod.cpp bscript/berror.cpp \ + bscript/blong.cpp bscript/bstruct.cpp \ + bscript/compctx.cpp bscript/compilercfg.cpp bscript/eprog_read.cpp \ + bscript/eprog2.cpp \ + bscript/dbl.cpp bscript/dict.cpp bscript/eprog.cpp \ + bscript/escrutil.cpp \ + bscript/escript_config.cpp bscript/escriptv.cpp bscript/execmodl.cpp \ + bscript/executor.cpp \ + bscript/fmodule.cpp \ + bscript/mathemod.cpp \ + bscript/object.cpp bscript/ofstrm.cpp bscript/objstrm.cpp \ + bscript/parser.cpp \ + bscript/str.cpp bscript/symcont.cpp \ + bscript/tkn_strm.cpp bscript/token.cpp \ + bscript/userfunc.cpp \ + clib/binaryfile.cpp clib/cfgfile.cpp clib/cfgsect.cpp \ + clib/dirlist.cpp clib/dualbuf.cpp \ + clib/fileutil.cpp clib/iohelp.cpp \ + clib/kbhit.cpp \ + clib/mlog.cpp clib/MD5.cpp \ + clib/nlogfile.cpp \ + clib/opnew.cpp \ + clib/passert.cpp \ + clib/rarray.cpp \ + clib/sckutil.cpp clib/strexcpt.cpp clib/strset.cpp clib/strutil.cpp \ + clib/threadhelp.cpp \ + clib/tracebuf.cpp \ + clib/endian.cpp clib/logfile.cpp clib/fdump.cpp clib/stracpy.cpp \ + clib/random.cpp clib/cmdargs.cpp clib/wallclock.cpp \ + clib/wnsckt.cpp \ + clib/xmain.cpp \ + clib/unicode.cpp \ + gp/gendef.cpp gp/gphelp.cpp gp/gtree.cpp \ + gp/treegen.cpp + +# pol/crypt/crypt1264.cpp pol/crypt/crypt200.cpp pol/crypt/cryptignt.cpp \ + + +hold_cpp_sources = \ + uvars.cpp target.cpp ufunc.cpp ucrypto.cpp \ + speech.cpp tips.cpp login.cpp \ + dropitem.cpp getitem.cpp eqpitem.cpp \ + sockio.cpp clientio.cpp \ + stubdata.cpp + +ecompile_sources=ecompile/ecompile.cpp \ + plib/polver.cpp plib/pkg.cpp \ + bscript/compilercfg.cpp bscript/compiler.cpp bscript/parser.cpp \ + bscript/token.cpp bscript/symcont.cpp \ + bscript/compctx.cpp bscript/tkn_strm.cpp \ + bscript/eprog.cpp bscript/eprog2.cpp bscript/userfunc.cpp \ + bscript/escriptv.cpp bscript/eprog3.cpp \ + bscript/fmodule.cpp bscript/eprog_read.cpp \ + clib/cfgfile.cpp \ + clib/dirlist.cpp clib/esignal.cpp clib/fileutil.cpp \ + clib/strutil.cpp clib/rarray.cpp clib/filecont.cpp \ + clib/progver.cpp clib/passert.cpp clib/xmain.cpp \ + clib/endian.cpp clib/logfile.cpp clib/fdump.cpp clib/stracpy.cpp \ + clib/random.cpp clib/cmdargs.cpp \ + clib/strexcpt.cpp clib/threadhelp.cpp clib/wallclock.cpp + +runecl_sources=runecl/runecl.cpp \ + bscript/executor.cpp bscript/execmodl.cpp bscript/dbl.cpp \ + bscript/basicio.cpp bscript/basicmod.cpp bscript/berror.cpp \ + bscript/blong.cpp bscript/bstruct.cpp bscript/compctx.cpp \ + bscript/dict.cpp bscript/eprog.cpp bscript/eprog2.cpp \ + bscript/eprog3.cpp bscript/eprog_read.cpp bscript/escript_config.cpp \ + bscript/escriptv.cpp bscript/escrutil.cpp bscript/fmodule.cpp \ + bscript/mathemod.cpp bscript/object.cpp bscript/objstrm.cpp \ + bscript/ofstrm.cpp bscript/str.cpp bscript/symcont.cpp \ + bscript/tkn_strm.cpp bscript/token.cpp bscript/userfunc.cpp \ + bscript/parser.cpp bscript/compilercfg.cpp \ + clib/passert.cpp clib/rarray.cpp clib/strutil.cpp \ + clib/endian.cpp clib/esignal.cpp clib/logfile.cpp clib/fdump.cpp \ + clib/stracpy.cpp clib/cfgfile.cpp clib/fileutil.cpp \ + clib/random.cpp clib/cmdargs.cpp clib/dirlist.cpp \ + clib/progver.cpp \ + clib/mlog.cpp clib/xmain.cpp clib/strexcpt.cpp clib/threadhelp.cpp \ + clib/wallclock.cpp + +uoconvert_sources=uoconvert/uoconvert.cpp \ + pol/uofile00.cpp pol/uofile01.cpp pol/uofile02.cpp \ + pol/uofile07.cpp pol/uofile08.cpp \ + pol/polfile1.cpp \ + plib/mapfunc.cpp plib/mapwriter.cpp plib/realmdescriptor.cpp \ + clib/cfgfile.cpp clib/cmdargs.cpp clib/strutil.cpp \ + clib/fileutil.cpp clib/passert.cpp clib/dirlist.cpp clib/iohelp.cpp \ + clib/logfile.cpp \ + clib/progver.cpp clib/esignal.cpp clib/random.cpp clib/strexcpt.cpp \ + clib/wallclock.cpp \ + clib/xmain.cpp + +uotool_sources=uotool/uotool.cpp \ + uotool/uofile04.cpp uotool/uofile05.cpp +# clib/esignal.cpp clib/fileutil.cpp \ +# clib/cfgfile.cpp clib/fdump.cpp clib/strutil.cpp \ +# clib/dirlist.cpp clib/passert.cpp clib/progver.cpp \ +# clib/logfile.cpp \ +# plib/realm.cpp plib/polver.cpp plib/realmdescriptor.cpp \ +# plib/maptileserver.cpp plib/mapserver.cpp plib/staticserver.cpp \ +# plib/mapfunc.cpp plib/mapwriter.cpp \ +# pol/polcfg.cpp pol/polfile1.cpp pol/polfile2.cpp\ +# pol/multidef.cpp \ +# pol/uofile00.cpp pol/uofile01.cpp pol/uofile02.cpp pol/uofile03.cpp \ +# pol/uofile06.cpp pol/uofile07.cpp pol/uofile08.cpp + +poltool_sources=poltool/poltool.cpp + +ecompile_objects=$(ecompile_sources:.cpp=.o) $(c_sources:.c=.o) + +runecl_objects=$(runecl_sources:.cpp=.o) $(c_sources:.c=.o) + +uoconvert_objects=$(uoconvert_sources:.cpp=.o) $(c_sources:.c=.o) + +uotool_objects=$(uotool_sources:.cpp=.o) $(c_sources:.c=.o) $(cpp_sources:.cpp=.o) + +poltool_objects=$(poltool_sources:.cpp=.o) $(c_sources:.c=.o) + +objects = $(cpp_sources:.cpp=.o) $(c_sources:.c=.o) + +objects_debug = $(cpp_sources:.cpp=.debug.o) $(c_sources:.c=.debug.o) + +ecompile: bin/ecompile + +runecl: bin/runecl + +uoconvert: bin/uoconvert + +release: bin/pol bin/ecompile bin/runecl bin/uoconvert + +dynrelease: bin/pol-dynamic bin/ecompile-dynamic bin/runecl-dynamic bin/uoconvert-dynamic + +bin/pol: $(objects) + $(LINKER) $(CXX_OPTS) -static -Xlinker -Map -Xlinker pol.map -o bin/pol $(objects) -l$(LIB_STL) -lpthread -lm -l$(LIBCRYPT) -lz $(LIB_MORE) + +bin/ecompile: $(ecompile_objects) + $(LINKER) $(CXX_OPTS) -static -o bin/ecompile $(ecompile_objects) -l$(LIB_STL) -lpthread -lm $(LIB_MORE) + +bin/runecl: $(runecl_objects) + $(LINKER) $(CXX_OPTS) -static -o bin/runecl $(runecl_objects) -l$(LIB_STL) -lpthread -lm $(LIB_MORE) + +bin/uoconvert: $(uoconvert_objects) + $(LINKER) $(CXX_OPTS) -static -o bin/uoconvert $(uoconvert_objects) -l$(LIB_STL) -lpthread -lm $(LIB_MORE) + +bin/uotool: $(uotool_objects) + $(LINKER) $(CXX_OPTS) -static -o bin/uotool $(uotool_objects) -l$(LIB_STL) -lpthread -lm $(LIB_MORE) + +bin/poltool: $(poltool_objects) + $(LINKER) $(CXX_OPTS) -static -o bin/poltool $(poltool_objects) -l$(LIB_STL) -lpthread -lm $(LIB_MORE) + + +debug: $(objects_debug) + $(LINKER) $(CXX_OPTS) -static -Xlinker -Map -Xlinker poldebug.map -o bin/poldebug $(objects_debug) -l$(LIB_STL) -lpthread -lm -l$(LIBCRYPT) -lz $(LIB_MORE) + +# -lSegFault +### DYNAMIC-LINK VERSIONS ### +bin/pol-dynamic: $(objects) + $(LINKER) $(CXX_OPTS) -o bin/pol-dynamic $(objects) -l$(LIB_STL) -lpthread -lm -l$(LIBCRYPT) -lz $(LIB_MORE) + +bin/ecompile-dynamic: $(ecompile_objects) + $(LINKER) $(CXX_OPTS) -o bin/ecompile-dynamic $(ecompile_objects) -l$(LIB_STL) -lpthread -lm $(LIB_MORE) + +bin/runecl-dynamic: $(runecl_objects) + $(LINKER) $(CXX_OPTS) -o bin/runecl-dynamic $(runecl_objects) -l$(LIB_STL) -lpthread -lm $(LIB_MORE) + +bin/uoconvert-dynamic: $(uoconvert_objects) + $(LINKER) $(CXX_OPTS) -o bin/uoconvert-dynamic $(uoconvert_objects) -l$(LIB_STL) -lpthread -lm $(LIB_MORE) + +dyndebug: $(objects_debug) + $(LINKER) $(CXX_OPTS) -o bin/poldyndebug $(objects_debug) -l$(LIB_STL) -lpthread -lm -l$(LIBCRYPT) -lz $(LIB_MORE) + +clean: + rm -f $(objects) $(clib_objects) $(ecompile_objects) $(runecl_objects) $(uoconvert_objects) + +gzipfile: bin/pol bin/ecompile bin/runecl bin/uoconvert #bin/poltool bin/uotool + mkdir dist/scripts + mkdir dist/scripts/modules + strip -o dist/pol bin/pol + strip -o dist/scripts/ecompile bin/ecompile + strip -o dist/scripts/runecl bin/runecl + strip -o dist/uoconvert bin/uoconvert + cp support/scripts/*.em dist/scripts/modules + cp support/scripts/ecompile.cfg.example dist/scripts + cp doc/core-changes.txt dist + cp doc/uoconvert.txt dist + cp doc/packethooks.txt dist + cp doc/packets.zip dist + cp support/uoconvert.cfg dist + (cd dist ; tar -cvf pol-$(POL_BUILDNAME)bin-$(POL_RELEASE)-`date +%Y-%m-%d`-$(POL_BUILDTAG).tar pol uoconvert core-changes.txt uoconvert.txt uoconvert.cfg packethooks.txt packets.zip scripts ; gzip -9 pol-$(POL_BUILDNAME)bin-$(POL_RELEASE)-`date +%Y-%m-%d`-$(POL_BUILDTAG).tar ) + rm -f dist/core-changes.txt dist/pol dist/uoconvert + rm -f dist/packethooks.txt + rm -f dist/packets.zip + rm -f dist/uoconvert.cfg + rm -rf dist/scripts + +gzipfile-dynamic: bin/pol-dynamic bin/ecompile-dynamic bin/runecl-dynamic bin/uoconvert-dynamic + mkdir dist/scripts + mkdir dist/scripts/modules + strip -o dist/pol bin/pol-dynamic + strip -o dist/scripts/ecompile bin/ecompile-dynamic + strip -o dist/scripts/runecl bin/runecl-dynamic + strip -o dist/uoconvert bin/uoconvert-dynamic + cp support/scripts/*.em dist/scripts/modules + cp support/scripts/ecompile.cfg.example dist/scripts + cp doc/core-changes.txt dist + cp doc/uoconvert.txt dist + cp doc/packethooks.txt dist + cp doc/packets.zip dist + cp support/uoconvert.cfg dist + (cd dist ; tar -cvf pol-$(POL_BUILDNAME)bin-$(POL_RELEASE)-`date +%Y-%m-%d`-$(POL_BUILDTAG)-dynamic.tar pol uoconvert core-changes.txt uoconvert.txt uoconvert.cfg packethooks.txt packets.zip scripts | gzip -9 pol-$(POL_BUILDNAME)bin-$(POL_RELEASE)-`date +%Y-%m-%d`-$(POL_BUILDTAG)-dynamic.tar ) + rm -f dist/core-changes.txt dist/pol dist/uoconvert + rm -f dist/packethooks.txt + rm -f dist/packets.zip + rm -f dist/uoconvert.cfg + rm -rf dist/scripts + +# $(clib_objects) + +clib_library: + $(MAKE) -C clib + +#include $(c_sources:.c=.d) +#include $(cpp_sources:.cpp=.d) + + +## +## How to build C sources +## +%.o: %.c + $(CC) $(CXX_OPTS) -c -I . -o $@ $< + +## +## How to build C++ sources +## +%.o: %.cpp + $(CC) -x c++ $(CXX_RELEASE_OPTS) -c -I. -o $@ $< + +%.debug.o: %.cpp + $(CC) -x c++ $(CXX_DEBUG_OPTS) -c -I. -o $@ $< + +pol/crypwrap.o: pol/crypwrap.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/nocrypt.o: pol/crypt/nocrypt.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/twofish.o: pol/crypt/twofish.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/blowfish.o: pol/crypt/blowfish.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt1264.o: pol/crypt/crypt1264.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt200.o: pol/crypt/crypt200.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/cryptignt.o: pol/crypt/cryptignt.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypwrap.debug.o: pol/crypwrap.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/nocrypt.debug.o: pol/crypt/nocrypt.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt1264.debug.o: pol/crypt/crypt1264.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/crypt200.debug.o: pol/crypt/crypt200.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +pol/crypt/cryptignt.debug.o: pol/crypt/cryptignt.cpp + $(CC) -x c++ $(CXX_OPTS_NOWARN) -c -I. -o $@ $< + +# | sed 's#^$(@F)#$<#g' + +%.d: %.cpp + set -e; $(CC) -x c++ $(CPPFLAGS) -I. -MM $< \ + | sed 's#\($(*F)\)\.o[ :]*#$(*D)/\1.o $@ : #g' > $@; \ + [ -s $@ ] || rm -f $@ + +%.d: %.c + set -e; $(CC) $(CPPFLAGS) -I. -MM $< \ + | sed 's#\($(*F)\)\.o[ :]*#$(*D)/\1.o $@ : #g' > $@; \ + [ -s $@ ] || rm -f $@ + + +include $(sort $(objects:.o=.d) $(ecompile_objects:.o=.d) $(runecl_objects:.o=.d) $(uoconvert_objects:.o=.d)) Added: trunk/pol-core/mk-debian =================================================================== --- trunk/pol-core/mk-debian (rev 0) +++ trunk/pol-core/mk-debian 2009-08-18 20:52:08 UTC (rev 7) @@ -0,0 +1,10 @@ +#!/bin/bash + +CC=gcc-3.0 LINKER=g++-3.0 LIBCRYPT="crypto" POL_BUILDTAG=debian CXX_MORE_OPTS="-DHAVE_OPENSSL -DNDEBUG -D_REENTRANT -DPOL_BUILDTAG=\\\"debian\\\"" make -f makefile3.gcc $* + +#until CC=gcc-3.0 LINKER=g++-3.0 LIBCRYPT="crypto" POL_BUILDTAG=debian CXX_MORE_OPTS="-DHAVE_OPENSSL -DNDEBUG -D_REENTRANT -DPOL_BUILDTAG=\\\"debian\\\"" make -f makefile3.gcc $* +#do +# echo Tryinh again +# sleep 10 +#done + Added: trunk/pol-core/mk-redhat =================================================================== --- trunk/pol-core/mk-redhat (rev 0) +++ trunk/pol-core/mk-redhat 2009-08-18 20:52:08 UTC (rev 7) @@ -0,0 +1,4 @@ +#!/bin/bash + +LIBCRYPT="crypto" POL_BUILDTAG=redhat CXX_MORE_OPTS="-DHAVE_OPENSSL -DNDEBUG -D_REENTRANT -DPOL_BUILDTAG=\\\"redhat\\\"" make -f makefile3.gcc $* + Added: trunk/pol-core/mk-redhat-gprof =================================================================== --- trunk/pol-core/mk-redhat-gprof (rev 0) +++ trunk/pol-core/mk-redhat-gprof 2009-08-18 20:52:08 UTC (rev 7) @@ -0,0 +1,4 @@ +#!/bin/bash + +LIBCRYPT="crypto" POL_BUILDTAG=redhat CXX_MORE_OPTS="-pg -DHAVE_OPENSSL -DNDEBUG -D_REENTRANT -DPOL_BUILDTAG=\\\"redhat\\\"" make -f makefile3.gcc $* + Added: trunk/pol-core/mk-redhat-stlport =================================================================== --- trunk/pol-core/mk-redhat-stlport (rev 0) +++ trunk/pol-core/mk-redhat-stlport 2009-08-18 20:52:08 UTC (rev 7) @@ -0,0 +1,3 @@ +#!/bin/bash + +USE_STLPORT=1 LIBCRYPT="crypto" POL_BUILDTAG="redhat-stlport" CXX_MORE_OPTS=" -DUSE_STLPORT -DHAVE_OPENSSL -DNDEBUG -D_REENTRANT -DPOL_BUILDTAG=\\\"redhat-stlport\\\"" make -f makefile3.gcc $* Added: trunk/pol-core/mk-slackware =================================================================== --- trunk/pol-core/mk-slackware (rev 0) +++ trunk/pol-core/mk-slackware 2009-08-18 20:52:08 UTC (rev 7) @@ -0,0 +1,3 @@ +#!/bin/bash + +USE_STLPORT=1 LIBCRYPT="crypt" CXX_MORE_OPTS="-O3 -DNDEBUG -D_REENTRANT -DUSE_STLPORT -DPOL_BUILDTAG=\\\"slackware-9\\\"" make -f makefile3.gcc $* \ No newline at end of file Added: trunk/pol-core/mk-slackware-openssl =================================================================== --- trunk/pol-core/mk-slackware-openssl (rev 0) +++ trunk/pol-core/mk-slackware-openssl 2009-08-18 20:52:08 UTC (rev 7) @@ -0,0 +1,3 @@ +#!/bin/bash + +USE_STLPORT=1 LIBCRYPT="crypto" CXX_MORE_OPTS="-O3 -DHAVE_OPENSSL -DNDEBUG -D_REENTRANT -DUSE_STLPORT -DPOL_BUILDTAG=\\\"slackware-9\\\"" make -f makefile3.gcc $* \ No newline at end of file Added: trunk/pol-core/mk.ksh =================================================================== --- trunk/pol-core/mk.ksh (rev 0) +++ trunk/pol-core/mk.ksh 2009-08-18 20:52:08 UTC (rev 7) @@ -0,0 +1,8 @@ +#!/usr/bin/ksh + +until CC=gcc-3.0 make -f makefile3.gcc +do + echo Trying Again... + sleep 10 +done + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-08-20 01:27:40
|
Revision: 9 http://polserver.svn.sourceforge.net/polserver/?rev=9&view=rev Author: muaddib_pol Date: 2009-08-20 01:27:27 +0000 (Thu, 20 Aug 2009) Log Message: ----------- + Updated uoconvert.cfg from one in distro + Updated 099 core-changes.txt Modified Paths: -------------- trunk/pol-core/doc/core-changes.txt trunk/pol-core/support/uoconvert.cfg Modified: trunk/pol-core/doc/core-changes.txt =================================================================== --- trunk/pol-core/doc/core-changes.txt 2009-08-19 13:09:11 UTC (rev 8) +++ trunk/pol-core/doc/core-changes.txt 2009-08-20 01:27:27 UTC (rev 9) @@ -1,4 +1,18 @@ -- POL099 -- +08-19-2009 Turley: + Added: r/o member character.uo_expansion_client client sends this flag at packet 0x5D charselect and 0x00 createchar + Note: values are: + FLAG_T2A = 0x00, + FLAG_RENAISSANCE = 0x01, + FLAG_THIRD_DAWN = 0x02, + FLAG_LBR = 0x04, + FLAG_AOS = 0x08, + FLAG_SE = 0x10, + FLAG_SA = 0x20, + FLAG_UO3D = 0x40, // ? + FLAG_RESERVED = 0x80, + FLAG_3DCLIENT = 0x100 // 3d Client + 08-14-2009 Turley: Changed: Stopped spam of unknown packet for 0xBF.5 & 0xBF.C Modified: trunk/pol-core/support/uoconvert.cfg =================================================================== --- trunk/pol-core/support/uoconvert.cfg 2009-08-19 13:09:11 UTC (rev 8) +++ trunk/pol-core/support/uoconvert.cfg 2009-08-20 01:27:27 UTC (rev 9) @@ -1,19 +1,31 @@ LOSOptions { - UseNoShoot 0 - LOSThroughWindows 0 + // UseNoShoot means uoconvert will determine whether or not something blocks LOS by use of + // the NoShoot tiledata flag instead of the Blocking tiledata flag. A couple of special + // cases exist for secret door items and blocking items that are walls(in both cases, LOS + // will be hindered), but otherwise the NoShoot tiledata flag will be used. This should + // make many blocking, yet not really LOS blocking items no longer block sight, such as + // candelabras, lamp posts, and such. + + // LOSThroughWindows only matters if UseNoShoot is 1. If LOSThroughWindows is 1, then + // items marked as windows in tiledata will not impede LOS. + // Both of these options default to false. When UseNoShoot is false, the old method of + // determining sight blocking as being equivalent to ability to pass will be used for LOS. + + UseNoShoot 0 + LOSThroughWindows 0 } StaticOptions { - MaxStaticsPerBlock 1000 - WarningStaticsPerBlock 1000 - ShowIllegalGraphicWarning 1 + MaxStaticsPerBlock 1000 + WarningStaticsPerBlock 1000 + ShowIllegalGraphicWarning 1 } TileOptions { - ShowRoofAndPlatformWarning 1 + ShowRoofAndPlatformWarning 0 } MultiTypes @@ -22,10 +34,13 @@ Houses 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 0x87 0x8c 0x8d 0x96 0x98 0x9a 0x9c 0x9e 0xa0 0xa2 0x1f4 0x1f5 0x1f6 0x3e8 0x3e9 0x3ea 0x3eb 0x7d0 0x7d1 0x7d2 0x7d3 0x7d4 0x7d5 0x7d6 0x7d7 0xbb8 0xfa0 0xfa1 0xfa2 0xfa3 0xfa4 0xfa5 0xfa6 0xfa7 0xfa8 0xfa9 0xfaa 0xfab 0xfac 0x1388 0x13ec 0x13ed 0x13ee 0x13ef 0x13f0 0x13f1 0x13f8 0x13f9 0x13fa 0x13fb 0x13fc 0x13fd 0x13fe 0x1404 0x1405 0x1406 0x1407 0x1408 0x1409 0x140a 0x140b 0x1410 0x1411 0x1412 0x1413 0x1414 0x1415 0x1416 0x1417 0x1418 0x141c 0x141d 0x141e 0x141f 0x1420 0x1421 0x1422 0x1423 0x1424 0x1425 0x1428 0x1429 0x142a 0x142b 0x142c 0x142d 0x142e 0x142f 0x1430 0x1431 0x1432 0x1435 0x1436 0x1437 0x1438 0x1439 0x143a 0x143b 0x143c 0x143d 0x143e 0x143f 0x1442 0x1443 0x1444 0x1445 0x1446 0x1447 0x1448 0x1449 0x144a 0x144b 0x144f 0x1450 0x1451 0x1452 0x1453 0x1454 0x1455 0x1456 0x1457 0x145c 0x145d 0x145e 0x145f 0x1460 0x1461 0x1462 0x1463 0x1469 0x146a 0x146b 0x146c 0x146d 0x146e 0x146f 0x1476 0x1477 0x1478 0x1479 0x147a 0x147b - Stairs 0x1d4c 0x1db0 0x1db1 0x1db2 0x1db3 0x1db4 0x1db5 0x1db6 0x1db7 0x1db8 0x1db9 0x1dba 0x1dbb 0x1dbc 0x1dbd 0x1dbe 0x1dbf 0x1dc0 0x1dc1 0x1dc2 0x1dc3 0x1dc4 0x1dc5 0x1dc6 0x1dc7 0x1dc8 0x1dc9 0x1dca 0x1dcb 0x1dcc 0x1dcd 0x1dce 0x1dcf 0x1dd0 0x1dd1 0x1dd2 0x1dd3 0x1dd4 0x1dd7 + Stairs 0x1db0 0x1db1 0x1db2 0x1db3 0x1db4 0x1db5 0x1db6 0x1db7 0x1db8 0x1db9 0x1dba 0x1dbb 0x1dbc 0x1dbd 0x1dbe 0x1dbf 0x1dc0 0x1dc1 0x1dc2 0x1dc3 0x1dc4 0x1dc5 0x1dc6 0x1dc7 0x1dc8 0x1dc9 0x1dca 0x1dcb 0x1dcc 0x1dcd 0x1dce 0x1dcf 0x1dd0 0x1dd1 0x1dd2 0x1dd3 0x1dd4 0x1dd7 } Mounts { - Tiles 0x3ea2 0x3e98 0x3e9f 0x3ea0 0x3ea1 0x3ea6 0x3ea3 0x3ea4 0x3ea5 0x3ea7 0x3ea8 0x3ea9 0x3eb0 0x3eb2 0x3eb3 0x3eb4 0x3eb8 0x3eaa 0x3eab 0x3eac 0x3ead 0x3eba 0x3ebb 0x3ebc 0x3ebd 0x3ebe 0x3eb3 0x3e90 0x3e91 0x3e92 0x3e94 + // If this element exists, and if Tiles exist within it, then those tiles with the graphic IDs + // listed will be considered to be mounts by uoconvert and will set the layer to be the + // mount layer and it will set the tile to be equippable. + Tiles 0x3e90 0x3e91 0x3e92 0x3e94 0x3e95 0x3e97 0x3e98 0x3e9a 0x3e9b 0x3e9c 0x3e9d 0x3e9e 0x3e9f 0x3ea0 0x3ea1 0x3ea2 0x3ea3 0x3ea4 0x3ea5 0x3ea6 0x3ea7 0x3ea8 0x3ea9 0x3eaa 0x3eab 0x3eac 0x3ead 0x3eaf 0x3eb0 0x3eb1 0x3eb2 0x3eb3 0x3eb4 0x3eb5 0x3eb6 0x3eb7 0x3eb8 0x3eba 0x3ebb 0x3ebc 0x3ebd 0x3ebe 0x3f6f } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-03 20:52:44
|
Revision: 13 http://polserver.svn.sourceforge.net/polserver/?rev=13&view=rev Author: muaddib_pol Date: 2009-09-03 20:52:34 +0000 (Thu, 03 Sep 2009) Log Message: ----------- + Updates for adding/removing files to the Projects Modified Paths: -------------- trunk/pol-core/dist/dist-2008.vcproj trunk/pol-core/doc/doc-2008.vcproj trunk/pol-core/pol/pol-2008.vcproj trunk/pol-core/support/support-2008.vcproj Modified: trunk/pol-core/dist/dist-2008.vcproj =================================================================== --- trunk/pol-core/dist/dist-2008.vcproj 2009-09-03 19:44:42 UTC (rev 12) +++ trunk/pol-core/dist/dist-2008.vcproj 2009-09-03 20:52:34 UTC (rev 13) @@ -4,6 +4,7 @@ Version="9.00" Name="dist" ProjectGUID="{1D3B3C40-100C-4C8E-8A58-AB49B5BD5A40}" + RootNamespace="dist" Keyword="Win32Proj" TargetFrameworkVersion="131072" > @@ -120,10 +121,22 @@ </References> <Files> <File + RelativePath=".\bscriptexclude.lst" + > + </File> + <File RelativePath="core.lst" > </File> <File + RelativePath=".\debug-exclude.lst" + > + </File> + <File + RelativePath=".\libexclude.lst" + > + </File> + <File RelativePath="makefile.vc7" > </File> @@ -131,6 +144,14 @@ RelativePath="mkdist7.bat" > </File> + <File + RelativePath=".\obj.lst" + > + </File> + <File + RelativePath=".\src.lst" + > + </File> </Files> <Globals> </Globals> Modified: trunk/pol-core/doc/doc-2008.vcproj =================================================================== --- trunk/pol-core/doc/doc-2008.vcproj 2009-09-03 19:44:42 UTC (rev 12) +++ trunk/pol-core/doc/doc-2008.vcproj 2009-09-03 20:52:34 UTC (rev 13) @@ -4,6 +4,7 @@ Version="9.00" Name="doc" ProjectGUID="{701FAB6A-5BEA-49AA-8688-57F3637B2239}" + RootNamespace="doc" Keyword="MakeFileProj" TargetFrameworkVersion="131072" > @@ -61,82 +62,18 @@ <References> </References> <Files> - <Filter - Name="issues" - > - <File - RelativePath="issues\los.txt" - > - </File> - </Filter> - <Filter - Name="proxy" - > - <File - RelativePath="proxy\UO_PRO_Saturday February 01 01_35_03 AM 2003.txt" - > - </File> - <File - RelativePath="proxy\UO_PRO_Saturday February 01 02_53_26 AM 2003.txt" - > - </File> - </Filter> <File - RelativePath="bugs.txt" - > - </File> - <File - RelativePath="client-notes.txt" - > - </File> - <File - RelativePath="core-changes-old.txt" - > - </File> - <File RelativePath=".\core-changes.txt" > </File> <File - RelativePath="development-changes.txt" + RelativePath=".\packethooks.txt" > </File> <File - RelativePath=".\gdb-debugging.txt" + RelativePath=".\uoconvert.txt" > </File> - <File - RelativePath="grouped-core-changes095.txt" - > - </File> - <File - RelativePath="loglines.txt" - > - </File> - <File - RelativePath=".\mapformat.txt" - > - </File> - <File - RelativePath=".\maps.txt" - > - </File> - <File - RelativePath="packethooks.txt" - > - </File> - <File - RelativePath="to-do.txt" - > - </File> - <File - RelativePath="unimplimented_packets.txt" - > - </File> - <File - RelativePath="upgrade-notes-095.txt" - > - </File> </Files> <Globals> </Globals> Modified: trunk/pol-core/pol/pol-2008.vcproj =================================================================== --- trunk/pol-core/pol/pol-2008.vcproj 2009-09-03 19:44:42 UTC (rev 12) +++ trunk/pol-core/pol/pol-2008.vcproj 2009-09-03 20:52:34 UTC (rev 13) @@ -1199,10 +1199,6 @@ > </File> <File - RelativePath=".\cryptengine.h" - > - </File> - <File RelativePath=".\crypwrap.h" > </File> @@ -1247,10 +1243,6 @@ > </File> <File - RelativePath=".\esignal.h" - > - </File> - <File RelativePath=".\eventid.h" > </File> Modified: trunk/pol-core/support/support-2008.vcproj =================================================================== --- trunk/pol-core/support/support-2008.vcproj 2009-09-03 19:44:42 UTC (rev 12) +++ trunk/pol-core/support/support-2008.vcproj 2009-09-03 20:52:34 UTC (rev 13) @@ -4,6 +4,7 @@ Version="9.00" Name="support" ProjectGUID="{D4F7092B-08EA-4CEF-94E8-3D1133CCA5B7}" + RootNamespace="support" Keyword="MakeFileProj" TargetFrameworkVersion="131072" > @@ -151,6 +152,10 @@ </File> </Filter> <File + RelativePath=".\pol.cfg" + > + </File> + <File RelativePath="uoconvert.cfg" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-04 03:18:42
|
Revision: 14 http://polserver.svn.sourceforge.net/polserver/?rev=14&view=rev Author: muaddib_pol Date: 2009-09-04 03:18:29 +0000 (Fri, 04 Sep 2009) Log Message: ----------- + Up to date Packets Zip. + Moved combat related ssopt entries to combat.cfg Modified Paths: -------------- trunk/pol-core/doc/core-changes.txt trunk/pol-core/doc/packets.zip trunk/pol-core/pol/charactr.cpp trunk/pol-core/pol/cmbtcfg.cpp trunk/pol-core/pol/cmbtcfg.h trunk/pol-core/pol/ssopt.cpp trunk/pol-core/pol/ssopt.h Modified: trunk/pol-core/doc/core-changes.txt =================================================================== --- trunk/pol-core/doc/core-changes.txt 2009-09-03 20:52:34 UTC (rev 13) +++ trunk/pol-core/doc/core-changes.txt 2009-09-04 03:18:29 UTC (rev 14) @@ -1,4 +1,7 @@ -- POL099 -- +09-03-2009 MuadDib: + Changed: CoreHitSounds, ScriptedAttackChecks, ResetSwingOnTurn, SendSwingPacket all moved from SSOPT to Combat CFG. + 08-19-2009 Turley: Added: r/o member character.uo_expansion_client client sends this flag at packet 0x5D charselect and 0x00 createchar Note: values are: Modified: trunk/pol-core/doc/packets.zip =================================================================== (Binary files differ) Modified: trunk/pol-core/pol/charactr.cpp =================================================================== --- trunk/pol-core/pol/charactr.cpp 2009-09-03 20:52:34 UTC (rev 13) +++ trunk/pol-core/pol/charactr.cpp 2009-09-04 03:18:29 UTC (rev 14) @@ -22,7 +22,7 @@ 2009/02/25 MuadDib: on_poison_changed() added UOKR Status bar update for poisoned. Booyah! 2009/07/20 MuadDib: Slot checks added to Character::Die() 2009/07/25 MuadDib: equippable() now checks if a twohanded is intrinsic or not also. Intrinsic gets ignored -2009/07/31 Turley: added check for ssopt::send_swing_packet & reset_swing_onturn +2009/07/31 Turley: added check for cmbtcfg::send_swing_packet & reset_swing_onturn 2009/08/04 MuadDib: calc_vital_stuff() now checks to see if a vital changed, before using tell_vital_changed() 2009/08/06 MuadDib: Addeed gotten_by code for items. 2009/08/07 MuadDib: Added new Corpse Layer code to character Die() to put equipped items on correct layer with @@ -33,6 +33,7 @@ 2009/08/25 Shinigami: STLport-5.2.1 fix: corpseSlot not used STLport-5.2.1 fix: init order changed of party_can_loot_, party_decline_timeout_ and skillcap_ 2009/08/28 Turley: Crashfix for Character::on_poison_changed() +2009/09/03 MuadDib: Changed combat related ssopt stuff to combat_config. Notes ======= @@ -2618,7 +2619,7 @@ bool Character::is_attackable( Character* who ) const { passert( who != NULL ); - if ( ssopt.scripted_attack_checks ) + if ( combat_config.scripted_attack_checks ) { dtrace(21) << "is_attackable(" << this << "," << who << "): will be handled by combat hook." << endl; return true; @@ -2930,7 +2931,7 @@ void Character::do_imhit_effects() { - if ( ssopt.core_hit_sounds ) + if ( combat_config.core_hit_sounds ) { int sfx = 0; if ( this->isa(UObject::CLASS_NPC) ) @@ -3106,7 +3107,7 @@ if (ready_to_swing) // and I can swing now, { // do so. FUNCTION_CHECKPOINT( check_attack_after_move, 4 ); - if (ssopt.send_swing_packet && client != NULL) + if (combat_config.send_swing_packet && client != NULL) send_fight_occuring( client, opponent ); attack( opponent ); FUNCTION_CHECKPOINT( check_attack_after_move, 5 ); @@ -3392,7 +3393,7 @@ { setfacing(static_cast<u8>(i_facing)); - if (ssopt.reset_swing_onturn && !cached_settings.firewhilemoving && weapon->is_projectile()) + if (combat_config.reset_swing_onturn && !cached_settings.firewhilemoving && weapon->is_projectile()) reset_swing_timer(); if (hidden() && (ssopt.hidden_turns_count)) { Modified: trunk/pol-core/pol/cmbtcfg.cpp =================================================================== --- trunk/pol-core/pol/cmbtcfg.cpp 2009-09-03 20:52:34 UTC (rev 13) +++ trunk/pol-core/pol/cmbtcfg.cpp 2009-09-04 03:18:29 UTC (rev 14) @@ -1,8 +1,9 @@ /* History ======= -2005/23/11 MuadDib: Added warmode_wait timer for changing war mode. - Delay default is 1. +2005/23/11 MuadDib: Added warmode_wait timer for changing war mode. + Delay default is 1. +2009/09/03 MuadDib: Moved combat related settings to Combat Config from SSOPT Notes ======= @@ -38,4 +39,9 @@ combat_config.warmode_inhibits_regen = elem.remove_bool( "WarmodeInhibitsRegen", false ); combat_config.attack_self = elem.remove_bool( "SingleCombat", false ); combat_config.warmode_delay = elem.remove_ulong( "WarModeDelay", 1 ); + combat_config.core_hit_sounds = elem.remove_bool("CoreHitSounds", false); + combat_config.scripted_attack_checks = elem.remove_bool("ScriptedAttackChecks", false); + combat_config.reset_swing_onturn = elem.remove_bool("ResetSwingOnTurn",false); + combat_config.send_swing_packet = elem.remove_bool("SendSwingPacket",true); + } Modified: trunk/pol-core/pol/cmbtcfg.h =================================================================== --- trunk/pol-core/pol/cmbtcfg.h 2009-09-03 20:52:34 UTC (rev 13) +++ trunk/pol-core/pol/cmbtcfg.h 2009-09-04 03:18:29 UTC (rev 14) @@ -2,6 +2,7 @@ History ======= 2005/23/11 MuadDib: Added warmode_wait timer for changing war mode. +2009/09/03 MuadDib: Moved combat related settings to Combat Config from SSOPT Notes ======= @@ -13,6 +14,12 @@ bool warmode_inhibits_regen; bool attack_self; unsigned long warmode_delay; + + bool core_hit_sounds; + bool scripted_attack_checks; + bool reset_swing_onturn; + bool send_swing_packet; + }; extern CombatConfig combat_config; Modified: trunk/pol-core/pol/ssopt.cpp =================================================================== --- trunk/pol-core/pol/ssopt.cpp 2009-09-03 20:52:34 UTC (rev 13) +++ trunk/pol-core/pol/ssopt.cpp 2009-09-04 03:18:29 UTC (rev 14) @@ -8,6 +8,7 @@ 2005/12/05 MuadDib: ServSpecOpt InvulTage using 0, 1, 2 for method of invul showing. 2009/07/31 Turley: ServSpecOpt ResetSwingOnTurn=true/false Should SwingTimer be reset with projectile weapon on facing change ServSpecOpt SendSwingPacket=true/false Should packet 0x2F be send on swing. + 2009/09/03 MuadDib: Moved combat related settings to Combat Config. Notes ======= @@ -59,8 +60,6 @@ ssopt.starting_gold = elem.remove_ushort("StartingGold", 100); ssopt.item_color_mask = elem.remove_ushort("ItemColorMask", 0xFFF); ssopt.use_win_lfh = elem.remove_bool( "UseWinLFH", false ); - ssopt.core_hit_sounds = elem.remove_bool("CoreHitSounds", false); - ssopt.scripted_attack_checks = elem.remove_bool("ScriptedAttackChecks", false); ssopt.privacy_paperdoll = elem.remove_bool("PrivacyPaperdoll",false); ssopt.force_new_objcache_packets = elem.remove_bool("ForceNewObjCachePackets",false); ssopt.allow_moving_trade = elem.remove_bool("AllowMovingTrade",false); @@ -69,8 +68,6 @@ ssopt.default_max_slots = static_cast<unsigned char>(elem.remove_ushort("MaxContainerSlots", 125)); ssopt.use_slot_index = elem.remove_bool("UseContainerSlots",false); ssopt.use_edit_server = elem.remove_bool("EditServer",false); - ssopt.reset_swing_onturn = elem.remove_bool("ResetSwingOnTurn",false); - ssopt.send_swing_packet = elem.remove_bool("SendSwingPacket",true); ssopt.core_sends_caps = elem.remove_bool("CoreSendsCaps",false); ssopt.send_stat_locks = elem.remove_bool("SendStatLocks",false); Modified: trunk/pol-core/pol/ssopt.h =================================================================== --- trunk/pol-core/pol/ssopt.h 2009-09-03 20:52:34 UTC (rev 13) +++ trunk/pol-core/pol/ssopt.h 2009-09-04 03:18:29 UTC (rev 14) @@ -8,8 +8,8 @@ 2005/12/05 MuadDib: ServSpecOpt InvulTage using 0, 1, 2 for method of invul showing. 2009/07/31 Turley: ServSpecOpt ResetSwingOnTurn=true/false Should SwingTimer be reset with projectile weapon on facing change ServSpecOpt SendSwingPacket=true/false Should packet 0x2F be send on swing. +2009/09/03 MuadDib: Moved combat related settings to Combat Config. - Notes ======= @@ -40,15 +40,11 @@ unsigned short item_color_mask; unsigned char default_max_slots; bool use_win_lfh; - bool core_hit_sounds; - bool scripted_attack_checks; bool privacy_paperdoll; bool force_new_objcache_packets; bool allow_moving_trade; bool core_handled_locks; bool use_slot_index; - bool reset_swing_onturn; - bool send_swing_packet; bool use_edit_server; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-04 06:37:21
|
Revision: 15 http://polserver.svn.sourceforge.net/polserver/?rev=15&view=rev Author: muaddib_pol Date: 2009-09-04 06:37:13 +0000 (Fri, 04 Sep 2009) Log Message: ----------- + Organization updates. * Account and Multi related pol-2008.vcproj organized. Modified Paths: -------------- trunk/pol-core/makefile.gcc trunk/pol-core/plib/realmfunc.cpp trunk/pol-core/plib/testenv.cpp trunk/pol-core/pol/attack.cpp trunk/pol-core/pol/cgdata.cpp trunk/pol-core/pol/charactr.cpp trunk/pol-core/pol/client.cpp trunk/pol-core/pol/cmbtcfg.h trunk/pol-core/pol/containr.cpp trunk/pol-core/pol/core.cpp trunk/pol-core/pol/create.cpp trunk/pol-core/pol/dblclick.cpp trunk/pol-core/pol/dropitem.cpp trunk/pol-core/pol/fnsearch.cpp trunk/pol-core/pol/getitem.cpp trunk/pol-core/pol/item.cpp trunk/pol-core/pol/itemcr.cpp trunk/pol-core/pol/itemdesc.cpp trunk/pol-core/pol/login.cpp trunk/pol-core/pol/menusel.cpp trunk/pol-core/pol/miscmsg.cpp trunk/pol-core/pol/movement.cpp trunk/pol-core/pol/objecthash.cpp trunk/pol-core/pol/objtype.h trunk/pol-core/pol/packethooks.cpp trunk/pol-core/pol/pol-2008.vcproj trunk/pol-core/pol/pol.cpp trunk/pol-core/pol/scrsched.cpp trunk/pol-core/pol/speech.cpp trunk/pol-core/pol/target.cpp trunk/pol-core/pol/textcmd.cpp trunk/pol-core/pol/ufunc.cpp trunk/pol-core/pol/uimport.cpp trunk/pol-core/pol/uniemod.cpp trunk/pol-core/pol/uoemod.cpp trunk/pol-core/pol/uoemod2.cpp trunk/pol-core/pol/uofile03.cpp trunk/pol-core/pol/uolisten.cpp trunk/pol-core/pol/uoscrobj.cpp trunk/pol-core/pol/uoscrobj.h trunk/pol-core/pol/useskill.cpp trunk/pol-core/pol/uvars.cpp trunk/pol-core/pol/uworld.cpp trunk/pol-core/uotool/uotool-2008.vcproj trunk/pol-core/uotool/uotool.cpp Added Paths: ----------- trunk/pol-core/pol/accounts/ trunk/pol-core/pol/accounts/account.cpp trunk/pol-core/pol/accounts/account.h trunk/pol-core/pol/accounts/accounts.cpp trunk/pol-core/pol/accounts/accounts.h trunk/pol-core/pol/accounts/acscrobj.cpp trunk/pol-core/pol/accounts/acscrobj.h trunk/pol-core/pol/combat.cpp trunk/pol-core/pol/combat.h trunk/pol-core/pol/multi/ trunk/pol-core/pol/multi/boat.cpp trunk/pol-core/pol/multi/boat.h trunk/pol-core/pol/multi/boatcomp.cpp trunk/pol-core/pol/multi/boatcomp.h trunk/pol-core/pol/multi/boatemod.cpp trunk/pol-core/pol/multi/boatemod.h trunk/pol-core/pol/multi/customhousehelp.cpp trunk/pol-core/pol/multi/customhouses.cpp trunk/pol-core/pol/multi/customhouses.h trunk/pol-core/pol/multi/house.cpp trunk/pol-core/pol/multi/house.h trunk/pol-core/pol/multi/multi.h trunk/pol-core/pol/multi/multicfg.cpp trunk/pol-core/pol/multi/multicr.cpp trunk/pol-core/pol/multi/multidef.cpp trunk/pol-core/pol/multi/multidef.h trunk/pol-core/pol/multi/multidef2.cpp trunk/pol-core/pol/multi/multis.cpp Removed Paths: ------------- trunk/pol-core/pol/account.cpp trunk/pol-core/pol/account.h trunk/pol-core/pol/accounts.cpp trunk/pol-core/pol/accounts.h trunk/pol-core/pol/acscrobj.cpp trunk/pol-core/pol/acscrobj.h trunk/pol-core/pol/boat.cpp trunk/pol-core/pol/boat.h trunk/pol-core/pol/boatcomp.cpp trunk/pol-core/pol/boatcomp.h trunk/pol-core/pol/boatemod.cpp trunk/pol-core/pol/boatemod.h trunk/pol-core/pol/customhousehelp.cpp trunk/pol-core/pol/customhouses.cpp trunk/pol-core/pol/customhouses.h trunk/pol-core/pol/house.cpp trunk/pol-core/pol/house.h trunk/pol-core/pol/multi.h trunk/pol-core/pol/multicfg.cpp trunk/pol-core/pol/multicr.cpp trunk/pol-core/pol/multidef.cpp trunk/pol-core/pol/multidef.h trunk/pol-core/pol/multidef2.cpp trunk/pol-core/pol/multis.cpp Modified: trunk/pol-core/makefile.gcc =================================================================== --- trunk/pol-core/makefile.gcc 2009-09-04 03:18:29 UTC (rev 14) +++ trunk/pol-core/makefile.gcc 2009-09-04 06:37:13 UTC (rev 15) @@ -48,11 +48,11 @@ cpp_sources = \ clib/progver.cpp plib/polver.cpp \ - pol/account.cpp pol/accounts.cpp pol/acscrobj.cpp pol/allocd.cpp \ + pol/accounts/account.cpp pol/accounts/accounts.cpp pol/accounts/acscrobj.cpp pol/allocd.cpp \ pol/armor.cpp pol/attack.cpp \ pol/attribute.cpp pol/auxclient.cpp \ - pol/bannedips.cpp pol/binaryfilescrobj.cpp pol/boat.cpp pol/boatcomp.cpp \ - pol/boatemod.cpp pol/bowsalut.cpp \ + pol/bannedips.cpp pol/binaryfilescrobj.cpp pol/multi/boat.cpp pol/multi/boatcomp.cpp \ + pol/multi/boatemod.cpp pol/bowsalut.cpp \ pol/cfgemod.cpp pol/cfgrepos.cpp pol/cgdata.cpp pol/charactr.cpp \ pol/checkpnt.cpp \ pol/chrcast.cpp pol/chrituse.cpp pol/chrskuse.cpp pol/client.cpp \ @@ -63,7 +63,7 @@ pol/cryptengine.cpp pol/crypt/cryptbase.cpp pol/crypt/cryptkey.cpp \ pol/crypt/nocrypt.cpp pol/crypt/blowfish.cpp pol/crypt/twofish.cpp \ pol/ctable.cpp \ - pol/customhouses.cpp pol/customhousehelp.cpp \ + pol/multi/customhouses.cpp pol/multi/customhousehelp.cpp \ pol/datastore.cpp pol/dblclick.cpp pol/decay.cpp pol/dice.cpp \ pol/door.cpp pol/dropitem.cpp \ pol/dye.cpp \ @@ -74,7 +74,7 @@ pol/gameclck.cpp pol/getitem.cpp pol/getmsg.cpp pol/gflag.cpp \ pol/gprepos.cpp pol/guardrgn.cpp\ pol/guilds.cpp \ - pol/help.cpp pol/house.cpp \ + pol/help.cpp pol/multi/house.cpp \ pol/iostats.cpp pol/irequest.cpp pol/item.cpp pol/item00.cpp \ pol/itemcr.cpp pol/itemdesc.cpp \ pol/landtile.cpp \ @@ -83,8 +83,8 @@ pol/menu.cpp pol/menusel.cpp pol/miscmsg.cpp \ pol/miscrgn.cpp pol/mkscrobj.cpp \ pol/movecost.cpp pol/movement.cpp pol/msgfiltr.cpp \ - pol/multicfg.cpp pol/multicr.cpp pol/multidef.cpp pol/multis.cpp \ - pol/multidef2.cpp \ + pol/multi/multicfg.cpp pol/multi/multicr.cpp pol/multi/multidef.cpp pol/multi/multis.cpp \ + pol/multi/multidef2.cpp \ pol/musicrgn.cpp \ pol/npc.cpp pol/npctmpl.cpp pol/npctemplates.cpp \ pol/objecthash.cpp \ Modified: trunk/pol-core/plib/realmfunc.cpp =================================================================== --- trunk/pol-core/plib/realmfunc.cpp 2009-09-04 03:18:29 UTC (rev 14) +++ trunk/pol-core/plib/realmfunc.cpp 2009-09-04 06:37:13 UTC (rev 15) @@ -5,6 +5,7 @@ added getstatics - to fill a list with statics 2005/06/06 Shinigami: added readmultis derivative - to get a list of statics 2005/09/03 Shinigami: fixed: Realm::walkheight ignored param doors_block +2009/09/03 MuadDib: Relocation of multi related cpp/h Notes ======= @@ -26,7 +27,7 @@ #include "pol/tiles.h" #include "pol/charactr.h" #include "pol/cgdata.h" -#include "pol/customhouses.h" +#include "pol/multi/customhouses.h" #include "pol/fnsearch.h" #include "pol/ssopt.h" #include "pol/uvars.h" @@ -34,8 +35,8 @@ #include "pol/item.h" #include "pol/itemdesc.h" #include "pol/itemdesc.h" -#include "pol/multi.h" -#include "pol/house.h" +#include "pol/multi/multi.h" +#include "pol/multi/house.h" #include "pol/uconst.h" #define HULL_HEIGHT_BUFFER 2 Modified: trunk/pol-core/plib/testenv.cpp =================================================================== --- trunk/pol-core/plib/testenv.cpp 2009-09-04 03:18:29 UTC (rev 14) +++ trunk/pol-core/plib/testenv.cpp 2009-09-04 06:37:13 UTC (rev 15) @@ -1,6 +1,7 @@ /* History ======= +2009/09/03 MuadDib: Relocation of multi related cpp/h Notes ======= @@ -18,7 +19,7 @@ #include "pol/item.h" #include "pol/itemdesc.h" -#include "pol/multi.h" +#include "pol/multi/multi.h" #include "pol/npc.h" #include "pol/objecthash.h" #include "pol/realms.h" Deleted: trunk/pol-core/pol/account.cpp =================================================================== --- trunk/pol-core/pol/account.cpp 2009-09-04 03:18:29 UTC (rev 14) +++ trunk/pol-core/pol/account.cpp 2009-09-04 06:37:13 UTC (rev 15) @@ -1,236 +0,0 @@ -/* -History -======= -2005/05/25 Shinigami: added void writeto( ConfigElem& elem ) -2005/05/25 Shinigami: added getnextfreeslot() -2009/08/06 MuadDib: Removed PasswordOnlyHash support - -Notes -======= - -*/ - -#include "clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/MD5.h" - -#include "account.h" -#include "accounts.h" -#include "charactr.h" -#include "client.h" -#include "cmdlevel.h" -#include "polcfg.h" - -Account::Account( ConfigElem& elem ) : - active_character(NULL), - characters_(), - name_(elem.remove_string( "NAME" )), - enabled_(true), - banned_(false), - default_cmdlevel_(0) -{ - // If too low, will cause the client to freeze and the console to report - // Exception in message handler 0x91: vector - for( int i = 0; i < config.character_slots; i++ ) - characters_.push_back( CharacterRef(NULL) ); - - readfrom( elem ); -} - -void Account::readfrom( ConfigElem& elem ) -{ - if( elem.has_prop("Password") ) - { - string temppass; - temppass = elem.remove_string( "Password" ); - if(config.retain_cleartext_passwords) - { - password_ = temppass; - } - if(!MD5_Encrypt(name_+temppass,passwordhash_)) //MD5 - elem.throw_error("Failed to encrypt password for " + name_); - accounts_txt_dirty = true; - } - else if( elem.has_prop("PasswordHash") ) - { - passwordhash_ = elem.remove_string( "PasswordHash" ); - } - else - elem.throw_error("Failed password reads for account " + name_); - - enabled_ = elem.remove_bool( "ENABLED", true ); - banned_ = elem.remove_bool( "BANNED", false ); - uo_expansion_ = elem.remove_string( "UOExpansion", "T2A" ); - - default_privs_.readfrom( elem.remove_string( "DefaultPrivs", "" ) ); - - string cmdaccstr = elem.remove_string( "DefaultCmdLevel", "player" ); - CmdLevel* cmdlevel_search = find_cmdlevel( cmdaccstr.c_str() ); - if (cmdlevel_search == NULL) - elem.throw_error("Didn't understand cmdlevel of '" + cmdaccstr + "'"); - default_cmdlevel_ = static_cast<unsigned char>(cmdlevel_search->cmdlevel); - - props_.clear(); - props_.readProperties( elem ); -} - -void Account::writeto( std::ostream& os ) -{ - os << "Account" << std::endl - << "{" << std::endl - << "\tName\t" << name_ << std::endl; - - //dave 6/5/3 don't write cleartext unless configured to - if(config.retain_cleartext_passwords && !password_.empty()) - os << "\tPassword\t" << password_ << std::endl; - - os << "\tPasswordHash\t" << passwordhash_ << std::endl; //MD5 - - os << "\tEnabled\t" << enabled_ << std::endl - << "\tBanned\t" << banned_ << std::endl; - - if (!default_privs_.empty()) - { - os << "\tDefaultPrivs\t" << default_privs_.extract() << pf_endl; - } - if (default_cmdlevel_) - { - os << "\tDefaultCmdLevel\t" << cmdlevels2[default_cmdlevel_].name.c_str() << pf_endl; - } - if (!uo_expansion_.empty()) - { - os << "\tUOExpansion\t" << uo_expansion_ << pf_endl; - } - props_.printProperties( os ); - - os << "}" << endl - << endl; -} - -void Account::writeto( ConfigElem& elem ) const -{ - elem.add_prop( "Name", name_.c_str() ); - - //dave 6/5/3 don't write cleartext unless configured to - if(config.retain_cleartext_passwords && !password_.empty()) - elem.add_prop( "Password", password_.c_str() ); - - elem.add_prop( "PasswordHash", passwordhash_.c_str() ); - - elem.add_prop( "Enabled", ((unsigned long)(enabled_?1:0)) ); - elem.add_prop( "Banned", ((unsigned long)(banned_?1:0)) ); - - if (!default_privs_.empty()) - { - elem.add_prop( "DefaultPrivs", default_privs_.extract().c_str() ); - } - if (default_cmdlevel_) - { - elem.add_prop( "DefaultCmdLevel", cmdlevels2[default_cmdlevel_].name.c_str() ); - } - if (!uo_expansion_.empty()) - { - elem.add_prop( "UOExpansion", uo_expansion_.c_str() ); - } - props_.printProperties( elem ); -} - -Account::~Account() -{ - if (active_character != NULL) - { - if ((active_character->client != NULL) && - (active_character->client->acct == this)) - { - active_character->client->acct = NULL; - } - - if (active_character->acct == this) - { - active_character->acct.clear(); - } - - active_character = NULL; - } - - for( int i = 0; i < config.character_slots; i++ ) - { - if (characters_[i].get()) - { - characters_[i]->acct.clear(); - characters_[i].clear(); - } - } -} - -Character* Account::get_character( int index ) -{ - return characters_.at(index).get(); -} - -void Account::set_character( int index, Character* chr ) -{ - characters_.at(index).set( chr ); -} - -void Account::clear_character( int index ) -{ - characters_.at(index).clear(); -} - -const char* Account::name() const -{ - return name_.c_str(); -} - -const string Account::password() const -{ - return password_; -} - -const string Account::passwordhash() const -{ - return passwordhash_; -} - -const string Account::uo_expansion() const -{ - return uo_expansion_; -} - -bool Account::enabled() const -{ - return enabled_; -} - -bool Account::banned() const -{ - return banned_; -} - -std::string Account::default_privlist() const -{ - return default_privs_.extract(); -} - -unsigned char Account::default_cmdlevel() const -{ - return default_cmdlevel_; -} - -int Account::numchars() const -{ - int num = 0; - for( int i = 0; i < config.character_slots; i++ ) - if ( characters_[i].get() ) - ++num; - return num; -} - -int Account::getnextfreeslot() const -{ - for( int i = 0; i < config.character_slots; i++ ) - if ( !characters_[i].get() ) - return (i+1); - return -1; -} Deleted: trunk/pol-core/pol/account.h =================================================================== --- trunk/pol-core/pol/account.h 2009-09-04 03:18:29 UTC (rev 14) +++ trunk/pol-core/pol/account.h 2009-09-04 06:37:13 UTC (rev 15) @@ -1,78 +0,0 @@ -/* -History -======= -2005/05/25 Shinigami: added void writeto( ConfigElem& elem ) -2005/05/25 Shinigami: added getnextfreeslot() -2009/08/06 MuadDib: Removed PasswordOnlyHash support - -Notes -======= - -*/ - -#ifndef ACCOUNT_H -#define ACCOUNT_H - -#include "ucfg.h" -#include "proplist.h" -#include "reftypes.h" - -#include "clib/strset.h" -#include "clib/refptr.h" - -class Character; -class Client; -class ConfigElem; - -class Account : public ref_counted -{ -public: - explicit Account( ConfigElem& elem ); - ~Account(); - - const char *name() const; - const string password() const; - const string passwordhash() const; - const string uo_expansion() const; - bool enabled() const; - bool banned() const; - - int numchars() const; - int getnextfreeslot() const; - - Character* active_character; - - Character* get_character( int index ); - void set_character( int index, Character* chr ); - void clear_character( int index ); - - void readfrom( ConfigElem& elem ); - void writeto( ostream& os ); - void writeto( ConfigElem& elem ) const; - - string default_privlist() const; - unsigned char default_cmdlevel() const; - - void set_password(string newpass) {password_ = newpass;}; - void set_passwordhash(string newpass) {passwordhash_ = newpass;}; - - friend class AccountObjImp; - -private: - vector<CharacterRef> characters_; - string name_; - string password_; - string passwordhash_; - string uo_expansion_; - bool enabled_; - bool banned_; - PropertyList props_; - StringSet default_privs_; - unsigned char default_cmdlevel_; - - StringSet options_; -}; - -Account *find_account( const char *acctname ); - -#endif Added: trunk/pol-core/pol/accounts/account.cpp =================================================================== --- trunk/pol-core/pol/accounts/account.cpp (rev 0) +++ trunk/pol-core/pol/accounts/account.cpp 2009-09-04 06:37:13 UTC (rev 15) @@ -0,0 +1,237 @@ +/* +History +======= +2005/05/25 Shinigami: added void writeto( ConfigElem& elem ) +2005/05/25 Shinigami: added getnextfreeslot() +2009/08/06 MuadDib: Removed PasswordOnlyHash support +2009/09/03 MuadDib: Relocation of account related cpp/h + +Notes +======= + +*/ + +#include "../../clib/stl_inc.h" +#include "../../clib/cfgelem.h" +#include "../../clib/MD5.h" + +#include "account.h" +#include "accounts.h" +#include "../charactr.h" +#include "../client.h" +#include "../cmdlevel.h" +#include "../polcfg.h" + +Account::Account( ConfigElem& elem ) : + active_character(NULL), + characters_(), + name_(elem.remove_string( "NAME" )), + enabled_(true), + banned_(false), + default_cmdlevel_(0) +{ + // If too low, will cause the client to freeze and the console to report + // Exception in message handler 0x91: vector + for( int i = 0; i < config.character_slots; i++ ) + characters_.push_back( CharacterRef(NULL) ); + + readfrom( elem ); +} + +void Account::readfrom( ConfigElem& elem ) +{ + if( elem.has_prop("Password") ) + { + string temppass; + temppass = elem.remove_string( "Password" ); + if(config.retain_cleartext_passwords) + { + password_ = temppass; + } + if(!MD5_Encrypt(name_+temppass,passwordhash_)) //MD5 + elem.throw_error("Failed to encrypt password for " + name_); + accounts_txt_dirty = true; + } + else if( elem.has_prop("PasswordHash") ) + { + passwordhash_ = elem.remove_string( "PasswordHash" ); + } + else + elem.throw_error("Failed password reads for account " + name_); + + enabled_ = elem.remove_bool( "ENABLED", true ); + banned_ = elem.remove_bool( "BANNED", false ); + uo_expansion_ = elem.remove_string( "UOExpansion", "T2A" ); + + default_privs_.readfrom( elem.remove_string( "DefaultPrivs", "" ) ); + + string cmdaccstr = elem.remove_string( "DefaultCmdLevel", "player" ); + CmdLevel* cmdlevel_search = find_cmdlevel( cmdaccstr.c_str() ); + if (cmdlevel_search == NULL) + elem.throw_error("Didn't understand cmdlevel of '" + cmdaccstr + "'"); + default_cmdlevel_ = static_cast<unsigned char>(cmdlevel_search->cmdlevel); + + props_.clear(); + props_.readProperties( elem ); +} + +void Account::writeto( std::ostream& os ) +{ + os << "Account" << std::endl + << "{" << std::endl + << "\tName\t" << name_ << std::endl; + + //dave 6/5/3 don't write cleartext unless configured to + if(config.retain_cleartext_passwords && !password_.empty()) + os << "\tPassword\t" << password_ << std::endl; + + os << "\tPasswordHash\t" << passwordhash_ << std::endl; //MD5 + + os << "\tEnabled\t" << enabled_ << std::endl + << "\tBanned\t" << banned_ << std::endl; + + if (!default_privs_.empty()) + { + os << "\tDefaultPrivs\t" << default_privs_.extract() << pf_endl; + } + if (default_cmdlevel_) + { + os << "\tDefaultCmdLevel\t" << cmdlevels2[default_cmdlevel_].name.c_str() << pf_endl; + } + if (!uo_expansion_.empty()) + { + os << "\tUOExpansion\t" << uo_expansion_ << pf_endl; + } + props_.printProperties( os ); + + os << "}" << endl + << endl; +} + +void Account::writeto( ConfigElem& elem ) const +{ + elem.add_prop( "Name", name_.c_str() ); + + //dave 6/5/3 don't write cleartext unless configured to + if(config.retain_cleartext_passwords && !password_.empty()) + elem.add_prop( "Password", password_.c_str() ); + + elem.add_prop( "PasswordHash", passwordhash_.c_str() ); + + elem.add_prop( "Enabled", ((unsigned long)(enabled_?1:0)) ); + elem.add_prop( "Banned", ((unsigned long)(banned_?1:0)) ); + + if (!default_privs_.empty()) + { + elem.add_prop( "DefaultPrivs", default_privs_.extract().c_str() ); + } + if (default_cmdlevel_) + { + elem.add_prop( "DefaultCmdLevel", cmdlevels2[default_cmdlevel_].name.c_str() ); + } + if (!uo_expansion_.empty()) + { + elem.add_prop( "UOExpansion", uo_expansion_.c_str() ); + } + props_.printProperties( elem ); +} + +Account::~Account() +{ + if (active_character != NULL) + { + if ((active_character->client != NULL) && + (active_character->client->acct == this)) + { + active_character->client->acct = NULL; + } + + if (active_character->acct == this) + { + active_character->acct.clear(); + } + + active_character = NULL; + } + + for( int i = 0; i < config.character_slots; i++ ) + { + if (characters_[i].get()) + { + characters_[i]->acct.clear(); + characters_[i].clear(); + } + } +} + +Character* Account::get_character( int index ) +{ + return characters_.at(index).get(); +} + +void Account::set_character( int index, Character* chr ) +{ + characters_.at(index).set( chr ); +} + +void Account::clear_character( int index ) +{ + characters_.at(index).clear(); +} + +const char* Account::name() const +{ + return name_.c_str(); +} + +const string Account::password() const +{ + return password_; +} + +const string Account::passwordhash() const +{ + return passwordhash_; +} + +const string Account::uo_expansion() const +{ + return uo_expansion_; +} + +bool Account::enabled() const +{ + return enabled_; +} + +bool Account::banned() const +{ + return banned_; +} + +std::string Account::default_privlist() const +{ + return default_privs_.extract(); +} + +unsigned char Account::default_cmdlevel() const +{ + return default_cmdlevel_; +} + +int Account::numchars() const +{ + int num = 0; + for( int i = 0; i < config.character_slots; i++ ) + if ( characters_[i].get() ) + ++num; + return num; +} + +int Account::getnextfreeslot() const +{ + for( int i = 0; i < config.character_slots; i++ ) + if ( !characters_[i].get() ) + return (i+1); + return -1; +} Added: trunk/pol-core/pol/accounts/account.h =================================================================== --- trunk/pol-core/pol/accounts/account.h (rev 0) +++ trunk/pol-core/pol/accounts/account.h 2009-09-04 06:37:13 UTC (rev 15) @@ -0,0 +1,78 @@ +/* +History +======= +2005/05/25 Shinigami: added void writeto( ConfigElem& elem ) +2005/05/25 Shinigami: added getnextfreeslot() +2009/08/06 MuadDib: Removed PasswordOnlyHash support + +Notes +======= + +*/ + +#ifndef ACCOUNT_H +#define ACCOUNT_H + +#include "../ucfg.h" +#include "../proplist.h" +#include "../reftypes.h" + +#include "../../clib/strset.h" +#include "../../clib/refptr.h" + +class Character; +class Client; +class ConfigElem; + +class Account : public ref_counted +{ +public: + explicit Account( ConfigElem& elem ); + ~Account(); + + const char *name() const; + const string password() const; + const string passwordhash() const; + const string uo_expansion() const; + bool enabled() const; + bool banned() const; + + int numchars() const; + int getnextfreeslot() const; + + Character* active_character; + + Character* get_character( int index ); + void set_character( int index, Character* chr ); + void clear_character( int index ); + + void readfrom( ConfigElem& elem ); + void writeto( ostream& os ); + void writeto( ConfigElem& elem ) const; + + string default_privlist() const; + unsigned char default_cmdlevel() const; + + void set_password(string newpass) {password_ = newpass;}; + void set_passwordhash(string newpass) {passwordhash_ = newpass;}; + + friend class AccountObjImp; + +private: + vector<CharacterRef> characters_; + string name_; + string password_; + string passwordhash_; + string uo_expansion_; + bool enabled_; + bool banned_; + PropertyList props_; + StringSet default_privs_; + unsigned char default_cmdlevel_; + + StringSet options_; +}; + +Account *find_account( const char *acctname ); + +#endif Added: trunk/pol-core/pol/accounts/accounts.cpp =================================================================== --- trunk/pol-core/pol/accounts/accounts.cpp (rev 0) +++ trunk/pol-core/pol/accounts/accounts.cpp 2009-09-04 06:37:13 UTC (rev 15) @@ -0,0 +1,220 @@ +/* +History +======= +2005/05/24 Shinigami: added delete_account +2005/05/25 Shinigami: added duplicate_account +2007/06/17 Shinigami: added config.world_data_path +2009/09/03 MuadDib: Relocation of account related cpp/h + +Notes +======= + +*/ + +#include "clib/stl_inc.h" + + +#include <sys/types.h> +#include <sys/stat.h> +#include <stdio.h> +#include <time.h> + +#include "clib/cfgfile.h" +#include "clib/cfgelem.h" +#include "clib/fileutil.h" +#include "clib/passert.h" +#include "clib/wallclock.h" + +#include "account.h" +#include "accounts.h" +#include "../polcfg.h" +#include "../polsig.h" +#include "../schedule.h" +#include "../uvars.h" + +struct stat accounts_txt_stat; +bool accounts_txt_dirty = false; +void read_account_data() +{ + unsigned long naccounts = 0; + static int num_until_dot = 1000; + wallclock_t start = wallclock(); + + string accountsfile = config.world_data_path + "accounts.txt"; + + cout << " " << accountsfile << ":"; + stat( accountsfile.c_str(), &accounts_txt_stat ); + + { + ConfigFile cf( accountsfile, "Account" ); + ConfigElem elem; + + while (cf.read( elem )) + { + if (--num_until_dot == 0) + { + cout << "."; + num_until_dot = 1000; + } + accounts.push_back( AccountRef(new Account( elem )) ); + naccounts++; + } + } + + if(accounts_txt_dirty) + { + write_account_data(); + accounts_txt_dirty = false; + } + wallclock_t end = wallclock(); + long ms = wallclock_diff_ms( start, end ); + + cout << " " << naccounts << " elements in " << ms << " ms." << std::endl; +} + +void write_account_data() +{ + string accountstxtfile = config.world_data_path + "accounts.txt"; + string accountsbakfile = config.world_data_path + "accounts.bak"; + string accountsndtfile = config.world_data_path + "accounts.ndt"; + + RemoveFile( accountsbakfile ); + RemoveFile( accountsndtfile ); + + { + ofstream ofs( accountsndtfile.c_str(), std::ios::trunc|ios::out ); + for( Accounts::iterator itr = accounts.begin(); itr != accounts.end(); ++itr ) + { + Account* acct = (*itr).get(); + acct->writeto( ofs ); + } + } + + rename( accountstxtfile.c_str(), accountsbakfile.c_str() ); + rename( accountsndtfile.c_str(), accountstxtfile.c_str() ); + + struct stat newst; + stat( accountstxtfile.c_str(), &newst ); + memcpy( &accounts_txt_stat, &newst, sizeof accounts_txt_stat ); +} + +Account* create_new_account( const string& acctname, const string& password, bool enabled ) +{ + passert( !find_account( acctname.c_str() ) ); + + ConfigElem elem; + elem.add_prop( "name", acctname.c_str() ); + elem.add_prop( "password", password.c_str() ); + + elem.add_prop( "enabled", ((unsigned long)(enabled?1:0)) ); + Account* acct = new Account( elem ); + accounts.push_back( AccountRef(acct) ); + write_account_data(); + return acct; +} + +Account* duplicate_account( const string& oldacctname, const string& newacctname ) +{ + passert( !find_account( newacctname.c_str() ) ); + + Account* oldacct = find_account( oldacctname.c_str() ); + if (oldacct != NULL) + { + ConfigElem elem; + oldacct->writeto( elem ); + elem.remove_string( "name" ); + elem.add_prop( "name", newacctname.c_str() ); + + Account* acct = new Account( elem ); + accounts.push_back( AccountRef(acct) ); + write_account_data(); + return acct; + } + return NULL; +} + +Account* find_account( const char* acctname ) +{ + for( unsigned idx = 0; idx < accounts.size(); idx++ ) + { + if (stricmp( accounts[idx]->name(), acctname ) == 0) + { + return accounts[idx].get(); + } + } + return NULL; +} + +int delete_account( const char* acctname ) +{ + for( Accounts::iterator itr = accounts.begin(), end = accounts.end(); itr != end; ++itr ) + { + Account* account = (*itr).get(); + if (stricmp( account->name(), acctname ) == 0) + { + if (account->numchars() == 0) + { + accounts.erase(itr); + write_account_data(); + return 1; + } + else + return -1; + } + } + return -2; +} + +void reread_account( ConfigElem& elem ) +{ + string name = elem.remove_string( "NAME" ); + Account* existing = find_account( name.c_str() ); + if (existing != NULL) + { + existing->readfrom( elem ); + } + else + { + elem.add_prop( "NAME", name.c_str() ); + accounts.push_back( AccountRef(new Account( elem )) ); + } +} + +void reload_account_data(void) +{ + THREAD_CHECKPOINT( tasks, 500 ); + try + { + string accountsfile = config.world_data_path + "accounts.txt"; + + struct stat newst; + stat( accountsfile.c_str(), &newst ); + if ((newst.st_mtime != accounts_txt_stat.st_mtime) && + (newst.st_mtime < time(NULL)-10)) + { + cout << "Reloading accounts.txt..."; + memcpy( &accounts_txt_stat, &newst, sizeof accounts_txt_stat ); + + { + ConfigFile cf( accountsfile, "Account" ); + ConfigElem elem; + while (cf.read( elem )) + { + reread_account( elem ); + } + cout << "Done!" << endl; + } + if(accounts_txt_dirty) + { + write_account_data(); + accounts_txt_dirty = false; + } + } + } + catch( ... ) + { + cout << "Error reading accounts.txt!" << endl; + } + THREAD_CHECKPOINT( tasks, 599 ); +} +PeriodicTask reload_accounts_task( reload_account_data, 30, "LOADACCT" ); Added: trunk/pol-core/pol/accounts/accounts.h =================================================================== --- trunk/pol-core/pol/accounts/accounts.h (rev 0) +++ trunk/pol-core/pol/accounts/accounts.h 2009-09-04 06:37:13 UTC (rev 15) @@ -0,0 +1,23 @@ +/* +History +======= +2005/05/24 Shinigami: added delete_account +2005/05/25 Shinigami: added duplicate_account +2009/08/06 MuadDib: Removed PasswordOnlyHash support + + +Notes +======= + +*/ + +#ifndef ACCOUNTS_H +#define ACCOUNTS_H + +Account* create_new_account( const std::string& acctname, const std::string& password, bool enabled ); +Account* duplicate_account( const string& oldacctname, const string& newacctname ); +Account* find_account( const char* acctname ); +int delete_account( const char* acctname ); +void write_account_data(); +extern bool accounts_txt_dirty; +#endif Added: trunk/pol-core/pol/accounts/acscrobj.cpp =================================================================== --- trunk/pol-core/pol/accounts/acscrobj.cpp (rev 0) +++ trunk/pol-core/pol/accounts/acscrobj.cpp 2009-09-04 06:37:13 UTC (rev 15) @@ -0,0 +1,562 @@ +/* +History +======= +2005/04/04 Shinigami: account.Set_UO_Expansion( string ) - extended for Samurai Empire, + added value check, added to AccountObjImp::call_method (was missing) +2005/04/04 Shinigami: call ondelete script in account.DeleteCharacter( index ) too +2005/04/04 Shinigami: added candelete script +2005/05/24 Shinigami: added account.delete() to delete this account +2005/05/25 Shinigami: added account.split( newacctname : string, index : 1..5 ) + to create a new account and move character to it +2005/05/25 Shinigami: added account.move_char( destacctname : string, index : 1..5 ) + to move character from this account to destaccount +2005/11/25 Shinigami: MTH_GET_MEMBER/"get_member" - GCC fix +2005/11/26 Shinigami: changed "strcmp" into "stricmp" to suppress Script Errors +2006/05/16 Shinigami: account.Set_UO_Expansion( string ) - extended for Mondain's Legacy +2009/08/06 MuadDib: Removed PasswordOnlyHash support +2009/09/03 MuadDib: Relocation of account related cpp/h + +Notes +======= + +*/ + +#include "clib/stl_inc.h" +#include "clib/MD5.h" + +#include "bscript/berror.h" +#include "bscript/bobject.h" +#include "bscript/executor.h" +#include "bscript/impstr.h" +#include "bscript/objmembers.h" +#include "bscript/objmethods.h" + +#include "account.h" +#include "accounts.h" +#include "acscrobj.h" +#include "../charactr.h" +#include "../client.h" +#include "../cmdlevel.h" +#include "../core.h" +#include "../objecthash.h" +#include "../polcfg.h" +#include "../realms.h" +#include "../ufunc.h" +#include "../uoscrobj.h" +#include "../uoexhelp.h" + +BApplicObjType accountobjimp_type; + +const char* AccountObjImp::typeOf() const +{ + return "AccountRef"; +} + +BObjectImp* AccountObjImp::copy() const +{ + return new AccountObjImp( obj_ ); +} + +bool can_delete_character( Character* chr, int delete_by ); +void call_ondelete_scripts( Character* chr ); +void delete_character( Account* acct, Character* chr, int charidx ); +void createchar2(Account* acct, unsigned index); + +/// +/// [1] Account Scripting Object Methods +/// +/// All methods except GetProp and GetCharacter return 1 on success +/// All methods except GetProp and GetCharacter write the accounts.txt file on success. +/// All methods return Error("Not enough parameters") if too few parameters were passed. +/// All methods return Error("Invalid parameter type") if the wrong type was passed. +/// +BObjectImp* AccountObjImp::call_method_id( const int id, Executor& ex ) +{ + BObjectImp* result = NULL; + bool changed = false; // only set for proplist methods + + long index; + Character* chr; + switch(id) + { + case MTH_GET_MEMBER: + { + if ( !ex.hasParams(1) ) + return new BError("Not enough parameters"); + + const String* mname; + if ( ex.getStringParam(0, mname) ) + { + BObjectRef ref_temp = get_member(mname->value().c_str()); + BObjectRef& ref = ref_temp; + BObject *bo = ref.get(); + BObjectImp *ret = bo->impptr(); + ret = ret->copy(); + if ( ret->isa(OTUninit) ) + { + string message = string("Member ") + string(mname->value()) + string(" not found on that object"); + return new BError(message); + } + else + { + return ret; + } + } + else + return new BError( "Invalid parameter type" ); + break; + } + /// + /// account.Ban() : bans the account. Disconnects connected client if any. + /// + case MTH_BAN: + if (ex.numParams() == 0) + { + obj_->banned_ = true; + if (obj_->active_character) + { + if (obj_->active_character->client) + obj_->active_character->client->disconnect = true; + } + } + else + return new BError( "account.Ban() doesn't take parameters." ); + break; + /// + /// account.Unban() : unbans the account. + /// + case MTH_UNBAN: + if (ex.numParams() == 0) + obj_->banned_ = false; + else + return new BError( "account.Unban() doesn't take parameters." ); + break; + /// + /// account.Enable() : enables the account + /// + case MTH_ENABLE: + if (ex.numParams() == 0) + obj_->enabled_ = true; + else + return new BError( "account.Enable() doesn't take parameters." ); + break; + /// + /// account.Disable() : disables the account. Disconnects connected client if any. + /// + case MTH_DISABLE: + if (ex.numParams() == 0) + { + obj_->enabled_ = false; + if (obj_->active_character) + { + if (obj_->active_character->client) + obj_->active_character->client->disconnect = true; + } + break; + } + else + return new BError( "account.Disable() doesn't take parameters." ); + /// + /// account.SetPassword( newpassword : string ) : changes the password.. + /// + case MTH_SETPASSWORD: + if (ex.numParams() == 1) + { + const String* pwstr; + if (ex.getStringParam( 0, pwstr )) + { + if(config.retain_cleartext_passwords) + obj_->password_ = pwstr->value(); + + std::string temp; + MD5_Encrypt(obj_->name_ + pwstr->value(),temp); + obj_->passwordhash_ = temp; //MD5 + break; + } + else + { + return new BError( "Invalid parameter type" ); + } + } + else + return new BError( "account.SetPassword(newpass) requires a parameter." ); + /// + /// account.CheckPassword( password : string ) : checks if the password is valid + /// + case MTH_CHECKPASSWORD: + if (ex.numParams() == 1) + { + const String* pwstr; + if (ex.getStringParam( 0, pwstr )) + { + bool ret; + string temp; + + MD5_Encrypt(obj_->name_ + pwstr->value(),temp);//MD5 + ret = MD5_Compare(obj_->passwordhash_,temp); + + result = new BLong( ret ); + } + else + { + return new BError( "Invalid parameter type" ); + } + } + else + return new BError( "account.CheckPassword(password) requires a parameter." ); + break; + /// + /// account.SetAcctName( newname : string ) : changes the account name + /// - deprecated in favor of: + /// account.SetName( newname : string ) : changes the account name + /// ACK, bug - since account data is saved immediately, + /// a crash w/o save will result in a server that can't start + /// because account names in accounts.txt will refer to the old name + /// + case MTH_SETNAME: + //passed only new account name, and cleartext password is saved + if ( (ex.numParams() == 1) && config.retain_cleartext_passwords ) + { + const String* nmstr; + if (ex.getStringParam( 0, nmstr )) + { + if(nmstr->value().empty()) + return new BError( "Account name must not be empty." ); + std::string temp; + //passing the new name, and recalc name+pass hash (pass only hash is unchanged) + obj_->name_ = nmstr->value(); + MD5_Encrypt(obj_->name_ + obj_->password_,temp); + obj_->passwordhash_ = temp; //MD5 + } + else + { + return new BError( "Invalid parameter type" ); + } + } + //passed new account name and password + else if( ex.numParams() == 2 ) + { + const String* nmstr; + const String* pwstr; + if (ex.getStringParam( 0, nmstr ) && + ex.getStringParam( 1, pwstr )) + { + if(nmstr->value().empty()) + return new BError( "Account name must not be empty." ); + obj_->name_ = nmstr->value(); + //this is the same as the "setpassword" code above + if(config.retain_cleartext_passwords) + obj_->password_ = pwstr->value(); + + std::string temp; + MD5_Encrypt(obj_->name_ + pwstr->value(),temp); + obj_->passwordhash_ = temp; //MD5 + } + else + { + return new BError( "Invalid parameter type" ); + } + } + else if ((ex.numParams() == 1) && !config.retain_cleartext_passwords ) + return new BError( "Usage: account.SetName(name,pass) if RetainCleartextPasswords is off." ); + else + return new BError( "account.SetName needs at least 1 parameter." ); + break; + /// + /// account.GetProp( propname : string ) : gets a custom account property + /// returns Error( "Property not found" ) if property does not exist. + /// + /// + /// account.SetProp( propname : string, propval : packable ) : sets a custom account property + /// + /// + /// account.EraseProp( propname : string ) : erases a custom account property. + /// + /// + /// account.PropNames() : array of property names + /// + case MTH_GETPROP: + case MTH_SETPROP: + case MTH_ERASEPROP: + case MTH_PROPNAMES: + result = CallPropertyListMethod_id( obj_->props_, id, ex, changed ); + if (result && !changed) + return result; + break; + case MTH_SETDEFAULTCMDLEVEL: + { + if ( ex.numParams() != 1 ) + return new BError("account.SetDefaultCmdLevel(int) requires a parameter."); + + long cmdlevel; + if ( !ex.getParam(0, cmdlevel) ) + return new BError("Invalid parameter type."); + else if ( cmdlevel >= long(cmdlevels2.size()) ) + cmdlevel = cmdlevels2.size()-1; + + obj_->default_cmdlevel_ = char(cmdlevel); + + break; + } + /// + /// account.GetCharacter( index : 1..5 ) : retrieve a reference to a character belonging to this account. + /// This reference may be used even if the character is offline. + case MTH_GETCHARACTER: + if (ex.numParams()!=1) + return new BError( "account.GetCharacter(index) requires a parameter." ); + + if (!ex.getParam( 0, index, 1, config.character_slots )) + return NULL; + chr = obj_->get_character( index-1 ); + + if (chr == NULL) + return new BError( "No such character on this account" ); + return new EOfflineCharacterRefObjImp( chr ); + /// + /// account.DeleteCharacter( index : 1..5 ) : delete a character + /// character to be deleted cannot be logged in. + /// + case MTH_DELETECHARACTER: + if (ex.numParams()!=1) + return new BError( "account.DeleteCharacter(index) requires a parameter." ); + + if (!ex.getParam( 0, index, 1, config.character_slots )) + return NULL; + chr = obj_->get_character( index-1 ); + + if (chr == NULL) + return new BError( "No such character on this account" ); + if (chr->client != NULL || chr->logged_in) + return new BError( "That character is in use" ); + + if (can_delete_character( chr, DELETE_BY_SCRIPT )) + { + call_ondelete_scripts( chr ); + delete_character( obj_.Ptr(), chr, index-1 ); + } + else + return new BError( "CanDelete blocks Character deletion." ); + + break; + /// + /// account.Set_UO_Expansion( string ) : recognized values: ML, SE, AOS, LBR, T2A (default) + /// this determines what flag is sent with packet 0xB9 during login. + /// + case MTH_SET_UO_EXPANSION: + if (ex.numParams()!=1) + return new BError( "account.Set_UO_Expansion(string) requires a parameter." ); + + const String* expansion_str; + if (ex.getStringParam( 0, expansion_str )) + { + if ( expansion_str->value().empty() || (expansion_str->value()=="KR") || + (expansion_str->value()=="ML") || (expansion_str->value()=="SE") || + (expansion_str->value()=="AOS") || (expansion_str->value()=="LBR") || + (expansion_str->value()=="T2A") ) + { + obj_->uo_expansion_ = expansion_str->value(); + if (obj_->active_character) + send_feature_enable(obj_->active_character->client); + } + else + return new BError( "Invalid Parameter Value. Supported Values: \"\", T2A, LBR, AOS, SE, ML, KR" ); + } + else + return new BError("Invalid Parameter Type"); + break; + /// + /// account.Delete() : delete this account + /// + case MTH_DELETE: + if (ex.numParams() == 0) + { + int result = delete_account(obj_->name()); + if (result == -1) + return new BError( "You must delete all Character first." ); + else if (result == -2) // Should never happen ;o) + return new BError( "Invalid Account Name." ); + } + else + return new BError( "account.Delete() doesn't take parameters." ); + break; + /// + /// account.Split( newacctname : string, index : 1..5 ) : create a new account and move character to it + /// + case MTH_SPLIT: + if( ex.numParams() == 2 ) + { + const String* acctname; + long index; + if (ex.getStringParam( 0, acctname ) && + ex.getParam( 1, index, 1, config.character_slots )) + { + if (acctname->value().empty()) + return new BError( "Account name must not be empty." ); + + if (find_account( acctname->data() )) + return new BError( "Account already exists." ); + + Character* chr = obj_->get_character( index-1 ); + + if (chr == NULL) + return new BError( "No such character on this account." ); + if (chr->client != NULL || chr->logged_in) + return new BError( "That character is in use." ); + + Account* account = duplicate_account( obj_->name_, acctname->value() ); + if (account != NULL) + { + obj_->clear_character( index-1 ); + chr->acct.set( account ); + account->set_character( 0, chr ); + } + else + return new BError( "Was impossible to create new Account." ); + } + else + return new BError( "Invalid parameter type." ); + } + else + return new BError( "account.Split requires two parameters." ); + break; + /// + /// account.Move_Char( destacctname : string, index : 1..5 ) : move character from this account to destaccount + /// + case MTH_MOVE_CHAR: + if( ex.numParams() == 2 ) + { + const String* acctname; + long index; + if (ex.getStringParam( 0, acctname ) && + ex.getParam( 1, index, 1, config.character_slots )) + { + if (acctname->value().empty()) + return new BError( "Account name must not be empty." ); + + Account* account = find_account( acctname->data() ); + if (account == NULL) + return new BError( "Account doesn't exists." ); + + Character* chr = obj_->get_character( index-1 ); + + if (chr == NULL) + return new BError( "No such character on this account." ); + if (chr->client != NULL || chr->logged_in) + return new BError( "That character is in use." ); + + int charid = account->getnextfreeslot(); + if (charid != -1) + { + obj_->clear_character( index-1 ); + chr->acct.set( account ); + account->set_character( charid-1, chr ); + } + else + return new BError( "Account is full." ); + } + else + return new BError( "Invalid parameter type." ); + } + else + return new BError( "account.Move_Char requires two parameters." ); + break; + case MTH_ADD_CHARACTER: + { + long index; + if ( !ex.getParam(0, index, 0, config.character_slots) ) + return new BError("Account.AddCharacter() requires one parameter."); + + if ( index <= 0 ) + { + index = obj_->getnextfreeslot(); + if ( index == -1 ) + return new BError("Account has no free character slots."); + } + + // We take in 1-5 to match account.GetCharacter() + // Internally it uses it as 0-4 + index--; + + if ( obj_->get_character(index) ) + { + return new BError("That character slot is already in use."); + } + + result = new BLong(index+1); + Account* acct = find_account(obj_->name_.c_str()); + createchar2(acct, unsigned(index)); + + break; + } + default: + return NULL; + } + + // if any of the methods hit & worked, we'll come here + write_account_data(); + return result?result:new BLong(1); +} + + +/// +/// [1] Account Scripting Object Methods +/// +/// All methods except GetProp and GetCharacter return 1 on success +/// All methods except GetProp and GetCharacter write the accounts.txt file on success. +/// All methods return Error("Not enough parameters") if too few parameters were passed. +/// All methods return Error("Invalid parameter type") if the wrong type was passed. +/// +BObjectImp* AccountObjImp::call_method( const char* methodname, Executor& ex ) +{ + ObjMethod* objmethod = getKnownObjMethod(methodname); + if( objmethod != NULL ) + return this->call_method_id(objmethod->id, ex); + else + return NULL; +} + +/// +/// [2] Account Scripting Object Members +/// MemberName Type Access +/// name string read-only +/// enabled boolean read-only +/// banned boolean read-only +/// + +BObjectRef AccountObjImp::get_member_id( const int id ) //id test +{ + switch(id) + { + case MBR_NAME: + return BObjectRef( new String( obj_->name() ) ); + break; + case MBR_ENABLED: + return BObjectRef( new BLong( obj_->enabled() ) ); + break; + case MBR_BANNED: + return BObjectRef( new BLong( obj_->banned() ) ); + break; + case MBR_USERNAMEPASSWORDHASH: + return BObjectRef( new String( obj_->passwordhash() ) ); + break; + case MBR_UO_EXPANSION: + return BObjectRef( new String( obj_->uo_expansion() ) ); + break; + case MBR_DEFAULTCMDLEVEL: + return BObjectRef(new BLong(obj_->default_cmdlevel_)); + break; + default: + return BObjectRef( UninitObject::create() ); + break; + } +} + +BObjectRef AccountObjImp::get_member( const char* membername ) +{ + ObjMember* objmember = getKnownObjMember(membername); + if( objmember != NULL ) + return this->get_member_id(objmember->id); + else + return BObjectRef( UninitObject::create() ); +} + Added: trunk/pol-core/pol/accounts/acscrobj.h =================================================================== --- trunk/pol-core/pol/accounts/acscrobj.h (rev 0) +++ trunk/pol-core/pol/accounts/acscrobj.h 2009-09-04 06:37:13 UTC (rev 15) @@ -0,0 +1,46 @@ +/* +History +======= + + +Notes +======= + +*/ + +#ifndef ACSCROBJ_H +#define ACSCROBJ_H + +#include "../reftypes.h" + +class AccountPtrHolder +{ +public: + explicit AccountPtrHolder( AccountRef i_acct ) : acct(i_acct) {} + Account* operator->() { return acct.get(); } + const Account* operator->() const { return acct.get(); } + + Account* Ptr() { return acct.get(); } +private: + AccountRef acct; +}; + +extern BApplicObjType accountobjimp_type; +class AccountObjImp : public BApplicObj< AccountPtrHolder > +{ + typedef BApplicObj< AccountPtrHolder > base; +public: + explicit AccountObjImp( const AccountPtrHolder& other ) : + BApplicObj< AccountPtrHolder >(&accountobjimp_type, other) + { + } + virtual const char* typeOf() const; + virtual BObjectImp* copy() const; + virtual BObjectImp* call_method( const char* methodname, Executor& ex ); + virtual BObjectImp* call_method_id( const int id, Executor& ex ); + virtual BObjectRef get_member( const char* membername ); + virtual BObjectRef get_member_id( const int id ); //id test +}; + + +#endif Deleted: trunk/pol-core/pol/accounts.cpp =================================================================== --- trunk/pol-core/pol/accounts.cpp 2009-09-04 03:18:29 UTC (rev 14) +++ trunk/pol-core/pol/accounts.cpp 2009-09-04 06:37:13 UTC (rev 15) @@ -1,219 +0,0 @@ -/* -History -======= -2005/05/24 Shinigami: added delete_account -2005/05/25 Shinigami: added duplicate_account -2007/06/17 Shinigami: added config.world_data_path - -Notes -======= - -*/ - -#include "clib/stl_inc.h" - - -#include <sys/types.h> -#include <sys/stat.h> -#include <stdio.h> -#include <time.h> - -#include "clib/cfgfile.h" -#include "clib/cfgelem.h" -#include "clib/fileutil.h" -#include "clib/passert.h" -#include "clib/wallclock.h" - -#include "account.h" -#include "accounts.h" -#include "polcfg.h" -#include "polsig.h" -#include "schedule.h" -#include "uvars.h" - -struct stat accounts_txt_stat; -bool accounts_txt_dirty = false; -void read_account_data() -{ - unsigned long naccounts = 0; - static int num_until_dot = 1000; - wallclock_t start = wallclock(); - - string accountsfile = config.world_data_path + "accounts.txt"; - - cout << " " << accountsfile << ":"; - stat( accountsfile.c_str(), &accounts_txt_stat ); - - { - ConfigFile cf( accountsfile, "Account" ); - ConfigElem elem; - - while (cf.read( elem )) - { - if (--num_until_dot == 0) - { - cout << "."; - num_until_dot = 1000; - } - accounts.push_back( AccountRef(new Account( elem )) ); - naccounts++; - } - } - - if(accounts_txt_dirty) - { - write_account_data(); - accounts_txt_dirty = false; - } - wallclock_t end = wallclock(); - long ms = wallclock_diff_ms( start, end ); - - cout << " " << naccounts << " elements in " << ms << " ms." << std::endl; -} - -void write_account_data() -{ - string accountstxtfile = config.world_data_path + "accounts.txt"; - string accountsbakfile = config.world_data_path + "accounts.bak"; - string accountsndtfile = config.world_data_path + "accounts.ndt"; - - RemoveFile( accountsbakfile ); - RemoveFile( accountsndtfile ); - - { - ofstream ofs( accountsndtfile.c_str(), std::ios::trunc|ios::out ); - for( Accounts::iterator itr = accounts.begin(); itr != accounts.end(); ++itr ) - { - Account* acct = (*itr).get(); - acct->writeto( ofs ); - } - } - - rename( accountstxtfile.c_str(), accountsbakfile.c_str() ); - rename( accountsndtfile.c_str(), accountstxtfile.c_str() ); - - struct stat newst; - stat( accountstxtfile.c_str(), &newst ); - memcpy( &accounts_txt_stat, &newst, sizeof accounts_txt_stat ); -} - -Account* create_new_account( const string& acctname, const string& password, bool enabled ) -{ - passert( !find_account( acctname.c_str() ) ); - - ConfigElem elem; - elem.add_prop( "name", acctname.c_str() ); - elem.add_prop( "password", password.c_str() ); - - elem.add_prop( "enabled", ((unsigned long)(enabled?1:0)) ); - Account* acct = new Account( elem ); - accounts.push_back( AccountRef(acct) ); - write_account_data(); - return acct; -} - -Account* duplicate_account( const string& oldacctname, const string& newacctname ) -{ - passert( !find_account( newacctname.c_str() ) ); - - Account* oldacct = find_account( oldacctname.c_str() ); - if (oldacct != NULL) - { - ConfigElem elem; - oldacct->writeto( elem ); - elem.remove_string( "name" ); - elem.add_prop( "name", newacctname.c_str() ); - - Account* acct = new Account( elem ); - accounts.push_back( AccountRef(acct) ); - write_account_data(); - return acct; - } - return NULL; -} - -Account* find_account( const char* acctname ) -{ - for( unsigned idx = 0; idx < accounts.size(); idx++ ) - { - if (stricmp( accounts[idx]->name(), acctname ) == 0) - { - return accounts[idx].get(); - } - } - return NULL; -} - -int delete_account( const char* acctname ) -{ - for( Accounts::iterator itr = accounts.begin(), end = accounts.end(); itr != end; ++itr ) - { - Account* account = (*itr).get(); - if (stricmp( account->name(), acctname ) == 0) - { - if (account->numchars() == 0) - { - accounts.erase(itr); - write_account_data(); - return 1; - } - else - return -1; - } - } - return -2; -} - -void reread_account( ConfigElem& elem ) -{ - string name = elem.remove_string( "NAME" ); - Account* existing = find_account( name.c_str() ); - if (existing != NULL) - { - existing->readfrom( elem ); - } - else - { - elem.add_prop( "NAME", name.c_str() ); - accounts.push_back( AccountRef(new Account( elem )) ); - } -} - -void reload_account_data(void) -{ - THREAD_CHECKPOINT( tasks, 500 ); - try - { - string accountsfile = config.world_data_path + "accounts.txt"; - - struct stat newst; - stat( accountsfile.c_str(), &newst ); - if ((newst.st_mtime != accounts_txt_stat.st_mtime) && - (newst.st_mtime < time(NULL)-10)) - { - cout << "Reloading accounts.txt..."; - memcpy( &accounts_txt_stat, &newst, sizeof accounts_txt_stat ); - - { - ConfigFile cf( accountsfile, "Account" ); - ConfigElem elem; - while (cf.read( elem )) - { - reread_account( elem ); - } - cout << "Done!" << endl; - } - if(accounts_txt_dirty) - { - write_account_data(); - accounts_txt_dirty = false; - } - } - } - catch( ... ) - { - cout << "Error reading accounts.txt!" << endl; - } - THREAD_CHECKPOINT( tasks, 599 ); -} -PeriodicTask reload_accounts_task( reload_account_data, 30, "LOADACCT" ); Deleted: trunk/pol-core/pol/accounts.h =================================================================== --- trunk/pol-core/pol/accounts.h 2009-09-04 03:18:29 UTC (rev 14) +++ trunk/pol-core/pol/accounts.h 2009-09-04 06:37:13 UTC (rev 15) @@ -1,23 +0,0 @@ -/* -History -======= -2005/05/24 Shinigami: added delete_account -2005/05/25 Shinigami: added duplicate_account -2009/08/06 MuadDib: Removed PasswordOnlyHash support - - -Notes -======= - -*/ - -#ifndef ACCOUNTS_H -#define ACCOUNTS_H - -Account* create_new_account( const std::string& acctname, const std::string& password, bool enabled ); -Account* duplicate_account( const string& oldacctname, const string& newacctname ); -Account* find_account( const char* acctname ); -int delete_account( const char* acctname ); -void write_account_data(); -extern bool accounts_txt_dirty; -#endif Deleted: trunk/pol-core/pol/acscrobj.cpp =================================================================== --- trunk/pol-core/pol/acscrobj.cpp 2009-09-04 03:18:29 UTC (rev 14) +++ trunk/pol-core/pol/acscrobj.cpp 2009-09-04 06:37:13 UTC (rev 15) @@ -1,561 +0,0 @@ -/* -History -======= -2005/04/04 Shinigami: account.Set_UO_Expansion( string ) - extended for Samurai Empire, - added value check, added to AccountObjImp::call_method (was missing) -2005/04/04 Shinigami: call ondelete script in account.DeleteCharacter( index ) too -2005/04/04 Shinigami: added candelete script -2005/05/24 Shinigami: added account.delete() to delete this account -2005/05/25 Shinigami: added account.split( newacctname : string, index : 1..5 ) - to create a new account and move character to it -2005/05/25 Shinigami: added account.move_char( destacctname : string, index : 1..5 ) - to move character from this account to destaccount -2005/11/25 Shinigami: MTH_GET_MEMBER/"get_member" - GCC fix -2005/11/26 Shinigami: changed "strcmp" into "stricmp" to suppress Script Errors -2006/05/16 Shinigami: account.Set_UO_Expansion( string ) - extended for Mondain's Legacy -2009/08/06 MuadDib: Removed PasswordOnlyHash support - -Notes -======= - -*/ - -#include "clib/stl_inc.h" -#include "clib/MD5.h" - -#include "bscript/berror.h" -#include "bscript/bobject.h" -#include "bscript/executor.h" -#include "bscript/impstr.h" -#include "bscript/objmembers.h" -#include "bscript/objmethods.h" - -#include "account.h" -#include "accounts.h" -#include "acscrobj.h" -#include "charactr.h" -#include "client.h" -#include "cmdlevel.h" -#include "core.h" -#include "objecthash.h" -#include "polcfg.h" -#include "realms.h" -#include "ufunc.h" -#include "uoscrobj.h" -#include "uoexhelp.h" - -BApplicObjType accountobjimp_type; - -const char* AccountObjImp::typeOf() const -{ - return "AccountRef"; -} - -BObjectImp* AccountObjImp::copy() const -{ - return new AccountObjImp( obj_ ); -} - -bool can_delete_character( Character* chr, int delete_by ); -void call_ondelete_scripts( Character* chr ); -void delete_character( Account* acct, Character* chr, int charidx ); -void createchar2(Account* acct, unsigned index); - -/// -/// [1] Account Scripting Object Methods -/// -/// All methods except GetProp and GetCharacter return 1 on success -/// All methods except GetProp and GetCharacter write the accounts.txt file on success. -/// All methods return Error("Not enough parameters") if too few parameters were passed. -/// All methods return Error("Invalid parameter type") if the wrong type was passed. -/// -BObjectImp* AccountObjImp::call_method_id( const int id, Executor& ex ) -{ - BObjectImp* result = NULL; - bool changed = false; // only set for proplist methods - - long index; - Character* chr; - switch(id) - { - case MTH_GET_MEMBER: - { - if ( !ex.hasParams(1) ) - return new BError("Not enough parameters"); - - const String* mname; - if ( ex.getStringParam(0, mname) ) - { - BObjectRef ref_temp = get_member(mname->value().c_str()); - BObjectRef& ref = ref_temp; - BObject *bo = ref.get(); - BObjectImp *ret = bo->impptr(); - ret = ret->copy(); - if ( ret->isa(OTUninit) ) - { - string message = string("Member ") + string(mname->value()) + string(" not found on that object"); - return new BError(message); - } - else - { - return ret; - } - } - else - return new BError( "Invalid parameter type" ); - break; - } - /// - /// account.Ban() : bans the account. Disconnects connected client if any. - /// - case MTH_BAN: - if (ex.numParams() == 0) - { - obj_->banned_ = true; - if (obj_->active_character) - { - if (obj_->active_character->client) - obj_->active_character->client->disconnect = true; - } - } - else - return new BError( "account.Ban() doesn't take parameters." ); - break; - /// - /// account.Unban() : unbans the account. - /// - case MTH_UNBAN: - if (ex.numParams() == 0) - obj_->banned_ = false; - else - return new BError( "account.Unban() doesn't take parameters." ); - break; - /// - /// account.Enable() : enables the account - /// - case MTH_ENABLE: - if (ex.numParams() == 0) - obj_->enabled_ = true; - else - return new BError( "account.Enable() doesn't take parameters." ); - break; - /// - /// account.Disable() : disables the account. Disconnects connected client if any. - /// - case MTH_DISABLE: - if (ex.numParams() == 0) - { - obj_->enabled_ = false; - if (obj_->active_character) - { - if (obj_->active_character->client) - obj_->active_character->client->disconnect = true; - } - break; - } - else - return new BError( "account.Disable() doesn't take parameters." ); - /// - /// account.SetPassword( newpassword : string ) : changes the password.. - /// - case MTH_SETPASSWORD: - if (ex.numParams() == 1) - { - ... [truncated message content] |
From: <tu...@us...> - 2009-09-05 16:22:42
|
Revision: 20 http://polserver.svn.sourceforge.net/polserver/?rev=20&view=rev Author: turley Date: 2009-09-05 16:22:35 +0000 (Sat, 05 Sep 2009) Log Message: ----------- Added: struct .? and .- as shortcut for .exists() and .erase() Modified Paths: -------------- trunk/pol-core/bscript/bobject.h trunk/pol-core/bscript/bstruct.cpp trunk/pol-core/bscript/bstruct.h trunk/pol-core/bscript/executor.cpp trunk/pol-core/bscript/executor.h trunk/pol-core/bscript/object.cpp trunk/pol-core/doc/core-changes.txt Modified: trunk/pol-core/bscript/bobject.h =================================================================== --- trunk/pol-core/bscript/bobject.h 2009-09-05 12:35:57 UTC (rev 19) +++ trunk/pol-core/bscript/bobject.h 2009-09-05 16:22:35 UTC (rev 20) @@ -2,6 +2,7 @@ History ======= 2006/10/28 Shinigami: GCC 4.1.1 fix - invalid use of constructor as a template +2009/09/05 Turley: Added struct .? and .- as shortcut for .exists() and .erase() Notes ======= @@ -125,6 +126,8 @@ virtual BObjectImp* bitnot() const; virtual BObjectRef operDotPlus( const char* name ); + virtual BObjectRef operDotMinus( const char* name ); + virtual BObjectRef operDotQMark( const char* name ); virtual void operInsertInto( BObject& obj, const BObjectImp& objimp ); Modified: trunk/pol-core/bscript/bstruct.cpp =================================================================== --- trunk/pol-core/bscript/bstruct.cpp 2009-09-05 12:35:57 UTC (rev 19) +++ trunk/pol-core/bscript/bstruct.cpp 2009-09-05 16:22:35 UTC (rev 20) @@ -3,6 +3,7 @@ ======= 2005/11/26 Shinigami: changed "strcmp" into "stricmp" to suppress Script Errors 2008/02/11 Turley: BStruct::unpack() will accept zero length Structs +2009/09/05 Turley: Added struct .? and .- as shortcut for .exists() and .erase() Notes ======= @@ -453,6 +454,20 @@ } } +BObjectRef BStruct::operDotMinus( const char* name ) +{ + string key(name); + contents_.erase( key ); + return BObjectRef(new BLong(1)); +} + +BObjectRef BStruct::operDotQMark( const char* name ) +{ + string key(name); + int count = contents_.count( key ); + return BObjectRef(new BLong(count)); +} + const BStruct::Contents& BStruct::contents() const { return contents_; Modified: trunk/pol-core/bscript/bstruct.h =================================================================== --- trunk/pol-core/bscript/bstruct.h 2009-09-05 12:35:57 UTC (rev 19) +++ trunk/pol-core/bscript/bstruct.h 2009-09-05 16:22:35 UTC (rev 20) @@ -1,6 +1,7 @@ /* History ======= +2009/09/05 Turley: Added struct .? and .- as shortcut for .exists() and .erase() Notes ======= @@ -53,6 +54,8 @@ virtual BObjectRef set_member( const char* membername, BObjectImp* value ); virtual BObjectRef get_member( const char* membername ); virtual BObjectRef operDotPlus( const char* name ); + virtual BObjectRef operDotMinus( const char* name ); + virtual BObjectRef operDotQMark( const char* name ); virtual BObjectImp* array_assign( BObjectImp* idx, BObjectImp* target ); friend class BStructIterator; Modified: trunk/pol-core/bscript/executor.cpp =================================================================== --- trunk/pol-core/bscript/executor.cpp 2009-09-05 12:35:57 UTC (rev 19) +++ trunk/pol-core/bscript/executor.cpp 2009-09-05 16:22:35 UTC (rev 20) @@ -7,6 +7,7 @@ 2006/10/07 Shinigami: FreeBSD fix - changed __linux__ to __unix__ 2007/07/07 Shinigami: added code to analyze memoryleaks in initForFnCall() (needs defined MEMORYLEAK) 2009/07/19 MuadDib: Executor::ins_member() Removed, due to no longer used since case optimization code added. +2009/09/05 Turley: Added struct .? and .- as shortcut for .exists() and .erase() Notes ======= @@ -831,6 +832,30 @@ return left.impref().operDotPlus( varname.data() ); } +BObjectRef Executor::removemember( BObject& left, const BObject& right ) +{ + if (!right.isa( BObjectImp::OTString )) + { + return BObjectRef(left.clone()); + } + + const String& varname = static_cast<const String&>(right.impref()); + + return left.impref().operDotMinus( varname.data() ); +} + +BObjectRef Executor::checkmember( BObject& left, const BObject& right ) +{ + if (!right.isa( BObjectImp::OTString )) + { + return BObjectRef(left.clone()); + } + + const String& varname = static_cast<const String&>(right.impref()); + + return left.impref().operDotQMark( varname.data() ); +} + #include "contiter.h" ContIterator::ContIterator() : BObjectImp(BObjectImp::OTUnknown) @@ -1826,6 +1851,40 @@ leftref = addmember( left, right ); } +void Executor::ins_removemember( const Instruction& ins ) +{ + /* + These each take two operands, and replace them with one. + We'll leave the second one on the value stack, and + just replace its object with the result + */ + BObjectRef rightref = ValueStack.top(); + ValueStack.pop(); + BObjectRef& leftref = ValueStack.top(); + + BObject& right = *rightref; + BObject& left = *leftref; + + leftref = removemember( left, right ); +} + +void Executor::ins_checkmember( const Instruction& ins ) +{ + /* + These each take two operands, and replace them with one. + We'll leave the second one on the value stack, and + just replace its object with the result + */ + BObjectRef rightref = ValueStack.top(); + ValueStack.pop(); + BObjectRef& leftref = ValueStack.top(); + + BObject& right = *rightref; + BObject& left = *leftref; + + leftref = checkmember( left, right ); +} + void Executor::ins_addmember2( const Instruction& ins ) { BObjectRef obref = ValueStack.top(); @@ -2629,8 +2688,8 @@ case TOK_IN: // ins_in case TOK_ARRAY_SUBSCRIPT: // ins_arraysubscript - case TOK_DELMEMBER: // na - case TOK_CHKMEMBER: // na + case TOK_DELMEMBER: // ins_removemember + case TOK_CHKMEMBER: // ins_checkmember case TOK_ADDMEMBER: // ins_addmember case TOK_MEMBER: // ins_member { @@ -2746,6 +2805,12 @@ case TOK_ARRAY_SUBSCRIPT: // ins_array_subscript leftref = left.impptr()->OperSubscript( right ); return; + case TOK_CHKMEMBER: // ins_checkmember + leftref = checkmember( left, right ); + return; + case TOK_DELMEMBER: //ins_removemember + leftref = removemember( left, right ); + return; case TOK_ADDMEMBER: // ins_addmember leftref = addmember( left, right ); return; @@ -2864,6 +2929,8 @@ case TOK_OR: return &Executor::ins_logical_or; case TOK_ADDMEMBER: return &Executor::ins_addmember; + case TOK_DELMEMBER: return &Executor::ins_removemember; + case TOK_CHKMEMBER: return &Executor::ins_checkmember; case INS_DICTIONARY_ADDMEMBER: return &Executor::ins_dictionary_addmember; case TOK_IN: return &Executor::ins_in; case INS_ADDMEMBER2: return &Executor::ins_addmember2; Modified: trunk/pol-core/bscript/executor.h =================================================================== --- trunk/pol-core/bscript/executor.h 2009-09-05 12:35:57 UTC (rev 19) +++ trunk/pol-core/bscript/executor.h 2009-09-05 16:22:35 UTC (rev 20) @@ -1,6 +1,7 @@ /* History ======= +2009/09/05 Turley: Added struct .? and .- as shortcut for .exists() and .erase() Notes ======= @@ -156,6 +157,8 @@ void pushArg( const BObjectRef& ref ); BObjectRef addmember( BObject& left, const BObject& right ); + BObjectRef removemember( BObject& left, const BObject& right); + BObjectRef checkmember( BObject& left, const BObject& right); void addmember2( BObject& left, const BObject& right ); // execmodules: modules associated with the current program. References modules owned by availmodules. @@ -263,6 +266,8 @@ void ins_member( const Instruction& ins ); void ins_addmember( const Instruction& ins ); + void ins_removemember( const Instruction& ins ); + void ins_checkmember( const Instruction& ins ); void ins_dictionary_addmember( const Instruction& ins ); void ins_addmember2( const Instruction& ins ); void ins_addmember_assign( const Instruction& ins ); Modified: trunk/pol-core/bscript/object.cpp =================================================================== --- trunk/pol-core/bscript/object.cpp 2009-09-05 12:35:57 UTC (rev 19) +++ trunk/pol-core/bscript/object.cpp 2009-09-05 16:22:35 UTC (rev 20) @@ -3,6 +3,7 @@ ======= 2005/11/26 Shinigami: changed "strcmp" into "stricmp" to suppress Script Errors 2008/02/11 Turley: ObjArray::unpack() will accept zero length Arrays and Erros from Array-Elements +2009/09/05 Turley: Added struct .? and .- as shortcut for .exists() and .erase() Notes ======= @@ -422,6 +423,16 @@ return BObjectRef( new BError( "Operator .+ undefined" ) ); } +BObjectRef BObjectImp::operDotMinus( const char* name ) +{ + return BObjectRef( new BError( "Operator .- undefined" ) ); +} + +BObjectRef BObjectImp::operDotQMark( const char* name ) +{ + return BObjectRef( new BError( "Operator .? undefined" ) ); +} + UninitObject* UninitObject::SharedInstance; ref_ptr<BObjectImp> UninitObject::SharedInstanceOwner; Modified: trunk/pol-core/doc/core-changes.txt =================================================================== --- trunk/pol-core/doc/core-changes.txt 2009-09-05 12:35:57 UTC (rev 19) +++ trunk/pol-core/doc/core-changes.txt 2009-09-05 16:22:35 UTC (rev 20) @@ -1,4 +1,7 @@ -- POL099 -- +09-05-2009 Turley: + Added: struct .? and .- as shortcut for .exists() and .erase() + 09-03-2009 MuadDib: Changed: CoreHitSounds, ScriptedAttackChecks, ResetSwingOnTurn, SendSwingPacket all moved from SSOPT to Combat CFG. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-06 22:06:42
|
Revision: 24 http://polserver.svn.sourceforge.net/polserver/?rev=24&view=rev Author: muaddib_pol Date: 2009-09-06 22:06:29 +0000 (Sun, 06 Sep 2009) Log Message: ----------- + Creation of pol pid file in linux = Original Patch by Crazyman Modified Paths: -------------- trunk/pol-core/dist/mkdist.bat trunk/pol-core/pol/pol.cpp trunk/pol-core/pol/polcfg.cpp trunk/pol-core/pol/polcfg.h Modified: trunk/pol-core/dist/mkdist.bat =================================================================== --- trunk/pol-core/dist/mkdist.bat 2009-09-06 21:42:46 UTC (rev 23) +++ trunk/pol-core/dist/mkdist.bat 2009-09-06 22:06:29 UTC (rev 24) @@ -1 +1 @@ -nmake -f makefile.vc7 %1 +nmake -f makefile.vc %1 Modified: trunk/pol-core/pol/pol.cpp =================================================================== --- trunk/pol-core/pol/pol.cpp 2009-09-06 21:42:46 UTC (rev 23) +++ trunk/pol-core/pol/pol.cpp 2009-09-06 22:06:29 UTC (rev 24) @@ -1893,13 +1893,15 @@ // Added atexit() call to remove the tray icon. atexit(ShutdownSystemTrayHandling); #else -#ifdef PERGON +#ifdef __linux__ ofstream polpid; - polpid.open( "pol.pid", ios::out|ios::app ); + polpid.open( (config.pidfile_path+"pol.pid").c_str(), ios::out|ios::trunc ); if (polpid.is_open()) polpid << decint(getpid()); + else + cout << "Cannot create pid file in " << config.pidfile_path << endl; polpid.close(); #endif Modified: trunk/pol-core/pol/polcfg.cpp =================================================================== --- trunk/pol-core/pol/polcfg.cpp 2009-09-06 21:42:46 UTC (rev 23) +++ trunk/pol-core/pol/polcfg.cpp 2009-09-06 22:06:29 UTC (rev 24) @@ -59,7 +59,10 @@ config.realm_data_path = elem.remove_string( "RealmDataPath", "realm/" ); config.realm_data_path = normalized_dir_form( config.realm_data_path ); - + + config.pidfile_path = elem.remove_string( "PidFilePath", "./" ); + config.pidfile_path = normalized_dir_form( config.pidfile_path ); + config.listen_port = elem.remove_ushort( "ListenPort", 0 ); config.check_integrity = true; // elem.remove_bool( "CheckIntegrity", true ); config.count_resource_tiles = elem.remove_bool( "CountResourceTiles", false ); Modified: trunk/pol-core/pol/polcfg.h =================================================================== --- trunk/pol-core/pol/polcfg.h 2009-09-06 21:42:46 UTC (rev 23) +++ trunk/pol-core/pol/polcfg.h 2009-09-06 22:06:29 UTC (rev 24) @@ -17,6 +17,7 @@ std::string uo_datafile_root; std::string world_data_path; std::string realm_data_path; + std::string pidfile_path; unsigned short listen_port; bool verbose; unsigned short loglevel; // 0=nothing 10=lots This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-07 15:10:19
|
Revision: 29 http://polserver.svn.sourceforge.net/polserver/?rev=29&view=rev Author: muaddib_pol Date: 2009-09-07 15:10:12 +0000 (Mon, 07 Sep 2009) Log Message: ----------- + More module organization + Addition of base SQL EM module. Does nothing, just there as main point entry so far Modified Paths: -------------- trunk/pol-core/makefile.gcc trunk/pol-core/pol/module/osmod.cpp trunk/pol-core/pol/pol-2008.vcproj trunk/pol-core/pol/scrsched.cpp trunk/pol-core/support/support-2008.vcproj Added Paths: ----------- trunk/pol-core/pol/module/sqlmod.cpp trunk/pol-core/pol/module/sqlmod.h trunk/pol-core/pol/module/utilmod.cpp trunk/pol-core/pol/module/utilmod.h trunk/pol-core/support/scripts/sql.em Removed Paths: ------------- trunk/pol-core/pol/utilemod.cpp trunk/pol-core/pol/utilemod.h Property Changed: ---------------- trunk/pol-core/pol/ Modified: trunk/pol-core/makefile.gcc =================================================================== --- trunk/pol-core/makefile.gcc 2009-09-07 13:52:29 UTC (rev 28) +++ trunk/pol-core/makefile.gcc 2009-09-07 15:10:12 UTC (rev 29) @@ -116,7 +116,7 @@ pol/uoemod3.cpp pol/uoemod4.cpp pol/uoexhelp.cpp \ pol/uolisten.cpp \ pol/uoscrobj.cpp pol/uoskills.cpp pol/useskill.cpp \ - pol/utilemod.cpp \ + pol/module/utilmod.cpp pol/module/sqlmod.cpp \ pol/uvars.cpp pol/uworld.cpp \ pol/vital.cpp \ pol/weapon.cpp \ Property changes on: trunk/pol-core/pol ___________________________________________________________________ Modified: svn:ignore - *.suo *.ncb *.user Compiler Executor Debug Release Pergon MemoryLeak + *.aps *.ncb *.suo *.user Compiler Debug Executor MemoryLeak Pergon Release Modified: trunk/pol-core/pol/module/osmod.cpp =================================================================== --- trunk/pol-core/pol/module/osmod.cpp 2009-09-07 13:52:29 UTC (rev 28) +++ trunk/pol-core/pol/module/osmod.cpp 2009-09-07 15:10:12 UTC (rev 29) @@ -51,7 +51,7 @@ #include "../uniemod.h" #include "../uoemod.h" #include "../uoexec.h" -#include "../utilemod.h" +#include "utilmod.h" #include "vitalmod.h" #include "../watch.h" Added: trunk/pol-core/pol/module/sqlmod.cpp =================================================================== --- trunk/pol-core/pol/module/sqlmod.cpp (rev 0) +++ trunk/pol-core/pol/module/sqlmod.cpp 2009-09-07 15:10:12 UTC (rev 29) @@ -0,0 +1,30 @@ +/* +History +======= + +Notes +======= + +*/ + +#include "../../clib/stl_inc.h" + +#include "../../bscript/bobject.h" +#include "../../bscript/berror.h" +#include "../../bscript/impstr.h" + +#include "sqlmod.h" + +template<> +TmplExecutorModule<SQLExecutorModule>::FunctionDef +TmplExecutorModule<SQLExecutorModule>::function_table[] = +{ + { "Connect", &SQLExecutorModule::mf_ConnectToDB } +}; +template<> +int TmplExecutorModule<SQLExecutorModule>::function_table_size = arsize(function_table); + +BObjectImp* SQLExecutorModule::mf_ConnectToDB() +{ + return new BLong(1); +} \ No newline at end of file Added: trunk/pol-core/pol/module/sqlmod.h =================================================================== --- trunk/pol-core/pol/module/sqlmod.h (rev 0) +++ trunk/pol-core/pol/module/sqlmod.h 2009-09-07 15:10:12 UTC (rev 29) @@ -0,0 +1,26 @@ +/* +History +======= + +Notes +======= + +*/ + + +#ifndef SQLMOD_H +#define SQLMOD_H + +#include "../../bscript/execmodl.h" + +class SQLExecutorModule : public TmplExecutorModule<SQLExecutorModule> +{ +public: + SQLExecutorModule(Executor& exec) : + TmplExecutorModule<SQLExecutorModule>("sql", exec) {} + + BObjectImp* mf_ConnectToDB(); + +}; + +#endif Added: trunk/pol-core/pol/module/utilmod.cpp =================================================================== --- trunk/pol-core/pol/module/utilmod.cpp (rev 0) +++ trunk/pol-core/pol/module/utilmod.cpp 2009-09-07 15:10:12 UTC (rev 29) @@ -0,0 +1,141 @@ +/* +History +======= +2006/10/07 Shinigami: GCC 3.4.x fix - added "template<>" to TmplExecutorModule +2008/07/08 Turley: Added mf_RandomIntMinMax - Return Random Value between... + +Notes +======= + +*/ + +#include <time.h> + +#include "../../clib/stl_inc.h" +#include "../../clib/random.h" +#include "../../clib/rawtypes.h" + +#include "../../bscript/berror.h" +#include "../../bscript/execmodl.h" +#include "../../bscript/executor.h" +#include "../../bscript/impstr.h" + +#include "../dice.h" + +#include "utilmod.h" + + +template<> +TmplExecutorModule<UtilExecutorModule>::FunctionDef + TmplExecutorModule<UtilExecutorModule>::function_table[] = +{ + { "RandomInt", &UtilExecutorModule::mf_RandomInt }, + { "RandomFloat", &UtilExecutorModule::mf_RandomFloat }, + { "RandomDiceRoll", &UtilExecutorModule::mf_RandomDiceRoll }, + { "StrFormatTime", &UtilExecutorModule::mf_StrFormatTime }, + { "RandomIntMinMax", &UtilExecutorModule::mf_RandomIntMinMax} +}; + +template<> +int TmplExecutorModule<UtilExecutorModule>::function_table_size = + arsize(function_table); + + +BObjectImp* UtilExecutorModule::mf_RandomInt() +{ + long value; + if (exec.getParam( 0, value, 1, LONG_MAX )) + { + if (value > 0) + return new BLong( random_int( value ) ); + else + return new BError( "RandomInt() expects a positive integer" ); + } + else + { + return new BError( "RandomInt() expects a positive integer" ); + } +} + +BObjectImp* UtilExecutorModule::mf_RandomIntMinMax() +{ + long minvalue; + long maxvalue; + if (exec.getParam( 0, minvalue, LONG_MIN, LONG_MAX )) + { + if (exec.getParam( 1, maxvalue, LONG_MIN, LONG_MAX )) + { + if (maxvalue<minvalue) + swap(maxvalue,minvalue); + return new BLong( random_int_range( minvalue,maxvalue ) ); + } + else + return new BError( "RandomIntMinMax() expects an integer" ); + } + else + return new BError( "RandomIntMinMax() expects an integer" ); +} + +BObjectImp* UtilExecutorModule::mf_RandomFloat() +{ + double value; + if (exec.getRealParam( 0, value )) + { + return new Double( static_cast<double>(random_float( static_cast<float>(value) )) ); + } + else + { + return new BError( "RandomFloat() expects a Real parameter" ); + } +} + +BObjectImp* UtilExecutorModule::mf_RandomDiceRoll() +{ + const String* dicestr; + if (exec.getStringParam( 0, dicestr )) + { + string errormsg; + Dice dice; + if (dice.load( dicestr->data(), &errormsg )) + { + return new BLong( dice.roll() ); + } + else + { + return new BError( errormsg.c_str() ); + } + } + else + { + return new BError( "RandomDiceRoll() expects a String as parameter" ); + } +} + +BObjectImp* UtilExecutorModule::mf_StrFormatTime() +{ + const String* format_string; + getStringParam(0, format_string); + if ( !getStringParam(0, format_string) ) + return new BError("No time string passed."); + else if ( format_string->length() > 100 ) + return new BError("Format string exceeded 100 characters."); + + long time_stamp; + getParam(1, time_stamp, 0, LONG_MAX); + + time_t seconds; + struct tm* time_struct; + + if ( time_stamp <= 0 ) + seconds = time(NULL); + else + seconds = time_stamp; + + time_struct = localtime(&seconds); + + char buffer[102]; // +2 for the \0 termination. + strftime(buffer, sizeof buffer, format_string->data(), time_struct); + + return new String(buffer); +} + Added: trunk/pol-core/pol/module/utilmod.h =================================================================== --- trunk/pol-core/pol/module/utilmod.h (rev 0) +++ trunk/pol-core/pol/module/utilmod.h 2009-09-07 15:10:12 UTC (rev 29) @@ -0,0 +1,27 @@ +/* +History +======= +2008/07/08 Turley: Added mf_RandomIntMinMax - Return Random Value between... + +Notes +======= + +*/ + +#ifndef __UTILMOD_H +#define __UTILMOD_H + +class UtilExecutorModule : public TmplExecutorModule<UtilExecutorModule> +{ +public: + UtilExecutorModule( Executor& exec ) : TmplExecutorModule<UtilExecutorModule>("util",exec) {} + + BObjectImp* mf_RandomInt(); + BObjectImp* mf_RandomFloat(); + BObjectImp* mf_RandomDiceRoll(); + BObjectImp* mf_StrFormatTime(); + BObjectImp* mf_RandomIntMinMax(); +}; + +#endif // UTILMOD_H + Modified: trunk/pol-core/pol/pol-2008.vcproj =================================================================== --- trunk/pol-core/pol/pol-2008.vcproj 2009-09-07 13:52:29 UTC (rev 28) +++ trunk/pol-core/pol/pol-2008.vcproj 2009-09-07 15:10:12 UTC (rev 29) @@ -946,10 +946,6 @@ > </File> <File - RelativePath=".\utilemod.cpp" - > - </File> - <File RelativePath=".\uvars.cpp" > </File> @@ -1571,10 +1567,6 @@ > </File> <File - RelativePath=".\utilemod.h" - > - </File> - <File RelativePath=".\utype.h" > </File> @@ -2071,6 +2063,22 @@ > </File> <File + RelativePath=".\module\sqlmod.cpp" + > + </File> + <File + RelativePath=".\module\sqlmod.h" + > + </File> + <File + RelativePath=".\module\utilmod.cpp" + > + </File> + <File + RelativePath=".\module\utilmod.h" + > + </File> + <File RelativePath=".\module\vitalmod.cpp" > </File> Modified: trunk/pol-core/pol/scrsched.cpp =================================================================== --- trunk/pol-core/pol/scrsched.cpp 2009-09-07 13:52:29 UTC (rev 28) +++ trunk/pol-core/pol/scrsched.cpp 2009-09-07 15:10:12 UTC (rev 29) @@ -38,6 +38,7 @@ #include "module/clmod.h" #include "mobile/charactr.h" #include "module/datastore.h" +#include "module/sqlmod.h" #include "exscrobj.h" #include "module/filemod.h" #include "module/guildmod.h" @@ -641,6 +642,7 @@ ex.addModule( new GuildExecutorModule( ex ) ); ex.addModule( new UnicodeExecutorModule( ex ) ); ex.addModule( new PartyExecutorModule( ex ) ); + ex.addModule( new SQLExecutorModule( ex ) ); ex.addModule( CreateFileAccessExecutorModule( ex ) ); } Deleted: trunk/pol-core/pol/utilemod.cpp =================================================================== --- trunk/pol-core/pol/utilemod.cpp 2009-09-07 13:52:29 UTC (rev 28) +++ trunk/pol-core/pol/utilemod.cpp 2009-09-07 15:10:12 UTC (rev 29) @@ -1,140 +0,0 @@ -/* -History -======= -2006/10/07 Shinigami: GCC 3.4.x fix - added "template<>" to TmplExecutorModule -2008/07/08 Turley: Added mf_RandomIntMinMax - Return Random Value between... - -Notes -======= - -*/ - -#include <time.h> - -#include "clib/stl_inc.h" -#include "clib/random.h" -#include "clib/rawtypes.h" - -#include "bscript/berror.h" -#include "bscript/execmodl.h" -#include "bscript/executor.h" -#include "bscript/impstr.h" - -#include "dice.h" -#include "utilemod.h" - - -template<> -TmplExecutorModule<UtilExecutorModule>::FunctionDef - TmplExecutorModule<UtilExecutorModule>::function_table[] = -{ - { "RandomInt", &UtilExecutorModule::mf_RandomInt }, - { "RandomFloat", &UtilExecutorModule::mf_RandomFloat }, - { "RandomDiceRoll", &UtilExecutorModule::mf_RandomDiceRoll }, - { "StrFormatTime", &UtilExecutorModule::mf_StrFormatTime }, - { "RandomIntMinMax", &UtilExecutorModule::mf_RandomIntMinMax} -}; - -template<> -int TmplExecutorModule<UtilExecutorModule>::function_table_size = - arsize(function_table); - - -BObjectImp* UtilExecutorModule::mf_RandomInt() -{ - long value; - if (exec.getParam( 0, value, 1, LONG_MAX )) - { - if (value > 0) - return new BLong( random_int( value ) ); - else - return new BError( "RandomInt() expects a positive integer" ); - } - else - { - return new BError( "RandomInt() expects a positive integer" ); - } -} - -BObjectImp* UtilExecutorModule::mf_RandomIntMinMax() -{ - long minvalue; - long maxvalue; - if (exec.getParam( 0, minvalue, LONG_MIN, LONG_MAX )) - { - if (exec.getParam( 1, maxvalue, LONG_MIN, LONG_MAX )) - { - if (maxvalue<minvalue) - swap(maxvalue,minvalue); - return new BLong( random_int_range( minvalue,maxvalue ) ); - } - else - return new BError( "RandomIntMinMax() expects an integer" ); - } - else - return new BError( "RandomIntMinMax() expects an integer" ); -} - -BObjectImp* UtilExecutorModule::mf_RandomFloat() -{ - double value; - if (exec.getRealParam( 0, value )) - { - return new Double( static_cast<double>(random_float( static_cast<float>(value) )) ); - } - else - { - return new BError( "RandomFloat() expects a Real parameter" ); - } -} - -BObjectImp* UtilExecutorModule::mf_RandomDiceRoll() -{ - const String* dicestr; - if (exec.getStringParam( 0, dicestr )) - { - string errormsg; - Dice dice; - if (dice.load( dicestr->data(), &errormsg )) - { - return new BLong( dice.roll() ); - } - else - { - return new BError( errormsg.c_str() ); - } - } - else - { - return new BError( "RandomDiceRoll() expects a String as parameter" ); - } -} - -BObjectImp* UtilExecutorModule::mf_StrFormatTime() -{ - const String* format_string; - getStringParam(0, format_string); - if ( !getStringParam(0, format_string) ) - return new BError("No time string passed."); - else if ( format_string->length() > 100 ) - return new BError("Format string exceeded 100 characters."); - - long time_stamp; - getParam(1, time_stamp, 0, LONG_MAX); - - time_t seconds; - struct tm* time_struct; - - if ( time_stamp <= 0 ) - seconds = time(NULL); - else - seconds = time_stamp; - - time_struct = localtime(&seconds); - - char buffer[102]; // +2 for the \0 termination. - strftime(buffer, sizeof buffer, format_string->data(), time_struct); - - return new String(buffer); -} - Deleted: trunk/pol-core/pol/utilemod.h =================================================================== --- trunk/pol-core/pol/utilemod.h 2009-09-07 13:52:29 UTC (rev 28) +++ trunk/pol-core/pol/utilemod.h 2009-09-07 15:10:12 UTC (rev 29) @@ -1,27 +0,0 @@ -/* -History -======= -2008/07/08 Turley: Added mf_RandomIntMinMax - Return Random Value between... - -Notes -======= - -*/ - - -#ifndef UTILEMOD_H -#define UTILEMOD_H - -class UtilExecutorModule : public TmplExecutorModule<UtilExecutorModule> -{ -public: - UtilExecutorModule( Executor& exec ) : TmplExecutorModule<UtilExecutorModule>("util",exec) {} - - BObjectImp* mf_RandomInt(); - BObjectImp* mf_RandomFloat(); - BObjectImp* mf_RandomDiceRoll(); - BObjectImp* mf_StrFormatTime(); - BObjectImp* mf_RandomIntMinMax(); -}; - -#endif Added: trunk/pol-core/support/scripts/sql.em =================================================================== --- trunk/pol-core/support/scripts/sql.em (rev 0) +++ trunk/pol-core/support/scripts/sql.em 2009-09-07 15:10:12 UTC (rev 29) @@ -0,0 +1,3 @@ +// +// SQL related functions +// Modified: trunk/pol-core/support/support-2008.vcproj =================================================================== --- trunk/pol-core/support/support-2008.vcproj 2009-09-07 13:52:29 UTC (rev 28) +++ trunk/pol-core/support/support-2008.vcproj 2009-09-07 15:10:12 UTC (rev 29) @@ -131,6 +131,10 @@ > </File> <File + RelativePath=".\scripts\sql.em" + > + </File> + <File RelativePath=".\scripts\storage.em" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-07 17:50:38
|
Revision: 31 http://polserver.svn.sourceforge.net/polserver/?rev=31&view=rev Author: muaddib_pol Date: 2009-09-07 17:50:30 +0000 (Mon, 07 Sep 2009) Log Message: ----------- + Storage and Unicode Modules moved Modified Paths: -------------- trunk/pol-core/clib/clib.h trunk/pol-core/makefile.gcc trunk/pol-core/pol/cgdata.cpp trunk/pol-core/pol/client.cpp trunk/pol-core/pol/module/npcmod.cpp trunk/pol-core/pol/module/osmod.cpp trunk/pol-core/pol/npc.cpp trunk/pol-core/pol/pol-2008.vcproj trunk/pol-core/pol/scrsched.cpp trunk/pol-core/uotool/uotool.cpp Added Paths: ----------- trunk/pol-core/pol/module/storagemod.cpp trunk/pol-core/pol/module/storagemod.h trunk/pol-core/pol/module/unimod.cpp trunk/pol-core/pol/module/unimod.h Removed Paths: ------------- trunk/pol-core/pol/storagemod.cpp trunk/pol-core/pol/storagemod.h trunk/pol-core/pol/uniemod.cpp trunk/pol-core/pol/uniemod.h Modified: trunk/pol-core/clib/clib.h =================================================================== --- trunk/pol-core/clib/clib.h 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/clib/clib.h 2009-09-07 17:50:30 UTC (rev 31) @@ -12,7 +12,7 @@ #ifndef __STDDEF_H -#include "stddef.h" +# include "stddef.h" #endif /* explicit cast: use instead of c-style (type) casts. Modified: trunk/pol-core/makefile.gcc =================================================================== --- trunk/pol-core/makefile.gcc 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/makefile.gcc 2009-09-07 17:50:30 UTC (rev 31) @@ -110,7 +110,7 @@ pol/tildecmd.cpp pol/tiles.cpp pol/tiplstwn.cpp \ pol/tips.cpp pol/tmpvars.cpp pol/tooltips.cpp \ pol/ucrypto.cpp pol/ufunc.cpp pol/ufunc2.cpp pol/uimport.cpp \ - pol/umap.cpp pol/uniemod.cpp \ + pol/umap.cpp pol/module/unimod.cpp \ pol/uobjcnt.cpp pol/uobject.cpp pol/uobjhelp.cpp pol/uoclient.cpp \ pol/uoemod.cpp pol/uoemod2.cpp \ pol/uoemod3.cpp pol/uoemod4.cpp pol/uoexhelp.cpp \ @@ -121,7 +121,7 @@ pol/vital.cpp \ pol/weapon.cpp \ pol/zone.cpp \ - pol/module/attributemod.cpp pol/module/clmod.cpp pol/clfunc.cpp pol/storagemod.cpp pol/module/vitalmod.cpp \ + pol/module/attributemod.cpp pol/module/clmod.cpp pol/clfunc.cpp pol/module/storagemod.cpp pol/module/vitalmod.cpp \ plib/mapfunc.cpp plib/mapserver.cpp plib/pkg.cpp plib/realm.cpp \ plib/filemapserver.cpp plib/inmemorymapserver.cpp \ plib/realmfunc.cpp \ Modified: trunk/pol-core/pol/cgdata.cpp =================================================================== --- trunk/pol-core/pol/cgdata.cpp 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/pol/cgdata.cpp 2009-09-07 17:50:30 UTC (rev 31) @@ -13,7 +13,7 @@ #include "clib/unicode.h" #include "module/osmod.h" -#include "uniemod.h" +#include "module/unimod.h" #include "uoemod.h" #include "uoexec.h" Modified: trunk/pol-core/pol/client.cpp =================================================================== --- trunk/pol-core/pol/client.cpp 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/pol/client.cpp 2009-09-07 17:50:30 UTC (rev 31) @@ -38,7 +38,7 @@ #include "polstats.h" #include "sockio.h" #include "ssopt.h" -#include "uniemod.h" +#include "module/unimod.h" #include "uoclient.h" #include "uvars.h" #include "uworld.h" Modified: trunk/pol-core/pol/module/npcmod.cpp =================================================================== --- trunk/pol-core/pol/module/npcmod.cpp 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/pol/module/npcmod.cpp 2009-09-07 17:50:30 UTC (rev 31) @@ -63,7 +63,7 @@ #include "../uoemod.h" #include "../objtype.h" #include "../ufunc.h" -#include "../uniemod.h" +#include "unimod.h" #include "../uoexhelp.h" #include "../uoscrobj.h" #include "../watch.h" Modified: trunk/pol-core/pol/module/osmod.cpp =================================================================== --- trunk/pol-core/pol/module/osmod.cpp 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/pol/module/osmod.cpp 2009-09-07 17:50:30 UTC (rev 31) @@ -47,8 +47,8 @@ #include "../profile.h" #include "../scrdef.h" #include "../scrstore.h" -#include "../storagemod.h" -#include "../uniemod.h" +#include "storagemod.h" +#include "unimod.h" #include "../uoemod.h" #include "../uoexec.h" #include "utilmod.h" Added: trunk/pol-core/pol/module/storagemod.cpp =================================================================== --- trunk/pol-core/pol/module/storagemod.cpp (rev 0) +++ trunk/pol-core/pol/module/storagemod.cpp 2009-09-07 17:50:30 UTC (rev 31) @@ -0,0 +1,122 @@ +/* +History +======= +2006/10/07 Shinigami: GCC 3.4.x fix - added "template<>" to TmplExecutorModule + +Notes +======= + +*/ + +#include "../../clib/stl_inc.h" + +#include "../../bscript/bobject.h" +#include "../../bscript/berror.h" +#include "../../bscript/impstr.h" + +#include "storagemod.h" + +#include "../realms.h" +#include "../storage.h" +#include "../uoexhelp.h" +#include "../uoscrobj.h" + +template<> +TmplExecutorModule<StorageExecutorModule>::FunctionDef + TmplExecutorModule<StorageExecutorModule>::function_table[] = +{ + { "StorageAreas", &StorageExecutorModule::mf_StorageAreas }, + { "FindStorageArea", &StorageExecutorModule::mf_FindStorageArea }, + { "CreateStorageArea", &StorageExecutorModule::mf_CreateStorageArea }, + { "FindRootItemInStorageArea", &StorageExecutorModule::mf_FindRootItemInStorageArea }, + { "CreateRootItemInStorageArea", &StorageExecutorModule::mf_CreateRootItemInStorageArea }, + { "DestroyRootItemInStorageArea", &StorageExecutorModule::mf_DestroyRootItemInStorageArea } +}; +template<> +int TmplExecutorModule<StorageExecutorModule>::function_table_size = + arsize(function_table); + +BObjectImp* CreateStorageAreasImp(); +BObjectImp* StorageExecutorModule::mf_StorageAreas() +{ + return CreateStorageAreasImp(); +} + + +BObjectImp* StorageExecutorModule::mf_FindStorageArea() +{ + const String* str = getStringParam(0); + if ( str != NULL ) + { + StorageArea *area = storage.find_area(str->value()); + + if ( area ) + return new BApplicPtr(&storage_area_type, area); + } + return new BLong(0); // non-string passed, or not found. +} + +BObjectImp* StorageExecutorModule::mf_CreateStorageArea() +{ + String* name = EXPLICIT_CAST(String*, BObjectImp*)(getParamImp(0, BObjectImp::OTString)); + if ( name ) + { + StorageArea *area = storage.create_area(name->value()); + if ( area ) + return new BApplicPtr(&storage_area_type, area); + } + return new BLong( 0 ); // non-string passed, or not found. +} + +BObjectImp* StorageExecutorModule::mf_FindRootItemInStorageArea() +{ + StorageArea* area = EXPLICIT_CAST(StorageArea*, void*)(exec.getApplicPtrParam(0, &storage_area_type)); + const String *name = getStringParam(1); + + if ( !area || !name ) + return new BError("Invalid parameter type"); + + Item *item = area->find_root_item(name->value()); + + if ( item != NULL ) + return new EItemRefObjImp(item); + else + return new BError("Root item not found."); +} + +BObjectImp* StorageExecutorModule::mf_DestroyRootItemInStorageArea() +{ + StorageArea* area = EXPLICIT_CAST(StorageArea*, void*)(getApplicPtrParam(0, &storage_area_type)); + const String *name = getStringParam(1); + + if ( !area || !name ) + return new BError("Invalid parameter type"); + + bool result = area->delete_root_item(name->value()); + return new BLong( result ? 1 : 0 ); +} + +BObjectImp* StorageExecutorModule::mf_CreateRootItemInStorageArea() +{ + StorageArea* area = EXPLICIT_CAST(StorageArea*, void*)(getApplicPtrParam(0, &storage_area_type)); + const String* name; + const ItemDesc* descriptor; + + if ( area == NULL || !getStringParam(1, name) || !getObjtypeParam(exec, 2, descriptor) ) + return new BError("Invalid parameter type"); + + Item *item = Item::create(*descriptor); + if ( item == NULL ) + return new BError("Unable to create item"); + + item->setname(name->value()); + + if(item->realm == NULL) + item->realm = find_realm(string("britannia")); + + area->insert_root_item(item); + + return new EItemRefObjImp(item); +} + + Added: trunk/pol-core/pol/module/storagemod.h =================================================================== --- trunk/pol-core/pol/module/storagemod.h (rev 0) +++ trunk/pol-core/pol/module/storagemod.h 2009-09-07 17:50:30 UTC (rev 31) @@ -0,0 +1,31 @@ +/* +History +======= + +Notes +======= +Make sure to set the module up in scrsched.cpp too +add_common_exmods() + +*/ + +#ifndef STORAGEEMOD_H +#define STORAGEEMOD_H + +#include "../../bscript/execmodl.h" + +class StorageExecutorModule : public TmplExecutorModule<StorageExecutorModule> +{ +public: + StorageExecutorModule( Executor& exec ) : + TmplExecutorModule<StorageExecutorModule>("Storage", exec) {}; + + BObjectImp* mf_StorageAreas(); + BObjectImp* mf_DestroyRootItemInStorageArea(); + BObjectImp* mf_FindStorageArea(); + BObjectImp* mf_CreateStorageArea(); + BObjectImp* mf_FindRootItemInStorageArea(); + BObjectImp* mf_CreateRootItemInStorageArea(); +}; + +#endif Added: trunk/pol-core/pol/module/unimod.cpp =================================================================== --- trunk/pol-core/pol/module/unimod.cpp (rev 0) +++ trunk/pol-core/pol/module/unimod.cpp 2009-09-07 17:50:30 UTC (rev 31) @@ -0,0 +1,356 @@ +/* +History +======= +2006/10/07 Shinigami: GCC 3.4.x fix - added "template<>" to TmplExecutorModule +2009/09/03 MuadDib: Relocation of account related cpp/h + +Notes +======= + +*/ + +#include "../../clib/stl_inc.h" + +#ifdef _MSC_VER +# pragma warning(disable:4786) +#endif + +#include "../../clib/endian.h" +#include "../../clib/logfile.h" +#include "../../clib/stlutil.h" +#include "../../clib/strutil.h" +#include "../../clib/unicode.h" + +#include "bscript/berror.h" +#include "bscript/bobject.h" +#include "bscript/execmodl.h" +#include "bscript/impstr.h" + +#include "../accounts/account.h" +#include "../cgdata.h" +#include "../mobile/charactr.h" +#include "../client.h" +#include "../msghandl.h" +#include "../pktboth.h" +#include "../sockio.h" +#include "../ufunc.h" + +#include "osmod.h" +#include "unimod.h" + +////////////////////////////////////////////////////////////////////////// + + + +////////////////////////////////////////////////////////////////////////// + +char gtext[ 2*1024 ]; +u16 gwtext[ (SPEECH_MAX_LEN + 1) ]; + +void send_unicode_prompt( Client* client, u32 serial ) +{ + static PKTBI_C2 msg; + memset(&msg, 0, sizeof msg); + msg.msgtype = PKTBI_C2_ID; + msg.msglen = ctBEu16( PKTBI_C2::SERVER_MSGLEN ); + msg.serial = serial; + msg.msg_id = serial; // Server-"decided" message ID. o_O + transmit( client, &msg, PKTBI_C2::SERVER_MSGLEN ); +} + +void handle_unicode_prompt( Client* client, PKTBI_C2* msg ) +{ + UnicodeExecutorModule* uniemod = client->gd->prompt_uniemod; + if (uniemod == NULL) + return; // log it? + + int textlen = ((cfBEu16(msg->msglen) - offsetof(PKTBI_C2,wtext)) + / sizeof(msg->wtext[0])); //note NO terminator! + if (textlen < 0) + textlen = 0; + if (textlen > SPEECH_MAX_LEN) + { + textlen = SPEECH_MAX_LEN; // ENHANCE: May want to log this + msg->wtext[textlen] = 0x0000; + } + + bool ok = true; + BObject* valstack = NULL; + +#if(0) + // client version of the packet should always send this as a 1?? + if (cfBEu16(msg->unk) != 0x01) + { + // ENHANCE: May want to log this, too? + ok = false; + valstack = new BObject( new BError("Malformed return-packet from client") ); + } +#endif + + char lang[4]; + memcpy(lang, msg->lang, 3); + lang[3] = 0x00; + + if ( ok ) + { + ObjArray uc_text; + int i; + for ( i = 0; i < textlen; i++ ) + { + u16 wc = cfBEu16(msg->wtext[i]); + if ( wc < (u16)0x20 || wc == (u16)0x7F ) // control character! >_< + { + ok = false; + valstack = new BObject( new BError( "Invalid control characters in text entry" ) ); + + sprintf(gtext, "Client #%lu (account %s) sent invalid unicode control characters (RequestInputUC)", + client->instance_, + (client->acct != NULL) ? client->acct->name() : "unknown"); + cerr << gtext << endl; + Log("%s\n", gtext); + break; //for + } + uc_text.addElement( new BLong( wc ) ); + } + + if (ok) + { + if ( uc_text.ref_arr.size() == 0 ) + valstack = new BObject( new BLong( 0 ) ); + else + { + BStruct* retval = new BStruct(); + retval->addMember("lang", new String( lang ) ); + retval->addMember("uc_text", uc_text.copy() ); + valstack = new BObject( retval ); + } + } + } + + uniemod->exec.ValueStack.top().set( valstack ); // error or struct, regardless. + uniemod->os_module->revive(); + uniemod->prompt_chr = NULL; + client->gd->prompt_uniemod = NULL; +} +MESSAGE_HANDLER_VARLEN( PKTBI_C2, handle_unicode_prompt ); + +////////////////////////////////////////////////////////////////////////// + +template<> +TmplExecutorModule<UnicodeExecutorModule>::FunctionDef + TmplExecutorModule<UnicodeExecutorModule>::function_table[] = +{ + { "BroadcastUC", &UnicodeExecutorModule::mf_BroadcastUC }, + { "PrintTextAboveUC", &UnicodeExecutorModule::mf_PrintTextAboveUC }, + { "PrintTextAbovePrivateUC", &UnicodeExecutorModule::mf_PrivateTextAboveUC }, + { "RequestInputUC", &UnicodeExecutorModule::mf_RequestInputUC }, + { "SendSysMessageUC", &UnicodeExecutorModule::mf_SendSysMessageUC }, + { "SendTextEntryGumpUC", &UnicodeExecutorModule::mf_SendTextEntryGumpUC } +}; +template<> +int TmplExecutorModule<UnicodeExecutorModule>::function_table_size = + arsize(function_table); + +UnicodeExecutorModule::UnicodeExecutorModule( Executor& exec ) : + TmplExecutorModule<UnicodeExecutorModule>( "unicode", exec ), + prompt_chr(NULL) +{ + os_module = static_cast<OSExecutorModule*>(exec.findModule("OS")); + if (os_module == NULL) + throw runtime_error( "UnicodeExecutorModule needs OS module!" ); +} + +UnicodeExecutorModule::~UnicodeExecutorModule() +{ + if (prompt_chr != NULL) + { + prompt_chr->client->gd->prompt_uniemod = NULL; + prompt_chr = NULL; + } +} + +BObjectImp* UnicodeExecutorModule::mf_BroadcastUC() +{ +using std::wcout; // wcout rox :) + + ObjArray* oText; + const String* lang; + unsigned short font; + unsigned short color; + if (getObjArrayParam( 0, oText ) && + getStringParam( 1, lang ) && + getParam( 2, font ) && // todo: getFontParam + getParam( 3, color )) // todo: getColorParam + { + unsigned textlen = oText->ref_arr.size(); + if ( textlen > SPEECH_MAX_LEN ) + return new BError( "Unicode array exceeds maximum size." ); + if ( lang->length() != 3 ) + return new BError( "langcode must be a 3-character code." ); + //lang->toUpper(); // Language codes are in upper-case :) + if ( !convertArrayToUC(oText, gwtext, textlen) ) + return new BError( "Invalid value in Unicode array." ); + ::broadcast( gwtext, strupper(lang->value()).c_str(), font, color ); + return new BLong( 1 ); + } + else + { + return new BError( "A parameter was invalid" ); + } +} + +BObjectImp* UnicodeExecutorModule::mf_PrintTextAboveUC() +{ + UObject* obj; + ObjArray* oText; + const String* lang; + unsigned short font; + unsigned short color; + long journal_print; + + if (getUObjectParam( 0, obj ) && + getObjArrayParam( 1, oText ) && + getStringParam( 2, lang ) && + getParam( 3, font ) && + getParam( 4, color ) && + getParam( 5, journal_print) ) + { + unsigned textlen = oText->ref_arr.size(); + if ( textlen > SPEECH_MAX_LEN ) + return new BError( "Unicode array exceeds maximum size." ); + if ( lang->length() != 3 ) + return new BError( "langcode must be a 3-character code." ); + if ( !convertArrayToUC(oText, gwtext, textlen) ) + return new BError( "Invalid value in Unicode array." ); + + return new BLong( say_above( obj, gwtext, strupper(lang->value()).c_str(), font, color, journal_print ) ); + } + else + { + return new BError( "A parameter was invalid" ); + } +} + +BObjectImp* UnicodeExecutorModule::mf_PrivateTextAboveUC() +{ + Character* chr; + UObject* obj; + ObjArray* oText; + const String* lang; + unsigned short font; + unsigned short color; + + if (getUObjectParam( 0, obj ) && + getObjArrayParam( 1, oText ) && + getStringParam( 2, lang ) && + getCharacterParam( 3, chr ) && + getParam( 4, font ) && + getParam( 5, color ) ) + { + unsigned textlen = oText->ref_arr.size(); + if ( textlen > SPEECH_MAX_LEN ) + return new BError( "Unicode array exceeds maximum size." ); + if ( lang->length() != 3 ) + return new BError( "langcode must be a 3-character code." ); + //lang->toUpper(); // Language codes are in upper-case :) + if ( !convertArrayToUC(oText, gwtext, textlen) ) + return new BError( "Invalid value in Unicode array." ); + + return new BLong( private_say_above( chr, obj, gwtext, strupper(lang->value()).c_str(), font, color ) ); + } + else + { + return new BError( "A parameter was invalid" ); + } +} + +BObjectImp* UnicodeExecutorModule::mf_RequestInputUC() +{ + Character* chr; + Item* item; + ObjArray* oPrompt; + const String *lang; + if (getCharacterParam( 0, chr ) && + getItemParam( 1, item ) && + getObjArrayParam( 2, oPrompt ) && + getStringParam( 3, lang )) + { + if (!chr->has_active_client()) + { + return new BError( "No client attached" ); + } + + if (chr->has_active_prompt()) + { + return new BError( "Another script has an active prompt" ); + } + + unsigned textlen = oPrompt->ref_arr.size(); + if ( textlen > SPEECH_MAX_LEN ) + return new BError( "Unicode array exceeds maximum size." ); + if ( lang->length() != 3 ) + return new BError( "langcode must be a 3-character code." ); + if ( !convertArrayToUC(oPrompt, gwtext, textlen) ) + return new BError( "Invalid value in Unicode array." ); + + send_sysmessage( chr->client, gwtext, strupper(lang->value()).c_str() ); + + chr->client->gd->prompt_uniemod = this; + prompt_chr = chr; + + send_unicode_prompt( chr->client, ctBEu32( item->serial ) ); + os_module->suspend(); + return new BLong(0); + } + else + { + return new BError( "A parameter was invalid" ); + } +} + +BObjectImp* UnicodeExecutorModule::mf_SendSysMessageUC() +{ + Character* chr; + ObjArray* oText; + const String* lang; + unsigned short font; + unsigned short color; + + if (getCharacterParam( 0, chr ) && + getObjArrayParam( 1, oText ) && + getStringParam( 2, lang ) && + getParam( 3, font ) && + getParam( 4, color )) + { + if (chr->has_active_client()) + { + unsigned textlen = oText->ref_arr.size(); + if ( textlen > SPEECH_MAX_LEN ) + return new BError( "Unicode array exceeds maximum size." ); + if ( lang->length() != 3 ) + return new BError( "langcode must be a 3-character code." ); + //lang->toUpper(); // Language codes are in upper-case :) + if ( !convertArrayToUC(oText, gwtext, textlen) ) + return new BError( "Invalid value in Unicode array." ); + + send_sysmessage( chr->client, gwtext, strupper(lang->value()).c_str(), font, color ); + return new BLong(1); + } + else + { + return new BError( "Mobile has no active client" ); + } + } + else + { + return new BError( "Invalid parameter type" ); + } +} + +BObjectImp* UnicodeExecutorModule::mf_SendTextEntryGumpUC() +{ + //SendTextEntryGumpUC(who, uc_text1, cancel := TE_CANCEL_ENABLE, + // style := TE_STYLE_NORMAL, maximum := 40, uc_text2 := {} ); + + return new BError( "Function not implimented" ); +} Added: trunk/pol-core/pol/module/unimod.h =================================================================== --- trunk/pol-core/pol/module/unimod.h (rev 0) +++ trunk/pol-core/pol/module/unimod.h 2009-09-07 17:50:30 UTC (rev 31) @@ -0,0 +1,64 @@ +/* +History +======= + + +Notes +======= + +*/ + +#ifndef H_UNIEMOD_H +#define H_UNIEMOD_H + +#ifndef __BSCRIPT_EXECMODL_H +# include "../../bscript/execmodl.h" +#endif + +#include "../pktdef.h" +#include "../uoexec.h" +#include "../uoexhelp.h" + +extern u16 gwtext[ (SPEECH_MAX_LEN + 1) ]; + +class UnicodeExecutorModule : public TmplExecutorModule<UnicodeExecutorModule> +{ +public: + explicit UnicodeExecutorModule( Executor& exec ); + ~UnicodeExecutorModule(); + + OSExecutorModule* os_module; + + BObjectImp* mf_PrintTextAboveUC(); // OverObject, Text, Font, Color + BObjectImp* mf_PrivateTextAboveUC(); // OverObject, Text, ToChar, Font, Color + + BObjectImp* mf_BroadcastUC(); // Text + BObjectImp* mf_SendSysMessageUC(); // Character, Text + + BObjectImp* mf_RequestInputUC(); // ToChar, Item, TextPrompt + BObjectImp* mf_SendTextEntryGumpUC(); // ToChar, Text1, Cancel, Style, MaxLen, Text2 + + Character* prompt_chr; + +protected: + bool getCharacterParam( unsigned param, Character*& chrptr ); + bool getItemParam( unsigned param, Item*& itemptr ); + bool getUObjectParam( unsigned param, UObject*& objptr ); +}; + +inline bool UnicodeExecutorModule::getCharacterParam( unsigned param, Character*& chrptr ) +{ + return ::getCharacterParam( exec, param, chrptr ); +} + +inline bool UnicodeExecutorModule::getItemParam( unsigned param, Item*& itemptr ) +{ + return ::getItemParam( exec, param, itemptr ); +} + +inline bool UnicodeExecutorModule::getUObjectParam( unsigned param, UObject*& objptr ) +{ + return ::getUObjectParam( exec, param, objptr ); +} + +#endif Modified: trunk/pol-core/pol/npc.cpp =================================================================== --- trunk/pol-core/pol/npc.cpp 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/pol/npc.cpp 2009-09-07 17:50:30 UTC (rev 31) @@ -70,7 +70,7 @@ #include "uoemod.h" #include "objtype.h" #include "ufunc.h" -#include "uniemod.h" +#include "module/unimod.h" #include "uoexhelp.h" #include "uoscrobj.h" #include "watch.h" Modified: trunk/pol-core/pol/pol-2008.vcproj =================================================================== --- trunk/pol-core/pol/pol-2008.vcproj 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/pol/pol-2008.vcproj 2009-09-07 17:50:30 UTC (rev 31) @@ -682,10 +682,6 @@ > </File> <File - RelativePath=".\storagemod.cpp" - > - </File> - <File RelativePath=".\syshook.cpp" > </File> @@ -750,10 +746,6 @@ > </File> <File - RelativePath="uniemod.cpp" - > - </File> - <File RelativePath=".\uobjcnt.cpp" > </File> @@ -1427,10 +1419,6 @@ > </File> <File - RelativePath=".\storagemod.h" - > - </File> - <File RelativePath=".\stubdata.h" > </File> @@ -1515,10 +1503,6 @@ > </File> <File - RelativePath="uniemod.h" - > - </File> - <File RelativePath=".\uobjcnt.h" > </File> @@ -2071,6 +2055,22 @@ > </File> <File + RelativePath=".\module\storagemod.cpp" + > + </File> + <File + RelativePath=".\module\storagemod.h" + > + </File> + <File + RelativePath=".\module\unimod.cpp" + > + </File> + <File + RelativePath=".\module\unimod.h" + > + </File> + <File RelativePath=".\module\utilmod.cpp" > </File> Modified: trunk/pol-core/pol/scrsched.cpp =================================================================== --- trunk/pol-core/pol/scrsched.cpp 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/pol/scrsched.cpp 2009-09-07 17:50:30 UTC (rev 31) @@ -55,8 +55,8 @@ #include "profile.h" #include "scrdef.h" #include "scrstore.h" -#include "storagemod.h" -#include "uniemod.h" +#include "module/storagemod.h" +#include "module/unimod.h" #include "uoemod.h" #include "uoexec.h" #include "module/utilmod.h" Deleted: trunk/pol-core/pol/storagemod.cpp =================================================================== --- trunk/pol-core/pol/storagemod.cpp 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/pol/storagemod.cpp 2009-09-07 17:50:30 UTC (rev 31) @@ -1,121 +0,0 @@ -/* -History -======= -2006/10/07 Shinigami: GCC 3.4.x fix - added "template<>" to TmplExecutorModule - -Notes -======= - -*/ - -#include "clib/stl_inc.h" - -#include "bscript/bobject.h" -#include "bscript/berror.h" -#include "bscript/impstr.h" - -#include "realms.h" -#include "storage.h" -#include "storagemod.h" -#include "uoexhelp.h" -#include "uoscrobj.h" - -template<> -TmplExecutorModule<StorageExecutorModule>::FunctionDef - TmplExecutorModule<StorageExecutorModule>::function_table[] = -{ - { "StorageAreas", &StorageExecutorModule::mf_StorageAreas }, - { "FindStorageArea", &StorageExecutorModule::mf_FindStorageArea }, - { "CreateStorageArea", &StorageExecutorModule::mf_CreateStorageArea }, - { "FindRootItemInStorageArea", &StorageExecutorModule::mf_FindRootItemInStorageArea }, - { "CreateRootItemInStorageArea", &StorageExecutorModule::mf_CreateRootItemInStorageArea }, - { "DestroyRootItemInStorageArea", &StorageExecutorModule::mf_DestroyRootItemInStorageArea } -}; -template<> -int TmplExecutorModule<StorageExecutorModule>::function_table_size = - arsize(function_table); - -BObjectImp* CreateStorageAreasImp(); -BObjectImp* StorageExecutorModule::mf_StorageAreas() -{ - return CreateStorageAreasImp(); -} - - -BObjectImp* StorageExecutorModule::mf_FindStorageArea() -{ - const String* str = getStringParam(0); - if ( str != NULL ) - { - StorageArea *area = storage.find_area(str->value()); - - if ( area ) - return new BApplicPtr(&storage_area_type, area); - } - return new BLong(0); // non-string passed, or not found. -} - -BObjectImp* StorageExecutorModule::mf_CreateStorageArea() -{ - String* name = EXPLICIT_CAST(String*, BObjectImp*)(getParamImp(0, BObjectImp::OTString)); - if ( name ) - { - StorageArea *area = storage.create_area(name->value()); - if ( area ) - return new BApplicPtr(&storage_area_type, area); - } - return new BLong( 0 ); // non-string passed, or not found. -} - -BObjectImp* StorageExecutorModule::mf_FindRootItemInStorageArea() -{ - StorageArea* area = EXPLICIT_CAST(StorageArea*, void*)(exec.getApplicPtrParam(0, &storage_area_type)); - const String *name = getStringParam(1); - - if ( !area || !name ) - return new BError("Invalid parameter type"); - - Item *item = area->find_root_item(name->value()); - - if ( item != NULL ) - return new EItemRefObjImp(item); - else - return new BError("Root item not found."); -} - -BObjectImp* StorageExecutorModule::mf_DestroyRootItemInStorageArea() -{ - StorageArea* area = EXPLICIT_CAST(StorageArea*, void*)(getApplicPtrParam(0, &storage_area_type)); - const String *name = getStringParam(1); - - if ( !area || !name ) - return new BError("Invalid parameter type"); - - bool result = area->delete_root_item(name->value()); - return new BLong( result ? 1 : 0 ); -} - -BObjectImp* StorageExecutorModule::mf_CreateRootItemInStorageArea() -{ - StorageArea* area = EXPLICIT_CAST(StorageArea*, void*)(getApplicPtrParam(0, &storage_area_type)); - const String* name; - const ItemDesc* descriptor; - - if ( area == NULL || !getStringParam(1, name) || !getObjtypeParam(exec, 2, descriptor) ) - return new BError("Invalid parameter type"); - - Item *item = Item::create(*descriptor); - if ( item == NULL ) - return new BError("Unable to create item"); - - item->setname(name->value()); - - if(item->realm == NULL) - item->realm = find_realm(string("britannia")); - - area->insert_root_item(item); - - return new EItemRefObjImp(item); -} - - Deleted: trunk/pol-core/pol/storagemod.h =================================================================== --- trunk/pol-core/pol/storagemod.h 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/pol/storagemod.h 2009-09-07 17:50:30 UTC (rev 31) @@ -1,32 +0,0 @@ -/* -History -======= -Make sure to set the module up in scrsched.cpp too -add_common_exmods() - - -Notes -======= - -*/ - -#ifndef STORAGEEMOD_H -#define STORAGEEMOD_H - -#include "bscript/execmodl.h" - -class StorageExecutorModule : public TmplExecutorModule<StorageExecutorModule> -{ -public: - StorageExecutorModule( Executor& exec ) : - TmplExecutorModule<StorageExecutorModule>("Storage", exec) {}; - - BObjectImp* mf_StorageAreas(); - BObjectImp* mf_DestroyRootItemInStorageArea(); - BObjectImp* mf_FindStorageArea(); - BObjectImp* mf_CreateStorageArea(); - BObjectImp* mf_FindRootItemInStorageArea(); - BObjectImp* mf_CreateRootItemInStorageArea(); -}; - -#endif Deleted: trunk/pol-core/pol/uniemod.cpp =================================================================== --- trunk/pol-core/pol/uniemod.cpp 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/pol/uniemod.cpp 2009-09-07 17:50:30 UTC (rev 31) @@ -1,356 +0,0 @@ -/* -History -======= -2006/10/07 Shinigami: GCC 3.4.x fix - added "template<>" to TmplExecutorModule -2009/09/03 MuadDib: Relocation of account related cpp/h - -Notes -======= - -*/ - -#include "clib/stl_inc.h" - -#ifdef _MSC_VER -#pragma warning(disable:4786) -#endif - -#include "clib/endian.h" -#include "clib/logfile.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" -#include "clib/unicode.h" - -#include "bscript/berror.h" -#include "bscript/bobject.h" -#include "bscript/execmodl.h" -#include "bscript/impstr.h" - -#include "accounts/account.h" -#include "cgdata.h" -#include "mobile/charactr.h" -#include "client.h" -#include "msghandl.h" -#include "pktboth.h" -#include "sockio.h" -#include "ufunc.h" - -#include "module/osmod.h" -#include "uniemod.h" - -////////////////////////////////////////////////////////////////////////// - - - -////////////////////////////////////////////////////////////////////////// - -char gtext[ 2*1024 ]; -u16 gwtext[ (SPEECH_MAX_LEN + 1) ]; - -void send_unicode_prompt( Client* client, u32 serial ) -{ - static PKTBI_C2 msg; - memset(&msg, 0, sizeof msg); - msg.msgtype = PKTBI_C2_ID; - msg.msglen = ctBEu16( PKTBI_C2::SERVER_MSGLEN ); - msg.serial = serial; - msg.msg_id = serial; // Server-"decided" message ID. o_O - transmit( client, &msg, PKTBI_C2::SERVER_MSGLEN ); -} - -void handle_unicode_prompt( Client* client, PKTBI_C2* msg ) -{ - UnicodeExecutorModule* uniemod = client->gd->prompt_uniemod; - if (uniemod == NULL) - return; // log it? - - int textlen = ((cfBEu16(msg->msglen) - offsetof(PKTBI_C2,wtext)) - / sizeof(msg->wtext[0])); //note NO terminator! - if (textlen < 0) - textlen = 0; - if (textlen > SPEECH_MAX_LEN) - { - textlen = SPEECH_MAX_LEN; // ENHANCE: May want to log this - msg->wtext[textlen] = 0x0000; - } - - bool ok = true; - BObject* valstack = NULL; - -#if(0) - // client version of the packet should always send this as a 1?? - if (cfBEu16(msg->unk) != 0x01) - { - // ENHANCE: May want to log this, too? - ok = false; - valstack = new BObject( new BError("Malformed return-packet from client") ); - } -#endif - - char lang[4]; - memcpy(lang, msg->lang, 3); - lang[3] = 0x00; - - if ( ok ) - { - ObjArray uc_text; - int i; - for ( i = 0; i < textlen; i++ ) - { - u16 wc = cfBEu16(msg->wtext[i]); - if ( wc < (u16)0x20 || wc == (u16)0x7F ) // control character! >_< - { - ok = false; - valstack = new BObject( new BError( "Invalid control characters in text entry" ) ); - - sprintf(gtext, "Client #%lu (account %s) sent invalid unicode control characters (RequestInputUC)", - client->instance_, - (client->acct != NULL) ? client->acct->name() : "unknown"); - cerr << gtext << endl; - Log("%s\n", gtext); - break; //for - } - uc_text.addElement( new BLong( wc ) ); - } - - if (ok) - { - if ( uc_text.ref_arr.size() == 0 ) - valstack = new BObject( new BLong( 0 ) ); - else - { - BStruct* retval = new BStruct(); - retval->addMember("lang", new String( lang ) ); - retval->addMember("uc_text", uc_text.copy() ); - valstack = new BObject( retval ); - } - } - } - - uniemod->exec.ValueStack.top().set( valstack ); // error or struct, regardless. - uniemod->os_module->revive(); - uniemod->prompt_chr = NULL; - client->gd->prompt_uniemod = NULL; -} -MESSAGE_HANDLER_VARLEN( PKTBI_C2, handle_unicode_prompt ); - -////////////////////////////////////////////////////////////////////////// - -template<> -TmplExecutorModule<UnicodeExecutorModule>::FunctionDef - TmplExecutorModule<UnicodeExecutorModule>::function_table[] = -{ - { "BroadcastUC", &UnicodeExecutorModule::mf_BroadcastUC }, - { "PrintTextAboveUC", &UnicodeExecutorModule::mf_PrintTextAboveUC }, - { "PrintTextAbovePrivateUC", &UnicodeExecutorModule::mf_PrivateTextAboveUC }, - { "RequestInputUC", &UnicodeExecutorModule::mf_RequestInputUC }, - { "SendSysMessageUC", &UnicodeExecutorModule::mf_SendSysMessageUC }, - { "SendTextEntryGumpUC", &UnicodeExecutorModule::mf_SendTextEntryGumpUC } -}; -template<> -int TmplExecutorModule<UnicodeExecutorModule>::function_table_size = - arsize(function_table); - -UnicodeExecutorModule::UnicodeExecutorModule( Executor& exec ) : - TmplExecutorModule<UnicodeExecutorModule>( "unicode", exec ), - prompt_chr(NULL) -{ - os_module = static_cast<OSExecutorModule*>(exec.findModule("OS")); - if (os_module == NULL) - throw runtime_error( "UnicodeExecutorModule needs OS module!" ); -} - -UnicodeExecutorModule::~UnicodeExecutorModule() -{ - if (prompt_chr != NULL) - { - prompt_chr->client->gd->prompt_uniemod = NULL; - prompt_chr = NULL; - } -} - -BObjectImp* UnicodeExecutorModule::mf_BroadcastUC() -{ -using std::wcout; // wcout rox :) - - ObjArray* oText; - const String* lang; - unsigned short font; - unsigned short color; - if (getObjArrayParam( 0, oText ) && - getStringParam( 1, lang ) && - getParam( 2, font ) && // todo: getFontParam - getParam( 3, color )) // todo: getColorParam - { - unsigned textlen = oText->ref_arr.size(); - if ( textlen > SPEECH_MAX_LEN ) - return new BError( "Unicode array exceeds maximum size." ); - if ( lang->length() != 3 ) - return new BError( "langcode must be a 3-character code." ); - //lang->toUpper(); // Language codes are in upper-case :) - if ( !convertArrayToUC(oText, gwtext, textlen) ) - return new BError( "Invalid value in Unicode array." ); - ::broadcast( gwtext, strupper(lang->value()).c_str(), font, color ); - return new BLong( 1 ); - } - else - { - return new BError( "A parameter was invalid" ); - } -} - -BObjectImp* UnicodeExecutorModule::mf_PrintTextAboveUC() -{ - UObject* obj; - ObjArray* oText; - const String* lang; - unsigned short font; - unsigned short color; - long journal_print; - - if (getUObjectParam( 0, obj ) && - getObjArrayParam( 1, oText ) && - getStringParam( 2, lang ) && - getParam( 3, font ) && - getParam( 4, color ) && - getParam( 5, journal_print) ) - { - unsigned textlen = oText->ref_arr.size(); - if ( textlen > SPEECH_MAX_LEN ) - return new BError( "Unicode array exceeds maximum size." ); - if ( lang->length() != 3 ) - return new BError( "langcode must be a 3-character code." ); - if ( !convertArrayToUC(oText, gwtext, textlen) ) - return new BError( "Invalid value in Unicode array." ); - - return new BLong( say_above( obj, gwtext, strupper(lang->value()).c_str(), font, color, journal_print ) ); - } - else - { - return new BError( "A parameter was invalid" ); - } -} - -BObjectImp* UnicodeExecutorModule::mf_PrivateTextAboveUC() -{ - Character* chr; - UObject* obj; - ObjArray* oText; - const String* lang; - unsigned short font; - unsigned short color; - - if (getUObjectParam( 0, obj ) && - getObjArrayParam( 1, oText ) && - getStringParam( 2, lang ) && - getCharacterParam( 3, chr ) && - getParam( 4, font ) && - getParam( 5, color ) ) - { - unsigned textlen = oText->ref_arr.size(); - if ( textlen > SPEECH_MAX_LEN ) - return new BError( "Unicode array exceeds maximum size." ); - if ( lang->length() != 3 ) - return new BError( "langcode must be a 3-character code." ); - //lang->toUpper(); // Language codes are in upper-case :) - if ( !convertArrayToUC(oText, gwtext, textlen) ) - return new BError( "Invalid value in Unicode array." ); - - return new BLong( private_say_above( chr, obj, gwtext, strupper(lang->value()).c_str(), font, color ) ); - } - else - { - return new BError( "A parameter was invalid" ); - } -} - -BObjectImp* UnicodeExecutorModule::mf_RequestInputUC() -{ - Character* chr; - Item* item; - ObjArray* oPrompt; - const String *lang; - if (getCharacterParam( 0, chr ) && - getItemParam( 1, item ) && - getObjArrayParam( 2, oPrompt ) && - getStringParam( 3, lang )) - { - if (!chr->has_active_client()) - { - return new BError( "No client attached" ); - } - - if (chr->has_active_prompt()) - { - return new BError( "Another script has an active prompt" ); - } - - unsigned textlen = oPrompt->ref_arr.size(); - if ( textlen > SPEECH_MAX_LEN ) - return new BError( "Unicode array exceeds maximum size." ); - if ( lang->length() != 3 ) - return new BError( "langcode must be a 3-character code." ); - if ( !convertArrayToUC(oPrompt, gwtext, textlen) ) - return new BError( "Invalid value in Unicode array." ); - - send_sysmessage( chr->client, gwtext, strupper(lang->value()).c_str() ); - - chr->client->gd->prompt_uniemod = this; - prompt_chr = chr; - - send_unicode_prompt( chr->client, ctBEu32( item->serial ) ); - os_module->suspend(); - return new BLong(0); - } - else - { - return new BError( "A parameter was invalid" ); - } -} - -BObjectImp* UnicodeExecutorModule::mf_SendSysMessageUC() -{ - Character* chr; - ObjArray* oText; - const String* lang; - unsigned short font; - unsigned short color; - - if (getCharacterParam( 0, chr ) && - getObjArrayParam( 1, oText ) && - getStringParam( 2, lang ) && - getParam( 3, font ) && - getParam( 4, color )) - { - if (chr->has_active_client()) - { - unsigned textlen = oText->ref_arr.size(); - if ( textlen > SPEECH_MAX_LEN ) - return new BError( "Unicode array exceeds maximum size." ); - if ( lang->length() != 3 ) - return new BError( "langcode must be a 3-character code." ); - //lang->toUpper(); // Language codes are in upper-case :) - if ( !convertArrayToUC(oText, gwtext, textlen) ) - return new BError( "Invalid value in Unicode array." ); - - send_sysmessage( chr->client, gwtext, strupper(lang->value()).c_str(), font, color ); - return new BLong(1); - } - else - { - return new BError( "Mobile has no active client" ); - } - } - else - { - return new BError( "Invalid parameter type" ); - } -} - -BObjectImp* UnicodeExecutorModule::mf_SendTextEntryGumpUC() -{ - //SendTextEntryGumpUC(who, uc_text1, cancel := TE_CANCEL_ENABLE, - // style := TE_STYLE_NORMAL, maximum := 40, uc_text2 := {} ); - - return new BError( "Function not implimented" ); -} Deleted: trunk/pol-core/pol/uniemod.h =================================================================== --- trunk/pol-core/pol/uniemod.h 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/pol/uniemod.h 2009-09-07 17:50:30 UTC (rev 31) @@ -1,64 +0,0 @@ -/* -History -======= - - -Notes -======= - -*/ - -#ifndef H_UNIEMOD_H -#define H_UNIEMOD_H - -#ifndef __BSCRIPT_EXECMODL_H -#include "bscript/execmodl.h" -#endif - -#include "pktdef.h" -#include "uoexec.h" -#include "uoexhelp.h" - -extern u16 gwtext[ (SPEECH_MAX_LEN + 1) ]; - -class UnicodeExecutorModule : public TmplExecutorModule<UnicodeExecutorModule> -{ -public: - explicit UnicodeExecutorModule( Executor& exec ); - ~UnicodeExecutorModule(); - - OSExecutorModule* os_module; - - BObjectImp* mf_PrintTextAboveUC(); // OverObject, Text, Font, Color - BObjectImp* mf_PrivateTextAboveUC(); // OverObject, Text, ToChar, Font, Color - - BObjectImp* mf_BroadcastUC(); // Text - BObjectImp* mf_SendSysMessageUC(); // Character, Text - - BObjectImp* mf_RequestInputUC(); // ToChar, Item, TextPrompt - BObjectImp* mf_SendTextEntryGumpUC(); // ToChar, Text1, Cancel, Style, MaxLen, Text2 - - Character* prompt_chr; - -protected: - bool getCharacterParam( unsigned param, Character*& chrptr ); - bool getItemParam( unsigned param, Item*& itemptr ); - bool getUObjectParam( unsigned param, UObject*& objptr ); -}; - -inline bool UnicodeExecutorModule::getCharacterParam( unsigned param, Character*& chrptr ) -{ - return ::getCharacterParam( exec, param, chrptr ); -} - -inline bool UnicodeExecutorModule::getItemParam( unsigned param, Item*& itemptr ) -{ - return ::getItemParam( exec, param, itemptr ); -} - -inline bool UnicodeExecutorModule::getUObjectParam( unsigned param, UObject*& objptr ) -{ - return ::getUObjectParam( exec, param, objptr ); -} - -#endif Modified: trunk/pol-core/uotool/uotool.cpp =================================================================== --- trunk/pol-core/uotool/uotool.cpp 2009-09-07 15:12:30 UTC (rev 30) +++ trunk/pol-core/uotool/uotool.cpp 2009-09-07 17:50:30 UTC (rev 31) @@ -9,8 +9,9 @@ */ #include "../clib/stl_inc.h" + #ifdef _WIN32 -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif #include <fstream> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-07 18:27:17
|
Revision: 32 http://polserver.svn.sourceforge.net/polserver/?rev=32&view=rev Author: muaddib_pol Date: 2009-09-07 18:27:08 +0000 (Mon, 07 Sep 2009) Log Message: ----------- + UO Module code moved Modified Paths: -------------- trunk/pol-core/makefile.gcc trunk/pol-core/pol/auxclient.cpp trunk/pol-core/pol/cgdata.cpp trunk/pol-core/pol/create.cpp trunk/pol-core/pol/exscrobj.cpp trunk/pol-core/pol/getmsg.cpp trunk/pol-core/pol/mobile/charactr.cpp trunk/pol-core/pol/mobile/chrcast.cpp trunk/pol-core/pol/mobile/chrituse.cpp trunk/pol-core/pol/mobile/chrskuse.cpp trunk/pol-core/pol/module/guildmod.cpp trunk/pol-core/pol/module/npcmod.cpp trunk/pol-core/pol/module/osmod.cpp trunk/pol-core/pol/module/vitalmod.cpp trunk/pol-core/pol/npc.cpp trunk/pol-core/pol/party.cpp trunk/pol-core/pol/pol-2008.vcproj trunk/pol-core/pol/poldbg.cpp trunk/pol-core/pol/polwww.cpp trunk/pol-core/pol/scrsched.cpp trunk/pol-core/pol/textcmd.cpp trunk/pol-core/pol/uoscrobj.cpp Added Paths: ----------- trunk/pol-core/pol/module/uomod.cpp trunk/pol-core/pol/module/uomod.h trunk/pol-core/pol/module/uomod2.cpp trunk/pol-core/pol/module/uomod3.cpp trunk/pol-core/pol/module/uomod4.cpp Removed Paths: ------------- trunk/pol-core/pol/uoemod.cpp trunk/pol-core/pol/uoemod.h trunk/pol-core/pol/uoemod2.cpp trunk/pol-core/pol/uoemod3.cpp trunk/pol-core/pol/uoemod4.cpp Modified: trunk/pol-core/makefile.gcc =================================================================== --- trunk/pol-core/makefile.gcc 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/makefile.gcc 2009-09-07 18:27:08 UTC (rev 32) @@ -112,8 +112,8 @@ pol/ucrypto.cpp pol/ufunc.cpp pol/ufunc2.cpp pol/uimport.cpp \ pol/umap.cpp pol/module/unimod.cpp \ pol/uobjcnt.cpp pol/uobject.cpp pol/uobjhelp.cpp pol/uoclient.cpp \ - pol/uoemod.cpp pol/uoemod2.cpp \ - pol/uoemod3.cpp pol/uoemod4.cpp pol/uoexhelp.cpp \ + pol/module/uomod.cpp pol/module/uomod2.cpp \ + pol/module/uomod3.cpp pol/module/uomod4.cpp pol/uoexhelp.cpp \ pol/uolisten.cpp \ pol/uoscrobj.cpp pol/uoskills.cpp pol/useskill.cpp \ pol/module/utilmod.cpp pol/module/sqlmod.cpp \ Modified: trunk/pol-core/pol/auxclient.cpp =================================================================== --- trunk/pol-core/pol/auxclient.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/auxclient.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -31,7 +31,7 @@ #include "scrdef.h" #include "scrsched.h" #include "sockets.h" -#include "uoemod.h" +#include "module/uomod.h" #include "uoexec.h" class AuxClientThread; Modified: trunk/pol-core/pol/cgdata.cpp =================================================================== --- trunk/pol-core/pol/cgdata.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/cgdata.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -14,7 +14,7 @@ #include "module/osmod.h" #include "module/unimod.h" -#include "uoemod.h" +#include "module/uomod.h" #include "uoexec.h" #include "cgdata.h" Modified: trunk/pol-core/pol/create.cpp =================================================================== --- trunk/pol-core/pol/create.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/create.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -56,7 +56,7 @@ #include "scrsched.h" #include "scrstore.h" #include "uoexec.h" -#include "uoemod.h" +#include "module/uomod.h" #include "objecthash.h" Modified: trunk/pol-core/pol/exscrobj.cpp =================================================================== --- trunk/pol-core/pol/exscrobj.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/exscrobj.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -29,7 +29,7 @@ #include "polcfg.h" #include "module/osmod.h" #include "uoexec.h" -#include "uoemod.h" +#include "module/uomod.h" #include "uoscrobj.h" BApplicObjType scriptexobjimp_type; Modified: trunk/pol-core/pol/getmsg.cpp =================================================================== --- trunk/pol-core/pol/getmsg.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/getmsg.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -26,7 +26,7 @@ #include "pktboth.h" #include "ufunc.h" #include "uoexec.h" -#include "uoemod.h" +#include "module/uomod.h" void send_prompt( Client* client, u32 serial ) { Modified: trunk/pol-core/pol/mobile/charactr.cpp =================================================================== --- trunk/pol-core/pol/mobile/charactr.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/mobile/charactr.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -112,7 +112,7 @@ #include "../ufuncstd.h" #include "../umanip.h" #include "../uobjcnt.h" -#include "../uoemod.h" +#include "../module/uomod.h" #include "../uoexec.h" #include "../uofile.h" #include "../uoscrobj.h" Modified: trunk/pol-core/pol/mobile/chrcast.cpp =================================================================== --- trunk/pol-core/pol/mobile/chrcast.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/mobile/chrcast.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -18,7 +18,7 @@ #include "../scrsched.h" #include "../spells.h" -#include "../uoemod.h" +#include "../module/uomod.h" #include "../uoexec.h" #include "charactr.h" Modified: trunk/pol-core/pol/mobile/chrituse.cpp =================================================================== --- trunk/pol-core/pol/mobile/chrituse.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/mobile/chrituse.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -16,7 +16,7 @@ #include "../module/osmod.h" #include "../polcfg.h" #include "../scrsched.h" -#include "../uoemod.h" +#include "../module/uomod.h" #include "../uoexec.h" #include "../uoscrobj.h" Modified: trunk/pol-core/pol/mobile/chrskuse.cpp =================================================================== --- trunk/pol-core/pol/mobile/chrskuse.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/mobile/chrskuse.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -12,7 +12,7 @@ #include "../module/cfgmod.h" #include "../module/osmod.h" #include "../scrsched.h" -#include "../uoemod.h" +#include "../module/uomod.h" #include "../uoexec.h" #include "charactr.h" Modified: trunk/pol-core/pol/module/guildmod.cpp =================================================================== --- trunk/pol-core/pol/module/guildmod.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/module/guildmod.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -33,7 +33,7 @@ #include "../proplist.h" #include "../ufunc.h" #include "../uobject.h" -#include "../uoemod.h" +#include "uomod.h" #include "../uoscrobj.h" /// Guild Object Modified: trunk/pol-core/pol/module/npcmod.cpp =================================================================== --- trunk/pol-core/pol/module/npcmod.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/module/npcmod.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -60,7 +60,7 @@ #include "../uvars.h" #include "osmod.h" #include "../uoexec.h" -#include "../uoemod.h" +#include "uomod.h" #include "../objtype.h" #include "../ufunc.h" #include "unimod.h" Modified: trunk/pol-core/pol/module/osmod.cpp =================================================================== --- trunk/pol-core/pol/module/osmod.cpp 2009-09-07 17:50:30 UTC (rev 31) +++ trunk/pol-core/pol/module/osmod.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -49,7 +49,7 @@ #include "../scrstore.h" #include "storagemod.h" #include "unimod.h" -#include "../uoemod.h" +#include "uomod.h" #include "../uoexec.h" #include "utilmod.h" #include "vitalmod.h" Added: trunk/pol-core/pol/module/uomod.cpp =================================================================== --- trunk/pol-core/pol/module/uomod.cpp (rev 0) +++ trunk/pol-core/pol/module/uomod.cpp 2009-09-07 18:27:08 UTC (rev 32) @@ -0,0 +1,5603 @@ +/* +History +======= +2005/03/02 Shinigami: internal_MoveItem - item took from container don't had the correct realm +2005/04/02 Shinigami: mf_CreateItemCopyAtLocation - added realm param +2005/04/28 Shinigami: mf_EnumerateItemsInContainer/enumerate_contents - added flag to list content of locked container too +2005/04/28 Shinigami: added mf_SecureTradeWin - to init secure trade via script over long distances + added mf_MoveItemToSecureTradeWin - to move item to secure trade window via script +2005/04/31 Shinigami: mf_EnumerateItemsInContainer - error message added +2005/06/01 Shinigami: added mf_Attach - to attach a Script to a Character + mf_MoveItem - stupid non-realm anti-crash bugfix (e.g. for intrinsic weapons without realm) + added mf_ListStaticsAtLocation - list static Items at location + added mf_ListStaticsNearLocation - list static Items around location + added mf_GetStandingLayers - get layer a mobile can stand +2005/06/06 Shinigami: mf_ListStatics* will return multi Items too / flags added +2005/07/04 Shinigami: mf_ListStatics* constants renamed + added Z to mf_ListStatics*Location - better specify what u want to get + modified Z handling of mf_ListItems*Location* and mf_ListMobilesNearLocation* + better specify what u want to get + added realm-based coord check to mf_ListItems*Location*, + mf_List*InBox and mf_ListMobilesNearLocation* + added mf_ListStaticsInBox - list static items in box +2005/07/07 Shinigami: realm-based coord check in mf_List*InBox disabled +2005/09/02 Shinigami: mf_Attach - smaller bug which allowed u to attach more than one Script to a Character +2005/09/03 Shinigami: mf_FindPath - added Flags to support non-blocking doors +2005/09/23 Shinigami: added mf_SendStatus - to send full status packet to support extensions +2005/12/06 MuadDib: Rewrote realm handling for Move* and internal_move_item. New realm is + to be passed to function, and oldrealm handling is done within the function. + Container's still save and check oldrealm as before to update clients. +2006/01/18 Shinigami: added attached_npc_ - to get attached NPC from AI-Script-Process Obj +2006/05/10 Shinigami: mf_ListMobilesNearLocationEx - just a logical mismatch +2006/05/24 Shinigami: added mf_SendCharacterRaceChanger - change Hair, Beard and Color +2006/06/08 Shinigami: started to add FindPath logging +2006/09/17 Shinigami: mf_SendEvent() will return error "Event queue is full, discarding event" +2006/11/25 Shinigami: mf_GetWorldHeight() fixed bug because z was'n initialized +2007/05/03 Turley: added mf_GetRegionNameAtLocation - get name of justice region +2007/05/04 Shinigami: added mf_GetRegionName - get name of justice region by objref +2007/05/07 Shinigami: fixed a crash in mf_GetRegionName using NPCs; added TopLevelOwner +2008/07/08 Turley: Added mf_IsStackable - Is item stackable? +2008/07/21 Mehdorn: mf_ReserveItem() will return 2 if Item is already reserved by me (instead of 1) +2009/07/27 MuadDib: Packet Struct Refactoring +2009/08/08 MuadDib: mf_SetRawSkill(), mf_GetRawSkill(), mf_ApplyRawDamage(), mf_GameStat(), + mf_AwardRawPoints(), old replace_properties(), mf_GetSkill() cleaned out. +2009/08/25 Shinigami: STLport-5.2.1 fix: additional parentheses in mf_ListMultisInBox +2009/09/03 MuadDib: Changes for account related source file relocation + Changes for multi related source file relocation + +Notes +======= + +*/ + +#include "../../clib/stl_inc.h" + +#ifdef _MSC_VER +# pragma warning(disable:4786) +#endif + + +#include <stddef.h> +#include <stdio.h> +#include <string.h> +#include <limits.h> +#include <math.h> + +#include "../../clib/cfgelem.h" +#include "../../clib/cfgfile.h" +#include "../../clib/clib.h" +#include "../../clib/endian.h" +#include "../../clib/esignal.h" +#include "../../clib/logfile.h" +#include "../../clib/mlog.h" +#include "../../clib/passert.h" +#include "../../clib/weakptr.h" +#include "../../clib/stlutil.h" +#include "../../clib/strutil.h" + +#include "../../bscript/berror.h" +#include "../../bscript/bobject.h" +#include "../../bscript/execmodl.h" +#include "../../bscript/impstr.h" +#include "../../bscript/token.h" +#include "../../bscript/dict.h" + +#include "../../plib/mapcell.h" +#include "../../plib/mapshape.h" +#include "../../plib/maptile.h" +#include "../../plib/realm.h" + +#include "../action.h" +#include "../multi/boat.h" +#include "cfgmod.h" +#include "../cfgrepos.h" +#include "../cgdata.h" +#include "../mobile/charactr.h" +#include "../client.h" +#include "../core.h" +#include "../eventid.h" +#include "../fnsearch.h" +#include "../guardrgn.h" +#include "../itemdesc.h" +#include "../listenpt.h" +#include "../los.h" +#include "../menu.h" +#include "../multi/multidef.h" +#include "../npc.h" +#include "../objtype.h" +#include "osmod.h" +#include "../pktboth.h" +#include "../pktin.h" +#include "../polcfg.h" +#include "../polclass.h" +#include "../polsig.h" +#include "../poltype.h" +#include "../profile.h" +#include "../realms.h" +#include "../savedata.h" +#include "../scrsched.h" +#include "../scrstore.h" +#include "../skilladv.h" +#include "../spells.h" +#include "../ssopt.h" +#include "../target.h" +#include "../ufunc.h" +#include "../umanip.h" +#include "../udatfile.h" +#include "../uofile.h" +#include "../uoscrobj.h" +#include "../ustruct.h" +#include "../uvars.h" +#include "../uworld.h" +#include "../uoexec.h" +#include "../uopathnode.h" + +#include "uomod.h" + +#include "../objecthash.h" + +#define CONST_DEFAULT_ZRANGE 19 + +class EMenuObjImp : public BApplicObj< Menu > +{ +public: + EMenuObjImp( const Menu& m ) : BApplicObj<Menu>(&menu_type, m) {} + virtual const char* typeOf() const { return "MenuRef"; } + virtual BObjectImp* copy() const { return new EMenuObjImp(value()); } +}; + + +UOExecutorModule::UOExecutorModule(UOExecutor& exec) : + ExecutorModule("UO", exec), + uoexec( exec ), + target_cursor_chr(NULL), + menu_selection_chr(NULL), + prompt_chr(NULL), + gump_chr(NULL), + textentry_chr(NULL), + resurrect_chr(NULL), + selcolor_chr(NULL), + target_options(0), + attached_chr_(NULL), + attached_npc_(NULL), + controller_(NULL), + reserved_items_(), + registered_for_speech_events(false) +{ +} + +UOExecutorModule::~UOExecutorModule() +{ + while (!reserved_items_.empty()) + { + Item* item = reserved_items_.back().get(); + item->inuse( false ); + reserved_items_.pop_back(); + } + + if (target_cursor_chr != NULL) + { + // CHECKME can we cancel the cursor request? + target_cursor_chr->client->gd->target_cursor_uoemod = NULL; + target_cursor_chr = NULL; + } + if (menu_selection_chr != NULL) + { + menu_selection_chr->client->gd->menu_selection_uoemod = NULL; + menu_selection_chr = NULL; + } + if (prompt_chr != NULL) + { + prompt_chr->client->gd->prompt_uoemod = NULL; + prompt_chr = NULL; + } + if (gump_chr != NULL) + { + gump_chr->client->gd->remove_gumpmod( this ); + // gump_chr->client->gd->gump_uoemod = NULL; + gump_chr = NULL; + } + if (textentry_chr != NULL) + { + textentry_chr->client->gd->textentry_uoemod = NULL; + textentry_chr = NULL; + } + if (resurrect_chr != NULL) + { + resurrect_chr->client->gd->resurrect_uoemod = NULL; + resurrect_chr = NULL; + } + if (selcolor_chr != NULL) + { + selcolor_chr->client->gd->selcolor_uoemod = NULL; + selcolor_chr = NULL; + } + if (attached_chr_ != NULL) + { + passert( attached_chr_->script_ex == &uoexec ); + attached_chr_->script_ex = NULL; + attached_chr_ = NULL; + } + if (registered_for_speech_events) + { + deregister_from_speech_events( &uoexec ); + } +} + +BObjectImp* UOExecutorModule::mf_Attach(/* Character */) +{ + Character* chr; + if (getCharacterParam( exec, 0, chr )) + { + if (attached_chr_ == NULL) + { + if (chr->script_ex == NULL) + { + attached_chr_ = chr; + attached_chr_->script_ex = &uoexec; + + return new BLong(1); + } + else + return new BError( "Another script still attached." ); + } + else + return new BError( "Another character still attached." ); + } + else + return new BError( "Invalid parameter" ); +} + +BObjectImp* UOExecutorModule::mf_Detach() +{ + if (attached_chr_ != NULL) + { + passert( attached_chr_->script_ex == &uoexec ); + attached_chr_->script_ex = NULL; + attached_chr_ = NULL; + return new BLong(1); + } + else + { + return new BLong(0); + } +} + +static bool item_create_params_ok( long objtype, long amount ) +{ + return ((objtype >= UOBJ_ITEM__LOWEST && objtype <= UOBJ_ITEM__HIGHEST) || + (objtype >= EXTOBJ__LOWEST && objtype <= EXTOBJ__HIGHEST)) && + amount > 0 && + amount <= 60000L; +} + +BObjectImp* _create_item_in_container( + UContainer* cont, + const ItemDesc* descriptor, + unsigned short amount, + bool force_stacking, + UOExecutorModule* uoemod ) +{ + if ((tile_flags( descriptor->graphic ) & FLAG::STACKABLE) || force_stacking) + { + for( UContainer::const_iterator itr = cont->begin(); itr != cont->end(); ++itr ) + { + Item *item = GET_ITEM_PTR( itr ); + ItemRef itemref(item); //dave 1/28/3 prevent item from being destroyed before function ends + + if (item->objtype_ == descriptor->objtype && + !item->newbie() && + item->color == descriptor->color && //dave added 5/11/3, only add to existing stack if is default color + item->has_only_default_cprops(descriptor) && //dave added 5/11/3, only add to existing stack if default cprops + (!item->inuse() || (uoemod && uoemod->is_reserved_to_me(item))) && + item->can_add_to_self(amount)) + { + + //DAVE added this 11/17, call can/onInsert scripts for this container + Character* chr_owner = cont->GetCharacterOwner(); + if(chr_owner == NULL) + chr_owner = uoemod->controller_.get(); + + //If the can insert script fails for combining a stack, we'll let the create new item code below handle it + // what if a cannInsert script modifies (adds to) the container we're iterating over? (they shouldn't do that) + // FIXME oh my, this makes no sense. 'item' in this case is already in the container. + if(!cont->can_insert_increase_stack( chr_owner, UContainer::MT_CORE_CREATED, item, amount, NULL )) + continue; + if(item->orphan()) //dave added 1/28/3, item might be destroyed in RTC script + { + return new BError( "Item was destroyed in CanInsert Script" ); + } + #ifdef PERGON + item->ct_merge_stacks_pergon( amount ); // Pergon: Re-Calculate Property CreateTime after Adding Items to a Stack + #endif + + long newamount = item->getamount(); + newamount += amount; + item->setamount( static_cast<unsigned short>(newamount) ); + + update_item_to_inrange( item ); + UpdateCharacterWeight( item ); + + // FIXME again, this makes no sense, item is already in the container. + cont->on_insert_increase_stack( chr_owner, UContainer::MT_CORE_CREATED, item, amount ); + if(item->orphan()) //dave added 1/28/3, item might be destroyed in RTC script + { + return new BError( "Item was destroyed in OnInsert Script" ); + } + + + return new EItemRefObjImp(item); + } + } + } + else if (amount != 1 && !force_stacking) + { + return new BError( "That item is not stackable. Create one at a time." ); + } + + Item* item = Item::create( *descriptor ); + if (item != NULL) + { + ItemRef itemref(item); //dave 1/28/3 prevent item from being destroyed before function ends + item->realm = cont->realm; + item->setamount( amount ); + + if (cont->can_add( *item )) + { + if (!descriptor->create_script.empty()) + { + BObjectImp* res = run_script_to_completion( descriptor->create_script, new EItemRefObjImp( item ) ); + if (!res->isTrue()) + { + item->destroy(); + return res; + } + else + { + BObject ob( res ); + } + if (!cont->can_add( *item )) + { // UNTESTED + item->destroy(); + return new BError( "Couldn't add item to container after create script ran" ); + } + } + + //DAVE added this 11/17, call can/onInsert scripts for this container + Character* chr_owner = cont->GetCharacterOwner(); + if(chr_owner == NULL) + chr_owner = uoemod->controller_.get(); + + if(!cont->can_insert_add_item( chr_owner, UContainer::MT_CORE_CREATED, item )) + { + item->destroy(); + //FIXME: try to propogate error from returned result of the canInsert script + return new BError( "Could not insert item into container." ); + } + if(item->orphan()) //dave added 1/28/3, item might be destroyed in RTC script + { + return new BError( "Item was destroyed in CanInsert Script" ); + } + + // FIXME : Add Grid Index Default Location Checks here. + // Remember, if index fails, move to the ground. + cont->add_at_random_location( item ); + update_item_to_inrange( item ); + //DAVE added this 11/17, refresh owner's weight on item insert + UpdateCharacterWeight( item ); + + cont->on_insert_add_item( chr_owner, UContainer::MT_CORE_CREATED, item ); + if(item->orphan()) //dave added 1/28/3, item might be destroyed in RTC script + { + return new BError( "Item was destroyed in OnInsert Script" ); + } + + return new EItemRefObjImp( item ); + } + else + { + item->destroy(); + return new BError( "That container is full" ); + } + } + else + { + return new BError( "Failed to create that item type" ); + } +} + +BObjectImp* UOExecutorModule::mf_CreateItemInContainer() +{ + Item* item; + const ItemDesc* descriptor; + long amount; + + if (getItemParam( exec, 0, item ) && + getObjtypeParam( exec, 1, descriptor ) && + getParam( 2, amount ) && + item_create_params_ok( descriptor->objtype, amount )) + { + if (item->isa( UObject::CLASS_CONTAINER )) + { + return _create_item_in_container( static_cast<UContainer*>(item), + descriptor, + static_cast<unsigned short>(amount), + false, + this ); + } + else + { + return new BError( "That is not a container" ); + } + } + else + { + return new BError( "A parameter was invalid" ); + } +} + +BObjectImp* UOExecutorModule::mf_CreateItemInInventory() +{ + Item* item; + const ItemDesc* descriptor; + long amount; + + if (getItemParam( exec, 0, item ) && + getObjtypeParam( exec, 1, descriptor ) && + getParam( 2, amount ) && + item_create_params_ok( descriptor->objtype, amount )) + { + if (item->isa( UObject::CLASS_CONTAINER )) + { + return _create_item_in_container( static_cast<UContainer*>(item), + descriptor, + static_cast<unsigned short>(amount), + true, + this ); + } + else + { + return new BError( "That is not a container" ); + } + } + else + { + return new BError( "A parameter was invalid" ); + } +} + + +BObjectImp* UOExecutorModule::broadcast() +{ + const char *text; + unsigned short font; + unsigned short color; + text = exec.paramAsString(0); + if (text && + getParam( 1, font ) && // todo: getFontParam + getParam( 2, color )) // todo: getColorParam + { + ::broadcast( text, font, color ); + return new BLong( 1 ); + } + else + { + return NULL; + } +} + +/* Special containers (specifically, bankboxes, but probably any other + "invisible" accessible container) seem to work thus: + They sit in layer 0x1D. The player is told to "wear_item" the item, + then the gump and container contents are sent. + We'll put a reference to this item in the character's additional_legal_items + container, which is flushed whenever he moves. + It might be better to actually put it in that layer, because that way + it implicitly is at the same location (location of the wornitems container) +*/ +BObjectImp* UOExecutorModule::mf_SendOpenSpecialContainer() +{ + Character* chr; + Item* item; + if (!getCharacterParam( exec, 0, chr ) || + !getItemParam( exec, 1, item )) + { + return new BError( "Invalid parameter type" ); + } + + if (!chr->has_active_client()) + { + return new BError( "No client attached" ); + } + if (!item->isa( UObject::CLASS_CONTAINER )) + { + return new BError( "That isn't a container" ); + } + + u8 save_layer = item->layer; + item->layer = LAYER_BANKBOX; + send_wornitem( chr->client, chr, item ); + item->layer = save_layer; + item->x = chr->x; + item->y = chr->y; + item->z = chr->z; + item->double_click( chr->client ); // open the container on the client's screen + chr->add_remote_container( item ); + + return new BLong(1); +} + +BObjectImp* open_trade_window( Client* client, Character* dropon ); +BObjectImp* UOExecutorModule::mf_SecureTradeWin() +{ + Character* chr; + Character* chr2; + if (!getCharacterParam( exec, 0, chr ) || + !getCharacterParam( exec, 1, chr2 )) + { + return new BError( "Invalid parameter type." ); + } + + if (chr == chr2) + { + return new BError( "You can't trade with yourself." ); + } + + if (!chr->has_active_client()) + { + return new BError( "No client attached." ); + } + if (!chr2->has_active_client()) + { + return new BError( "No client attached." ); + } + + return open_trade_window( chr->client, chr2 ); +} + +void cancel_trade( Character* chr1 ); +BObjectImp* UOExecutorModule::mf_CloseTradeWindow() +{ + Character* chr; + if ( !getCharacterParam( exec, 0, chr ) ) + { + return new BError( "Invalid parameter type." ); + } + if ( !chr->trading_with ) + return new BError("Mobile is not currently trading with anyone."); + + cancel_trade(chr); + return new BLong(1); +} + +BObjectImp* UOExecutorModule::mf_SendViewContainer() +{ + Character* chr; + Item* item; + if (!getCharacterParam( exec, 0, chr ) || + !getItemParam( exec, 1, item )) + { + return new BError( "Invalid parameter type" ); + } + + if (!chr->has_active_client()) + { + return new BError( "No client attached" ); + } + if (!item->isa( UObject::CLASS_CONTAINER )) + { + return new BError( "That isn't a container" ); + } + UContainer* cont = static_cast<UContainer*>(item); + chr->client->pause(); + send_open_gump( chr->client, *cont ); + send_container_contents( chr->client, *cont ); + chr->client->restart(); + return new BLong(1); +} + +BObjectImp* UOExecutorModule::mf_FindObjtypeInContainer() +{ + Item* item; + unsigned short objtype; + if (!getItemParam( exec, 0, item ) || + !getObjtypeParam( exec, 1, objtype )) + { + return new BError( "Invalid parameter type" ); + } + if (!item->isa( UObject::CLASS_CONTAINER )) + { + return new BError( "That is not a container" ); + } + + UContainer* cont = static_cast<UContainer*>(item); + Item* found = cont->find_toplevel_objtype( objtype ); + if (found == NULL) + return new BError( "No items were found" ); + else + return new EItemRefObjImp( found ); +} + + +BObjectImp* UOExecutorModule::mf_SendSysMessage() +{ + Character* chr; + const String* ptext; + unsigned short font; + unsigned short color; + + if (getCharacterParam( exec, 0, chr ) && + ( (ptext = getStringParam( 1 )) != NULL) && + getParam( 2, font ) && + getParam( 3, color )) + { + if (chr->has_active_client()) + { + send_sysmessage( chr->client, ptext->data(), font, color ); + return new BLong(1); + } + else + { + return new BError( "Mobile has no active client" ); + } + } + else + { + return new BError( "Invalid parameter type" ); + } +} + +BObjectImp* UOExecutorModule::mf_PrintTextAbove() +{ + UObject* obj; + const String* ptext; + unsigned short font; + unsigned short color; + long journal_print; + + if (getUObjectParam( exec, 0, obj ) && + getStringParam( 1, ptext ) && + getParam( 2, font ) && + getParam( 3, color ) && + getParam( 4, journal_print) ) + { + return new BLong( say_above( obj, ptext->data(), font, color, journal_print ) ); + } + else + { + return new BError( "A parameter was invalid" ); + } +} +BObjectImp* UOExecutorModule::mf_PrivateTextAbove() +{ + Character* chr; + UObject* obj; + const String* ptext; + unsigned short font; + unsigned short color; + long journal_print; + + if (getUObjectParam( exec, 0, obj ) && + getStringParam( 1, ptext ) && + getCharacterParam( exec, 2, chr ) && + getParam( 3, font ) && + getParam( 4, color ) && + getParam( 5, journal_print) ) + { + return new BLong( private_say_above( chr, obj, ptext->data(), font, color, journal_print ) ); + } + else + { + return new BError( "A parameter was invalid" ); + } +} + +const long TGTOPT_CHECK_LOS = 0x0001; +const long TGTOPT_NOCHECK_LOS = 0x0000; +const long TGTOPT_HARMFUL = 0x0002; +const long TGTOPT_HELPFUL = 0x0004; + +// FIXME susceptible to out-of-sequence target cursors +void handle_script_cursor( Character* chr, UObject* obj ) +{ + if (chr != NULL && + chr->client->gd->target_cursor_uoemod != NULL) + { + if (obj != NULL) + { + if (obj->ismobile()) + { + Character* targetted_chr = static_cast<Character*>(obj); + if (chr->client->gd->target_cursor_uoemod->target_options & TGTOPT_HARMFUL) + { + targetted_chr->inform_engaged( chr ); + chr->repsys_on_attack( targetted_chr ); + } + else if (chr->client->gd->target_cursor_uoemod->target_options & TGTOPT_HELPFUL) + { + chr->repsys_on_help( targetted_chr ); + } + } + chr->client->gd->target_cursor_uoemod->uoexec.ValueStack.top().set( new BObject( obj->make_ref() ) ); + } + // even on cancel, we wake the script up. + chr->client->gd->target_cursor_uoemod->uoexec.os_module->revive(); + chr->client->gd->target_cursor_uoemod->target_cursor_chr = NULL; + chr->client->gd->target_cursor_uoemod = NULL; + } +} + +LosCheckedTargetCursor los_checked_script_cursor( &handle_script_cursor, true ); +NoLosCheckedTargetCursor nolos_checked_script_cursor( &handle_script_cursor, true ); + + +BObjectImp* UOExecutorModule::mf_Target() +{ + Character* chr; + if (getCharacterParam( exec, 0, chr )) + { + if (chr->has_active_client()) + { + if (!chr->target_cursor_busy()) + { + if (!getParam( 1, target_options )) + target_options = TGTOPT_CHECK_LOS; + + PKTBI_6C::CURSOR_TYPE crstype; + + if (target_options & TGTOPT_HARMFUL) + crstype = PKTBI_6C::CURSOR_TYPE_HARMFUL; + else if (target_options & TGTOPT_HELPFUL) + crstype = PKTBI_6C::CURSOR_TYPE_HELPFUL; + else + crstype = PKTBI_6C::CURSOR_TYPE_NEUTRAL; + + if ((target_options & TGTOPT_CHECK_LOS) && !chr->ignores_line_of_sight()) + if (los_checked_script_cursor.send_object_cursor( chr->client, crstype ) ) + { + chr->client->gd->target_cursor_uoemod = this; + target_cursor_chr = chr; + uoexec.os_module->suspend(); + return new BLong(0); + } + else + { + return new BError( "Client has an active target cursor" ); + } + else + { + if ( nolos_checked_script_cursor.send_object_cursor( chr->client, crstype ) ) + { + chr->client->gd->target_cursor_uoemod = this; + target_cursor_chr = chr; + uoexec.os_module->suspend(); + return new BLong(0); + } + else + { + return new BError( "Client has an active target cursor" ); + } + } + return new BLong(0); + } + else + { + return new BError( "Client busy with another target cursor" ); + } + } + else + { + return new BError( "No client connected" ); + } + } + else + { + return new BError( "Invalid parameter type" ); + } +} + +BObjectImp* UOExecutorModule::mf_TargetCancel() +{ + Character* chr; + if (getCharacterParam( exec, 0, chr )) + { + if (chr->has_active_client()) + { + if (chr->target_cursor_busy()) + { + static PKTBI_6C msg; + msg.msgtype = PKTBI_6C_ID; + msg.unk1 = PKTBI_6C::UNK1_00; + msg.target_cursor_serial = ctBEu32( 0x0 ); + msg.cursor_type = 0x3; + chr->client->transmit( &msg, sizeof msg ); + return new BLong(0); + } + else + { + return new BError( "Client does not have an active target cursor" ); + } + } + else + { + return new BError( "No client connected" ); + } + } + else + { + return new BError( "Invalid parameter type" ); + } +} + +void handle_coord_cursor( Character* chr, PKTBI_6C* msg ) +{ + if (chr != NULL && + chr->client->gd->target_cursor_uoemod != NULL) + { + if (msg != NULL) + { + BStruct* arr = new BStruct; + arr->addMember( "x", new BLong( cfBEu16(msg->x) ) ); + arr->addMember( "y", new BLong( cfBEu16(msg->y) ) ); + arr->addMember( "z", new BLong( msg->z ) ); +// FIXME: Objtype CANNOT be trusted! Scripts must validate this, or, we must +// validate right here. Should we check map/static, or let that reside +// for scripts to run ListStatics? In theory, using Injection or similar, +// you could mine where no mineable tiles are by faking objtype in packet +// and still get the resources? + arr->addMember( "objtype", new BLong( cfBEu16(msg->graphic) ) ); + + u32 selected_serial = cfBEu32(msg->selected_serial); + if (selected_serial) + { + UObject* obj = system_find_object( selected_serial ); + if (obj) + { + arr->addMember( obj->target_tag(), obj->make_ref() ); + } + } + +// Never trust packet's objtype is the reason here. They should never +// target on other realms. DUH! + arr->addMember( "realm", new String( chr->realm->name() ) ); + + UMulti* multi = chr->realm->find_supporting_multi( cfBEu16(msg->x), cfBEu16(msg->y), msg->z ); + if ( multi != NULL ) + arr->addMember( "multi", multi->make_ref() ); + + chr->client->gd->target_cursor_uoemod->uoexec.ValueStack.top().set( new BObject( arr ) ); + + } + + chr->client->gd->target_cursor_uoemod->uoexec.os_module->revive(); + chr->client->gd->target_cursor_uoemod->target_cursor_chr = NULL; + chr->client->gd->target_cursor_uoemod = NULL; + } +} + +LosCheckedCoordCursor script_cursor2( &handle_coord_cursor, true ); +BObjectImp* UOExecutorModule::mf_TargetCoordinates() +{ + Character* chr; + if (getCharacterParam( exec, 0, chr )) + { + if (chr->has_active_client()) + { + if (!chr->target_cursor_busy()) + { + if (script_cursor2.send_coord_cursor( chr->client )) + { + chr->client->gd->target_cursor_uoemod = this; + target_cursor_chr = chr; + uoexec.os_module->suspend(); + return new BLong(0); + } + else + { + return new BError( "Client has an active target cursor" ); + } + + } + else + { + return new BError( "Client has an active target cursor" ); + } + } + else + { + return new BError( "Mobile has no active client" ); + } + } + else + { + return new BError( "Invalid parameter type" ); + } +} + +MultiPlacementCursor multi_placement_cursor( &handle_coord_cursor ); +BObjectImp* UOExecutorModule::mf_TargetMultiPlacement() +{ + Character* chr; + unsigned short objtype; + long flags; + long xoffset, yoffset; + if (! (getCharacterParam( exec, 0, chr ) && + getObjtypeParam( exec, 1, objtype ) && + getParam(2, flags) && + getParam(3, xoffset) && + getParam(4, yoffset)) ) + { + return new BError( "Invalid parameter type" ); + } + + + if (!chr->has_active_client()) + { + return new BError( "No client attached" ); + } + + if (chr->target_cursor_busy()) + { + return new BError( "Client busy with another target cursor" ); + } + + if (find_itemdesc(objtype).type != ItemDesc::BOATDESC && + find_itemdesc(objtype).type != ItemDesc::HOUSEDESC) + { + return new BError( "Object Type is out of range for Multis" ); + } + + chr->client->gd->target_cursor_uoemod = this; + target_cursor_chr = chr; + multi_placement_cursor.send_placemulti( chr->client, objtype, flags, (s16)xoffset, (s16)yoffset ); + uoexec.os_module->suspend(); + return new BLong(0); +} + +BObjectImp* UOExecutorModule::mf_GetObjType() +{ + Item* item; + Character* chr; + + if (getItemParam( exec, 0, item )) + { + return new BLong( item->objtype_ ); + } + else if (getCharacterParam( exec, 0, chr )) + { + return new BLong( chr->objtype_ ); + } + else + { + return new BLong(0); + } +} + +// FIXME character needs an Accessible that takes an Item* +BObjectImp* UOExecutorModule::mf_Accessible() +{ + Character* chr; + Item* item; + if (getCharacterParam( exec, 0, chr ) && + getItemParam( exec, 1, item )) + { + if (find_legal_item( chr, item->serial ) != NULL) + return new BLong(1); + else + return new BLong(0); + } + return new BLong(0); +} + +BObjectImp* UOExecutorModule::mf_GetAmount() +{ + Item* item; + + if (getItemParam( exec, 0, item )) + { + return new BLong(item->getamount()); + } + else + { + return new BLong(0); + } +} + + +// FIXME, copy-pasted from NPC, copy-pasted to CreateItemInContainer +BObjectImp* UOExecutorModule::mf_CreateItemInBackpack() +{ + Character* chr; + const ItemDesc* descriptor; + unsigned short amount; + + if (getCharacterParam( exec, 0, chr ) && + getObjtypeParam( exec, 1, descriptor ) && + getParam( 2, amount ) && + item_create_params_ok( descriptor->objtype, amount )) + { + UContainer* backpack = chr->backpack(); + if (backpack != NULL) + { + return _create_item_in_container( backpack, descriptor, amount, false, this ); + } + else + { + return new BError( "Character has no backpack." ); + } + } + else + { + return new BError( "A parameter was invalid." ); + } +} + +BObjectImp* _complete_create_item_at_location( Item* item, long x, long y, long z, Realm* realm ) +{ + //Dave moved these 3 lines up here 12/20 cuz x,y,z was uninit in the createscript. + item->x = static_cast<unsigned short>(x); + item->y = static_cast<unsigned short>(y); + item->z = static_cast<signed char>(z); + item->realm = realm; + + // ITEMDESCTODO: use the original descriptor + const ItemDesc& id = find_itemdesc( item->objtype_ ); + if (!id.create_script.empty()) + { + BObjectImp* res = run_script_to_completion( id.create_script, new EItemRefObjImp( item ) ); + if (!res->isTrue()) + { + item->destroy(); + return res; + } + else + { + BObject ob( res ); + } + } + + update_item_to_inrange( item ); + add_item_to_world( item ); + register_with_supporting_multi( item ); + return new EItemRefObjImp( item ); +} + +BObjectImp* UOExecutorModule::mf_CreateItemAtLocation(/* x,y,z,objtype,amount,realm */) +{ + long x, y, z; + const ItemDesc* itemdesc; + unsigned short amount; + const String* strrealm; + if (getParam( 0, x ) && + getParam( 1, y ) && + getParam( 2, z, ZCOORD_MIN, ZCOORD_MAX ) && + getObjtypeParam( exec, 3, itemdesc ) && + getParam( 4, amount, 1, 60000 ) && + getStringParam( 5, strrealm ) && + item_create_params_ok( itemdesc->objtype, amount )) + { + if (!(tile_flags( itemdesc->graphic ) & FLAG::STACKABLE) && + (amount != 1)) + { + return new BError( "That item is not stackable. Create one at a time." ); + } + + Realm* realm = find_realm(strrealm->value()); + if(!realm) + return new BError( "Realm not found" ); + + if(!realm->valid(x,y,z)) return new BError("Invalid Coordinates for Realm"); + Item* item = Item::create( *itemdesc ); + if (item != NULL) + { + item->setamount( amount ); + return _complete_create_item_at_location( item, x, y, z, realm ); + } + else + { + return new BError( "Unable to create item of objtype " + hexint(itemdesc->objtype) ); + } + } + return new BError( "Invalid parameter type" ); +} + +BObjectImp* UOExecutorModule::mf_CreateItemCopyAtLocation(/* x,y,z,item,realm */) +{ + long x, y, z; + Item* origitem; + const String* strrealm; + if (getParam( 0, x ) && + getParam( 1, y ) && + getParam( 2, z, ZCOORD_MIN, ZCOORD_MAX ) && + getItemParam( exec, 3, origitem ) && + getStringParam( 4, strrealm )) + { + if(origitem->script_isa(POLCLASS_MULTI)) + return new BError( "This function does not work with Multi objects." ); + + Realm* realm = find_realm(strrealm->value()); + if(!realm) + return new BError( "Realm not found" ); + + if(!realm->valid(x,y,z)) return new BError("Invalid Coordinates for Realm"); + Item* item = origitem->clone(); + if (item != NULL) + { + return _complete_create_item_at_location( item, x, y, z, realm ); + } + else + { + return new BError( "Unable to clone item" ); + } + } + else + { + return new BError( "Invalid parameter type" ); + } +} + +BObjectImp* UOExecutorModule::mf_CreateMultiAtLocation(/* x,y,z,objtype,flags,realm */) +{ + long x, y, z; + const ItemDesc* descriptor; + long flags = 0; + const String* strrealm; + Realm* realm = find_realm(string("britannia")); + if (! (getParam( 0, x ) && + getParam( 1, y ) && + getParam( 2, z, ZCOORD_MIN, ZCOORD_MAX ) && + getObjtypeParam( exec, 3, descriptor )) ) + { + return new BError( "Invalid parameter type" ); + } + if (exec.hasParams(5)) + { + if (!getParam(4,flags)) + return new BError( "Invalid parameter type" ); + } + if (exec.hasParams(6)) + { + if (!getStringParam(5, strrealm)) + return new BError( "Invalid parameter type" ); + realm = find_realm(strrealm->value()); + if(!realm) + return new BError( "Realm not found" ); + } + if(!realm->valid(x,y,z)) return new BError("Invalid Coordinates for Realm"); + if (descriptor->type != ItemDesc::BOATDESC && + descriptor->type != ItemDesc::HOUSEDESC) + { + return new BError( "That objtype is not a Multi" ); + } + if (!realm->valid(x,y,z)) + { + return new BError( "That location is out of bounds" ); + } + + return UMulti::scripted_create( *descriptor, + static_cast<unsigned short>(x), + static_cast<unsigned short>(y), + static_cast<signed char>(z), + realm, flags ); +} + +void replace_properties( ConfigElem& elem, BStruct* custom ) +{ + for( BStruct::Contents::const_iterator citr = custom->contents().begin(), end = custom->contents().end(); citr != end; ++citr ) + { + + const string& name = (*citr).first; + BObjectImp* ref = (*citr).second->impptr(); + + if( name == "CProps" ) + { + if (ref->isa( BObjectImp::OTDictionary )) + { + BDictionary* cpropdict = static_cast<BDictionary*>(ref); + const BDictionary::Contents& cprop_cont = cpropdict->contents(); + BDictionary::Contents::const_iterator itr; + for( itr = cprop_cont.begin(); itr != cprop_cont.end(); ++itr ) + { + elem.add_prop("cprop", ((*itr).first->getStringRep() + "\t" + (*itr).second->impptr()->pack()).c_str() ); + } + } + else + { + throw runtime_error( "NPC override_properties: CProps must be a dictionary, but is: " + string( ref->typeOf() ) ); + } + } + else + { + elem.clear_prop( name.c_str() ); + elem.add_prop( name.c_str(), ref->getStringRep().c_str() ); + } + } +} + +bool FindNpcTemplate( const char *template_name, + ConfigFile& cfile, + ConfigElem& elem ); +bool FindNpcTemplate( const char* template_name, ConfigElem& elem ); + +BObjectImp* UOExecutorModule::mf_CreateNpcFromTemplate() +{ + const String* tmplname; + long x,y,z; + const String* strrealm; + Realm* realm = find_realm(string("britannia")); + + if (!(getStringParam( 0, tmplname ) && + getParam( 1, x ) && + getParam( 2, y ) && + getParam( 3, z, ZCOORD_MIN, ZCOORD_MAX ) )) + { + return new BError( "Invalid parameter type" ); + } + BObjectImp* imp = getParamImp( 4 ); + BStruct* custom_struct = NULL; + if (imp->isa( BObjectImp::OTLong )) + { + custom_struct = NULL; + } + else if (imp->isa( BObjectImp::OTStruct )) + { + custom_struct = static_cast<BStruct*>(imp); + } + else + { + return new BError( string("Parameter 4 must be a Struct or Integer(0), got ") + BObjectImp::typestr( imp->type() ) ); + } + if (exec.hasParams(6)) + { + if(!getStringParam( 5, strrealm )) + return new BError( "Realm not found" ); + realm = find_realm(strrealm->value()); + if(!realm) return new BError("Realm not found"); + if(!realm->valid(x,y,z)) return new BError("Invalid Coordinates for Realm"); + } + //ConfigFile cfile; + ConfigElem elem; + START_PROFILECLOCK( npc_search ); + //bool found = FindNpcTemplate( tmplname->data(), cfile, elem ); + bool found = FindNpcTemplate( tmplname->data(), elem ); + STOP_PROFILECLOCK( npc_search ); + INC_PROFILEVAR( npc_searches ); + + if (!found) + { + return new BError( "NPC template '" + tmplname->value() + "' not found" ); + } + MOVEMODE movemode = Character::decode_movemode( elem.read_string( "MoveMode", "L" ) ); + + int newz; + UMulti* dummy_multi; + Item* dummy_walkon; + if (!realm->walkheight(x,y,z,&newz,&dummy_multi, &dummy_walkon, true, movemode)) + { + return new BError( "Not a valid location for an NPC!" ); + } + z = newz; + + + NPCRef npc; + // readProperties can throw, if stuff is missing. + try { + npc.set( new NPC( elem.remove_ushort( "OBJTYPE" ), elem ) ); + npc->set_dirty(); + elem.clear_prop( "Serial" ); + elem.clear_prop( "X" ); + elem.clear_prop( "Y" ); + elem.clear_prop( "Z" ); + + elem.add_prop( "Serial", GetNextSerialNumber() ); + // FIXME sanity check + elem.add_prop( "X", static_cast<unsigned short>(x) ); + elem.add_prop( "Y", static_cast<unsigned short>(y) ); + elem.add_prop( "Z", static_cast<unsigned short>(z) ); + elem.add_prop( "Realm", realm->name().c_str() ); + if (custom_struct != NULL) + replace_properties( elem, custom_struct ); + npc->readPropertiesForNewNPC( elem ); + + ////HASH + objecthash.Insert(npc.get()); + //// + + + + //characters.push_back( npc.get() ); + SetCharacterWorldPosition( npc.get() ); + + ForEach( clients, send_char_data, static_cast<Character*>(npc.get()) ); + + //dave added 2/3/3 send entered area events for npc create + ForEachMobileInRange( static_cast<unsigned short>(x), static_cast<unsigned short>(y), realm, 32, + NpcPropagateMove, static_cast<Character*>(npc.get()) ); + if (dummy_multi) + dummy_multi->register_object( npc.get() ); + return new ECharacterRefObjImp( npc.get() ); + } + catch( std::exception& ex ) + { + if (npc.get() != NULL) + npc->destroy(); + return new BError( "Exception detected trying to create npc from template '" + tmplname->value() + "': " + ex.what() ); + } +} + + +BObjectImp* UOExecutorModule::mf_SubtractAmount() +{ + Item* item; + unsigned short amount; + + if (getItemParam( exec, 0, item ) && + getParam( 1, amount, 1, MAX_STACK_ITEMS )) + { + if (item->inuse() && !is_reserved_to_me(item)) + { + return new BError( "That item is being used." ); + } + subtract_amount_from_item( item, amount ); + return new BLong(1); + } + else + { + return new BError( "Invalid parameter type" ); + } +} + +BObjectImp* UOExecutorModule::mf_AddAmount() +{ + Item* item; + unsigned short amount; + + if (getItemParam( exec, 0, item ) && + getParam( 1, amount, 1, MAX_STACK_ITEMS )) + { + if (item->inuse() && !is_reserved_to_me(item)) + { + return new BError( "That item is being used." ); + } + if (~tile_flags( item->graphic ) & FLAG::STACKABLE) + { + return new BError( "That item type is not stackable." ); + } + if (!item->can_add_to_self(amount)) + { + return new BError( "Can't add that much to that stack" ); + } + + unsigned short newamount = item->getamount(); + newamount += amount; + item->setamount( newamount ); + update_item_to_inrange( item ); + + //DAVE added this 12/05: if in a Character's pack, update weight. + UpdateCharacterWeight(item); + + return new BLong(1); + } + else + { + return new BError( "Invalid parameter type" ); + } +} + +BObjectImp* UOExecutorModule::mf_PerformAction() +{ + Character* chr; + unsigned short actionval; + unsigned short framecount, repeatcount; + unsigned short backward, repeatflag, delay; + if (getCharacterParam( exec, 0, chr ) && + getParam( 1, actionval ) && + getParam( 2, framecount) && + getParam( 3, repeatcount) && + getParam( 4, backward) && + getParam( 5, repeatflag) && + getParam( 6, delay)) + { + UACTION action = static_cast<UACTION>(actionval); + send_action_to_inrange( chr, action, + framecount, + repeatcount, + static_cast<PKTOUT_6E::DIRECTION_FLAG>(backward), + static_cast<PKTOUT_6E::REPEAT_FLAG>(repeatflag), + static_cast<unsigned char>(delay)); + return new BLong(1); + } + else + { + return new BError( "Invalid parameter" ); + } +} + +BObjectImp* UOExecutorModule::mf_PlaySoundEffect() +{ + UObject* chr; + long effect; + if (getUObjectParam( exec, 0, chr ) && + getParam( 1, effect )) + { + play_sound_effect( chr, static_cast<u16>(effect) ); + return new BLong(1); + } + else + { + return new BError( "Invalid parameter" ); + } +} + +BObjectImp* UOExecutorModule::mf_PlaySoundEffectPrivate() +{ + UObject* center; + long effect; + Character* forchr; + if (getUObjectParam( exec, 0, center ) && + getParam( 1, effect ) && + getCharacterParam( exec, 2, forchr ) ) + { + play_sound_effect_private( center, static_cast<u16>(effect), forchr ); + return new BLong(1); + } + else + { + return new BError( "Invalid parameter" ); + } +} + +BObjectImp* UOExecutorModule::mf_PlaySoundEffectXYZ() +{ + long cx,cy,cz; + long effect; + const String* strrealm; + Realm* realm = find_realm(string("britannia")); + if (getParam( 0, cx ) && + getParam( 1, cy ) && + getParam( 2, cz ) && + getParam( 3, effect ) && + getStringParam( 4, strrealm) ) + { + realm = find_realm(strrealm->value()); + if(!realm) return new BError("Realm not found"); + if(!realm->valid(cx,cy,cz)) + return new BError("Invalid Coordinates for realm"); + play_sound_effect_xyz( static_cast<unsigned short>(cx), + static_cast<unsigned short>(cy), + static_cast<signed char>(cz), + static_cast<u16>(effect), + realm); + return new BLong(1); + } + else + { + return new BError( "Invalid parameter" ); + } +} + +BObjectImp* UOExecutorModule::mf_PlayMusic(/* char, music_id */) +{ + Character* chr; + long musicid; + if (getCharacterParam(exec, 0, chr) && + getParam( 1, musicid )) + { + send_midi(chr->client, static_cast<u16>(musicid)); + return new BLong(1); + } + else + { + return new BError( "Invalid parameter" ); + } +} + +void menu_selection_made( Client* client, MenuItem* mi, PKTIN_7D* msg ) +{ + if (client != NULL) + { + Character* chr = client->chr; + if (chr != NULL && + chr->client->gd->menu_selection_uoemod != NULL) + { + if (mi != NULL && + msg != NULL) + { + BStruct* selection = new BStruct; + // FIXME should make sure objtype and choice are within valid range. + selection->addMember( "objtype", new BLong( mi->objtype_ ) ); + selection->addMember( "graphic", new BLong( mi->graphic_ ) ); + selection->addMember( "index", new BLong( cfBEu16(msg->choice) ) ); // this has been validated + selection->addMember( "color", new BLong( mi->color_ ) ); + chr->client->gd->menu_selection_uoemod->uoexec.ValueStack.top().set( new BObject( selection ) ); + } + // 0 is already on the value stack, for the case of cancellation. + chr->client->gd->menu_selection_uoemod->uoexec.os_module->revive(); + chr->client->gd->menu_selection_uoemod->menu_selection_chr = NULL; + chr->client->gd->menu_selection_uoemod = NULL; + } + } +} + +bool UOExecutorModule::getDynamicMenuParam( unsigned param, Menu*& menu ) +{ + BApplicObjBase* aob = getApplicObjParam( param, &menu_type ); + if (aob != NULL) + { + EMenuObjImp* menu_imp = static_cast<EMenuObjImp*>(aob); + menu = &menu_imp->value(); + return true; + } + else + { + return false; + } +} + +bool UOExecutorModule::getStaticOrDynamicMenuParam( unsigned param, Menu*& menu ) +{ + BObjectImp* imp = getParamImp( param ); + if (imp->isa( BObjectImp::OTString )) + { + String* pmenuname = static_cast<String*>(imp); + menu = find_menu( pmenuname->data() ); + return (menu != NULL); + } + else if (imp->isa( BObjectImp::OTApplicObj )) + { + BApplicObjBase* aob = static_cast<BApplicObjBase*>(imp); + if (aob->object_type() == &menu_type) + { + EMenuObjImp* menu_imp = static_cast<EMenuObjImp*>(aob); + menu = &menu_imp->value(); + return true; + } + } + if (mlog.is_open()) + mlog << "SelectMenuItem: expected a menu name (static menu) or a CreateMenu() dynamic menu" << endl; + return false; +} + +BObjectImp* UOExecutorModule::mf_SelectMenuItem() +{ + Character* chr; + Menu* menu; + + if (getCharacterParam( exec, 0, chr ) && + getStaticOrDynamicMenuParam( 1, menu ) && + (chr->client->gd->menu_selection_uoemod == NULL)) + { + if (menu != NULL && + chr->has_active_client() && + !menu->menuitems_.empty()) + { + if (send_menu( chr->client, menu )) + { + chr->menu = menu; + chr->on_menu_selection = menu_selection_made; + chr->client->gd->menu_selection_uoemod = this; + menu_selection_chr = chr; + uoexec.os_module->suspend(); + return new BLong(0); + } + else + { + return new BError( "Menu too large" ); + } + } + else + { + return new BError( "Client is busy, or menu is empty" ); + } + } + else + { + return new BError( "Invalid parameter" ); + } +} + +void append_objtypes( ObjArray* objarr, Menu* menu ) +{ + for( unsigned i = 0; i < menu->menuitems_.size(); ++i ) + { + MenuItem* mi = &menu->menuitems_[i]; + + if (mi->submenu_id) + { + Menu* menu = find_menu( mi->submenu_id ); + if (menu != NULL) + append_objtypes( objarr, menu ); + } + else + { + objarr->addElement( new BLong( mi->objtype_ ) ); + } + } +} + +BObjectImp* UOExecutorModule::mf_GetMenuObjTypes() +{ + Menu* menu; + if (getStaticOrDynamicMenuParam( 0, menu )) + { + auto_ptr<ObjArray> objarr( new ObjArray ); + + append_objtypes( objarr.get(), menu ); + + return objarr.release(); + } + return new BLong(0); +} + +BObjectImp* UOExecutorModule::mf_ApplyConstraint() +{ + ObjArray* arr; + StoredConfigFile* cfile; + const String* propname_str; + long amthave; + + if (getObjArrayParam( 0, arr ) && + getStoredConfigFileParam( *this, 1, cfile ) && + getStringParam( 2, propname_str ) && + getParam( 3, amthave )) + { + auto_ptr<ObjArray> newarr( new ObjArray ); + + for( unsigned i = 0; i < arr->ref_arr.size(); i++ ) + { + BObjectRef& ref = arr->ref_arr[ i ]; + + BObject *bo = ref.get(); + if (bo == NULL) + continue; + if (!bo->isa( BObjectImp::OTLong )) + continue; + BLong* blong = static_cast<BLong*>(bo->impptr()); + unsigned long objtype = blong->value(); + + ref_ptr<StoredConfigElem> celem = cfile->findelem( objtype ); + if (celem.get() == NULL) + continue; + + BObjectImp* propval = celem->getimp( propname_str->value() ); + if (propval == NULL) + continue; + if (!propval->isa( BObjectImp::OTLong)) + continue; + BLong* amtreq = static_cast<BLong*>(propval); + if (amtreq->value() > amthave) + continue; + newarr->addElement( new BLong( objtype ) ); + } + + return newarr.release(); + } + + return new UninitObject; +} + +BObjectImp* UOExecutorModule::mf_CreateMenu() +{ + const String* title; + if (getStringPara... [truncated message content] |
From: <mua...@us...> - 2009-09-07 20:37:49
|
Revision: 33 http://polserver.svn.sourceforge.net/polserver/?rev=33&view=rev Author: muaddib_pol Date: 2009-09-07 20:37:38 +0000 (Mon, 07 Sep 2009) Log Message: ----------- + Network Code organized some. Baby steps, baby steps Modified Paths: -------------- trunk/pol-core/makefile.gcc trunk/pol-core/plib/realmfunc.cpp trunk/pol-core/pol/accounts/account.cpp trunk/pol-core/pol/accounts/acscrobj.cpp trunk/pol-core/pol/bowsalut.cpp trunk/pol-core/pol/clfunc.cpp trunk/pol-core/pol/containr.cpp trunk/pol-core/pol/core.cpp trunk/pol-core/pol/create.cpp trunk/pol-core/pol/dblclick.cpp trunk/pol-core/pol/door.cpp trunk/pol-core/pol/dropitem.cpp trunk/pol-core/pol/eqpitem.cpp trunk/pol-core/pol/getitem.cpp trunk/pol-core/pol/getmsg.cpp trunk/pol-core/pol/guardrgn.cpp trunk/pol-core/pol/help.cpp trunk/pol-core/pol/irequest.cpp trunk/pol-core/pol/item.cpp trunk/pol-core/pol/itemcr.cpp trunk/pol-core/pol/login.cpp trunk/pol-core/pol/menusel.cpp trunk/pol-core/pol/miscmsg.cpp trunk/pol-core/pol/mobile/attack.cpp trunk/pol-core/pol/mobile/charactr.cpp trunk/pol-core/pol/module/attributemod.cpp trunk/pol-core/pol/module/clmod.cpp trunk/pol-core/pol/module/npcmod.cpp trunk/pol-core/pol/module/osmod.cpp trunk/pol-core/pol/module/unimod.cpp trunk/pol-core/pol/module/uomod.cpp trunk/pol-core/pol/module/uomod2.cpp trunk/pol-core/pol/module/uomod3.cpp trunk/pol-core/pol/module/vitalmod.cpp trunk/pol-core/pol/movement.cpp trunk/pol-core/pol/multi/boat.cpp trunk/pol-core/pol/multi/customhouses.cpp trunk/pol-core/pol/multi/customhouses.h trunk/pol-core/pol/multi/house.cpp trunk/pol-core/pol/npc.cpp trunk/pol-core/pol/packetscrobj.cpp trunk/pol-core/pol/party.cpp trunk/pol-core/pol/pol-2008.vcproj trunk/pol-core/pol/pol.cpp trunk/pol-core/pol/scrsched.cpp trunk/pol-core/pol/sngclick.cpp trunk/pol-core/pol/speech.cpp trunk/pol-core/pol/spelbook.h trunk/pol-core/pol/spells.cpp trunk/pol-core/pol/statmsg.cpp trunk/pol-core/pol/target.cpp trunk/pol-core/pol/tasks.cpp trunk/pol-core/pol/textcmd.cpp trunk/pol-core/pol/tooltips.cpp trunk/pol-core/pol/tooltips.h trunk/pol-core/pol/ufunc.cpp trunk/pol-core/pol/ufunc2.cpp trunk/pol-core/pol/umap.cpp trunk/pol-core/pol/uobjhelp.cpp trunk/pol-core/pol/uolisten.cpp trunk/pol-core/pol/uoscrobj.cpp trunk/pol-core/pol/useskill.cpp trunk/pol-core/pol/uvars.cpp Added Paths: ----------- trunk/pol-core/pol/network/ trunk/pol-core/pol/network/bannedips.cpp trunk/pol-core/pol/network/bannedips.h trunk/pol-core/pol/network/cgdata.cpp trunk/pol-core/pol/network/cgdata.h trunk/pol-core/pol/network/client.cpp trunk/pol-core/pol/network/client.h trunk/pol-core/pol/network/clientio.cpp trunk/pol-core/pol/network/cliface.cpp trunk/pol-core/pol/network/cliface.h trunk/pol-core/pol/network/iostats.cpp trunk/pol-core/pol/network/iostats.h trunk/pol-core/pol/network/packethooks.cpp trunk/pol-core/pol/network/packethooks.h Removed Paths: ------------- trunk/pol-core/pol/bannedips.cpp trunk/pol-core/pol/bannedips.h trunk/pol-core/pol/cgdata.cpp trunk/pol-core/pol/cgdata.h trunk/pol-core/pol/client.cpp trunk/pol-core/pol/client.h trunk/pol-core/pol/clientio.cpp trunk/pol-core/pol/cliface.cpp trunk/pol-core/pol/cliface.h trunk/pol-core/pol/iostats.cpp trunk/pol-core/pol/iostats.h trunk/pol-core/pol/packethooks.cpp trunk/pol-core/pol/packethooks.h Modified: trunk/pol-core/makefile.gcc =================================================================== --- trunk/pol-core/makefile.gcc 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/makefile.gcc 2009-09-07 20:37:38 UTC (rev 33) @@ -51,13 +51,13 @@ pol/accounts/account.cpp pol/accounts/accounts.cpp pol/accounts/acscrobj.cpp pol/allocd.cpp \ pol/armor.cpp pol/mobile/attack.cpp \ pol/mobile/attribute.cpp pol/auxclient.cpp \ - pol/bannedips.cpp pol/binaryfilescrobj.cpp pol/multi/boat.cpp pol/multi/boatcomp.cpp \ + pol/network/bannedips.cpp pol/binaryfilescrobj.cpp pol/multi/boat.cpp pol/multi/boatcomp.cpp \ pol/module/boatmod.cpp pol/mobile/boundbox.cpp pol/bowsalut.cpp \ - pol/module/cfgmod.cpp pol/cfgrepos.cpp pol/cgdata.cpp pol/mobile/charactr.cpp \ + pol/module/cfgmod.cpp pol/cfgrepos.cpp pol/network/cgdata.cpp pol/mobile/charactr.cpp \ pol/checkpnt.cpp \ - pol/mobile/chrcast.cpp pol/mobile/chrituse.cpp pol/mobile/chrskuse.cpp pol/client.cpp \ - pol/clientio.cpp \ - pol/cliface.cpp pol/cmbtcfg.cpp pol/cmdlevel.cpp pol/containr.cpp \ + pol/mobile/chrcast.cpp pol/mobile/chrituse.cpp pol/mobile/chrskuse.cpp pol/network/client.cpp \ + pol/network/clientio.cpp \ + pol/network/cliface.cpp pol/cmbtcfg.cpp pol/cmdlevel.cpp pol/containr.cpp \ pol/console.cpp pol/core.cpp pol/mobile/corpse.cpp \ pol/create.cpp \ pol/cryptengine.cpp pol/crypt/cryptbase.cpp pol/crypt/cryptkey.cpp \ @@ -76,7 +76,7 @@ pol/module/guildmod.cpp \ pol/module/basiciomod.cpp pol/module/basicmod.cpp \ pol/help.cpp pol/multi/house.cpp \ - pol/iostats.cpp pol/irequest.cpp pol/item.cpp pol/item00.cpp \ + pol/network/iostats.cpp pol/irequest.cpp pol/item.cpp pol/item00.cpp \ pol/itemcr.cpp pol/itemdesc.cpp \ pol/landtile.cpp \ pol/listenpt.cpp pol/loadunld.cpp pol/lockable.cpp pol/logfiles.cpp \ @@ -89,7 +89,7 @@ pol/musicrgn.cpp \ pol/npc.cpp pol/npctmpl.cpp pol/npctemplates.cpp pol/module/npcmod.cpp \ pol/objecthash.cpp pol/module/osmod.cpp \ - pol/packethooks.cpp pol/packetscrobj.cpp pol/party.cpp \ + pol/network/packethooks.cpp pol/packetscrobj.cpp pol/party.cpp \ pol/pol.cpp pol/polcfg.cpp pol/polclock.cpp pol/poldbg.cpp \ pol/polfile2.cpp pol/polsem.cpp pol/polsig.cpp pol/polstats.cpp \ pol/module/polsystemmod.cpp \ Modified: trunk/pol-core/plib/realmfunc.cpp =================================================================== --- trunk/pol-core/plib/realmfunc.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/plib/realmfunc.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -14,7 +14,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include "realm.h" #include "realmdescriptor.h" @@ -24,20 +24,20 @@ #include "mapshape.h" #include "maptileserver.h" -#include "pol/tiles.h" +#include "../pol/tiles.h" #include "../pol/mobile/charactr.h" -#include "pol/cgdata.h" -#include "pol/multi/customhouses.h" -#include "pol/fnsearch.h" -#include "pol/ssopt.h" -#include "pol/uvars.h" -#include "pol/uworld.h" -#include "pol/item.h" -#include "pol/itemdesc.h" -#include "pol/itemdesc.h" -#include "pol/multi/multi.h" -#include "pol/multi/house.h" -#include "pol/uconst.h" +#include "../pol/network/cgdata.h" +#include "../pol/multi/customhouses.h" +#include "../pol/fnsearch.h" +#include "../pol/ssopt.h" +#include "../pol/uvars.h" +#include "../pol/uworld.h" +#include "../pol/item.h" +#include "../pol/itemdesc.h" +#include "../pol/itemdesc.h" +#include "../pol/multi/multi.h" +#include "../pol/multi/house.h" +#include "../pol/uconst.h" #define HULL_HEIGHT_BUFFER 2 Modified: trunk/pol-core/pol/accounts/account.cpp =================================================================== --- trunk/pol-core/pol/accounts/account.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/accounts/account.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -18,7 +18,7 @@ #include "account.h" #include "accounts.h" #include "../mobile/charactr.h" -#include "../client.h" +#include "../network/client.h" #include "../cmdlevel.h" #include "../polcfg.h" Modified: trunk/pol-core/pol/accounts/acscrobj.cpp =================================================================== --- trunk/pol-core/pol/accounts/acscrobj.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/accounts/acscrobj.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -35,7 +35,7 @@ #include "accounts.h" #include "acscrobj.h" #include "../mobile/charactr.h" -#include "../client.h" +#include "../network/client.h" #include "../cmdlevel.h" #include "../core.h" #include "../objecthash.h" Deleted: trunk/pol-core/pol/bannedips.cpp =================================================================== --- trunk/pol-core/pol/bannedips.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/bannedips.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -1,74 +0,0 @@ -/* -History -======= - -Notes -======= - -*/ - -#include "clib/stl_inc.h" - -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/fileutil.h" -#include "client.h" -#include "bannedips.h" - -bool is_banned_ip(Client* client) -{ - if (banned_ips.empty()) - return false; - - for( std::vector<IPRule>::iterator itr = banned_ips.begin(); itr != banned_ips.end(); ++itr ) - { - unsigned long addr1part, addr2part; - struct sockaddr_in* sockin = reinterpret_cast<struct sockaddr_in*>(&client->ipaddr); - addr1part = itr->ipMatch & itr->ipMask; - -#ifdef _WIN32 - addr2part = sockin->sin_addr.S_un.S_addr & itr->ipMask; -#else - addr2part = sockin->sin_addr.s_addr & itr->ipMask; -#endif - - if (addr1part == addr2part) - return true; - } - return false; -} - -void read_bannedips_config( bool initial_load) -{ - if (!initial_load) - { - banned_ips.clear(); - } - if (!FileExists( "config/bannedips.cfg" )) - return; - - ConfigFile cf( "config/bannedips.cfg" ); - ConfigElem elem; - - while (cf.read( elem )) - { - IPRule CurrentEntry; - string iptext = elem.remove_string( "IPMatch" ); - string::size_type delim = iptext.find_first_of( "/" ); - if (delim != string::npos) - { - string ipaddr_str = iptext.substr( 0, delim ); - string ipmask_str = iptext.substr( delim+1 ); - CurrentEntry.ipMatch = inet_addr( ipaddr_str.c_str() ); - CurrentEntry.ipMask = inet_addr( ipmask_str.c_str() ); - banned_ips.push_back(CurrentEntry); - } - else - { - string ipmask_str = "255.255.255.255"; - CurrentEntry.ipMatch = inet_addr( iptext.c_str() ); - CurrentEntry.ipMask = inet_addr( ipmask_str.c_str() ); - banned_ips.push_back(CurrentEntry); - } - } -} Deleted: trunk/pol-core/pol/bannedips.h =================================================================== --- trunk/pol-core/pol/bannedips.h 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/bannedips.h 2009-09-07 20:37:38 UTC (rev 33) @@ -1,23 +0,0 @@ -/* -History -======= -2009/01/24 MuadDib Creation of bannedips.h. This is for the new upcoming bannedips.cpp/h setup. - This will work by storing the ip/mask in a vectored struct so - it's not reloading EVERY client connection! Will need to set a - clearing/reset with reloadcfg for this new system when done. - -Notes -======= - -*/ - -#include <string> -#include <vector> - -struct IPRule -{ - unsigned long ipMatch; - unsigned long ipMask; -}; - -std::vector< IPRule > banned_ips; \ No newline at end of file Modified: trunk/pol-core/pol/bowsalut.cpp =================================================================== --- trunk/pol-core/pol/bowsalut.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/bowsalut.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -18,7 +18,7 @@ #include "clib/strutil.h" #include "mobile/charactr.h" -#include "client.h" +#include "network/client.h" #include "extcmd.h" #include "pktin.h" #include "uobject.h" Deleted: trunk/pol-core/pol/cgdata.cpp =================================================================== --- trunk/pol-core/pol/cgdata.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/cgdata.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -1,139 +0,0 @@ -/* -History -======= -2009/09/03 MuadDib: Relocation of multi related cpp/h - -Notes -======= - -*/ - -#include "clib/stl_inc.h" - -#include "clib/unicode.h" - -#include "module/osmod.h" -#include "module/unimod.h" -#include "module/uomod.h" -#include "uoexec.h" - -#include "cgdata.h" -#include "fnsearch.h" -#include "multi/house.h" - -ClientGameData::ClientGameData() : - vendor(NULL), - gumpmods(), - textentry_uoemod(NULL), - target_cursor_uoemod(NULL), - menu_selection_uoemod(NULL), - prompt_uoemod(NULL), - resurrect_uoemod(NULL), - selcolor_uoemod(NULL), - prompt_uniemod(NULL), - justice_region(NULL), - lightlevel(0), - // light_region(NULL), - music_region(NULL), - weather_region(NULL), - custom_house_serial(0) -{ -} - -ClientGameData::~ClientGameData() -{ - clear(); -} - -void ClientGameData::clear() -{ - while (!gumpmods.empty()) - { - UOExecutorModule* uoemod = *gumpmods.begin(); - uoemod->uoexec.os_module->revive(); - uoemod->gump_chr = NULL; - gumpmods.erase( gumpmods.begin() ); - } - - if (textentry_uoemod != NULL) - { - textentry_uoemod->uoexec.os_module->revive(); - textentry_uoemod->textentry_chr = NULL; - textentry_uoemod = NULL; - } - - if (menu_selection_uoemod != NULL) - { - menu_selection_uoemod->uoexec.os_module->revive(); - menu_selection_uoemod->menu_selection_chr = NULL; - menu_selection_uoemod = NULL; - } - - if (prompt_uoemod != NULL) - { - prompt_uoemod->uoexec.os_module->revive(); - prompt_uoemod->prompt_chr = NULL; - prompt_uoemod = NULL; - } - - if (resurrect_uoemod != NULL) - { - resurrect_uoemod->uoexec.os_module->revive(); - resurrect_uoemod->resurrect_chr = NULL; - resurrect_uoemod = NULL; - } - - if (selcolor_uoemod != NULL) - { - selcolor_uoemod->uoexec.os_module->revive(); - selcolor_uoemod->selcolor_chr = NULL; - selcolor_uoemod = NULL; - } - - if (target_cursor_uoemod != NULL) - { - target_cursor_uoemod->uoexec.os_module->revive(); - target_cursor_uoemod->target_cursor_chr = NULL; - target_cursor_uoemod = NULL; - } - - if (prompt_uniemod != NULL) - { - prompt_uniemod->os_module->revive(); - prompt_uniemod->prompt_chr = NULL; - prompt_uniemod = NULL; - } - if (custom_house_serial != 0) - { - UMulti* multi = system_find_multi(custom_house_serial); - if(multi != NULL) - { - UHouse* house = multi->as_house(); - if(house != NULL) - house->editing = false; - } - custom_house_serial = 0; - } - -} - -void ClientGameData::add_gumpmod( UOExecutorModule* uoemod ) -{ - gumpmods.insert( uoemod ); -} - -UOExecutorModule* ClientGameData::find_gumpmod( u32 pid ) -{ - for( GumpMods::iterator itr = gumpmods.begin(); itr != gumpmods.end(); ++itr ) - { - UOExecutorModule* uoemod = (*itr); - if (uoemod->uoexec.os_module->pid() == pid) - return uoemod; - } - return NULL; -} - -void ClientGameData::remove_gumpmod( UOExecutorModule* uoemod ) -{ - gumpmods.erase( uoemod ); -} Deleted: trunk/pol-core/pol/cgdata.h =================================================================== --- trunk/pol-core/pol/cgdata.h 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/cgdata.h 2009-09-07 20:37:38 UTC (rev 33) @@ -1,71 +0,0 @@ -/* -History -======= - - -Notes -======= - -*/ - -#ifndef CGDATA_H -#define CGDATA_H - -#include "clib/refptr.h" - -#include "containr.h" -#include "npc.h" -#include "reftypes.h" - -class JusticeRegion; -class LightRegion; -class MusicRegion; -class WeatherRegion; - -class UnicodeExecutorModule; - -class ClientGameData -{ -public: - ClientGameData(); - ~ClientGameData(); - void clear(); - - - ref_ptr<UContainer> vendor_bought; - ref_ptr<UContainer> vendor_for_sale; - NPCRef vendor; - - typedef std::set<UOExecutorModule*> GumpMods; - GumpMods gumpmods; - - void add_gumpmod( UOExecutorModule* ); - UOExecutorModule* find_gumpmod( u32 pid ); - void remove_gumpmod( UOExecutorModule* ); - - UOExecutorModule* textentry_uoemod; - - - /* - * If a script is requesting a target cursor from this - * character, target_cursor_ex is that script. - * Same for menu selection. - */ - UOExecutorModule* target_cursor_uoemod; - UOExecutorModule* menu_selection_uoemod; - UOExecutorModule* prompt_uoemod; - UOExecutorModule* resurrect_uoemod; - UOExecutorModule* selcolor_uoemod; - - UnicodeExecutorModule* prompt_uniemod; // UNIemod, not UOemod!!! - - JusticeRegion* justice_region; - - int lightlevel; - // LightRegion* light_region; - MusicRegion* music_region; - WeatherRegion* weather_region; - u32 custom_house_serial; -}; - -#endif Modified: trunk/pol-core/pol/clfunc.cpp =================================================================== --- trunk/pol-core/pol/clfunc.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/clfunc.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -19,7 +19,7 @@ #include "clib/passert.h" #include "mobile/charactr.h" -#include "client.h" +#include "network/client.h" #include "pktoutid.h" #include "sockio.h" #include "clfunc.h" Deleted: trunk/pol-core/pol/client.cpp =================================================================== --- trunk/pol-core/pol/client.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/client.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -1,571 +0,0 @@ -/* -History -======= -2005/01/24 Shinigami: added getspyonclient2 to support packet 0xd9 (Spy on Client 2) -2005/08/29 Shinigami: character.spyonclient2 renamed to character.clientinfo - getspyonclient2 renamed to getclientinfo -2007/07/09 Shinigami: added isUOKR [bool] - UO:KR client used? -2009/07/20 MuadDib: Added statement to bypass cryptseed at login. Handled by changing default client recv_state using ssopt flag. -2009/07/23 MuadDib: updates for new Enum::Packet Out ID -2009/08/25 Shinigami: STLport-5.2.1 fix: init order changed of aosresist - STLport-5.2.1 fix: params in call of Log2() - -Notes -======= - -*/ - -#include "clib/stl_inc.h" - -#include "clib/fdump.h" -#include "clib/logfile.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" //CNXBUG -#include "clib/unicode.h" - -#include "bscript/berror.h" - -#include "accounts/account.h" -#include "cgdata.h" -#include "mobile/charactr.h" -#include "client.h" -#include "cliface.h" -#include "crypt/cryptengine.h" -#include "msgfiltr.h" -#include "pktin.h" -#include "polcfg.h" -#include "polsig.h" -#include "polstats.h" -#include "sockio.h" -#include "ssopt.h" -#include "module/unimod.h" -#include "uoclient.h" -#include "uvars.h" -#include "uworld.h" -#include "xbuffer.h" - -// only in here temporarily, until logout-on-disconnect stuff is removed -#include "ufunc.h" - -unsigned long Client::instance_counter_; - -Client::Client( ClientInterface& aInterface, const string& encryption ) : - acct(NULL), - chr(NULL), - Interface(aInterface), - ready(false), - csocket(-1), - listen_port(0), - aosresist(false), - disconnect(0), - recv_state( RECV_STATE_CRYPTSEED_WAIT ), - encrypted_data(), - bufcheck1_AA(0xAA), - buffer(), - bufcheck2_55(0x55), - bytes_received(0), - message_length(0), - cryptengine( create_crypt_engine( encryption ) ), - encrypt_server_stream(0), - msgtype_filter(&login_filter), - fpLog(NULL), - pause_count(0), - first_xmit_buffer(NULL), - last_xmit_buffer(NULL), - n_queued(0), - queued_bytes_counter(0), - gd(new ClientGameData), - instance_( ++instance_counter_ ), - checkpoint(-1), //CNXBUG - last_msgtype(255), - thread_pid(-1), - UOExpansionFlag(0), - isUOKR(false), - is_greq_6017(false), - is_greq_60142(false), - paused_(false) -{ - // For bypassing cryptseed packet - if ( ssopt.use_edit_server ) - { - recv_state = RECV_STATE_MSGTYPE_WAIT; - } - - Interface.register_client( this ); - memset( buffer, 0, sizeof buffer ); - memset( &counters, 0, sizeof counters ); - memset( &clientinfo_, 0, sizeof(clientinfo_) ); - memset( &versiondetail_, 0, sizeof(versiondetail_) ); -} - -void cancel_trade( Character* chr1 ); - -void Client::Delete( Client* client ) -{ - client->PreDelete(); - delete client; -} - -Client::~Client() -{ -} - -void Client::Disconnect() -{ - Interface.deregister_client( this ); - if (csocket != INVALID_SOCKET)//>= 0) - { -#ifdef _WIN32 - shutdown( csocket,2 ); //2 is both sides, defined in winsock2.h ... - closesocket( csocket ); -#else - shutdown( csocket,SHUT_RDWR ); - close( csocket ); -#endif - } - csocket = INVALID_SOCKET; -} - -void Client::PreDelete() -{ - Disconnect(); - // FIXME: TEMPORARY FIX: disassociate the character from the account, so - // you can log on with another character - if ((acct != NULL) && - (acct->active_character != NULL) && - (acct->active_character->client == this)) - { - if (acct->active_character->logged_in) - { - Character* tchr = acct->active_character; - ClrCharacterWorldPosition( tchr, "Client Exit" ); - send_remove_character_to_nearby( tchr ); - tchr->logged_in = false; - - tchr->set_opponent( NULL ); - tchr->removal_cleanup(); - if (tchr->get_opponent() != NULL) - { - tchr->set_opponent(NULL, true); - } - } - else - { - cerr << "Uhh... active character not logged in!??" << endl; - } - acct->active_character = NULL; - } - - // detach the account and character from this client, if they - // are still associated with it. - - acct = NULL; - - if (chr) - { - if (chr->client == this) - chr->client = NULL; - chr = NULL; - } - - if (fpLog != NULL) - { - time_t now = time(NULL); - fprintf( fpLog, "Log closed at %s\n", asctime( localtime( &now ) ) ); - - fclose( fpLog ); - fpLog = NULL; - } - - delete gd; - gd = NULL; - - while (first_xmit_buffer != NULL) - { - XmitBuffer* xbuffer = first_xmit_buffer; - first_xmit_buffer = first_xmit_buffer->next; - free(xbuffer); - --n_queued; - } - last_xmit_buffer = NULL; -} - -// ClientInfo - delivers a lot of usefull infomation about client PC -BStruct* Client::getclientinfo() const -{ - BStruct* ret = new BStruct; - - ret->addMember( "unknown1", new BLong( clientinfo_.unknown1 ) ); // Unknown - allways 0x02 - ret->addMember( "instance", new BLong( clientinfo_.instance ) ); // Unique Instance ID of UO - ret->addMember( "os_major", new BLong( clientinfo_.os_major ) ); // OS Major - ret->addMember( "os_minor", new BLong( clientinfo_.os_minor ) ); // OS Minor - ret->addMember( "os_revision", new BLong( clientinfo_.os_revision ) ); // OS Revision - ret->addMember( "cpu_manufacturer", new BLong( clientinfo_.cpu_manufacturer ) ); // CPU Manufacturer - ret->addMember( "cpu_family", new BLong( clientinfo_.cpu_family ) ); // CPU Family - ret->addMember( "cpu_model", new BLong( clientinfo_.cpu_model ) ); // CPU Model - ret->addMember( "cpu_clockspeed", new BLong( clientinfo_.cpu_clockspeed ) ); // CPU Clock Speed [Mhz] - ret->addMember( "cpu_quantity", new BLong( clientinfo_.cpu_quantity ) ); // CPU Quantity - ret->addMember( "memory", new BLong( clientinfo_.memory ) ); // Memory [MB] - ret->addMember( "screen_width", new BLong( clientinfo_.screen_width ) ); // Screen Width - ret->addMember( "screen_height", new BLong( clientinfo_.screen_height ) ); // Screen Height - ret->addMember( "screen_depth", new BLong( clientinfo_.screen_depth ) ); // Screen Depth [Bit] - ret->addMember( "directx_major", new BLong( clientinfo_.directx_major ) ); // DirectX Major - ret->addMember( "directx_minor", new BLong( clientinfo_.directx_minor ) ); // DirectX Minor - - ObjArray* arr_vd; - unsigned maxlen_vd = sizeof(clientinfo_.video_description) / sizeof(clientinfo_.video_description[0]); - unsigned wlen_vd = 0; - while ( (clientinfo_.video_description[wlen_vd] != L'\0') && (wlen_vd < maxlen_vd) ) - ++wlen_vd; - if ( !convertUCtoArray(clientinfo_.video_description, arr_vd, wlen_vd, true) ) - ret->addMember( "video_description", new BError("Invalid Unicode speech received.") ); - else { - ret->addMember( "video_description", arr_vd ); // Video Card Description [wide-character] - } - - ret->addMember( "video_vendor", new BLong( clientinfo_.video_vendor ) ); // Video Card Vendor ID - ret->addMember( "video_device", new BLong( clientinfo_.video_device ) ); // Video Card Device ID - ret->addMember( "video_memory", new BLong( clientinfo_.video_memory ) ); // Video Card Memory [MB] - ret->addMember( "distribution", new BLong( clientinfo_.distribution ) ); // Distribution - ret->addMember( "clients_running", new BLong( clientinfo_.clients_running ) ); // Clients Running - ret->addMember( "clients_installed", new BLong( clientinfo_.clients_installed ) ); // Clients Installed - ret->addMember( "partial_installed", new BLong( clientinfo_.partial_installed ) ); // Partial Insstalled - - ObjArray* arr_lc; - unsigned maxlen_lc = sizeof(clientinfo_.langcode) / sizeof(clientinfo_.langcode[0]); - unsigned wlen_lc = 0; - while ( (clientinfo_.langcode[wlen_lc] != L'\0') && (wlen_lc < maxlen_lc) ) - ++wlen_lc; - if ( !convertUCtoArray(clientinfo_.langcode, arr_lc, wlen_lc, true) ) - ret->addMember( "langcode", new BError("Invalid Unicode speech received.") ); - else { - ret->addMember( "langcode", arr_lc ); // Language Code [wide-character] - } - - ObjArray* arr_u2 = new ObjArray; - for ( unsigned i = 0; i < sizeof(clientinfo_.unknown2); ++i ) - arr_u2->addElement( new BLong( clientinfo_.unknown2[i] ) ); - ret->addMember( "unknown2", arr_u2 ); // Unknown - - return ret; -} - -void Client::itemizeclientversion(const std::string& ver, VersionDetailStruct& detail) -{ - try - { - int dot1 = ver.find_first_of('.',0); - int dot2 = ver.find_first_of('.',dot1 + 1); - int dot3 = ver.find_first_of('.',dot2 + 1); - if (dot3 == -1) // since 5.0.7 patch is digit - { - dot3 = dot2 + 1; - while ( (dot3 < (int)ver.length()) && (isdigit(ver[dot3])) ) - { - dot3++; - } - } - - detail.major = atoi(ver.substr(0,dot1).c_str()); - detail.minor = atoi(ver.substr(dot1+1,dot2 - dot1 - 1).c_str()); - detail.rev = atoi(ver.substr(dot2+1,dot3 - dot2 - 1).c_str()); - detail.patch = 0; - if (dot3<(int)ver.length()) - { - if ( (detail.major<=5) && (detail.minor<=0) && (detail.rev<=6)) - { - if (ver[dot3]!=' ') - detail.patch = (ver[dot3] - 'a') + 1; // char to int - } - else - detail.patch = atoi(ver.substr(dot3+1,ver.length() - dot3 - 1).c_str()); - } - } - catch(...) - { - detail.major = 0; - detail.minor = 0; - detail.rev = 0; - detail.patch = 0; - Log2("Malformed clientversion string: %s\n",ver.c_str()); - } -} - -bool Client::compareVersion( const std::string& ver ) -{ - VersionDetailStruct ver2; - itemizeclientversion(ver, ver2); - return Client::compareVersion(ver2); -} - -bool Client::compareVersion(const VersionDetailStruct& ver2) -{ - VersionDetailStruct ver1 = getversiondetail(); - - if ( ver1.major > ver2.major ) - return true; - else if ( ver1.major < ver2.major ) - return false; - else if ( ver1.minor > ver2.minor ) - return true; - else if ( ver1.minor < ver2.minor ) - return false; - else if ( ver1.rev > ver2.rev ) - return true; - else if ( ver1.rev < ver2.rev ) - return false; - else if ( ver1.patch > ver2.patch ) - return true; - else if ( ver1.patch < ver2.patch ) - return false; - else - return true; -} - -std::string Client::status() const -{ - std::string st; - if (acct != NULL) - st += "AC:" + std::string(acct->name()) + " "; - if (chr != NULL) - st += "CH:" + chr->name() + " "; - if (have_queued_data()) - st += "TXBUF "; - if (disconnect) - st += "DISC "; - if (paused_) - st += "PAUSE "; - if (ready) - st += "RDY "; - st += ipaddrAsString() + " "; - st += "CHK: " + decint(checkpoint) + " "; - st += "PID: " + decint(thread_pid) + " "; - st += "LAST: " + hexint(last_msgtype); - return st; -} - -void Client::setcryptseed( unsigned char i_cryptseed[4] ) -{ - memcpy( cryptseed, i_cryptseed, sizeof cryptseed ); -} - -void Client::queue_data( const void *data, unsigned short datalen ) -{ - THREAD_CHECKPOINT( active_client, 300 ); - XmitBuffer *xbuffer = (XmitBuffer *) malloc( sizeof(XmitBuffer)-1+datalen ); - THREAD_CHECKPOINT( active_client, 301 ); - if (xbuffer) - { - THREAD_CHECKPOINT( active_client, 302 ); - xbuffer->next = NULL; - xbuffer->nsent = 0; - xbuffer->lenleft = datalen; - memcpy( xbuffer->data, data, datalen ); - THREAD_CHECKPOINT( active_client, 303 ); - if (first_xmit_buffer == NULL) - { // in this case, last_xmit_buffer is also NULL, so can't set its ->next. - THREAD_CHECKPOINT( active_client, 304 ); - first_xmit_buffer = xbuffer; - } - else - { - THREAD_CHECKPOINT( active_client, 305 ); - last_xmit_buffer->next = xbuffer; - } - THREAD_CHECKPOINT( active_client, 306 ); - last_xmit_buffer = xbuffer; - ++n_queued; - queued_bytes_counter += datalen; - } - else - { - THREAD_CHECKPOINT( active_client, 307 ); - Log( "Client#%lu: Unable to allocate %d bytes for queued data. Disconnecting.\n", - instance_, sizeof(XmitBuffer)-1+datalen ); - disconnect = true; - } - THREAD_CHECKPOINT( active_client, 309 ); - -} - - -void Client::xmit( const void *data, unsigned short datalen ) -{ - THREAD_CHECKPOINT( active_client, 200 ); - if (last_xmit_buffer) // this client already backlogged, schedule for later - { - THREAD_CHECKPOINT( active_client, 201 ); - queue_data( data, datalen ); - THREAD_CHECKPOINT( active_client, 202 ); - return; - } - THREAD_CHECKPOINT( active_client, 203 ); - - /* client not backlogged - try to send. */ - const unsigned char *cdata = (const unsigned char *) data; - int nsent; - - if (-1 == (nsent = send( csocket, (const char *)cdata, datalen, 0 ))) - { - THREAD_CHECKPOINT( active_client, 204 ); - int sckerr = socket_errno; - - if (sckerr == SOCKET_ERRNO(EWOULDBLOCK)) - { - THREAD_CHECKPOINT( active_client, 205 ); - Log( "Client#%lu: Switching to queued data mode (1, %u bytes)\n", instance_, (unsigned) datalen ); - cerr << "Switching to queued data mode (1, " << datalen << " bytes)" << endl; - THREAD_CHECKPOINT( active_client, 206 ); - queue_data( data, datalen ); - THREAD_CHECKPOINT( active_client, 207 ); - return; - } - else - { - THREAD_CHECKPOINT( active_client, 208 ); - if (!disconnect) - Log( "Client#%lu: Disconnecting client due to send() error (1): %d\n" , instance_, sckerr); - disconnect = 1; - THREAD_CHECKPOINT( active_client, 209 ); - return; - } - } - else // no error - { - THREAD_CHECKPOINT( active_client, 210 ); - datalen -= static_cast<unsigned short>(nsent); - counters.bytes_transmitted += nsent; - polstats.bytes_sent += nsent; - if (datalen) // anything left? if so, queue for later. - { - THREAD_CHECKPOINT( active_client, 211 ); - Log( "Client#%lu: Switching to queued data mode (2)\n", instance_ ); - cerr << "Switching to queued data mode (2)" << endl; - THREAD_CHECKPOINT( active_client, 212 ); - queue_data( cdata+nsent, datalen ); - THREAD_CHECKPOINT( active_client, 213 ); - - } - } - THREAD_CHECKPOINT( active_client, 214 ); -} - -void Client::send_queued_data() -{ - XmitBuffer *xbuffer; - // hand off data to the sockets layer until it won't take any more. - // note if a buffer is sent in full, we try to send the next one, ad infinitum - while (NULL != (xbuffer = first_xmit_buffer)) - { - int nsent; - nsent = send( csocket, - (char *) &xbuffer->data[xbuffer->nsent], - xbuffer->lenleft, - 0 ); - if (nsent == -1) - { -#ifdef _WIN32 - int sckerr = WSAGetLastError(); -#else - int sckerr = errno; -#endif - if (sckerr == SOCKET_ERRNO(EWOULDBLOCK)) - { - // do nothing. it'll be re-queued later, when it won't block. - return; - } - else - { - if (!disconnect) - Log( "Client#%lu: Disconnecting client due to send() error (2): %d\n", instance_, sckerr ); - disconnect = 1; - return; - } - } - else - { - xbuffer->nsent += static_cast<unsigned short>(nsent); - xbuffer->lenleft -= static_cast<unsigned short>(nsent); - counters.bytes_transmitted += nsent; - polstats.bytes_sent += nsent; - if (xbuffer->lenleft == 0) - { - first_xmit_buffer = first_xmit_buffer->next; - if (first_xmit_buffer == NULL) - { - last_xmit_buffer = NULL; - Log( "Client#%lu: Leaving queued mode (%ld bytes xmitted)\n", instance_, queued_bytes_counter ); - queued_bytes_counter = 0; - } - free( xbuffer ); - --n_queued; - } - } - } -} - -#define PRE_ENCRYPT - -#ifndef PRE_ENCRYPT -#include "sockio.h" -#endif - -// 33 01 "encrypted": 4F FA -static const unsigned char pause_pre_encrypted[2] = { 0x4F, 0xFA }; -// 33 00 "encrypted": 4C D0 -static const unsigned char restart_pre_encrypted[2] = { 0x4C, 0xD0 }; - -void Client::send_pause(bool bForce /*=false*/) -{ - if ((bForce || uoclient_protocol.EnableFlowControlPackets) && !paused_) - { -#ifndef PRE_ENCRYPT - PKTOUT_33 msg; - msg.msgtype = PKTOUT_33_ID; - msg.flow = MSGOPT_33_FLOW_PAUSE; - transmit( this, &msg, sizeof msg ); -#else - xmit( pause_pre_encrypted, sizeof pause_pre_encrypted ); -#endif - paused_ = true; - // cout << "Client#" << instance_ << " paused" << endl; - } -} - -void Client::pause() -{ - if (!pause_count) - { - send_pause(); - pause_count = 1; - } - // ++pause_count; -} - -void Client::send_restart(bool bForce /*=false*/) -{ - if (paused_) - { -#ifndef PRE_ENCRYPT - PKTOUT_33 msg; - msg.msgtype = PKTOUT_33_ID; - msg.flow = MSGOPT_33_FLOW_RESTART; - transmit( this, &msg, sizeof msg ); -#else - xmit( restart_pre_encrypted, sizeof restart_pre_encrypted ); -#endif - // cout << "Client#" << instance_ << " restarted" << endl; - paused_ = false; - } -} - -// FIXME: Why is this empty?? -void Client::restart() -{ -} - -void Client::restart2() -{ - send_restart(); - pause_count = 0; -} Deleted: trunk/pol-core/pol/client.h =================================================================== --- trunk/pol-core/pol/client.h 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/client.h 2009-09-07 20:37:38 UTC (rev 33) @@ -1,203 +0,0 @@ -/* -History -======= -2005/01/24 Shinigami: added get-/setspyonclient2 to support packet 0xd9 (Spy on Client 2) -2005/04/03 Shinigami: added UOExpansionFlag for Samurai Empire -2005/08/29 Shinigami: character.spyonclient2 renamed to character.clientinfo - get-/setspyonclient2 renamed to get-/setclientinfo -2006/05/16 Shinigami: added UOExpansionFlag for Mondain's Legacy - added GENDER/RACE flag (e.g. used inside ClientCreateChar()) -2007/07/09 Shinigami: added isUOKR [bool] - UO:KR client used? -2009/08/10 MuadDib: Added CLIENT_VER_50000 for v5.0.0x clients. -2009/08/19 Turley: Added u32 UOExpansionFlagClient - -Notes -======= - -*/ - -#ifndef __CLIENT_H -#define __CLIENT_H - -#include <stdio.h> // for that FILE fpLog down there :( -#include <memory> -#include <string> - -#include "clib/rawtypes.h" -#include "pktin.h" -#include "sockets.h" -#include "ucfg.h" -#include "ucrypto.h" -#include "crypt/cryptengine.h" -#include "bscript/bstruct.h" - -class MessageTypeFilter; -class Account; -class Character; -class UContainer; -struct XmitBuffer; -class ClientGameData; -class ClientInterface; -class UOClientInterface; - -extern UOClientInterface uo_client_interface; - -const u16 T2A = 0x01; -const u16 LBR = 0x02; -const u16 AOS = 0x04; -const u16 SE = 0x08; // set AOS-Flag in send_feature_enable() too for needed checks -const u16 ML = 0x10; // set SE- and AOS-Flag in send_feature_enable() too for needed checks -const u16 KR = 0x20; // set KR- and SE- and AOS-Flag in send_feature_enable() too for needed checks - -const u8 FLAG_GENDER = 0x01; -const u8 FLAG_RACE = 0x02; - - -struct VersionDetailStruct -{ - int major; - int minor; - int rev; - int patch; -}; - -const struct VersionDetailStruct CLIENT_VER_50000={5,0,0,0}; -const struct VersionDetailStruct CLIENT_VER_60171={6,0,1,7}; -const struct VersionDetailStruct CLIENT_VER_60142={6,0,14,2}; - -class Client -{ -public: - Client( ClientInterface& aInterface, const string& encryption ); - static void Delete( Client* client ); - friend class GCCHelper; - -private: - void PreDelete(); - virtual ~Client(); - -public: - void Disconnect(); - void transmit( const void *data, int len ); // for entire message or header only - void transmitmore( const void *data, int len ); // for stuff after a header - - void recv_remaining( int total_expected ); - void recv_remaining_nocrypt( int total_expected ); - - void setversion( const std::string& ver ) { version_ = ver; } - const std::string& getversion() const { return version_; } - VersionDetailStruct getversiondetail() const { return versiondetail_; } - void setversiondetail( VersionDetailStruct& detail ) { versiondetail_ = detail; } - void itemizeclientversion( const std::string& ver, VersionDetailStruct& detail ); - bool compareVersion( const std::string& ver ); - bool compareVersion(const VersionDetailStruct& ver2); - - void setclientinfo( const PKTIN_D9 *msg ) { memcpy( &clientinfo_, msg, sizeof(clientinfo_) ); } - BStruct* getclientinfo() const; - - Account* acct; - Character* chr; - ClientInterface& Interface; - - bool ready; // all initialization stuff has been sent, ready for general use. - - -// - bool have_queued_data() const; - void send_queued_data(); - - SOCKET csocket; // socket to client ACK - requires header inclusion. - unsigned short listen_port; - bool aosresist; // UOClient.Cfg Entry - - bool disconnect; // if 1, disconnect this client - - enum e_recv_states { - RECV_STATE_CRYPTSEED_WAIT, - RECV_STATE_MSGTYPE_WAIT, - RECV_STATE_MSGLEN_WAIT, - RECV_STATE_MSGDATA_WAIT - } recv_state; - - unsigned char encrypted_data[ MAXBUFFER ]; - unsigned char bufcheck1_AA; - unsigned char buffer[ MAXBUFFER ]; - unsigned char bufcheck2_55; - unsigned int bytes_received; // how many bytes have been received into the buffer. - unsigned int message_length; // how many bytes are expected for this message - - struct sockaddr ipaddr; - - ClientEncryptionEngine clicrypt; - - std::auto_ptr<CryptEngine> cryptengine; - - //CCrypt newcrypt; - unsigned char cryptseed[4]; - - void setcryptseed( unsigned char cryptseed[4] ); - - bool encrypt_server_stream; // encrypt the server stream (data sent to client)? - - const MessageTypeFilter *msgtype_filter; - - FILE* fpLog; - - std::string status() const; - - void send_pause(bool bForce = false); - void send_restart(bool bForce = false); - - void pause(); - void restart(); - void restart2(); - int pause_count; - - std::string ipaddrAsString() const; - -protected: - - XmitBuffer *first_xmit_buffer; - XmitBuffer *last_xmit_buffer; - long n_queued; - long queued_bytes_counter; // only used for monitoring - - // we may want to track how many bytes total are outstanding, - // and boot clients that are too far behind. - void queue_data( const void *data, unsigned short datalen ); - void transmit_encrypted( const void *data, int len ); - void xmit( const void *data, unsigned short datalen ); - -public: - ClientGameData* gd; - unsigned long instance_; - static unsigned long instance_counter_; - int checkpoint;//CNXBUG - unsigned char last_msgtype; - int thread_pid; - u16 UOExpansionFlag; - u32 UOExpansionFlagClient; - bool isUOKR; - bool is_greq_6017; - bool is_greq_60142; - -private: - struct { - unsigned long bytes_transmitted; - unsigned long bytes_received; - } counters; - std::string version_; - PKTIN_D9 clientinfo_; - bool paused_; - VersionDetailStruct versiondetail_; - // hidden: - Client( const Client& x ); - Client& operator=( const Client& x ); -}; - -inline bool Client::have_queued_data() const -{ - return (first_xmit_buffer != NULL); -} - -#endif Deleted: trunk/pol-core/pol/clientio.cpp =================================================================== --- trunk/pol-core/pol/clientio.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/clientio.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -1,310 +0,0 @@ -/* -History -======= - -Notes -======= - -*/ - -#include "clib/stl_inc.h" - -#include "ctable.h" -#include "uvars.h" -#include "ucrypto.h" -#include "sockio.h" - -#define OPT_LOG_CLIENT_DATA 0 - -#include "config.h" - -#include "clib/logfile.h" -#include "clib/fdump.h" -#include "clib/passert.h" - -#include "client.h" -#include "iostats.h" -#include "packethooks.h" -#include "polsig.h" -#include "polstats.h" -#include "ucfg.h" - -string Client::ipaddrAsString() const -{ - return AddressToString( const_cast<struct sockaddr*>(&ipaddr) ); -} - -void Client::recv_remaining( int total_expected) -{ - int count; - int max_expected = total_expected - bytes_received; - - count=recv(csocket, - (char *) encrypted_data, // &client->buffer[ client->bytes_received ] - max_expected, 0); - - if (count > 0) - { - passert( count <= max_expected ); - -#if OPT_LOG_CLIENT_DATA - if (logfile) - { - fprintf( logfile, "Client ciphertext: \n" ); - fdump( logfile, encrypted_data, count ); - } -#endif - - cryptengine->Decrypt( encrypted_data, &buffer[ bytes_received ], count ); - -#if OPT_LOG_CLIENT_DATA - if (logfile) - { - fprintf( logfile, "Client plaintext: \n" ); - fdump( logfile, &buffer[ bytes_received ], count ); - } -#endif - - bytes_received += count; - counters.bytes_received += count; - polstats.bytes_received += count; - } - else if (count == 0) // graceful close - { - disconnect = true; - } - else - { - int errn = socket_errno; - if (errn != SOCKET_ERRNO( EWOULDBLOCK )) - disconnect = true; - } -} - -void Client::recv_remaining_nocrypt( int total_expected) -{ - int count; - - count=recv(csocket, - (char *) &buffer[ bytes_received ], - total_expected - bytes_received, 0); - - if (count > 0) - { - bytes_received += count; - counters.bytes_received += count; - polstats.bytes_received += count; - } - else if (count == 0) // graceful close - { - disconnect = true; - } - else - { - int errn = socket_errno; - if (errn != SOCKET_ERRNO( EWOULDBLOCK )) - disconnect = true; - } -} - -void svr_decrypt( unsigned char *dst, int *lenout, - const unsigned char *src, int lenin ) -{ - unsigned short cmpval; - unsigned char inmask; - int bitcount; - - bitcount = 0; - *lenout = 0; - cmpval = 0; - while (lenin) - { - inmask = 0x80; - while (inmask) - { - cmpval <<= 1; - - if (*src & inmask) - cmpval |= 1; - - inmask >>= 1; - - bitcount += 1; - - for( unsigned char i = 0; i <= 256; i++ ) - { - if (bitcount == keydesc[ i ].nbits) - { - if (keydesc[i].bits == cmpval) - { - if (i == 0x0100) return; - *dst = i; - dst++; - *lenout = *lenout + 1; - bitcount = 0; - cmpval = 0; - break; // FIXME - } - } - } - } - src++; - lenin--; - } -} - -unsigned char xoutbuffer[ 64000 ]; - - - -/* NOTE: If this changes, code in client.cpp must change - pause() and restart() use - pre-encrypted values of 33 00 and 33 01. -*/ -void Client::transmit_encrypted( const void *data, int len ) -{ - THREAD_CHECKPOINT( active_client, 100 ); - const unsigned char *cdata = (const unsigned char *) data; - unsigned char *pch; - int i; - int bidx; // Offset in output byte - - pch = xoutbuffer; - bidx=0; - THREAD_CHECKPOINT( active_client, 101 ); - for (i=0; i < len; i++) - { - THREAD_CHECKPOINT( active_client, 102 ); - unsigned char ch = cdata[i]; - int nbits = keydesc[ ch ].nbits; - unsigned short inval = keydesc[ ch ].bits_reversed; - - THREAD_CHECKPOINT( active_client, 103 ); - - while (nbits--) - { - THREAD_CHECKPOINT( active_client, 104 ); - *pch <<= 1; - if (inval & 1) *pch |= 1; - bidx++; - if (bidx == 8) - { - THREAD_CHECKPOINT( active_client, 105 ); - pch++; - bidx = 0; - } - THREAD_CHECKPOINT( active_client, 106 ); - - inval >>= 1; - } - THREAD_CHECKPOINT( active_client, 107 ); - - } - THREAD_CHECKPOINT( active_client, 108 ); - do { - int nbits = keydesc[ 0x100 ].nbits; - unsigned short inval = keydesc[ 0x100 ].bits_reversed; - - THREAD_CHECKPOINT( active_client, 109 ); - - while (nbits--) - { - THREAD_CHECKPOINT( active_client, 110 ); - *pch <<= 1; - if (inval & 1) *pch |= 1; - bidx++; - THREAD_CHECKPOINT( active_client, 111 ); - if (bidx == 8) - { - pch++; - bidx = 0; - } - THREAD_CHECKPOINT( active_client, 112 ); - - inval >>= 1; - } - } while (0); - THREAD_CHECKPOINT( active_client, 113 ); - - if (bidx==0) - { - pch--; - } - else - { - *pch <<= (8-bidx); - } - THREAD_CHECKPOINT( active_client, 114 ); - - passert( pch-xoutbuffer+1 <= int(sizeof xoutbuffer) ); - THREAD_CHECKPOINT( active_client, 115 ); - xmit( xoutbuffer, pch-xoutbuffer+1 ); - THREAD_CHECKPOINT( active_client, 116 ); -} -#include "packetscrobj.h" -void Client::transmit( const void *data, int len ) -{ - ref_ptr<BPacket> p; - bool handled = false; - //see if the outgoing packet has a SendFunction installed. If so call it. It may or may not - //want us to continue sending the packet. If it does, handled will be false, and data, len, and p - //will be altered. data has the new packet data to send, len the new length, and p, a ref counted - //pointer to the packet object. - // - //If there is no outgoing packet script, handled will be false, and the passed params will be unchanged. - CallOutgoingPacketExportedFunction(this, data, len, p, handled); - if(handled) - return; - - unsigned char msgtype = * (const char*) data; - - if (fpLog != NULL) - { - fprintf( fpLog, "Server -> Client: 0x%X, %d bytes\n", msgtype, len ); - fdump( fpLog, data, len ); - fprintf( fpLog, "\n" ); - } - - if (last_xmit_buffer) - { - queuedmode_iostats.sent[ msgtype ].count++; - queuedmode_iostats.sent[ msgtype ].bytes += len; - } - iostats.sent[ msgtype ].count++; - iostats.sent[ msgtype ].bytes += len; - - if (encrypt_server_stream) - { - pause(); - transmit_encrypted( data, len ); - } - else - { - xmit( data, len ); - // _xmit( client->csocket, data, len ); - } -} - -void Client::transmitmore( const void *data, int len ) -{ - if (fpLog != NULL) - { - fprintf( fpLog, "Server -> Client (%d bytes)\n", len ); - fdump( fpLog, data, len ); - } - - if (encrypt_server_stream) - { - pause(); - transmit_encrypted( data, len ); - } - else - { - xmit( data, len ); - // _xmit( client->csocket, data, len ); - } -} - -void transmit( Client* client, const void *data, int len ) -{ - client->transmit( data, len ); -} Deleted: trunk/pol-core/pol/cliface.cpp =================================================================== --- trunk/pol-core/pol/cliface.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/cliface.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -1,262 +0,0 @@ -/* -History -======= -2009/07/23 MuadDib: updates for new Enum::Packet Out ID - -Notes -======= - -*/ - -#include "clib/stl_inc.h" -#include "clib/endian.h" - -#include "mobile/attribute.h" -#include "mobile/charactr.h" -#include "client.h" -#include "cliface.h" -#include "party.h" -#include "pktboth.h" -#include "ssopt.h" -#include "statmsg.h" -#include "ufunc.h" -#include "uoclient.h" -#include "uoskills.h" -#include "vital.h" - -UOClientInterface uo_client_interface; - -void initialize_client_interfaces() -{ - uo_client_interface.Initialize(); -} - -ClientVitalUpdaters::ClientVitalUpdaters() : - my_vital_changed(NULL), - others_vital_changed(NULL) -{ -} - -ClientAttributeUpdaters::ClientAttributeUpdaters() : - my_attr_changed(NULL) -{ -} - -void ClientInterface::register_client( Client* client ) -{ - clients.push_back( client ); -} -void ClientInterface::deregister_client( Client* client ) -{ - for( unsigned i = 0; i < clients.size(); ++i ) - { - if (clients[i] == client) - { - clients[i] = clients.back(); - clients.pop_back(); - break; - } - } -} - -// static -void ClientInterface::tell_vital_changed( Character* who, const Vital* vital ) -{ - Client* client = who->client; - if (client && client->ready) - { - const ClientVitalUpdaters& cvu = client->Interface.vital_updaters[ vital->vitalid ]; - if (cvu.my_vital_changed) - cvu.my_vital_changed(client,who,vital); - } - - // on all the client interfaces, for their connected clients, possibly tell them - uo_client_interface.bcast_vital_changed( who, vital ); -} -void ClientInterface::tell_attribute_changed( Character* who, const Attribute* attr ) -{ - Client* client = who->client; - if (client && client->ready) - { - const ClientAttributeUpdaters& cau = client->Interface.attribute_updaters[ attr->attrid ]; - if (cau.my_attr_changed) - cau.my_attr_changed(client,who,attr); - } -} - - -void send_uo_hits( Client* client, Character* me, const Vital* vital ) -{ - PKTOUT_A1 msg; - msg.msgtype = PKTOUT_A1_ID; - msg.serial = me->serial_ext; - - long v = me->vital( vital->vitalid ).current_ones(); - if (v > 0xFFFF) - v = 0xFFFF; - msg.hits = ctBEu16( static_cast<u16>(v) ); - - v = me->vital( vital->vitalid ).maximum_ones(); - if (v > 0xFFFF) - v = 0xFFFF; - msg.max_hits = ctBEu16( static_cast<u16>(v) ); - - client->transmit( &msg, sizeof msg ); - -} - -void send_uo_mana( Client* client, Character* me, const Vital* vital ) -{ - PKTOUT_A2 msg; - msg.msgtype = PKTOUT_A2_ID; - msg.serial = me->serial_ext; - - long v = me->vital( vital->vitalid ).current_ones(); - if (v > 0xFFFF) - v = 0xFFFF; - msg.mana = ctBEu16( static_cast<u16>(v) ); - - v = me->vital( vital->vitalid ).maximum_ones(); - if (v > 0xFFFF) - v = 0xFFFF; - msg.max_mana = ctBEu16( static_cast<u16>(v) ); - - client->transmit( &msg, sizeof msg ); - - if (me->party() != NULL) - me->party()->on_mana_changed(me); - -} - -void send_uo_stamina( Client* client, Character* me, const Vital* vital ) -{ - PKTOUT_A3 msg; - msg.msgtype = PKTOUT_A3_ID; - msg.serial = me->serial_ext; - - long v = me->vital( vital->vitalid ).current_ones(); - if (v > 0xFFFF) - v = 0xFFFF; - msg.stamina = ctBEu16( static_cast<u16>(v) ); - - v = me->vital( vital->vitalid ).maximum_ones(); - if (v > 0xFFFF) - v = 0xFFFF; - msg.max_stamina = ctBEu16( static_cast<u16>(v) ); - - client->transmit( &msg, sizeof msg ); - - if (me->party()!=NULL) - me->party()->on_stam_changed(me); -} -void send_uo_strength( Client* client, Character* me, const Attribute* attr ) -{ - send_full_statmsg( client, me ); -} -void send_uo_dexterity( Client* client, Character* me, const Attribute* attr ) -{ - send_full_statmsg( client, me ); -} -void send_uo_intelligence( Client* client, Character* me, const Attribute* attr ) -{ - send_full_statmsg( client, me ); -} -void send_uo_skill( Client* client, Character* me, const Attribute* attr ) -{ - ClientAttributeUpdaters& cau = client->Interface.attribute_updaters[ attr->attrid ]; - - if (!ssopt.core_sends_caps) { - PKTBI_3A_VALUES msg; - unsigned short msglen = offsetof(PKTBI_3A_VALUES,skills) + - sizeof(msg.skills[0]); - - msg.msgtype = PKTBI_3A_VALUES_ID; - msg.msglen = ctBEu16( msglen ); - msg.unk3 = PKTBI_3A_VALUES::SINGLE_SKILL; - msg.skills[0].skillid = ctBEu16(cau.pUOSkill->skillid); // er, no conversion here. !! - const AttributeValue& av = me->attribute(attr->attrid); - msg.skills[0].value = ctBEu16( static_cast<u16>(av.effective_tenths()) ); - msg.skills[0].value_unmod = ctBEu16( static_cast<u16>(av.base()) ); // base is always in tenths... - msg.skills[0].lock_mode = (u8)av.lock();//PKTBI_3A_VALUES::LOCK_NONE; - client->transmit( &msg, msglen ); - } else { - PKTBI_3A_CAPS msg; - unsigned short msglen = offsetof(PKTBI_3A_VALUES,skills) + - sizeof(msg.skills[0]); - - msg.msgtype = PKTBI_3A_VALUES_ID; - msg.msglen = ctBEu16( msglen ); - msg.unk3 = PKTBI_3A_VALUES::SINGLE_SKILL_CAP; - msg.skills[0].skillid = ctBEu16(cau.pUOSkill->skillid); // er, no conversion here. !! - const AttributeValue& av = me->attribute(attr->attrid); - msg.skills[0].value = ctBEu16( static_cast<u16>(av.effective_tenths()) ); - msg.skills[0].value_unmod = ctBEu16( static_cast<u16>(av.base()) ); // base is always in tenths... - msg.skills[0].lock_mode = (u8)av.lock();//PKTBI_3A_VALUES::LOCK_NONE; - msg.skills[0].cap = ctBEu16( static_cast<u16>(av.cap()) ); - client->transmit( &msg, msglen ); - } -} -void ClientInterface::Initialize() -{ - vital_updaters.resize( vitals.size() ); - attribute_updaters.resize( attributes.size() ); -} - -void UOClientInterface::Initialize() -{ - ClientInterface::Initialize(); - - // tell a player's own client when his life changes - if (uoclient_general.hits.any) - { - vital_updaters[ uoclient_general.hits.id ].my_vital_changed = send_uo_hits; - vital_updaters[ uoclient_general.hits.id ].others_vital_changed = send_uo_hits; - } - if (uoclient_general.mana.any) - { - vital_updaters[ uoclient_general.mana.id ].my_vital_changed = send_uo_mana; - } - if (uoclient_general.stamina.any) - { - vital_updaters[ uoclient_general.stamina.id ].my_vital_changed = send_uo_stamina; - } - - if (uoclient_general.strength.any) - { - attribute_updaters[ uoclient_general.strength.id ].my_attr_changed = send_uo_strength; - } - if (uoclient_general.intelligence.any) - { - attribute_updaters[ uoclient_general.intelligence.id ].my_attr_changed = send_uo_intelligence; - } - if (uoclient_general.dexterity.any) - { - attribute_updaters[ uoclient_general.dexterity.id ].my_attr_changed = send_uo_dexterity; - } - - for( unsigned i = 0; i < uoclient_general.maxskills+1; ++i ) - { - const UOSkill& uoskill = GetUOSkill( i ); - if (uoskill.inited && uoskill.pAttr) - { - attribute_updaters[ uoskill.pAttr->attrid ].my_attr_changed = send_uo_skill; - attribute_updaters[ uoskill.pAttr->attrid ].pUOSkill = &uoskill; - } - } -} - -void UOClientInterface::bcast_vital_changed( Character* who, const Vital* vital ) const -{ - const ClientVitalUpdaters& cvu = vital_updaters[ vital->vitalid ]; - if (cvu.others_vital_changed != NULL) - { - for( unsigned i = 0; i < clients.size(); ++i ) - { - Client* client = clients[i]; - if (client->ready && inrange(who, client->chr)) - { - cvu.others_vital_changed(client,who,vital); - } - } - } -} Deleted: trunk/pol-core/pol/cliface.h =================================================================== --- trunk/pol-core/pol/cliface.h 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/cliface.h 2009-09-07 20:37:38 UTC (rev 33) @@ -1,77 +0,0 @@ -/* -History -======= - - -Notes -======= - -*/ - -#ifndef CLIFACE_H -#define CLIFACE_H - -#include <vector> - -class Attribute; -class Client; -class Character; -class Vital; -class UOSkill; - -struct ClientVitalUpdaters -{ -public: - ClientVitalUpdaters(); - - void (*my_vital_changed)(Client* client, Character* me, const Vital* vital); - void (*others_vital_changed)(Client* client, Character* him, const Vital* vital); -}; - -struct ClientAttributeUpdaters -{ -public: - ClientAttributeUpdaters(); - - void (*my_attr_changed)(Client* client, Character* me, const Attribute* attr); - - const UOSkill* pUOSkill; -}; - -class ClientInterface -{ -public: - virtual ~ClientInterface() {} - - void register_client( Client* client ); - void deregister_client( Client* client ); - - static void tell_vital_changed( Character* who, const Vital* vital ); - static void tell_attribute_changed( Character* who, const Attribute* attr ); - -protected: - virtual void Initialize(); - - virtual void bcast_vital_changed( Character* who, const Vital* vital ) const = 0; - - std::vector<ClientVitalUpdaters> vital_updaters; - std::vector<ClientAttributeUpdaters> attribute_updaters; - - std::vector<Client*> clients; - - friend void send_uo_skill( Client* client, Character* me, const Attribute* attr ); - -}; - -class UOClientInterface : public ClientInterface -{ -public: - void Initialize(); - -protected: - friend class ClientInterface; - virtual void bcast_vital_changed( Character* who, const Vital* vital ) const; -}; -extern UOClientInterface uo_client_interface; - -#endif Modified: trunk/pol-core/pol/containr.cpp =================================================================== --- trunk/pol-core/pol/containr.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/containr.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -30,7 +30,7 @@ #include "clib/random.h" #include "clib/stlutil.h" -#include "client.h" +#include "network/client.h" #include "mobile/charactr.h" #include "core.h" #include "equipmnt.h" Modified: trunk/pol-core/pol/core.cpp =================================================================== --- trunk/pol-core/pol/core.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/core.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -13,8 +13,8 @@ #include "plib/realm.h" #include "mobile/charactr.h" -#include "cgdata.h" -#include "client.h" +#include "network/cgdata.h" +#include "network/client.h" #include "core.h" #include "itemdesc.h" #include "polsem.h" Modified: trunk/pol-core/pol/create.cpp =================================================================== --- trunk/pol-core/pol/create.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/create.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -30,7 +30,7 @@ #include "mobile/attribute.h" #include "mobile/charactr.h" #include "clidata.h" -#include "client.h" +#include "network/client.h" #include "gameclck.h" #include "layers.h" #include "mkscrobj.h" Modified: trunk/pol-core/pol/dblclick.cpp =================================================================== --- trunk/pol-core/pol/dblclick.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/dblclick.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -25,7 +25,7 @@ #include "plib/realm.h" -#include "client.h" +#include "network/client.h" #include "eventid.h" #include "itemdesc.h" #include "msghandl.h" Modified: trunk/pol-core/pol/door.cpp =================================================================== --- trunk/pol-core/pol/door.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/door.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -16,7 +16,7 @@ #include "clib/endian.h" #include "clib/passert.h" -#include "client.h" +#include "network/client.h" #include "door.h" #include "itemdesc.h" #include "objtype.h" Modified: trunk/pol-core/pol/dropitem.cpp =================================================================== --- trunk/pol-core/pol/dropitem.cpp 2009-09-07 18:27:08 UTC (rev 32) +++ trunk/pol-core/pol/dropitem.cpp 2009-09-07 20:37:38 UTC (rev 33) @@ -40,7 +40,7 @@ #include "multi/boat.h" #include "mobile/charactr.h" -#include "client.h" +#include "network/client.h" #include "dtrace.h" #include "getitem.h" #incl... [truncated message content] |
From: <mua...@us...> - 2009-09-08 01:42:39
|
Revision: 34 http://polserver.svn.sourceforge.net/polserver/?rev=34&view=rev Author: muaddib_pol Date: 2009-09-08 01:42:26 +0000 (Tue, 08 Sep 2009) Log Message: ----------- + Partial Network and Item code moved Modified Paths: -------------- trunk/pol-core/makefile.gcc trunk/pol-core/plib/realmfunc.cpp trunk/pol-core/plib/realmlos.cpp trunk/pol-core/plib/testenv.cpp trunk/pol-core/plib/testlos1.cpp trunk/pol-core/pol/containr.cpp trunk/pol-core/pol/core.cpp trunk/pol-core/pol/dblclick.cpp trunk/pol-core/pol/decay.cpp trunk/pol-core/pol/door.cpp trunk/pol-core/pol/dye.h trunk/pol-core/pol/equipdsc.h trunk/pol-core/pol/fnsearch.cpp trunk/pol-core/pol/getmsg.cpp trunk/pol-core/pol/loaddata.cpp trunk/pol-core/pol/loadunld.cpp trunk/pol-core/pol/lockable.h trunk/pol-core/pol/los.cpp trunk/pol-core/pol/mobile/charactr.cpp trunk/pol-core/pol/mobile/chrituse.cpp trunk/pol-core/pol/module/boatmod.cpp trunk/pol-core/pol/module/npcmod.cpp trunk/pol-core/pol/module/polsystemmod.cpp trunk/pol-core/pol/module/uomod.cpp trunk/pol-core/pol/module/uomod2.cpp trunk/pol-core/pol/multi/boat.cpp trunk/pol-core/pol/multi/house.cpp trunk/pol-core/pol/multi/multi.h trunk/pol-core/pol/multi/multicr.cpp trunk/pol-core/pol/multi/multidef.cpp trunk/pol-core/pol/multi/multidef2.cpp trunk/pol-core/pol/multi/multis.cpp trunk/pol-core/pol/npc.cpp trunk/pol-core/pol/npctmpl.cpp trunk/pol-core/pol/pol-2008.vcproj trunk/pol-core/pol/pol.cpp trunk/pol-core/pol/polfile1.cpp trunk/pol-core/pol/poltest.cpp trunk/pol-core/pol/readcfg.cpp trunk/pol-core/pol/reftypes.cpp trunk/pol-core/pol/resource.cpp trunk/pol-core/pol/savedata.cpp trunk/pol-core/pol/spelbook.cpp trunk/pol-core/pol/spelbook.h trunk/pol-core/pol/spells.cpp trunk/pol-core/pol/storage.cpp trunk/pol-core/pol/target.cpp trunk/pol-core/pol/textcmd.cpp trunk/pol-core/pol/tooltips.cpp trunk/pol-core/pol/ufunc.cpp trunk/pol-core/pol/uimport.cpp trunk/pol-core/pol/umap.cpp trunk/pol-core/pol/umap.h trunk/pol-core/pol/uobject.cpp trunk/pol-core/pol/uoexhelp.cpp trunk/pol-core/pol/uofile03.cpp trunk/pol-core/pol/uoscrobj.cpp trunk/pol-core/pol/uoscrobj.h trunk/pol-core/pol/uvars.cpp trunk/pol-core/pol/uworld.cpp Added Paths: ----------- trunk/pol-core/pol/item/ trunk/pol-core/pol/item/armor.cpp trunk/pol-core/pol/item/armor.h trunk/pol-core/pol/item/armrtmpl.h trunk/pol-core/pol/item/equipmnt.cpp trunk/pol-core/pol/item/equipmnt.h trunk/pol-core/pol/item/item.cpp trunk/pol-core/pol/item/item.h trunk/pol-core/pol/item/item00.cpp trunk/pol-core/pol/item/itemcr.cpp trunk/pol-core/pol/item/itemdesc.cpp trunk/pol-core/pol/item/itemdesc.h trunk/pol-core/pol/item/weapon.cpp trunk/pol-core/pol/item/weapon.h trunk/pol-core/pol/item/wepntmpl.h trunk/pol-core/pol/network/auxclient.cpp Removed Paths: ------------- trunk/pol-core/pol/armor.cpp trunk/pol-core/pol/armor.h trunk/pol-core/pol/armrtmpl.h trunk/pol-core/pol/auxclient.cpp trunk/pol-core/pol/equipmnt.cpp trunk/pol-core/pol/equipmnt.h trunk/pol-core/pol/item.cpp trunk/pol-core/pol/item.h trunk/pol-core/pol/item00.cpp trunk/pol-core/pol/itemcr.cpp trunk/pol-core/pol/itemdesc.cpp trunk/pol-core/pol/itemdesc.h trunk/pol-core/pol/weapon.cpp trunk/pol-core/pol/weapon.h trunk/pol-core/pol/wepntmpl.h Modified: trunk/pol-core/makefile.gcc =================================================================== --- trunk/pol-core/makefile.gcc 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/makefile.gcc 2009-09-08 01:42:26 UTC (rev 34) @@ -49,8 +49,8 @@ cpp_sources = \ clib/progver.cpp plib/polver.cpp \ pol/accounts/account.cpp pol/accounts/accounts.cpp pol/accounts/acscrobj.cpp pol/allocd.cpp \ - pol/armor.cpp pol/mobile/attack.cpp \ - pol/mobile/attribute.cpp pol/auxclient.cpp \ + pol/item/armor.cpp pol/mobile/attack.cpp \ + pol/mobile/attribute.cpp pol/network/auxclient.cpp \ pol/network/bannedips.cpp pol/binaryfilescrobj.cpp pol/multi/boat.cpp pol/multi/boatcomp.cpp \ pol/module/boatmod.cpp pol/mobile/boundbox.cpp pol/bowsalut.cpp \ pol/module/cfgmod.cpp pol/cfgrepos.cpp pol/network/cgdata.cpp pol/mobile/charactr.cpp \ @@ -67,7 +67,7 @@ pol/module/datastore.cpp pol/dblclick.cpp pol/decay.cpp pol/dice.cpp \ pol/door.cpp pol/dropitem.cpp \ pol/dye.cpp \ - pol/eqpitem.cpp pol/equipdsc.cpp pol/equipmnt.cpp clib/esignal.cpp \ + pol/eqpitem.cpp pol/equipdsc.cpp pol/item/equipmnt.cpp clib/esignal.cpp \ pol/exscrobj.cpp \ pol/extcmd.cpp \ pol/module/filemod.cpp pol/fnsearch.cpp \ @@ -76,8 +76,8 @@ pol/module/guildmod.cpp \ pol/module/basiciomod.cpp pol/module/basicmod.cpp \ pol/help.cpp pol/multi/house.cpp \ - pol/network/iostats.cpp pol/irequest.cpp pol/item.cpp pol/item00.cpp \ - pol/itemcr.cpp pol/itemdesc.cpp \ + pol/network/iostats.cpp pol/irequest.cpp pol/item/item.cpp pol/item/item00.cpp \ + pol/item/itemcr.cpp pol/item/itemdesc.cpp \ pol/landtile.cpp \ pol/listenpt.cpp pol/loadunld.cpp pol/lockable.cpp pol/logfiles.cpp \ pol/loaddata.cpp pol/login.cpp \ @@ -119,7 +119,7 @@ pol/module/utilmod.cpp pol/module/sqlmod.cpp \ pol/uvars.cpp pol/uworld.cpp \ pol/vital.cpp \ - pol/weapon.cpp \ + pol/item/weapon.cpp \ pol/zone.cpp \ pol/module/attributemod.cpp pol/module/clmod.cpp pol/clfunc.cpp pol/module/storagemod.cpp pol/module/vitalmod.cpp \ plib/mapfunc.cpp plib/mapserver.cpp plib/pkg.cpp plib/realm.cpp \ Modified: trunk/pol-core/plib/realmfunc.cpp =================================================================== --- trunk/pol-core/plib/realmfunc.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/plib/realmfunc.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -32,9 +32,9 @@ #include "../pol/ssopt.h" #include "../pol/uvars.h" #include "../pol/uworld.h" -#include "../pol/item.h" -#include "../pol/itemdesc.h" -#include "../pol/itemdesc.h" +#include "../pol/item/item.h" +#include "../pol/item/itemdesc.h" +#include "../pol/item/itemdesc.h" #include "../pol/multi/multi.h" #include "../pol/multi/house.h" #include "../pol/uconst.h" Modified: trunk/pol-core/plib/realmlos.cpp =================================================================== --- trunk/pol-core/plib/realmlos.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/plib/realmlos.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -16,7 +16,7 @@ #include "mapshape.h" #include "pol/uworld.h" // TODO move 'world' into Realm -#include "pol/item.h" +#include "pol/item/item.h" #include "pol/udatfile.h" #include "pol/los.h" Modified: trunk/pol-core/plib/testenv.cpp =================================================================== --- trunk/pol-core/plib/testenv.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/plib/testenv.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -17,8 +17,8 @@ #include "clib/passert.h" #include "plib/realm.h" -#include "pol/item.h" -#include "pol/itemdesc.h" +#include "pol/item/item.h" +#include "pol/item/itemdesc.h" #include "pol/multi/multi.h" #include "pol/npc.h" #include "pol/objecthash.h" Modified: trunk/pol-core/plib/testlos1.cpp =================================================================== --- trunk/pol-core/plib/testlos1.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/plib/testlos1.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -12,7 +12,7 @@ #include "pol/uobject.h" #include "pol/los.h" #include "pol/npc.h" -#include "pol/item.h" +#include "pol/item/item.h" #include "realm.h" #include "mapserver.h" Deleted: trunk/pol-core/pol/armor.cpp =================================================================== --- trunk/pol-core/pol/armor.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/armor.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -1,164 +0,0 @@ -/* -History -======= - 2003/07/10 Dave: armordesc expects string zone names - -Notes -======= - -*/ - -#include "clib/stl_inc.h" - -#ifdef _MSC_VER -#pragma warning( disable: 4786 ) -#endif - -#include "bscript/bstruct.h" -#include "bscript/impstr.h" - -#include "clib/cfgelem.h" -#include "clib/cistring.h" -#include "clib/endian.h" -#include "plib/pkg.h" - -#include "armor.h" -#include "tiles.h" -#include "clidata.h" -#include "itemdesc.h" -#include "layers.h" -#include "ufunc.h" - - - -unsigned short layer_to_zone( unsigned short layer ); -unsigned short zone_name_to_zone( const char *zname ); - -ArmorDesc::ArmorDesc( u16 objtype, ConfigElem& elem, const Package* pkg ) : - EquipDesc( objtype, elem, ARMORDESC, pkg ), - ar( elem.remove_ushort( "AR" ) ), - zones(), - on_hit_script( elem.remove_string( "ONHITSCRIPT", "" ), pkg, "scripts/items/" ) -{ - string coverage; - while ( elem.remove_prop("COVERAGE", &coverage) ) - { - try - { - zones.insert(zone_name_to_zone(coverage.c_str())); - } - catch ( runtime_error err ) - { - cerr << "Error in ObjType 0x" << hex << objtype << ". Package " << pkg->name() <<"." << endl; - throw err; - } - } - - if (zones.empty()) - { - // No 'COVERAGE' entries existed. - // default coverage based on object type/layer - unsigned short layer = tile[graphic].layer; - // special case for shields - they effectively have no coverage. - if (layer != LAYER_HAND1 && layer != LAYER_HAND2) - { - try - { - zones.insert(layer_to_zone(layer)); - } - catch( runtime_error err ) - { - cerr << "Error in ObjType 0x" << hex << objtype << ". Package " << pkg->name() <<"." << endl; - throw err; - } - } - } -} - -const char* zone_to_zone_name( unsigned short zone ); -void ArmorDesc::PopulateStruct( BStruct* descriptor ) const -{ - base::PopulateStruct( descriptor ); - descriptor->addMember( "OnHitScript", new String(on_hit_script.relativename(pkg)) ); - descriptor->addMember( "AR", new BLong(ar) ); - - ObjArray* arr_zones = new ObjArray(); - std::set<unsigned int>::const_iterator itr; - for(itr = zones.begin(); itr != zones.end(); ++itr) - arr_zones->addElement( new String( zone_to_zone_name(*itr) ) ); - - - if(arr_zones->ref_arr.size() > 0) - descriptor->addMember( "Coverage", arr_zones ); - else - delete arr_zones; -} - -UArmor::UArmor( const ArmorDesc& descriptor, const ArmorDesc* permanent_descriptor ) : - Equipment( descriptor, CLASS_ARMOR ), - tmpl( permanent_descriptor ), - ar_mod_(0), - onhitscript_( descriptor.on_hit_script ) -{ -} - -unsigned short UArmor::ar() const -{ - long ar = tmpl->ar * hp_ / maxhp(); - if (ar_mod_ != 0) - { - ar += ar_mod_; - } - - if (ar < 0) - return 0; - else if (ar <= USHRT_MAX) - return static_cast<unsigned short>(ar); - else - return USHRT_MAX; -} - -bool UArmor::covers( unsigned layer ) const -{ - return tmpl->zones.find( layer ) != tmpl->zones.end(); -} - -Item* UArmor::clone() const -{ - UArmor* armor = static_cast<UArmor*>(base::clone()); - armor->ar_mod_ = ar_mod_; - armor->onhitscript_ = onhitscript_; - armor->tmpl = tmpl; - return armor; -} - -void UArmor::printProperties( ostream& os ) const -{ - base::printProperties( os ); - if (ar_mod_) - os << "\tAR_mod\t" << ar_mod_ << pf_endl; - if (! (onhitscript_ == tmpl->on_hit_script) ) - os << "\tOnHitScript\t" << onhitscript_.relativename( tmpl->pkg ) << pf_endl; -} - -void UArmor::readProperties( ConfigElem& elem ) -{ - base::readProperties( elem ); - ar_mod_ = static_cast<short>(elem.remove_int( "AR_MOD", 0 )); - set_onhitscript( elem.remove_string( "ONHITSCRIPT", "" ) ); -} - -void UArmor::set_onhitscript( const string& scriptname ) -{ - if (scriptname.empty()) - { - onhitscript_.clear(); - } - else - { - onhitscript_.config( scriptname, - itemdesc().pkg, - "scripts/items/", - true ); - } -} Deleted: trunk/pol-core/pol/armor.h =================================================================== --- trunk/pol-core/pol/armor.h 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/armor.h 2009-09-08 01:42:26 UTC (rev 34) @@ -1,65 +0,0 @@ -/* -History -======= - - -Notes -======= - -*/ - -#ifndef ARMOR_H -#define ARMOR_H - -#include <iosfwd> - -#include "equipmnt.h" -#include "item.h" -#include "scrdef.h" -#include "armrtmpl.h" - - -class ArmorDesc; - -class UArmor : public Equipment -{ - typedef Equipment base; -public: - virtual unsigned short ar() const; - virtual bool covers( unsigned layer ) const; - virtual Item* clone() const; - void set_onhitscript( const string& scriptname ); - std::set<unsigned> tmplzones(); - -protected: - virtual void printProperties( std::ostream& os ) const; - virtual void readProperties( ConfigElem& elem ); - virtual BObjectImp* get_script_member( const char *membername ) const; - virtual BObjectImp* get_script_member_id( const int id ) const; ///id test - virtual BObjectImp* set_script_member( const char *membername, const std::string& value ); - virtual BObjectImp* set_script_member( const char *membername, long value ); - virtual BObjectImp* set_script_member_id( const int id, const std::string& value ); //id test - virtual BObjectImp* set_script_member_id( const int id, long value );//id test - virtual bool script_isa( unsigned isatype ) const; - - UArmor( const ArmorDesc& descriptor, const ArmorDesc* permanent_descriptor ); - friend class Item; - //friend void load_data(); - - const ArmorDesc& descriptor() const; - const ScriptDef& onhitscript() const; - - -private: - const ArmorDesc* tmpl; - short ar_mod_; - - ScriptDef onhitscript_; -}; - -inline std::set<unsigned> UArmor::tmplzones() { return tmpl->zones; } - -void load_armor_templates(); -void unload_armor_templates(); - -#endif Deleted: trunk/pol-core/pol/armrtmpl.h =================================================================== --- trunk/pol-core/pol/armrtmpl.h 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/armrtmpl.h 2009-09-08 01:42:26 UTC (rev 34) @@ -1,35 +0,0 @@ -/* -History -======= - - -Notes -======= - -*/ - -#ifndef ARMRTMPL_H -#define ARMRTMPL_H - -#include <string> -#include <set> - -#include "itemdesc.h" -#include "equipdsc.h" - -class ConfigElem; - -class ArmorDesc : public EquipDesc -{ -public: - //ArmorTemplate(); - typedef EquipDesc base; - ArmorDesc( u16 objtype, ConfigElem& elem, const Package* pkg ); - virtual void PopulateStruct( BStruct* descriptor ) const; - - unsigned short ar; - std::set<unsigned> zones; - ScriptDef on_hit_script; -}; - -#endif Deleted: trunk/pol-core/pol/auxclient.cpp =================================================================== --- trunk/pol-core/pol/auxclient.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/auxclient.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -1,338 +0,0 @@ -/* -History -======= -2005/11/26 Shinigami: changed "strcmp" into "stricmp" to suppress Script Errors - -Notes -======= - -*/ - -#include "clib/stl_inc.h" - -#include "bscript/bobject.h" -#include "bscript/berror.h" -#include "bscript/bstruct.h" -#include "bscript/impstr.h" - -#include "clib/cfgelem.h" -#include "clib/esignal.h" -#include "clib/sckutil.h" -#include "clib/socketsvc.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" -#include "clib/threadhelp.h" -#include "clib/weakptr.h" - -#include "plib/pkg.h" - -#include "core.h" -#include "polsem.h" -#include "scrdef.h" -#include "scrsched.h" -#include "sockets.h" -#include "module/uomod.h" -#include "uoexec.h" - -class AuxClientThread; - -class AuxConnection : public BObjectImp -{ -public: - AuxConnection( AuxClientThread* auxclientthread , string ip) : - BObjectImp( OTUnknown ), - _auxclientthread( auxclientthread ), - _ip( ip ) - {} - - virtual BObjectImp* copy() const; - virtual bool isTrue() const; - virtual std::string getStringRep() const; - virtual unsigned long sizeEstimate() const; - - virtual BObjectImp* call_method( const char* methodname, Executor& ex ); - virtual BObjectRef get_member( const char *membername ); - - void disconnect(); - -private: - AuxClientThread* _auxclientthread; - string _ip; -}; - -class AuxService -{ -public: - AuxService( const Package* pkg, ConfigElem& elem ); - void run(); - - const ScriptDef& scriptdef() const { return _scriptdef; } - std::vector<unsigned long> _aux_ip_match; - std::vector<unsigned long> _aux_ip_match_mask; -private: - const Package* _pkg; - ScriptDef _scriptdef; - unsigned short _port; -}; - -class AuxClientThread : public SocketClientThread -{ -public: - AuxClientThread( AuxService* auxsvc, SocketListener& listener ); - - virtual void run(); - void transmit( const BObjectImp* imp ); - BObjectImp* get_ip(); - -private: - bool init(); - bool ipAllowed(sockaddr MyPeer); - - AuxService* _auxservice; - ref_ptr<AuxConnection> _auxconnection; - weak_ptr<UOExecutor> _uoexec; -}; - -BObjectImp* AuxConnection::copy() const -{ - return const_cast<AuxConnection*>(this); -} - -std::string AuxConnection::getStringRep() const -{ - return "<AuxConnection>"; -} - -unsigned long AuxConnection::sizeEstimate() const -{ - return sizeof(AuxConnection); -} - -bool AuxConnection::isTrue() const -{ - return (_auxclientthread != NULL); -} - -BObjectRef AuxConnection::get_member( const char *membername ) -{ - if (stricmp( membername, "ip" ) == 0) - { - return BObjectRef(new String(_ip)); - } - return BObjectRef(UninitObject::create()); -} - -BObjectImp* AuxConnection::call_method( const char* methodname, Executor& ex ) -{ - if (stricmp( methodname, "transmit" ) == 0) - { - if (ex.numParams()==1) - { - if (_auxclientthread != NULL) - { - BObjectImp* value = ex.getParamImp(0); - // FIXME this can block! - _auxclientthread->transmit( value ); - } - else - { - return new BError( "Client has disconnected" ); - } - } - else - { - return new BError( "1 parameter expected" ); - } - } - return NULL; -} - -void AuxConnection::disconnect() -{ - _auxclientthread = NULL; -} - -AuxClientThread::AuxClientThread( AuxService* auxsvc, SocketListener& listener ) : - SocketClientThread(listener), - _auxservice(auxsvc), - _uoexec(0) -{ -} - -bool AuxClientThread::init() -{ - PolLock lock; - struct sockaddr ConnectingIP = _sck.peer_address(); - if (ipAllowed(ConnectingIP)) - { - _auxconnection.set( new AuxConnection( this, _sck.getpeername() ) ); - - UOExecutorModule* uoemod = start_script( _auxservice->scriptdef(), _auxconnection.get() ); - _uoexec = uoemod->uoexec.weakptr; - return true; - } - else - { - return false; - } -} - -bool AuxClientThread::ipAllowed(sockaddr MyPeer) -{ - if (_auxservice->_aux_ip_match.empty()) - { - return true; - } - for( unsigned j = 0; j < _auxservice->_aux_ip_match.size(); ++j ) - { - unsigned long addr1part, addr2part; - struct sockaddr_in* sockin = reinterpret_cast<struct sockaddr_in*>(&MyPeer); - - addr1part = _auxservice->_aux_ip_match[j] & _auxservice->_aux_ip_match_mask[j]; -#ifdef _WIN32 - addr2part = sockin->sin_addr.S_un.S_addr & _auxservice->_aux_ip_match_mask[j]; -#else - addr2part = sockin->sin_addr.s_addr & _auxservice->_aux_ip_match_mask[j]; -#endif - if (addr1part == addr2part) - return true; - } - return false; -} -void AuxClientThread::run() -{ - if(!init()) - { - if (_sck.connected()) - { - writeline( _sck, "Connection closed" ); - _sck.close(); - } - _auxconnection.clear(); - return; - } - - string tmp; - bool result,timeout_exit; - for(;;) - { - result=readline( _sck, tmp, &timeout_exit, 5 ); - if(!result && !timeout_exit) - break; - - PolLock lock; - - if (_uoexec.exists()) - { - if(result) - { - istringstream is(tmp); - BObjectImp* value = BObjectImp::unpack( is ); - - BStruct* event = new BStruct; - event->addMember( "type", new String( "recv" ) ); - event->addMember( "value", value ); - _uoexec->os_module->signal_event( event ); - } - } - else - { // the controlling script dropped its last reference to the connection, - // by exiting or otherwise. - break; - } - } - - PolLock lock; - _auxconnection->disconnect(); - // the auxconnection is probably referenced by another ref_ptr, - // so its deletion must be protected by the lock. - // Clear our reference: - _auxconnection.clear(); -} - -void AuxClientThread::transmit( const BObjectImp* value ) -{ - string tmp = value->pack(); - writeline( _sck, tmp ); -} - -AuxService::AuxService( const Package* pkg, ConfigElem& elem ) : - _pkg(pkg), - _scriptdef( elem.remove_string( "SCRIPT" ), _pkg ), - _port( elem.remove_ushort( "PORT" ) ) -{ - string iptext; - while (elem.remove_prop( "IPMATCH", &iptext )) - { - string::size_type delim = iptext.find_first_of( "/" ); - if (delim != string::npos) - { - string ipaddr_str = iptext.substr( 0, delim ); - string ipmask_str = iptext.substr( delim+1 ); - unsigned long ipaddr = inet_addr( ipaddr_str.c_str() ); - unsigned long ipmask = inet_addr( ipmask_str.c_str() ); - _aux_ip_match.push_back( ipaddr ); - _aux_ip_match_mask.push_back( ipmask ); - } - else - { - unsigned long ipaddr = inet_addr( iptext.c_str() ); - _aux_ip_match.push_back( ipaddr ); - _aux_ip_match_mask.push_back( 0xFFffFFffLu ); - } - } -} - -void AuxService::run() -{ - atomic_cout( "Starting Aux Listener (" + _scriptdef.relativename() + ", port " + decint(_port) + ")" ); - - SocketListener listener( _port ); - while (!exit_signalled) - { - if (listener.GetConnection( 5 )) - { - // Shinigami: Just 4 Debugging. We got Crashes here... - #ifdef PERGON - cerr << "Aux Listener (" << _scriptdef.relativename() << ", port " << decint(_port) << ") - create Thread" << endl; - #endif - SocketClientThread* clientthread = new AuxClientThread( this, listener ); - clientthread->start(); - // note SocketClientThread::start deletes the SocketClientThread upon thread exit. - } - } -} - - -typedef vector< AuxService* > AuxServices; -AuxServices auxservices; - -void aux_service_thread_stub( void* arg ) -{ - AuxService* as = reinterpret_cast<AuxService*>(arg); - as->run(); -} - -void start_aux_services() -{ - for( unsigned i = 0; i < auxservices.size(); ++i ) - { - threadhelp::start_thread( aux_service_thread_stub, "AuxService", auxservices[i] ); - } -} - -void load_auxservice_entry( const Package* pkg, ConfigElem& elem ) -{ - auxservices.push_back( new AuxService(pkg,elem) ); -} - -void load_aux_services() -{ - load_packaged_cfgs( "auxsvc.cfg", "AuxService", load_auxservice_entry ); -} - -void unload_aux_services() -{ - delete_all( auxservices ); -} - Modified: trunk/pol-core/pol/containr.cpp =================================================================== --- trunk/pol-core/pol/containr.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/containr.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -33,9 +33,9 @@ #include "network/client.h" #include "mobile/charactr.h" #include "core.h" -#include "equipmnt.h" +#include "item/equipmnt.h" #include "gflag.h" -#include "itemdesc.h" +#include "item/itemdesc.h" #include "multi/multi.h" #include "profile.h" #include "statmsg.h" Modified: trunk/pol-core/pol/core.cpp =================================================================== --- trunk/pol-core/pol/core.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/core.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -16,7 +16,7 @@ #include "network/cgdata.h" #include "network/client.h" #include "core.h" -#include "itemdesc.h" +#include "item/itemdesc.h" #include "polsem.h" #include "module/polsystemmod.h" #include "multi/multi.h" Modified: trunk/pol-core/pol/dblclick.cpp =================================================================== --- trunk/pol-core/pol/dblclick.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/dblclick.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -27,7 +27,7 @@ #include "network/client.h" #include "eventid.h" -#include "itemdesc.h" +#include "item/itemdesc.h" #include "msghandl.h" #include "mobile/charactr.h" #include "los.h" Modified: trunk/pol-core/pol/decay.cpp =================================================================== --- trunk/pol-core/pol/decay.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/decay.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -14,8 +14,8 @@ #include "plib/realm.h" #include "core.h" -#include "item.h" -#include "itemdesc.h" +#include "item/item.h" +#include "item/itemdesc.h" #include "gameclck.h" #include "polclock.h" #include "polsem.h" Modified: trunk/pol-core/pol/door.cpp =================================================================== --- trunk/pol-core/pol/door.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/door.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -18,7 +18,7 @@ #include "network/client.h" #include "door.h" -#include "itemdesc.h" +#include "item/itemdesc.h" #include "objtype.h" #include "ufunc.h" #include "uworld.h" Modified: trunk/pol-core/pol/dye.h =================================================================== --- trunk/pol-core/pol/dye.h 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/dye.h 2009-09-08 01:42:26 UTC (rev 34) @@ -14,7 +14,7 @@ /* #ifndef ITEM_H -#include "item.h" +#include "item/item.h" #endif #define UOBJ_DYES 0xFA9 Modified: trunk/pol-core/pol/equipdsc.h =================================================================== --- trunk/pol-core/pol/equipdsc.h 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/equipdsc.h 2009-09-08 01:42:26 UTC (rev 34) @@ -11,7 +11,7 @@ #ifndef EQUIPDSC_H #define EQUIPDSC_H -#include "itemdesc.h" +#include "item/itemdesc.h" class ConfigElem; class Package; Deleted: trunk/pol-core/pol/equipmnt.cpp =================================================================== --- trunk/pol-core/pol/equipmnt.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/equipmnt.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -1,86 +0,0 @@ -/* -History -======= -2007/03/28 Shinigami: added increv() to Equipment::reduce_hp_from_hit - -Notes -======= - -*/ - - -#include "clib/stl_inc.h" - -#include "clib/cfgelem.h" -#include "clib/random.h" - -#include "equipmnt.h" -#include "equipdsc.h" -#include "tooltips.h" -#include "mobile/charactr.h" - -Equipment::Equipment( const ItemDesc& itemdesc, UOBJ_CLASS uobj_class ) : - Item( itemdesc, uobj_class ), - eq_tmpl_(static_cast<const EquipDesc&>(find_itemdesc( objtype_ ))), // be sure to grab the permanent entry - quality_(1.0), - hp_( eq_tmpl_.maxhp), - maxhp_mod_(0) -{ -} - -Item* Equipment::clone() const -{ - Equipment* eq = static_cast<Equipment*>(base::clone()); - - eq->quality_ = quality_; - eq->hp_ = hp_; - eq->maxhp_mod_ = maxhp_mod_; - - return eq; -} - - -void Equipment::printProperties( std::ostream& os ) const -{ - base::printProperties( os ); - - os << "\tQuality\t" << quality_ << pf_endl; - os << "\tHP\t" << hp_ << pf_endl; - if (maxhp_mod_) - os << "\tmaxhp_mod\t" << maxhp_mod_ << pf_endl; - -} - -void Equipment::readProperties( ConfigElem& elem ) -{ - base::readProperties( elem ); - quality_ = elem.remove_double( "QUALITY", 1.0 ); - hp_ = elem.remove_ushort( "HP", eq_tmpl_.maxhp ); - maxhp_mod_ = static_cast<short>(elem.remove_int( "MAXHP_MOD", 0 )); -} - -unsigned short Equipment::maxhp() const -{ - long mhp = eq_tmpl_.maxhp + maxhp_mod_; - if (mhp >= 1) - return static_cast<unsigned short>(mhp); - else - return 1; -} - -void Equipment::reduce_hp_from_hit() -{ - if (hp_ >= 1 && random_int(100) == 0) - { - set_dirty(); - --hp_; - increv(); - if (isa(CLASS_ARMOR)) - { - Character* chr= GetCharacterOwner(); - if (chr != NULL) - chr->refresh_ar(); - } - send_object_cache_to_inrange(this); - } -} Deleted: trunk/pol-core/pol/equipmnt.h =================================================================== --- trunk/pol-core/pol/equipmnt.h 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/equipmnt.h 2009-09-08 01:42:26 UTC (rev 34) @@ -1,51 +0,0 @@ -/* -History -======= - - -Notes -======= - -*/ - -#ifndef EQUIPMNT_H -#define EQUIPMNT_H - -#include <iosfwd> - -#include "item.h" - -class ConfigElem; -class EquipDesc; - -class Equipment : public Item -{ - typedef Item base; - -public: - void reduce_hp_from_hit(); - -protected: - Equipment( const ItemDesc& itemdesc, UOBJ_CLASS uobj_class ); - virtual void printProperties( std::ostream& os ) const; - virtual void readProperties( ConfigElem& elem ); - virtual BObjectImp* get_script_member( const char *membername ) const; - virtual BObjectImp* get_script_member_id( const int id ) const; ///id test - //virtual BObjectImp* set_script_member( const char *membername, const std::string& value ); - virtual BObjectImp* set_script_member( const char *membername, long value ); - virtual BObjectImp* set_script_member_double( const char *membername, double value ); - virtual BObjectImp* set_script_member_id( const int id, long value ); //id test - virtual BObjectImp* set_script_member_id_double( const int id, double value ); //id test - - virtual bool script_isa( unsigned isatype ) const; - unsigned short maxhp() const; - virtual Item* clone() const; - -protected: - const EquipDesc& eq_tmpl_; - double quality_; - unsigned short hp_; - short maxhp_mod_; -}; - -#endif Modified: trunk/pol-core/pol/fnsearch.cpp =================================================================== --- trunk/pol-core/pol/fnsearch.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/fnsearch.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -16,7 +16,7 @@ #include "clib/stlutil.h" #include "mobile/charactr.h" -#include "item.h" +#include "item/item.h" #include "storage.h" #include "multi/multi.h" #include "uworld.h" Modified: trunk/pol-core/pol/getmsg.cpp =================================================================== --- trunk/pol-core/pol/getmsg.cpp 2009-09-07 20:37:38 UTC (rev 33) +++ trunk/pol-core/pol/getmsg.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -21,7 +21,7 @@ #include "network/cgdata.h" #include "mobile/charactr.h" -#include "item.h" +#include "item/item.h" #include "module/osmod.h" #include "pktboth.h" #include "ufunc.h" Added: trunk/pol-core/pol/item/armor.cpp =================================================================== --- trunk/pol-core/pol/item/armor.cpp (rev 0) +++ trunk/pol-core/pol/item/armor.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -0,0 +1,164 @@ +/* +History +======= + 2003/07/10 Dave: armordesc expects string zone names + +Notes +======= + +*/ + +#include "../../clib/stl_inc.h" + +#ifdef _MSC_VER +#pragma warning( disable: 4786 ) +#endif + +#include "../../bscript/bstruct.h" +#include "../../bscript/impstr.h" + +#include "../../clib/cfgelem.h" +#include "../../clib/cistring.h" +#include "../../clib/endian.h" +#include "../../plib/pkg.h" + +#include "../tiles.h" +#include "../clidata.h" +#include "../layers.h" +#include "../ufunc.h" + +#include "armor.h" +#include "itemdesc.h" + + +unsigned short layer_to_zone( unsigned short layer ); +unsigned short zone_name_to_zone( const char *zname ); + +ArmorDesc::ArmorDesc( u16 objtype, ConfigElem& elem, const Package* pkg ) : + EquipDesc( objtype, elem, ARMORDESC, pkg ), + ar( elem.remove_ushort( "AR" ) ), + zones(), + on_hit_script( elem.remove_string( "ONHITSCRIPT", "" ), pkg, "scripts/items/" ) +{ + string coverage; + while ( elem.remove_prop("COVERAGE", &coverage) ) + { + try + { + zones.insert(zone_name_to_zone(coverage.c_str())); + } + catch ( runtime_error err ) + { + cerr << "Error in ObjType 0x" << hex << objtype << ". Package " << pkg->name() <<"." << endl; + throw err; + } + } + + if (zones.empty()) + { + // No 'COVERAGE' entries existed. + // default coverage based on object type/layer + unsigned short layer = tile[graphic].layer; + // special case for shields - they effectively have no coverage. + if (layer != LAYER_HAND1 && layer != LAYER_HAND2) + { + try + { + zones.insert(layer_to_zone(layer)); + } + catch( runtime_error err ) + { + cerr << "Error in ObjType 0x" << hex << objtype << ". Package " << pkg->name() <<"." << endl; + throw err; + } + } + } +} + +const char* zone_to_zone_name( unsigned short zone ); +void ArmorDesc::PopulateStruct( BStruct* descriptor ) const +{ + base::PopulateStruct( descriptor ); + descriptor->addMember( "OnHitScript", new String(on_hit_script.relativename(pkg)) ); + descriptor->addMember( "AR", new BLong(ar) ); + + ObjArray* arr_zones = new ObjArray(); + std::set<unsigned int>::const_iterator itr; + for(itr = zones.begin(); itr != zones.end(); ++itr) + arr_zones->addElement( new String( zone_to_zone_name(*itr) ) ); + + + if(arr_zones->ref_arr.size() > 0) + descriptor->addMember( "Coverage", arr_zones ); + else + delete arr_zones; +} + +UArmor::UArmor( const ArmorDesc& descriptor, const ArmorDesc* permanent_descriptor ) : + Equipment( descriptor, CLASS_ARMOR ), + tmpl( permanent_descriptor ), + ar_mod_(0), + onhitscript_( descriptor.on_hit_script ) +{ +} + +unsigned short UArmor::ar() const +{ + long ar = tmpl->ar * hp_ / maxhp(); + if (ar_mod_ != 0) + { + ar += ar_mod_; + } + + if (ar < 0) + return 0; + else if (ar <= USHRT_MAX) + return static_cast<unsigned short>(ar); + else + return USHRT_MAX; +} + +bool UArmor::covers( unsigned layer ) const +{ + return tmpl->zones.find( layer ) != tmpl->zones.end(); +} + +Item* UArmor::clone() const +{ + UArmor* armor = static_cast<UArmor*>(base::clone()); + armor->ar_mod_ = ar_mod_; + armor->onhitscript_ = onhitscript_; + armor->tmpl = tmpl; + return armor; +} + +void UArmor::printProperties( ostream& os ) const +{ + base::printProperties( os ); + if (ar_mod_) + os << "\tAR_mod\t" << ar_mod_ << pf_endl; + if (! (onhitscript_ == tmpl->on_hit_script) ) + os << "\tOnHitScript\t" << onhitscript_.relativename( tmpl->pkg ) << pf_endl; +} + +void UArmor::readProperties( ConfigElem& elem ) +{ + base::readProperties( elem ); + ar_mod_ = static_cast<short>(elem.remove_int( "AR_MOD", 0 )); + set_onhitscript( elem.remove_string( "ONHITSCRIPT", "" ) ); +} + +void UArmor::set_onhitscript( const string& scriptname ) +{ + if (scriptname.empty()) + { + onhitscript_.clear(); + } + else + { + onhitscript_.config( scriptname, + itemdesc().pkg, + "scripts/items/", + true ); + } +} Added: trunk/pol-core/pol/item/armor.h =================================================================== --- trunk/pol-core/pol/item/armor.h (rev 0) +++ trunk/pol-core/pol/item/armor.h 2009-09-08 01:42:26 UTC (rev 34) @@ -0,0 +1,66 @@ +/* +History +======= + + +Notes +======= + +*/ + +#ifndef ARMOR_H +#define ARMOR_H + +#include <iosfwd> + +#include "../scrdef.h" + +#include "equipmnt.h" +#include "item.h" +#include "armrtmpl.h" + + +class ArmorDesc; + +class UArmor : public Equipment +{ + typedef Equipment base; +public: + virtual unsigned short ar() const; + virtual bool covers( unsigned layer ) const; + virtual Item* clone() const; + void set_onhitscript( const string& scriptname ); + std::set<unsigned> tmplzones(); + +protected: + virtual void printProperties( std::ostream& os ) const; + virtual void readProperties( ConfigElem& elem ); + virtual BObjectImp* get_script_member( const char *membername ) const; + virtual BObjectImp* get_script_member_id( const int id ) const; ///id test + virtual BObjectImp* set_script_member( const char *membername, const std::string& value ); + virtual BObjectImp* set_script_member( const char *membername, long value ); + virtual BObjectImp* set_script_member_id( const int id, const std::string& value ); //id test + virtual BObjectImp* set_script_member_id( const int id, long value );//id test + virtual bool script_isa( unsigned isatype ) const; + + UArmor( const ArmorDesc& descriptor, const ArmorDesc* permanent_descriptor ); + friend class Item; + //friend void load_data(); + + const ArmorDesc& descriptor() const; + const ScriptDef& onhitscript() const; + + +private: + const ArmorDesc* tmpl; + short ar_mod_; + + ScriptDef onhitscript_; +}; + +inline std::set<unsigned> UArmor::tmplzones() { return tmpl->zones; } + +void load_armor_templates(); +void unload_armor_templates(); + +#endif Added: trunk/pol-core/pol/item/armrtmpl.h =================================================================== --- trunk/pol-core/pol/item/armrtmpl.h (rev 0) +++ trunk/pol-core/pol/item/armrtmpl.h 2009-09-08 01:42:26 UTC (rev 34) @@ -0,0 +1,35 @@ +/* +History +======= + + +Notes +======= + +*/ + +#ifndef ARMRTMPL_H +#define ARMRTMPL_H + +#include <string> +#include <set> + +#include "itemdesc.h" +#include "../equipdsc.h" + +class ConfigElem; + +class ArmorDesc : public EquipDesc +{ +public: + //ArmorTemplate(); + typedef EquipDesc base; + ArmorDesc( u16 objtype, ConfigElem& elem, const Package* pkg ); + virtual void PopulateStruct( BStruct* descriptor ) const; + + unsigned short ar; + std::set<unsigned> zones; + ScriptDef on_hit_script; +}; + +#endif Added: trunk/pol-core/pol/item/equipmnt.cpp =================================================================== --- trunk/pol-core/pol/item/equipmnt.cpp (rev 0) +++ trunk/pol-core/pol/item/equipmnt.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -0,0 +1,86 @@ +/* +History +======= +2007/03/28 Shinigami: added increv() to Equipment::reduce_hp_from_hit + +Notes +======= + +*/ + + +#include "../../clib/stl_inc.h" + +#include "../../clib/cfgelem.h" +#include "../../clib/random.h" + +#include "equipmnt.h" +#include "../equipdsc.h" +#include "../tooltips.h" +#include "../mobile/charactr.h" + +Equipment::Equipment( const ItemDesc& itemdesc, UOBJ_CLASS uobj_class ) : + Item( itemdesc, uobj_class ), + eq_tmpl_(static_cast<const EquipDesc&>(find_itemdesc( objtype_ ))), // be sure to grab the permanent entry + quality_(1.0), + hp_( eq_tmpl_.maxhp), + maxhp_mod_(0) +{ +} + +Item* Equipment::clone() const +{ + Equipment* eq = static_cast<Equipment*>(base::clone()); + + eq->quality_ = quality_; + eq->hp_ = hp_; + eq->maxhp_mod_ = maxhp_mod_; + + return eq; +} + + +void Equipment::printProperties( std::ostream& os ) const +{ + base::printProperties( os ); + + os << "\tQuality\t" << quality_ << pf_endl; + os << "\tHP\t" << hp_ << pf_endl; + if (maxhp_mod_) + os << "\tmaxhp_mod\t" << maxhp_mod_ << pf_endl; + +} + +void Equipment::readProperties( ConfigElem& elem ) +{ + base::readProperties( elem ); + quality_ = elem.remove_double( "QUALITY", 1.0 ); + hp_ = elem.remove_ushort( "HP", eq_tmpl_.maxhp ); + maxhp_mod_ = static_cast<short>(elem.remove_int( "MAXHP_MOD", 0 )); +} + +unsigned short Equipment::maxhp() const +{ + long mhp = eq_tmpl_.maxhp + maxhp_mod_; + if (mhp >= 1) + return static_cast<unsigned short>(mhp); + else + return 1; +} + +void Equipment::reduce_hp_from_hit() +{ + if (hp_ >= 1 && random_int(100) == 0) + { + set_dirty(); + --hp_; + increv(); + if (isa(CLASS_ARMOR)) + { + Character* chr= GetCharacterOwner(); + if (chr != NULL) + chr->refresh_ar(); + } + send_object_cache_to_inrange(this); + } +} Added: trunk/pol-core/pol/item/equipmnt.h =================================================================== --- trunk/pol-core/pol/item/equipmnt.h (rev 0) +++ trunk/pol-core/pol/item/equipmnt.h 2009-09-08 01:42:26 UTC (rev 34) @@ -0,0 +1,51 @@ +/* +History +======= + + +Notes +======= + +*/ + +#ifndef EQUIPMNT_H +#define EQUIPMNT_H + +#include <iosfwd> + +#include "item.h" + +class ConfigElem; +class EquipDesc; + +class Equipment : public Item +{ + typedef Item base; + +public: + void reduce_hp_from_hit(); + +protected: + Equipment( const ItemDesc& itemdesc, UOBJ_CLASS uobj_class ); + virtual void printProperties( std::ostream& os ) const; + virtual void readProperties( ConfigElem& elem ); + virtual BObjectImp* get_script_member( const char *membername ) const; + virtual BObjectImp* get_script_member_id( const int id ) const; ///id test + //virtual BObjectImp* set_script_member( const char *membername, const std::string& value ); + virtual BObjectImp* set_script_member( const char *membername, long value ); + virtual BObjectImp* set_script_member_double( const char *membername, double value ); + virtual BObjectImp* set_script_member_id( const int id, long value ); //id test + virtual BObjectImp* set_script_member_id_double( const int id, double value ); //id test + + virtual bool script_isa( unsigned isatype ) const; + unsigned short maxhp() const; + virtual Item* clone() const; + +protected: + const EquipDesc& eq_tmpl_; + double quality_; + unsigned short hp_; + short maxhp_mod_; +}; + +#endif Added: trunk/pol-core/pol/item/item.cpp =================================================================== --- trunk/pol-core/pol/item/item.cpp (rev 0) +++ trunk/pol-core/pol/item/item.cpp 2009-09-08 01:42:26 UTC (rev 34) @@ -0,0 +1,1162 @@ +/* +History +======= +2006/03/01 MuadDib: Altered the decayat_gameclock_ check (to check for != 0). +2008/12/17 MuadDub: Added item.tile_layer - returns layer entry from tiledata/tiles.cfg +2009/08/06 MuadDib: Added gotten_by code for items. +2009/08/25 Shinigami: STLport-5.2.1 fix: new_ar not used +2009/09/03 MuadDib: Changes for account related source file relocation + Changes for multi related source file relocation + +Notes +======= + +*/ + +#include "../../clib/stl_inc.h" + +#ifdef _MSC_VER +# pragma warning( disable: 4786 ) +#endif + +#include "../../bscript/berror.h" + +#include "../../clib/cfgelem.h" +#include "../../clib/endian.h" +#include "../../clib/strutil.h" + +#include "../../plib/mapcell.h" + +#include "item.h" +#include "armor.h" +#include "../ustruct.h" +#include "../uofile.h" +#include "../containr.h" +#include "../ufunc.h" +#include "../network/client.h" +#include "../mobile/charactr.h" +#include "../item/itemdesc.h" +#include "../objtype.h" +#include "../../plib/pkg.h" +#include "../polcfg.h" +#include "../resource.h" +#include "../scrsched.h" +#include "../scrstore.h" +#include "../stackcfg.h" //dave 1/26/3 +#include "../tooltips.h" +#include "../uoscrobj.h" +#include "../ssopt.h" +/* +#include "clib/endian.h" + +#include "armor.h" +#include "multi/boat.h" +#include "door.h" +#include "dye.h" +#include "objtype.h" +#include "spelbook.h" +#include "weapon.h" +*/ + + +/* This is a pretty good clone. Somewhat inefficient, but does + work for derived classes that do not have data. + (since it calls Item::create, virtual tables are copied) +*/ +Item* Item::clone() const +{ + Item* item = Item::create( objtype_ ); + item->color = color; + item->color_ext = color_ext; + item->graphic = graphic; + item->graphic_ext = graphic_ext; + item->x = x; + item->y = y; + item->z = z; + item->realm = realm; + item->facing = facing; + item->setamount( amount_ ); + item->layer = layer; + item->tile_layer = tile_layer; + item->container = NULL; // was container + item->sellprice_ = sellprice_; + item->buyprice_ = buyprice_; + item->newbie_ = newbie_; + + item->invisible_ = invisible_; //dave 12-20 + item->movable_ = movable_; //dave 12-20 + + item->on_use_script_ = on_use_script_; //dave 12-20 + item->equip_script_ = equip_script_; //dave 12-20 + item->unequip_script_ = unequip_script_; //dave 12-20 + + item->name_ = name_; + item->increv(); + + item->copyprops( *this ); + + item->saveonexit( saveonexit() ); + + // Let's build the resistances defaults. + item->element_resist.cold = element_resist.cold; + item->element_resist.energy = element_resist.energy; + item->element_resist.fire = element_resist.fire; + item->element_resist.poison = element_resist.poison; + item->element_resist.physical = element_resist.physical; + + item->element_resist_mod.cold = element_resist_mod.cold; + item->element_resist_mod.energy = element_resist_mod.energy; + item->element_resist_mod.fire = element_resist_mod.fire; + item->element_resist_mod.poison = element_resist_mod.poison; + item->element_resist_mod.physical = element_resist_mod.physical; + + // Let's build the resistances defaults. + item->element_damage.cold = element_damage.cold; + item->element_damage.energy = element_damage.energy; + item->element_damage.fire = element_damage.fire; + item->element_damage.poison = element_damage.poison; + item->element_damage.physical = element_damage.physical; + + item->element_damage_mod.cold = element_damage_mod.cold; + item->element_damage_mod.energy = element_damage_mod.energy; + item->element_damage_mod.fire = element_damage_mod.fire; + item->element_damage_mod.poison = element_damage_mod.poison; + item->element_damage_mod.physical = element_damage_mod.physical; + + return item; +} + +string Item::name() const +{ + if (name_ != "") + { + return name_; + } + else + { + return tile_desc( graphic ); + } +} + +const ItemDesc& Item::itemdesc() const +{ + return find_itemdesc( objtype_ ); +} + +/* there are four forms of 'name' in objinfo: + name (normal) + name%s (percent followed by plural-part, then null-term) + name%s% (percent followed by plural-part, then percent, then more) + wheat shea%ves/f% ( '%', plural part, '/', single part, '%', rest ) + Some examples: + pil%es/e% of hides + banana%s% + feather%s + Known bugs: + 1 gold coin displays as "gold coin". There must be a bit somewhere + that I just don't understand yet. +*/ +string Item::description() const +{ + if (specific_name()) + { + return ::format_description( 0, name(), amount_ ); //dave monkeyed with this 2/4/3 + } + else + { + const ItemDesc& id = find_itemdesc( objtype_ ); + if (id.desc.empty()) + { + return ::format_description( tile_flags( graphic ), tile_desc( graphic ), amount_ ); + } + else + { + return ::format_description( tile_flags( graphic ), id.desc, amount_ ); + } + } +} + +string Item::get_use_script_name() const +{ + return on_use_script_; +} + +string Item::merchant_description() const +{ + if (specific_name()) + { + return name(); + } + else + { + const ItemDesc& id = find_itemdesc( objtype_ ); + if (id.desc.empty()) + { + return ::format_description( 0, tile_desc( graphic ), 1 ); + } + else + { + return ::format_description( 0, id.desc, 1 ); + } + } +} + +unsigned long Item::sellprice() const +{ + if (sellprice_ < ULONG_MAX) //dave changed 1/15/3 so 0 means 0, not default to itemdesc value + { + return sellprice_; + } + else + { + return itemdesc().vendor_sells_for; + } +} + +//Dave add buyprice() 11/28. Dont know wtf getbuyprice() is trying to do. +// Dave, getbuyprice() was trying to return false if the vendor wasn't interested in buying. +// it would return true if the vendor was interested in buying. +// -Eric +unsigned long Item::buyprice() const +{ + if (buyprice_ < ULONG_MAX) //dave changed 1/15/3 so 0 means 0, not default to itemdesc value + { + return buyprice_; + } + else + { + return itemdesc().vendor_buys_for; + } +} + +bool Item::getbuyprice( unsigned long& bp ) const +{ + bp = buyprice(); + if (bp > 0) + return true; + else + return false; + //dave ripped out the below, was wrong with the above buyprice() changes. + /* + if (buyprice_ > 0) + { + buyprice = static_cast<unsigned long>(buyprice_); + return true; + } + else + { + buyprice = 0; + return false; + } + } + else + { + buyprice = itemdesc().vendor_buys_for; + return (buyprice > 0); + } + */ +} + +u8 Item::los_height() const +{ + return height / 2; +/* + if (height) + return height-1; + else + return 0; +*/ +} + +UObject* Item::owner() +{ + if (container != NULL) + return container->self_as_owner(); + else + return NULL; +} + +const UObject* Item::owner() const +{ + if (container != NULL) + return container->self_as_owner(); + else + return NULL; +} + +UObject* Item::toplevel_owner() +{ + Item* item = this; + while (item->container != NULL) + item = item->container; + + return item; +} + +const UObject* Item::toplevel_owner() const +{ + const Item* item = this; + while (item->container != NULL) + item = item->container; + + return item; +} + +const char* Item::classname() const +{ + return "Item"; +} + +bool Item::default_movable() const +{ + const ItemDesc& id = find_itemdesc( objtype_ ); + if (id.movable == ItemDesc::DEFAULT) + return ((tile_flags( graphic ) & FLAG::MOVABLE) != 0); + else + return id.movable ? true : false; +} + +bool Item::default_invisible() const +{ + return itemdesc().invisible; +} + +bool Item::default_newbie() const +{ + return itemdesc().newbie; +} + +void Item::printProperties( ostream& os ) const +{ + base::printProperties(os); + if (amount_ != 1) + os << "\tAmount\t" << amount_ << pf_endl; + + if (layer != 0) + os << "\tLayer\t" << (int) layer << pf_endl; + + if (movable_ != default_movable()) + os << "\tMovable\t" << movable_ << pf_endl; + + if (invisible_ != default_invisible()) + os << "\tInvisible\t" << invisible_ << pf_endl; + + if (element_resist_mod.fire != 0) + os << "\tFireResistMod\t" << static_cast<int>(element_resist_mod.fire) << pf_endl; + if (element_resist_mod.cold != 0) + os << "\tColdResistMod\t" << static_cast<int>(element_resist_mod.cold) << pf_endl; + if (element_resist_mod.energy != 0) + os << "\tEnergyResistMod\t" << static_cast<int>(element_resist_mod.energy) << pf_endl; + if (element_resist_mod.poison != 0) + os << "\tPoisonResistMod\t" << static_cast<int>(element_resist_mod.poison) << pf_endl; + if (element_resist_mod.physical != 0) + os << "\tPhysicalResistMod\t" << static_cast<int>(element_resist_mod.physical) << pf_endl; + + if (element_damage_mod.fire != 0) + os << "\tFireDamageMod\t" << static_cast<int>(element_damage_mod.fire) << pf_endl; + if (element_damage_mod.cold != 0) + os << "\tColdDamageMod\t" << static_cast<int>(element_damage_mod.cold) << pf_endl; + if (element_damage_mod.energy != 0) + os << "\tEnergyDamageMod\t" << static_cast<int>(element_damage_mod.energy) << pf_endl; + if (element_damage_mod.poison != 0) + os << "\tPoisonDamageMod\t" << static_cast<int>(element_damage_mod.poison) << pf_endl; + if (element_damage_mod.physical != 0) + os << "\tPhysicalDamageMod\t" << static_cast<int>(element_damage_mod.physical) << pf_endl; + + if (container != NULL) + os << "\tContainer\t0x" << hex << container->serial << dec << pf_endl; + + if (!on_use_script_.empty()) + os << "\tOnUseScript\t" << on_use_script_ << pf_endl; + + if (equip_script_ != itemdesc().equip_script) + os << "\tEquipScript\t" << equip_script_ << pf_endl; + + if (unequip_script_ != itemdesc().unequip_script) + os << "\tUnequipScript\t" << unequip_script_ << pf_endl; + + if (decayat_gameclock_ != 0) + os << "\tDecayAt\t" << decayat_gameclock_ << pf_endl; + + if (sellprice_ != ULONG_MAX) // recall that ULONG_MAX means use default + os << "\tSellPrice\t" << sellprice_ << pf_endl; + + if (buyprice_ != ULONG_MAX) // recall that ULONG_MAX means use default + os << "\tBuyPrice\t" << buyprice_ << pf_endl; + + if (newbie_ != default_newbie()) + os << "\tNewbie\t" << newbie_ << pf_endl; +} + +void Item::printDebugProperties( ostream& os ) const +{ + base::printDebugProperties( os ); +} + +void Item::readProperties( ConfigElem& elem ) +{ + base::readProperties( elem ); + +// Changed from Valid Color Mask to cfg mask in ssopt. + color &= ssopt.item_color_mask; + color_ext = ctBEu16( color ); + + amount_ = elem.remove_ushort( "AMOUNT", 1 ); + layer = static_cast<unsigned char>(elem.remove_ushort( "LAYER", 0 )); + movable_ = elem.remove_bool( "MOVABLE", default_movable() ); + invisible_ = elem.remove_bool( "INVISIBLE", default_invisible() ); + + // NOTE, container is handled specially - it is extracted by the creator. + + on_use_script_ = elem.remove_string( "ONUSESCRIPT", "" ); + equip_script_ = elem.remove_string( "EQUIPSCRIPT", equip_script_.c_str() ); + unequip_script_ = elem.remove_string( "UNEQUIPSCRIPT", unequip_script_.c_str() ); + + decayat_gameclock_ = elem.remove_ulong( "DECAYAT", 0 ); + sellprice_ = elem.remove_ulong( "SELLPRICE", ULONG_MAX ); + buyprice_ = elem.remove_ulong( "BUYPRICE", ULONG_MAX ); + + // buyprice used to be read in with remove_int (which was wrong). + // the ULONG_MAX values used to be written out (which was wrong). + // when ULONG_MAX is read in by atoi, it returned 2147483647 (0x7FFFFFFF) + // correct for this. + if (buyprice_ == 2147483647) + buyprice_ = ULONG_MAX; + newbie_ = elem.remove_bool( "NEWBIE", default_newbie() ); + + element_resist_mod.fire = static_cast<s16>(elem.remove_int( "FIRERESISTMOD", 0 )); + element_resist_mod.cold = static_cast<s16>(elem.remove_int( "COLDRESISTMOD", 0 )); + element_resist_mod.energy = static_cast<s16>(elem.remove_int( "ENERGYRESISTMOD", 0 )); + element_resist_mod.poison = static_cast<s16>(elem.remove_int( "POISONRESISTMOD", 0 )); + element_resist_mod.physical = static_cast<s16>(elem.remove_int( "PHYSICALRESISTMOD", 0 )); + + element_damage_mod.fire = static_cast<s16>(elem.remove_int( "FIREDAMAGEMOD", 0 )); + element_damage_mod.cold = static_cast<s16>(elem.remove_int( "COLDDAMAGEMOD", 0 )); + element_damage_mod.energy = static_cast<s16>(elem.remove_int( "ENERGYDAMAGEMOD", 0 )); + element_damage_mod.poison = static_cast<s16>(elem.remove_int( "POISONDAMAGEMOD", 0 )); + element_damage_mod.physical = static_cast<s16>(elem.remove_int( "PHYSICALDAMAGEMOD", 0 )); + +} + +void Item::builtin_on_use( Client* client ) +{ + send_sysmessage( client, "I can't think of a way to use that." ); +} + +void Item::double_click( Client* client ) +{ + const ItemDesc& itemdesc = find_itemdesc( objtype_ ); + + if (itemdesc.requires_attention && (client->chr->skill_ex_active() || + client->chr->casting_spell())) + { + send_sysmessage( client, "I am already doing something else." ); + return; + } + + if (itemdesc.requires_attention && client->chr->hidden()) + client->chr->unhide(); + + ref_ptr<EScriptProgram> prog; + + if (!on_use_script_.empty()) + { + ScriptDef sd( on_use_script_, NULL, "" ); + prog = find_script2( sd, + true, // complain if not found + config.cache_interactive_scripts ); + } + else if (!itemdesc.on_use_script.empty()) + { + prog = find_script2( itemdesc.on_use_script, + true, + config.cache_interactive_scripts ); + } + + if (prog.get() != NULL) + { + if (client->chr->start_itemuse_script( prog.get(), this, itemdesc.requires_attention )) + return; + // else log the fact? + } + else + { + builtin_on_use( client ); + } +} + + +unsigned short Item::get_senditem_amount() const +{ + return amount_; +} + +bool Item::setlayer( unsigned char in_layer ) +{ + if (tilelayer( graphic ) == in_layer) + { + layer = in_layer; + return true; + } + else + { + return false; + } +} + +bool Item::stackable() const +{ + return (tile_flags( graphic ) & FLAG::STACKABLE) ? true : false; +} + +void Item::setamount( u16 amount ) +{ + set_dirty(); + int oldweight = weight(); + + if (amount > amount_) // adding stuff + remove_resources( objtype_, amount - amount_ ); + else + return_resources( objtype_, amount_ - amount ); + + amount_ = amount; + int newweight = weight(); + if (container) + container->add_bulk( 0, newweight-oldweight ); + + increv(); + send_object_cache_to_inrange(this); +} + +void Item::subamount( u16 amount_subtract ) +{ + setamount( amount_ - amount_subtract ); + increv(); +} + +void Item::add_to_self( Item*& item ) +{ + #ifdef PERGON + ct_merge_stacks_pergon( item ); // Pergon: Re-Calculate Property CreateTime after Merging of two Stacks + #endif + + setamount( amount_ + item->amount_ ); + + if (!item->newbie()) + newbie_ = false; + + item->destroy(); + item = NULL; +} + +#ifdef PERGON +// Pergon: Re-Calculate Property CreateTime after Merging of two Stacks +void Item::ct_merge_stacks_pergon( Item*& item_sub ) +{ + long time_self, time_sub, time; + string value_self, value_sub; + + // get "ct" of first stack - if error, init + if (getprop( "ct", value_self )) + { + BObjectImp* imp = BObjectImp::unpack( value_self.c_str() ); + if (imp != NULL && imp->isa( BObjectImp::OTLong )) + time_self = static_cast<BLong*>(imp)->value(); + else + time_self = read_gameclock(); + } + else + time_self = read_gameclock(); + + // get "ct" of second stack - if error, init + if (item_sub->getprop( "ct", value_sub )) + { + BObjectImp* imp = BObjectImp::unpack( value_sub.c_str() ); + if (imp != NULL && imp->isa( BObjectImp::OTLong )) + time_sub = static_cast<BLong*>(imp)->value(); + else + time_sub = read_gameclock(); + } + else + time_sub = read_gameclock(); + + // calculate new time + if (time_self < time_sub) + { + double factor = (item_sub->amount_ * 1.0) / (amount_ + item_sub->amount_); + time = long((time_sub - time_self) * factor + time_self); + } + else if (time_self > time_sub) + { + double factor = (amount_ * 1.0) / (amount_ + item_sub->amount_); + time = long((time_self - time_sub) * factor + time_sub); + } + else + time = time_self; + + setprop("ct", "i" + decint( time )); + increv(); +} + +// Pergon: Re-Calculate Property CreateTime after Adding Items to a Stack +void Item::ct_merge_stacks_pergon( u16 amount_sub ) +{ + long time_self, time_sub, time; + string value_self; + + // get "ct" of first stack - if error, init + if (getprop( "ct", value_self )) + { + BObjectImp* imp = BObjectImp::unpack( value_self.c_str() ); + if (imp != NULL && imp->isa( BObjectImp::OTLong )) + time_self = static_cast<BLong*>(imp)->value(); + else + time_self = read_gameclock(); + } + else + time_self = read_gameclock(); + + // set "ct" of second new stack + time_sub = read_gameclock(); + + // calculate new time + if (time_self != time_sub) + { + double factor = (amount_sub * 1.0) / (amount_ + amount_sub); + time = long((time_sub - time_self) * factor + time_self); + } + else + time = time_self; + + setprop("ct", "i" + decint( time )); + increv(); +} +#endif + +bool Item::can_add_to_self( unsigned short amount ) const +{ + unsigned long amount1 = (unsigned long) amount_; + unsigned long amount2 = (unsigned long) amount; + if ((amount1 + amount2) > MAX_STACK_ITEMS) + return false; + + if (container != NULL) + { + long more_weight = weight_of(amount_+amount) - weight_of(amount_); + if (more_weight > USHRT_MAX/*std::numeric_limits<unsigned short>::max()*/) + return false; + return container->can_add(static_cast<unsigned short>(more_weight)); + } + + return true; +} + +bool Item::can_add_to_self( const Item& item ) const //dave 1/26/03 totally changed this function to handle the cprop comparisons. +{ + bool res = ( (item.objtype_ == objtype_) && + (item.newbie() == newbie()) && + (item.graphic == graphic) && + (item.color == color) && + (!inuse()) && + (can_add_to_self( item.amount_ )) + ); + if(res == true) + { + //NOTE! this logic is copied in Ite... [truncated message content] |
From: <tu...@us...> - 2009-09-09 14:00:38
|
Revision: 40 http://polserver.svn.sourceforge.net/polserver/?rev=40&view=rev Author: turley Date: 2009-09-09 14:00:30 +0000 (Wed, 09 Sep 2009) Log Message: ----------- added ServSpecOpt CarryingCapacityMod (double default 1.0) as * modifier for mobile max_weight changed armorzone sets to unsigned short Modified Paths: -------------- trunk/pol-core/doc/core-changes.txt trunk/pol-core/pol/item/armor.cpp trunk/pol-core/pol/item/armor.h trunk/pol-core/pol/item/armrtmpl.h trunk/pol-core/pol/mobile/charactr.cpp trunk/pol-core/pol/ssopt.cpp trunk/pol-core/pol/ssopt.h Modified: trunk/pol-core/doc/core-changes.txt =================================================================== --- trunk/pol-core/doc/core-changes.txt 2009-09-09 13:20:23 UTC (rev 39) +++ trunk/pol-core/doc/core-changes.txt 2009-09-09 14:00:30 UTC (rev 40) @@ -1,4 +1,10 @@ -- POL099 -- +09-09-2009 Turley: + Added: ServSpecOpt CarryingCapacityMod (double default 1.0) as * modifier for mobile max_weight + Note: Formula is (40 + strength * 7 / 2) * ssopt.CarryingCapacityMod + Note: Since ML max weight is send for statusgump + Note: Patch submitted by Tomi + 09-05-2009 MuadDib: Added: POL Linux builds will now create a PID file when loading. Patch submitted by Crazyman Modified: trunk/pol-core/pol/item/armor.cpp =================================================================== --- trunk/pol-core/pol/item/armor.cpp 2009-09-09 13:20:23 UTC (rev 39) +++ trunk/pol-core/pol/item/armor.cpp 2009-09-09 14:00:30 UTC (rev 40) @@ -83,7 +83,7 @@ descriptor->addMember( "AR", new BLong(ar) ); ObjArray* arr_zones = new ObjArray(); - std::set<unsigned int>::const_iterator itr; + std::set<unsigned short>::const_iterator itr; for(itr = zones.begin(); itr != zones.end(); ++itr) arr_zones->addElement( new String( zone_to_zone_name(*itr) ) ); @@ -118,7 +118,7 @@ return USHRT_MAX; } -bool UArmor::covers( unsigned layer ) const +bool UArmor::covers( unsigned short layer ) const { return tmpl->zones.find( layer ) != tmpl->zones.end(); } Modified: trunk/pol-core/pol/item/armor.h =================================================================== --- trunk/pol-core/pol/item/armor.h 2009-09-09 13:20:23 UTC (rev 39) +++ trunk/pol-core/pol/item/armor.h 2009-09-09 14:00:30 UTC (rev 40) @@ -27,10 +27,10 @@ typedef Equipment base; public: virtual unsigned short ar() const; - virtual bool covers( unsigned layer ) const; + virtual bool covers( unsigned short layer ) const; virtual Item* clone() const; void set_onhitscript( const string& scriptname ); - std::set<unsigned> tmplzones(); + std::set<unsigned short> tmplzones(); protected: virtual void printProperties( std::ostream& os ) const; @@ -58,7 +58,7 @@ ScriptDef onhitscript_; }; -inline std::set<unsigned> UArmor::tmplzones() { return tmpl->zones; } +inline std::set<unsigned short> UArmor::tmplzones() { return tmpl->zones; } void load_armor_templates(); void unload_armor_templates(); Modified: trunk/pol-core/pol/item/armrtmpl.h =================================================================== --- trunk/pol-core/pol/item/armrtmpl.h 2009-09-09 13:20:23 UTC (rev 39) +++ trunk/pol-core/pol/item/armrtmpl.h 2009-09-09 14:00:30 UTC (rev 40) @@ -28,7 +28,7 @@ virtual void PopulateStruct( BStruct* descriptor ) const; unsigned short ar; - std::set<unsigned> zones; + std::set<unsigned short> zones; ScriptDef on_hit_script; }; Modified: trunk/pol-core/pol/mobile/charactr.cpp =================================================================== --- trunk/pol-core/pol/mobile/charactr.cpp 2009-09-09 13:20:23 UTC (rev 39) +++ trunk/pol-core/pol/mobile/charactr.cpp 2009-09-09 14:00:30 UTC (rev 40) @@ -36,6 +36,8 @@ 2009/09/03 MuadDib: Changed combat related ssopt stuff to combat_config. Changes for account related source file relocation Changes for multi related source file relocation +2009/09/09 Turley: ServSpecOpt CarryingCapacityMod as * modifier for Character::carrying_capacity() + Notes ======= @@ -502,7 +504,7 @@ /// unsigned short Character::carrying_capacity() const { - return 40 + strength() * 7 / 2; + return static_cast<u16>(floor( (40 + strength() * 7 / 2) * ssopt.carrying_capacity_mod )); } int Character::charindex() const @@ -2259,8 +2261,8 @@ if (item->isa( CLASS_ARMOR )) { UArmor* armor = static_cast<UArmor*>(item); - std::set<unsigned> tmplzones = armor->tmplzones(); - std::set<unsigned>::iterator itr; + std::set<unsigned short> tmplzones = armor->tmplzones(); + std::set<unsigned short>::iterator itr; for ( itr = tmplzones.begin(); itr != tmplzones.end(); ++itr ) { if ((armor_[*itr] == NULL) || (armor->ar() > armor_[*itr]->ar())) Modified: trunk/pol-core/pol/ssopt.cpp =================================================================== --- trunk/pol-core/pol/ssopt.cpp 2009-09-09 13:20:23 UTC (rev 39) +++ trunk/pol-core/pol/ssopt.cpp 2009-09-09 14:00:30 UTC (rev 40) @@ -8,7 +8,8 @@ 2005/12/05 MuadDib: ServSpecOpt InvulTage using 0, 1, 2 for method of invul showing. 2009/07/31 Turley: ServSpecOpt ResetSwingOnTurn=true/false Should SwingTimer be reset with projectile weapon on facing change ServSpecOpt SendSwingPacket=true/false Should packet 0x2F be send on swing. - 2009/09/03 MuadDib: Moved combat related settings to Combat Config. +2009/09/03 MuadDib: Moved combat related settings to Combat Config. +2009/09/09 Turley: ServSpecOpt CarryingCapacityMod as * modifier for Character::carrying_capacity() Notes ======= @@ -68,7 +69,7 @@ ssopt.default_max_slots = static_cast<unsigned char>(elem.remove_ushort("MaxContainerSlots", 125)); ssopt.use_slot_index = elem.remove_bool("UseContainerSlots",false); ssopt.use_edit_server = elem.remove_bool("EditServer",false); - + ssopt.carrying_capacity_mod = elem.remove_double("CarryingCapacityMod",1.0); ssopt.core_sends_caps = elem.remove_bool("CoreSendsCaps",false); ssopt.send_stat_locks = elem.remove_bool("SendStatLocks",false); ssopt_parse_totalstats(elem); Modified: trunk/pol-core/pol/ssopt.h =================================================================== --- trunk/pol-core/pol/ssopt.h 2009-09-09 13:20:23 UTC (rev 39) +++ trunk/pol-core/pol/ssopt.h 2009-09-09 14:00:30 UTC (rev 40) @@ -9,6 +9,7 @@ 2009/07/31 Turley: ServSpecOpt ResetSwingOnTurn=true/false Should SwingTimer be reset with projectile weapon on facing change ServSpecOpt SendSwingPacket=true/false Should packet 0x2F be send on swing. 2009/09/03 MuadDib: Moved combat related settings to Combat Config. +2009/09/09 Turley: ServSpecOpt CarryingCapacityMod as * modifier for Character::carrying_capacity() Notes ======= @@ -45,7 +46,7 @@ bool allow_moving_trade; bool core_handled_locks; bool use_slot_index; - + double carrying_capacity_mod; bool use_edit_server; unsigned short default_attribute_cap; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tu...@us...> - 2009-09-10 12:25:45
|
Revision: 41 http://polserver.svn.sourceforge.net/polserver/?rev=41&view=rev Author: turley Date: 2009-09-10 12:24:52 +0000 (Thu, 10 Sep 2009) Log Message: ----------- coordinate vartype cleanup, i hope no new bugs :( Modified Paths: -------------- trunk/pol-core/bscript/execmodl.h trunk/pol-core/bscript/executor.cpp trunk/pol-core/bscript/executor.h trunk/pol-core/clib/cfgelem.h trunk/pol-core/clib/cfgfile.cpp trunk/pol-core/plib/filemapserver.cpp trunk/pol-core/plib/filemapserver.h trunk/pol-core/plib/inmemorymapserver.cpp trunk/pol-core/plib/inmemorymapserver.h trunk/pol-core/plib/mapfunc.cpp trunk/pol-core/plib/mapfunc.h trunk/pol-core/plib/mapserver.cpp trunk/pol-core/plib/mapserver.h trunk/pol-core/plib/mapshape.h trunk/pol-core/plib/maptileserver.cpp trunk/pol-core/plib/mapwriter.cpp trunk/pol-core/plib/mapwriter.h trunk/pol-core/plib/realm.cpp trunk/pol-core/plib/realm.h trunk/pol-core/plib/realmdescriptor.cpp trunk/pol-core/plib/realmdescriptor.h trunk/pol-core/plib/realmfunc.cpp trunk/pol-core/plib/realmlos.cpp trunk/pol-core/plib/staticserver.cpp trunk/pol-core/plib/staticserver.h trunk/pol-core/plib/testdrop1.cpp trunk/pol-core/plib/testenv.cpp trunk/pol-core/plib/testwalk1.cpp trunk/pol-core/pol/clidata.h trunk/pol-core/pol/core.cpp trunk/pol-core/pol/core.h trunk/pol-core/pol/dropitem.cpp trunk/pol-core/pol/mobile/charactr.cpp trunk/pol-core/pol/mobile/ufacing.h trunk/pol-core/pol/module/uomod.cpp trunk/pol-core/pol/module/uomod.h trunk/pol-core/pol/module/uomod4.cpp trunk/pol-core/pol/multi/boat.cpp trunk/pol-core/pol/multi/boat.h trunk/pol-core/pol/multi/customhousehelp.cpp trunk/pol-core/pol/multi/house.cpp trunk/pol-core/pol/multi/house.h trunk/pol-core/pol/multi/multi.h trunk/pol-core/pol/multi/multidef.cpp trunk/pol-core/pol/multi/multidef.h trunk/pol-core/pol/multi/multidef2.cpp trunk/pol-core/pol/npc.cpp trunk/pol-core/pol/pol.cpp trunk/pol-core/pol/poltype.h trunk/pol-core/pol/region.cpp trunk/pol-core/pol/resource.cpp trunk/pol-core/pol/startloc.h trunk/pol-core/pol/uimport.cpp trunk/pol-core/pol/umap.cpp trunk/pol-core/pol/uofile.h trunk/pol-core/pol/uofile06.cpp trunk/pol-core/pol/uofile08.cpp trunk/pol-core/pol/uofilei.h trunk/pol-core/pol/uopathnode.h trunk/pol-core/pol/wrldsize.h trunk/pol-core/pol/zone.h trunk/pol-core/poltool/poltool.cpp trunk/pol-core/uoconvert/uoconvert.cpp trunk/pol-core/uotool/uotool.cpp Modified: trunk/pol-core/bscript/execmodl.h =================================================================== --- trunk/pol-core/bscript/execmodl.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/bscript/execmodl.h 2009-09-10 12:24:52 UTC (rev 41) @@ -54,6 +54,19 @@ return exec.getParam( param, value ); } + bool getParam( unsigned param, short& value ) + { + return exec.getParam( param, value ); + } + bool getParam( unsigned param, short& value, short maxval ) + { + return exec.getParam( param, value, maxval ); + } + bool getParam( unsigned param, short& value, short minval, short maxval ) + { + return exec.getParam( param, value, minval, maxval ); + } + bool getParam( unsigned param, unsigned short& value ) { return exec.getParam( param, value ); Modified: trunk/pol-core/bscript/executor.cpp =================================================================== --- trunk/pol-core/bscript/executor.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/bscript/executor.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -601,7 +601,91 @@ } } +bool Executor::getParam( unsigned param, short& value ) +{ + BObjectImp* imp = getParamImp2( param, BObjectImp::OTLong ); + if (imp) + { + BLong* plong = explicit_cast<BLong*,BObjectImp*>(imp); + long longvalue = plong->value(); + if (longvalue >= (long)SHRT_MIN && longvalue <= (long)SHRT_MAX) + { + value = static_cast<short>(longvalue); + return true; + } + else + { + string report = "Parameter " + decint(param) + " value " + decint(longvalue) + " out of expected range of [" + decint(SHRT_MIN) +".." + + decint(SHRT_MAX) + "]"; + func_result_ = new BError( report ); + return false; + } + } + else + { + return false; + } +} + +bool Executor::getParam( unsigned param, short& value, short maxval ) +{ + BObjectImp* imp = getParamImp2( param, BObjectImp::OTLong ); + if (imp) + { + BLong* plong = explicit_cast<BLong*,BObjectImp*>(imp); + + long longvalue = plong->value(); + if (longvalue >= (long)SHRT_MIN && longvalue <= maxval) + { + value = static_cast<short>(longvalue); + return true; + } + else + { + string report = "Parameter " + decint(param) + " value " + decint(longvalue) + " out of expected range of [" + decint(SHRT_MIN) +".." + + decint(maxval) + "]"; + func_result_ = new BError( report ); + return false; + } + } + else + { + return false; + } +} + +bool Executor::getParam( unsigned param, + short& value, + short minval, + short maxval ) +{ + BObjectImp* imp = getParamImp2( param, BObjectImp::OTLong ); + if (imp) + { + BLong* plong = explicit_cast<BLong*,BObjectImp*>(imp); + + long longvalue = plong->value(); + if (longvalue >= minval && longvalue <= maxval) + { + value = static_cast<short>(longvalue); + return true; + } + else + { + string report = "Parameter " + decint(param) + " value " + decint(longvalue) + " out of expected range of [" + decint(minval) +".." + + decint(maxval) + "]"; + func_result_ = new BError( report ); + return false; + } + } + else + { + return false; + } +} + + BObjectRef& Executor::LocalVar( unsigned long varnum ) { passert( Locals2 ); Modified: trunk/pol-core/bscript/executor.h =================================================================== --- trunk/pol-core/bscript/executor.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/bscript/executor.h 2009-09-10 12:24:52 UTC (rev 41) @@ -122,9 +122,13 @@ bool getParam( unsigned param, unsigned& value ); - bool getParam( unsigned param, unsigned short& value ); + bool getParam( unsigned param, unsigned short& value ); bool getParam( unsigned param, unsigned short& value, unsigned short maxval ); bool getParam( unsigned param, unsigned short& value, unsigned short minval, unsigned short maxval ); + + bool getParam( unsigned param, short& value ); + bool getParam( unsigned param, short& value, short maxval ); + bool getParam( unsigned param, short& value, short minval, short maxval ); void* getApplicPtrParam( unsigned param, const BApplicObjType* pointer_type ); BApplicObjBase* getApplicObjParam( unsigned param, const BApplicObjType* object_type ); Modified: trunk/pol-core/clib/cfgelem.h =================================================================== --- trunk/pol-core/clib/cfgelem.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/clib/cfgelem.h 2009-09-10 12:24:52 UTC (rev 41) @@ -95,6 +95,7 @@ void add_prop( const char *propname, const char *str ); void add_prop( const char *propname, unsigned long lval ); void add_prop( const char *propname, unsigned short sval ); + void add_prop( const char *propname, short sval ); void throw_error( const string& errmsg ) const; void warn( const string& errmsg ) const; Modified: trunk/pol-core/clib/cfgfile.cpp =================================================================== --- trunk/pol-core/clib/cfgfile.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/clib/cfgfile.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -555,6 +555,14 @@ properties.insert( make_pair(string(propname), OSTRINGSTREAM_STR(os)) ); } +void ConfigElem::add_prop( const char* propname, short sval ) +{ + OSTRINGSTREAM os; + os << sval; + + properties.insert( make_pair(string(propname), OSTRINGSTREAM_STR(os)) ); +} + void VectorConfigElem::add_prop( const char* propname, unsigned short sval ) { ConfigProperty* prop; Modified: trunk/pol-core/plib/filemapserver.cpp =================================================================== --- trunk/pol-core/plib/filemapserver.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/filemapserver.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -26,14 +26,14 @@ _cur_mapblock_index = 0; } -MAPCELL FileMapServer::GetMapCell( unsigned x, unsigned y ) const +MAPCELL FileMapServer::GetMapCell( unsigned short x, unsigned short y ) const { passert( x < _descriptor.width && y < _descriptor.height ); - unsigned xblock = x >> MAPBLOCK_SHIFT; - unsigned xcell = x & MAPBLOCK_CELLMASK; - unsigned yblock = y >> MAPBLOCK_SHIFT; - unsigned ycell = y & MAPBLOCK_CELLMASK; + unsigned short xblock = x >> MAPBLOCK_SHIFT; + unsigned short xcell = x & MAPBLOCK_CELLMASK; + unsigned short yblock = y >> MAPBLOCK_SHIFT; + unsigned short ycell = y & MAPBLOCK_CELLMASK; long block_index = yblock * (_descriptor.width >> MAPBLOCK_SHIFT) + xblock; if (block_index != _cur_mapblock_index) Modified: trunk/pol-core/plib/filemapserver.h =================================================================== --- trunk/pol-core/plib/filemapserver.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/filemapserver.h 2009-09-10 12:24:52 UTC (rev 41) @@ -22,7 +22,7 @@ explicit FileMapServer( const RealmDescriptor& descriptor ); virtual ~FileMapServer() { } - virtual MAPCELL GetMapCell( unsigned x, unsigned y ) const; + virtual MAPCELL GetMapCell( unsigned short x, unsigned short y ) const; protected: mutable BinaryFile _mapfile; Modified: trunk/pol-core/plib/inmemorymapserver.cpp =================================================================== --- trunk/pol-core/plib/inmemorymapserver.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/inmemorymapserver.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -30,14 +30,14 @@ { } -MAPCELL InMemoryMapServer::GetMapCell( unsigned x, unsigned y ) const +MAPCELL InMemoryMapServer::GetMapCell( unsigned short x, unsigned short y ) const { passert( x < _descriptor.width && y < _descriptor.height ); - unsigned xblock = x >> MAPBLOCK_SHIFT; - unsigned xcell = x & MAPBLOCK_CELLMASK; - unsigned yblock = y >> MAPBLOCK_SHIFT; - unsigned ycell = y & MAPBLOCK_CELLMASK; + unsigned short xblock = x >> MAPBLOCK_SHIFT; + unsigned short xcell = x & MAPBLOCK_CELLMASK; + unsigned short yblock = y >> MAPBLOCK_SHIFT; + unsigned short ycell = y & MAPBLOCK_CELLMASK; long block_index = yblock * (_descriptor.width >> MAPBLOCK_SHIFT) + xblock; const MAPBLOCK& mapblock = _mapblocks[ block_index ]; Modified: trunk/pol-core/plib/inmemorymapserver.h =================================================================== --- trunk/pol-core/plib/inmemorymapserver.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/inmemorymapserver.h 2009-09-10 12:24:52 UTC (rev 41) @@ -18,7 +18,7 @@ explicit InMemoryMapServer( const RealmDescriptor& descriptor ); virtual ~InMemoryMapServer(); - virtual MAPCELL GetMapCell( unsigned x, unsigned y ) const; + virtual MAPCELL GetMapCell( unsigned short x, unsigned short y ) const; private: vector<MAPBLOCK> _mapblocks; Modified: trunk/pol-core/plib/mapfunc.cpp =================================================================== --- trunk/pol-core/plib/mapfunc.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/mapfunc.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -72,7 +72,7 @@ return (~value & flags) == flags; } -u32 polflags_from_tileflags( unsigned tile, u32 uoflags, bool use_no_shoot, bool LOS_through_windows ) +u32 polflags_from_tileflags( unsigned short tile, u32 uoflags, bool use_no_shoot, bool LOS_through_windows ) { u32 mapflags = 0; @@ -217,7 +217,7 @@ return mapflags; } -u32 polflags_from_landtileflags( unsigned tile, u32 lt_flags ) +u32 polflags_from_landtileflags( unsigned short tile, u32 lt_flags ) { if (~lt_flags & USTRUCT_TILE::FLAG_BLOCKING) { // this seems to be the default. Modified: trunk/pol-core/plib/mapfunc.h =================================================================== --- trunk/pol-core/plib/mapfunc.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/mapfunc.h 2009-09-10 12:24:52 UTC (rev 41) @@ -15,8 +15,8 @@ class ConfigElem; -u32 polflags_from_tileflags( unsigned tile, u32 uoflags, bool use_no_shoot, bool LOS_through_windows ); -u32 polflags_from_landtileflags( unsigned tile, u32 lt_flags ); +u32 polflags_from_tileflags( unsigned short tile, u32 uoflags, bool use_no_shoot, bool LOS_through_windows ); +u32 polflags_from_landtileflags( unsigned short tile, u32 lt_flags ); unsigned long readflags( ConfigElem& elem ); Modified: trunk/pol-core/plib/mapserver.cpp =================================================================== --- trunk/pol-core/plib/mapserver.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/mapserver.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -105,7 +105,7 @@ } } -void MapServer::GetMapShapes( MapShapeList& shapes, unsigned x, unsigned y, unsigned long anyflags ) const +void MapServer::GetMapShapes( MapShapeList& shapes, unsigned short x, unsigned short y, unsigned long anyflags ) const { passert( x < _descriptor.width && y < _descriptor.height ); @@ -122,10 +122,10 @@ if (cell.flags & FLAG::MORE_SOLIDS) { - unsigned xblock = x >> SOLIDX_X_SHIFT; - unsigned xcell = x & SOLIDX_X_CELLMASK; - unsigned yblock = y >> SOLIDX_Y_SHIFT; - unsigned ycell = y & SOLIDX_Y_CELLMASK; + unsigned short xblock = x >> SOLIDX_X_SHIFT; + unsigned short xcell = x & SOLIDX_X_CELLMASK; + unsigned short yblock = y >> SOLIDX_Y_SHIFT; + unsigned short ycell = y & SOLIDX_Y_CELLMASK; long block = yblock * (_descriptor.width >> SOLIDX_X_SHIFT) + xblock; SOLIDX2_ELEM* pIndex2 = _index1[ block ]; Modified: trunk/pol-core/plib/mapserver.h =================================================================== --- trunk/pol-core/plib/mapserver.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/mapserver.h 2009-09-10 12:24:52 UTC (rev 41) @@ -23,8 +23,8 @@ virtual ~MapServer(); - virtual MAPCELL GetMapCell( unsigned x, unsigned y ) const = 0; - void GetMapShapes( MapShapeList& list, unsigned x, unsigned y, unsigned long anyflags ) const; + virtual MAPCELL GetMapCell( unsigned short x, unsigned short y ) const = 0; + void GetMapShapes( MapShapeList& list, unsigned short x, unsigned short y, unsigned long anyflags ) const; protected: explicit MapServer( const RealmDescriptor& descriptor ); Modified: trunk/pol-core/plib/mapshape.h =================================================================== --- trunk/pol-core/plib/mapshape.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/mapshape.h 2009-09-10 12:24:52 UTC (rev 41) @@ -12,8 +12,8 @@ struct MapShape { - int z; - int height; + short z; + short height; unsigned long flags; }; Modified: trunk/pol-core/plib/maptileserver.cpp =================================================================== --- trunk/pol-core/plib/maptileserver.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/maptileserver.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -28,10 +28,10 @@ MAPTILE_CELL MapTileServer::GetMapTile( unsigned short x, unsigned short y ) { - unsigned xblock = x >> MAPTILE_SHIFT; - unsigned xcell = x & MAPTILE_CELLMASK; - unsigned yblock = y >> MAPTILE_SHIFT; - unsigned ycell = y & MAPTILE_CELLMASK; + unsigned short xblock = x >> MAPTILE_SHIFT; + unsigned short xcell = x & MAPTILE_CELLMASK; + unsigned short yblock = y >> MAPTILE_SHIFT; + unsigned short ycell = y & MAPTILE_CELLMASK; long block_index = yblock * (_descriptor.width >> MAPTILE_SHIFT) + xblock; if (block_index != _cur_block_index) Modified: trunk/pol-core/plib/mapwriter.cpp =================================================================== --- trunk/pol-core/plib/mapwriter.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/mapwriter.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -66,7 +66,7 @@ ofs_cfg << "}" << endl; } -void MapWriter::CreateNewFiles(const string& realm_name, unsigned width, unsigned height) +void MapWriter::CreateNewFiles(const string& realm_name, unsigned short width, unsigned short height) { _realm_name = realm_name; _width = width; @@ -184,12 +184,12 @@ return _width * _height / MAPTILE_CHUNK / MAPTILE_CHUNK; } -void MapWriter::SetMapCell( unsigned x, unsigned y, MAPCELL cell ) +void MapWriter::SetMapCell( unsigned short x, unsigned short y, MAPCELL cell ) { - unsigned xblock = x >> MAPBLOCK_SHIFT; - unsigned xcell = x & MAPBLOCK_CELLMASK; - unsigned yblock = y >> MAPBLOCK_SHIFT; - unsigned ycell = y & MAPBLOCK_CELLMASK; + unsigned short xblock = x >> MAPBLOCK_SHIFT; + unsigned short xcell = x & MAPBLOCK_CELLMASK; + unsigned short yblock = y >> MAPBLOCK_SHIFT; + unsigned short ycell = y & MAPBLOCK_CELLMASK; // doh, need to know map geometry here. long blockIdx = yblock * (_width >> MAPBLOCK_SHIFT) + xblock; @@ -208,12 +208,12 @@ _block.cell[xcell][ycell] = cell; } -void MapWriter::SetMapTile( unsigned x, unsigned y, MAPTILE_CELL cell ) +void MapWriter::SetMapTile( unsigned short x, unsigned short y, MAPTILE_CELL cell ) { - unsigned xblock = x >> MAPTILE_SHIFT; - unsigned xcell = x & MAPTILE_CELLMASK; - unsigned yblock = y >> MAPTILE_SHIFT; - unsigned ycell = y & MAPTILE_CELLMASK; + unsigned short xblock = x >> MAPTILE_SHIFT; + unsigned short xcell = x & MAPTILE_CELLMASK; + unsigned short yblock = y >> MAPTILE_SHIFT; + unsigned short ycell = y & MAPTILE_CELLMASK; // doh, need to know map geometry here. long blockIdx = yblock * (_width >> MAPTILE_SHIFT) + xblock; @@ -276,7 +276,7 @@ _ofs_solidx2.write( reinterpret_cast<const char*>( &elem ), sizeof elem ); } -void MapWriter::SetSolidx2Offset( unsigned x_base, unsigned y_base, unsigned long offset ) +void MapWriter::SetSolidx2Offset( unsigned short x_base, unsigned short y_base, unsigned long offset ) { unsigned long elems_per_row = (_width / SOLIDX_X_SIZE); unsigned long index = (y_base / SOLIDX_Y_SIZE) * elems_per_row Modified: trunk/pol-core/plib/mapwriter.h =================================================================== --- trunk/pol-core/plib/mapwriter.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/mapwriter.h 2009-09-10 12:24:52 UTC (rev 41) @@ -23,12 +23,12 @@ MapWriter(); ~MapWriter(); - void SetMapCell( unsigned x, unsigned y, MAPCELL cell ); - void SetMapTile( unsigned x, unsigned y, MAPTILE_CELL cell ); + void SetMapCell( unsigned short x, unsigned short y, MAPCELL cell ); + void SetMapTile( unsigned short x, unsigned short y, MAPTILE_CELL cell ); void Flush(); - void CreateNewFiles(const string& realm_name, unsigned width, unsigned height); + void CreateNewFiles(const string& realm_name, unsigned short width, unsigned short height); void OpenExistingFiles(const string& realm_name); void WriteConfigFile(); @@ -39,7 +39,7 @@ void AppendSolid( const SOLIDS_ELEM& solid ); void AppendSolidx2Elem( const SOLIDX2_ELEM& elem ); - void SetSolidx2Offset( unsigned x_base, unsigned y_base, unsigned long offset ); + void SetSolidx2Offset( unsigned short x_base, unsigned short y_base, unsigned long offset ); unsigned width() const { return _width; } unsigned height() const { return _height; } @@ -55,8 +55,8 @@ private: string _realm_name; - unsigned _width; - unsigned _height; + unsigned short _width; + unsigned short _height; fstream _ofs_base; long _cur_mapblock_index; MAPBLOCK _block; Modified: trunk/pol-core/plib/realm.cpp =================================================================== --- trunk/pol-core/plib/realm.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/realm.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -80,12 +80,12 @@ delete[] zone; } -unsigned Realm::width() const +unsigned short Realm::width() const { return _Descriptor().width; } -unsigned Realm::height() const +unsigned short Realm::height() const { return _Descriptor().height; } @@ -95,7 +95,7 @@ return _Descriptor().season; } -bool Realm::valid( unsigned x, unsigned y, int z ) const +bool Realm::valid( unsigned short x, unsigned short y, short z ) const { return (x < _Descriptor().width && y < _Descriptor().height && z >= -128 && z <= 127); Modified: trunk/pol-core/plib/realm.h =================================================================== --- trunk/pol-core/plib/realm.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/realm.h 2009-09-10 12:24:52 UTC (rev 41) @@ -45,56 +45,56 @@ Realm* baserealm; const string shadowname; - unsigned width() const; - unsigned height() const; + unsigned short width() const; + unsigned short height() const; unsigned season() const; - bool valid( unsigned x, unsigned y, int z ) const; + bool valid( unsigned short x, unsigned short y, short z ) const; const string name() const; - bool walkheight(unsigned x, unsigned y, int oldz, - int* newz, + bool walkheight(unsigned short x, unsigned short y, short oldz, + short* newz, UMulti** pmulti, Item** pwalkon, bool doors_block, MOVEMODE movemode, int* gradual_boost = NULL); - bool walkheight( const Character* chr, unsigned x, unsigned y, int oldz, - int* newz, + bool walkheight( const Character* chr, unsigned short x, unsigned short y, short oldz, + short* newz, UMulti** pmulti, Item** pwalkon, int* gradual_boost = NULL); - bool lowest_walkheight( unsigned x, unsigned y, int oldz, - int* newz, + bool lowest_walkheight( unsigned short x, unsigned short y, short oldz, + short* newz, UMulti** pmulti, Item** pwalkon, bool doors_block, MOVEMODE movemode, int* gradual_boost = NULL); - bool dropheight( unsigned dropx, - unsigned dropy, - int dropz, - int chrz, - int* newz, + bool dropheight( unsigned short dropx, + unsigned short dropy, + short dropz, + short chrz, + short* newz, UMulti** pmulti ); bool has_los( const LosObj& att, const LosObj& tgt ) const; bool has_los( const UObject& iatt, const UObject& itgt ) const; bool has_los( const Character& iatt, const UObject& itgt ) const; - bool navigable( unsigned x, unsigned y, int z, int height ) const; + bool navigable( unsigned short x, unsigned short y, short z, short height ) const; - UMulti* find_supporting_multi( unsigned x, unsigned y, int z ); + UMulti* find_supporting_multi( unsigned short x, unsigned short y, short z ); - bool lowest_standheight( unsigned x, unsigned y, int* z ) const; - bool findstatic( unsigned x, unsigned y, unsigned objtype ) const; - void getstatics( StaticEntryList& statics, unsigned x, unsigned y ) const; - bool groundheight( unsigned x, unsigned y, int* z ) const; - MAPTILE_CELL getmaptile( unsigned x, unsigned y ) const; - void getmapshapes( MapShapeList& shapes, unsigned x, unsigned y, unsigned long anyflags ) const; - void readmultis( MapShapeList& vec, unsigned x, unsigned y, unsigned long flags ) const; - void readmultis( MapShapeList& vec, unsigned x, unsigned y, unsigned long flags, MultiList& mvec ); - void readmultis( StaticList& vec, unsigned x, unsigned y ) const; + bool lowest_standheight( unsigned short x, unsigned short y, short* z ) const; + bool findstatic( unsigned short x, unsigned short y, unsigned short objtype ) const; + void getstatics( StaticEntryList& statics, unsigned short x, unsigned short y ) const; + bool groundheight( unsigned short x, unsigned short y, short* z ) const; + MAPTILE_CELL getmaptile( unsigned short x, unsigned short y ) const; + void getmapshapes( MapShapeList& shapes, unsigned short x, unsigned short y, unsigned long anyflags ) const; + void readmultis( MapShapeList& vec, unsigned short x, unsigned short y, unsigned long flags ) const; + void readmultis( MapShapeList& vec, unsigned short x, unsigned short y, unsigned long flags, MultiList& mvec ); + void readmultis( StaticList& vec, unsigned short x, unsigned short y ) const; Zone** zone; set<unsigned long> global_hulls; //xy-smashed together @@ -110,35 +110,35 @@ protected: void standheight( MOVEMODE movemode, MapShapeList& shapes, - int oldz, bool* result, - int* newz, + short oldz, bool* result, + short* newz, int* gradual_boost = NULL ) const; void lowest_standheight( MOVEMODE movemode, MapShapeList& shapes, - int oldz, bool* result, - int* newz, + short oldz, bool* result, + short* newz, int* gradual_boost = NULL ) const; bool dropheight( MapShapeList& shapes, - int dropz, - int chrz, - int* newz ) const; + short dropz, + short chrz, + short* newz ) const; void readdynamics( MapShapeList& vec, - unsigned x, - unsigned y, + unsigned short x, + unsigned short y, Items& walkon_items, bool doors_block ); bool dynamic_item_blocks_los( const LosObj& att, const LosObj& target, - unsigned x, unsigned y, int z ) const; + unsigned short x, unsigned short y, short z ) const; - bool static_item_blocks_los( unsigned x, unsigned y, int z ) const; + bool static_item_blocks_los( unsigned short x, unsigned short y, short z ) const; bool los_blocked( const LosObj& att, const LosObj& target, - unsigned x, unsigned y, int z ) const; + unsigned short x, unsigned short y, short z ) const; - UMulti* find_supporting_multi( MultiList& mvec, int z ); + UMulti* find_supporting_multi( MultiList& mvec, short z ); private: RealmDescriptor _descriptor; Modified: trunk/pol-core/plib/realmdescriptor.cpp =================================================================== --- trunk/pol-core/plib/realmdescriptor.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/realmdescriptor.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -34,8 +34,8 @@ RealmDescriptor::RealmDescriptor( const string& realm_name, const string& realm_path, ConfigElem& elem ) : name(realm_name), file_path(realm_path), - width(elem.remove_unsigned( "width" )), - height(elem.remove_unsigned( "height" )), + width(elem.remove_ushort( "width" )), + height(elem.remove_ushort( "height" )), uomapid(elem.remove_unsigned( "uomapid", 0 )), uodif(elem.remove_bool( "uodif", false )), num_map_patches(elem.remove_unsigned( "num_map_patches", 0 )), Modified: trunk/pol-core/plib/realmdescriptor.h =================================================================== --- trunk/pol-core/plib/realmdescriptor.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/realmdescriptor.h 2009-09-10 12:24:52 UTC (rev 41) @@ -21,8 +21,8 @@ const string name; const string file_path; - const unsigned width; - const unsigned height; + const unsigned short width; + const unsigned short height; const unsigned uomapid; // map[n].mul, need to be able to tell the client this. const bool uodif; // use the *dif files? const unsigned num_map_patches; Modified: trunk/pol-core/plib/realmfunc.cpp =================================================================== --- trunk/pol-core/plib/realmfunc.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/realmfunc.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -41,7 +41,7 @@ #define HULL_HEIGHT_BUFFER 2 -bool Realm::lowest_standheight( unsigned x, unsigned y, int* z ) const +bool Realm::lowest_standheight( unsigned short x, unsigned short y, short* z ) const { static MapShapeList vec; vec.clear(); @@ -54,11 +54,11 @@ void Realm::standheight( MOVEMODE movemode, MapShapeList& shapes, - int oldz, - bool* result_out, int* newz_out, int* gradual_boost ) const + short oldz, + bool* result_out, short * newz_out, int* gradual_boost ) const { - int lowest_blocking_z = 128; - int highest_blocking_z = -127; + short lowest_blocking_z = 128; + short highest_blocking_z = -127; bool land_ok = (movemode & MOVEMODE_LAND) ? true : false; bool sea_ok = (movemode & MOVEMODE_SEA) ? true : false; int the_boost = 0; @@ -79,14 +79,14 @@ } - int newz = -200; + short newz = -200; bool result = false; for( MapShapeList::const_iterator itr = shapes.begin(); itr != shapes.end(); ++itr ) { const MapShape& shape = (*itr); unsigned long flags = shape.flags; - int ztop = shape.z + shape.height; + short ztop = shape.z + shape.height; #if ENABLE_POLTEST_OUTPUT if (static_debug_on) { @@ -178,8 +178,8 @@ void Realm::lowest_standheight( MOVEMODE movemode, MapShapeList& shapes, - int minz, - bool* result_out, int* newz_out, int* gradual_boost ) const + short minz, + bool* result_out, short* newz_out, int* gradual_boost ) const { bool land_ok = (movemode & MOVEMODE_LAND) ? true : false; bool sea_ok = (movemode & MOVEMODE_SEA) ? true : false; @@ -201,14 +201,14 @@ } - int newz = 255; + short newz = 255; bool result = false; for( MapShapeList::const_iterator itr = shapes.begin(); itr != shapes.end(); ++itr ) { const MapShape& shape = (*itr); unsigned long flags = shape.flags; - int ztop = shape.z + shape.height; + short ztop = shape.z + shape.height; #if ENABLE_POLTEST_OUTPUT if (static_debug_on) { @@ -283,10 +283,10 @@ } -Item* find_walkon_item( Items& ivec, int z ); +Item* find_walkon_item( Items& ivec, short z ); unsigned char flags_from_tileflags( unsigned long uoflags ); -void Realm::readdynamics( MapShapeList& vec, unsigned x, unsigned y, Items& walkon_items, bool doors_block ) +void Realm::readdynamics( MapShapeList& vec, unsigned short x, unsigned short y, Items& walkon_items, bool doors_block ) { ZoneItems& witems = getzone(x,y,this).items; for (ZoneItems::const_iterator itr = witems.begin(); itr != witems.end(); ++itr ) @@ -313,11 +313,11 @@ } } } -UMulti* find_supporting_multi( MultiList& mvec, int z ); +UMulti* find_supporting_multi( MultiList& mvec, short z ); // new Z given new X, Y, and old Z. -bool Realm::walkheight(unsigned x, unsigned y, int oldz, - int* newz, +bool Realm::walkheight(unsigned short x, unsigned short y, short oldz, + short * newz, UMulti** pmulti, Item** pwalkon, bool doors_block, MOVEMODE movemode, @@ -373,8 +373,8 @@ // new Z given new X, Y, and old Z. //dave: todo: return false if walking onto a custom house and not in the list of editing players, and no cmdlevel -bool Realm::walkheight( const Character* chr, unsigned x, unsigned y, int oldz, - int* newz, +bool Realm::walkheight( const Character* chr, unsigned short x, unsigned short y, short oldz, + short* newz, UMulti** pmulti, Item** pwalkon, int* gradual_boost) { static MapShapeList shapes; @@ -443,8 +443,8 @@ } -bool Realm::lowest_walkheight(unsigned x, unsigned y, int oldz, - int* newz, +bool Realm::lowest_walkheight(unsigned short x, unsigned short y, short oldz, + short* newz, UMulti** pmulti, Item** pwalkon, bool doors_block, MOVEMODE movemode, @@ -497,11 +497,11 @@ } -bool Realm::dropheight( unsigned dropx, - unsigned dropy, - int dropz, - int chrz, - int* newz, +bool Realm::dropheight( unsigned short dropx, + unsigned short dropy, + short dropz, + short chrz, + short* newz, UMulti** pmulti ) { static MapShapeList shapes; @@ -538,18 +538,18 @@ // used to be statics_dropheight bool Realm::dropheight( MapShapeList& shapes, - int dropz, - int chrz, - int* newz ) const + short dropz, + short chrz, + short* newz ) const { - int z = -128; + short z = -128; bool result = false; for( MapShapeList::const_iterator itr = shapes.begin(); itr != shapes.end(); ++itr ) { const MapShape& shape = (*itr); unsigned long flags = shape.flags; - int ztop = shape.z + shape.height; + short ztop = shape.z + shape.height; #if ENABLE_POLTEST_OUTPUT if (static_debug_on) { @@ -583,7 +583,7 @@ const MapShape& shape = (*itr); if (shape.flags & FLAG::BLOCKING) { - int ztop = shape.z + shape.height; + short ztop = shape.z + shape.height; if (shape.z <= z && // location blocked by some object z < ztop) @@ -616,7 +616,7 @@ } -void Realm::readmultis( MapShapeList& vec, unsigned x, unsigned y, unsigned long anyflags ) const +void Realm::readmultis( MapShapeList& vec, unsigned short x, unsigned short y, unsigned long anyflags ) const { unsigned short wxL, wyL, wxH, wyH; zone_convert_clip( x-64, y-64, this, wxL, wyL ); @@ -634,18 +634,18 @@ UHouse* house = multi->as_house(); if( house != NULL && house->IsCustom() ) //readshapes switches to working design if the house is being edited, //everyone in the house would use it for walking... - multi->readshapes( vec, int(x) - multi->x, int(y) - multi->y, multi->z ); + multi->readshapes( vec, s16(x) - multi->x, s16(y) - multi->y, multi->z ); else { const MultiDef& def = multi->multidef(); - def.readshapes( vec, int(x) - multi->x, int(y) - multi->y, multi->z, anyflags ); + def.readshapes( vec, s16(x) - multi->x, s16(y) - multi->y, multi->z, anyflags ); } } } } } -void Realm::readmultis( MapShapeList& vec, unsigned x, unsigned y, unsigned long anyflags, MultiList& mvec ) +void Realm::readmultis( MapShapeList& vec, unsigned short x, unsigned short y, unsigned long anyflags, MultiList& mvec ) { unsigned short wxL, wyL, wxH, wyH; zone_convert_clip( x-64, y-64, this, wxL, wyL ); @@ -663,13 +663,13 @@ UHouse* house = multi->as_house(); if( house != NULL && house->IsCustom() ) { - if( multi->readshapes( vec, int(x) - multi->x, int(y) - multi->y, multi->z ) ) + if( multi->readshapes( vec, s16(x) - multi->x, s16(y) - multi->y, multi->z ) ) mvec.push_back( multi ); } else { const MultiDef& def = multi->multidef(); - if (def.readshapes( vec, int(x) - multi->x, int(y) - multi->y, multi->z, anyflags )) + if (def.readshapes( vec, s16(x) - multi->x, s16(y) - multi->y, multi->z, anyflags )) { mvec.push_back( multi ); } @@ -679,7 +679,7 @@ } } -void Realm::readmultis( StaticList& vec, unsigned x, unsigned y ) const +void Realm::readmultis( StaticList& vec, unsigned short x, unsigned short y ) const { unsigned short wxL, wyL, wxH, wyH; zone_convert_clip( x-64, y-64, this, wxL, wyL ); @@ -708,7 +708,7 @@ } } -bool Realm::navigable( unsigned x, unsigned y, int z, int height = 0 ) const +bool Realm::navigable( unsigned short x, unsigned short y, short z, short height = 0 ) const { if (!valid( x,y,z )) @@ -743,7 +743,7 @@ return onwater; } -UMulti* Realm::find_supporting_multi( unsigned x, unsigned y, int z ) +UMulti* Realm::find_supporting_multi( unsigned short x, unsigned short y, short z ) { if (!valid( x,y,z )) { @@ -762,7 +762,7 @@ /* The supporting multi is the highest multi that is below or equal * to the Z-coord of the supported object. */ -UMulti* Realm::find_supporting_multi( MultiList& mvec, int z ) +UMulti* Realm::find_supporting_multi( MultiList& mvec, short z ) { UMulti* found = NULL; for( MultiList::const_iterator itr = mvec.begin(), end = mvec.end(); itr != end; ++itr ) @@ -780,7 +780,7 @@ return found; } -bool Realm::findstatic( unsigned x, unsigned y, unsigned objtype ) const +bool Realm::findstatic( unsigned short x, unsigned short y, unsigned short objtype ) const { if (is_shadowrealm) return baserealm->_staticserver->findstatic( x, y, objtype ); @@ -788,7 +788,7 @@ return _staticserver->findstatic( x, y, objtype ); } -void Realm::getstatics( StaticEntryList& statics, unsigned x, unsigned y ) const +void Realm::getstatics( StaticEntryList& statics, unsigned short x, unsigned short y ) const { if (is_shadowrealm) return baserealm->_staticserver->getstatics( statics, x, y ); @@ -796,7 +796,7 @@ _staticserver->getstatics( statics, x, y ); } -bool Realm::groundheight( unsigned x, unsigned y, int* z ) const +bool Realm::groundheight( unsigned short x, unsigned short y, short* z ) const { MAPTILE_CELL cell = _maptileserver->GetMapTile( x, y ); *z = cell.z; @@ -808,7 +808,7 @@ ((landtile_flags(cell.landtile) & FLAG::BLOCKING) == 0) ); } -MAPTILE_CELL Realm::getmaptile( unsigned x, unsigned y ) const +MAPTILE_CELL Realm::getmaptile( unsigned short x, unsigned short y ) const { if (is_shadowrealm) return baserealm->_maptileserver->GetMapTile( x, y ); @@ -816,7 +816,7 @@ return _maptileserver->GetMapTile( x, y ); } -void Realm::getmapshapes( MapShapeList& shapes, unsigned x, unsigned y, unsigned long anyflags ) const +void Realm::getmapshapes( MapShapeList& shapes, unsigned short x, unsigned short y, unsigned long anyflags ) const { if (is_shadowrealm) baserealm->_mapserver->GetMapShapes( shapes, x, y, anyflags ); Modified: trunk/pol-core/plib/realmlos.cpp =================================================================== --- trunk/pol-core/plib/realmlos.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/realmlos.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -56,7 +56,7 @@ /**************************** 3D LOS CHECKING *******************************/ bool Realm::dynamic_item_blocks_los( const LosObj& att, const LosObj& target, - unsigned x, unsigned y, int z ) const + unsigned short x, unsigned short y, short z ) const { ZoneItems& witems = getzone(x,y,const_cast<Realm*>(this)).items; @@ -87,7 +87,7 @@ return false; } -bool Realm::static_item_blocks_los( unsigned x, unsigned y, int z ) const +bool Realm::static_item_blocks_los( unsigned short x, unsigned short y, short z ) const { static MapShapeList shapes; shapes.clear(); @@ -97,8 +97,8 @@ for( MapShapeList::const_iterator itr = shapes.begin(), end = shapes.end(); itr != end; ++itr ) { const MapShape& shape = (*itr); - int ob_ht = shape.height; - int ob_z = shape.z; + short ob_ht = shape.height; + short ob_z = shape.z; #if ENABLE_POLTEST_OUTPUT cout << "static type " << hexint(itr->graphic) << " (flags " << hexint( tile_flags( itr->graphic ) ) << ", ht=" << ob_ht << ")" @@ -127,7 +127,7 @@ // Is any object occupying point (x,y,z) that is neither attacker nor target? bool Realm::los_blocked( const LosObj& att, const LosObj& target, - unsigned x, unsigned y, int z ) const + unsigned short x, unsigned short y, short z ) const { // if the target inhabits the location, LOS can't be blocked: if (att.x == x && @@ -157,13 +157,13 @@ bool Realm::has_los( const LosObj& att, const LosObj& tgt ) const { - int x1, y1, z1; // one of the endpoints - int x2, y2, z2; // the other endpoint - int xd, yd, zd; - int x, y, z; - int ax, ay, az; - int sx, sy, sz; - int dx, dy, dz; + short x1, y1, z1; // one of the endpoints + short x2, y2, z2; // the other endpoint + short xd, yd, zd; + short x, y, z; + short ax, ay, az; + short sx, sy, sz; + short dx, dy, dz; if ( (att.y < tgt.y) || (att.y == tgt.y && att.z < tgt.z) ) Modified: trunk/pol-core/plib/staticserver.cpp =================================================================== --- trunk/pol-core/plib/staticserver.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/staticserver.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -50,9 +50,9 @@ { wallclock_t start = wallclock(); cout << "Validating statics files: "; - for( unsigned y = 0; y < _descriptor.height; y += STATICBLOCK_CHUNK ) + for( unsigned short y = 0; y < _descriptor.height; y += STATICBLOCK_CHUNK ) { - for( unsigned x = 0; x < _descriptor.width; x += STATICBLOCK_CHUNK ) + for( unsigned short x = 0; x < _descriptor.width; x += STATICBLOCK_CHUNK ) { ValidateBlock( x, y ); } @@ -63,10 +63,10 @@ cout << "Completed in " << ms << " ms." << endl; } -void StaticServer::ValidateBlock( unsigned x, unsigned y ) const +void StaticServer::ValidateBlock( unsigned short x, unsigned short y ) const { - unsigned short x_block = static_cast<unsigned short>(x / STATICBLOCK_CHUNK); - unsigned short y_block = static_cast<unsigned short>(y / STATICBLOCK_CHUNK); + unsigned short x_block = x / STATICBLOCK_CHUNK; + unsigned short y_block = y / STATICBLOCK_CHUNK; unsigned long block_index = y_block * (_descriptor.width>>STATICBLOCK_SHIFT) + x_block; if (block_index+1 >= _index.size()) @@ -83,12 +83,12 @@ } } -bool StaticServer::findstatic( unsigned x, unsigned y, unsigned short objtype ) const +bool StaticServer::findstatic( unsigned short x, unsigned short y, unsigned short objtype ) const { passert( x < _descriptor.width && y < _descriptor.height ); - unsigned short x_block = static_cast<unsigned short>(x >> STATICBLOCK_SHIFT); - unsigned short y_block = static_cast<unsigned short>(y >> STATICBLOCK_SHIFT); + unsigned short x_block = x >> STATICBLOCK_SHIFT; + unsigned short y_block = y >> STATICBLOCK_SHIFT; unsigned short xy = ((x & STATICCELL_MASK) << 4) | (y & STATICCELL_MASK); unsigned long block_index = x_block + y_block * (_descriptor.width >> STATICBLOCK_SHIFT); @@ -110,12 +110,12 @@ return false; } -void StaticServer::getstatics( StaticEntryList& statics, unsigned x, unsigned y ) const +void StaticServer::getstatics( StaticEntryList& statics, unsigned short x, unsigned short y ) const { passert( x < _descriptor.width && y < _descriptor.height ); - unsigned short x_block = static_cast<unsigned short>(x >> STATICBLOCK_SHIFT); - unsigned short y_block = static_cast<unsigned short>(y >> STATICBLOCK_SHIFT); + unsigned short x_block = x >> STATICBLOCK_SHIFT; + unsigned short y_block = y >> STATICBLOCK_SHIFT; unsigned short xy = ((x & STATICCELL_MASK) << 4) | (y & STATICCELL_MASK); unsigned long block_index = x_block + y_block * (_descriptor.width >> STATICBLOCK_SHIFT); Modified: trunk/pol-core/plib/staticserver.h =================================================================== --- trunk/pol-core/plib/staticserver.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/staticserver.h 2009-09-10 12:24:52 UTC (rev 41) @@ -23,12 +23,12 @@ ~StaticServer(); StaticServer & operator=( const StaticServer & ) { return *this; } - bool findstatic( unsigned x, unsigned y, unsigned short objtype ) const; - void getstatics( StaticEntryList& statics, unsigned x, unsigned y ) const; + bool findstatic( unsigned short x, unsigned short y, unsigned short objtype ) const; + void getstatics( StaticEntryList& statics, unsigned short x, unsigned short y ) const; protected: void Validate() const; - void ValidateBlock( unsigned x, unsigned y ) const; + void ValidateBlock( unsigned short x, unsigned short y ) const; private: RealmDescriptor _descriptor; Modified: trunk/pol-core/plib/testdrop1.cpp =================================================================== --- trunk/pol-core/plib/testdrop1.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/testdrop1.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -18,8 +18,8 @@ extern Realm* p_test_realm; /* This code should mirror code in drop_item_on_ground */ -static void test_drop( int chrx, int chry, int chrz, - int dropx, int dropy, int dropz, bool exp_result, int exp_z ) +static void test_drop( unsigned short chrx, unsigned short chry, short chrz, + unsigned short dropx, unsigned short dropy, short dropz, bool exp_result, short exp_z ) { if (p_test_realm == NULL) p_test_realm = new Realm("britannia"); @@ -28,7 +28,7 @@ << dropx << "," << dropy << "," << dropz << "): " << "Expect " << exp_result << "," << exp_z << ": "; - int newz; + short newz; UMulti* multi; bool result = p_test_realm->dropheight( dropx,dropy,dropz, chrz, &newz, &multi ); cout << "Got " << result << "," << newz << ": "; Modified: trunk/pol-core/plib/testenv.cpp =================================================================== --- trunk/pol-core/plib/testenv.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/testenv.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -38,40 +38,40 @@ Item* test_chest2; NPC* test_orclord; -Item* add_item( unsigned short objtype, int x, int y, int z ) +Item* add_item( unsigned short objtype, unsigned short x, unsigned short y, short z ) { Item* item; item = Item::create( objtype ); passert(item); - item->x = static_cast<u16>(x); - item->y = static_cast<u16>(y); + item->x = x; + item->y = y; item->z = static_cast<s8>(z); item->realm = find_realm(string("britannia")); add_item_to_world( item ); return item; } -void add_multi( unsigned short objtype, int x, int y, int z ) +void add_multi( unsigned short objtype, unsigned short x, unsigned short y, short z ) { UMulti* multi = UMulti::create( find_itemdesc(objtype) ); passert(multi); - multi->x = static_cast<u16>(x); - multi->y = static_cast<u16>(y); + multi->x = x; + multi->y = y; multi->z = static_cast<s8>(z); multi->realm = find_realm(string("britannia")); add_multi_to_world( multi ); } -void add_multi( unsigned short objtype, int x, int y, int z, long flags ) +void add_multi( unsigned short objtype, unsigned short x, unsigned short y, short z, long flags ) { Realm* realm = find_realm(string("britannia")); - BObject obj( UMulti::scripted_create( find_itemdesc(objtype), static_cast<u16>(x), static_cast<u16>(y), static_cast<s8>(z), realm, flags ) ); + BObject obj( UMulti::scripted_create( find_itemdesc(objtype), x, y, static_cast<s8>(z), realm, flags ) ); } bool FindNpcTemplate( const char *template_name, ConfigFile& cfile, ConfigElem& elem ); -NPC* add_npc( const char* npctype, int x, int y, int z ) +NPC* add_npc( const char* npctype, unsigned short x, unsigned short y, short z ) { ConfigFile cfile; ConfigElem elem; @@ -87,9 +87,9 @@ elem.clear_prop( "Z" ); elem.add_prop( "Serial", GetNextSerialNumber() ); - elem.add_prop( "X", static_cast<unsigned short>(x) ); - elem.add_prop( "Y", static_cast<unsigned short>(y) ); - elem.add_prop( "Z", static_cast<unsigned short>(z) ); + elem.add_prop( "X", x ); + elem.add_prop( "Y", y ); + elem.add_prop( "Z", z ); npc->readPropertiesForNewNPC( elem ); objecthash.Insert( npc ); Modified: trunk/pol-core/plib/testwalk1.cpp =================================================================== --- trunk/pol-core/plib/testwalk1.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/plib/testwalk1.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -34,8 +34,8 @@ class UMulti; class Item; -bool pol_walkheight(int x, int y, int oldz, - int* newz, +bool pol_walkheight(unsigned short x, unsigned short y, short oldz, + short* newz, UMulti** psupporting_multi, Item** pwalkon_item, bool doors_block = true, @@ -43,15 +43,15 @@ Realm* p_test_realm; -static void test_walk( int oldx, int oldy, int oldz, - int newx, int newy, bool exp_result, int exp_z ) +static void test_walk( unsigned short oldx, unsigned short oldy, short oldz, + unsigned short newx, unsigned short newy, bool exp_result, short exp_z ) { RealmDescriptor r1 = RealmDescriptor::Load( "britannia" ); RealmDescriptor r2 = RealmDescriptor::Load( "ilshenar" ); if (p_test_realm == NULL) p_test_realm = new Realm("britannia"); - int newz; + short newz; cout << "WalkHeight(" << newx << "," << newy << "," << oldz << "): " << "Expect " << exp_result << "," << exp_z << ": "; @@ -79,13 +79,13 @@ inc_successes(); cout << "Ok!" << endl; } -static void test_walk2( int oldx, int oldy, int oldz, - int newx, int newy, bool doors_block, MOVEMODE movemode, bool exp_result, int exp_z ) +static void test_walk2( unsigned short oldx, unsigned short oldy, short oldz, + unsigned short newx, unsigned short newy, bool doors_block, MOVEMODE movemode, bool exp_result, short exp_z ) { if (p_test_realm == NULL) p_test_realm = new Realm("britannia"); - int newz; + short newz; cout << "WalkHeight(" << newx << "," << newy << "," << oldz << "): " << "Expect " << exp_result << "," << exp_z << ": "; Modified: trunk/pol-core/pol/clidata.h =================================================================== --- trunk/pol-core/pol/clidata.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/pol/clidata.h 2009-09-10 12:24:52 UTC (rev 41) @@ -11,7 +11,7 @@ #ifndef CLIDATA_H #define CLIDATA_H -bool groundheight( unsigned short x, unsigned short y, int* z ); +bool groundheight( unsigned short x, unsigned short y, short* z ); char tileheight(unsigned short tilenum); unsigned char tilelayer( unsigned short tilenum ); unsigned long tile_flags( unsigned short tilenum ); // POL flags Modified: trunk/pol-core/pol/core.cpp =================================================================== --- trunk/pol-core/pol/core.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/pol/core.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -42,12 +42,12 @@ bool move_character_to( Character* chr, unsigned short x, unsigned short y, - int z, + short z, long flags, Realm* oldrealm ) { // FIXME consider consolidating with similar code in CHARACTER.CPP - int newz; + short newz; UMulti* supporting_multi = NULL; Item* walkon_item = NULL; int new_boost = 0; @@ -141,7 +141,7 @@ 2) have a "walk on" script */ -Item* find_walkon_item( Items& ivec, int z ) +Item* find_walkon_item( Items& ivec, short z ) { //cout << "find walkon item, z=" << z << endl; for( Items::const_iterator itr = ivec.begin(), end = ivec.end(); itr != end; ++itr ) Modified: trunk/pol-core/pol/core.h =================================================================== --- trunk/pol-core/pol/core.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/pol/core.h 2009-09-10 12:24:52 UTC (rev 41) @@ -37,7 +37,7 @@ bool move_character_to( Character* chr, unsigned short x, unsigned short y, - int z, + short z, long flags, Realm* oldrealm ); @@ -76,7 +76,7 @@ const long JOURNAL_PRINT_NAME = 0x00; const long JOURNAL_PRINT_YOU_SEE = 0x01; -Item* find_walkon_item( Items& ivec, int z ); +Item* find_walkon_item( Items& ivec, short z ); void atomic_cout( const string& msg ); void restart_all_clients(); Modified: trunk/pol-core/pol/dropitem.cpp =================================================================== --- trunk/pol-core/pol/dropitem.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/pol/dropitem.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -290,7 +290,7 @@ Character* chr = client->chr; UMulti* multi; - int newz; + short newz; if (!inrangex( chr, x, y, 2) && !client->chr->can_moveanydist()) { Log("Client (Character %s) tried to drop an item out of range.\n",client->chr->name().c_str()); Modified: trunk/pol-core/pol/mobile/charactr.cpp =================================================================== --- trunk/pol-core/pol/mobile/charactr.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/pol/mobile/charactr.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -3437,10 +3437,10 @@ { if (facing & 1) // check if diagonal movement is allowed -- Nando (2009-02-26) { - int new_z; + short new_z; u8 tmp_facing = (facing+1) & 0x7; - unsigned tmp_newx = x + move_delta[ tmp_facing ].xmove; - unsigned tmp_newy = y + move_delta[ tmp_facing ].ymove; + unsigned short tmp_newx = x + move_delta[ tmp_facing ].xmove; + unsigned short tmp_newy = y + move_delta[ tmp_facing ].ymove; // needs to save because if only one direction is blocked, it shouldn't block ;) bool walk1 = realm->walkheight(this, tmp_newx, tmp_newy, z, &new_z, NULL, NULL, NULL ); @@ -3453,11 +3453,11 @@ return false; } - unsigned newx = x + move_delta[ facing ].xmove; - unsigned newy = y + move_delta[ facing ].ymove; + unsigned short newx = x + move_delta[ facing ].xmove; + unsigned short newy = y + move_delta[ facing ].ymove; // FIXME consider consolidating with similar code in UOEMOD.CPP - int newz; + short newz; UMulti* supporting_multi; Item* walkon_item; //cout << "checking walkheight" << endl; Modified: trunk/pol-core/pol/mobile/ufacing.h =================================================================== --- trunk/pol-core/pol/mobile/ufacing.h 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/pol/mobile/ufacing.h 2009-09-10 12:24:52 UTC (rev 41) @@ -129,7 +129,7 @@ return away; } -UFACING direction_away( const Character* src, long from_x, long from_y ) +UFACING direction_away( const Character* src, xcoord from_x, ycoord from_y ) { UFACING toward = direction_toward(src,from_x, from_y); UFACING away = away_cvt[ static_cast<int>(toward) ]; Modified: trunk/pol-core/pol/module/uomod.cpp =================================================================== --- trunk/pol-core/pol/module/uomod.cpp 2009-09-09 14:00:30 UTC (rev 40) +++ trunk/pol-core/pol/module/uomod.cpp 2009-09-10 12:24:52 UTC (rev 41) @@ -1032,11 +1032,11 @@ } } -BObjectImp* _complete_create_item_at_location( Item* item, long x, long y, long z, Realm* realm ) +BObjectImp* _complete_create_item_at_location( Item* item, unsigned short x, unsigned short y, short z, Realm* realm ) { //Dave moved these 3 lines up here 12/20 cuz x,y,z was uninit in the createscript. - item->x = static_cast<unsigned short>(x); - item->y = static_cast<unsigned short>(y); + item->x = x; + item->y = y; item->z = static_cast<signed char>(z); item->realm = realm; @@ -1064,7 +1064,8 @@ BObjectImp* UOExecutorModule::mf_CreateItemAtLocation(/* x,y,z,objtype,amount,realm */) { - long x, y, z; + unsigned short x, y; + short z; const ItemDesc* itemdesc; unsigned short amount; const String* strrealm; @@ -1103,7 +1104,8 @@ BObjectImp* UOExecutorModule::mf_CreateItemCopyAtLocation(/* x,y,z,item,realm */) { - long x, y, z; + unsigned short x, y; + short z; Item* origitem; const String* strrealm; if (getParam( 0, x ) && @@ -1138,7 +1140,8 @@ BObjectImp* UOExecutorModule::mf_CreateMultiAtLocation(/* x,y,z,objtype,flags,realm */) { - long x, y, z; + unsigned short x, y; + short z; const ItemDesc* descriptor; long flags = 0; const String* strrealm; @@ -1175,8 +1178,8 @@ } return UMulti::scripted_create( *descriptor, - static_cast<unsigned short>(x), - static_cast<unsigned short>(y), + x, + y, static_cast<signed char>(z), realm, flags ); } @@ -1222,7 +1225,8 @@ BObjectImp* UOExecutorModule::mf_CreateNpcFromTemplate() { const String* tmplname; - long x,y,z; + unsigned short x,y; + short z; const String* strrealm; Realm* realm = find_realm(string("britannia")); @@ -1269,7 +1273,7 @@ } MOVEMODE movemode = Character::decode_movemode( elem.read_string( "MoveMode", "L" ) ); - int newz; + short newz; UMulti* dummy_multi; Item* dummy_walkon; if (!realm->walkheight(x,y,z,&newz,&dummy_multi, &dummy_walkon, true, movemode)) @@ -1291,9 +1295,9 @@ elem.add_prop( "Serial", GetNextSerialNumber() ); // FIXME sanity check - elem.add_prop( "X", static_cast<unsigned short>(x) ); - elem.add_prop( "Y", static_cast<unsigned short>(y) ); - elem.add_prop( "Z", static_cast<unsigned short>(z) ); + elem.add_prop( "X", x ); + elem.add_prop( "Y", y ); + elem.add_prop( "Z", z ); elem.add_prop( "Realm", realm->name().c_str() ); if (custom_struct != NULL) replace_properties( elem, custom_struct ); @@ -1311,7 +1315,7 @@ ForEach( clients, send_char_data, static_cast<Character*>(npc.get()) ); //dave added 2/3/3 send entered area events for npc create - ForEachMobileInRange( static_cast<unsigned short>(x), static_cast<unsigned short>(y), realm, 32, + ForEachMobileInRange( x, y, realm, 32, NpcPropagateMove, static_cast<Character*>(npc.get()) ); if (dummy_multi) dummy_multi->register_object( npc.get() ); @@ -1449,7 +1453,8 @@ BObjectImp* UOExecutorModule::mf_PlaySoundEffectXYZ() { - long cx,cy,cz; + unsigned short cx,cy; + short cz; long effect; const String* strrealm; Realm* realm = find_realm(string("britannia")); @@ -1463,8 +1468,8 @@ if(!realm) return new BError("Realm not found"); if(!realm->valid(cx,cy,cz)) return new BError("Invalid Coordinates for realm"); - play_sound_effect_xyz( static_cast<unsigned short>(cx), - static_cast<unsigned short>(cy), + ... [truncated message content] |
From: <tu...@us...> - 2009-09-10 15:47:51
|
Revision: 42 http://polserver.svn.sourceforge.net/polserver/?rev=42&view=rev Author: turley Date: 2009-09-10 15:47:43 +0000 (Thu, 10 Sep 2009) Log Message: ----------- CompressedGump support (Grin) Modified Paths: -------------- trunk/pol-core/doc/core-changes.txt trunk/pol-core/pol/core.h trunk/pol-core/pol/module/uomod.h trunk/pol-core/pol/module/uomod2.cpp trunk/pol-core/pol/pktout.h trunk/pol-core/pol/pktoutid.h Modified: trunk/pol-core/doc/core-changes.txt =================================================================== --- trunk/pol-core/doc/core-changes.txt 2009-09-10 12:24:52 UTC (rev 41) +++ trunk/pol-core/doc/core-changes.txt 2009-09-10 15:47:43 UTC (rev 42) @@ -1,4 +1,10 @@ -- POL099 -- +09-10-2009 Turley: + Added: CompressedGump support packet 0xdd + Added: flag param to SendDialogGump() SENDDIALOGMENU_FORCE_OLD/0 default 0 + Note: SendDialogGump sends compressed gump if !SENDDIALOGMENU_FORCE_OLD && clientversion >=5.0.0a else old uncompressed + Note: Patch submitted by Grin + 09-09-2009 Turley: Added: ServSpecOpt CarryingCapacityMod (double default 1.0) as * modifier for mobile max_weight Note: Formula is (40 + strength * 7 / 2) * ssopt.CarryingCapacityMod Modified: trunk/pol-core/pol/core.h =================================================================== --- trunk/pol-core/pol/core.h 2009-09-10 12:24:52 UTC (rev 41) +++ trunk/pol-core/pol/core.h 2009-09-10 15:47:43 UTC (rev 42) @@ -63,6 +63,7 @@ const long FP_IGNORE_DOORS = 0x02; const long VENDOR_SEND_AOS_TOOLTIP = 0x01; +const long SENDDIALOGMENU_FORCE_OLD = 0x01; const long SAVE_FULL = 0x00; const long SAVE_INCREMENTAL = 0x01; Modified: trunk/pol-core/pol/module/uomod.h =================================================================== --- trunk/pol-core/pol/module/uomod.h 2009-09-10 12:24:52 UTC (rev 41) +++ trunk/pol-core/pol/module/uomod.h 2009-09-10 15:47:43 UTC (rev 42) @@ -18,6 +18,7 @@ 2008/07/08 Turley: Added mf_IsStackable - Is item stackable? 2009/08/08 MuadDib: mf_SetRawSkill(), mf_GetRawSkill(), mf_ApplyRawDamage(), mf_GameStat(), mf_AwardRawPoints(), old replace_properties(), mf_GetSkill() cleaned out. +2009/09/10 Turley: CompressedGump support (Grin) Notes ======= @@ -305,6 +306,8 @@ BObjectImp* internal_MoveBoat(UBoat* boat, xcoord x, ycoord y, zcoord z, long flags, Realm* newrealm); BObjectImp* internal_MoveContainer(UContainer* container, xcoord x, ycoord y, zcoord z, long flags, Realm* newrealm); void internal_InBoxAreaChecks(unsigned short &x1, unsigned short &y1, short &z1, unsigned short &x2, unsigned short &y2, short &z2, Realm* realm); + BObjectImp* UOExecutorModule::internal_SendUnCompressedGumpMenu(Character* chr, ObjArray* layout_arr, ObjArray* data_arr, long x,long y); + BObjectImp* UOExecutorModule::internal_SendCompressedGumpMenu(Character* chr, ObjArray* layout_arr, ObjArray* data_arr, long x,long y); private: // not implemented UOExecutorModule( const UOExecutorModule& ); Modified: trunk/pol-core/pol/module/uomod2.cpp =================================================================== --- trunk/pol-core/pol/module/uomod2.cpp 2009-09-10 12:24:52 UTC (rev 41) +++ trunk/pol-core/pol/module/uomod2.cpp 2009-09-10 15:47:43 UTC (rev 42) @@ -18,6 +18,7 @@ 2009/08/06 MuadDib: Removed PasswordOnlyHash support 2009/09/03 MuadDib: Relocation of account related cpp/h Relocation of multi related cpp/h +2009/09/10 Turley: CompressedGump support (Grin) Notes ======= @@ -97,6 +98,7 @@ #include "../uoscrobj.h" #include "../uvars.h" #include "../uworld.h" +#include "../../../lib/zlib/zlib.h" static char buffer[ 65535 ]; @@ -751,7 +753,7 @@ const char* layout, const char* strings[] */ - long x, y; + long x, y, flags; Character* chr; ObjArray* layout_arr; ObjArray* data_arr; @@ -759,7 +761,8 @@ exec.getObjArrayParam( 1, layout_arr ) && exec.getObjArrayParam( 2, data_arr ) && exec.getParam( 3, x ) && - exec.getParam( 4, y )) ) + exec.getParam( 4, y ) && + exec.getParam( 5, flags ))) { return new BError( "Invalid parameter" ); } @@ -773,7 +776,15 @@ return new BError( "Client already has an active gump" ); } */ + if ((!(flags & SENDDIALOGMENU_FORCE_OLD)) && (chr->client->compareVersion(CLIENT_VER_50000))) + return internal_SendCompressedGumpMenu(chr, layout_arr, data_arr, x, y); + else + return internal_SendUnCompressedGumpMenu(chr, layout_arr, data_arr, x, y); +} + +BObjectImp* UOExecutorModule::internal_SendUnCompressedGumpMenu(Character* chr, ObjArray* layout_arr, ObjArray* data_arr, long x,long y) +{ PKTOUT_B0::HEADER* hdr; PKTOUT_B0::LAYOUT* playout; unsigned playout_idx; @@ -870,6 +881,97 @@ return new BLong(0); } +BObjectImp* UOExecutorModule::internal_SendCompressedGumpMenu(Character* chr, ObjArray* layout_arr, ObjArray* data_arr, long x,long y) +{ + PKTOUT_DD::HEADER *header = (PKTOUT_DD::HEADER *)buffer; + header->dialog_x = x; + header->dialog_y = y; + header->msgtype = PKTOUT_DD_ID; + header->serial = chr->serial_ext; + header->dialog_id = ctBEu32( this->uoexec.os_module->pid() ); + header->dialog_x = ctBEu32( header->dialog_x ); + header->dialog_y = ctBEu32( header->dialog_y ); + + PKTOUT_DD::LAYOUT *playout = (PKTOUT_DD::LAYOUT *)((u32)header+sizeof(PKTOUT_DD::HEADER)); + unsigned char *tempbufpos = bfr; + playout->layout_dlen = 0; + + for( unsigned i = 0; i < layout_arr->ref_arr.size(); ++i ) + { + BObject* bo = layout_arr->ref_arr[i].get(); + if (bo == NULL) + continue; + BObjectImp* imp = bo->impptr(); + std::string s = imp->getStringRep(); + + playout->layout_dlen += 4 + s.length(); + if (playout->layout_dlen > sizeof(bfr)) + return new BError( "Buffer length exceeded" ); + *tempbufpos++ = '{'; + *tempbufpos++ = ' '; + memcpy( tempbufpos, s.c_str(), s.length() ); + tempbufpos += s.length(); + *tempbufpos++ = ' '; + *tempbufpos++ = '}'; + } + playout->layout_dlen++; + if (playout->layout_dlen > sizeof(bfr)) + return new BError( "Buffer length exceeded" ); + *tempbufpos++ = '\0'; + + + playout->layout_clen = sizeof(bfr)*2; + if (compress(&playout->layout_cdata, &playout->layout_clen, bfr, playout->layout_dlen)) + return new BError( "Compression error" ); + playout->layout_dlen = ctBEu32( playout->layout_dlen ); + + + PKTOUT_DD::TEXT *ptext = (PKTOUT_DD::TEXT *)((u32)&playout->layout_cdata + playout->layout_clen); + playout->layout_clen = ctBEu32( playout->layout_clen+4 ); + + ptext->lines = 0; + ptext->text_dlen = 0; + u16 *tempwbufpos = (u16*)bfr; + + for( unsigned i = 0; i < data_arr->ref_arr.size(); ++i ) + { + BObject* bo = data_arr->ref_arr[i].get(); + if (bo == NULL) + continue; + ptext->lines++; + + BObjectImp* imp = bo->impptr(); + std::string s = imp->getStringRep(); + const char* string = s.c_str(); + ptext->text_dlen += (s.length()+1)*2; + + if (ptext->text_dlen > sizeof(bfr)) + return new BError( "Buffer length exceeded" ); + + *tempwbufpos++ = ctBEu16((u16)s.length()); + while (*string) + *tempwbufpos++ = (u16)(*string++) << 8; + } + + ptext->lines = ctBEu32(ptext->lines); + + ptext->text_clen = sizeof(bfr)*2; + if (compress(&ptext->text_cdata, &ptext->text_clen, bfr, ptext->text_dlen)) + return new BError( "Compression error" ); + + ptext->text_dlen = ctBEu32(ptext->text_dlen); + u16 msglen = (u16)((u32)&ptext->text_cdata - (u32)buffer + ptext->text_clen+1); + header->msglen = ctBEu16( msglen ); + ptext->text_clen = ctBEu32(ptext->text_clen+4); + + chr->client->transmit( buffer, msglen ); + chr->client->gd->add_gumpmod( this ); + //old_gump_uoemod = this; + gump_chr = chr; + uoexec.os_module->suspend(); + return new BLong(0); +} + class BIntHash : public BObjectImp { public: Modified: trunk/pol-core/pol/pktout.h =================================================================== --- trunk/pol-core/pol/pktout.h 2009-09-10 12:24:52 UTC (rev 41) +++ trunk/pol-core/pol/pktout.h 2009-09-10 15:47:43 UTC (rev 42) @@ -8,6 +8,7 @@ 2009/08/01 MuadDib: Added packet 0x86, 0x9C. Completed moving all "Outbound only" Packet structs to here. 2009/08/09 MuadDib: Re factor of Packet 0x25, 0x11 for naming convention 2009/08/14 Turley: PKTOUT_B9_V2 removed unk u16 and changed flag to u32 +2009/09/10 Turley: CompressedGump support (Grin) Notes ======= @@ -1200,6 +1201,31 @@ }; asserteql( sizeof(PKTOUT_DC), 9); +struct PKTOUT_DD { + struct HEADER { + u8 msgtype; + u16 msglen; + u32 serial; + u32 dialog_id; + u32 dialog_x; + u32 dialog_y; + }; + struct LAYOUT { + u32 layout_clen; + u32 layout_dlen; + u8 layout_cdata; + }; + struct TEXT { + u32 lines; + u32 text_clen; + u32 text_dlen; + u8 text_cdata; + }; +}; +asserteql( sizeof(PKTOUT_DD::HEADER), 19 ); +asserteql( sizeof(PKTOUT_DD::LAYOUT), 9 ); +asserteql( sizeof(PKTOUT_DD::TEXT), 13 ); + struct PKTOUT_E3 { u8 msgtype; u16 msglen; Modified: trunk/pol-core/pol/pktoutid.h =================================================================== --- trunk/pol-core/pol/pktoutid.h 2009-09-10 12:24:52 UTC (rev 41) +++ trunk/pol-core/pol/pktoutid.h 2009-09-10 15:47:43 UTC (rev 42) @@ -4,6 +4,7 @@ 2009/07/23 MuadDib: Initial creation. 2009/08/01 MuadDib: Completed moving all "Outbound only" Packet IDs to here. 2009/08/09 MuadDib: Re factor of Packet 0x25, 0x11 for naming convention +2009/09/10 Turley: CompressedGump support (Grin) Notes ======= @@ -117,6 +118,7 @@ PKTOUT_D8_ID = 0xD8, // Custom Housing PKTOUT_DC_ID = 0xDC, // Object Cahce/Revision (SE Introduced version) + PKTOUT_DD_ID = 0xDD, // Compressed Gump PKTOUT_E3_ID = 0xE3 // KR Encryption Response }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-11 12:48:46
|
Revision: 46 http://polserver.svn.sourceforge.net/polserver/?rev=46&view=rev Author: muaddib_pol Date: 2009-09-11 12:48:39 +0000 (Fri, 11 Sep 2009) Log Message: ----------- + CLib, Ecompile, and GP project updated for removal of .. include directory. Modified Paths: -------------- trunk/pol-core/bscript/bscript-2008.vcproj trunk/pol-core/clib/StdAfx.h trunk/pol-core/clib/cfgfile.h trunk/pol-core/clib/clib-2008.vcproj trunk/pol-core/clib/compileassert.h trunk/pol-core/clib/dirlist.h trunk/pol-core/clib/drarray.h trunk/pol-core/clib/mlog.h trunk/pol-core/clib/opnew.cpp trunk/pol-core/clib/passert.cpp trunk/pol-core/clib/passert.h trunk/pol-core/clib/strexcpt.h trunk/pol-core/clib/strset.h trunk/pol-core/clib/threadhelp.h trunk/pol-core/clib/tracebuf.h trunk/pol-core/clib/unicode.cpp trunk/pol-core/clib/unicode.h trunk/pol-core/clib/wnsckt.cpp trunk/pol-core/clib/wnsckt.h trunk/pol-core/clib/xmain.cpp trunk/pol-core/clib/xmlutil.h trunk/pol-core/ecompile/ecompile-2008.vcproj trunk/pol-core/ecompile/ecompile.cpp trunk/pol-core/ecompile/resource.h trunk/pol-core/gp/StdAfx.cpp trunk/pol-core/gp/gendef.cpp trunk/pol-core/gp/gp-2008.vcproj trunk/pol-core/gp/gphelp.cpp trunk/pol-core/gp/gtree.cpp trunk/pol-core/gp/tree.h trunk/pol-core/gp/treegen.cpp Modified: trunk/pol-core/bscript/bscript-2008.vcproj =================================================================== --- trunk/pol-core/bscript/bscript-2008.vcproj 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/bscript/bscript-2008.vcproj 2009-09-11 12:48:39 UTC (rev 46) @@ -43,7 +43,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="_DEBUG,WIN32,_LIB,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" Modified: trunk/pol-core/clib/StdAfx.h =================================================================== --- trunk/pol-core/clib/StdAfx.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/StdAfx.h 2009-09-11 12:48:39 UTC (rev 46) @@ -18,7 +18,7 @@ # define AFX_STDAFX_H__A572F903_DA2C_11D6_BC99_00AA006409CA__INCLUDED_ # if _MSC_VER > 1000 -# pragma once +# pragma once # endif // _MSC_VER > 1000 # define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers Modified: trunk/pol-core/clib/cfgfile.h =================================================================== --- trunk/pol-core/clib/cfgfile.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/cfgfile.h 2009-09-11 12:48:39 UTC (rev 46) @@ -12,15 +12,15 @@ #define CLIB_CFGFILE_H #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif #define CFGFILE_USES_IOSTREAMS 0 #if CFGFILE_USES_IOSTREAMS -#include <fstream> +# include <fstream> #else -#include <stdio.h> +# include <stdio.h> #endif #include <set> Modified: trunk/pol-core/clib/clib-2008.vcproj =================================================================== --- trunk/pol-core/clib/clib-2008.vcproj 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/clib-2008.vcproj 2009-09-11 12:48:39 UTC (rev 46) @@ -44,7 +44,7 @@ Name="VCCLCompilerTool" InlineFunctionExpansion="1" OmitFramePointers="true" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="NDEBUG,WIN32,_LIB,NOMINMAX,INC_PASSERT" StringPooling="true" ExceptionHandling="1" @@ -121,7 +121,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/EHac" Optimization="0" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="_DEBUG,WIN32,_LIB,NOMINMAX,INC_PASSERT" ExceptionHandling="0" BasicRuntimeChecks="3" Modified: trunk/pol-core/clib/compileassert.h =================================================================== --- trunk/pol-core/clib/compileassert.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/compileassert.h 2009-09-11 12:48:39 UTC (rev 46) @@ -14,11 +14,11 @@ extern char xxxyyyzzz[1]; #if _lint -#define asserteql(a,b) extern char xxxyyyzzz[1] -#define assertofs(type,var,pos) extern char xxxyyyzzz[1] +# define asserteql(a,b) extern char xxxyyyzzz[1] +# define assertofs(type,var,pos) extern char xxxyyyzzz[1] #else -#define asserteql(a,b) extern char xxxyyyzzz[ (unsigned)1 - (unsigned)(a^(b)) ] -#define assertofs(type,var,pos) asserteql( offsetof(type,var),pos ) +# define asserteql(a,b) extern char xxxyyyzzz[ (unsigned)1 - (unsigned)(a^(b)) ] +# define assertofs(type,var,pos) asserteql( offsetof(type,var),pos ) #endif #define arsize(a) (sizeof a / sizeof a[0]) Modified: trunk/pol-core/clib/dirlist.h =================================================================== --- trunk/pol-core/clib/dirlist.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/dirlist.h 2009-09-11 12:48:39 UTC (rev 46) @@ -13,10 +13,10 @@ #include <string> #ifdef _WIN32 -#include <windows.h> +# include <windows.h> #else -#include <sys/types.h> -#include <dirent.h> +# include <sys/types.h> +# include <dirent.h> #endif class DirList Modified: trunk/pol-core/clib/drarray.h =================================================================== --- trunk/pol-core/clib/drarray.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/drarray.h 2009-09-11 12:48:39 UTC (rev 46) @@ -11,7 +11,7 @@ #define __DRARRAY_H #ifndef __STDIO_H -#include <stdio.h> +# include <stdio.h> #endif /* GenDRArray - direct resizing array Modified: trunk/pol-core/clib/mlog.h =================================================================== --- trunk/pol-core/clib/mlog.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/mlog.h 2009-09-11 12:48:39 UTC (rev 46) @@ -13,6 +13,6 @@ extern ofstream mlog; #ifdef MEMORYLEAK -extern ofstream llog; -extern bool memoryleak_debug; + extern ofstream llog; + extern bool memoryleak_debug; #endif Modified: trunk/pol-core/clib/opnew.cpp =================================================================== --- trunk/pol-core/clib/opnew.cpp 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/opnew.cpp 2009-09-11 12:48:39 UTC (rev 46) @@ -13,21 +13,25 @@ */ #include "stl_inc.h" + #ifdef MEMORYLEAK -#include "mlog.h" +# include "mlog.h" #endif #include <stdexcept> + #ifdef _WIN32 -#include <malloc.h> +# include <malloc.h> #endif + #ifdef __linux__ -#include <malloc.h> +# include <malloc.h> #endif + #ifdef MEMORYLEAK -#include <time.h> +# include <time.h> -#define MEMORYLOGBLOCKS 0 +# define MEMORYLOGBLOCKS 0 #endif static unsigned long bytes_allocated = 0; Modified: trunk/pol-core/clib/passert.cpp =================================================================== --- trunk/pol-core/clib/passert.cpp 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/passert.cpp 2009-09-11 12:48:39 UTC (rev 46) @@ -20,8 +20,8 @@ #include "threadhelp.h" #ifdef _WIN32 -#include <windows.h> -#include "mdumpimp.h" +# include <windows.h> +# include "mdumpimp.h" #endif bool passert_disabled = true; Modified: trunk/pol-core/clib/passert.h =================================================================== --- trunk/pol-core/clib/passert.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/passert.h 2009-09-11 12:48:39 UTC (rev 46) @@ -13,16 +13,16 @@ #define CLIB_PASSERT_H #ifndef INC_PASSERT -#define INC_PASSERT 0 +# define INC_PASSERT 0 #endif #ifndef INC_PASSERT_PARANOID -#ifdef NDEBUG -#define INC_PASSERT_PARANOID 0 -#else -#define INC_PASSERT_PARANOID INC_PASSERT +# ifdef NDEBUG +# define INC_PASSERT_PARANOID 0 +# else +# define INC_PASSERT_PARANOID INC_PASSERT +# endif #endif -#endif extern bool passert_disabled; Modified: trunk/pol-core/clib/strexcpt.h =================================================================== --- trunk/pol-core/clib/strexcpt.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/strexcpt.h 2009-09-11 12:48:39 UTC (rev 46) @@ -12,7 +12,6 @@ #include <stdexcept> - // set_terminate // set_unexpected // set_se_handler Modified: trunk/pol-core/clib/strset.h =================================================================== --- trunk/pol-core/clib/strset.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/strset.h 2009-09-11 12:48:39 UTC (rev 46) @@ -11,7 +11,7 @@ #define STRSET_H #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif #include <set> Modified: trunk/pol-core/clib/threadhelp.h =================================================================== --- trunk/pol-core/clib/threadhelp.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/threadhelp.h 2009-09-11 12:48:39 UTC (rev 46) @@ -1,3 +1,13 @@ +/* +History +======= + + +Notes +======= + +*/ + #ifndef THREADHELP_H #define THREADHELP_H Modified: trunk/pol-core/clib/tracebuf.h =================================================================== --- trunk/pol-core/clib/tracebuf.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/tracebuf.h 2009-09-11 12:48:39 UTC (rev 46) @@ -1,3 +1,13 @@ +/* +History +======= + + +Notes +======= + +*/ + #ifndef CLIB_TRACEBUF_H #define CLIB_TRACEBUF_H Modified: trunk/pol-core/clib/unicode.cpp =================================================================== --- trunk/pol-core/clib/unicode.cpp 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/unicode.cpp 2009-09-11 12:48:39 UTC (rev 46) @@ -8,10 +8,10 @@ */ -#include "clib/stl_inc.h" +#include "stl_inc.h" -#include "clib/endian.h" -#include "clib/unicode.h" +#include "endian.h" +#include "unicode.h" // Warning: Make sure that your buffer if large enough! Don't forget to add space for null terminator if requested. bool convertArrayToUC(ObjArray*& in_text, u16* out_wtext, Modified: trunk/pol-core/clib/unicode.h =================================================================== --- trunk/pol-core/clib/unicode.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/unicode.h 2009-09-11 12:48:39 UTC (rev 46) @@ -1,13 +1,20 @@ -// History -// 2006/09/16 Shinigami: fixed Memory Overwrite Bug in convertArrayToUC +/* +History +======= +2006/09/16 Shinigami: fixed Memory Overwrite Bug in convertArrayToUC +Notes +======= + +*/ + #ifndef CLIB_UNICODE_H #define CLIB_UNICODE_H #include <string> -#include "bscript/bobject.h" -#include "pol/utype.h" +#include "../bscript/bobject.h" +#include "../pol/utype.h" //std::string toascii( const std::wstring& wstr ); //std::wstring tounicode( const std::string& str ); Modified: trunk/pol-core/clib/wnsckt.cpp =================================================================== --- trunk/pol-core/clib/wnsckt.cpp 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/wnsckt.cpp 2009-09-11 12:48:39 UTC (rev 46) @@ -15,32 +15,32 @@ #include <stdio.h> #ifdef _WIN32 -#include <windows.h> -#include <winsock.h> -#define SOCKET_ERRNO(x) WSA##x -#define socket_errno WSAGetLastError() -typedef int socklen_t; +# include <windows.h> +# include <winsock.h> +# define SOCKET_ERRNO(x) WSA##x +# define socket_errno WSAGetLastError() + typedef int socklen_t; #else -#include <netinet/in.h> -#include <netinet/tcp.h> -#include <arpa/inet.h> -#include <sys/socket.h> -#include <sys/time.h> -#include <sys/types.h> -#include <netdb.h> -#include <sys/time.h> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> -#define SOCKET_ERRNO(x) x -#define socket_errno errno +# include <netinet/in.h> +# include <netinet/tcp.h> +# include <arpa/inet.h> +# include <sys/socket.h> +# include <sys/time.h> +# include <sys/types.h> +# include <netdb.h> +# include <sys/time.h> +# include <unistd.h> +# include <fcntl.h> +# include <errno.h> +# define SOCKET_ERRNO(x) x +# define socket_errno errno -typedef int SOCKET; -#ifndef INVALID_SOCKET -#define INVALID_SOCKET (SOCKET)(-1) -#endif + typedef int SOCKET; +# ifndef INVALID_SOCKET +# define INVALID_SOCKET (SOCKET)(-1) +# endif #endif Modified: trunk/pol-core/clib/wnsckt.h =================================================================== --- trunk/pol-core/clib/wnsckt.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/wnsckt.h 2009-09-11 12:48:39 UTC (rev 46) @@ -2,9 +2,9 @@ #define __WNSCKT_H__ #ifdef _WIN32 -#include <winsock.h> +# include <winsock.h> #else -#include <sys/socket.h> +# include <sys/socket.h> #endif Modified: trunk/pol-core/clib/xmain.cpp =================================================================== --- trunk/pol-core/clib/xmain.cpp 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/xmain.cpp 2009-09-11 12:48:39 UTC (rev 46) @@ -17,8 +17,8 @@ #include "xmain.h" #ifdef _WIN32 - #include <windows.h> // for GetModuleFileName - #include <crtdbg.h> +# include <windows.h> // for GetModuleFileName +# include <crtdbg.h> #endif unsigned long refptr_count; Modified: trunk/pol-core/clib/xmlutil.h =================================================================== --- trunk/pol-core/clib/xmlutil.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/clib/xmlutil.h 2009-09-11 12:48:39 UTC (rev 46) @@ -1,3 +1,13 @@ +/* +History +======= + + +Notes +======= + +*/ + #ifndef CLIB_XMLUTIL_H #define CLIB_XMLUTIL_H Modified: trunk/pol-core/ecompile/ecompile-2008.vcproj =================================================================== --- trunk/pol-core/ecompile/ecompile-2008.vcproj 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/ecompile/ecompile-2008.vcproj 2009-09-11 12:48:39 UTC (rev 46) @@ -44,7 +44,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE,NOMINMAX,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -134,7 +134,7 @@ <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE,NOMINMAX,INC_PASSERT" StringPooling="true" RuntimeLibrary="0" Modified: trunk/pol-core/ecompile/ecompile.cpp =================================================================== --- trunk/pol-core/ecompile/ecompile.cpp 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/ecompile/ecompile.cpp 2009-09-11 12:48:39 UTC (rev 46) @@ -7,32 +7,34 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #ifdef WIN32 -#pragma warning(disable:4786) +# pragma warning(disable:4786) #endif +#include "../clib/xmain.h" + #include <string.h> #include <stdio.h> #include <time.h> -#include "clib/clib.h" -#include "clib/dirlist.h" -#include "clib/fileutil.h" -#include "clib/mdump.h" -#include "clib/progver.h" -#include "clib/wallclock.h" +#include "../clib/clib.h" +#include "../clib/dirlist.h" +#include "../clib/fileutil.h" +#include "../clib/mdump.h" +#include "../clib/progver.h" +#include "../clib/wallclock.h" -#include "plib/pkg.h" +#include "../plib/pkg.h" -#include "bscript/compilercfg.h" -#include "bscript/filefmt.h" -#include "bscript/userfunc.h" -#include "bscript/compiler.h" -#include "bscript/escriptv.h" -#include "bscript/executor.h" -#include "bscript/userfunc.h" +#include "../bscript/compilercfg.h" +#include "../bscript/filefmt.h" +#include "../bscript/userfunc.h" +#include "../bscript/compiler.h" +#include "../bscript/escriptv.h" +#include "../bscript/executor.h" +#include "../bscript/userfunc.h" ExecInstrFunc Executor::GetInstrFunc( const Token& token ) { @@ -649,8 +651,6 @@ return any; } -#include "clib/xmain.h" - void read_config_file( int argc, char* argv[]) { for(int i=1;i<argc;i++) Modified: trunk/pol-core/ecompile/resource.h =================================================================== --- trunk/pol-core/ecompile/resource.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/ecompile/resource.h 2009-09-11 12:48:39 UTC (rev 46) @@ -1,3 +1,13 @@ +/* +History +======= + + +Notes +======= + +*/ + //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by ecompile.rc Modified: trunk/pol-core/gp/StdAfx.cpp =================================================================== --- trunk/pol-core/gp/StdAfx.cpp 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/gp/StdAfx.cpp 2009-09-11 12:48:39 UTC (rev 46) @@ -10,5 +10,5 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" Modified: trunk/pol-core/gp/gendef.cpp =================================================================== --- trunk/pol-core/gp/gendef.cpp 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/gp/gendef.cpp 2009-09-11 12:48:39 UTC (rev 46) @@ -7,10 +7,10 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/random.h" +#include "../clib/random.h" #include "tree.h" GenDef::GenDef() : Modified: trunk/pol-core/gp/gp-2008.vcproj =================================================================== --- trunk/pol-core/gp/gp-2008.vcproj 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/gp/gp-2008.vcproj 2009-09-11 12:48:39 UTC (rev 46) @@ -43,7 +43,7 @@ <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="NDEBUG,WIN32,_LIB,NOMINMAX,INC_PASSERT" StringPooling="true" RuntimeLibrary="0" @@ -119,7 +119,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="_DEBUG,WIN32,_LIB,NOMINMAX,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" Modified: trunk/pol-core/gp/gphelp.cpp =================================================================== --- trunk/pol-core/gp/gphelp.cpp 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/gp/gphelp.cpp 2009-09-11 12:48:39 UTC (rev 46) @@ -7,10 +7,10 @@ */ -#include "clib/stl_inc.h" -#include "bscript/token.h" +#include "../clib/stl_inc.h" +#include "../bscript/token.h" -#include "gp/gphelp.h" +#include "gphelp.h" #include "tree.h" Token MakeFunctionToken( unsigned module, unsigned funcidx ) Modified: trunk/pol-core/gp/gtree.cpp =================================================================== --- trunk/pol-core/gp/gtree.cpp 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/gp/gtree.cpp 2009-09-11 12:48:39 UTC (rev 46) @@ -7,9 +7,9 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/random.h" +#include "../clib/random.h" #include "tree.h" Modified: trunk/pol-core/gp/tree.h =================================================================== --- trunk/pol-core/gp/tree.h 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/gp/tree.h 2009-09-11 12:48:39 UTC (rev 46) @@ -14,7 +14,7 @@ #include <string> #include <vector> -#include "bscript/token.h" +#include "../bscript/token.h" extern long n_GIndividual; extern long n_GPopulation; Modified: trunk/pol-core/gp/treegen.cpp =================================================================== --- trunk/pol-core/gp/treegen.cpp 2009-09-11 12:15:05 UTC (rev 45) +++ trunk/pol-core/gp/treegen.cpp 2009-09-11 12:48:39 UTC (rev 46) @@ -7,12 +7,12 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <math.h> -#include "bscript/eprog.h" -#include "clib/random.h" +#include "../bscript/eprog.h" +#include "../clib/random.h" #include "tree.h" #include "gphelp.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-11 13:13:14
|
Revision: 45 http://polserver.svn.sourceforge.net/polserver/?rev=45&view=rev Author: muaddib_pol Date: 2009-09-11 12:15:05 +0000 (Fri, 11 Sep 2009) Log Message: ----------- + bscript project upgrade to use literal paths. Removed include of ".." + Couple format/cleanup Modified Paths: -------------- trunk/pol-core/bscript/StdAfx.cpp trunk/pol-core/bscript/berror.cpp trunk/pol-core/bscript/blong.cpp trunk/pol-core/bscript/bobject.h trunk/pol-core/bscript/bscript-2008.vcproj trunk/pol-core/bscript/bstruct.cpp trunk/pol-core/bscript/bstruct.h trunk/pol-core/bscript/compctx.cpp trunk/pol-core/bscript/compiler.cpp trunk/pol-core/bscript/compiler.h trunk/pol-core/bscript/compilercfg.cpp trunk/pol-core/bscript/dbl.cpp trunk/pol-core/bscript/dict.cpp trunk/pol-core/bscript/eprog.cpp trunk/pol-core/bscript/eprog.h trunk/pol-core/bscript/eprog2.cpp trunk/pol-core/bscript/eprog3.cpp trunk/pol-core/bscript/eprog_read.cpp trunk/pol-core/bscript/escript_config.cpp trunk/pol-core/bscript/escriptv.cpp trunk/pol-core/bscript/escriptv.h trunk/pol-core/bscript/escrutil.cpp trunk/pol-core/bscript/execmodl.cpp trunk/pol-core/bscript/executor.cpp trunk/pol-core/bscript/filefmt.h trunk/pol-core/bscript/fmodule.cpp trunk/pol-core/bscript/fmodule.h trunk/pol-core/bscript/object.cpp trunk/pol-core/bscript/objstrm.cpp trunk/pol-core/bscript/ofstrm.cpp trunk/pol-core/bscript/parser.cpp trunk/pol-core/bscript/str.cpp trunk/pol-core/bscript/symcont.cpp trunk/pol-core/bscript/symcont.h trunk/pol-core/bscript/tkn_strm.cpp trunk/pol-core/bscript/token.cpp trunk/pol-core/bscript/userfunc.cpp trunk/pol-core/clib/endian.h trunk/pol-core/pol/allocd.cpp trunk/pol-core/pol/clfunc.cpp trunk/pol-core/pol/clfunc.h trunk/pol-core/pol/pktin.h trunk/pol-core/pol/pktout.h trunk/pol-core/pol/reftypes.h trunk/pol-core/pol/textcmd.cpp trunk/pol-core/pol/ufunc.h trunk/pol-core/pol/uobject.h trunk/pol-core/pol/utype.h Added Paths: ----------- branches/ tags/ Modified: trunk/pol-core/bscript/StdAfx.cpp =================================================================== --- trunk/pol-core/bscript/StdAfx.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/StdAfx.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -13,5 +13,5 @@ stdafx.obj will contain the pre-compiled type information */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" Modified: trunk/pol-core/bscript/berror.cpp =================================================================== --- trunk/pol-core/bscript/berror.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/berror.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,7 +7,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include "berror.h" #include "impstr.h" Modified: trunk/pol-core/bscript/blong.cpp =================================================================== --- trunk/pol-core/bscript/blong.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/blong.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,12 +7,12 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdlib.h> #include <string.h> -#include "clib/stlutil.h" +#include "../clib/stlutil.h" #include "berror.h" #include "bobject.h" Modified: trunk/pol-core/bscript/bobject.h =================================================================== --- trunk/pol-core/bscript/bobject.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/bobject.h 2009-09-11 12:15:05 UTC (rev 45) @@ -17,11 +17,11 @@ #pragma warning(disable:4786) #endif -#include "clib/clib.h" -#include "clib/fixalloc.h" -#include "clib/passert.h" +#include "../clib/clib.h" +#include "../clib/fixalloc.h" +#include "../clib/passert.h" -#include "clib/refptr.h" +#include "../clib/refptr.h" #include "escriptv.h" class BObjectImp; Modified: trunk/pol-core/bscript/bscript-2008.vcproj =================================================================== --- trunk/pol-core/bscript/bscript-2008.vcproj 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/bscript-2008.vcproj 2009-09-11 12:15:05 UTC (rev 45) @@ -117,7 +117,7 @@ <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="NDEBUG,WIN32,_LIB,INC_PASSERT" StringPooling="true" RuntimeLibrary="0" Modified: trunk/pol-core/bscript/bstruct.cpp =================================================================== --- trunk/pol-core/bscript/bstruct.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/bstruct.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -10,9 +10,9 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/stlutil.h" +#include "../clib/stlutil.h" #include "bstruct.h" #include "berror.h" #include "impstr.h" Modified: trunk/pol-core/bscript/bstruct.h =================================================================== --- trunk/pol-core/bscript/bstruct.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/bstruct.h 2009-09-11 12:15:05 UTC (rev 45) @@ -12,7 +12,7 @@ #define BSCRIPT_BSTRUCT_H #include "bobject.h" -#include "clib/maputil.h" +#include "../clib/maputil.h" class BStruct : public BObjectImp { Modified: trunk/pol-core/bscript/compctx.cpp =================================================================== --- trunk/pol-core/bscript/compctx.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/compctx.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,7 +7,8 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include "compctx.h" CompilerContext::CompilerContext() : Modified: trunk/pol-core/bscript/compiler.cpp =================================================================== --- trunk/pol-core/bscript/compiler.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/compiler.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -20,7 +20,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #ifdef WIN32 # pragma warning(disable:4786) @@ -34,13 +34,13 @@ # include <unistd.h> #endif -#include "clib/clib.h" -#include "clib/filecont.h" -#include "clib/fileutil.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" +#include "../clib/clib.h" +#include "../clib/filecont.h" +#include "../clib/fileutil.h" +#include "../clib/stlutil.h" +#include "../clib/strutil.h" -#include "plib/pkg.h" +#include "../plib/pkg.h" #include "compctx.h" #include "compilercfg.h" @@ -53,7 +53,7 @@ #include "parser.h" #include "userfunc.h" #include "compiler.h" -#include "clib/xmain.h" +#include "../clib/xmain.h" #include "objmembers.h" Modified: trunk/pol-core/bscript/compiler.h =================================================================== --- trunk/pol-core/bscript/compiler.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/compiler.h 2009-09-11 12:15:05 UTC (rev 45) @@ -25,7 +25,7 @@ #endif #include "eprog.h" -#include "clib/maputil.h" +#include "../clib/maputil.h" #ifdef WIN32 #pragma warning(disable:4786) Modified: trunk/pol-core/bscript/compilercfg.cpp =================================================================== --- trunk/pol-core/bscript/compilercfg.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/compilercfg.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,12 +7,12 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/cfgfile.h" -#include "clib/cfgelem.h" -#include "clib/dirlist.h" -#include "clib/xmain.h" +#include "../clib/cfgfile.h" +#include "../clib/cfgelem.h" +#include "../clib/dirlist.h" +#include "../clib/xmain.h" #include "compilercfg.h" Modified: trunk/pol-core/bscript/dbl.cpp =================================================================== --- trunk/pol-core/bscript/dbl.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/dbl.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,13 +7,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <math.h> #include <stdlib.h> #include <string.h> -#include "clib/stlutil.h" +#include "../clib/stlutil.h" #include "berror.h" #include "bobject.h" Modified: trunk/pol-core/bscript/dict.cpp =================================================================== --- trunk/pol-core/bscript/dict.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/dict.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -9,11 +9,12 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include "dict.h" #include "executor.h" -#include "clib/stlutil.h" +#include "../clib/stlutil.h" #include "berror.h" #include "impstr.h" Modified: trunk/pol-core/bscript/eprog.cpp =================================================================== --- trunk/pol-core/bscript/eprog.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/eprog.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,11 +7,11 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdio.h> -#include "clib/stlutil.h" +#include "../clib/stlutil.h" #include "filefmt.h" Modified: trunk/pol-core/bscript/eprog.h =================================================================== --- trunk/pol-core/bscript/eprog.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/eprog.h 2009-09-11 12:15:05 UTC (rev 45) @@ -20,7 +20,7 @@ #include "token.h" #include "fmodule.h" -#include "clib/refptr.h" +#include "../clib/refptr.h" #include "executortype.h" Modified: trunk/pol-core/bscript/eprog2.cpp =================================================================== --- trunk/pol-core/bscript/eprog2.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/eprog2.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,12 +7,12 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" // EPROG compiler-only functions -#include "clib/clib.h" -#include "clib/passert.h" -#include "clib/stlutil.h" +#include "../clib/clib.h" +#include "../clib/passert.h" +#include "../clib/stlutil.h" #include "escriptv.h" #include "filefmt.h" Modified: trunk/pol-core/bscript/eprog3.cpp =================================================================== --- trunk/pol-core/bscript/eprog3.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/eprog3.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,7 +7,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include "eprog.h" Modified: trunk/pol-core/bscript/eprog_read.cpp =================================================================== --- trunk/pol-core/bscript/eprog_read.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/eprog_read.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -10,11 +10,11 @@ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdio.h> -#include "clib/strutil.h" +#include "../clib/strutil.h" #include "filefmt.h" Modified: trunk/pol-core/bscript/escript_config.cpp =================================================================== --- trunk/pol-core/bscript/escript_config.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/escript_config.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,7 +7,8 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include "config.h" EScriptConfig escript_config; Modified: trunk/pol-core/bscript/escriptv.cpp =================================================================== --- trunk/pol-core/bscript/escriptv.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/escriptv.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -8,9 +8,10 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include "escriptv.h" + bool ecompile_include_debug_sections; int include_debug; Modified: trunk/pol-core/bscript/escriptv.h =================================================================== --- trunk/pol-core/bscript/escriptv.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/escriptv.h 2009-09-11 12:15:05 UTC (rev 45) @@ -11,7 +11,7 @@ #ifndef BSCRIPT_ESCRIPTV_H #define BSCRIPT_ESCRIPTV_H -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" extern int include_debug; Modified: trunk/pol-core/bscript/escrutil.cpp =================================================================== --- trunk/pol-core/bscript/escrutil.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/escrutil.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -10,11 +10,11 @@ #include <math.h> -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "bscript/bobject.h" -#include "bscript/escrutil.h" -#include "bscript/impstr.h" +#include "bobject.h" +#include "escrutil.h" +#include "impstr.h" bool could_be_a_number( const char* s ) { Modified: trunk/pol-core/bscript/execmodl.cpp =================================================================== --- trunk/pol-core/bscript/execmodl.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/execmodl.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,13 +7,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <string.h> -#include "clib/clib.h" -#include "clib/mlog.h" -#include "clib/stlutil.h" +#include "../clib/clib.h" +#include "../clib/mlog.h" +#include "../clib/stlutil.h" #include "eprog.h" #include "executor.h" Modified: trunk/pol-core/bscript/executor.cpp =================================================================== --- trunk/pol-core/bscript/executor.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/executor.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -14,14 +14,14 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/clib.h" -#include "clib/logfile.h" -#include "clib/mlog.h" -#include "clib/passert.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" +#include "../clib/clib.h" +#include "../clib/logfile.h" +#include "../clib/mlog.h" +#include "../clib/passert.h" +#include "../clib/stlutil.h" +#include "../clib/strutil.h" #include "berror.h" #include "config.h" Modified: trunk/pol-core/bscript/filefmt.h =================================================================== --- trunk/pol-core/bscript/filefmt.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/filefmt.h 2009-09-11 12:15:05 UTC (rev 45) @@ -14,7 +14,7 @@ #ifndef __BSCRIPT_FILEFMT_H #define __BSCRIPT_FILEFMT_H -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" #ifdef _MSC_VER #pragma pack(push,1) Modified: trunk/pol-core/bscript/fmodule.cpp =================================================================== --- trunk/pol-core/bscript/fmodule.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/fmodule.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,10 +7,11 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include <stddef.h> -#include "clib/clib.h" +#include "../clib/clib.h" #include "options.h" #include "fmodule.h" Modified: trunk/pol-core/bscript/fmodule.h =================================================================== --- trunk/pol-core/bscript/fmodule.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/fmodule.h 2009-09-11 12:15:05 UTC (rev 45) @@ -17,7 +17,7 @@ class UserFunction; #include "options.h" -#include "clib/maputil.h" +#include "../clib/maputil.h" class ModuleFunction Modified: trunk/pol-core/bscript/object.cpp =================================================================== --- trunk/pol-core/bscript/object.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/object.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -10,14 +10,12 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" +#include "../clib/clib.h" +#include "../clib/stlutil.h" +#include "../clib/random.h" - -#include "clib/clib.h" -#include "clib/stlutil.h" -#include "clib/random.h" - #include "berror.h" #include "bobject.h" #include "bstruct.h" Modified: trunk/pol-core/bscript/objstrm.cpp =================================================================== --- trunk/pol-core/bscript/objstrm.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/objstrm.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,7 +7,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <string.h> Modified: trunk/pol-core/bscript/ofstrm.cpp =================================================================== --- trunk/pol-core/bscript/ofstrm.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/ofstrm.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,11 +7,10 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include <string.h> - - #include "ofile.h" Modified: trunk/pol-core/bscript/parser.cpp =================================================================== --- trunk/pol-core/bscript/parser.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/parser.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -31,7 +31,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdlib.h> @@ -40,10 +40,10 @@ #include <stddef.h> #include <stdio.h> -#include "clib/clib.h" -#include "clib/maputil.h" -#include "clib/rstack.h" -#include "clib/strutil.h" +#include "../clib/clib.h" +#include "../clib/maputil.h" +#include "../clib/rstack.h" +#include "../clib/strutil.h" #include "compilercfg.h" #include "fmodule.h" Modified: trunk/pol-core/bscript/str.cpp =================================================================== --- trunk/pol-core/bscript/str.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/str.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -10,7 +10,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdlib.h> #include <string.h> Modified: trunk/pol-core/bscript/symcont.cpp =================================================================== --- trunk/pol-core/bscript/symcont.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/symcont.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -8,13 +8,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdio.h> #include <string.h> #include <stdlib.h> -#include "clib/strutil.h" +#include "../clib/strutil.h" #include "tokens.h" #include "symcont.h" Modified: trunk/pol-core/bscript/symcont.h =================================================================== --- trunk/pol-core/bscript/symcont.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/symcont.h 2009-09-11 12:15:05 UTC (rev 45) @@ -12,8 +12,8 @@ #include <stdio.h> -#include "clib/passert.h" -#include "clib/rawtypes.h" +#include "../clib/passert.h" +#include "../clib/rawtypes.h" #ifndef __TOKENS_H #include "tokens.h" Modified: trunk/pol-core/bscript/tkn_strm.cpp =================================================================== --- trunk/pol-core/bscript/tkn_strm.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/tkn_strm.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,7 +7,8 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include <string.h> #include "modules.h" Modified: trunk/pol-core/bscript/token.cpp =================================================================== --- trunk/pol-core/bscript/token.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/token.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -8,13 +8,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdio.h> #include <string.h> #include <stdlib.h> -#include "clib/esignal.h" +#include "../clib/esignal.h" #include "modules.h" #include "tokens.h" Modified: trunk/pol-core/bscript/userfunc.cpp =================================================================== --- trunk/pol-core/bscript/userfunc.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/bscript/userfunc.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -7,7 +7,8 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include "userfunc.h" unsigned long UserFunction::_instances; Modified: trunk/pol-core/clib/endian.h =================================================================== --- trunk/pol-core/clib/endian.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/clib/endian.h 2009-09-11 12:15:05 UTC (rev 45) @@ -1,6 +1,7 @@ /* History ======= +2009/09/10 MuadDib: FlipEndian32 Update for compilers. Submitted by Grin. Notes ======= @@ -11,11 +12,11 @@ #define __CLIB_ENDIAN_H #ifndef __RAWTYPES_H -#include "rawtypes.h" +# include "rawtypes.h" #endif #ifndef U_BIG_ENDIAN -#define U_LITTLE_ENDIAN +# define U_LITTLE_ENDIAN #endif #define flipEndian32(x) (((unsigned)(x) >> 24) | (((unsigned)(x) >> 8) & 0x0000FF00) | (((x) << 8) & 0x00FF0000) | ((x) << 24)) @@ -24,28 +25,28 @@ #ifdef U_BIG_ENDIAN /* big endian */ -#define cfLEu32(x) flipEndian32(x) -#define cfLEu16(x) flipEndian16(x) -#define ctLEu32(x) flipEndian32(x) -#define ctLEu16(x) flipEndian16(x) +# define cfLEu32(x) flipEndian32(x) +# define cfLEu16(x) flipEndian16(x) +# define ctLEu32(x) flipEndian32(x) +# define ctLEu16(x) flipEndian16(x) -#define cfBEu32(x) (x) -#define cfBEu16(x) (x) -#define ctBEu32(x) (x) -#define ctBEu16(x) (x) +# define cfBEu32(x) (x) +# define cfBEu16(x) (x) +# define ctBEu32(x) (x) +# define ctBEu16(x) (x) #else /* little endian */ -#define cfLEu32(x) (x) -#define cfLEu16(x) (x) -#define ctLEu32(x) (x) -#define ctLEu16(x) (x) +# define cfLEu32(x) (x) +# define cfLEu16(x) (x) +# define ctLEu32(x) (x) +# define ctLEu16(x) (x) -#define cfBEu32(x) flipEndian32(x) -#define cfBEu16(x) flipEndian16(x) -#define ctBEu32(x) flipEndian32(x) -#define ctBEu16(x) flipEndian16(x) +# define cfBEu32(x) flipEndian32(x) +# define cfBEu16(x) flipEndian16(x) +# define ctBEu32(x) flipEndian32(x) +# define ctBEu16(x) flipEndian16(x) #endif Modified: trunk/pol-core/pol/allocd.cpp =================================================================== --- trunk/pol-core/pol/allocd.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/pol/allocd.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -9,9 +9,11 @@ */ #include "clib/stl_inc.h" + #ifdef _WIN32 -#include <malloc.h> +# include <malloc.h> #endif + #include <stddef.h> #include <stdio.h> Modified: trunk/pol-core/pol/clfunc.cpp =================================================================== --- trunk/pol-core/pol/clfunc.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/pol/clfunc.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -8,15 +8,15 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <assert.h> #include <stddef.h> -#include "clib/clib.h" -#include "clib/endian.h" -#include "clib/logfile.h" -#include "clib/passert.h" +#include "../clib/clib.h" +#include "../clib/endian.h" +#include "../clib/logfile.h" +#include "../clib/passert.h" #include "mobile/charactr.h" #include "network/client.h" Modified: trunk/pol-core/pol/clfunc.h =================================================================== --- trunk/pol-core/pol/clfunc.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/pol/clfunc.h 2009-09-11 12:15:05 UTC (rev 45) @@ -6,7 +6,7 @@ // this is for NULLs found.. #include <stddef.h> -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" #include "ufunc.h" #include "uconst.h" Modified: trunk/pol-core/pol/pktin.h =================================================================== --- trunk/pol-core/pol/pktin.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/pol/pktin.h 2009-09-11 12:15:05 UTC (rev 45) @@ -14,7 +14,7 @@ #ifndef __PKTINH #define __PKTINH -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" #include "layers.h" #include "pktinid.h" #include "pktdef.h" Modified: trunk/pol-core/pol/pktout.h =================================================================== --- trunk/pol-core/pol/pktout.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/pol/pktout.h 2009-09-11 12:15:05 UTC (rev 45) @@ -18,7 +18,7 @@ #ifndef __PKTOUTH #define __PKTOUTH -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" #include "layers.h" #include "pktoutid.h" #include "pktdef.h" Modified: trunk/pol-core/pol/reftypes.h =================================================================== --- trunk/pol-core/pol/reftypes.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/pol/reftypes.h 2009-09-11 12:15:05 UTC (rev 45) @@ -11,7 +11,7 @@ #ifndef REFTYPES_H #define REFTYPES_H -#include "clib/refptr.h" +#include "../clib/refptr.h" #ifdef NDEBUG // release mode Modified: trunk/pol-core/pol/textcmd.cpp =================================================================== --- trunk/pol-core/pol/textcmd.cpp 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/pol/textcmd.cpp 2009-09-11 12:15:05 UTC (rev 45) @@ -4,7 +4,8 @@ 2006/06/15 Austin: Removed .set .priv and .priv 2006/05/30 Shinigami: fixed a smaller mistype in textcmd_startlog() set correct time stamp in textcmd_startlog() and textcmd_stoplog() - 2009/09/03 MuadDib: Relocation of account related cpp/h +2009/09/03 MuadDib: Relocation of account related cpp/h +2009/09/10 MuadDib: Cleanup of depreciated internal text commands. Notes ======= @@ -697,18 +698,13 @@ bool process_command( Client *client, const char *text, const u16* wtext /*NULL*/, const char* lang /*NULL*/) { - //cout << "process_command: " << text << endl; static int init; if (!init) { init = 1; register_command( "armor", textcmd_listarmor ); register_command( "constat", textcmd_constat ); - // register_command( "i_create", textcmd_create ); - // register_command( "destroy", textcmd_destroy ); - // register_command( "eobjcount", &textcmd_eobjcount ); register_command( "heapcheck", &textcmd_heapcheck ); - // register_command( "i_help", textcmd_help ); register_command( "i_repdata", textcmd_repdata ); register_command( "t_ident", textcmd_ident ); register_command( "integ_item", textcmd_integ_item ); @@ -718,43 +714,15 @@ register_command( "list_scripts", &textcmd_list_scripts ); register_command( "log_profile", &textcmd_log_profile ); register_command( "log_profile_clear", &textcmd_log_profile_clear ); - // register_command( "los", &loscheck ); - // register_command( "objcount", &textcmd_objcount ); - // register_command( "t_online", &textcmd_online ); register_command( "orphans", &textcmd_orphans ); - // register_command( "priv", &txtcmd_priv ); - // register_command( "privs", &txtcmd_priv ); register_command( "procs", &textcmd_procs ); - // register_command( "t_props", &textcmd_props ); - // register_command( "res", &textcmd_resurrect ); register_command( "resendchars", &textcmd_resendchars ); - // register_command( "resme", &textcmd_resme ); - // register_command( "rpm", &textcmd_rpm ); - // register_command( "set", &txtcmd_list_settings ); register_command( "shutdown", &textcmd_shutdown ); register_command( "startlog", &textcmd_startlog ); register_command( "stoplog", &textcmd_stoplog ); register_command( "threads", &textcmd_threads ); - //register_command( "turn", &textcmd_turn ); - // register_command( "unloadall", &textcmd_unload_all ); - - // register_command( "where", &textcmd_where ); - //register_command( "wheretest", &wheretest ); - //register_command( "xxexp", &textcmd_experimental ); - - // register_command( "action ", &textcmd_action ); - // register_command( "armor ", &create_armor ); - // register_command( "bcast ", &textcmd_bcast ); - // register_command( "i_create ", &cmd_create ); - // register_command( "i_createnpc ", &txtcmd_createnpc ); register_command( "flag1 ", &textcmd_flag1 ); register_command( "flag2 ", &textcmd_flag2 ); - // register_command( "goto ", &textcmd_goto ); - // register_command( "log ", &textcmd_log ); - // register_command( "mycolor ", &txtcmd_mycolor ); - // register_command( "set ", &txtcmd_set ); - // register_command( "weapon ", &create_weapon ); - // register_command( "unload ", &textcmd_unload ); } ++text; // skip the "/" or "." Modified: trunk/pol-core/pol/ufunc.h =================================================================== --- trunk/pol-core/pol/ufunc.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/pol/ufunc.h 2009-09-11 12:15:05 UTC (rev 45) @@ -17,7 +17,7 @@ #include <stddef.h> -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" #include "uconst.h" #include "pktout.h" Modified: trunk/pol-core/pol/uobject.h =================================================================== --- trunk/pol-core/pol/uobject.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/pol/uobject.h 2009-09-11 12:15:05 UTC (rev 45) @@ -13,7 +13,7 @@ #define __UOBJECT_H #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif #include <iosfwd> @@ -23,14 +23,14 @@ #define pf_endl '\n' #ifndef __UCONST_H -#include "uconst.h" +# include "uconst.h" #endif #ifndef __CLIB_RAWTYPES_H -#include "clib/rawtypes.h" +# include "clib/rawtypes.h" #endif -#include "clib/refptr.h" +#include "../clib/refptr.h" #include "proplist.h" class BObjectImp; Modified: trunk/pol-core/pol/utype.h =================================================================== --- trunk/pol-core/pol/utype.h 2009-09-10 23:27:18 UTC (rev 44) +++ trunk/pol-core/pol/utype.h 2009-09-11 12:15:05 UTC (rev 45) @@ -12,7 +12,7 @@ #define __UTYPE_H #ifndef CLIB_RAWTYPES_H -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" #endif // I'm thinking of using these as parameters to functions, and as the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-11 16:03:11
|
Revision: 47 http://polserver.svn.sourceforge.net/polserver/?rev=47&view=rev Author: muaddib_pol Date: 2009-09-11 16:03:01 +0000 (Fri, 11 Sep 2009) Log Message: ----------- + All projects except /pol are now updated to use no .. include location. Literal paths used in source Modified Paths: -------------- trunk/pol-core/plib/filemapserver.cpp trunk/pol-core/plib/filemapserver.h trunk/pol-core/plib/inmemorymapserver.cpp trunk/pol-core/plib/mapcell.h trunk/pol-core/plib/mapfunc.cpp trunk/pol-core/plib/mapfunc.h trunk/pol-core/plib/mapserver.cpp trunk/pol-core/plib/mapsolid.h trunk/pol-core/plib/maptileserver.cpp trunk/pol-core/plib/maptileserver.h trunk/pol-core/plib/mapwriter.cpp trunk/pol-core/plib/pkg.cpp trunk/pol-core/plib/plib-2008.vcproj trunk/pol-core/plib/polver.cpp trunk/pol-core/plib/polver.h trunk/pol-core/plib/realm.cpp trunk/pol-core/plib/realm.h trunk/pol-core/plib/realmdescriptor.cpp trunk/pol-core/plib/realmlos.cpp trunk/pol-core/plib/realmlos2.cpp trunk/pol-core/plib/staticblock.h trunk/pol-core/plib/staticserver.cpp trunk/pol-core/plib/testdrop1.cpp trunk/pol-core/plib/testenv.cpp trunk/pol-core/plib/testlos1.cpp trunk/pol-core/plib/testwalk1.cpp trunk/pol-core/pol/objecthash.h trunk/pol-core/pol/pktboth.h trunk/pol-core/pol/polfile1.cpp trunk/pol-core/pol/poltype.h trunk/pol-core/pol/profile.h trunk/pol-core/pol/tiles.h trunk/pol-core/pol/uobject.h trunk/pol-core/pol/uofile00.cpp trunk/pol-core/pol/uofile01.cpp trunk/pol-core/pol/uofile02.cpp trunk/pol-core/pol/uofile06.cpp trunk/pol-core/pol/uofile07.cpp trunk/pol-core/pol/uofile08.cpp trunk/pol-core/pol/uoscrobj.h trunk/pol-core/pol/ustruct.h trunk/pol-core/pol/uworld.h trunk/pol-core/pol/zone.h trunk/pol-core/poltool/poltool.cpp trunk/pol-core/runecl/runecl-2008.vcproj trunk/pol-core/runecl/runecl.cpp trunk/pol-core/uoconvert/uoconvert-2008.vcproj trunk/pol-core/uoconvert/uoconvert.cpp trunk/pol-core/uotool/uofile04.cpp trunk/pol-core/uotool/uofile05.cpp trunk/pol-core/uotool/uotool-2008.vcproj Modified: trunk/pol-core/plib/filemapserver.cpp =================================================================== --- trunk/pol-core/plib/filemapserver.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/filemapserver.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,9 +7,9 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/passert.h" +#include "../clib/passert.h" #include "filemapserver.h" Modified: trunk/pol-core/plib/filemapserver.h =================================================================== --- trunk/pol-core/plib/filemapserver.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/filemapserver.h 2009-09-11 16:03:01 UTC (rev 47) @@ -10,7 +10,7 @@ #ifndef PLIB_FILEMAPSERVER_H #define PLIB_FILEMAPSERVER_H -#include "clib/binaryfile.h" +#include "../clib/binaryfile.h" #include "mapblock.h" #include "mapcell.h" Modified: trunk/pol-core/plib/inmemorymapserver.cpp =================================================================== --- trunk/pol-core/plib/inmemorymapserver.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/inmemorymapserver.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,10 +7,10 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/passert.h" -#include "clib/strutil.h" +#include "../clib/passert.h" +#include "../clib/strutil.h" #include "inmemorymapserver.h" Modified: trunk/pol-core/plib/mapcell.h =================================================================== --- trunk/pol-core/plib/mapcell.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/mapcell.h 2009-09-11 16:03:01 UTC (rev 47) @@ -10,7 +10,7 @@ #ifndef PLIB_MAPCELL_H #define PLIB_MAPCELL_H -#include "clib/compileassert.h" +#include "../clib/compileassert.h" struct FLAG { Modified: trunk/pol-core/plib/mapfunc.cpp =================================================================== --- trunk/pol-core/plib/mapfunc.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/mapfunc.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -9,17 +9,17 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/passert.h" +#include "../clib/cfgelem.h" +#include "../clib/passert.h" -#include "plib/mapcell.h" -#include "plib/mapshape.h" -#include "plib/realm.h" +#include "../plib/mapcell.h" +#include "../plib/mapshape.h" +#include "../plib/realm.h" -#include "pol/uconst.h" -#include "pol/ustruct.h" +#include "../pol/uconst.h" +#include "../pol/ustruct.h" #include "mapserver.h" @@ -119,53 +119,53 @@ mapflags |= FLAG::DESC_PREPEND_AN; } - if (use_no_shoot) + if (use_no_shoot) - { + { - if ((uoflags & USTRUCT_TILE::FLAG_WALL) && + if ((uoflags & USTRUCT_TILE::FLAG_WALL) && - (uoflags & (USTRUCT_TILE::FLAG_BLOCKING | USTRUCT_TILE::FLAG_DOOR)) + (uoflags & (USTRUCT_TILE::FLAG_BLOCKING | USTRUCT_TILE::FLAG_DOOR)) - ) + ) - mapflags |= FLAG::BLOCKSIGHT; + mapflags |= FLAG::BLOCKSIGHT; - + - if (uoflags & USTRUCT_TILE::FLAG_NO_SHOOT) + if (uoflags & USTRUCT_TILE::FLAG_NO_SHOOT) - mapflags |= FLAG::BLOCKSIGHT; + mapflags |= FLAG::BLOCKSIGHT; - + - if (!LOS_through_windows) + if (!LOS_through_windows) - { + { - if ((uoflags & USTRUCT_TILE::FLAG_WINDOW) && + if ((uoflags & USTRUCT_TILE::FLAG_WINDOW) && - (uoflags & USTRUCT_TILE::FLAG_WALL) + (uoflags & USTRUCT_TILE::FLAG_WALL) - ) + ) - mapflags |= FLAG::BLOCKSIGHT; + mapflags |= FLAG::BLOCKSIGHT; - } else + } else - { + { - if (uoflags & USTRUCT_TILE::FLAG_WINDOW) + if (uoflags & USTRUCT_TILE::FLAG_WINDOW) - mapflags &= ~FLAG::BLOCKSIGHT; + mapflags &= ~FLAG::BLOCKSIGHT; - } + } - } + } - else + else - { + { if ((uoflags & USTRUCT_TILE::FLAG_WALL) && (~uoflags & USTRUCT_TILE::FLAG_BLOCKING) && Modified: trunk/pol-core/plib/mapfunc.h =================================================================== --- trunk/pol-core/plib/mapfunc.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/mapfunc.h 2009-09-11 16:03:01 UTC (rev 47) @@ -11,7 +11,7 @@ #ifndef PLIB_MAPFUNC_H #define PLIB_MAPFUNC_H -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" class ConfigElem; Modified: trunk/pol-core/plib/mapserver.cpp =================================================================== --- trunk/pol-core/plib/mapserver.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/mapserver.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,11 +7,11 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/binaryfile.h" -#include "clib/passert.h" -#include "clib/strutil.h" +#include "../clib/binaryfile.h" +#include "../clib/passert.h" +#include "../clib/strutil.h" #include "filemapserver.h" #include "inmemorymapserver.h" Modified: trunk/pol-core/plib/mapsolid.h =================================================================== --- trunk/pol-core/plib/mapsolid.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/mapsolid.h 2009-09-11 16:03:01 UTC (rev 47) @@ -12,7 +12,7 @@ #ifndef PLIB_MAPBLOB_H #define PLIB_MAPBLOB_H -#include "clib/compileassert.h" +#include "../clib/compileassert.h" #define SOLIDX_X_SIZE 16 #define SOLIDX_X_SHIFT 4 Modified: trunk/pol-core/plib/maptileserver.cpp =================================================================== --- trunk/pol-core/plib/maptileserver.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/maptileserver.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,7 +7,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include "maptile.h" #include "maptileserver.h" Modified: trunk/pol-core/plib/maptileserver.h =================================================================== --- trunk/pol-core/plib/maptileserver.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/maptileserver.h 2009-09-11 16:03:01 UTC (rev 47) @@ -10,7 +10,7 @@ #ifndef PLIB_LANDTILESERVER_H #define PLIB_LANDTILESERVER_H -#include "clib/binaryfile.h" +#include "../clib/binaryfile.h" #include "maptile.h" #include "realmdescriptor.h" Modified: trunk/pol-core/plib/mapwriter.cpp =================================================================== --- trunk/pol-core/plib/mapwriter.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/mapwriter.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,12 +7,12 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/fileutil.h" -#include "clib/iohelp.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/fileutil.h" +#include "../clib/iohelp.h" #include "mapblock.h" #include "mapserver.h" @@ -20,7 +20,7 @@ #include "mapsolid.h" #include "maptile.h" -#include "pol/uofile.h" +#include "../pol/uofile.h" extern unsigned int num_map_patches; Modified: trunk/pol-core/plib/pkg.cpp =================================================================== --- trunk/pol-core/plib/pkg.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/pkg.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,15 +7,15 @@ */ -#include "clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/dirlist.h" -#include "clib/fileutil.h" -#include "clib/maputil.h" -#include "clib/passert.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" +#include "../clib/stl_inc.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/dirlist.h" +#include "../clib/fileutil.h" +#include "../clib/maputil.h" +#include "../clib/passert.h" +#include "../clib/stlutil.h" +#include "../clib/strutil.h" #include "pkg.h" #include "polver.h" Modified: trunk/pol-core/plib/plib-2008.vcproj =================================================================== --- trunk/pol-core/plib/plib-2008.vcproj 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/plib-2008.vcproj 2009-09-11 16:03:01 UTC (rev 47) @@ -43,7 +43,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="WIN32,_DEBUG,_LIB,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -118,7 +118,7 @@ <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="WIN32,NDEBUG,_LIB,INC_PASSERT" StringPooling="true" RuntimeLibrary="0" Modified: trunk/pol-core/plib/polver.cpp =================================================================== --- trunk/pol-core/plib/polver.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/polver.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -13,8 +13,8 @@ */ -#include "clib/stl_inc.h" -#include "clib/progver.h" +#include "../clib/stl_inc.h" +#include "../clib/progver.h" #include "polver.h" const char polverstr[] = "POL099beta-2009-04-14"; Modified: trunk/pol-core/plib/polver.h =================================================================== --- trunk/pol-core/plib/polver.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/polver.h 2009-09-11 16:03:01 UTC (rev 47) @@ -10,7 +10,7 @@ #ifndef POLVER_H #define POLVER_H -#include "clib/progver.h" +#include "../clib/progver.h" extern const char polverstr[]; extern const char polbuildtag[]; Modified: trunk/pol-core/plib/realm.cpp =================================================================== --- trunk/pol-core/plib/realm.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/realm.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -10,14 +10,14 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include "realm.h" #include "realmdescriptor.h" #include "mapserver.h" #include "staticserver.h" #include "maptileserver.h" -#include "pol/uworld.h" +#include "../pol/uworld.h" Realm::Realm( const string& realm_name, const string& realm_path ) : is_shadowrealm(false), Modified: trunk/pol-core/plib/realm.h =================================================================== --- trunk/pol-core/plib/realm.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/realm.h 2009-09-11 16:03:01 UTC (rev 47) @@ -15,8 +15,8 @@ #include "realmdescriptor.h" #include "staticblock.h" -#include "pol/uconst.h" // for MOVEMODE under gcc, bleh -#include "pol/udatfile.h" +#include "../pol/uconst.h" // for MOVEMODE under gcc, bleh +#include "../pol/udatfile.h" class Character; class Item; Modified: trunk/pol-core/plib/realmdescriptor.cpp =================================================================== --- trunk/pol-core/plib/realmdescriptor.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/realmdescriptor.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,11 +7,11 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/strutil.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/strutil.h" #include "realmdescriptor.h" Modified: trunk/pol-core/plib/realmlos.cpp =================================================================== --- trunk/pol-core/plib/realmlos.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/realmlos.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,7 +7,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include "realm.h" #include "mapcell.h" @@ -15,10 +15,10 @@ #include "inmemorymapserver.h" #include "mapshape.h" -#include "pol/uworld.h" // TODO move 'world' into Realm -#include "pol/item/item.h" -#include "pol/udatfile.h" -#include "pol/los.h" +#include "../pol/uworld.h" // TODO move 'world' into Realm +#include "../pol/item/item.h" +#include "../pol/udatfile.h" +#include "../pol/los.h" const int los_range = 20; const int z_los_range = 60; // unused as yet Modified: trunk/pol-core/plib/realmlos2.cpp =================================================================== --- trunk/pol-core/plib/realmlos2.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/realmlos2.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,9 +7,9 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include "realm.h" -#include "pol/los.h" +#include "../pol/los.h" #include "../pol/mobile/charactr.h" bool Realm::has_los( const UObject& iatt, const UObject& itgt ) const Modified: trunk/pol-core/plib/staticblock.h =================================================================== --- trunk/pol-core/plib/staticblock.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/staticblock.h 2009-09-11 16:03:01 UTC (rev 47) @@ -11,7 +11,7 @@ #ifndef PLIB_STATICBLOCK_H #define PLIB_STATICBLOCK_H -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" struct STATIC_INDEX { u32 index; Modified: trunk/pol-core/plib/staticserver.cpp =================================================================== --- trunk/pol-core/plib/staticserver.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/staticserver.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -8,12 +8,12 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/binaryfile.h" -#include "clib/passert.h" -#include "clib/stlutil.h" -#include "clib/wallclock.h" +#include "../clib/binaryfile.h" +#include "../clib/passert.h" +#include "../clib/stlutil.h" +#include "../clib/wallclock.h" #include "staticblock.h" #include "staticserver.h" Modified: trunk/pol-core/plib/testdrop1.cpp =================================================================== --- trunk/pol-core/plib/testdrop1.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/testdrop1.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,8 +7,8 @@ */ -#include "clib/stl_inc.h" -#include "pol/uconst.h" +#include "../clib/stl_inc.h" +#include "../pol/uconst.h" #include "realm.h" #include "mapserver.h" Modified: trunk/pol-core/plib/testenv.cpp =================================================================== --- trunk/pol-core/plib/testenv.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/testenv.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -8,24 +8,24 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <assert.h> -#include "clib/cfgfile.h" -#include "clib/cfgelem.h" -#include "clib/passert.h" -#include "plib/realm.h" +#include "../clib/cfgfile.h" +#include "../clib/cfgelem.h" +#include "../clib/passert.h" +#include "../plib/realm.h" -#include "pol/item/item.h" -#include "pol/item/itemdesc.h" -#include "pol/multi/multi.h" -#include "pol/npc.h" -#include "pol/objecthash.h" -#include "pol/realms.h" -#include "pol/ufunc.h" -#include "pol/uvars.h" -#include "pol/uworld.h" +#include "../pol/item/item.h" +#include "../pol/item/itemdesc.h" +#include "../pol/multi/multi.h" +#include "../pol/npc.h" +#include "../pol/objecthash.h" +#include "../pol/realms.h" +#include "../pol/ufunc.h" +#include "../pol/uvars.h" +#include "../pol/uworld.h" NPC* test_banker; NPC* test_banker2; Modified: trunk/pol-core/plib/testlos1.cpp =================================================================== --- trunk/pol-core/plib/testlos1.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/testlos1.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,12 +7,12 @@ */ -#include "clib/stl_inc.h" -#include "pol/uconst.h" -#include "pol/uobject.h" -#include "pol/los.h" -#include "pol/npc.h" -#include "pol/item/item.h" +#include "../clib/stl_inc.h" +#include "../pol/uconst.h" +#include "../pol/uobject.h" +#include "../pol/los.h" +#include "../pol/npc.h" +#include "../pol/item/item.h" #include "realm.h" #include "mapserver.h" Modified: trunk/pol-core/plib/testwalk1.cpp =================================================================== --- trunk/pol-core/plib/testwalk1.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/plib/testwalk1.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,9 +7,9 @@ */ -#include "clib/stl_inc.h" -#include "pol/uconst.h" -#include "pol/uobject.h" +#include "../clib/stl_inc.h" +#include "../pol/uconst.h" +#include "../pol/uobject.h" #include "realm.h" #include "mapserver.h" Modified: trunk/pol-core/pol/objecthash.h =================================================================== --- trunk/pol-core/pol/objecthash.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/objecthash.h 2009-09-11 16:03:01 UTC (rev 47) @@ -12,7 +12,7 @@ #define __OBJECTHASH_H #include "reftypes.h" -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" /* template <class _Key> struct myhash { }; Modified: trunk/pol-core/pol/pktboth.h =================================================================== --- trunk/pol-core/pol/pktboth.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/pktboth.h 2009-09-11 16:03:01 UTC (rev 47) @@ -12,7 +12,7 @@ #ifndef __PKTBOTHH #define __PKTBOTHH -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" #include "pktbothid.h" #include "pktdef.h" Modified: trunk/pol-core/pol/polfile1.cpp =================================================================== --- trunk/pol-core/pol/polfile1.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/polfile1.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -10,7 +10,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdio.h> @@ -18,17 +18,17 @@ #include <unistd.h> #endif -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/fileutil.h" -#include "clib/passert.h" -#include "clib/random.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" -#include "clib/wallclock.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/fileutil.h" +#include "../clib/passert.h" +#include "../clib/random.h" +#include "../clib/stlutil.h" +#include "../clib/strutil.h" +#include "../clib/wallclock.h" -#include "plib/realmdescriptor.h" -#include "plib/staticblock.h" +#include "../plib/realmdescriptor.h" +#include "../plib/staticblock.h" #include "item/itemdesc.h" #include "ustruct.h" Modified: trunk/pol-core/pol/poltype.h =================================================================== --- trunk/pol-core/pol/poltype.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/poltype.h 2009-09-11 16:03:01 UTC (rev 47) @@ -11,7 +11,7 @@ #ifndef POLTYPE_H #define POLTYPE_H -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" // X, Y minimums will always be zero. const short XCOORD_MIN = 0; Modified: trunk/pol-core/pol/profile.h =================================================================== --- trunk/pol-core/pol/profile.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/profile.h 2009-09-11 16:03:01 UTC (rev 47) @@ -12,7 +12,7 @@ #define PROFILE_H #include <time.h> -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" #define DEF_PROFILEVAR( counter ) \ unsigned long prf_##counter, \ Modified: trunk/pol-core/pol/tiles.h =================================================================== --- trunk/pol-core/pol/tiles.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/tiles.h 2009-09-11 16:03:01 UTC (rev 47) @@ -11,7 +11,7 @@ #ifndef TILES_H #define TILES_H -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" class Tile { Modified: trunk/pol-core/pol/uobject.h =================================================================== --- trunk/pol-core/pol/uobject.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/uobject.h 2009-09-11 16:03:01 UTC (rev 47) @@ -27,7 +27,7 @@ #endif #ifndef __CLIB_RAWTYPES_H -# include "clib/rawtypes.h" +# include "../clib/rawtypes.h" #endif #include "../clib/refptr.h" Modified: trunk/pol-core/pol/uofile00.cpp =================================================================== --- trunk/pol-core/pol/uofile00.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/uofile00.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,13 +7,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdio.h> #include <string.h> -#include "clib/fileutil.h" -#include "clib/stlutil.h" +#include "../clib/fileutil.h" +#include "../clib/stlutil.h" #include "polcfg.h" #include "polfile.h" Modified: trunk/pol-core/pol/uofile01.cpp =================================================================== --- trunk/pol-core/pol/uofile01.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/uofile01.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,9 +7,10 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif @@ -18,9 +19,9 @@ #include <string.h> #include <math.h> -#include "clib/passert.h" +#include "../clib/passert.h" -#include "plib/mapfunc.h" +#include "../plib/mapfunc.h" #include "objtype.h" #include "polcfg.h" Modified: trunk/pol-core/pol/uofile02.cpp =================================================================== --- trunk/pol-core/pol/uofile02.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/uofile02.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -10,13 +10,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdio.h> #include <string.h> -#include "clib/passert.h" -#include "clib/stlutil.h" +#include "../clib/passert.h" +#include "../clib/stlutil.h" #include "polcfg.h" #include "polfile.h" Modified: trunk/pol-core/pol/uofile06.cpp =================================================================== --- trunk/pol-core/pol/uofile06.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/uofile06.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,7 +7,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdio.h> #include <string.h> Modified: trunk/pol-core/pol/uofile07.cpp =================================================================== --- trunk/pol-core/pol/uofile07.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/uofile07.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,12 +7,12 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdio.h> #include <string.h> -#include "clib/passert.h" +#include "../clib/passert.h" #include "polcfg.h" #include "polfile.h" Modified: trunk/pol-core/pol/uofile08.cpp =================================================================== --- trunk/pol-core/pol/uofile08.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/uofile08.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -9,9 +9,10 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif @@ -19,9 +20,9 @@ #include <stdio.h> #include <string.h> -#include "clib/passert.h" +#include "../clib/passert.h" -#include "plib/mapfunc.h" +#include "../plib/mapfunc.h" #include "clidata.h" #include "objtype.h" Modified: trunk/pol-core/pol/uoscrobj.h =================================================================== --- trunk/pol-core/pol/uoscrobj.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/uoscrobj.h 2009-09-11 16:03:01 UTC (rev 47) @@ -13,10 +13,10 @@ #ifndef UOSCROBJ_H #define UOSCROBJ_H -#include "bscript/bobject.h" -#include "bscript/bstruct.h" -#include "bscript/parser.h" -#include "clib/passert.h" +#include "../bscript/bobject.h" +#include "../bscript/bstruct.h" +#include "../bscript/parser.h" +#include "../clib/passert.h" #include "mobile/charactr.h" #include "item/item.h" Modified: trunk/pol-core/pol/ustruct.h =================================================================== --- trunk/pol-core/pol/ustruct.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/ustruct.h 2009-09-11 16:03:01 UTC (rev 47) @@ -11,15 +11,15 @@ #ifndef __USTRUCT_H #define __USTRUCT_H -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" #ifdef _MSC_VER -#pragma pack( push, 1 ) +# pragma pack( push, 1 ) #else -/* Ok, my build of GCC supports this, yay! */ -#undef POSTSTRUCT_PACK -#define POSTSTRUCT_PACK -#pragma pack(1) + /* Ok, my build of GCC supports this, yay! */ +# undef POSTSTRUCT_PACK +# define POSTSTRUCT_PACK +# pragma pack(1) #endif struct USTRUCT_VERSION Modified: trunk/pol-core/pol/uworld.h =================================================================== --- trunk/pol-core/pol/uworld.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/uworld.h 2009-09-11 16:03:01 UTC (rev 47) @@ -16,8 +16,8 @@ #include <assert.h> -#include "clib/passert.h" -#include "plib/realm.h" +#include "../clib/passert.h" +#include "../plib/realm.h" #include "mobile/charactr.h" #include "uvars.h" #include "zone.h" Modified: trunk/pol-core/pol/zone.h =================================================================== --- trunk/pol-core/pol/zone.h 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/pol/zone.h 2009-09-11 16:03:01 UTC (rev 47) @@ -14,7 +14,7 @@ #include <string> #include <vector> -#include "plib/realm.h" +#include "../plib/realm.h" #include "poltype.h" #include "wrldsize.h" Modified: trunk/pol-core/poltool/poltool.cpp =================================================================== --- trunk/pol-core/poltool/poltool.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/poltool/poltool.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,19 +7,19 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/strutil.h" +#include "../clib/strutil.h" -#include "plib/mapcell.h" -#include "plib/mapserver.h" -#include "plib/filemapserver.h" -#include "plib/mapshape.h" -#include "plib/realmdescriptor.h" +#include "../plib/mapcell.h" +#include "../plib/mapserver.h" +#include "../plib/filemapserver.h" +#include "../plib/mapshape.h" +#include "../plib/realmdescriptor.h" -#include "plib/realm.h" -#include "plib/maptile.h" -#include "plib/maptileserver.h" +#include "../plib/realm.h" +#include "../plib/maptile.h" +#include "../plib/maptileserver.h" void pol_walk_test(); string flagstr( unsigned long flags ); Modified: trunk/pol-core/runecl/runecl-2008.vcproj =================================================================== --- trunk/pol-core/runecl/runecl-2008.vcproj 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/runecl/runecl-2008.vcproj 2009-09-11 16:03:01 UTC (rev 47) @@ -44,7 +44,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""..\..\lib\STLPort5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLPort5\stlport";" PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE,NOMINMAX,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -135,7 +135,7 @@ <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE,NOMINMAX,INC_PASSERT" StringPooling="true" RuntimeLibrary="0" Modified: trunk/pol-core/runecl/runecl.cpp =================================================================== --- trunk/pol-core/runecl/runecl.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/runecl/runecl.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -7,7 +7,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #ifdef _WIN32 # include <windows.h> @@ -25,21 +25,21 @@ #include <iostream> #include <iomanip> -#include "clib/clib.h" -#include "clib/progver.h" -#include "clib/rstack.h" +#include "../clib/clib.h" +#include "../clib/progver.h" +#include "../clib/rstack.h" -#include "bscript/config.h" -#include "bscript/eprog.h" -#include "bscript/escriptv.h" -#include "bscript/filefmt.h" -#include "bscript/tokens.h" -#include "bscript/symcont.h" -#include "bscript/token.h" -#include "bscript/execmodl.h" -#include "bscript/executor.h" +#include "../bscript/config.h" +#include "../bscript/eprog.h" +#include "../bscript/escriptv.h" +#include "../bscript/filefmt.h" +#include "../bscript/tokens.h" +#include "../bscript/symcont.h" +#include "../bscript/token.h" +#include "../bscript/execmodl.h" +#include "../bscript/executor.h" -#include "clib/cmdargs.h" +#include "../clib/cmdargs.h" #include "../pol/module/basicmod.h" #include "../pol/module/basiciomod.h" Modified: trunk/pol-core/uoconvert/uoconvert-2008.vcproj =================================================================== --- trunk/pol-core/uoconvert/uoconvert-2008.vcproj 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/uoconvert/uoconvert-2008.vcproj 2009-09-11 16:03:01 UTC (rev 47) @@ -44,7 +44,7 @@ <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE,NOMINMAX,INC_PASSERT" StringPooling="true" RuntimeLibrary="0" @@ -137,7 +137,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE,NOMINMAX,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" Modified: trunk/pol-core/uoconvert/uoconvert.cpp =================================================================== --- trunk/pol-core/uoconvert/uoconvert.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/uoconvert/uoconvert.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -14,33 +14,34 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <time.h> -#include "clib/stlutil.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/cmdargs.h" -#include "clib/fileutil.h" -#include "clib/passert.h" -#include "clib/wallclock.h" -#include "pol/uofile.h" -#include "pol/objtype.h" -#include "pol/polcfg.h" -#include "pol/udatfile.h" -#include "pol/polfile.h" -#include "pol/uofilei.h" +#include "../clib/stlutil.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/cmdargs.h" +#include "../clib/fileutil.h" +#include "../clib/passert.h" +#include "../clib/wallclock.h" -#include "plib/mapcell.h" -#include "plib/mapblock.h" -#include "plib/mapsolid.h" -#include "plib/mapfunc.h" -#include "plib/mapserver.h" -#include "plib/mapshape.h" -#include "plib/mapwriter.h" -#include "plib/realmdescriptor.h" +#include "../pol/uofile.h" +#include "../pol/objtype.h" +#include "../pol/polcfg.h" +#include "../pol/udatfile.h" +#include "../pol/polfile.h" +#include "../pol/uofilei.h" +#include "../plib/mapcell.h" +#include "../plib/mapblock.h" +#include "../plib/mapsolid.h" +#include "../plib/mapfunc.h" +#include "../plib/mapserver.h" +#include "../plib/mapshape.h" +#include "../plib/mapwriter.h" +#include "../plib/realmdescriptor.h" + unsigned long mapcache_misses; unsigned long mapcache_hits; Modified: trunk/pol-core/uotool/uofile04.cpp =================================================================== --- trunk/pol-core/uotool/uofile04.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/uotool/uofile04.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -25,12 +25,12 @@ #include <stdio.h> #include <string.h> -#include "pol/polcfg.h" -#include "pol/udatfile.h" -#include "pol/ustruct.h" +#include "../pol/polcfg.h" +#include "../pol/udatfile.h" +#include "../pol/ustruct.h" -#include "pol/uofile.h" -#include "pol/uofilei.h" +#include "../pol/uofile.h" +#include "../pol/uofilei.h" std::set<unsigned long> water; Modified: trunk/pol-core/uotool/uofile05.cpp =================================================================== --- trunk/pol-core/uotool/uofile05.cpp 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/uotool/uofile05.cpp 2009-09-11 16:03:01 UTC (rev 47) @@ -21,12 +21,12 @@ #include <stdio.h> #include <string.h> -#include "pol/polcfg.h" -#include "pol/udatfile.h" -#include "pol/ustruct.h" +#include "../pol/polcfg.h" +#include "../pol/udatfile.h" +#include "../pol/ustruct.h" -#include "pol/uofile.h" -#include "pol/uofilei.h" +#include "../pol/uofile.h" +#include "../pol/uofilei.h" void staticsmax() Modified: trunk/pol-core/uotool/uotool-2008.vcproj =================================================================== --- trunk/pol-core/uotool/uotool-2008.vcproj 2009-09-11 12:48:39 UTC (rev 46) +++ trunk/pol-core/uotool/uotool-2008.vcproj 2009-09-11 16:03:01 UTC (rev 47) @@ -44,7 +44,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE,NOMINMAX,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -135,7 +135,7 @@ <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE,NOMINMAX,INC_PASSERT" StringPooling="true" RuntimeLibrary="0" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tu...@us...> - 2009-09-12 13:26:07
|
Revision: 48 http://polserver.svn.sourceforge.net/polserver/?rev=48&view=rev Author: turley Date: 2009-09-12 13:25:56 +0000 (Sat, 12 Sep 2009) Log Message: ----------- added isUOKR check to gump send Modified Paths: -------------- trunk/pol-core/doc/core-changes.txt trunk/pol-core/pol/module/uomod2.cpp Modified: trunk/pol-core/doc/core-changes.txt =================================================================== --- trunk/pol-core/doc/core-changes.txt 2009-09-11 16:03:01 UTC (rev 47) +++ trunk/pol-core/doc/core-changes.txt 2009-09-12 13:25:56 UTC (rev 48) @@ -2,7 +2,7 @@ 09-10-2009 Turley: Added: CompressedGump support packet 0xdd Added: flag param to SendDialogGump() SENDDIALOGMENU_FORCE_OLD/0 default 0 - Note: SendDialogGump sends compressed gump if !SENDDIALOGMENU_FORCE_OLD && clientversion >=5.0.0a else old uncompressed + Note: SendDialogGump sends compressed gump if (client.isUOKR || (!SENDDIALOGMENU_FORCE_OLD && clientversion >=5.0.0a)) else old uncompressed Note: Patch submitted by Grin 09-09-2009 Turley: Modified: trunk/pol-core/pol/module/uomod2.cpp =================================================================== --- trunk/pol-core/pol/module/uomod2.cpp 2009-09-11 16:03:01 UTC (rev 47) +++ trunk/pol-core/pol/module/uomod2.cpp 2009-09-12 13:25:56 UTC (rev 48) @@ -776,7 +776,7 @@ return new BError( "Client already has an active gump" ); } */ - if ((!(flags & SENDDIALOGMENU_FORCE_OLD)) && (chr->client->compareVersion(CLIENT_VER_50000))) + if ((chr->client->isUOKR) || ((!(flags & SENDDIALOGMENU_FORCE_OLD)) && (chr->client->compareVersion(CLIENT_VER_50000)))) return internal_SendCompressedGumpMenu(chr, layout_arr, data_arr, x, y); else return internal_SendUnCompressedGumpMenu(chr, layout_arr, data_arr, x, y); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-12 23:51:30
|
Revision: 49 http://polserver.svn.sourceforge.net/polserver/?rev=49&view=rev Author: muaddib_pol Date: 2009-09-12 23:51:20 +0000 (Sat, 12 Sep 2009) Log Message: ----------- + All projects now using literal paths for includes. + Disabled Compiler warning 4244 in VS for str.cpp and strutil.cpp due to fact they are false warnings there. Modified Paths: -------------- trunk/pol-core/bscript/str.cpp trunk/pol-core/clib/strutil.cpp trunk/pol-core/plib/stlastar.h trunk/pol-core/pol/accounts/accounts.cpp trunk/pol-core/pol/accounts/acscrobj.cpp trunk/pol-core/pol/allocd.cpp trunk/pol-core/pol/binaryfilescrobj.cpp trunk/pol-core/pol/binaryfilescrobj.h trunk/pol-core/pol/bowsalut.cpp trunk/pol-core/pol/cfgrepos.cpp trunk/pol-core/pol/cfgrepos.h trunk/pol-core/pol/checkpnt.cpp trunk/pol-core/pol/cmbtcfg.cpp trunk/pol-core/pol/cmdlevel.cpp trunk/pol-core/pol/cmdlevel.h trunk/pol-core/pol/console.cpp trunk/pol-core/pol/containr.cpp trunk/pol-core/pol/core.cpp trunk/pol-core/pol/create.cpp trunk/pol-core/pol/crypt/cryptkey.cpp trunk/pol-core/pol/cryptengine.cpp trunk/pol-core/pol/ctable.cpp trunk/pol-core/pol/dblclick.cpp trunk/pol-core/pol/decay.cpp trunk/pol-core/pol/dice.cpp trunk/pol-core/pol/door.cpp trunk/pol-core/pol/door.h trunk/pol-core/pol/dropitem.cpp trunk/pol-core/pol/eqpitem.cpp trunk/pol-core/pol/equipdsc.cpp trunk/pol-core/pol/exscrobj.cpp trunk/pol-core/pol/exscrobj.h trunk/pol-core/pol/extcmd.cpp trunk/pol-core/pol/fnsearch.cpp trunk/pol-core/pol/gameclck.cpp trunk/pol-core/pol/getitem.cpp trunk/pol-core/pol/getmsg.cpp trunk/pol-core/pol/gflag.cpp trunk/pol-core/pol/gprepos.cpp trunk/pol-core/pol/guardrgn.cpp trunk/pol-core/pol/help.cpp trunk/pol-core/pol/irequest.cpp trunk/pol-core/pol/item/item.cpp trunk/pol-core/pol/landtile.cpp trunk/pol-core/pol/listenpt.cpp trunk/pol-core/pol/loaddata.cpp trunk/pol-core/pol/loadunld.cpp trunk/pol-core/pol/lockable.cpp trunk/pol-core/pol/logfiles.cpp trunk/pol-core/pol/logfiles.h trunk/pol-core/pol/login.cpp trunk/pol-core/pol/los.cpp trunk/pol-core/pol/los2.cpp trunk/pol-core/pol/menu.cpp trunk/pol-core/pol/menu.h trunk/pol-core/pol/menusel.cpp trunk/pol-core/pol/miscmsg.cpp trunk/pol-core/pol/miscrgn.cpp trunk/pol-core/pol/miscrgn.h trunk/pol-core/pol/mkscrobj.cpp trunk/pol-core/pol/module/attributemod.h trunk/pol-core/pol/module/clmod.h trunk/pol-core/pol/module/npcmod.cpp trunk/pol-core/pol/module/osmod.cpp trunk/pol-core/pol/module/partymod.h trunk/pol-core/pol/module/polsystemmod.h trunk/pol-core/pol/module/unimod.cpp trunk/pol-core/pol/movecost.cpp trunk/pol-core/pol/movement.cpp trunk/pol-core/pol/msgfiltr.cpp trunk/pol-core/pol/multi/boat.cpp trunk/pol-core/pol/multi/house.cpp trunk/pol-core/pol/multi/multidef2.cpp trunk/pol-core/pol/musicrgn.cpp trunk/pol-core/pol/npc.cpp trunk/pol-core/pol/npctemplates.cpp trunk/pol-core/pol/npctmpl.cpp trunk/pol-core/pol/objecthash.cpp trunk/pol-core/pol/packetscrobj.cpp trunk/pol-core/pol/packetscrobj.h trunk/pol-core/pol/party.cpp trunk/pol-core/pol/pktni.h trunk/pol-core/pol/pol-2008.vcproj trunk/pol-core/pol/pol.cpp trunk/pol-core/pol/polcfg.cpp trunk/pol-core/pol/polclock.cpp trunk/pol-core/pol/poldbg.cpp trunk/pol-core/pol/polfile2.cpp trunk/pol-core/pol/polsem.cpp trunk/pol-core/pol/polservice.cpp trunk/pol-core/pol/polsig.cpp trunk/pol-core/pol/polstats.cpp trunk/pol-core/pol/polstats.h trunk/pol-core/pol/poltest.cpp trunk/pol-core/pol/polvar.cpp trunk/pol-core/pol/polwww.cpp trunk/pol-core/pol/profile.cpp trunk/pol-core/pol/proplist.cpp trunk/pol-core/pol/readcfg.cpp trunk/pol-core/pol/realms.cpp trunk/pol-core/pol/reftypes.cpp trunk/pol-core/pol/region.cpp trunk/pol-core/pol/repsys.cpp trunk/pol-core/pol/resource.cpp trunk/pol-core/pol/savedata.cpp trunk/pol-core/pol/savedata.h trunk/pol-core/pol/schedule.cpp trunk/pol-core/pol/scrdef.cpp trunk/pol-core/pol/scrsched.cpp trunk/pol-core/pol/scrstore.cpp trunk/pol-core/pol/scrstore.h trunk/pol-core/pol/skilladv.cpp trunk/pol-core/pol/skillid.h trunk/pol-core/pol/sngclick.cpp trunk/pol-core/pol/sockets.h trunk/pol-core/pol/sockio.cpp trunk/pol-core/pol/speech.cpp trunk/pol-core/pol/spelbook.cpp trunk/pol-core/pol/spelbook.h trunk/pol-core/pol/spells.cpp trunk/pol-core/pol/spells.h trunk/pol-core/pol/ssopt.cpp trunk/pol-core/pol/stackcfg.cpp trunk/pol-core/pol/startloc.cpp trunk/pol-core/pol/statmsg.cpp trunk/pol-core/pol/storage.cpp trunk/pol-core/pol/storage.h trunk/pol-core/pol/syshook.cpp trunk/pol-core/pol/systemhookscript.cpp trunk/pol-core/pol/target.cpp trunk/pol-core/pol/target.h trunk/pol-core/pol/tasks.cpp trunk/pol-core/pol/textcmd.cpp trunk/pol-core/pol/tildecmd.cpp trunk/pol-core/pol/tiles.cpp trunk/pol-core/pol/tiplstwn.cpp trunk/pol-core/pol/tips.cpp trunk/pol-core/pol/tmpvars.cpp trunk/pol-core/pol/tmpvars.h trunk/pol-core/pol/tooltips.cpp trunk/pol-core/pol/ucrypto.cpp trunk/pol-core/pol/ufunc.cpp trunk/pol-core/pol/ufunc2.cpp trunk/pol-core/pol/uimport.cpp trunk/pol-core/pol/umap.cpp trunk/pol-core/pol/uobjcnt.cpp trunk/pol-core/pol/uobject.cpp trunk/pol-core/pol/uobjhelp.cpp trunk/pol-core/pol/uoclient.cpp trunk/pol-core/pol/uoexec.h trunk/pol-core/pol/uoexhelp.cpp trunk/pol-core/pol/uofile03.cpp trunk/pol-core/pol/uolisten.cpp trunk/pol-core/pol/uopathnode.h trunk/pol-core/pol/uoscrobj.cpp trunk/pol-core/pol/uoskills.cpp trunk/pol-core/pol/useskill.cpp trunk/pol-core/pol/uvars.cpp trunk/pol-core/pol/uworld.cpp trunk/pol-core/pol/vital.cpp trunk/pol-core/pol/zone.cpp Modified: trunk/pol-core/bscript/str.cpp =================================================================== --- trunk/pol-core/bscript/str.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/bscript/str.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -4,6 +4,7 @@ 2007/12/09 Shinigami: removed ( is.peek() != EOF ) check from String::unpackWithLen() will not work with Strings in Arrays, Dicts, etc. 2008/02/08 Turley: String::unpackWithLen() will accept zero length Strings +2009/09/12 MuadDib: Disabled 4244 in this file due to it being on a string iter. Makes no sense. Notes ======= @@ -23,6 +24,9 @@ #include "bobject.h" #include "impstr.h" +#ifdef _MSC_VER +# pragma warning( disable: 4244 ) +#endif String::String(BObjectImp& objimp) : BObjectImp( OTString ) { @@ -295,18 +299,10 @@ void String::toLower( void ) { -#if 0 - // UNTESTED - - using use_facet; - // FIXME: why no simply way to lower/upper a string? come on. - _USE( locale::locale(), ctype<char> ).tolower( value_.begin(), value_.end() ); -#else for( string::iterator itr = value_.begin(); itr != value_.end(); itr++ ) { *itr = tolower(*itr); } -#endif } BObjectImp* String::array_assign( BObjectImp* idx, BObjectImp* target ) Modified: trunk/pol-core/clib/strutil.cpp =================================================================== --- trunk/pol-core/clib/strutil.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/clib/strutil.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -1,6 +1,7 @@ /* History ======= +2009/09/12 MuadDib: Disabled 4244 in this file due to it being on a string iter. Makes no sense. Notes ======= @@ -13,6 +14,10 @@ #include "strutil.h" #include "unittest.h" +#ifdef _MSC_VER +# pragma warning( disable: 4244 ) +#endif + string hexint( unsigned short v ) { OSTRINGSTREAM os; Modified: trunk/pol-core/plib/stlastar.h =================================================================== --- trunk/pol-core/plib/stlastar.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/plib/stlastar.h 2009-09-12 23:51:20 UTC (rev 49) @@ -1,6 +1,14 @@ -// History -// 2005/09/03 Shinigami: SearchStep - added support for non-blocking doors +/* +History +======= +2005/09/03 Shinigami: SearchStep - added support for non-blocking doors +Notes +======= + +*/ + + // STL A* Search implementation // Copyright 2001 Justin Heyes-Jones @@ -22,7 +30,7 @@ using namespace std; // fast fixed size memory allocator, used for fast node memory management -#include "plib/fsa.h" +#include "fsa.h" // Fixed size memory allocator can be disabled to compare performance // Uses std new and delete instead if you turn it off @@ -31,7 +39,7 @@ // disable warning that debugging information has lines that are truncated // occurs in stl headers #ifdef _MSC_VER -#pragma warning(disable:4786) +# pragma warning(disable:4786) #endif // The AStar search class. UserState is the users state space type Modified: trunk/pol-core/pol/accounts/accounts.cpp =================================================================== --- trunk/pol-core/pol/accounts/accounts.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/accounts/accounts.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -11,7 +11,7 @@ */ -#include "clib/stl_inc.h" +#include "../../clib/stl_inc.h" #include <sys/types.h> @@ -19,11 +19,11 @@ #include <stdio.h> #include <time.h> -#include "clib/cfgfile.h" -#include "clib/cfgelem.h" -#include "clib/fileutil.h" -#include "clib/passert.h" -#include "clib/wallclock.h" +#include "../../clib/cfgfile.h" +#include "../../clib/cfgelem.h" +#include "../../clib/fileutil.h" +#include "../../clib/passert.h" +#include "../../clib/wallclock.h" #include "account.h" #include "accounts.h" Modified: trunk/pol-core/pol/accounts/acscrobj.cpp =================================================================== --- trunk/pol-core/pol/accounts/acscrobj.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/accounts/acscrobj.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -21,15 +21,15 @@ */ -#include "clib/stl_inc.h" -#include "clib/MD5.h" +#include "../../clib/stl_inc.h" +#include "../../clib/MD5.h" -#include "bscript/berror.h" -#include "bscript/bobject.h" -#include "bscript/executor.h" -#include "bscript/impstr.h" -#include "bscript/objmembers.h" -#include "bscript/objmethods.h" +#include "../../bscript/berror.h" +#include "../../bscript/bobject.h" +#include "../../bscript/executor.h" +#include "../../bscript/impstr.h" +#include "../../bscript/objmembers.h" +#include "../../bscript/objmethods.h" #include "account.h" #include "accounts.h" Modified: trunk/pol-core/pol/allocd.cpp =================================================================== --- trunk/pol-core/pol/allocd.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/allocd.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,7 +8,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #ifdef _WIN32 # include <malloc.h> Modified: trunk/pol-core/pol/binaryfilescrobj.cpp =================================================================== --- trunk/pol-core/pol/binaryfilescrobj.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/binaryfilescrobj.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -7,21 +7,21 @@ */ -#include "clib/stl_inc.h" -#include "clib/strutil.h" -#include "clib/endian.h" +#include "../clib/stl_inc.h" +#include "../clib/strutil.h" +#include "../clib/endian.h" + #include "binaryfilescrobj.h" +#include "../bscript/executor.h" +#include "../bscript/berror.h" +#include "../bscript/bobject.h" +#include "../bscript/impstr.h" +#include "../bscript/objmembers.h" +#include "../bscript/objmethods.h" -#include "bscript/executor.h" -#include "bscript/berror.h" -#include "bscript/bobject.h" -#include "bscript/impstr.h" -#include "bscript/objmembers.h" -#include "bscript/objmethods.h" - BBinaryfile::BBinaryfile(): BObjectImp( OTBinaryFile ), _filename( "" ), openmode( ios::in ), Modified: trunk/pol-core/pol/binaryfilescrobj.h =================================================================== --- trunk/pol-core/pol/binaryfilescrobj.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/binaryfilescrobj.h 2009-09-12 23:51:20 UTC (rev 49) @@ -11,8 +11,8 @@ #ifndef BINARYSCROBJ_H #define BINARYSCROBJ_H -#include "bscript/bobject.h" -#include "clib/rawtypes.h" +#include "../bscript/bobject.h" +#include "../clib/rawtypes.h" class BinFile { Modified: trunk/pol-core/pol/bowsalut.cpp =================================================================== --- trunk/pol-core/pol/bowsalut.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/bowsalut.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,13 +9,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/endian.h" -#include "clib/fileutil.h" -#include "clib/strutil.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/endian.h" +#include "../clib/fileutil.h" +#include "../clib/strutil.h" #include "mobile/charactr.h" #include "network/client.h" Modified: trunk/pol-core/pol/cfgrepos.cpp =================================================================== --- trunk/pol-core/pol/cfgrepos.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/cfgrepos.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -15,28 +15,28 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif #include <sys/stat.h> -#include "bscript/bobject.h" -#include "bscript/escrutil.h" -#include "bscript/impstr.h" +#include "../bscript/bobject.h" +#include "../bscript/escrutil.h" +#include "../bscript/impstr.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/fileutil.h" -#include "clib/mlog.h" -#include "clib/refptr.h" -#include "clib/strutil.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/fileutil.h" +#include "../clib/mlog.h" +#include "../clib/refptr.h" +#include "../clib/strutil.h" #include "cfgrepos.h" #include "polcfg.h" -#include "plib/pkg.h" +#include "../plib/pkg.h" StoredConfigElem::StoredConfigElem( ConfigElem& elem ) { Modified: trunk/pol-core/pol/cfgrepos.h =================================================================== --- trunk/pol-core/pol/cfgrepos.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/cfgrepos.h 2009-09-12 23:51:20 UTC (rev 49) @@ -21,8 +21,8 @@ #include <map> #include <string> -#include "clib/maputil.h" -#include "clib/refptr.h" +#include "../clib/maputil.h" +#include "../clib/refptr.h" class ConfigFile; class ConfigElem; Modified: trunk/pol-core/pol/checkpnt.cpp =================================================================== --- trunk/pol-core/pol/checkpnt.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/checkpnt.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -7,9 +7,9 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/logfile.h" +#include "../clib/logfile.h" #include "polcfg.h" #include "checkpnt.h" Modified: trunk/pol-core/pol/cmbtcfg.cpp =================================================================== --- trunk/pol-core/pol/cmbtcfg.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/cmbtcfg.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -10,10 +10,10 @@ */ -#include "clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/fileutil.h" +#include "../clib/stl_inc.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/fileutil.h" #include "cmbtcfg.h" #include "polcfg.h" Modified: trunk/pol-core/pol/cmdlevel.cpp =================================================================== --- trunk/pol-core/pol/cmdlevel.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/cmdlevel.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -10,16 +10,19 @@ #include <string> -#include "clib/stl_inc.h" -#include "clib/cfgfile.h" -#include "clib/cfgelem.h" -#include "clib/dirlist.h" -#include "clib/fileutil.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" -#include "bscript/impstr.h" -#include "bscript/bstruct.h" -#include "plib/pkg.h" +#include "../clib/stl_inc.h" +#include "../clib/cfgfile.h" +#include "../clib/cfgelem.h" +#include "../clib/dirlist.h" +#include "../clib/fileutil.h" +#include "../clib/stlutil.h" +#include "../clib/strutil.h" + +#include "../bscript/impstr.h" +#include "../bscript/bstruct.h" + +#include "../plib/pkg.h" + #include "cmdlevel.h" Modified: trunk/pol-core/pol/cmdlevel.h =================================================================== --- trunk/pol-core/pol/cmdlevel.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/cmdlevel.h 2009-09-12 23:51:20 UTC (rev 49) @@ -11,7 +11,7 @@ #include <string> #include <vector> -#include "bscript/bobject.h" +#include "../bscript/bobject.h" class ConfigElem; class Package; Modified: trunk/pol-core/pol/console.cpp =================================================================== --- trunk/pol-core/pol/console.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/console.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -7,21 +7,21 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #ifdef _WIN32 -#include <conio.h> +# include <conio.h> #else -#include "clib/kbhit.h" -keyboard kb; +# include "clib/kbhit.h" + keyboard kb; #endif -#include "bscript/impstr.h" +#include "../bscript/impstr.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/fileutil.h" -#include "clib/stlutil.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/fileutil.h" +#include "../clib/stlutil.h" #include "polcfg.h" #include "polsem.h" Modified: trunk/pol-core/pol/containr.cpp =================================================================== --- trunk/pol-core/pol/containr.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/containr.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -15,21 +15,22 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif #include <limits.h> +#include <stddef.h> +#include "../clib/endian.h" +#include "../clib/cfgfile.h" +#include "../clib/logfile.h" +#include "../clib/passert.h" +#include "../clib/random.h" +#include "../clib/stlutil.h" -#include "clib/cfgfile.h" -#include "clib/logfile.h" -#include "clib/passert.h" -#include "clib/random.h" -#include "clib/stlutil.h" - #include "network/client.h" #include "mobile/charactr.h" #include "core.h" @@ -44,6 +45,9 @@ #include "umanip.h" #include "uvars.h" #include "uworld.h" +#include "objtype.h" +#include "ufunc.h" +#include "sockio.h" #include "containr.h" @@ -633,12 +637,6 @@ return contents_.end(); } -#include <stddef.h> -#include "clib/endian.h" -#include "objtype.h" -#include "ufunc.h" -#include "sockio.h" - void UContainer::builtin_on_use( Client *client ) { client->pause(); Modified: trunk/pol-core/pol/core.cpp =================================================================== --- trunk/pol-core/pol/core.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/core.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,9 +8,9 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "plib/realm.h" +#include "../plib/realm.h" #include "mobile/charactr.h" #include "network/cgdata.h" Modified: trunk/pol-core/pol/create.cpp =================================================================== --- trunk/pol-core/pol/create.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/create.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -10,21 +10,22 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif #include <iostream> #include <string> -#include "clib/endian.h" -#include "clib/fdump.h" -#include "clib/logfile.h" -#include "clib/random.h" +#include "../clib/endian.h" +#include "../clib/fdump.h" +#include "../clib/logfile.h" +#include "../clib/random.h" -#include "plib/realm.h" +#include "../plib/realm.h" #include "accounts/account.h" #include "mobile/attribute.h" @@ -51,7 +52,7 @@ #include "uvars.h" #include "uworld.h" -#include "bscript/bobject.h" +#include "../bscript/bobject.h" #include "module/osmod.h" #include "scrsched.h" #include "scrstore.h" Modified: trunk/pol-core/pol/crypt/cryptkey.cpp =================================================================== --- trunk/pol-core/pol/crypt/cryptkey.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/crypt/cryptkey.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -10,7 +10,7 @@ ** TJ: up to 3.0.6j added ** *********************************************************************/ -#include "clib/stl_inc.h" +#include "../../clib/stl_inc.h" #include "cryptkey.h" Modified: trunk/pol-core/pol/cryptengine.cpp =================================================================== --- trunk/pol-core/pol/cryptengine.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/cryptengine.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -7,10 +7,10 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/logfile.h" -#include "clib/strutil.h" +#include "../clib/logfile.h" +#include "../clib/strutil.h" #include "crypt/cryptengine.h" #include "crypt/nocrypt.h" Modified: trunk/pol-core/pol/ctable.cpp =================================================================== --- trunk/pol-core/pol/ctable.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/ctable.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -7,7 +7,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include "ctable.h" SVR_KEYDESC keydesc[ 257 ] = { Modified: trunk/pol-core/pol/dblclick.cpp =================================================================== --- trunk/pol-core/pol/dblclick.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/dblclick.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -16,14 +16,14 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <string.h> -#include "clib/clib.h" -#include "clib/endian.h" +#include "../clib/clib.h" +#include "../clib/endian.h" -#include "plib/realm.h" +#include "../plib/realm.h" #include "network/client.h" #include "eventid.h" Modified: trunk/pol-core/pol/decay.cpp =================================================================== --- trunk/pol-core/pol/decay.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/decay.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,9 +9,9 @@ */ -#include "clib/stl_inc.h" -#include "clib/esignal.h" -#include "plib/realm.h" +#include "../clib/stl_inc.h" +#include "../clib/esignal.h" +#include "../plib/realm.h" #include "core.h" #include "item/item.h" Modified: trunk/pol-core/pol/dice.cpp =================================================================== --- trunk/pol-core/pol/dice.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/dice.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,10 +9,10 @@ */ -#include "clib/stl_inc.h" -#include "clib/stlutil.h" -#include "clib/logfile.h" -#include "clib/random.h" +#include "../clib/stl_inc.h" +#include "../clib/stlutil.h" +#include "../clib/logfile.h" +#include "../clib/random.h" #include "dice.h" Modified: trunk/pol-core/pol/door.cpp =================================================================== --- trunk/pol-core/pol/door.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/door.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,13 +8,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #ifdef _MSC_VER #pragma warning( disable: 4786 ) #endif -#include "clib/endian.h" -#include "clib/passert.h" +#include "../clib/endian.h" +#include "../clib/passert.h" #include "network/client.h" #include "door.h" Modified: trunk/pol-core/pol/door.h =================================================================== --- trunk/pol-core/pol/door.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/door.h 2009-09-12 23:51:20 UTC (rev 49) @@ -12,7 +12,7 @@ #define __DOOR_H #ifndef __ITEM_H -#include "lockable.h" +# include "lockable.h" #endif class Client; Modified: trunk/pol-core/pol/dropitem.cpp =================================================================== --- trunk/pol-core/pol/dropitem.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/dropitem.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -22,21 +22,21 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <assert.h> #include <stdio.h> -#include "clib/endian.h" -#include "clib/logfile.h" -#include "clib/passert.h" -#include "clib/random.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" +#include "../clib/endian.h" +#include "../clib/logfile.h" +#include "../clib/passert.h" +#include "../clib/random.h" +#include "../clib/stlutil.h" +#include "../clib/strutil.h" -#include "bscript/berror.h" +#include "../bscript/berror.h" -#include "plib/realm.h" +#include "../plib/realm.h" #include "multi/boat.h" #include "mobile/charactr.h" Modified: trunk/pol-core/pol/eqpitem.cpp =================================================================== --- trunk/pol-core/pol/eqpitem.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/eqpitem.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,14 +9,15 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include <assert.h> #include <stdio.h> -#include "bscript/bobject.h" +#include "../bscript/bobject.h" -#include "clib/endian.h" -#include "clib/logfile.h" +#include "../clib/endian.h" +#include "../clib/logfile.h" #include "mobile/charactr.h" #include "network/client.h" Modified: trunk/pol-core/pol/equipdsc.cpp =================================================================== --- trunk/pol-core/pol/equipdsc.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/equipdsc.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,10 +8,10 @@ */ -#include "clib/stl_inc.h" -#include "clib/cfgelem.h" +#include "../clib/stl_inc.h" +#include "../clib/cfgelem.h" -#include "bscript/bstruct.h" +#include "../bscript/bstruct.h" #include "equipdsc.h" Modified: trunk/pol-core/pol/exscrobj.cpp =================================================================== --- trunk/pol-core/pol/exscrobj.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/exscrobj.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -14,15 +14,15 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "bscript/berror.h" -#include "bscript/dict.h" -#include "bscript/impstr.h" -#include "bscript/objmembers.h" -#include "bscript/objmethods.h" +#include "../bscript/berror.h" +#include "../bscript/dict.h" +#include "../bscript/impstr.h" +#include "../bscript/objmembers.h" +#include "../bscript/objmethods.h" -#include "clib/strutil.h" +#include "../clib/strutil.h" #include "exscrobj.h" Modified: trunk/pol-core/pol/exscrobj.h =================================================================== --- trunk/pol-core/pol/exscrobj.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/exscrobj.h 2009-09-12 23:51:20 UTC (rev 49) @@ -11,8 +11,8 @@ #ifndef EXSCROBJ_H #define EXSCROBJ_H -#include "bscript/bobject.h" -#include "clib/weakptr.h" +#include "../bscript/bobject.h" +#include "../clib/weakptr.h" class UOExecutor; Modified: trunk/pol-core/pol/extcmd.cpp =================================================================== --- trunk/pol-core/pol/extcmd.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/extcmd.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,11 +8,12 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include <stddef.h> -#include "clib/fdump.h" -#include "clib/endian.h" +#include "../clib/fdump.h" +#include "../clib/endian.h" #include "msghandl.h" #include "pktin.h" Modified: trunk/pol-core/pol/fnsearch.cpp =================================================================== --- trunk/pol-core/pol/fnsearch.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/fnsearch.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,11 +9,11 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include "fnsearch.h" -#include "clib/stlutil.h" +#include "../clib/stlutil.h" #include "mobile/charactr.h" #include "item/item.h" Modified: trunk/pol-core/pol/gameclck.cpp =================================================================== --- trunk/pol-core/pol/gameclck.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/gameclck.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,10 +8,11 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include <time.h> -#include "clib/stlutil.h" +#include "../clib/stlutil.h" #include "gameclck.h" #include "gprops.h" Modified: trunk/pol-core/pol/getitem.cpp =================================================================== --- trunk/pol-core/pol/getitem.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/getitem.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -17,14 +17,15 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include <stdio.h> -#include "clib/endian.h" -#include "clib/logfile.h" -#include "clib/stlutil.h" +#include "../clib/endian.h" +#include "../clib/logfile.h" +#include "../clib/stlutil.h" -#include "plib/realm.h" +#include "../plib/realm.h" #include "multi/boat.h" #include "mobile/charactr.h" @@ -39,9 +40,7 @@ #include "uofile.h" #include "uobject.h" #include "uworld.h" -//#include "layers.h" - /* How get_item works: when the client drags an item off the ground, a GET_ITEM message is generated. Modified: trunk/pol-core/pol/getmsg.cpp =================================================================== --- trunk/pol-core/pol/getmsg.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/getmsg.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,13 +8,14 @@ */ -#include "clib/stl_inc.h" -#include "bscript/berror.h" -#include "bscript/impstr.h" +#include "../clib/stl_inc.h" -#include "clib/endian.h" -#include "clib/rawtypes.h" +#include "../bscript/berror.h" +#include "../bscript/impstr.h" +#include "../clib/endian.h" +#include "../clib/rawtypes.h" + #include "network/client.h" #include "sockio.h" #include "msghandl.h" Modified: trunk/pol-core/pol/gflag.cpp =================================================================== --- trunk/pol-core/pol/gflag.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/gflag.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,7 +8,8 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include "gflag.h" bool gflag_enforce_container_limits = true; Modified: trunk/pol-core/pol/gprepos.cpp =================================================================== --- trunk/pol-core/pol/gprepos.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/gprepos.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,17 +8,17 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif +#include "../bscript/fmodule.h" -#include "bscript/fmodule.h" +#include "../gp/gphelp.h" +#include "../gp/tree.h" -#include "gp/gphelp.h" -#include "gp/tree.h" - #include "gprepos.h" typedef map<string,GTerminalDef*> TerminalDefs; Modified: trunk/pol-core/pol/guardrgn.cpp =================================================================== --- trunk/pol-core/pol/guardrgn.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/guardrgn.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,11 +8,11 @@ */ -#include "clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/fileutil.h" +#include "../clib/stl_inc.h" +#include "../clib/cfgelem.h" +#include "../clib/fileutil.h" -#include "bscript/impstr.h" +#include "../bscript/impstr.h" #include "mobile/charactr.h" #include "guardrgn.h" Modified: trunk/pol-core/pol/help.cpp =================================================================== --- trunk/pol-core/pol/help.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/help.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,7 +8,8 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include "mobile/charactr.h" #include "network/client.h" #include "msghandl.h" Modified: trunk/pol-core/pol/irequest.cpp =================================================================== --- trunk/pol-core/pol/irequest.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/irequest.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,10 +9,10 @@ */ -#include "clib/stl_inc.h" -#include "clib/endian.h" -#include "clib/fdump.h" -#include "clib/clib.h" +#include "../clib/stl_inc.h" +#include "../clib/endian.h" +#include "../clib/fdump.h" +#include "../clib/clib.h" #include "mobile/attribute.h" #include "mobile/charactr.h" Modified: trunk/pol-core/pol/item/item.cpp =================================================================== --- trunk/pol-core/pol/item/item.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/item/item.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -19,12 +19,13 @@ # pragma warning( disable: 4786 ) #endif -#include "../../bscript/berror.h" - #include "../../clib/cfgelem.h" #include "../../clib/endian.h" #include "../../clib/strutil.h" +#include "../../bscript/berror.h" +#include "../../bscript/bobject.h" + #include "../../plib/mapcell.h" #include "item.h" @@ -902,7 +903,6 @@ ///////////////////////////////////////////////////////////////////////////// // Equip-Script related functions ///////////////////////////////////////////////////////////////////////////// -#include "bscript/bobject.h" bool Item::has_equip_script() const { return !equip_script_.empty(); Modified: trunk/pol-core/pol/landtile.cpp =================================================================== --- trunk/pol-core/pol/landtile.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/landtile.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,13 +9,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/passert.h" +#include "../clib/cfgelem.h" +#include "../clib/passert.h" -#include "plib/mapfunc.h" -#include "plib/pkg.h" +#include "../plib/mapfunc.h" +#include "../plib/pkg.h" const unsigned LANDTILE_COUNT = 0x4000; struct LandTile Modified: trunk/pol-core/pol/listenpt.cpp =================================================================== --- trunk/pol-core/pol/listenpt.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/listenpt.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,8 +8,8 @@ */ -#include "clib/stl_inc.h" -#include "clib/refptr.h" +#include "../clib/stl_inc.h" +#include "../clib/refptr.h" #include "mobile/charactr.h" #include "module/osmod.h" Modified: trunk/pol-core/pol/loaddata.cpp =================================================================== --- trunk/pol-core/pol/loaddata.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/loaddata.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,13 +9,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/cfgfile.h" -#include "clib/cfgelem.h" -#include "clib/fileutil.h" -#include "clib/strutil.h" -#include "clib/wallclock.h" +#include "../clib/cfgfile.h" +#include "../clib/cfgelem.h" +#include "../clib/fileutil.h" +#include "../clib/strutil.h" +#include "../clib/wallclock.h" #include "mobile/charactr.h" #include "clidata.h" Modified: trunk/pol-core/pol/loadunld.cpp =================================================================== --- trunk/pol-core/pol/loadunld.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/loadunld.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,18 +9,18 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/fileutil.h" +#include "../clib/stlutil.h" +#include "../clib/strutil.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/fileutil.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" - #include "item/armor.h" #include "checkpnt.h" #include "cmbtcfg.h" @@ -35,7 +35,7 @@ #include "loadunld.h" #include "objecthash.h" -#include "plib/pkg.h" +#include "../plib/pkg.h" void initialize_client_interfaces(); Modified: trunk/pol-core/pol/lockable.cpp =================================================================== --- trunk/pol-core/pol/lockable.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/lockable.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,9 +8,9 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" +#include "../clib/cfgelem.h" -#include "clib/cfgelem.h" #include "lockable.h" ULockable::ULockable( const ItemDesc& itemdesc, UOBJ_CLASS uobj_class ) : Modified: trunk/pol-core/pol/logfiles.cpp =================================================================== --- trunk/pol-core/pol/logfiles.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/logfiles.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,9 +8,9 @@ */ -#include "clib/stl_inc.h" -#include "clib/dualbuf.h" -#include "clib/nlogfile.h" +#include "../clib/stl_inc.h" +#include "../clib/dualbuf.h" +#include "../clib/nlogfile.h" #include "logfiles.h" Modified: trunk/pol-core/pol/logfiles.h =================================================================== --- trunk/pol-core/pol/logfiles.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/logfiles.h 2009-09-12 23:51:20 UTC (rev 49) @@ -11,7 +11,7 @@ #ifndef LOGFILES_H #define LOGFILES_H -#include "clib/nlogfile.h" +#include "../clib/nlogfile.h" extern LogFile script_log; Modified: trunk/pol-core/pol/login.cpp =================================================================== --- trunk/pol-core/pol/login.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/login.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -19,22 +19,22 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif -#include "clib/stlutil.h" -#include "clib/MD5.h" +#include "../clib/stlutil.h" +#include "../clib/MD5.h" #include <string.h> +#include "../clib/clib.h" +#include "../clib/endian.h" +#include "../clib/logfile.h" +#include "../clib/fdump.h" -#include "clib/clib.h" -#include "clib/endian.h" -#include "clib/logfile.h" -#include "clib/fdump.h" - #include "accounts/account.h" #include "mobile/charactr.h" #include "network/client.h" Modified: trunk/pol-core/pol/los.cpp =================================================================== --- trunk/pol-core/pol/los.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/los.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,19 +8,19 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif #include <stdlib.h> -#include "clib/strutil.h" +#include "../clib/strutil.h" #include "item/item.h" #include "polcfg.h" -//#include "poltest.h" #include "uobject.h" #include "uvars.h" #include "ustruct.h" Modified: trunk/pol-core/pol/los2.cpp =================================================================== --- trunk/pol-core/pol/los2.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/los2.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,7 +8,8 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" + #include "charactr.h" #include "los.h" Modified: trunk/pol-core/pol/menu.cpp =================================================================== --- trunk/pol-core/pol/menu.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/menu.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,12 +8,12 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <string.h> #include <assert.h> -#include "clib/clib.h" -#include "clib/passert.h" +#include "../clib/clib.h" +#include "../clib/passert.h" #include "menu.h" Modified: trunk/pol-core/pol/menu.h =================================================================== --- trunk/pol-core/pol/menu.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/menu.h 2009-09-12 23:51:20 UTC (rev 49) @@ -14,7 +14,7 @@ #include <vector> #ifndef __CLIB_RAWTYPES_H -#include "clib/rawtypes.h" +# include "../clib/rawtypes.h" #endif // FIXME these are horribly wasteful. Probably should be using <string> or something. Modified: trunk/pol-core/pol/menusel.cpp =================================================================== --- trunk/pol-core/pol/menusel.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/menusel.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,13 +8,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <assert.h> -#include "clib/clib.h" -#include "clib/endian.h" -#include "clib/logfile.h" -#include "clib/passert.h" +#include "../clib/clib.h" +#include "../clib/endian.h" +#include "../clib/logfile.h" +#include "../clib/passert.h" #include "accounts/account.h" #include "mobile/charactr.h" Modified: trunk/pol-core/pol/miscmsg.cpp =================================================================== --- trunk/pol-core/pol/miscmsg.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/miscmsg.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -18,20 +18,20 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" /* MISCMSG.CPP: Miscellaneous message handlers. Handlers shouldn't stay here long, only until they find a better home - but this is better than putting them in POL.CPP. */ #include <stddef.h> -#include "clib/clib.h" -#include "clib/endian.h" -#include "clib/fdump.h" -#include "clib/logfile.h" -#include "clib/strutil.h" +#include "../clib/clib.h" +#include "../clib/endian.h" +#include "../clib/fdump.h" +#include "../clib/logfile.h" +#include "../clib/strutil.h" -#include "clib/stlutil.h" +#include "../clib/stlutil.h" #include "accounts/account.h" #include "mobile/charactr.h" Modified: trunk/pol-core/pol/miscrgn.cpp =================================================================== --- trunk/pol-core/pol/miscrgn.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/miscrgn.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,10 +9,10 @@ */ -#include "clib/stl_inc.h" -#include "clib/cfgelem.h" +#include "../clib/stl_inc.h" +#include "../clib/cfgelem.h" -#include "plib/realm.h" +#include "../plib/realm.h" #include "region.h" #include "miscrgn.h" Modified: trunk/pol-core/pol/miscrgn.h =================================================================== --- trunk/pol-core/pol/miscrgn.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/miscrgn.h 2009-09-12 23:51:20 UTC (rev 49) @@ -11,7 +11,7 @@ #ifndef MISCRGN_H #define MISCRGN_H -#include "plib/realm.h" +#include "../plib/realm.h" #include "region.h" Modified: trunk/pol-core/pol/mkscrobj.cpp =================================================================== --- trunk/pol-core/pol/mkscrobj.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/mkscrobj.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,7 +8,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include "mkscrobj.h" #include "uoscrobj.h" Modified: trunk/pol-core/pol/module/attributemod.h =================================================================== --- trunk/pol-core/pol/module/attributemod.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/module/attributemod.h 2009-09-12 23:51:20 UTC (rev 49) @@ -13,7 +13,7 @@ #ifndef ATTRIBUTEEMOD_H #define ATTRIBUTEEMOD_H -#include "bscript/execmodl.h" +#include "../../bscript/execmodl.h" class AttributeExecutorModule : public TmplExecutorModule<AttributeExecutorModule> { Modified: trunk/pol-core/pol/module/clmod.h =================================================================== --- trunk/pol-core/pol/module/clmod.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/module/clmod.h 2009-09-12 23:51:20 UTC (rev 49) @@ -10,7 +10,7 @@ #ifndef CLILOCEMOD_H #define CLILOCEMOD_H -#include "bscript/execmodl.h" +#include "../../bscript/execmodl.h" class ClilocExecutorModule : public TmplExecutorModule<ClilocExecutorModule> { Modified: trunk/pol-core/pol/module/npcmod.cpp =================================================================== --- trunk/pol-core/pol/module/npcmod.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/module/npcmod.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,7 +8,7 @@ */ -#include "clib/stl_inc.h" +#include "../../clib/stl_inc.h" #ifdef _MSC_VER # pragma warning(disable:4786) Modified: trunk/pol-core/pol/module/osmod.cpp =================================================================== --- trunk/pol-core/pol/module/osmod.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/module/osmod.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -7,7 +7,7 @@ */ -#include "clib/stl_inc.h" +#include "../../clib/stl_inc.h" #include <time.h> Modified: trunk/pol-core/pol/module/partymod.h =================================================================== --- trunk/pol-core/pol/module/partymod.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/module/partymod.h 2009-09-12 23:51:20 UTC (rev 49) @@ -11,7 +11,7 @@ #ifndef PARTYMOD_H #define PARTYMOD_H -#include "bscript/execmodl.h" +#include "../../bscript/execmodl.h" class PartyExecutorModule : public TmplExecutorModule<PartyExecutorModule> { Modified: trunk/pol-core/pol/module/polsystemmod.h =================================================================== --- trunk/pol-core/pol/module/polsystemmod.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/module/polsystemmod.h 2009-09-12 23:51:20 UTC (rev 49) @@ -11,7 +11,7 @@ #ifndef POLSYSTEMEMOD_H #define POLSYSTEMEMOD_H -#include "bscript/execmodl.h" +#include "../../bscript/execmodl.h" class PolSystemExecutorModule : public TmplExecutorModule<PolSystemExecutorModule> { Modified: trunk/pol-core/pol/module/unimod.cpp =================================================================== --- trunk/pol-core/pol/module/unimod.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/module/unimod.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -21,10 +21,10 @@ #include "../../clib/strutil.h" #include "../../clib/unicode.h" -#include "bscript/berror.h" -#include "bscript/bobject.h" -#include "bscript/execmodl.h" -#include "bscript/impstr.h" +#include "../../bscript/berror.h" +#include "../../bscript/bobject.h" +#include "../../bscript/execmodl.h" +#include "../../bscript/impstr.h" #include "../accounts/account.h" #include "../network/cgdata.h" Modified: trunk/pol-core/pol/movecost.cpp =================================================================== --- trunk/pol-core/pol/movecost.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/movecost.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -10,13 +10,13 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/fileutil.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/fileutil.h" +#include "../clib/stlutil.h" +#include "../clib/strutil.h" #include "mobile/charactr.h" #include "movecost.h" Modified: trunk/pol-core/pol/movement.cpp =================================================================== --- trunk/pol-core/pol/movement.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/movement.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,10 +9,10 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/endian.h" -#include "clib/stlutil.h" +#include "../clib/endian.h" +#include "../clib/stlutil.h" #include "mobile/charactr.h" #include "network/client.h" Modified: trunk/pol-core/pol/msgfiltr.cpp =================================================================== --- trunk/pol-core/pol/msgfiltr.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/msgfiltr.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -10,7 +10,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <string.h> #include "pktboth.h" #include "pktin.h" Modified: trunk/pol-core/pol/multi/boat.cpp =================================================================== --- trunk/pol-core/pol/multi/boat.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/multi/boat.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -14,7 +14,7 @@ */ -#include "clib/stl_inc.h" +#include "../../clib/stl_inc.h" #ifdef _MSC_VER # pragma warning( disable: 4786 ) Modified: trunk/pol-core/pol/multi/house.cpp =================================================================== --- trunk/pol-core/pol/multi/house.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/multi/house.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -11,7 +11,7 @@ */ -#include "clib/stl_inc.h" +#include "../../clib/stl_inc.h" #include <assert.h> Modified: trunk/pol-core/pol/multi/multidef2.cpp =================================================================== --- trunk/pol-core/pol/multi/multidef2.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/multi/multidef2.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,9 +9,10 @@ */ -#include "clib/stl_inc.h" +#include "../../clib/stl_inc.h" + #ifdef _MSC_VER -#pragma warning( disable: 4786 ) +# pragma warning( disable: 4786 ) #endif #include <algorithm> Modified: trunk/pol-core/pol/musicrgn.cpp =================================================================== --- trunk/pol-core/pol/musicrgn.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/musicrgn.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,10 +8,10 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/random.h" +#include "../clib/cfgelem.h" +#include "../clib/random.h" #include "musicrgn.h" Modified: trunk/pol-core/pol/npc.cpp =================================================================== --- trunk/pol-core/pol/npc.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/npc.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -17,32 +17,32 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #ifdef _MSC_VER #pragma warning(disable:4786) #endif -#include "clib/cfgelem.h" -#include "clib/clib.h" -#include "clib/endian.h" -#include "clib/fileutil.h" -#include "clib/logfile.h" -#include "clib/mlog.h" -#include "clib/passert.h" -#include "clib/random.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" -#include "clib/unicode.h" +#include "../clib/cfgelem.h" +#include "../clib/clib.h" +#include "../clib/endian.h" +#include "../clib/fileutil.h" +#include "../clib/logfile.h" +#include "../clib/mlog.h" +#include "../clib/passert.h" +#include "../clib/random.h" +#include "../clib/stlutil.h" +#include "../clib/strutil.h" +#include "../clib/unicode.h" -#include "bscript/berror.h" -#include "bscript/eprog.h" -#include "bscript/executor.h" -#include "bscript/execmodl.h" -#include "bscript/modules.h" -#include "bscript/impstr.h" +#include "../bscript/berror.h" +#include "../bscript/eprog.h" +#include "../bscript/executor.h" +#include "../bscript/execmodl.h" +#include "../bscript/modules.h" +#include "../bscript/impstr.h" -#include "plib/realm.h" +#include "../plib/realm.h" #include "mobile/attribute.h" #include "network/client.h" Modified: trunk/pol-core/pol/npctemplates.cpp =================================================================== --- trunk/pol-core/pol/npctemplates.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/npctemplates.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -11,14 +11,14 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/fileutil.h" -#include "clib/stlutil.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/fileutil.h" +#include "../clib/stlutil.h" -#include "plib/pkg.h" +#include "../plib/pkg.h" class NpcTemplateConfigSource : public ConfigSource { Modified: trunk/pol-core/pol/npctmpl.cpp =================================================================== --- trunk/pol-core/pol/npctmpl.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/npctmpl.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,15 +8,15 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/fileutil.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/fileutil.h" #include "npctmpl.h" -#include "plib/pkg.h" +#include "../plib/pkg.h" #include "item/weapon.h" struct TRANSLATION Modified: trunk/pol-core/pol/objecthash.cpp =================================================================== --- trunk/pol-core/pol/objecthash.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/objecthash.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -9,11 +9,11 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" -#include "clib/endian.h" -#include "clib/passert.h" -#include "clib/logfile.h" +#include "../clib/endian.h" +#include "../clib/passert.h" +#include "../clib/logfile.h" #include "accounts/account.h" #include "objecthash.h" Modified: trunk/pol-core/pol/packetscrobj.cpp =================================================================== --- trunk/pol-core/pol/packetscrobj.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/packetscrobj.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -13,17 +13,17 @@ */ -#include "clib/stl_inc.h" -#include "clib/endian.h" -#include "clib/stlutil.h" -#include "clib/strutil.h" -#include "clib/unicode.h" +#include "../clib/stl_inc.h" +#include "../clib/endian.h" +#include "../clib/stlutil.h" +#include "../clib/strutil.h" +#include "../clib/unicode.h" -#include "bscript/executor.h" -#include "bscript/berror.h" -#include "bscript/impstr.h" -#include "bscript/objmembers.h" -#include "bscript/objmethods.h" +#include "../bscript/executor.h" +#include "../bscript/berror.h" +#include "../bscript/impstr.h" +#include "../bscript/objmembers.h" +#include "../bscript/objmethods.h" #include "mobile/charactr.h" #include "network/client.h" Modified: trunk/pol-core/pol/packetscrobj.h =================================================================== --- trunk/pol-core/pol/packetscrobj.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/packetscrobj.h 2009-09-12 23:51:20 UTC (rev 49) @@ -11,8 +11,8 @@ #ifndef PACKETSCROBJ_H #define PACKETSCROBJ_H -#include "bscript/bobject.h" -#include "clib/rawtypes.h" +#include "../bscript/bobject.h" +#include "../clib/rawtypes.h" class BPacket : public BObjectImp { Modified: trunk/pol-core/pol/party.cpp =================================================================== --- trunk/pol-core/pol/party.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/party.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -19,7 +19,7 @@ #include "../bscript/berror.h" #ifdef MEMORYLEAK -#include "bscript/bobject.h" +#include "../bscript/bobject.h" #endif #include "../clib/endian.h" #include "../clib/cfgelem.h" Modified: trunk/pol-core/pol/pktni.h =================================================================== --- trunk/pol-core/pol/pktni.h 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/pktni.h 2009-09-12 23:51:20 UTC (rev 49) @@ -13,7 +13,7 @@ #define __PKTNI_H // Rawtypes is required when doing the Struct stuff, blah -#include "clib/rawtypes.h" +#include "../clib/rawtypes.h" #ifdef _MSC_VER /* Visual C++ 4.0 and above */ Modified: trunk/pol-core/pol/pol-2008.vcproj =================================================================== --- trunk/pol-core/pol/pol-2008.vcproj 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/pol-2008.vcproj 2009-09-12 23:51:20 UTC (rev 49) @@ -44,7 +44,7 @@ <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE,NOMINMAX,INC_PASSERT" StringPooling="true" RuntimeLibrary="0" @@ -139,7 +139,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE,NOMINMAX,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -1075,10 +1075,6 @@ > </File> <File - RelativePath=".\npcemod.h" - > - </File> - <File RelativePath=".\npctmpl.h" > </File> Modified: trunk/pol-core/pol/pol.cpp =================================================================== --- trunk/pol-core/pol/pol.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/pol.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -46,7 +46,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #ifdef _MSC_VER #pragma warning( disable: 4786 ) #endif @@ -67,24 +67,24 @@ #include <time.h> #include "dtrace.h" -#include "clib/dualbuf.h" -#include "clib/endian.h" -#include "clib/esignal.h" -#include "clib/fdump.h" -#include "clib/fileutil.h" -#include "clib/logfile.h" -#include "clib/MD5.h" -#include "clib/mlog.h" -#include "clib/passert.h" -#include "clib/random.h" -#include "clib/stlutil.h" -#include "clib/strexcpt.h" -#include "clib/strutil.h" -#include "clib/threadhelp.h" -#include "clib/tracebuf.h" +#include "../clib/dualbuf.h" +#include "../clib/endian.h" +#include "../clib/esignal.h" +#include "../clib/fdump.h" +#include "../clib/fileutil.h" +#include "../clib/logfile.h" +#include "../clib/MD5.h" +#include "../clib/mlog.h" +#include "../clib/passert.h" +#include "../clib/random.h" +#include "../clib/stlutil.h" +#include "../clib/strexcpt.h" +#include "../clib/strutil.h" +#include "../clib/threadhelp.h" +#include "../clib/tracebuf.h" -#include "plib/pkg.h" -#include "plib/realm.h" +#include "../plib/pkg.h" +#include "../plib/realm.h" #include "accounts/account.h" #include "allocd.h" @@ -124,7 +124,7 @@ #include "polfile.h" #include "polsig.h" #include "poltest.h" -#include "plib/polver.h" +#include "../plib/polver.h" #include "polwww.h" #include "profile.h" #include "readcfg.h" @@ -1719,7 +1719,7 @@ { cout << "Remaining item: " << item->serial << ": " << item->name() << endl; } -#include "bscript/escriptv.h" +#include "../bscript/escriptv.h" void display_executor_instances(); void display_unreaped_orphan_instances(); void display_bobjectimp_instances(); @@ -1804,7 +1804,7 @@ void allocate_intrinsic_weapon_serials(); #ifdef _WIN32 -#include "clib/mdump.h" +#include "../clib/mdump.h" #endif #ifdef _WIN32 Modified: trunk/pol-core/pol/polcfg.cpp =================================================================== --- trunk/pol-core/pol/polcfg.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/polcfg.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -11,22 +11,22 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> -#include "bscript/config.h" +#include "../bscript/config.h" -#include "clib/cfgelem.h" -#include "clib/cfgfile.h" -#include "clib/dirlist.h" -#include "clib/logfile.h" -#include "clib/mdump.h" -#include "clib/mlog.h" -#include "clib/passert.h" -#include "clib/strutil.h" +#include "../clib/cfgelem.h" +#include "../clib/cfgfile.h" +#include "../clib/dirlist.h" +#include "../clib/logfile.h" +#include "../clib/mdump.h" +#include "../clib/mlog.h" +#include "../clib/passert.h" +#include "../clib/strutil.h" #include "core.h" #include "polcfg.h" Modified: trunk/pol-core/pol/polclock.cpp =================================================================== --- trunk/pol-core/pol/polclock.cpp 2009-09-12 13:25:56 UTC (rev 48) +++ trunk/pol-core/pol/polclock.cpp 2009-09-12 23:51:20 UTC (rev 49) @@ -8,7 +8,7 @@ */ -#include "clib/stl_inc.h" +#include "../clib/stl_inc.h" #ifdef _WIN32 # define WIN32_LEAN_AND_M... [truncated message content] |
From: <mua...@us...> - 2009-09-15 04:32:15
|
Revision: 55 http://polserver.svn.sourceforge.net/polserver/?rev=55&view=rev Author: muaddib_pol Date: 2009-09-15 04:32:01 +0000 (Tue, 15 Sep 2009) Log Message: ----------- + More slot support for containers. 80% done now. Modified Paths: -------------- trunk/pol-core/doc/core-changes.txt trunk/pol-core/pol/loaddata.cpp trunk/pol-core/pol/module/npcmod.cpp trunk/pol-core/pol/module/uomod.cpp trunk/pol-core/pol/uimport.cpp Modified: trunk/pol-core/doc/core-changes.txt =================================================================== --- trunk/pol-core/doc/core-changes.txt 2009-09-14 23:57:25 UTC (rev 54) +++ trunk/pol-core/doc/core-changes.txt 2009-09-15 04:32:01 UTC (rev 55) @@ -1,4 +1,12 @@ -- POL099 -- +09-14-2009 MuadDib: + Removed: All import abilities built in to core for UOX data files. O_O + Note: The file "import.txt" will be loaded each time POL loads, when found in the world data directory. This file's + format is the same as, for example, the ITEMS.TXT file POL saves. You can use this for example, to store all your + doors, decorations, etc, to ensure they are reloaded after a wipe, or loaded every time POL starts. These items + are added to the real world, and saved to items.txt. However, if on load the same objtype is found at the same + x y z as the item in IMPORT.TXT, it destroys that item, and loads the import one. + 09-10-2009 Turley: Added: CompressedGump support packet 0xdd Added: flag param to SendDialogGump() SENDDIALOGMENU_FORCE_OLD/0 default 0 Modified: trunk/pol-core/pol/loaddata.cpp =================================================================== --- trunk/pol-core/pol/loaddata.cpp 2009-09-14 23:57:25 UTC (rev 54) +++ trunk/pol-core/pol/loaddata.cpp 2009-09-15 04:32:01 UTC (rev 55) @@ -2,7 +2,8 @@ History ======= 2007/06/17 Shinigami: added config.world_data_path -2008/12/17 MuadDub: Added item.tile_layer - returns layer entry from tiledata/tiles.cfg +2008/12/17 MuadDib: Added item.tile_layer - returns layer entry from tiledata/tiles.cfg +2009/09/14 MuadDib: Added slot support to equip_loaded_item() and add_loaded_item() Notes ======= @@ -222,11 +223,10 @@ { gflag_enforce_container_limits = false; bool canadd = bp->can_add( *item ); - if (canadd) + u8 slotIndex = item->slot_index(); + bool add_to_slot = bp->can_add_to_slot(slotIndex); + if ( canadd && add_to_slot && item->slot_index(slotIndex) ) { - // FIXME : Add Grid Index Default Location Checks here. - // Remember, if index fails, move to the ground. - bp->add_at_random_location(item); // leaving dirty gflag_enforce_container_limits = true; cerr << "I'm so cool, I put it in the character's backpack!" << endl; @@ -256,15 +256,23 @@ gflag_enforce_container_limits = false; bool canadd = cont->can_add( *item ); + u8 slotIndex = item->slot_index(); + bool add_to_slot = cont->can_add_to_slot(slotIndex); if ( !canadd ) { cerr << "Can't add Item " << hexint(item->serial) << " to container " << hexint(cont->serial) << endl; throw runtime_error( "Data file error" ); } - - // FIXME : Add Grid Index Default Location Checks here. - // Remember, if index fails, move to the ground. + + if ( !add_to_slot || !item->slot_index(slotIndex) ) + { + cerr << "Can't add Item " << hexint(item->serial) + << " to container " << hexint(cont->serial) + << " at slot " << hexint(slotIndex) << endl; + throw runtime_error( "Data file error" ); + } + cont->add( item ); item->clear_dirty(); // adding sets dirty Modified: trunk/pol-core/pol/module/npcmod.cpp =================================================================== --- trunk/pol-core/pol/module/npcmod.cpp 2009-09-14 23:57:25 UTC (rev 54) +++ trunk/pol-core/pol/module/npcmod.cpp 2009-09-15 04:32:01 UTC (rev 55) @@ -1,8 +1,8 @@ /* History ======= +2009/09/14 MuadDib: CreateItem() now has slot support. - Notes ======= @@ -977,10 +977,15 @@ if (!backpack->can_add( *item )) return new BLong(0); + u8 slotIndex = item->slot_index(); + if ( !backpack->can_add_to_slot(slotIndex) ) + return new BLong(0); + + if ( !item->slot_index(slotIndex) ) + return new BLong(0); + u32 serial = item->serial; - // FIXME : Add Grid Index Default Location Checks here. - // Remember, if index fails, move to the ground. backpack->add( item.release() ); return new BLong(serial); Modified: trunk/pol-core/pol/module/uomod.cpp =================================================================== --- trunk/pol-core/pol/module/uomod.cpp 2009-09-14 23:57:25 UTC (rev 54) +++ trunk/pol-core/pol/module/uomod.cpp 2009-09-15 04:32:01 UTC (rev 55) @@ -44,6 +44,7 @@ 2009/08/25 Shinigami: STLport-5.2.1 fix: additional parentheses in mf_ListMultisInBox 2009/09/03 MuadDib: Changes for account related source file relocation Changes for multi related source file relocation +2009/09/14 MuadDib: Slot support added to creation/move to container. Notes ======= @@ -363,6 +364,19 @@ } } + // run before owner is found. No need to find owner if not even able to use slots. + u8 slotIndex = item->slot_index(); + if (!cont->can_add_to_slot(slotIndex)) + { + item->destroy(); + return new BError( "No slots available in this container" ); + } + if ( !item->slot_index(slotIndex) ) + { + item->destroy(); + return new BError( "Couldn't set slot index on item" ); + } + //DAVE added this 11/17, call can/onInsert scripts for this container Character* chr_owner = cont->GetCharacterOwner(); if(chr_owner == NULL) @@ -379,8 +393,6 @@ return new BError( "Item was destroyed in CanInsert Script" ); } - // FIXME : Add Grid Index Default Location Checks here. - // Remember, if index fails, move to the ground. cont->add_at_random_location( item ); update_item_to_inrange( item ); //DAVE added this 11/17, refresh owner's weight on item insert @@ -3638,6 +3650,18 @@ } } + u8 slotIndex = item->slot_index(); + if (!cont->can_add_to_slot(slotIndex)) + { + item->destroy(); + return new BError( "No slots available in new container" ); + } + if ( !item->slot_index(slotIndex) ) + { + item->destroy(); + return new BError( "Couldn't set slot index on item" ); + } + short x = static_cast<short>(px); short y = static_cast<short>(py); if (/*x < 0 || y < 0 ||*/ !cont->is_legal_posn( item, x, y )) @@ -3653,8 +3677,7 @@ item->x = x; item->y = y; item->z = 0; - // FIXME : Add Grid Index Default Location Checks here. - // Remember, if index fails, move to the ground. + cont->add( item ); update_item_to_inrange( item ); //DAVE added this 11/17: if in a Character's pack, update weight. Modified: trunk/pol-core/pol/uimport.cpp =================================================================== --- trunk/pol-core/pol/uimport.cpp 2009-09-14 23:57:25 UTC (rev 54) +++ trunk/pol-core/pol/uimport.cpp 2009-09-15 04:32:01 UTC (rev 55) @@ -5,6 +5,7 @@ 2007/06/17 Shinigami: added config.world_data_path 2009/09/03 MuadDib: Relocation of account related cpp/h Relocation of multi related cpp/h +2009/09/14 MuadDib: All UOX3 Import Code commented out. You can script this. Notes ======= @@ -67,6 +68,7 @@ typedef std::vector<unsigned long> ContSerArr; ContSerArr container_serials; +/* void uox_place_contained_items( void ) { int any; @@ -104,7 +106,7 @@ { if (cont_item->isa(UObject::CLASS_CONTAINER)) { - // FIXME : Add Grid Index Default Location Checks here. + // FIXME : Add Slot Index Default Location Checks here. // Remember, if index fails, move to the ground. ((UContainer* ) cont_item)->add( item ); contained_items[idx] = NULL; @@ -154,10 +156,12 @@ contained_items.clear(); container_serials.clear(); } +*/ +/* void uox_read_character( ConfigElem& elem ) { -/* + unsigned long account; if (!elem.remove_prop( "Account", &account ) || account != 0xFFffFFffLu) @@ -198,9 +202,11 @@ characters.push_back( chr ); SetCharacterWorldPosition( chr ); + +} */ -} +/* void uox_read_item( ConfigElem& elem ) { u32 serial; @@ -253,7 +259,9 @@ container_serials.push_back( container_serial ); } } +*/ +/* void import_wsc( void ) { string impworldfile = config.world_data_path + "impworld.wsc"; @@ -283,6 +291,7 @@ unlink( impworldfile.c_str() ); } } +*/ /****************** POL Native Files *******************/ //Dave changed 3/8/3 to use objecthash @@ -753,14 +762,11 @@ if (FileExists( importfile )) { -// if (1) + ConfigFile cf( importfile, "ITEM" ); + ConfigElem elem; + while (cf.read( elem )) { - ConfigFile cf( importfile, "ITEM" ); - ConfigElem elem; - while (cf.read( elem )) - { - import( elem ); - } + import( elem ); } unlink( importfile.c_str() ); cout << "Import Results: " << import_count << " imported, " << dupe_count << " duplicates." << endl; @@ -896,7 +902,7 @@ clear_save_index(); import_new_data(); - import_wsc(); +// import_wsc(); //dave 3/9/3 if( stored_last_item_serial < GetCurrentItemSerialNumber() ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tu...@us...> - 2009-09-16 08:49:10
|
Revision: 62 http://polserver.svn.sourceforge.net/polserver/?rev=62&view=rev Author: turley Date: 2009-09-16 08:48:57 +0000 (Wed, 16 Sep 2009) Log Message: ----------- removed chr.isUOKR added chr.ClientType removed all bool is* versionmembers and added bitfield clienttype changed all versionchecks to check the bitfield added 0xE1 support (0xA9 packet will now send the flag for request) Modified Paths: -------------- trunk/pol-core/bscript/filefmt.h trunk/pol-core/bscript/objmembers.h trunk/pol-core/bscript/parser.cpp trunk/pol-core/doc/core-changes.txt trunk/pol-core/pol/dropitem.cpp trunk/pol-core/pol/login.cpp trunk/pol-core/pol/miscmsg.cpp trunk/pol-core/pol/mobile/charactr.cpp trunk/pol-core/pol/module/uomod2.cpp trunk/pol-core/pol/msgfiltr.cpp trunk/pol-core/pol/network/client.cpp trunk/pol-core/pol/network/client.h trunk/pol-core/pol/pktin.h trunk/pol-core/pol/pktinid.h trunk/pol-core/pol/pktout.h trunk/pol-core/pol/pol.cpp trunk/pol-core/pol/poldbg.cpp trunk/pol-core/pol/statmsg.cpp trunk/pol-core/pol/tooltips.cpp trunk/pol-core/pol/ufunc.cpp trunk/pol-core/pol/ufunc2.cpp trunk/pol-core/pol/uoscrobj.cpp Modified: trunk/pol-core/bscript/filefmt.h =================================================================== --- trunk/pol-core/bscript/filefmt.h 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/bscript/filefmt.h 2009-09-16 08:48:57 UTC (rev 62) @@ -5,6 +5,7 @@ 2006/09/16 Shinigami: New Version... Internal handling of UO.EM Function execution changed. 2007/11/07 Shinigami: New Version... Removed some tokens like Left+Mid 2009/08/27 Turley: New Version Muad removed members/methods +2009/09/16 Turley: New Version removed member isUOKR Notes ======= @@ -36,6 +37,7 @@ #define ESCRIPT_FILE_VER_0009 0x0009 #define ESCRIPT_FILE_VER_000A 0x000A #define ESCRIPT_FILE_VER_000B 0x000B +#define ESCRIPT_FILE_VER_000C 0x000C /* NOTE: Update ESCRIPT_FILE_VER_CURRENT when you make a @@ -43,7 +45,7 @@ and report this to users when an older compiled version is attempted to be executed - TJ */ -#define ESCRIPT_FILE_VER_CURRENT (ESCRIPT_FILE_VER_000B) +#define ESCRIPT_FILE_VER_CURRENT (ESCRIPT_FILE_VER_000C) struct BSCRIPT_FILE_HDR { Modified: trunk/pol-core/bscript/objmembers.h =================================================================== --- trunk/pol-core/bscript/objmembers.h 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/bscript/objmembers.h 2009-09-16 08:48:57 UTC (rev 62) @@ -14,6 +14,7 @@ 2008/12/17 MuadDub: Added item.tile_layer - returns layer entry from tiledata/tiles.cfg 2009/08/06 MuadDib: Removed PasswordOnlyHash support 2009/08/19 Turley: Added character.uo_expansion_client +2009/09/06 Turley: Removed chr.isUOKR added chr.ClientType Notes ======= @@ -156,7 +157,6 @@ MBR_TRADING_WITH, MBR_TRADE_CONTAINER, MBR_ALIGNMENT, - MBR_ISUOKR, //130 MBR_CURSOR, MBR_GUMP, MBR_PROMPT, @@ -205,7 +205,8 @@ MBR_AGGRESSORTO, MBR_LAWFULLYDAMAGED, MBR_GETGOTTENBY, - MBR_UO_EXPANSION_CLIENT + MBR_UO_EXPANSION_CLIENT, + MBR_CLIENTTYPE }; Modified: trunk/pol-core/bscript/parser.cpp =================================================================== --- trunk/pol-core/bscript/parser.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/bscript/parser.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -25,6 +25,7 @@ GetGottenBy Method 2009/08/19 Turley: Added character.uo_expansion_client 2009/08/25 Shinigami: STLport-5.2.1 fix: ParseErrorStr and ReservedWord changed little bit +2009/09/06 Turley: Removed chr.isUOKR added chr.ClientType Notes ======= @@ -380,7 +381,6 @@ { MBR_TRADING_WITH, "trading_with", false}, { MBR_TRADE_CONTAINER, "trade_container", false}, { MBR_ALIGNMENT, "alignment", false}, - { MBR_ISUOKR, "isuokr", true }, { MBR_CURSOR, "cursor", false },//130 { MBR_GUMP, "gump", false }, { MBR_PROMPT, "prompt", false }, @@ -429,7 +429,8 @@ { MBR_AGGRESSORTO, "aggressorto", true},//175 { MBR_LAWFULLYDAMAGED, "lawfullydamaged", true}, { MBR_GETGOTTENBY, "getgottenby", true }, - { MBR_UO_EXPANSION_CLIENT, "uo_expansion_client", true } + { MBR_UO_EXPANSION_CLIENT, "uo_expansion_client", true }, + { MBR_CLIENTTYPE, "clienttype", true }, }; int n_objmembers = sizeof object_members / sizeof object_members[0]; ObjMember* getKnownObjMember(const char* token) Modified: trunk/pol-core/doc/core-changes.txt =================================================================== --- trunk/pol-core/doc/core-changes.txt 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/doc/core-changes.txt 2009-09-16 08:48:57 UTC (rev 62) @@ -1,4 +1,15 @@ -- POL099 -- +09-16-2009 Turley: + Removed: char.isUOKR + Added: char.ClientType r/o bitfield + Note: current Flags are: + CLIENTTYPE_5000 := 0x1, + CLIENTTYPE_6017 := 0x2, + CLIENTTYPE_60142 := 0x4, + CLIENTTYPE_UOKR := 0x8, + CLIENTTYPE_UOSA := 0x10 + Note: Pol will be now compiled with flag /LARGEADDRESSAWARE (win only flag) pol should now be able to consume more memory + 09-14-2009 MuadDib: Removed: All import abilities built in to core for UOX data files. O_O Note: The file "import.txt" will be loaded each time POL loads, when found in the world data directory. This file's Modified: trunk/pol-core/pol/dropitem.cpp =================================================================== --- trunk/pol-core/pol/dropitem.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/dropitem.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -15,6 +15,7 @@ Added slot support to find_giveitem_container() 2009/09/03 MuadDib: Changes for account related source file relocation Changes for multi related source file relocation +2009/09/06 Turley: Changed Version checks to bitfield client->ClientType Notes ======= @@ -379,7 +380,7 @@ Character* whos, UContainer* cont ) { - if ( client->is_greq_6017 ) + if ( client->ClientType & CLIENTTYPE_6017 ) { PKTOUT_25_V2 slot_buffer; slot_buffer.msgtype = PKTOUT_25_V2_ID; Modified: trunk/pol-core/pol/login.cpp =================================================================== --- trunk/pol-core/pol/login.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/login.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -13,6 +13,7 @@ 2008/02/09 Shinigami: removed hardcoded MAX_CHARS from send_start() 2009/07/23 MuadDib: updates for new Enum::Packet Out ID 2009/08/06 MuadDib: Removed PasswordOnlyHash support +2009/09/06 Turley: Changed Version checks to bitfield client->ClientType Notes ======= @@ -275,24 +276,12 @@ // MuadDib Added new seed system. This is for transferring KR/6017/Normal client detection from loginserver // to the gameserver. Allows keeping client flags from remote loginserver to gameserver for 6017 and kr // packets. - // FIXME : in 099 Rewrite, upgrade this to some sort of bitflag setup? rsp.unk7_00 = 0xFE; // This was set to 0xffffffff in the past but this will conflict with UO:KR detection rsp.unk8_03 = 0xFE; - if ( client->compareVersion(CLIENT_VER_60142)) - rsp.unk9_C3 = 0xFD; - else - rsp.unk9_C3 = 0xFE; - // 0xFE = Normal - // 0xFD = 6017+ client - // 0xFC = KR client - // FUCK EA :( - if ( client->isUOKR ) - rsp.unk10_4B =0xFC; - else if ( client->is_greq_6017 ) - rsp.unk10_4B =0xFD; - else - rsp.unk10_4B =0xFE; + rsp.unk9_C3 = 0xFE; + rsp.unk10_4B = client->ClientType; + client->transmit( &rsp, sizeof rsp ); unsigned long nseed = 0xFFffFFffLu; // CRYPT_AUTOMASK; @@ -382,12 +371,14 @@ clientflag = ssopt.uo_feature_enable; // 'default' flags. Maybe auto-enable them according to the expansion? + clientflag |= startflags.FLAG_SEND_UO3D_TYPE; // Let UO3D (KR,SA) send 0xE1 packet + // Change this to a function for clarity? -- Nando if (char_slots == 7) { - clientflag |= 0x1000; // 7th Character flag + clientflag |= startflags.FLAG_UPTO_SEVEN_CHARACTERS; // 7th Character flag } else if (char_slots == 6) { - clientflag |= 0x40; // 6th Character Flag + clientflag |= startflags.FLAG_UPTO_SIX_CHARACTERS; // 6th Character Flag } else if (char_slots == 1) { clientflag |= 0x14; // Only one character (SIEGE (0x04) + LIMIT_CHAR (0x10)) @@ -483,22 +474,8 @@ // MuadDib Added new seed system. This is for transferring KR/6017/Normal client detection from loginserver // to the gameserver. Allows keeping client flags from remote loginserver to gameserver for 6017 and kr // packets. - // FIXME : in 099 Rewrite, upgrade this to some sort of bitflag setup? - // 0xFE = Normal - // 0xFD = 6017+ client - // 0xFC = KR client - // FUCK EA :( - if (msg->unk3==0xFD) - client->is_greq_60142=true; + client->ClientType=msg->unk4; - switch ( msg->unk4 ) - { - case 0xFC: client->isUOKR = true; break; - case 0xFD: client->is_greq_6017 = true; break; -// case 0xFE: -// default: - } - send_start( client ); } Modified: trunk/pol-core/pol/miscmsg.cpp =================================================================== --- trunk/pol-core/pol/miscmsg.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/miscmsg.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -12,6 +12,8 @@ 2009/08/14 Turley: Added PKTBI_BF::TYPE_SCREEN_SIZE & TYPE_CLOSED_STATUS_GUMP (anti spam) 2009/09/03 MuadDib: Relocation of account related cpp/h 2009/09/03 MuadDib: Relocation of multi related cpp/h +2009/09/06 Turley: Changed Version checks to bitfield client->ClientType + Added 0xE1 packet (UO3D clienttype packet) Notes ======= @@ -174,8 +176,12 @@ client->itemizeclientversion(ver2, vers_det); client->setversiondetail(vers_det); - if (client->compareVersion(CLIENT_VER_60171)) //Grid-loc support - client->is_greq_6017=true; + if (client->compareVersion(CLIENT_VER_60142)) + client->setClientType(CLIENTTYPE_60142); + else if (client->compareVersion(CLIENT_VER_60171)) //Grid-loc support + client->setClientType(CLIENTTYPE_6017); + else if (client->compareVersion(CLIENT_VER_50000)) + client->setClientType(CLIENTTYPE_5000); send_season_info( client ); // Scott 10/11/2007 added for login fixes and handling 1.x clients. // Season info needs to check client version to keep from crashing 1.x // version not set until shortly after login complete. @@ -351,10 +357,12 @@ detail.rev=cfBEu32(msg->ver_Revision); detail.patch=cfBEu32(msg->ver_Patch); client->setversiondetail(detail); - if (client->compareVersion(CLIENT_VER_60171)) //Grid-loc support - client->is_greq_6017=true; - if (detail.major >= 66) // UO:SA hack - client->isUOKR=true; + if (client->compareVersion(CLIENT_VER_60142)) + client->setClientType(CLIENTTYPE_60142); + else if (client->compareVersion(CLIENT_VER_60171)) //Grid-loc support + client->setClientType(CLIENTTYPE_6017); + else if (client->compareVersion(CLIENT_VER_50000)) + client->setClientType(CLIENTTYPE_5000); // detail->patch is since 5.0.7 always numeric, so no need to make it complicated OSTRINGSTREAM os; @@ -363,6 +371,24 @@ } MESSAGE_HANDLER( PKTIN_EF, handle_ef_seed ); +void handle_e1_clienttype( Client *client, PKTIN_E1 *msg ) +{ + switch (cfBEu32(msg->clienttype)) + { + case PKTIN_E1::CLIENTTYPE_KR: + client->setClientType(CLIENTTYPE_UOKR); + break; + case PKTIN_E1::CLIENTTYPE_SA: + client->setClientType(CLIENTTYPE_UOSA); + break; + default: + printf( "Unknown client type send with packet 0xE1 : 0x%x\n",cfBEu32(msg->clienttype)); + break; + } +} +MESSAGE_HANDLER( PKTIN_E1, handle_e1_clienttype ); + + void handle_aos_commands (Client *client, PKTBI_D7* msg) { //cout <<" Sizeof: " << sizeof(PKTBI_D7) << endl; Modified: trunk/pol-core/pol/mobile/charactr.cpp =================================================================== --- trunk/pol-core/pol/mobile/charactr.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/mobile/charactr.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -40,6 +40,7 @@ 2009/09/15 MuadDib: Cleanup from registered houses on destroy u32 registered_house added to store serial of registered multi. Multi registration/unregistration support added. +2009/09/06 Turley: Changed Version checks to bitfield client->ClientType Notes ======= @@ -1556,7 +1557,7 @@ if ( client ) { send_goxyz( client, client->chr ); - if ( client->isUOKR ) + if ( client->ClientType & CLIENTTYPE_UOKR) { client->transmit(&msg, sizeof msg); } Modified: trunk/pol-core/pol/module/uomod2.cpp =================================================================== --- trunk/pol-core/pol/module/uomod2.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/module/uomod2.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -19,6 +19,7 @@ 2009/09/03 MuadDib: Relocation of account related cpp/h Relocation of multi related cpp/h 2009/09/10 Turley: CompressedGump support (Grin) +2009/09/06 Turley: Changed Version checks to bitfield client->ClientType Notes ======= @@ -776,7 +777,7 @@ return new BError( "Client already has an active gump" ); } */ - if ((chr->client->isUOKR) || ((!(flags & SENDDIALOGMENU_FORCE_OLD)) && (chr->client->compareVersion(CLIENT_VER_50000)))) + if ((chr->client->ClientType & CLIENTTYPE_UOKR) || ((!(flags & SENDDIALOGMENU_FORCE_OLD)) && (chr->client->compareVersion(CLIENT_VER_50000)))) return internal_SendCompressedGumpMenu(chr, layout_arr, data_arr, x, y); else return internal_SendUnCompressedGumpMenu(chr, layout_arr, data_arr, x, y); Modified: trunk/pol-core/pol/msgfiltr.cpp =================================================================== --- trunk/pol-core/pol/msgfiltr.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/msgfiltr.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -4,6 +4,7 @@ 2005/01/24 Shinigami: added packet 0xd9 (Spy on Client 2) to exceptions 2005/08/29 Shinigami: SPY_ON_CLIENT renamed to CLIENT_INFO 2007/07/08 Shinigami: added PKTIN_E4_ID to login_exceptions (used by UO:KR) +2009/09/06 Turley: Added 0xE1 packet Notes ======= @@ -47,6 +48,7 @@ PKTIN_A0_ID, PKTIN_A4_ID, PKTIN_D9_ID, + PKTIN_E1_ID, // Used by UO:KR & SA PKTIN_E4_ID, // Used by UO:KR PKTIN_8D_ID, -1 Modified: trunk/pol-core/pol/network/client.cpp =================================================================== --- trunk/pol-core/pol/network/client.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/network/client.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -9,6 +9,8 @@ 2009/07/23 MuadDib: updates for new Enum::Packet Out ID 2009/08/25 Shinigami: STLport-5.2.1 fix: init order changed of aosresist STLport-5.2.1 fix: params in call of Log2() +2009/09/06 Turley: Added u8 ClientType + FlagEnum + Removed is* Notes ======= @@ -80,9 +82,8 @@ last_msgtype(255), thread_pid(-1), UOExpansionFlag(0), - isUOKR(false), - is_greq_6017(false), - is_greq_60142(false), + UOExpansionFlagClient(0), + ClientType(0), paused_(false) { // For bypassing cryptseed packet @@ -322,6 +323,26 @@ return true; } +void Client::setClientType(ClientTypeFlag type) +{ + // with fall through ! + switch (type) + { + case CLIENTTYPE_UOSA: + ClientType |= CLIENTTYPE_UOSA; + case CLIENTTYPE_UOKR: + ClientType |= CLIENTTYPE_UOKR; + case CLIENTTYPE_60142: + ClientType |= CLIENTTYPE_60142; + case CLIENTTYPE_6017: + ClientType |= CLIENTTYPE_6017; + case CLIENTTYPE_5000: + ClientType |= CLIENTTYPE_5000; + default: + break; + } +} + std::string Client::status() const { std::string st; Modified: trunk/pol-core/pol/network/client.h =================================================================== --- trunk/pol-core/pol/network/client.h 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/network/client.h 2009-09-16 08:48:57 UTC (rev 62) @@ -10,6 +10,8 @@ 2007/07/09 Shinigami: added isUOKR [bool] - UO:KR client used? 2009/08/10 MuadDib: Added CLIENT_VER_50000 for v5.0.0x clients. 2009/08/19 Turley: Added u32 UOExpansionFlagClient +2009/09/06 Turley: Added u8 ClientType + FlagEnum + Removed is* Notes ======= @@ -66,7 +68,17 @@ const struct VersionDetailStruct CLIENT_VER_50000={5,0,0,0}; const struct VersionDetailStruct CLIENT_VER_60171={6,0,1,7}; const struct VersionDetailStruct CLIENT_VER_60142={6,0,14,2}; +const struct VersionDetailStruct CLIENT_VER_70000={7,0,0,0}; +enum ClientTypeFlag +{ + CLIENTTYPE_5000 = 0x1, + CLIENTTYPE_6017 = 0x2, + CLIENTTYPE_60142 = 0x4, + CLIENTTYPE_UOKR = 0x8, + CLIENTTYPE_UOSA = 0x10 +}; + class Client { public: @@ -93,6 +105,7 @@ void itemizeclientversion( const std::string& ver, VersionDetailStruct& detail ); bool compareVersion( const std::string& ver ); bool compareVersion(const VersionDetailStruct& ver2); + void setClientType(ClientTypeFlag type); void setclientinfo( const PKTIN_D9 *msg ) { memcpy( &clientinfo_, msg, sizeof(clientinfo_) ); } BStruct* getclientinfo() const; @@ -179,9 +192,7 @@ int thread_pid; u16 UOExpansionFlag; u32 UOExpansionFlagClient; - bool isUOKR; - bool is_greq_6017; - bool is_greq_60142; + u8 ClientType; private: struct { Modified: trunk/pol-core/pol/pktin.h =================================================================== --- trunk/pol-core/pol/pktin.h 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/pktin.h 2009-09-16 08:48:57 UTC (rev 62) @@ -4,6 +4,7 @@ 2009/07/26 MuadDib: Initial creation. This file is for packets sent by client only. 2009/08/14 Turley: fixed definition of PKTIN_5D 2009/08/14 Turley: fixed definition of PKTIN_00 +2009/09/06 Turley: Added PKTIN_E1 Notes ======= @@ -468,6 +469,18 @@ }; asserteql( sizeof(PKTIN_D9), 0x10C ); +struct PKTIN_E1 { + u8 msgtype; + u16 msglen; + u16 unknown_0x01; + u32 clienttype; + enum { + CLIENTTYPE_KR = 0x2, + CLIENTTYPE_SA = 0x3 + }; +}; +asserteql(sizeof(PKTIN_E1),0x09); + struct PKTIN_E4 { u8 msgtype; u16 msglen; Modified: trunk/pol-core/pol/pktinid.h =================================================================== --- trunk/pol-core/pol/pktinid.h 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/pktinid.h 2009-09-16 08:48:57 UTC (rev 62) @@ -1,7 +1,8 @@ /* History ======= -2009/07/26 MuadDib: Initial creation. +2009/07/26 MuadDib: Initial creation. +2009/09/06 Turley: Changed Version checks to bitfield client->ClientType Notes ======= @@ -55,6 +56,7 @@ PKTIN_B5_ID = 0xB5, // Chat Button PKTIN_B6_ID = 0xB6, // Request Tooltip PKTIN_D9_ID = 0xD9, // Client Machine's Details + PKTIN_E1_ID = 0xE1, // Client Type (UO3D) PKTIN_E4_ID = 0xE4, // KR Encryption Request PKTIN_EF_ID = 0xEF // Seed Packet, introduced 6.0.5.0 Modified: trunk/pol-core/pol/pktout.h =================================================================== --- trunk/pol-core/pol/pktout.h 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/pktout.h 2009-09-16 08:48:57 UTC (rev 62) @@ -9,6 +9,7 @@ 2009/08/09 MuadDib: Re factor of Packet 0x25, 0x11 for naming convention 2009/08/14 Turley: PKTOUT_B9_V2 removed unk u16 and changed flag to u32 2009/09/10 Turley: CompressedGump support (Grin) +2009/09/06 Turley: Added more known Flags to 0xA9 Notes ======= @@ -932,7 +933,11 @@ FLAG_AOS_FEATURES = 0x0020, // Age of Shadows FLAG_UPTO_SIX_CHARACTERS = 0x0040, // Use up to 6 Characters (not only 5) FLAG_SE_FEATURES = 0x0080, // Samurai Empire - FLAG_ML_FEATURES = 0x0100 // Mondain's Legacy + FLAG_ML_FEATURES = 0x0100, // Mondain's Legacy + FLAG_SEND_UO3D_TYPE = 0x0400, // KR and UO:SA will send 0xE1 packet + FLAG_UNK_0x0800 = 0x0800, // ? + FLAG_UPTO_SEVEN_CHARACTERS = 0x1000, // Use up to 7 Characters + FLAG_UNK_0x2000 = 0x2000 // ? }; }; Modified: trunk/pol-core/pol/pol.cpp =================================================================== --- trunk/pol-core/pol/pol.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/pol.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -41,6 +41,7 @@ 2009/09/03 MuadDib: Relocation of account related cpp/h Changes for multi related source file relocation 2009/09/15 MuadDib: Multi registration/unregistration support added. +2009/09/06 Turley: Changed Version checks to bitfield client->ClientType Notes ======= @@ -680,7 +681,7 @@ return false; } // It's in the 6017 handlers - if ( (client->is_greq_6017) && (handler_v2[ msgtype ].msglen) ) + if ( ( client->ClientType & CLIENTTYPE_6017 ) && (handler_v2[ msgtype ].msglen) ) { if ( (handler_v2[msgtype].msglen == MSGLEN_2BYTELEN_DATA) ) { @@ -763,7 +764,7 @@ { if (client->msgtype_filter->msgtype_allowed[msgtype]) { - if ( (client->is_greq_6017) && (handler_v2[ msgtype ].msglen) ) + if ( ( client->ClientType & CLIENTTYPE_6017 ) && (handler_v2[ msgtype ].msglen) ) { try { dtrace(10) << "Client#" << client->instance_ << ": message " << hexint( static_cast<unsigned short>(msgtype)) << endl; @@ -860,7 +861,7 @@ /* unknown_E[16] */ {0x5a, 0xce, 0x3e, 0xe3, 0x97, 0x92, 0xe4, 0x8a, 0xf1, 0x9a, 0xd3, 0x04, 0x41, 0x03, 0xcb, 0x53} }; - client->isUOKR = true; // UO:KR logging in + client->setClientType(CLIENTTYPE_UOKR); // UO:KR logging in client->transmit( &msg, sizeof msg ); } Modified: trunk/pol-core/pol/poldbg.cpp =================================================================== --- trunk/pol-core/pol/poldbg.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/poldbg.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -62,7 +62,7 @@ "reportables", "clientversion", "delay_mod", "shield", "uclang", "clientver_detail", "clientinfo", "createdat", "opponent", "connected", "trading_with", - "isuokr", "cursor", "gump", "prompt", "movemode", + "cursor", "gump", "prompt", "movemode", "hitchance_mod", "evasionchance_mod", "resist_fire", "resist_cold", "resist_energy", "resist_poison", "resist_physical", "resist_fire_mod", "resist_cold_mod", Modified: trunk/pol-core/pol/statmsg.cpp =================================================================== --- trunk/pol-core/pol/statmsg.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/statmsg.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -4,6 +4,7 @@ 2006/05/23 Shinigami: send_full_statmsg() updated to support Elfs 2009/07/23 MuadDib: updates for new Enum::Packet Out ID 2009/08/09 MuadDib: Re factor of Packet 0x25, 0x11 for naming convention +2009/09/06 Turley: Changed Version checks to bitfield client->ClientType Notes ======= @@ -33,7 +34,7 @@ // maintain this control with it. Unless they stick even more stuff mid-packet // after KR (like in SA - Stygian Abyss), all newer supported stuff will go // to the send_full_statmsg_new() function. Boooo to OSI! - if ( (client->UOExpansionFlag & ML) && (client->getversiondetail().major>=5 || client->isUOKR) ) + if ( (client->UOExpansionFlag & ML) && (client->ClientType & CLIENTTYPE_5000) ) send_full_statmsg_new(client, chr); else send_full_statmsg_std(client, chr); Modified: trunk/pol-core/pol/tooltips.cpp =================================================================== --- trunk/pol-core/pol/tooltips.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/tooltips.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -6,6 +6,7 @@ 2009/01/03 MuadDib: Some generic recoding to remove useless code. O_O 2009/01/27 MuadDib: Rewrote Obj Cache Building/Sending. 2009/07/26 MuadDib: Packet struct refactoring. +2009/09/06 Turley: Changed Version checks to bitfield client->ClientType Notes ======= @@ -64,7 +65,7 @@ { if (ssopt.uo_feature_enable & PKTOUT_A9_START_FLAGS::FLAG_AOS_FEATURES) { - if ((ssopt.force_new_objcache_packets) || (client->isUOKR) || (client->getversiondetail().major>=5)) + if ((ssopt.force_new_objcache_packets) || (client->ClientType & CLIENTTYPE_5000)) { unsigned char* uokr_buffer = BuildObjCache(obj, true); client->transmit(uokr_buffer, 9); @@ -102,7 +103,7 @@ if (inrange(client2->chr, obj)) { //send_object_cache(client2, obj); - if ((ssopt.force_new_objcache_packets) || (client2->isUOKR) || (client2->getversiondetail().major>=5)) + if ((ssopt.force_new_objcache_packets) || (client2->ClientType & CLIENTTYPE_5000)) { if (uokr_buffer == NULL) uokr_buffer = BuildObjCache(obj, true); Modified: trunk/pol-core/pol/ufunc.cpp =================================================================== --- trunk/pol-core/pol/ufunc.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/ufunc.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -22,6 +22,7 @@ Relocation of multi related cpp/h 2009/09/13 MuadDib: Optimized send_remove_character_to_nearby_cansee, send_remove_character_to_nearby_cantsee, send_remove_character_to_nearby to build packet and handle iter internally. Packet built just once this way, and sent to those who need it. +2009/09/06 Turley: Changed Version checks to bitfield client->ClientType Notes ======= @@ -529,7 +530,7 @@ void send_put_in_container( Client* client, const Item* item ) { - if ( client->is_greq_6017 ) + if ( client->ClientType & CLIENTTYPE_6017 ) { PKTOUT_25_V2 slot_buffer; BuildMsg25(item, &slot_buffer); @@ -567,7 +568,7 @@ if (client2->chr->mightsee( item->container )) { // FIXME if the container has an owner, and I'm not it, don't tell me? - if ( client2->is_greq_6017 ) + if ( client2->ClientType & CLIENTTYPE_6017 ) { if (!slot_built) BuildMsg25(item, &slot_buffer); @@ -1851,11 +1852,11 @@ { continue; } - if (is_6017 && !client->is_greq_6017) + if (is_6017 && (!( client->ClientType & CLIENTTYPE_6017 ))) { continue; } - if (is_UOKR && !client->isUOKR) + if (is_UOKR && (!( client->ClientType & CLIENTTYPE_UOKR ))) { continue; } @@ -1880,11 +1881,11 @@ { continue; } - if (is_6017 && !client->is_greq_6017) + if (is_6017 && (!( client->ClientType & CLIENTTYPE_6017 ))) { continue; } - if (is_UOKR && !client->isUOKR) + if (is_UOKR && (!( client->ClientType & CLIENTTYPE_UOKR ))) { continue; } @@ -2413,7 +2414,7 @@ } } - if (client->is_greq_60142) + if ( client->ClientType & CLIENTTYPE_60142 ) { PKTOUT_B9_V2 msg; msg.msgtype = PKTOUT_B9_V2_ID; Modified: trunk/pol-core/pol/ufunc2.cpp =================================================================== --- trunk/pol-core/pol/ufunc2.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/ufunc2.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -2,6 +2,7 @@ History ======= 2009/07/23 MuadDib: updates for new Enum::Packet Out ID +2009/09/06 Turley: Changed Version checks to bitfield client->ClientType Notes ======= @@ -154,7 +155,7 @@ //dave changed 11/9/3, don't send invis items to those who can't see invis void send_container_contents( Client *client, const UContainer& cont, bool show_invis ) { - if (client->is_greq_6017 || client->isUOKR) + if ( client->ClientType & CLIENTTYPE_6017 ) { static PKTOUT_3C_6017 msg; Modified: trunk/pol-core/pol/uoscrobj.cpp =================================================================== --- trunk/pol-core/pol/uoscrobj.cpp 2009-09-16 08:40:14 UTC (rev 61) +++ trunk/pol-core/pol/uoscrobj.cpp 2009-09-16 08:48:57 UTC (rev 62) @@ -21,6 +21,7 @@ 2009/08/31 MuadDib: Changed layer check on graphic change, excluding mount layer entirely. 2009/09/03 MuadDib: Relocation of account related cpp/h Relocation of multi related cpp/h +2009/09/06 Turley: Removed isUOKR added ClientType Notes ======= @@ -1290,9 +1291,9 @@ return new BError("Mobile is not currently trading with anyone."); } break; - case MBR_ISUOKR: + case MBR_CLIENTTYPE: if (client != NULL) - return new BLong( client->isUOKR ? 1 : 0 ); + return new BLong( client->ClientType ); else return new BLong(0); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tu...@us...> - 2009-09-16 09:22:10
|
Revision: 64 http://polserver.svn.sourceforge.net/polserver/?rev=64&view=rev Author: turley Date: 2009-09-16 09:21:56 +0000 (Wed, 16 Sep 2009) Log Message: ----------- update for old vcproj files Modified Paths: -------------- trunk/pol-core/bscript/bscript.vcproj trunk/pol-core/clib/clib.vcproj trunk/pol-core/dist/dist.vcproj trunk/pol-core/doc/doc.vcproj trunk/pol-core/ecompile/ecompile.vcproj trunk/pol-core/gp/gp.vcproj trunk/pol-core/plib/plib.vcproj trunk/pol-core/pol/pol.vcproj trunk/pol-core/poltool/poltool.vcproj trunk/pol-core/runecl/runecl.vcproj trunk/pol-core/support/support.vcproj trunk/pol-core/uoconvert/uoconvert.vcproj trunk/pol-core/uotool/uotool.vcproj Modified: trunk/pol-core/bscript/bscript.vcproj =================================================================== --- trunk/pol-core/bscript/bscript.vcproj 2009-09-16 09:02:33 UTC (rev 63) +++ trunk/pol-core/bscript/bscript.vcproj 2009-09-16 09:21:56 UTC (rev 64) @@ -4,116 +4,166 @@ Version="7.10" Name="bscript" ProjectGUID="{5005476B-7BD3-42A2-94CA-3AD2D0E2947C}" - SccProjectName="" - SccLocalPath=""> + RootNamespace="bscript" + TargetFrameworkVersion="131072" + > <Platforms> <Platform - Name="Win32"/> + Name="Win32" + /> </Platforms> + <ToolFiles> + </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory=".\Executor\Debug" IntermediateDirectory=".\Executor\Debug" ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""E:\UOL\POL-CORE\STLport\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="_DEBUG,WIN32,_LIB,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" - ForceConformanceInForLoopScope="TRUE" + ForceConformanceInForLoopScope="true" PrecompiledHeaderFile=".\Executor\Debug/bscript_executor.pch" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName=".\Debug/" WarningLevel="3" - SuppressStartupBanner="TRUE" + SuppressStartupBanner="true" DebugInformationFormat="3" - CompileAs="0"/> + CompileAs="0" + /> <Tool - Name="VCCustomBuildTool"/> + Name="VCManagedResourceCompilerTool" + /> <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool Name="VCLibrarianTool" OutputFile=".\Debug\bscript.lib" - SuppressStartupBanner="TRUE"/> + SuppressStartupBanner="true" + /> <Tool - Name="VCMIDLTool"/> + Name="VCALinkTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCXDCMakeTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCBscMakeTool" + /> <Tool - Name="VCPreLinkEventTool"/> + Name="VCFxCopTool" + /> <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> <Configuration Name="Release|Win32" OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""E:\UOL\POL-CORE\STLport\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="NDEBUG,WIN32,_LIB,INC_PASSERT" - StringPooling="TRUE" + StringPooling="true" RuntimeLibrary="0" - BufferSecurityCheck="FALSE" - EnableFunctionLevelLinking="TRUE" - ForceConformanceInForLoopScope="TRUE" + BufferSecurityCheck="false" + EnableFunctionLevelLinking="true" + ForceConformanceInForLoopScope="true" PrecompiledHeaderFile=".\Release/bscript_executor.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" WarningLevel="3" - SuppressStartupBanner="TRUE" + SuppressStartupBanner="true" DebugInformationFormat="3" - CompileAs="0"/> + CompileAs="0" + /> <Tool - Name="VCCustomBuildTool"/> + Name="VCManagedResourceCompilerTool" + /> <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool Name="VCLibrarianTool" OutputFile=".\Release\bscript.lib" - SuppressStartupBanner="TRUE"/> + SuppressStartupBanner="true" + /> <Tool - Name="VCMIDLTool"/> + Name="VCALinkTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCXDCMakeTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCBscMakeTool" + /> <Tool - Name="VCPreLinkEventTool"/> + Name="VCFxCopTool" + /> <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> </Configurations> <References> @@ -121,227 +171,265 @@ <Files> <Filter Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > <File - RelativePath=".\basicio.cpp"> + RelativePath=".\berror.cpp" + > </File> <File - RelativePath=".\basicmod.cpp"> + RelativePath=".\blong.cpp" + > </File> <File - RelativePath=".\berror.cpp"> + RelativePath=".\bstruct.cpp" + > </File> <File - RelativePath=".\blong.cpp"> + RelativePath="..\pol\clfunc.cpp" + > </File> <File - RelativePath=".\bstruct.cpp"> + RelativePath=".\compctx.cpp" + > </File> <File - RelativePath="..\pol\clemod.cpp"> + RelativePath="compiler.cpp" + > </File> <File - RelativePath="..\pol\clfunc.cpp"> + RelativePath="compilercfg.cpp" + > </File> <File - RelativePath=".\compctx.cpp"> + RelativePath=".\dbl.cpp" + > </File> <File - RelativePath="compiler.cpp"> + RelativePath=".\dict.cpp" + > </File> <File - RelativePath="compilercfg.cpp"> + RelativePath=".\eprog.cpp" + > </File> <File - RelativePath=".\dbl.cpp"> + RelativePath=".\eprog2.cpp" + > </File> <File - RelativePath=".\dict.cpp"> + RelativePath=".\eprog3.cpp" + > </File> <File - RelativePath=".\eprog.cpp"> + RelativePath=".\eprog_read.cpp" + > </File> <File - RelativePath=".\eprog2.cpp"> + RelativePath=".\escript_config.cpp" + > </File> <File - RelativePath=".\eprog3.cpp"> + RelativePath=".\escriptv.cpp" + > </File> <File - RelativePath=".\eprog_read.cpp"> + RelativePath=".\escrutil.cpp" + > </File> <File - RelativePath=".\escript_config.cpp"> + RelativePath=".\execmodl.cpp" + > </File> <File - RelativePath=".\escriptv.cpp"> + RelativePath=".\executor.cpp" + > </File> <File - RelativePath=".\escrutil.cpp"> + RelativePath=".\fmodule.cpp" + > </File> <File - RelativePath=".\execmodl.cpp"> + RelativePath=".\object.cpp" + > </File> <File - RelativePath=".\executor.cpp"> + RelativePath=".\objstrm.cpp" + > </File> <File - RelativePath=".\fmodule.cpp"> + RelativePath=".\ofstrm.cpp" + > </File> <File - RelativePath=".\mathemod.cpp"> + RelativePath="parser.cpp" + > </File> <File - RelativePath=".\object.cpp"> + RelativePath=".\StdAfx.cpp" + > </File> <File - RelativePath=".\objstrm.cpp"> + RelativePath=".\str.cpp" + > </File> <File - RelativePath=".\ofstrm.cpp"> + RelativePath=".\symcont.cpp" + > </File> <File - RelativePath="parser.cpp"> + RelativePath=".\tkn_strm.cpp" + > </File> <File - RelativePath=".\StdAfx.cpp"> + RelativePath=".\token.cpp" + > </File> <File - RelativePath=".\str.cpp"> + RelativePath=".\userfunc.cpp" + > </File> - <File - RelativePath=".\symcont.cpp"> - </File> - <File - RelativePath=".\tkn_strm.cpp"> - </File> - <File - RelativePath=".\token.cpp"> - </File> - <File - RelativePath=".\userfunc.cpp"> - </File> </Filter> <Filter Name="Header Files" - Filter="h;hpp;hxx;hm;inl"> + Filter="h;hpp;hxx;hm;inl" + > <File - RelativePath=".\basicio.h"> + RelativePath=".\berror.h" + > </File> <File - RelativePath=".\basicmod.h"> + RelativePath=".\bobject.h" + > </File> <File - RelativePath=".\berror.h"> + RelativePath=".\bstruct.h" + > </File> <File - RelativePath=".\bobject.h"> + RelativePath=".\compctx.h" + > </File> <File - RelativePath=".\bstruct.h"> + RelativePath=".\compiler.h" + > </File> <File - RelativePath="..\pol\clemod.h"> + RelativePath="compilercfg.h" + > </File> <File - RelativePath=".\compctx.h"> + RelativePath=".\compmodl.h" + > </File> <File - RelativePath=".\compiler.h"> + RelativePath=".\config.h" + > </File> <File - RelativePath="compilercfg.h"> + RelativePath=".\contiter.h" + > </File> <File - RelativePath=".\compmodl.h"> + RelativePath=".\dict.h" + > </File> <File - RelativePath=".\config.h"> + RelativePath=".\eprog.h" + > </File> <File - RelativePath=".\contiter.h"> + RelativePath=".\escript.h" + > </File> <File - RelativePath=".\dict.h"> + RelativePath=".\escriptv.h" + > </File> <File - RelativePath=".\eprog.h"> + RelativePath=".\escrutil.h" + > </File> <File - RelativePath=".\escript.h"> + RelativePath=".\execmodl.h" + > </File> <File - RelativePath=".\escriptv.h"> + RelativePath=".\exectype.h" + > </File> <File - RelativePath=".\escrutil.h"> + RelativePath=".\executor.h" + > </File> <File - RelativePath=".\execmodl.h"> + RelativePath=".\executortype.h" + > </File> <File - RelativePath=".\exectype.h"> + RelativePath=".\filefmt.h" + > </File> <File - RelativePath=".\executor.h"> + RelativePath=".\fmodule.h" + > </File> <File - RelativePath=".\executortype.h"> + RelativePath=".\impstr.h" + > </File> <File - RelativePath=".\fileemod.h"> + RelativePath=".\modules.h" + > </File> <File - RelativePath=".\filefmt.h"> + RelativePath="objmembers.h" + > </File> <File - RelativePath=".\fmodule.h"> + RelativePath="objmethods.h" + > </File> <File - RelativePath=".\impstr.h"> + RelativePath=".\ofile.h" + > </File> <File - RelativePath=".\mathemod.h"> + RelativePath=".\operator.h" + > </File> <File - RelativePath=".\modules.h"> + RelativePath=".\options.h" + > </File> <File - RelativePath="objmembers.h"> + RelativePath=".\parser.h" + > </File> <File - RelativePath="objmethods.h"> + RelativePath=".\StdAfx.h" + > </File> <File - RelativePath=".\ofile.h"> + RelativePath=".\symcont.h" + > </File> <File - RelativePath=".\operator.h"> + RelativePath=".\token.h" + > </File> <File - RelativePath=".\options.h"> + RelativePath=".\tokens.h" + > </File> <File - RelativePath=".\parser.h"> + RelativePath=".\userfunc.h" + > </File> <File - RelativePath=".\StdAfx.h"> + RelativePath=".\verbtbl.h" + > </File> - <File - RelativePath=".\symcont.h"> - </File> - <File - RelativePath=".\token.h"> - </File> - <File - RelativePath=".\tokens.h"> - </File> - <File - RelativePath=".\userfunc.h"> - </File> - <File - RelativePath=".\verbtbl.h"> - </File> </Filter> </Files> <Globals> Modified: trunk/pol-core/clib/clib.vcproj =================================================================== --- trunk/pol-core/clib/clib.vcproj 2009-09-16 09:02:33 UTC (rev 63) +++ trunk/pol-core/clib/clib.vcproj 2009-09-16 09:21:56 UTC (rev 64) @@ -4,118 +4,168 @@ Version="7.10" Name="clib" ProjectGUID="{7CD5572B-8A78-46C5-AC2D-39EE47ACD01A}" - SccProjectName="" - SccLocalPath=""> + RootNamespace="clib" + TargetFrameworkVersion="131072" + > <Platforms> <Platform - Name="Win32"/> + Name="Win32" + /> </Platforms> + <ToolFiles> + </ToolFiles> <Configurations> <Configuration Name="Release|Win32" OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - OmitFramePointers="TRUE" - AdditionalIncludeDirectories=""E:\UOL\POL-CORE\STLport\stlport";.." + OmitFramePointers="true" + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="NDEBUG,WIN32,_LIB,NOMINMAX,INC_PASSERT" - StringPooling="TRUE" - ExceptionHandling="TRUE" + StringPooling="true" + ExceptionHandling="1" RuntimeLibrary="0" - BufferSecurityCheck="FALSE" - EnableFunctionLevelLinking="TRUE" - ForceConformanceInForLoopScope="TRUE" + BufferSecurityCheck="false" + EnableFunctionLevelLinking="true" + ForceConformanceInForLoopScope="true" PrecompiledHeaderFile=".\Release/clib.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" - WarningLevel="3" - SuppressStartupBanner="TRUE" - DebugInformationFormat="3"/> + WarningLevel="1" + SuppressStartupBanner="true" + DebugInformationFormat="3" + /> <Tool - Name="VCCustomBuildTool"/> + Name="VCManagedResourceCompilerTool" + /> <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool Name="VCLibrarianTool" OutputFile=".\Release\clib.lib" - SuppressStartupBanner="TRUE"/> + SuppressStartupBanner="true" + /> <Tool - Name="VCMIDLTool"/> + Name="VCALinkTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCXDCMakeTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCBscMakeTool" + /> <Tool - Name="VCPreLinkEventTool"/> + Name="VCFxCopTool" + /> <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool Name="VCCLCompilerTool" AdditionalOptions="/EHac" Optimization="0" - AdditionalIncludeDirectories=""E:\UOL\POL-CORE\STLport\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="_DEBUG,WIN32,_LIB,NOMINMAX,INC_PASSERT" - ExceptionHandling="FALSE" + ExceptionHandling="0" BasicRuntimeChecks="3" RuntimeLibrary="1" - ForceConformanceInForLoopScope="TRUE" + ForceConformanceInForLoopScope="true" PrecompiledHeaderFile=".\Debug/clib.pch" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName=".\Debug/" WarningLevel="3" - SuppressStartupBanner="TRUE" - DebugInformationFormat="3"/> + SuppressStartupBanner="true" + DebugInformationFormat="3" + /> <Tool - Name="VCCustomBuildTool"/> + Name="VCManagedResourceCompilerTool" + /> <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool Name="VCLibrarianTool" OutputFile=".\Debug\clib.lib" - SuppressStartupBanner="TRUE"/> + SuppressStartupBanner="true" + /> <Tool - Name="VCMIDLTool"/> + Name="VCALinkTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCXDCMakeTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCBscMakeTool" + /> <Tool - Name="VCPreLinkEventTool"/> + Name="VCFxCopTool" + /> <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> </Configurations> <References> @@ -123,300 +173,398 @@ <Files> <Filter Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > <File - RelativePath="binaryfile.cpp"> + RelativePath="binaryfile.cpp" + > </File> <File - RelativePath=".\cfgfile.cpp"> + RelativePath=".\cfgfile.cpp" + > <FileConfiguration - Name="Debug|Win32"> + Name="Debug|Win32" + > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="3" - PrecompiledHeaderThrough="stl_inc.h"/> + UsePrecompiledHeader="2" + PrecompiledHeaderThrough="stl_inc.h" + /> </FileConfiguration> </File> <File - RelativePath=".\cfgsect.cpp"> + RelativePath=".\cfgsect.cpp" + > </File> <File - RelativePath="cmdargs.cpp"> + RelativePath="cmdargs.cpp" + > </File> <File - RelativePath="dirfunc.cpp"> + RelativePath="dirfunc.cpp" + > </File> <File - RelativePath=".\dirlist.cpp"> + RelativePath=".\dirlist.cpp" + > </File> <File - RelativePath=".\dualbuf.cpp"> + RelativePath=".\dualbuf.cpp" + > </File> <File - RelativePath="endian.cpp"> + RelativePath="endian.cpp" + > </File> <File - RelativePath=".\esignal.cpp"> + RelativePath=".\esignal.cpp" + > </File> <File - RelativePath="fdump.cpp"> + RelativePath="fdump.cpp" + > </File> <File - RelativePath=".\filecont.cpp"> + RelativePath=".\filecont.cpp" + > </File> <File - RelativePath=".\fileutil.cpp"> + RelativePath=".\fileutil.cpp" + > </File> <File - RelativePath="forspcnt.cpp"> + RelativePath="forspcnt.cpp" + > </File> <File - RelativePath="iohelp.cpp"> + RelativePath="iohelp.cpp" + > </File> <File - RelativePath="logfile.cpp"> + RelativePath="logfile.cpp" + > </File> <File - RelativePath="MD5.cpp"> + RelativePath="MD5.cpp" + > </File> <File - RelativePath="mdump.cpp"> + RelativePath="mdump.cpp" + > </File> <File - RelativePath=".\mlog.cpp"> + RelativePath=".\mlog.cpp" + > </File> <File - RelativePath=".\msjexhnd.cpp"> + RelativePath=".\msjexhnd.cpp" + > </File> <File - RelativePath=".\nlogfile.cpp"> + RelativePath=".\nlogfile.cpp" + > </File> <File - RelativePath="NTService.cpp"> + RelativePath="NTService.cpp" + > </File> <File - RelativePath=".\opnew.cpp"> + RelativePath=".\opnew.cpp" + > </File> <File - RelativePath=".\passert.cpp"> + RelativePath=".\passert.cpp" + > </File> <File - RelativePath=".\progver.cpp"> + RelativePath=".\progver.cpp" + > </File> <File - RelativePath="random.cpp"> + RelativePath="random.cpp" + > </File> <File - RelativePath=".\rarray.cpp"> + RelativePath=".\rarray.cpp" + > </File> <File - RelativePath=".\sckutil.cpp"> + RelativePath=".\sckutil.cpp" + > </File> <File - RelativePath="socketsvc.cpp"> + RelativePath="socketsvc.cpp" + > </File> <File - RelativePath=".\StdAfx.cpp"> + RelativePath=".\StdAfx.cpp" + > <FileConfiguration - Name="Debug|Win32"> + Name="Debug|Win32" + > <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1" - PrecompiledHeaderThrough="stl_inc.h"/> + PrecompiledHeaderThrough="stl_inc.h" + /> </FileConfiguration> </File> <File - RelativePath="stracpy.cpp"> + RelativePath="stracpy.cpp" + > </File> <File - RelativePath=".\strexcpt.cpp"> + RelativePath=".\strexcpt.cpp" + > </File> <File - RelativePath=".\strset.cpp"> + RelativePath=".\strset.cpp" + > </File> <File - RelativePath=".\strutil.cpp"> + RelativePath=".\strutil.cpp" + > </File> <File - RelativePath="threadhelp.cpp"> + RelativePath="threadhelp.cpp" + > </File> <File - RelativePath=".\tracebuf.cpp"> + RelativePath=".\tracebuf.cpp" + > </File> <File - RelativePath=".\unicode.cpp"> + RelativePath=".\unicode.cpp" + > </File> <File - RelativePath="wallclock.cpp"> + RelativePath="wallclock.cpp" + > </File> <File - RelativePath=".\wnsckt.cpp"> + RelativePath=".\wnsckt.cpp" + > </File> <File - RelativePath=".\xmain.cpp"> + RelativePath=".\xmain.cpp" + > </File> </Filter> <Filter Name="Header Files" - Filter="h;hpp;hxx;hm;inl"> + Filter="h;hpp;hxx;hm;inl" + > <File - RelativePath="binaryfile.h"> + RelativePath="binaryfile.h" + > </File> <File - RelativePath="bitutil.h"> + RelativePath="bitutil.h" + > </File> <File - RelativePath=".\cfgelem.h"> + RelativePath=".\cfgelem.h" + > </File> <File - RelativePath=".\cfgfile.h"> + RelativePath=".\cfgfile.h" + > </File> <File - RelativePath=".\cfgsect.h"> + RelativePath=".\cfgsect.h" + > </File> <File - RelativePath=".\cistring.h"> + RelativePath=".\cistring.h" + > </File> <File - RelativePath=".\clib.h"> + RelativePath=".\clib.h" + > </File> <File - RelativePath=".\clibopt.h"> + RelativePath=".\clibopt.h" + > </File> <File - RelativePath="cmdargs.h"> + RelativePath="cmdargs.h" + > </File> <File - RelativePath="compileassert.h"> + RelativePath="compileassert.h" + > </File> <File - RelativePath=".\dirlist.h"> + RelativePath=".\dirlist.h" + > </File> <File - RelativePath=".\drarray.h"> + RelativePath=".\drarray.h" + > </File> <File - RelativePath=".\dualbuf.h"> + RelativePath=".\dualbuf.h" + > </File> <File - RelativePath=".\endian.h"> + RelativePath=".\endian.h" + > </File> <File - RelativePath=".\esignal.h"> + RelativePath=".\esignal.h" + > </File> <File - RelativePath=".\fdump.h"> + RelativePath=".\fdump.h" + > </File> <File - RelativePath=".\fileutil.h"> + RelativePath=".\fileutil.h" + > </File> <File - RelativePath=".\fixalloc.h"> + RelativePath=".\fixalloc.h" + > </File> <File - RelativePath="iohelp.h"> + RelativePath="iohelp.h" + > </File> <File - RelativePath=".\logfile.h"> + RelativePath=".\logfile.h" + > </File> <File - RelativePath=".\maputil.h"> + RelativePath=".\maputil.h" + > </File> <File - RelativePath="MD5.h"> + RelativePath="MD5.h" + > </File> <File - RelativePath="mdump.h"> + RelativePath="mdump.h" + > </File> <File - RelativePath="mdumpimp.h"> + RelativePath="mdumpimp.h" + > </File> <File - RelativePath=".\mlog.h"> + RelativePath=".\mlog.h" + > </File> <File - RelativePath=".\msjexhnd.h"> + RelativePath=".\msjexhnd.h" + > </File> <File - RelativePath=".\nlogfile.h"> + RelativePath=".\nlogfile.h" + > </File> <File - RelativePath="NTService.h"> + RelativePath="NTService.h" + > </File> <File - RelativePath=".\opnew.h"> + RelativePath=".\opnew.h" + > </File> <File - RelativePath=".\passert.h"> + RelativePath=".\passert.h" + > </File> <File - RelativePath=".\progver.h"> + RelativePath=".\progver.h" + > </File> <File - RelativePath=".\random.h"> + RelativePath=".\random.h" + > </File> <File - RelativePath=".\rarray.h"> + RelativePath=".\rarray.h" + > </File> <File - RelativePath=".\rawtypes.h"> + RelativePath=".\rawtypes.h" + > </File> <File - RelativePath=".\RefPtr.h"> + RelativePath=".\RefPtr.h" + > </File> <File - RelativePath=".\sckutil.h"> + RelativePath=".\sckutil.h" + > </File> <File - RelativePath="socketsvc.h"> + RelativePath="socketsvc.h" + > </File> <File - RelativePath=".\StdAfx.h"> + RelativePath=".\StdAfx.h" + > </File> <File - RelativePath=".\stl_inc.h"> + RelativePath=".\stl_inc.h" + > </File> <File - RelativePath=".\stlutil.h"> + RelativePath=".\stlutil.h" + > </File> <File - RelativePath=".\strexcpt.h"> + RelativePath=".\strexcpt.h" + > </File> <File - RelativePath=".\strset.h"> + RelativePath=".\strset.h" + > </File> <File - RelativePath=".\strutil.h"> + RelativePath=".\strutil.h" + > </File> <File - RelativePath="threadhelp.h"> + RelativePath="threadhelp.h" + > </File> <File - RelativePath=".\tracebuf.h"> + RelativePath=".\tracebuf.h" + > </File> <File - RelativePath=".\unicode.h"> + RelativePath=".\unicode.h" + > </File> <File - RelativePath=".\unittest.h"> + RelativePath=".\unittest.h" + > </File> <File - RelativePath="wallclock.h"> + RelativePath="wallclock.h" + > </File> <File - RelativePath=".\weakptr.h"> + RelativePath=".\weakptr.h" + > </File> <File - RelativePath=".\wnsckt.h"> + RelativePath=".\wnsckt.h" + > </File> <File - RelativePath="xerces_inc.h"> + RelativePath="xerces_inc.h" + > </File> <File - RelativePath=".\xmain.h"> + RelativePath=".\xmain.h" + > </File> <File - RelativePath="xmlutil.h"> + RelativePath="xmlutil.h" + > </File> </Filter> </Files> Modified: trunk/pol-core/dist/dist.vcproj =================================================================== --- trunk/pol-core/dist/dist.vcproj 2009-09-16 09:02:33 UTC (rev 63) +++ trunk/pol-core/dist/dist.vcproj 2009-09-16 09:21:56 UTC (rev 64) @@ -4,110 +4,154 @@ Version="7.10" Name="dist" ProjectGUID="{1D3B3C40-100C-4C8E-8A58-AB49B5BD5A40}" - Keyword="Win32Proj"> + RootNamespace="dist" + Keyword="Win32Proj" + TargetFrameworkVersion="131072" + > <Platforms> <Platform - Name="Win32"/> + Name="Win32" + /> </Platforms> + <ToolFiles> + </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="1" - CharacterSet="2"> + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + CharacterSet="2" + > <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE,INC_PASSERT" - MinimalRebuild="TRUE" + MinimalRebuild="true" BasicRuntimeChecks="3" - RuntimeLibrary="5" + RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" - DebugInformationFormat="4"/> + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + /> <Tool - Name="VCCustomBuildTool"/> + Name="VCManagedResourceCompilerTool" + /> <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/dist.exe" LinkIncremental="2" - GenerateDebugInformation="TRUE" + GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/dist.pdb" SubSystem="1" - TargetMachine="1"/> + RandomizedBaseAddress="1" + DataExecutionPrevention="0" + TargetMachine="1" + /> <Tool - Name="VCMIDLTool"/> + Name="VCALinkTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCManifestTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCXDCMakeTool" + /> <Tool - Name="VCPreLinkEventTool"/> + Name="VCBscMakeTool" + /> <Tool - Name="VCResourceCompilerTool"/> + Name="VCFxCopTool" + /> <Tool - Name="VCWebServiceProxyGeneratorTool"/> + Name="VCAppVerifierTool" + /> <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release" IntermediateDirectory="Release" ConfigurationType="10" - CharacterSet="2"> + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + CharacterSet="2" + > <Tool - Name="VCCustomBuildTool"/> + Name="VCPreBuildEventTool" + /> <Tool - Name="VCMIDLTool"/> + Name="VCCustomBuildTool" + /> <Tool + Name="VCMIDLTool" + /> + <Tool Name="VCPostBuildEventTool" Description="Build distribution archive" - CommandLine="cd $(SolutionDir)dist -mkdist7.bat -"/> - <Tool - Name="VCPreBuildEventTool"/> + CommandLine="cd $(SolutionDir)dist
mkdist.bat
" + /> </Configuration> </Configurations> <References> </References> <Files> <File - RelativePath=".\bscriptexclude.lst"> + RelativePath=".\bscriptexclude.lst" + > </File> <File - RelativePath="core.lst"> + RelativePath="core.lst" + > </File> <File - RelativePath=".\debug-exclude.lst"> + RelativePath=".\debug-exclude.lst" + > </File> <File - RelativePath=".\libexclude.lst"> + RelativePath=".\libexclude.lst" + > </File> <File - RelativePath="makefile.vc7"> + RelativePath=".\makefile.vc" + > </File> <File - RelativePath="mkdist7.bat"> + RelativePath=".\mkdist.bat" + > </File> <File - RelativePath=".\obj.lst"> + RelativePath=".\obj.lst" + > </File> <File - RelativePath=".\src.lst"> + RelativePath=".\src.lst" + > </File> - <File - RelativePath=".\vcvars32.bat"> - </File> </Files> <Globals> </Globals> Modified: trunk/pol-core/doc/doc.vcproj =================================================================== --- trunk/pol-core/doc/doc.vcproj 2009-09-16 09:02:33 UTC (rev 63) +++ trunk/pol-core/doc/doc.vcproj 2009-09-16 09:21:56 UTC (rev 64) @@ -4,60 +4,76 @@ Version="7.10" Name="doc" ProjectGUID="{701FAB6A-5BEA-49AA-8688-57F3637B2239}" - SccProjectName="" - SccLocalPath="" - Keyword="MakeFileProj"> + RootNamespace="doc" + Keyword="MakeFileProj" + TargetFrameworkVersion="131072" + > <Platforms> <Platform - Name="Win32"/> + Name="Win32" + /> </Platforms> + <ToolFiles> + </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ConfigurationType="10" - UseOfMFC="0"> + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + UseOfMFC="0" + > <Tool - Name="VCCustomBuildTool"/> + Name="VCPreBuildEventTool" + /> <Tool - Name="VCMIDLTool"/> + Name="VCCustomBuildTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCMIDLTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> <Configuration Name="Release|Win32" OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="10" - UseOfMFC="0"> + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + UseOfMFC="0" + > <Tool - Name="VCCustomBuildTool"/> + Name="VCPreBuildEventTool" + /> <Tool - Name="VCMIDLTool"/> + Name="VCCustomBuildTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCMIDLTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> </Configurations> <References> </References> <Files> <File - RelativePath=".\core-changes.txt"> + RelativePath=".\core-changes.txt" + > </File> <File - RelativePath=".\packethooks.txt"> + RelativePath=".\packethooks.txt" + > </File> <File - RelativePath=".\packets.zip"> + RelativePath=".\uoconvert.txt" + > </File> - <File - RelativePath=".\uoconvert.txt"> - </File> </Files> <Globals> </Globals> Modified: trunk/pol-core/ecompile/ecompile.vcproj =================================================================== --- trunk/pol-core/ecompile/ecompile.vcproj 2009-09-16 09:02:33 UTC (rev 63) +++ trunk/pol-core/ecompile/ecompile.vcproj 2009-09-16 09:21:56 UTC (rev 64) @@ -4,139 +4,200 @@ Version="7.10" Name="ecompile" ProjectGUID="{B1A8988C-6DD0-4F97-BFA3-D0FE74AF33C9}" - SccProjectName="" - SccLocalPath=""> + RootNamespace="ecompile" + TargetFrameworkVersion="131072" + > <Platforms> <Platform - Name="Win32"/> + Name="Win32" + /> </Platforms> + <ToolFiles> + </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\Debug/ecompile.tlb" + /> + <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""E:\UOL\POL-CORE\STLPort\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE,NOMINMAX,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" - ForceConformanceInForLoopScope="TRUE" + ForceConformanceInForLoopScope="true" PrecompiledHeaderFile=".\Debug/ecompile.pch" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName=".\Debug/" WarningLevel="3" - SuppressStartupBanner="TRUE" + SuppressStartupBanner="true" DebugInformationFormat="3" - CompileAs="0"/> + CompileAs="0" + /> <Tool - Name="VCCustomBuildTool"/> + Name="VCManagedResourceCompilerTool" + /> <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" AdditionalDependencies="odbc32.lib odbccp32.lib" OutputFile=".\Debug/ecompile.exe" LinkIncremental="2" - SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories=""E:\UOL\POL-CORE\STLPort\lib"" - GenerateDebugInformation="TRUE" + SuppressStartupBanner="true" + AdditionalLibraryDirectories=""..\..\lib\STLport5\lib"" + GenerateDebugInformation="true" ProgramDatabaseFile=".\Debug/ecompile.pdb" - SubSystem="1"/> + SubSystem="1" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" + /> <Tool - Name="VCMIDLTool" - TypeLibraryName=".\Debug/ecompile.tlb"/> + Name="VCALinkTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCManifestTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCXDCMakeTool" + /> <Tool - Name="VCPreLinkEventTool"/> + Name="VCBscMakeTool" + /> <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033"/> + Name="VCFxCopTool" + /> <Tool - Name="VCWebServiceProxyGeneratorTool"/> + Name="VCAppVerifierTool" + /> <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> <Configuration Name="Release|Win32" OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\Release/ecompile.tlb" + /> + <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""E:\UOL\POL-CORE\STLPort\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE,NOMINMAX,INC_PASSERT" - StringPooling="TRUE" + StringPooling="true" RuntimeLibrary="0" - BufferSecurityCheck="FALSE" - EnableFunctionLevelLinking="TRUE" - ForceConformanceInForLoopScope="TRUE" + BufferSecurityCheck="false" + EnableFunctionLevelLinking="true" + ForceConformanceInForLoopScope="true" PrecompiledHeaderFile=".\Release/ecompile.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" - WarningLevel="3" - SuppressStartupBanner="TRUE" + WarningLevel="1" + SuppressStartupBanner="true" DebugInformationFormat="3" - CompileAs="0"/> + CompileAs="0" + /> <Tool - Name="VCCustomBuildTool"/> + Name="VCManagedResourceCompilerTool" + /> <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" AdditionalDependencies="odbc32.lib odbccp32.lib" OutputFile=".\Release/ecompile.exe" LinkIncremental="1" - SuppressStartupBanner="TRUE" - AdditionalLibraryDirectories=""E:\UOL\POL-CORE\STLPort\lib"" - GenerateDebugInformation="TRUE" + SuppressStartupBanner="true" + AdditionalLibraryDirectories=""..\..\lib\STLport5\lib"" + GenerateDebugInformation="true" ProgramDatabaseFile=".\Release/ecompile.pdb" - GenerateMapFile="TRUE" + GenerateMapFile="true" MapFileName=".\Release/ecompile.map" - MapLines="TRUE" - SubSystem="1"/> + SubSystem="1" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" + /> <Tool - Name="VCMIDLTool" - TypeLibraryName=".\Release/ecompile.tlb"/> + Name="VCALinkTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCManifestTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCXDCMakeTool" + /> <Tool - Name="VCPreLinkEventTool"/> + Name="VCBscMakeTool" + /> <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033"/> + Name="VCFxCopTool" + /> <Tool - Name="VCWebServiceProxyGeneratorTool"/> + Name="VCAppVerifierTool" + /> <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> </Configurations> <References> @@ -144,23 +205,29 @@ <Files> <Filter Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > <File - RelativePath=".\ecompile.cpp"> + RelativePath=".\ecompile.cpp" + > </File> <File - RelativePath=".\ecompile.rc"> + RelativePath=".\ecompile.rc" + > </File> </Filter> <Filter Name="Header Files" - Filter="h;hpp;hxx;hm;inl"> + Filter="h;hpp;hxx;hm;inl" + > <File - RelativePath=".\resource.h"> + RelativePath=".\resource.h" + > </File> </Filter> <File - RelativePath=".\ecompile.ico"> + RelativePath=".\ecompile.ico" + > </File> </Files> <Globals> Modified: trunk/pol-core/gp/gp.vcproj =================================================================== --- trunk/pol-core/gp/gp.vcproj 2009-09-16 09:02:33 UTC (rev 63) +++ trunk/pol-core/gp/gp.vcproj 2009-09-16 09:21:56 UTC (rev 64) @@ -4,116 +4,166 @@ Version="7.10" Name="gp" ProjectGUID="{D87FCC4A-E38D-4197-99A2-F8A1EA41FFCE}" - SccProjectName="" - SccLocalPath=""> + RootNamespace="gp" + TargetFrameworkVersion="131072" + > <Platforms> <Platform - Name="Win32"/> + Name="Win32" + /> </Platforms> + <ToolFiles> + </ToolFiles> <Configurations> <Configuration Name="Release|Win32" OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""E:\UOL\POL-CORE\STLPort\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="NDEBUG,WIN32,_LIB,NOMINMAX,INC_PASSERT" - StringPooling="TRUE" + StringPooling="true" RuntimeLibrary="0" - BufferSecurityCheck="FALSE" - EnableFunctionLevelLinking="TRUE" - ForceConformanceInForLoopScope="TRUE" + BufferSecurityCheck="false" + EnableFunctionLevelLinking="true" + ForceConformanceInForLoopScope="true" PrecompiledHeaderFile=".\Release/gp.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" - WarningLevel="3" - SuppressStartupBanner="TRUE" + WarningLevel="1" + SuppressStartupBanner="true" DebugInformationFormat="3" - CompileAs="0"/> + CompileAs="0" + /> <Tool - Name="VCCustomBuildTool"/> + Name="VCManagedResourceCompilerTool" + /> <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool Name="VCLibrarianTool" OutputFile=".\Release\gp.lib" - SuppressStartupBanner="TRUE"/> + SuppressStartupBanner="true" + /> <Tool - Name="VCMIDLTool"/> + Name="VCALinkTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCXDCMakeTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCBscMakeTool" + /> <Tool - Name="VCPreLinkEventTool"/> + Name="VCFxCopTool" + /> <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""E:\UOL\POL-CORE\STLPort\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="_DEBUG,WIN32,_LIB,NOMINMAX,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" - ForceConformanceInForLoopScope="TRUE" + ForceConformanceInForLoopScope="true" PrecompiledHeaderFile=".\Debug/gp.pch" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName=".\Debug/" WarningLevel="3" - SuppressStartupBanner="TRUE" + SuppressStartupBanner="true" DebugInformationFormat="3" - CompileAs="0"/> + CompileAs="0" + /> <Tool - Name="VCCustomBuildTool"/> + Name="VCManagedResourceCompilerTool" + /> <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool Name="VCLibrarianTool" OutputFile=".\Debug\gp.lib" - SuppressStartupBanner="TRUE"/> + SuppressStartupBanner="true" + /> <Tool - Name="VCMIDLTool"/> + Name="VCALinkTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCXDCMakeTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCBscMakeTool" + /> <Tool - Name="VCPreLinkEventTool"/> + Name="VCFxCopTool" + /> <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> </Configurations> <References> @@ -121,34 +171,44 @@ <Files> <Filter Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > <File - RelativePath=".\gendef.cpp"> + RelativePath=".\gendef.cpp" + > </File> <File - RelativePath=".\gphelp.cpp"> + RelativePath=".\gphelp.cpp" + > </File> <File - RelativePath=".\gtree.cpp"> + RelativePath=".\gtree.cpp" + > </File> <File - RelativePath=".\StdAfx.cpp"> + RelativePath=".\StdAfx.cpp" + > </File> <File - RelativePath=".\treegen.cpp"> + RelativePath=".\treegen.cpp" + > </File> </Filter> <Filter Name="Header Files" - Filter="h;hpp;hxx;hm;inl"> + Filter="h;hpp;hxx;hm;inl" + > <File - RelativePath="gphelp.h"> + RelativePath="gphelp.h" + > </File> <File - RelativePath=".\StdAfx.h"> + RelativePath=".\StdAfx.h" + > </File> <File - RelativePath="tree.h"> + RelativePath="tree.h" + > </File> </Filter> </Files> Modified: trunk/pol-core/plib/plib.vcproj =================================================================== --- trunk/pol-core/plib/plib.vcproj 2009-09-16 09:02:33 UTC (rev 63) +++ trunk/pol-core/plib/plib.vcproj 2009-09-16 09:21:56 UTC (rev 64) @@ -4,118 +4,168 @@ Version="7.10" Name="plib" ProjectGUID="{D45C6577-00E3-4995-A909-9C704A472565}" - SccProjectName="" - SccLocalPath=""> + RootNamespace="plib" + TargetFrameworkVersion="131072" + > <Platforms> <Platform - Name="Win32"/> + Name="Win32" + /> </Platforms> + <ToolFiles> + </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory=".\Debug" IntermediateDirectory=".\Debug" ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""E:\UOL\POL-CORE\STLPort\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="WIN32,_DEBUG,_LIB,INC_PASSERT" BasicRuntimeChecks="3" RuntimeLibrary="1" - ForceConformanceInForLoopScope="TRUE" + ForceConformanceInForLoopScope="true" UsePrecompiledHeader="0" PrecompiledHeaderFile=".\Debug/plib.pch" AssemblerListingLocation=".\Debug/" ObjectFile=".\Debug/" ProgramDataBaseFileName=".\Debug/" WarningLevel="3" - SuppressStartupBanner="TRUE" + SuppressStartupBanner="true" DebugInformationFormat="3" - CompileAs="0"/> + CompileAs="0" + /> <Tool - Name="VCCustomBuildTool"/> + Name="VCManagedResourceCompilerTool" + /> <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool Name="VCLibrarianTool" OutputFile=".\Debug\plib.lib" - SuppressStartupBanner="TRUE"/> + SuppressStartupBanner="true" + /> <Tool - Name="VCMIDLTool"/> + Name="VCALinkTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCXDCMakeTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCBscMakeTool" + /> <Tool - Name="VCPreLinkEventTool"/> + Name="VCFxCopTool" + /> <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> <Configuration Name="Release|Win32" OutputDirectory=".\Release" IntermediateDirectory=".\Release" ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="FALSE" - CharacterSet="2"> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""E:\UOL\POL-CORE\STLPort\stlport";.." + AdditionalIncludeDirectories=""..\..\lib\STLport5\stlport";" PreprocessorDefinitions="WIN32,NDEBUG,_LIB,INC_PASSERT" - StringPooling="TRUE" + StringPooling="true" RuntimeLibrary="0" - BufferSecurityCheck="FALSE" - EnableFunctionLevelLinking="TRUE" - ForceConformanceInForLoopScope="TRUE" - UsePrecompiledHeader="2" + BufferSecurityCheck="false" + EnableFunctionLevelLinking="true" + ForceConformanceInForLoopScope="true" + UsePrecompiledHeader="0" PrecompiledHeaderFile=".\Release/plib.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" - WarningLevel="3" - SuppressStartupBanner="TRUE" + WarningLevel="1" + SuppressStartupBanner="true" DebugInformationFormat="3" - CompileAs="0"/> + CompileAs="0" + /> <Tool - Name="VCCustomBuildTool"/> + Name="VCManagedResourceCompilerTool" + /> <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool Name="VCLibrarianTool" OutputFile=".\Release\plib.lib" - SuppressStartupBanner="TRUE"/> + SuppressStartupBanner="true" + /> <Tool - Name="VCMIDLTool"/> + Name="VCALinkTool" + /> <Tool - Name="VCPostBuildEventTool"/> + Name="VCXDCMakeTool" + /> <Tool - Name="VCPreBuildEventTool"/> + Name="VCBscMakeTool" + /> <Tool - Name="VCPreLinkEventTool"/> + Name="VCFxCopTool" + /> <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" - Culture="1033"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + Name="VCPostBuildEventTool" + /> </Configuration> </Configurations> <References> @@ -123,121 +173,160 @@ <Files> <Filter Name="Source Files" - Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > <File - RelativePath="filemapserver.cpp"> + RelativePath="filemapserver.cpp" + > </File> <File - RelativePath="inmemorymapserver.cpp"> + RelativePath="inmemorymapserver.cpp" + > </File> <File - RelativePath="mapfunc.cpp"> + RelativePath="mapfunc.cpp" + > </File> <File - RelativePath="mapserver.cpp"> + RelativePath="mapserver.cpp" + > </File> <File - RelativePath="maptileserver.cpp"> + RelativePath="maptileserver.cpp" + > </File> <File - RelativePath="mapwriter.cpp"> + RelativePath="mapwriter.cpp" + > </File> <File - RelativePath=".\pkg.cpp"> + RelativePath=".\pkg.cpp" + > </File> <File - RelativePath=".\polver.cpp"> + RelativePath=".\polver.cpp" + > </File> <File - RelativePath="realm.cpp"> + RelativePath="realm.cpp" + > </File> <File - RelativePath="realmdescriptor.cpp"> + RelativePath="realmdescriptor.cpp" + > </File> <File - RelativePath="realmfunc.cpp"> + RelativePath="realmfunc.cpp" + > </File> <File - RelativePath="realmlos.cpp"> + RelativePath="realmlos.cpp" + > </File> <File - RelativePath="realmlos2.cpp"> + RelativePath="realmlos2.cpp" + > </File> <File - RelativePath="staticserver.cpp"> + RelativePath="staticserver.cpp" + > </File> <File - RelativePath="testdrop1.cpp"> + RelativePath="testdrop1.cpp" + > </File> <File - RelativePath="testenv.cpp"> + RelativePath="testenv.cpp" + > </File> <File - RelativePath="testlos1.cpp"> + RelativePath="testlos1.cpp" + > </File> <File - RelativePath="testwalk1.cpp"> + RelativePath="testwalk1.cpp" + > </File> </Filter> <Filter Name="Header Files" - Filter="h;hpp;hxx;hm;inl"> + Filter="h;hpp;hxx;hm;inl" + > <File - RelativePath="filemapserver.h"> + RelativePath="filemapserver.h" + > </File> <File - RelativePath="inmemorymapserver.h"> + RelativePath="inmemorymapserver.h" + > </File> <File - RelativePath="mapblob.h"> + RelativePath="mapblob.h" + > </File> <File - RelativePath=".\mapblock.h"> + RelativePath=".\mapblock.h" + > </File> <File - RelativePath=".\mapcell.h"> + RelativePath=".\mapcell.h" + > </File> <File - RelativePath="mapfunc.h"> + RelativePath="mapfunc.h" + > </File> <File - RelativePath=".\mapserver.h"> + RelativePath=".\mapserver.h" + > </File> <File - RelativePath="mapshape.h"> + RelativePath="mapshape.h" + > </File> <File - RelativePath="mapsolid.h"> + RelativePath="mapsolid.h" + > </File> <File - RelativePath="maptile.h"> + RelativePath="maptile.h" + > </File> <File - RelativePath="maptileserver.h"> + RelativePath="maptileserver.h" + > </File> <File - RelativePath="mapwriter.h"> + RelativePath="mapwriter.h" + > </File> <File - RelativePath=".\pkg.h"> + RelativePath=".\pkg.h" + > </File> <File - RelativePath=".\polver.h"> + RelativePath=".\polver.h" + > </File> <File - RelativePath="realm.h"> + RelativePath="realm.h" + > </File> <File - RelativePath="realmdescriptor.h"> + RelativePath="realmdescriptor.h" + > </File> <File - RelativePath="staticblock.h"> + RelativePath="staticblock.h" + > </File> <File - RelativePath="staticserver.h"> + RelativePath="staticserver.h" + > </File> <File - RelativePath="testenv.h"> + RelativePath="testenv.h" + > </File> </Filter> </Files> Modified: trunk/pol-core/pol/pol.vcproj =================================================================== --- trunk/pol-core/pol/pol.vcproj 2009-09-16 09:02:33 UTC (rev 63) +++ trunk/pol-core/pol/pol.vcproj 2009-09-16 09:21:56 UTC (rev 64) @@ -4,141 +4,204 @@ Version="7.10" Name="pol" ProjectGUID="{9931FF8E-092B-4E67-8E99-E237E1A481EB}" - SccProjectName="" - SccLocalPath=""> + RootNamespace="pol" + TargetFrameworkVersion="131072" + > <Platforms> <Platform - Name... [truncated message content] |
From: <mua...@us...> - 2009-09-18 15:59:11
|
Revision: 72 http://polserver.svn.sourceforge.net/polserver/?rev=72&view=rev Author: muaddib_pol Date: 2009-09-18 15:59:00 +0000 (Fri, 18 Sep 2009) Log Message: ----------- + Spellbooks no longer rely on scroll contents to work. Work 100% off bitflags for each circle. Modified Paths: -------------- trunk/pol-core/doc/core-changes.txt trunk/pol-core/pol/loaddata.cpp trunk/pol-core/pol/spelbook.cpp trunk/pol-core/pol/spelbook.h Modified: trunk/pol-core/doc/core-changes.txt =================================================================== --- trunk/pol-core/doc/core-changes.txt 2009-09-17 09:51:37 UTC (rev 71) +++ trunk/pol-core/doc/core-changes.txt 2009-09-18 15:59:00 UTC (rev 72) @@ -1,4 +1,12 @@ -- POL099 -- +09-17-2009 MuadDib: + Removed: Storing scrolls inside spellbooks. Destroyed after insert is complete. + Changed: Pre-AOS Clients still get the same packet they always did when opening a spellbook, built entirely + off the bitflag system for newer spellbooks. So no more keeping scrolls inside of books. :D + Note: As spellbooks are loaded for the first time with newer cores and as added to books, scrolls are + marked SaveOnExit 0. Temp solution until valid method of destroy can be done without intermittent + crashes. + 09-16-2009 Turley: Removed: char.isUOKR Added: char.ClientType r/o bitfield Modified: trunk/pol-core/pol/loaddata.cpp =================================================================== --- trunk/pol-core/pol/loaddata.cpp 2009-09-17 09:51:37 UTC (rev 71) +++ trunk/pol-core/pol/loaddata.cpp 2009-09-18 15:59:00 UTC (rev 72) @@ -25,8 +25,10 @@ #include "item/item.h" #include "objecthash.h" #include "polcfg.h" +#include "polclass.h" #include "poltype.h" #include "loaddata.h" +#include "spelbook.h" #include "uobject.h" unsigned incremental_save_count = 0; @@ -248,10 +250,17 @@ } } +extern u16 spell_scroll_objtype_limits[7][2]; + void add_loaded_item( Item* cont_item, Item* item ) { if (cont_item->isa(UObject::CLASS_CONTAINER)) { + // Convert spellbook to use bitwise system, not scrolls. + if ( cont_item->script_isa(POLCLASS_SPELLBOOK) ) + { + item->saveonexit(0); + } UContainer* cont = static_cast<UContainer*>(cont_item); gflag_enforce_container_limits = false; Modified: trunk/pol-core/pol/spelbook.cpp =================================================================== --- trunk/pol-core/pol/spelbook.cpp 2009-09-17 09:51:37 UTC (rev 71) +++ trunk/pol-core/pol/spelbook.cpp 2009-09-18 15:59:00 UTC (rev 72) @@ -3,6 +3,7 @@ ======= 2005/02/14 Shinigami: double_click - simple logical error in layer_is_equipped check 2009/07/26 MuadDib: Packet struct refactoring. +2009/09/17 MuadDib: Spellbook::can_add upgraded to check bitflags instead of contents. Notes ======= @@ -62,10 +63,13 @@ return; } + if(bitwise_contents[0] == 0) //assume never been clicked using the new bitwise spell scheme + calc_current_bitwise_contents(); + if( !(client->UOExpansionFlag & AOS) && (spell_school == 0) ) { - base::double_click(client); + send_book_old(client); } else if( !(client->UOExpansionFlag & AOS) && (spell_school == 1 || spell_school == 2)) @@ -95,13 +99,10 @@ { if ( config.loglevel > 1 ) cout << "Client with AOS Expansion Account using spellbook without UOFeatureEnable 0x20 Bitflag.\n"; - base::double_click(client); + send_book_old(client); return; } - if(bitwise_contents[0] == 0) //assume never been clicked using the new bitwise spellscheme - calc_current_bitwise_contents(); - send_open_gump(client, *this); PKTBI_BF msg; msg.msgtype = PKTBI_BF_ID; @@ -117,18 +118,21 @@ } +// FIXME: Spell Upgrade, upgrade to use bits, not contents. bool Spellbook::has_spellid( unsigned long spellid ) const { - for( UContainer::const_iterator itr = begin(); itr != end(); ++itr ) - { - const Item* scroll = GET_ITEM_PTR( itr ); - if ( (unsigned long)(USpellScroll::convert_objtype_to_spellnum(scroll->objtype_, spell_school) + (spell_school * 100)) == spellid) - return true; - } + u16 spellnumber = static_cast<u16>(spellid); + u8 spellslot = spellnumber % 8; + if(spellslot == 0) spellslot = 8; + int bitcheck = ((bitwise_contents[ (spellnumber-1) / 8 ]) & (1 << (spellslot-1))); + cerr << "Bitcheck to cast and spellid: " << bitcheck << " " << spellid << endl; + if ( ((bitwise_contents[ (spellnumber-1) / 8 ]) & (1 << (spellslot-1))) != 0 ) + return true; return false; } +// FIXME: Spell Upgrade, update to use new has_spellid instead of bitchecks. bool Spellbook::can_add( const Item& item ) const { // note: item count maximums are implicitly checked for. @@ -141,12 +145,11 @@ } // you can only add one of each kind of scroll to a spellbook. - for( UContainer::const_iterator itr = begin(); itr != end(); ++itr ) - { - const Item* scroll = GET_ITEM_PTR( itr ); - if (scroll->objtype_ == item.objtype_) - return false; - } + u16 spellnum = USpellScroll::convert_objtype_to_spellnum(item.objtype_, spell_school); + u8 spellslot = spellnum % 8; + if(spellslot == 0) spellslot = 8; + if ( bitwise_contents[ (spellnum-1) / 8 ] & (1 << (spellslot-1)) ) + return false; return true; } @@ -164,6 +167,7 @@ u8 spellslot = spellnum % 8; if(spellslot == 0) spellslot = 8; bitwise_contents[ (spellnum-1) / 8 ] |= 1 << (spellslot-1); + item->saveonexit(0); } void Spellbook::printProperties( ostream& os ) const @@ -206,6 +210,13 @@ if(spellslot == 0) spellslot = 8; bitwise_contents[ (spellnum-1) / 8 ] |= 1 << (spellslot-1); } + + // ok, it's been upgraded. Destroy everything inside it. + for( UContainer::iterator itr = begin(); itr != end(); ++itr ) + { + Item* scroll = GET_ITEM_PTR( itr ); + scroll->destroy(); + } } USpellScroll::USpellScroll( const ItemDesc& itemdesc ) : @@ -213,7 +224,6 @@ { } -// See docs\spells.txt for what's going on here. u16 USpellScroll::convert_objtype_to_spellnum( u16 objtype, int school ) { u16 spellnum = objtype - spell_scroll_objtype_limits[school][0] + 1; @@ -241,3 +251,97 @@ return amount_; } } + +void Spellbook::send_book_old( Client *client ) +{ + client->pause(); + + if (!locked_) + { + send_open_gump( client, *this ); + send_spellbook_contents( client, *this ); + } + else + { + send_sysmessage( client, "That is locked." ); + } + + client->restart(); +} + +void send_spellbook_contents( Client *client, Spellbook& spellbook ) +{ + if ( client->ClientType & CLIENTTYPE_6017 ) + { + static PKTOUT_3C_6017 msg; + + msg.msgtype = PKTOUT_3C_ID; + + int count = 0; + for ( u16 i = 0; i < 64; ++i ) + { + u16 objtype = spell_scroll_objtype_limits[0][0] + i; + u16 spellnumber = USpellScroll::convert_objtype_to_spellnum( objtype, spellbook.spell_school ); + u8 spellpos = spellnumber % 8; // spellpos is the spell's position it it's circle's array. + if(spellpos == 0) spellpos = 8; + if ( ((spellbook.bitwise_contents[ ((spellnumber-1) / 8) ]) & (1 << (spellpos-1))) != 0 ) + { + msg.items[count].serial = 0x7FFFFFFF - spellnumber; + msg.items[count].graphic = ctBEu16(objtype); + msg.items[count].unk6_00 = 0x00; + + msg.items[count].amount = ctBEu16( spellnumber ); + + msg.items[count].x = ctBEu16(1); + msg.items[count].y = ctBEu16(1); + msg.items[count].slot_index = 0x00; + msg.items[count].container_serial = spellbook.serial_ext; + msg.items[count].color = 0x00; + ++count; + } + } + + unsigned short msglen = static_cast<unsigned short>(offsetof( PKTOUT_3C_6017, items ) + + count * sizeof msg.items[0]); + msg.msglen = ctBEu16( msglen ); + msg.count = ctBEu16( count ); + + client->transmit( &msg, msglen ); + } + else + { + static PKTOUT_3C msg; + + msg.msgtype = PKTOUT_3C_ID; + + int count = 0; + for ( u16 i = 0; i < 64; ++i ) + { + u16 objtype = spell_scroll_objtype_limits[0][0] + i; + u16 spellnumber = USpellScroll::convert_objtype_to_spellnum( objtype, spellbook.spell_school ); + u8 spellpos = spellnumber % 8; // spellpos is the spell's position it it's circle's array. + if(spellpos == 0) spellpos = 8; + if ( ((spellbook.bitwise_contents[ ((spellnumber-1) / 8) ]) & (1 << (spellpos-1))) != 0 ) + { + msg.items[count].serial = 0x7FFFFFFF - spellnumber; + msg.items[count].graphic = ctBEu16(objtype); + msg.items[count].unk6_00 = 0x00; + + msg.items[count].amount = ctBEu16( spellnumber ); + + msg.items[count].x = ctBEu16(1); + msg.items[count].y = ctBEu16(1); + msg.items[count].container_serial = spellbook.serial_ext; + msg.items[count].color = 0x00; + ++count; + } + } + + unsigned short msglen = static_cast<unsigned short>(offsetof( PKTOUT_3C, items ) + + count * sizeof msg.items[0]); + msg.msglen = ctBEu16( msglen ); + msg.count = ctBEu16( count ); + + client->transmit( &msg, msglen ); + } +} Modified: trunk/pol-core/pol/spelbook.h =================================================================== --- trunk/pol-core/pol/spelbook.h 2009-09-17 09:51:37 UTC (rev 71) +++ trunk/pol-core/pol/spelbook.h 2009-09-18 15:59:00 UTC (rev 72) @@ -26,6 +26,7 @@ bool has_spellid( unsigned long spellid ) const; u8 bitwise_contents[8]; + u64 spellbook_contents; short spell_school; virtual void add( Item *item ); virtual void printProperties( ostream& os ) const; @@ -33,6 +34,7 @@ virtual void printOn( ostream& os ) const; virtual void printSelfOn( ostream& os ) const; virtual void double_click( Client* client ); + void send_book_old( Client* client ); virtual bool script_isa( unsigned isatype ) const; private: @@ -55,4 +57,6 @@ private: }; +void send_spellbook_contents( Client *client, Spellbook& spellbook ); + #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mua...@us...> - 2009-09-18 19:15:39
|
Revision: 73 http://polserver.svn.sourceforge.net/polserver/?rev=73&view=rev Author: muaddib_pol Date: 2009-09-18 19:15:30 +0000 (Fri, 18 Sep 2009) Log Message: ----------- + Saving of registered housing to player and npc files. * Undecided if storage will remain on house objects for this also. So far no need seen where this will be needed. May remove house storage of registered before release. Modified Paths: -------------- trunk/pol-core/doc/core-changes.txt trunk/pol-core/pol/mobile/charactr.cpp trunk/pol-core/pol/npc.cpp Modified: trunk/pol-core/doc/core-changes.txt =================================================================== --- trunk/pol-core/doc/core-changes.txt 2009-09-18 15:59:00 UTC (rev 72) +++ trunk/pol-core/doc/core-changes.txt 2009-09-18 19:15:30 UTC (rev 73) @@ -1,5 +1,8 @@ -- POL099 -- -09-17-2009 MuadDib: +09-18-2009 MuadDib: + Added: Multi Walk On Script support. Works for player and npc. Just add Walkon itemdesc entry to the house. + Note: This is in early stages. While it is working, not all cases may register and deregister where a mob + gets put onto or removed from a house. If you find cases that do, report to bugtracker. Removed: Storing scrolls inside spellbooks. Destroyed after insert is complete. Changed: Pre-AOS Clients still get the same packet they always did when opening a spellbook, built entirely off the bitflag system for newer spellbooks. So no more keeping scrolls inside of books. :D Modified: trunk/pol-core/pol/mobile/charactr.cpp =================================================================== --- trunk/pol-core/pol/mobile/charactr.cpp 2009-09-18 15:59:00 UTC (rev 72) +++ trunk/pol-core/pol/mobile/charactr.cpp 2009-09-18 19:15:30 UTC (rev 73) @@ -563,6 +563,9 @@ os << "\tTrueColor\t0x" << hex << truecolor << dec << pf_endl; os << "\tTrueObjtype\t0x" << hex << trueobjtype << dec << pf_endl; + if (registered_house) + os << "\tRegisteredHouse\t0x" << hex << registered_house << dec << pf_endl; + os << "\tGender\t" << static_cast<int>(gender) << pf_endl; os << "\tRace\t" << static_cast<int>(race) << pf_endl; @@ -809,6 +812,8 @@ graphic = objtype_; graphic_ext = ctBEu16( graphic ); + registered_house = elem.remove_ulong( "REGISTEREDHOUSE", 0 ); + base::readProperties( elem ); if (name_ == "") Modified: trunk/pol-core/pol/npc.cpp =================================================================== --- trunk/pol-core/pol/npc.cpp 2009-09-18 15:59:00 UTC (rev 72) +++ trunk/pol-core/pol/npc.cpp 2009-09-18 19:15:30 UTC (rev 73) @@ -233,6 +233,9 @@ { base::printProperties( os ); + if (registered_house) + os << "\tRegisteredHouse\t0x" << hex << registered_house << dec << pf_endl; + if (npc_ar_) os << "\tAR\t" << npc_ar_ << pf_endl; @@ -293,6 +296,8 @@ void NPC::readNpcProperties( ConfigElem& elem ) { + registered_house = elem.remove_ulong( "REGISTEREDHOUSE", 0 ); + UWeapon* wpn = find_intrinsic_weapon( elem.rest() ); if (wpn == NULL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |