├── .gitignore ├── AUTHORS ├── COPYING ├── INSTALL.old ├── Makefile.am ├── Makefile.git ├── README.md ├── admin ├── acinclude.m4.in ├── flex.skl ├── moc_edit.pl └── tools │ ├── autorun │ └── ps-mailer ├── configure.ac ├── etc ├── planescape.xml.template └── plugin.xml.template ├── libdreamland ├── Makefile.am ├── Makefile.inc ├── alloc │ ├── Makefile.am │ ├── allocateclass.cpp │ ├── allocateclass.h │ ├── class.cpp │ ├── class.h │ ├── exceptionclassnotfound.cpp │ ├── exceptionclassnotfound.h │ ├── mocregistrator.h │ ├── oneallocate.cpp │ ├── oneallocate.h │ └── xmlvariableregistrator.h ├── fenia │ ├── Makefile.am │ ├── TODO │ ├── closure.cpp │ ├── closure.h │ ├── codesource.cpp │ ├── codesource.h │ ├── codesourceref.cpp │ ├── codesourceref.h │ ├── context.cpp │ ├── context.h │ ├── exceptions.cpp │ ├── exceptions.h │ ├── exp-tree.cpp │ ├── exp-tree.h │ ├── feniaparser.h │ ├── feniastring.cpp │ ├── feniastring.h │ ├── flow.h │ ├── function.cpp │ ├── function.h │ ├── handler.cpp │ ├── handler.h │ ├── impl.cpp │ ├── impl.h │ ├── lex.cpp │ ├── lex.h │ ├── main.cpp │ ├── manager-decl.h │ ├── manager-impl.h │ ├── native.cpp │ ├── native.h │ ├── nodes.cpp │ ├── nodes.h │ ├── object.cpp │ ├── object.h │ ├── parse.y++ │ ├── phase.cpp │ ├── phase.h │ ├── ref-tree.cpp │ ├── ref-tree.h │ ├── reference-impl.h │ ├── reference.cpp │ ├── reference.h │ ├── register-decl.h │ ├── register-impl.h │ ├── scan.l++ │ ├── scope.cpp │ ├── scope.h │ ├── stmt-tree.cpp │ ├── stmt-tree.h │ ├── test.cpp │ ├── test.h │ ├── xmlregister.cpp │ └── xmlregister.h ├── flags │ ├── Makefile.am │ ├── enumeration-impl.h │ ├── enumeration.cpp │ ├── enumeration.h │ ├── flags-impl.h │ ├── flags.cpp │ ├── flags.h │ ├── flagtable.cpp │ ├── flagtable.h │ ├── flagtableregistry.cpp │ ├── flagtableregistry.h │ ├── flagtablewrapper.h │ ├── xmlenumeration.cpp │ ├── xmlenumeration.h │ ├── xmlflags.cpp │ └── xmlflags.h ├── gref │ ├── Makefile.am │ ├── globalarray.cpp │ ├── globalarray.h │ ├── globalbitvector.cpp │ ├── globalbitvector.h │ ├── globalreference.cpp │ ├── globalreference.h │ ├── globalregistry.cpp │ ├── globalregistry.h │ ├── globalregistryelement.cpp │ ├── globalregistryelement.h │ ├── xmlglobalarray.cpp │ ├── xmlglobalarray.h │ ├── xmlglobalbitvector.cpp │ ├── xmlglobalbitvector.h │ ├── xmlglobalreference.cpp │ └── xmlglobalreference.h ├── io │ ├── Makefile.am │ ├── config_io.h │ ├── dbio.cpp │ ├── dbio.h │ ├── dbm │ │ ├── dbmio.cpp │ │ ├── dbmio.h │ │ ├── dbmtest.cpp │ │ ├── rdbms.cpp │ │ ├── rdbms.h │ │ ├── rdbms_bdb.cpp │ │ ├── rdbms_bdb.h │ │ ├── rdbms_fs.cpp │ │ └── rdbms_fs.h │ ├── dldirectory.cpp │ ├── dldirectory.h │ ├── dlfile.cpp │ ├── dlfile.h │ ├── dlfileloader.cpp │ ├── dlfileloader.h │ ├── dlfileop.cpp │ ├── dlfileop.h │ ├── dlfilestream.cpp │ ├── dlfilestream.h │ ├── exceptiondbio.cpp │ ├── exceptiondbio.h │ ├── exceptiondbioeof.h │ ├── txncontext.cpp │ ├── txncontext.h │ ├── xmlconfigurable.cpp │ ├── xmlconfigurable.h │ ├── xmlfile.cpp │ ├── xmlfile.h │ ├── xmlloader.cpp │ ├── xmlloader.h │ ├── xmltableelement.cpp │ ├── xmltableelement.h │ ├── xmltableloader.cpp │ └── xmltableloader.h ├── l10n │ ├── Makefile.am │ ├── adjective.cpp │ ├── adjective.h │ ├── flexer.cpp │ ├── flexer.h │ ├── grammar_entities.cpp │ ├── grammar_entities.h │ ├── grammar_entities_impl.h │ ├── noun.cpp │ ├── noun.h │ ├── nounholder.cpp │ ├── nounholder.h │ ├── pronouns.cpp │ ├── pronouns.h │ ├── ru_pronouns.cpp │ ├── ru_pronouns.h │ ├── russianstring.cpp │ ├── russianstring.h │ ├── verb.cpp │ ├── verb.h │ ├── xmlrussianstring.cpp │ └── xmlrussianstring.h ├── lang │ ├── Makefile.am │ ├── algo.h │ ├── bitstring.h │ ├── boolean.cpp │ ├── boolean.h │ ├── byte.cpp │ ├── byte.h │ ├── char.cpp │ ├── char.h │ ├── dllist.h │ ├── dlmap.h │ ├── dlobject.cpp │ ├── dlobject.h │ ├── dlstring.cpp │ ├── dlstring.h │ ├── exception.cpp │ ├── exception.h │ ├── exceptionbadtype.h │ ├── fileformatexception.h │ ├── integer.cpp │ ├── integer.h │ ├── long.cpp │ ├── long.h │ ├── longlong.cpp │ ├── longlong.h │ ├── mallocexception.h │ ├── pointer.h │ ├── safelist.h │ ├── safelist.tcc │ ├── short.cpp │ ├── short.h │ ├── staticlist.h │ ├── stringset.cpp │ └── stringset.h ├── moc │ ├── Makefile.am │ ├── acinclude.m4 │ ├── autogen.sh │ ├── configure.ac │ ├── generate.cpp │ ├── lex.l++ │ ├── main.cpp │ ├── mocfunctional.h │ ├── syn.y++ │ ├── system.cpp │ └── system.h ├── plugin │ ├── Makefile.am │ ├── classselfregistratorplugin.h │ ├── initializer.cpp │ ├── initializer.h │ ├── plugin.h │ ├── plugininitializer.h │ ├── pluginmanager.cpp │ ├── pluginmanager.h │ ├── sharedobject.cpp │ ├── sharedobject.h │ └── so.h ├── process │ ├── Makefile.am │ ├── monitor.cpp │ ├── monitor.h │ ├── mutex.cpp │ ├── mutex.h │ ├── process.cpp │ ├── process.h │ ├── thread.cpp │ └── thread.h ├── regex │ ├── BUGS │ ├── COPYRIGHT │ ├── Makefile.am │ ├── cclass.h │ ├── cname.h │ ├── engine.c │ ├── regcomp.c │ ├── regerror.c │ ├── regex.h │ ├── regex2.h │ ├── regexec.c │ ├── regfree.c │ ├── regutils.h │ └── utils.h ├── scheduler │ ├── Makefile.am │ ├── scheduler.cpp │ ├── scheduler.h │ ├── schedulerlist.cpp │ ├── schedulerlist.h │ ├── schedulerprioritymap.cpp │ ├── schedulerprioritymap.h │ ├── schedulerqueue.cpp │ ├── schedulerqueue.h │ ├── schedulertask.cpp │ └── schedulertask.h ├── util │ ├── Makefile.am │ ├── date.cpp │ ├── date.h │ ├── dateparser.h │ ├── dl_ctype.cpp │ ├── dl_ctype.h │ ├── dl_match.cpp │ ├── dl_match.h │ ├── dl_math.cpp │ ├── dl_math.h │ ├── dl_strings.cpp │ ├── dl_strings.h │ ├── exceptionbaddatestring.h │ ├── iconvmap.cpp │ ├── iconvmap.h │ ├── lastlogstream.cpp │ ├── lastlogstream.h │ ├── logstream.cpp │ ├── logstream.h │ ├── parsedate.l++ │ ├── profiler.cpp │ ├── profiler.h │ ├── regexp.cpp │ ├── regexp.h │ ├── timer.cpp │ └── timer.h └── xml │ ├── Makefile.am │ ├── exceptions.cpp │ ├── exceptionskipvariable.h │ ├── exceptionvariablenotfound.h │ ├── exceptionxmlerror.h │ ├── exceptionxsl.h │ ├── fpstream.h │ ├── moc.h │ ├── pstream.h │ ├── xmlboolean.cpp │ ├── xmlboolean.h │ ├── xmlbyte.cpp │ ├── xmlbyte.h │ ├── xmlchar.cpp │ ├── xmlchar.h │ ├── xmlclause.cpp │ ├── xmlclause.h │ ├── xmlcontainer.cpp │ ├── xmlcontainer.h │ ├── xmldate.cpp │ ├── xmldate.h │ ├── xmldocument.cpp │ ├── xmldocument.h │ ├── xmlinteger.cpp │ ├── xmlinteger.h │ ├── xmllimits.cpp │ ├── xmllimits.h │ ├── xmllist.h │ ├── xmllong.cpp │ ├── xmllong.h │ ├── xmllonglong.cpp │ ├── xmllonglong.h │ ├── xmlmap.h │ ├── xmlmatchpattern.h │ ├── xmlmatchpattern.l++ │ ├── xmlnode.cpp │ ├── xmlnode.h │ ├── xmloptions.h │ ├── xmlparser.h │ ├── xmlparser.l++ │ ├── xmlpersistent.h │ ├── xmlpointer.h │ ├── xmlpolymorphvariable.cpp │ ├── xmlpolymorphvariable.h │ ├── xmlpredicate.cpp │ ├── xmlpredicate.h │ ├── xmlref.cpp │ ├── xmlref.h │ ├── xmlreftest.cpp │ ├── xmlreftest.h │ ├── xmlreversevector.h │ ├── xmlsafelist.h │ ├── xmlshort.cpp │ ├── xmlshort.h │ ├── xmlstreamable.h │ ├── xmlstring.cpp │ ├── xmlstring.h │ ├── xmlstringlist.cpp │ ├── xmlstringlist.h │ ├── xmltest.cpp │ ├── xmltimestamp.cpp │ ├── xmltimestamp.h │ ├── xmlvariable.cpp │ ├── xmlvariable.h │ ├── xmlvariablecontainer.cpp │ ├── xmlvariablecontainer.h │ └── xmlvector.h ├── plug-ins ├── Makefile.am ├── Makefile.inc ├── feniaroot │ ├── Makefile.am │ ├── ceval.cpp │ ├── cfindref.cpp │ ├── characterwrapper.cpp │ ├── characterwrapper.h │ ├── feniastringext.cpp │ ├── idcontainerext.cpp │ ├── impl.cpp │ ├── nativeext.h │ ├── objectwrapper.cpp │ ├── objectwrapper.h │ ├── pluginnativeimpl.cpp │ ├── pluginnativeimpl.h │ ├── regcontainerext.cpp │ ├── reglistext.cpp │ ├── roomwrapper.cpp │ ├── roomwrapper.h │ ├── root.cpp │ ├── root.h │ ├── schedulerwrapperext.cpp │ ├── validatetask.cpp │ ├── validatetask.h │ ├── wrap_utils.cpp │ ├── wrap_utils.h │ ├── wrappermanager.cpp │ ├── wrappermanager.h │ ├── wrappersplugin.cpp │ └── wrappersplugin.h └── runtime │ ├── Makefile.am │ ├── act.comm.cpp │ ├── act.cpp │ ├── act.informative.cpp │ ├── act.item.cpp │ ├── act.movement.cpp │ ├── act.offensive.cpp │ ├── act.other.cpp │ ├── act.social.cpp │ ├── act.social.h │ ├── act.wizard.cpp │ ├── ai.cpp │ ├── ai.h │ ├── alias.cpp │ ├── ban.cpp │ ├── ban.h │ ├── boards.cpp │ ├── boards.h │ ├── case.cpp │ ├── case.h │ ├── case_table.h │ ├── class.cpp │ ├── color.cpp │ ├── comm.cpp │ ├── comm.h │ ├── commands.h │ ├── constants.cpp │ ├── constants.h │ ├── db.cpp │ ├── db.h │ ├── diskio.cpp │ ├── diskio.h │ ├── events.cpp │ ├── events.h │ ├── exp_fn.cpp │ ├── exp_fn.h │ ├── fight.cpp │ ├── fight.h │ ├── gameconfig.cpp │ ├── gameconfig.h │ ├── graph.cpp │ ├── handler.cpp │ ├── handler.h │ ├── help.cpp │ ├── help.h │ ├── house.cpp │ ├── house.h │ ├── impl.cpp │ ├── interpreter.cpp │ ├── interpreter.h │ ├── iomanager.cpp │ ├── iomanager.h │ ├── iptoaddr.cpp │ ├── iptoaddr.h │ ├── item.cpp │ ├── journal.cpp │ ├── limits.cpp │ ├── magic.cpp │ ├── mail.cpp │ ├── mail.h │ ├── map.cpp │ ├── map.hpp │ ├── mobact.cpp │ ├── mobmax.cpp │ ├── mobmax.h │ ├── modify.cpp │ ├── pk.cpp │ ├── pk.h │ ├── registration.cpp │ ├── registration.h │ ├── remorts.cpp │ ├── screen.h │ ├── scriptboard.cpp │ ├── scriptboard.h │ ├── shop.cpp │ ├── shop.h │ ├── sp_define.h │ ├── spec_procs.cpp │ ├── spell_parser.cpp │ ├── spells.cpp │ ├── spells.h │ ├── telnet.h │ ├── utils.cpp │ ├── utils.h │ ├── weather.cpp │ ├── xbody.cpp │ ├── xboot.h │ ├── xenchant.cpp │ ├── xmaterial.cpp │ ├── xmob.cpp │ ├── xobj.cpp │ ├── xquests.cpp │ ├── xsave.cpp │ ├── xscripts.cpp │ ├── xskills.cpp │ ├── xspells.cpp │ ├── xtempl.cpp │ ├── xwld.cpp │ └── xzon.cpp └── src ├── Makefile.am ├── Makefile.inc ├── boards-decl.h ├── comm-decl.h ├── core ├── Makefile.am ├── mudpluginmanager.cpp ├── mudpluginmanager.h ├── mudscheduler.cpp ├── mudscheduler.h ├── mudstats.cpp ├── mudstats.h ├── planescape.cpp └── planescape.h ├── db-decl.h ├── events-decl.h ├── fenia ├── Makefile.am ├── README ├── feniamanager.cpp ├── feniamanager.h ├── guts.cpp ├── guts.h ├── idcontainer.cpp ├── idcontainer.h ├── regcontainer.cpp ├── regcontainer.h ├── reglist.cpp ├── reglist.h ├── schedulerwrapper.cpp ├── schedulerwrapper.h ├── subr.h ├── wrapperbase.cpp ├── wrapperbase.h ├── wrappermanagerbase.cpp ├── wrappermanagerbase.h ├── wrappertarget.cpp └── wrappertarget.h ├── impl.cpp ├── interp-decl.h ├── io ├── Makefile.am ├── mudfile.cpp ├── mudfile.h ├── mudfilereader.cpp ├── mudfilereader.h ├── textfileloader.cpp └── textfileloader.h ├── mail-decl.h ├── main.cpp ├── memutils.cpp ├── memutils.h ├── spells-decl.h ├── structs.cpp ├── structs.h ├── sysdep.h ├── xformat ├── Makefile.am ├── list_commands.h ├── parser_id.h ├── xbody.cpp ├── xbody.h ├── xenchant.cpp ├── xenchant.h ├── xhelp.cpp ├── xhelp.h ├── xmaterial.cpp ├── xmaterial.h ├── xmob.cpp ├── xmob.h ├── xobj.cpp ├── xobj.h ├── xquests.cpp ├── xquests.h ├── xsave.cpp ├── xsave.h ├── xscripts.cpp ├── xscripts.h ├── xshop.cpp ├── xshop.h ├── xskills.cpp ├── xskills.h ├── xspells.cpp ├── xspells.h ├── xtempl.cpp ├── xtempl.h ├── xwld.cpp ├── xwld.h ├── xzon.cpp └── xzon.h └── xparser ├── Makefile.am ├── expr.cpp ├── expr.h ├── parser.cpp ├── parser.h ├── parser_const.cpp ├── parser_const.h ├── parser_file.cpp ├── parser_file.h ├── parser_items.cpp ├── parser_items.h ├── parser_readcfg.cpp ├── parser_readcfg.h ├── parser_types.h ├── parser_utils.h ├── strlib.cpp └── strlib.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.in 2 | /admin/* 3 | !/admin/*.in 4 | !/admin/*.skl 5 | !/admin/*.pl 6 | !/admin/tools 7 | *.diff 8 | *.log 9 | *.swp 10 | *.bak 11 | *~ 12 | aclocal.m4 13 | acinclude.m4 14 | /autom4te.cache 15 | /config.h.in~ 16 | /configure 17 | libdreamland/moc/autom4te.cache/ 18 | libdreamland/moc/configure 19 | libdreamland/moc/*.h++ 20 | /bin 21 | /lib 22 | /share 23 | /var 24 | /core.2* 25 | libexec/plugin.xml 26 | libexec/plugins 27 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/AUTHORS -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/COPYING -------------------------------------------------------------------------------- /INSTALL.old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/INSTALL.old -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = libdreamland src plug-ins 2 | 3 | AUTOMAKE_OPTIONS = foreign 1.4 4 | 5 | $(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in 6 | @cd $(top_srcdir) && cat admin/acinclude.m4.in > acinclude.m4 7 | 8 | -------------------------------------------------------------------------------- /etc/plugin.xml.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | runtime 4 | feniaroot 5 | 6 | -------------------------------------------------------------------------------- /libdreamland/Makefile.am: -------------------------------------------------------------------------------- 1 | DUMMY_LIBS = 2 | LD_DLLGLUE = 3 | CC_DLLGLUE = 4 | MY_CXXLD = $(CXX) 5 | 6 | lib_LTLIBRARIES = libdreamland.la 7 | 8 | AM_LDFLAGS = $(LD_DLLGLUE) 9 | AM_CXXFLAGS = $(CC_DLLGLUE) 10 | CXXLD = $(MY_CXXLD) 11 | 12 | 13 | SUBDIRS = \ 14 | regex \ 15 | lang \ 16 | alloc \ 17 | util \ 18 | l10n \ 19 | xml \ 20 | flags \ 21 | gref \ 22 | process \ 23 | plugin \ 24 | scheduler \ 25 | io \ 26 | fenia 27 | 28 | include $(top_srcdir)/libdreamland/Makefile.inc 29 | INCLUDES = $(INCLUDES_DREAMLAND) 30 | 31 | ##################################################### 32 | # dreamland shared library 33 | # 34 | libdreamland_la_SOURCES = 35 | 36 | libdreamland_la_LIBADD = \ 37 | fenia/libfenia.la \ 38 | xml/libxml.la \ 39 | lang/liblang.la \ 40 | l10n/libl10n.la \ 41 | io/libio.la \ 42 | plugin/libplugin.la \ 43 | util/libutil.la \ 44 | scheduler/libscheduler.la \ 45 | regex/libregex.la \ 46 | alloc/liballoc.la \ 47 | gref/libgref.la \ 48 | flags/libflags.la \ 49 | process/libprocess.la \ 50 | $(DUMMY_LIBS) @BDB_LIBS@ @MCCP_LIBS@ 51 | 52 | CLEANFILES = $(DUMMY_LIBS) 53 | -------------------------------------------------------------------------------- /libdreamland/Makefile.inc: -------------------------------------------------------------------------------- 1 | INCLUDES_DREAMLAND = \ 2 | -I$(top_srcdir)/libdreamland \ 3 | -I$(top_srcdir)/libdreamland/regex \ 4 | -I$(top_srcdir)/libdreamland/lang \ 5 | -I$(top_srcdir)/libdreamland/util \ 6 | -I$(top_srcdir)/libdreamland/xml \ 7 | -I$(top_srcdir)/libdreamland/plugin \ 8 | -I$(top_srcdir)/libdreamland/scheduler \ 9 | -I$(top_srcdir)/libdreamland/io \ 10 | -I$(top_srcdir)/libdreamland/fenia \ 11 | -I$(top_srcdir)/libdreamland/l10n \ 12 | -I$(top_srcdir)/libdreamland/alloc \ 13 | -I$(top_srcdir)/libdreamland/flags \ 14 | -I$(top_srcdir)/libdreamland/gref \ 15 | -I$(top_srcdir)/libdreamland/process 16 | 17 | -------------------------------------------------------------------------------- /libdreamland/alloc/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2008 3 | # 4 | noinst_LTLIBRARIES = liballoc.la 5 | 6 | INCLUDES = \ 7 | -I$(srcdir) \ 8 | -I$(top_builddir) \ 9 | -I$(srcdir)/../lang \ 10 | -I$(srcdir)/../util \ 11 | -I$(srcdir)/../l10n 12 | 13 | AM_CPPFLAGS = -Wall 14 | 15 | liballoc_la_SOURCES = \ 16 | allocateclass.cpp \ 17 | class.cpp \ 18 | oneallocate.cpp \ 19 | exceptionclassnotfound.cpp 20 | -------------------------------------------------------------------------------- /libdreamland/alloc/allocateclass.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: allocateclass.cpp,v 1.1.2.2 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, DreamLand, 2004 4 | */ 5 | 6 | #include "allocateclass.h" 7 | 8 | AllocateClass::~AllocateClass( ) 9 | { 10 | } 11 | 12 | -------------------------------------------------------------------------------- /libdreamland/alloc/allocateclass.h: -------------------------------------------------------------------------------- 1 | /* $Id: allocateclass.h,v 1.1.2.2 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, DreamLand, 2003 4 | */ 5 | /*************************************************************************** 6 | allocateclass.h - description 7 | ------------------- 8 | begin : Wed Oct 31 2001 9 | copyright : (C) 2001 by Igor S. Petrenko 10 | email : nofate@europe.com 11 | ***************************************************************************/ 12 | 13 | #ifndef ALLOCATECLASS_H 14 | #define ALLOCATECLASS_H 15 | 16 | #include "dlobject.h" 17 | 18 | class AllocateClass : public virtual DLObject 19 | { 20 | public: 21 | typedef ::Pointer Pointer; 22 | 23 | virtual ~AllocateClass( ); 24 | 25 | public: 26 | virtual DLObject::Pointer set( DLObject::Pointer arg1, DLObject::Pointer arg2 ) = 0; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libdreamland/alloc/exceptionclassnotfound.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: exceptionclassnotfound.cpp,v 1.1.2.2 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, DreamLand, 2003 4 | */ 5 | #include "exceptionclassnotfound.h" 6 | 7 | ExceptionClassNotFound::~ExceptionClassNotFound( ) throw( ) 8 | { 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /libdreamland/alloc/exceptionclassnotfound.h: -------------------------------------------------------------------------------- 1 | /* $Id: exceptionclassnotfound.h,v 1.1.2.2 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, DreamLand, 2003 4 | */ 5 | 6 | /*************************************************************************** 7 | exceptionclassnotfound.h - description 8 | ------------------- 9 | begin : Mon Oct 1 2001 10 | copyright : (C) 2001 by Igor S. Petrenko 11 | email : nofate@europe.com 12 | ***************************************************************************/ 13 | 14 | #ifndef EXCEPTIONCLASSNOTFOUND_H 15 | #define EXCEPTIONCLASSNOTFOUND_H 16 | 17 | #include "exception.h" 18 | 19 | /** 20 | * @author Igor S. Petrenko 21 | */ 22 | class ExceptionClassNotFound : public Exception 23 | { 24 | public: 25 | inline ExceptionClassNotFound( string name ) 26 | : Exception( string( "Class '" ) + name + "' not found" ) 27 | { 28 | } 29 | 30 | virtual ~ExceptionClassNotFound( ) throw( ); 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /libdreamland/alloc/mocregistrator.h: -------------------------------------------------------------------------------- 1 | /* $Id: mocregistrator.h,v 1.1.2.2 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, DreamLand, 2005 4 | */ 5 | #ifndef __MOCREGISTRATOR_H__ 6 | #define __MOCREGISTRATOR_H__ 7 | 8 | #include "plugin.h" 9 | #include "class.h" 10 | 11 | template 12 | class MocRegistrator : public virtual Plugin { 13 | public: 14 | typedef ::Pointer< MocRegistrator > Pointer; 15 | 16 | virtual void initialization( ) 17 | { 18 | Class::regMoc( ); 19 | } 20 | virtual void destruction( ) 21 | { 22 | Class::unregMoc( ); 23 | } 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /libdreamland/alloc/oneallocate.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: oneallocate.cpp,v 1.1.2.2 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, DreamLand, 2003 4 | */ 5 | /*************************************************************************** 6 | oneallocate.cpp - description 7 | ------------------- 8 | begin : Mon May 14 2001 9 | copyright : (C) 2001 by Igor S. Petrenko 10 | email : nofate@europe.com 11 | ***************************************************************************/ 12 | 13 | #include 14 | #include "dlobject.h" 15 | #include "oneallocate.h" 16 | #include "dlstring.h" 17 | #include "exception.h" 18 | 19 | OneAllocate::~OneAllocate( ) 20 | { 21 | } 22 | 23 | void OneAllocate::checkDuplicate( DLObject* object ) 24 | { 25 | if( object != 0 ) 26 | throw Exception( DLString( "Duplicate static class " ) 27 | + typeid( *object ).name( ) ); 28 | } 29 | -------------------------------------------------------------------------------- /libdreamland/alloc/oneallocate.h: -------------------------------------------------------------------------------- 1 | /* $Id: oneallocate.h,v 1.1.2.2 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, DreamLand, 2003 4 | */ 5 | /*************************************************************************** 6 | oneallocate.h - description 7 | ------------------- 8 | begin : Mon May 14 2001 9 | copyright : (C) 2001 by Igor S. Petrenko 10 | email : nofate@europe.com 11 | ***************************************************************************/ 12 | 13 | #ifndef ONEALLOCATE_H 14 | #define ONEALLOCATE_H 15 | 16 | #include "dlobject.h" 17 | 18 | /** 19 | * @author Igor S. Petrenko 20 | */ 21 | class OneAllocate : public virtual DLObject 22 | { 23 | public: 24 | virtual ~OneAllocate( ); 25 | 26 | static void checkDuplicate( DLObject* ); 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libdreamland/alloc/xmlvariableregistrator.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlvariableregistrator.h,v 1.1.2.2 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, DreamLand, 2005 4 | */ 5 | #ifndef __XMLVARREGISTRATOR_H__ 6 | #define __XMLVARREGISTRATOR_H__ 7 | 8 | #include "plugin.h" 9 | #include "class.h" 10 | 11 | template 12 | class XMLVariableRegistrator : public virtual Plugin { 13 | public: 14 | typedef ::Pointer< XMLVariableRegistrator > Pointer; 15 | 16 | virtual void initialization( ) 17 | { 18 | Class::regXMLVar( ); 19 | } 20 | virtual void destruction( ) 21 | { 22 | Class::unregXMLVar( ); 23 | } 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /libdreamland/fenia/TODO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/fenia/TODO -------------------------------------------------------------------------------- /libdreamland/fenia/closure.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, Dream Land, 2018 4 | */ 5 | /* $Id$ 6 | * 7 | * unicorn, Forgotten Dungeon, 2018 8 | */ 9 | 10 | 11 | #ifndef __CLOSURE_H__ 12 | #define __CLOSURE_H__ 13 | 14 | #include "dlobject.h" 15 | #include "function.h" 16 | 17 | namespace Scripting { 18 | 19 | class RegisterList; 20 | class Scope; 21 | class XMLFunctionRef; 22 | 23 | class Closure : public map, public DLObject { 24 | public: 25 | Closure(XMLFunctionRef &ref); 26 | Closure(Scope *start, Function *f); 27 | virtual ~Closure(); 28 | 29 | inline Function *getFunction() { 30 | return function; 31 | } 32 | 33 | void copyScope(Scope *s); 34 | Register invoke(Register thiz, const RegisterList &args); 35 | 36 | void reverse(ostream &os, const DLString &nextline) const; 37 | DLString toString() const; 38 | void toXMLFunctionRef(XMLFunctionRef &ref); 39 | private: 40 | Function *function; 41 | }; 42 | 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /libdreamland/fenia/codesourceref.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: codesourceref.cpp,v 1.1.6.2 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: codesourceref.cpp,v 1.1.6.2 2009/10/11 18:35:35 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #include "codesourceref.h" 11 | #include "codesource.h" 12 | 13 | namespace Scripting { 14 | 15 | CodeSourceRef::CodeSourceRef( ) 16 | { 17 | } 18 | 19 | CodeSourceRef::~CodeSourceRef( ) 20 | { 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /libdreamland/fenia/codesourceref.h: -------------------------------------------------------------------------------- 1 | /* $Id: codesourceref.h,v 1.1.4.1.6.2 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: codesourceref.h,v 1.1.4.1.6.2 2009/10/11 18:35:35 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | #ifndef __CODESOURCEREF_H__ 10 | #define __CODESOURCEREF_H__ 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | namespace Scripting { 17 | 18 | class CodeSource; 19 | 20 | class CodeSourceRef { 21 | public: 22 | CodeSourceRef(); 23 | ~CodeSourceRef(); 24 | 25 | int line; 26 | ::Pointer source; 27 | }; 28 | 29 | ostream &operator << (ostream &os, const CodeSourceRef &csr); 30 | 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /libdreamland/fenia/feniastring.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/fenia/feniastring.cpp -------------------------------------------------------------------------------- /libdreamland/fenia/feniastring.h: -------------------------------------------------------------------------------- 1 | /* $Id: feniastring.h,v 1.1.2.2.18.2 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: feniastring.h,v 1.1.2.2.18.2 2009/10/11 18:35:35 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #ifndef __FENIASTRING_H__ 11 | #define __FENIASTRING_H__ 12 | 13 | #include 14 | 15 | #include "native.h" 16 | 17 | namespace Scripting { 18 | 19 | class FeniaString : public DLString { 20 | NMI_OBJECT 21 | public: 22 | typedef NativeTraits Traits; 23 | 24 | FeniaString() { } 25 | FeniaString(const DLString &dls) : DLString(dls) { } 26 | }; 27 | 28 | } 29 | 30 | #endif /* __FENIASTRING_H__ */ 31 | -------------------------------------------------------------------------------- /libdreamland/fenia/flow.h: -------------------------------------------------------------------------------- 1 | /* $Id: flow.h,v 1.1.4.2.18.1 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: flow.h,v 1.1.4.2.18.1 2009/10/11 18:35:35 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #ifndef __FLOW_H__ 11 | #define __FLOW_H__ 12 | 13 | #include "register-decl.h" 14 | 15 | namespace Scripting { 16 | 17 | struct FlowCtl { 18 | static const int NEXT = 1; 19 | static const int BREAK = 2; 20 | static const int CONTINUE = 3; 21 | static const int RETURN = 4; 22 | 23 | FlowCtl(int t) : type(t) { } 24 | FlowCtl(int t, Register r) : type(t), ret(r) { } 25 | 26 | int type; 27 | Register ret; 28 | }; 29 | 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libdreamland/fenia/handler.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: handler.cpp,v 1.1.4.3 2009/10/11 18:35:35 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: handler.cpp,v 1.1.4.3 2009/10/11 18:35:35 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #include "handler.h" 11 | 12 | namespace Scripting { 13 | 14 | Handler::~Handler( ) 15 | { 16 | } 17 | 18 | void 19 | Handler::backup() 20 | { 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /libdreamland/fenia/handler.h: -------------------------------------------------------------------------------- 1 | /* $Id: handler.h,v 1.1.2.3.18.3 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: handler.h,v 1.1.2.3.18.3 2009/10/11 18:35:36 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #ifndef __HANDLER_H__ 11 | #define __HANDLER_H__ 12 | 13 | 14 | #include 15 | 16 | namespace Scripting { 17 | 18 | class Object; 19 | class Register; 20 | class RegisterList; 21 | 22 | class Handler : public virtual XMLPolymorphVariable { 23 | public: 24 | typedef ::Pointer Pointer; 25 | 26 | virtual ~Handler( ); 27 | 28 | virtual void setField(const Register &key, const Register &val) = 0; 29 | virtual Register getField(const Register &key) = 0; 30 | virtual Register callMethod(const Register &key, const RegisterList &args) = 0; 31 | 32 | virtual void setSelf(Object *) = 0; 33 | virtual void backup(); // called when 'object -> handler' link destroyed 34 | }; 35 | 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /libdreamland/fenia/impl.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: impl.cpp,v 1.1.4.2.18.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: impl.cpp,v 1.1.4.2.18.2 2009/10/11 18:35:36 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #include "function.h" 11 | #include "nodes.h" 12 | #include "xmlregister.h" 13 | #include "exp-tree.h" 14 | #include "ref-tree.h" 15 | #include "stmt-tree.h" 16 | 17 | using namespace Scripting; 18 | 19 | extern "C" { 20 | 21 | void fenia_init() { 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /libdreamland/fenia/impl.h: -------------------------------------------------------------------------------- 1 | /* $Id: impl.h,v 1.1.4.2.18.1 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: impl.h,v 1.1.4.2.18.1 2009/10/11 18:35:36 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #ifndef __IMPL_H__ 11 | #define __IMPL_H__ 12 | 13 | extern "C" void fenia_init(); 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /libdreamland/fenia/manager-decl.h: -------------------------------------------------------------------------------- 1 | /* $Id: manager-decl.h,v 1.1.4.4.6.6 2014-09-19 11:44:13 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: manager-decl.h,v 1.1.4.4.6.6 2014-09-19 11:44:13 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | 11 | #ifndef __MANAGER_DECL_H__ 12 | #define __MANAGER_DECL_H__ 13 | 14 | namespace Scripting { 15 | 16 | template 17 | class BaseManager : public T::Map { 18 | public: 19 | typedef typename T::Map::iterator iterator; 20 | typedef typename T::Map::const_iterator const_iterator; 21 | typedef typename T::id_t id_t; 22 | 23 | using T::Map::begin; 24 | using T::Map::end; 25 | using T::Map::lower_bound; 26 | using T::Map::_M_insert_unique_; 27 | 28 | inline BaseManager(); 29 | inline ~BaseManager(); 30 | 31 | inline void erase(id_t id); 32 | inline T &at(id_t id); 33 | inline T &allocate(); 34 | 35 | typename T::id_t lastId; 36 | }; 37 | 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /libdreamland/fenia/native.cpp: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id$ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #include "native.h" 11 | #include "register-impl.h" 12 | 13 | namespace Scripting { 14 | 15 | void NativeHandler::setField( const Register &key, const Register &val ) 16 | { 17 | if (!setNativeField( key, val )) 18 | throw Exception("Set method not found: " + key.toString( )); 19 | 20 | } 21 | 22 | Register NativeHandler::getField( const Register &key ) 23 | { 24 | Register retval; 25 | 26 | if (!getNativeField( key, retval )) 27 | throw Exception("Get method not found: " + key.toString( )); 28 | 29 | return retval; 30 | 31 | } 32 | 33 | Register NativeHandler::callMethod( const Register &key, const RegisterList &args ) 34 | { 35 | Register retval; 36 | BTPushNative dummy(this, key.toIdentifier()); 37 | 38 | if (!callNativeMethod( key, args, retval )) 39 | throw Exception("Invoke method not found: " + key.toString( )); 40 | 41 | return retval; 42 | } 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /libdreamland/fenia/nodes.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: nodes.cpp,v 1.4.6.3.18.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: nodes.cpp,v 1.4.6.3.18.2 2009/10/11 18:35:36 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #include "nodes.h" 11 | #include "flow.h" 12 | #include "context.h" 13 | #include "reference-impl.h" 14 | 15 | namespace Scripting { 16 | 17 | Node::Node() 18 | { 19 | } 20 | 21 | Node::~Node() 22 | { 23 | } 24 | 25 | StmtNode::~StmtNode( ) 26 | { 27 | } 28 | 29 | ExpNode::~ExpNode( ) 30 | { 31 | } 32 | 33 | ReferenceNode::~ReferenceNode( ) 34 | { 35 | } 36 | 37 | ExpNodeList::ExpNodeList() 38 | { 39 | } 40 | 41 | ExpNodeList::~ExpNodeList() 42 | { 43 | } 44 | 45 | StmtNodeList::StmtNodeList() 46 | { 47 | } 48 | 49 | StmtNodeList::~StmtNodeList() 50 | { 51 | } 52 | 53 | FlowCtl 54 | StmtNode::eval() 55 | { 56 | NodeTrace dummy(this); 57 | return evalAux(); 58 | } 59 | 60 | Register 61 | ExpNode::eval() 62 | { 63 | NodeTrace dummy(this); 64 | return evalAux(); 65 | } 66 | 67 | Reference 68 | ReferenceNode::eval() 69 | { 70 | NodeTrace dummy(this); 71 | return evalAux(); 72 | } 73 | 74 | 75 | } 76 | -------------------------------------------------------------------------------- /libdreamland/fenia/phase.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: phase.cpp,v 1.1.4.2.18.1 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: phase.cpp,v 1.1.4.2.18.1 2009/10/11 18:35:36 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #include "phase.h" 11 | 12 | namespace Scripting { 13 | bool gc = false; 14 | 15 | DereferenceListener *DereferenceListener::instance = 0; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /libdreamland/fenia/phase.h: -------------------------------------------------------------------------------- 1 | /* $Id: phase.h,v 1.1.4.2.18.1 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: phase.h,v 1.1.4.2.18.1 2009/10/11 18:35:36 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | #ifndef __PHASE_H__ 10 | #define __PHASE_H__ 11 | 12 | namespace Scripting { 13 | 14 | class Function; 15 | class Object; 16 | 17 | class DereferenceListener { 18 | public: 19 | virtual void notify(Function *) = 0; 20 | virtual void notify(Object *) = 0; 21 | 22 | static DereferenceListener *instance; 23 | }; 24 | 25 | extern bool gc; 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libdreamland/fenia/reference-impl.h: -------------------------------------------------------------------------------- 1 | /* $Id: reference-impl.h,v 1.1.2.2.18.1 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: reference-impl.h,v 1.1.2.2.18.1 2009/10/11 18:35:36 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #ifndef __REFERENCE_IMPL_H__ 11 | #define __REFERENCE_IMPL_H__ 12 | 13 | #include "reference.h" 14 | #include "register-impl.h" 15 | 16 | 17 | namespace Scripting { 18 | 19 | 20 | Reference::Reference() : id(0) 21 | { 22 | } 23 | 24 | Reference::Reference(Lex::id_t k) : id(k) 25 | { 26 | } 27 | 28 | Reference::Reference(const Register &c, const Register &k) 29 | : id(0), container(c), key(k) 30 | { 31 | } 32 | 33 | } 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /libdreamland/fenia/reference.h: -------------------------------------------------------------------------------- 1 | /* $Id: reference.h,v 1.1.2.5.18.1 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: reference.h,v 1.1.2.5.18.1 2009/10/11 18:35:36 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | #ifndef __REFERENCE_H__ 11 | #define __REFERENCE_H__ 12 | 13 | #include "register-decl.h" 14 | 15 | namespace Scripting { 16 | 17 | struct Reference { 18 | inline Reference(); 19 | inline Reference(Lex::id_t k); 20 | inline Reference(const Register &c, const Register &k); 21 | 22 | const Register operator () (const RegisterList &) const; 23 | const Register &operator = (const Register &) const; 24 | const Register operator * () const; 25 | 26 | Lex::id_t id; 27 | Register container; 28 | Register key; 29 | }; 30 | 31 | } 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /libdreamland/fenia/scan.l++: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/fenia/scan.l++ -------------------------------------------------------------------------------- /libdreamland/fenia/test.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: test.cpp,v 1.1.4.7.6.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /* $Id: test.cpp,v 1.1.4.7.6.2 2009/10/11 18:35:36 rufina Exp $ 6 | * 7 | * unicorn, Forgotten Dungeon, 2004 8 | */ 9 | 10 | 11 | #include 12 | 13 | using namespace std; 14 | 15 | #include "test.h" 16 | #include "register-impl.h" 17 | 18 | using namespace Scripting; 19 | 20 | extern DbEnvContext dbEnv; 21 | 22 | NMI_INIT(Test, "test") 23 | 24 | Test::Test() 25 | { 26 | current = this; 27 | self = 0; 28 | } 29 | 30 | Test::~Test() 31 | { 32 | current = 0; 33 | } 34 | 35 | void 36 | Test::load() 37 | { 38 | manager.open( ); 39 | manager.load( ); 40 | manager.recover( ); 41 | } 42 | 43 | void 44 | Test::save() 45 | { 46 | manager.sync( 0 ); 47 | manager.close( ); 48 | } 49 | 50 | DbEnvContext TestManager::dbEnv; 51 | 52 | DbEnvContext * 53 | TestManager::getDbEnv( ) const 54 | { 55 | return &dbEnv; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /libdreamland/flags/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2008 3 | # 4 | noinst_LTLIBRARIES = libflags.la 5 | 6 | INCLUDES = \ 7 | -I$(srcdir) \ 8 | -I$(top_builddir) \ 9 | -I$(srcdir)/../lang \ 10 | -I$(srcdir)/../alloc \ 11 | -I$(srcdir)/../util \ 12 | -I$(srcdir)/../xml \ 13 | -I$(srcdir)/../l10n 14 | 15 | AM_CPPFLAGS = -Wall 16 | 17 | libflags_la_SOURCES = \ 18 | flagtable.cpp \ 19 | flagtableregistry.cpp \ 20 | flags.cpp \ 21 | enumeration.cpp \ 22 | xmlflags.cpp \ 23 | xmlenumeration.cpp 24 | 25 | -------------------------------------------------------------------------------- /libdreamland/flags/enumeration.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: enumeration.cpp,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | #include "enumeration.h" 6 | 7 | const Enumeration Enumeration::emptyEnumeration; 8 | const EnumerationArray EnumerationArray::emptyArray; 9 | -------------------------------------------------------------------------------- /libdreamland/flags/enumeration.h: -------------------------------------------------------------------------------- 1 | /* $Id: enumeration.h,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2006 4 | */ 5 | 6 | #ifndef __ENUMERATION_H__ 7 | #define __ENUMERATION_H__ 8 | 9 | #include 10 | #include "integer.h" 11 | #include "flagtablewrapper.h" 12 | 13 | /* 14 | * Enumeration 15 | */ 16 | struct Enumeration : public FlagTableWrapper, public Integer { 17 | inline Enumeration( ); 18 | inline Enumeration( int, const FlagTable * ); 19 | 20 | inline DLString name( ) const; 21 | inline DLString message( char gcase = '1' ) const; 22 | 23 | static const Enumeration emptyEnumeration; 24 | }; 25 | 26 | /* 27 | * EnumerationArray 28 | */ 29 | struct EnumerationArray : public FlagTableWrapper, public vector { 30 | inline EnumerationArray( ); 31 | inline EnumerationArray( const FlagTable * ); 32 | 33 | inline void clear( ); 34 | inline void fill( int ); 35 | 36 | inline int & operator [] (size_type); 37 | inline const int & operator [] (size_type) const; 38 | 39 | static const EnumerationArray emptyArray; 40 | }; 41 | 42 | #endif 43 | 44 | #include "enumeration-impl.h" 45 | -------------------------------------------------------------------------------- /libdreamland/flags/flags.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: flags.cpp,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | #include "flags.h" 6 | 7 | const Flags Flags::emptyFlags; 8 | -------------------------------------------------------------------------------- /libdreamland/flags/flags.h: -------------------------------------------------------------------------------- 1 | /* $Id: flags.h,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | #ifndef __FLAGS_H__ 6 | #define __FLAGS_H__ 7 | 8 | #include 9 | #include "flagtablewrapper.h" 10 | 11 | struct Flags : public FlagTableWrapper, public Bitstring { 12 | inline Flags( ); 13 | inline Flags( bitstring_t, const FlagTable * ); 14 | 15 | inline DLString names( ) const; 16 | inline DLString messages( bool comma = false, char gcase = '1' ) const; 17 | 18 | static const Flags emptyFlags; 19 | }; 20 | 21 | struct FlagsArray : public FlagTableWrapper, vector { 22 | inline FlagsArray( const FlagTable * ); 23 | /* todo */ 24 | }; 25 | 26 | #endif 27 | 28 | #include "flags-impl.h" 29 | 30 | -------------------------------------------------------------------------------- /libdreamland/flags/flagtable.h: -------------------------------------------------------------------------------- 1 | /* $Id: flagtable.h,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | #ifndef __FLAGTABLE_H__ 6 | #define __FLAGTABLE_H__ 7 | 8 | #include "dlstring.h" 9 | #include "bitstring.h" 10 | 11 | const int NO_FLAG = -99; 12 | 13 | /* 14 | * FlagTable 15 | */ 16 | struct FlagTable { 17 | struct Field { 18 | bitnumber_t value; 19 | const char *name; 20 | const char *message; 21 | }; 22 | 23 | const Field * fields; 24 | const int * reverse; 25 | const int size; 26 | const int max; 27 | const bool enumerated; 28 | 29 | int index( const DLString &arg, bool strict = true ) const; 30 | bitstring_t bitstring( const DLString &arg, bool strict = true ) const; 31 | bitnumber_t value( const DLString &arg, bool strict = true ) const; 32 | 33 | DLString names( bitstring_t ) const; 34 | DLString messages( bitstring_t, bool comma = false, char gcase = '1' ) const; 35 | 36 | DLString name( bitnumber_t value ) const; 37 | DLString message( bitnumber_t value, char gcase = '1' ) const; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /libdreamland/gref/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2008 3 | # 4 | noinst_LTLIBRARIES = libgref.la 5 | 6 | INCLUDES = \ 7 | -I$(srcdir) \ 8 | -I$(top_builddir) \ 9 | -I$(srcdir)/../lang \ 10 | -I$(srcdir)/../util \ 11 | -I$(srcdir)/../xml \ 12 | -I$(srcdir)/../l10n 13 | 14 | AM_CPPFLAGS = -Wall 15 | 16 | libgref_la_SOURCES = \ 17 | globalarray.cpp \ 18 | globalbitvector.cpp \ 19 | globalregistry.cpp \ 20 | globalregistryelement.cpp \ 21 | globalreference.cpp \ 22 | xmlglobalarray.cpp \ 23 | xmlglobalbitvector.cpp \ 24 | xmlglobalreference.cpp 25 | 26 | -------------------------------------------------------------------------------- /libdreamland/gref/globalarray.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: globalarray.cpp,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2006 4 | */ 5 | #include "globalarray.h" 6 | 7 | static int zeroValue; 8 | 9 | const GlobalArray GlobalArray::emptyArray; 10 | 11 | GlobalArray::GlobalArray( ) 12 | : registry( NULL ) 13 | { 14 | } 15 | 16 | GlobalArray::GlobalArray( GlobalRegistryBase *reg ) 17 | : registry( reg ) 18 | { 19 | clear( ); 20 | } 21 | 22 | GlobalArray::~GlobalArray( ) 23 | { 24 | } 25 | 26 | void GlobalArray::clear( ) 27 | { 28 | vector::clear( ); 29 | 30 | if (registry) 31 | resize( registry->size( ) ); 32 | } 33 | 34 | int & GlobalArray::operator [] (size_type ndx) 35 | { 36 | if (!registry) 37 | return zeroValue; 38 | if (!registry->goodIndex( ndx )) 39 | return zeroValue; 40 | if (ndx >= size( )) 41 | resize( ndx + 1 ); 42 | 43 | return vector::operator [](ndx); 44 | } 45 | 46 | const int & GlobalArray::operator [] (size_type ndx) const 47 | { 48 | return vector::operator [](ndx); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /libdreamland/gref/globalarray.h: -------------------------------------------------------------------------------- 1 | /* $Id: globalarray.h,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2006 4 | */ 5 | #ifndef GLOBALARRAY_H 6 | #define GLOBALARRAY_H 7 | 8 | #include 9 | #include "globalregistry.h" 10 | 11 | class GlobalArray : public vector { 12 | public: 13 | static const GlobalArray emptyArray; 14 | 15 | GlobalArray( ); 16 | GlobalArray( GlobalRegistryBase * ); 17 | virtual ~GlobalArray( ); 18 | 19 | void clear( ); 20 | int & operator [] (size_type); 21 | 22 | protected: 23 | GlobalRegistryBase *registry; 24 | 25 | private: 26 | const int & operator [] (size_type) const; 27 | }; 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libdreamland/gref/globalreference.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: globalreference.cpp,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2006 4 | */ 5 | #include "globalreference.h" 6 | 7 | GlobalReferenceBase::~GlobalReferenceBase( ) 8 | { 9 | } 10 | 11 | GlobalReferenceBase::GlobalReferenceBase( ) 12 | { 13 | init( ); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /libdreamland/gref/globalregistryelement.cpp: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2004 4 | */ 5 | #include "globalregistryelement.h" 6 | 7 | GlobalRegistryElement::GlobalRegistryElement( ) 8 | : index( -1 ) 9 | { 10 | } 11 | 12 | GlobalRegistryElement::~GlobalRegistryElement( ) 13 | { 14 | } 15 | 16 | const DLString &GlobalRegistryElement::getRussianName( ) const 17 | { 18 | return getName( ); 19 | } 20 | 21 | bool GlobalRegistryElement::matchesStrict( const DLString &str ) const 22 | { 23 | return !str.empty( ) && str == getName( ); 24 | } 25 | 26 | bool GlobalRegistryElement::matchesUnstrict( const DLString &str ) const 27 | { 28 | if (str.empty( ) || getName( ).empty( )) 29 | return false; 30 | 31 | if (!str.strPrefix( getName( ) )) 32 | return false; 33 | // TODO unstrict match by russian name, all cases 34 | // Use getRussianName method in child classes instead of custom getRusName 35 | return true; 36 | } 37 | -------------------------------------------------------------------------------- /libdreamland/gref/globalregistryelement.h: -------------------------------------------------------------------------------- 1 | /* $Id: globalregistryelement.h,v 1.1.2.4 2009/11/08 17:34:01 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2006 4 | */ 5 | #ifndef __GLOBALREGISTRYELEMENT_H__ 6 | #define __GLOBALREGISTRYELEMENT_H__ 7 | 8 | #include "dlobject.h" 9 | #include "dlstring.h" 10 | 11 | class GlobalRegistryElement : public virtual DLObject { 12 | friend class GlobalRegistryBase; 13 | public: 14 | typedef ::Pointer Pointer; 15 | 16 | GlobalRegistryElement( ); 17 | virtual ~GlobalRegistryElement( ); 18 | 19 | virtual const DLString &getName( ) const = 0; 20 | virtual const DLString &getRussianName( ) const; 21 | 22 | virtual bool matchesStrict( const DLString &str ) const; 23 | virtual bool matchesUnstrict( const DLString &str ) const; 24 | 25 | inline int getIndex( ) const 26 | { 27 | return index; 28 | } 29 | 30 | virtual bool isValid( ) const 31 | { 32 | return true; 33 | } 34 | 35 | protected: 36 | inline void setIndex( int i ) 37 | { 38 | index = i; 39 | } 40 | 41 | private: 42 | int index; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /libdreamland/gref/xmlglobalarray.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlglobalarray.h,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2006 4 | */ 5 | #ifndef XMLGLOBALARRAY_H 6 | #define XMLGLOBALARRAY_H 7 | 8 | #include "globalarray.h" 9 | #include "xmlnode.h" 10 | 11 | class XMLGlobalArray : public GlobalArray { 12 | public: 13 | XMLGlobalArray( GlobalRegistryBase * ); 14 | 15 | bool toXML( XMLNode::Pointer& ) const; 16 | void fromXML( const XMLNode::Pointer& ) throw( ExceptionBadType ); 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /libdreamland/gref/xmlglobalbitvector.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlglobalbitvector.cpp,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2006 4 | */ 5 | #include "xmlglobalbitvector.h" 6 | #include "xmlstring.h" 7 | 8 | XMLGlobalBitvector::XMLGlobalBitvector( ) 9 | { 10 | } 11 | 12 | XMLGlobalBitvector::XMLGlobalBitvector( GlobalRegistryBase *reg ) 13 | : GlobalBitvector( reg ) 14 | { 15 | } 16 | 17 | void XMLGlobalBitvector::fromXML( const XMLNode::Pointer& parent ) throw( ExceptionBadType ) 18 | { 19 | XMLString str; 20 | 21 | str.fromXML( parent ); 22 | fromString( str ); 23 | } 24 | 25 | bool XMLGlobalBitvector::toXML( XMLNode::Pointer& parent ) const 26 | { 27 | DLString str = toString( ); 28 | 29 | if (str.empty( )) 30 | return false; 31 | else 32 | return XMLString( str ).toXML( parent ); 33 | } 34 | -------------------------------------------------------------------------------- /libdreamland/gref/xmlglobalbitvector.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlglobalbitvector.h,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | #ifndef __XMLGLOBALBITVECTOR_H__ 6 | #define __XMLGLOBALBITVECTOR_H__ 7 | 8 | #include "globalbitvector.h" 9 | #include "xmlnode.h" 10 | 11 | class XMLGlobalBitvector : public GlobalBitvector { 12 | public: 13 | XMLGlobalBitvector( ); 14 | XMLGlobalBitvector( GlobalRegistryBase * ); 15 | 16 | void fromXML( const XMLNode::Pointer& ) throw( ExceptionBadType ); 17 | bool toXML( XMLNode::Pointer& ) const; 18 | }; 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /libdreamland/gref/xmlglobalreference.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlglobalreference.cpp,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2006 4 | */ 5 | #include "xmlglobalreference.h" 6 | #include "xmlstring.h" 7 | 8 | void XMLGlobalReference::fromXML( const XMLNode::Pointer& parent ) throw( ExceptionBadType ) 9 | { 10 | XMLString str; 11 | 12 | str.fromXML( parent ); 13 | setName( str.getValue( ) ); 14 | } 15 | 16 | bool XMLGlobalReference::toXML( XMLNode::Pointer& parent ) const 17 | { 18 | if (name == "none") 19 | return false; 20 | else 21 | return XMLString( name ).toXML( parent ); 22 | } 23 | -------------------------------------------------------------------------------- /libdreamland/gref/xmlglobalreference.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlglobalreference.h,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | #ifndef __XMLGLOBALREFERENCE_H__ 6 | #define __XMLGLOBALREFERENCE_H__ 7 | 8 | #include "globalreference.h" 9 | #include "xmlvariable.h" 10 | 11 | class XMLGlobalReference : public virtual GlobalReferenceBase, 12 | public XMLVariable 13 | { 14 | public: 15 | 16 | virtual void fromXML( const XMLNode::Pointer& ) throw( ExceptionBadType ); 17 | virtual bool toXML( XMLNode::Pointer& ) const; 18 | }; 19 | 20 | 21 | #define XMLGLOBALREF_DECL(Type) \ 22 | struct XML##Type##Reference : public Type##Reference, public XMLGlobalReference { \ 23 | XML##Type##Reference( ); \ 24 | virtual ~XML##Type##Reference( ); \ 25 | inline XML##Type##Reference & operator = ( int index ) { \ 26 | assign( index ); \ 27 | return *this; \ 28 | } \ 29 | }; 30 | 31 | #define XMLGLOBALREF_IMPL(Type) \ 32 | XML##Type##Reference::XML##Type##Reference( ) { } \ 33 | XML##Type##Reference::~XML##Type##Reference( ) { } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libdreamland/io/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2003 3 | # based on: NoFate, 2002 4 | noinst_LTLIBRARIES = libio.la 5 | 6 | INCLUDES = \ 7 | -I$(srcdir) \ 8 | -I$(top_builddir) \ 9 | -I$(srcdir)/../xml \ 10 | -I$(srcdir)/../lang \ 11 | -I$(srcdir)/../alloc \ 12 | -I$(srcdir)/../util 13 | 14 | AM_CPPFLAGS = -Wall 15 | 16 | libio_la_SOURCES = \ 17 | txncontext.cpp \ 18 | dbio.cpp \ 19 | dldirectory.cpp \ 20 | dlfile.cpp \ 21 | dlfileop.cpp \ 22 | dlfilestream.cpp \ 23 | exceptiondbio.cpp \ 24 | xmlloader.cpp \ 25 | xmltableelement.cpp \ 26 | xmltableloader.cpp \ 27 | xmlfile.cpp \ 28 | xmlconfigurable.cpp \ 29 | dlfileloader.cpp 30 | 31 | -------------------------------------------------------------------------------- /libdreamland/io/config_io.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2004 4 | */ 5 | #ifndef CONFIG_IO_H 6 | #define CONFIG_IO_H 7 | 8 | #ifdef HAVE_CONFIG_H 9 | #include "config.h" 10 | #endif /* HAVE_CONFIG_H */ 11 | 12 | #ifdef HAVE_DIRENT_H 13 | #include "dirent.h" 14 | #define NAMLEN( dirent ) strlen( ( dirent )->d_name ) 15 | #else 16 | #define dirent direct 17 | #define NAMLEN( dirent ) ( dirent )->d_namlen 18 | #ifdef HAVE_SYS_NDIR_H 19 | #include 20 | #endif 21 | #ifdef HAVE_SYS_DIR_H 22 | #include 23 | #endif 24 | #ifdef HAVE_NDIR_H 25 | #include 26 | #endif 27 | #endif /* HAVE_DIRENT_H */ 28 | 29 | #endif /* CONFIG_IO_H */ 30 | -------------------------------------------------------------------------------- /libdreamland/io/dbio.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/io/dbio.h -------------------------------------------------------------------------------- /libdreamland/io/dbm/dbmio.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | /* $Id$ 6 | * 7 | * unicorn, Forgotten Dungeon, 2005 8 | */ 9 | 10 | 11 | #ifndef __DBMIO_H__ 12 | #define __DBMIO_H__ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | class DBMIO { 23 | public: 24 | typedef unsigned long int Key; 25 | struct Exception : public ::Exception { 26 | Exception(const DLString &ex) : ::Exception(ex) { } 27 | }; 28 | struct EOFException : public Exception { 29 | EOFException() : Exception("eof") { } 30 | }; 31 | 32 | DBMIO(); 33 | ~DBMIO(); 34 | 35 | void open(const char *fname, int flags, int mode = 0644); 36 | void sync(); 37 | void close(); 38 | 39 | void del(const Key &k); 40 | void get(const Key &k, DLString &v); 41 | void put(const Key &k, const DLString &v); 42 | void seq(Key &k, DLString &v, unsigned int flags); 43 | 44 | private: 45 | static u_int32_t hash(const void *, size_t); 46 | 47 | DB *db; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /libdreamland/io/dbm/dbmtest.cpp: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | /* $Id$ 6 | * 7 | * unicorn, Forgotten Dungeon, 2005 8 | */ 9 | 10 | 11 | #include 12 | 13 | #include 14 | 15 | #include "dbmio.h" 16 | 17 | using namespace std; 18 | 19 | int 20 | main(int argc, char **argv) 21 | { 22 | DBMIO::Key key; 23 | DLString val; 24 | DBMIO db; 25 | 26 | if(argc < 2) { 27 | cout << "Usage: dbmtest " << endl; 28 | return 1; 29 | } 30 | 31 | db.open(argv[1], O_RDWR); 32 | 33 | try { 34 | db.seq(key, val, R_FIRST); 35 | while(1) { 36 | cout << "[" << key << "] " << endl 37 | << val << endl; 38 | 39 | db.seq(key, val, R_NEXT); 40 | } 41 | } catch(const DBMIO::EOFException &ex) { 42 | /*nothing*/ 43 | } catch(const DBMIO::Exception &ex) { 44 | cout << ex.what() << endl; 45 | } 46 | 47 | db.close(); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /libdreamland/io/dbm/rdbms.cpp: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | /* $Id$ 6 | * 7 | * unicorn, Forgotten Dungeon, 2005 8 | */ 9 | 10 | #include "config.h" 11 | 12 | #ifdef HAS_BDB 13 | #include "rdbms_bdb.cpp" 14 | #else 15 | #error 16 | #endif 17 | 18 | 19 | template class DbContext; 20 | template class DbContext; 21 | template class DbContext; 22 | -------------------------------------------------------------------------------- /libdreamland/io/dbm/rdbms.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | /* $Id$ 6 | * 7 | * unicorn, Forgotten Dungeon, 2005 8 | */ 9 | 10 | /* $Id$ 11 | * 12 | * ruffina, Dream Land, 2005 13 | */ 14 | /* $Id$ 15 | * 16 | * unicorn, Forgotten Dungeon, 2005 17 | */ 18 | 19 | #ifndef __RDBMS_H__ 20 | #define __RDBMS_H__ 21 | 22 | #include "config.h" 23 | 24 | #ifdef HAS_BDB 25 | #include "rdbms_bdb.h" 26 | #else 27 | #error 28 | #endif 29 | 30 | 31 | extern template class DbContext; 32 | extern template class DbContext; 33 | extern template class DbContext; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libdreamland/io/dldirectory.h: -------------------------------------------------------------------------------- 1 | /* $Id: dldirectory.h,v 1.1.2.5 2014-09-19 11:45:55 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #ifndef DLDIRECTORY_H 6 | #define DLDIRECTORY_H 7 | 8 | #include 9 | 10 | #include "config_io.h" 11 | #include "exceptiondbio.h" 12 | #include "exceptiondbioeof.h" 13 | #include "dlfile.h" 14 | 15 | class DLDirectory : public DLFile { 16 | public: 17 | DLDirectory( ); 18 | DLDirectory( const DLString &dirname, const DLString &filename = DLString::emptyString, const DLString &fileext = DLString::emptyString ); 19 | DLDirectory( const DLFile &dir, const DLFile &file = emptyFile ); 20 | DLDirectory( const DLFile &dir, const DLString &filename, const DLString &fileext = DLString::emptyString ); 21 | virtual ~DLDirectory( ); 22 | 23 | void open( const DLString &path ) throw( ExceptionDBIO ); 24 | void open( ) throw( ExceptionDBIO ); 25 | void close( ); 26 | 27 | DLFile nextEntry( ) throw( ExceptionDBIOEOF ); 28 | DLFile nextTypedEntry( const DLString &fileExt ) throw( ExceptionDBIOEOF ); 29 | DLFile tempEntry( ) throw( ExceptionDBIO ); 30 | 31 | protected: 32 | DIR * dirp; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libdreamland/io/dlfileloader.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2004 4 | */ 5 | #ifndef DLFILELOADER_H 6 | #define DLFILELOADER_H 7 | 8 | #include 9 | #include "dlfileop.h" 10 | #include "dldirectory.h" 11 | 12 | class DLFileLoader { 13 | public: 14 | struct FileData { 15 | DLString content; 16 | time_t mtime; 17 | }; 18 | typedef map Files; 19 | 20 | virtual ~DLFileLoader(); 21 | 22 | void loadAll(); 23 | void load(const DLString &key); 24 | const DLString & get(const DLString &key) const; 25 | time_t getModifyTime(const DLString &key) const; 26 | 27 | protected: 28 | virtual DLDirectory getTableDir() const = 0; 29 | virtual DLString getFileExt() const; 30 | 31 | void addEntry(const DLFile &entry); 32 | 33 | Files files; 34 | }; 35 | 36 | class DLFileReaderByIndex { 37 | public: 38 | virtual ~DLFileReaderByIndex(); 39 | 40 | bool hasNext(); 41 | DLFile next(); 42 | 43 | protected: 44 | virtual DLDirectory getTableDir() const = 0; 45 | virtual DLString getIndexName() const = 0; 46 | 47 | bool openIndex(); 48 | void readEntry(); 49 | DLFileRead fileIndex; 50 | DLString currentEntry; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /libdreamland/io/dlfilestream.h: -------------------------------------------------------------------------------- 1 | /* $Id: dlfilestream.h,v 1.1.2.4 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #ifndef DLFILESTREAM_H 6 | #define DLFILESTREAM_H 7 | 8 | #include 9 | #include 10 | 11 | #include "dlfile.h" 12 | #include "exceptiondbio.h" 13 | 14 | class DLFileStream : public DLFile { 15 | public: 16 | DLFileStream( const DLString &dirname, const DLString &filename = DLString::emptyString, const DLString &fileext = DLString::emptyString ); 17 | DLFileStream( const DLFile &dir, const DLFile &file = emptyFile ); 18 | DLFileStream( const DLFile &dir, const DLString &filename, const DLString &fileext = DLString::emptyString ); 19 | virtual ~DLFileStream( ); 20 | 21 | void toStream( std::ostream & ) throw( ExceptionDBIO ); 22 | void fromString( const DLString & ) throw( ExceptionDBIO ); 23 | 24 | protected: 25 | void openInputStream( ) throw( ExceptionDBIO ); 26 | void openOutputStream( ) throw( ExceptionDBIO ); 27 | 28 | std::ifstream istr; 29 | std::ofstream ostr; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libdreamland/io/exceptiondbio.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: exceptiondbio.cpp,v 1.3.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | #include 6 | #include 7 | #include "exceptiondbio.h" 8 | 9 | ExceptionDBIO::ExceptionDBIO( const DLString &str ) throw( ) 10 | { 11 | if (errno > 0) { 12 | setStr( str + " (" + strerror( errno ) + ")" ); 13 | } 14 | else { 15 | setStr( str ); 16 | } 17 | } 18 | 19 | ExceptionDBIO::~ExceptionDBIO( ) throw( ) 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /libdreamland/io/exceptiondbio.h: -------------------------------------------------------------------------------- 1 | /* $Id: exceptiondbio.h,v 1.4.34.3 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | // exceptiondbio.h: interface for the ExceptionDBIO class. 6 | // 7 | ////////////////////////////////////////////////////////////////////// 8 | 9 | #if !defined(AFX_EXCEPTIONDBIO_H__CDBC51B3_C088_470A_AA4E_87DE5891C347__INCLUDED_) 10 | #define AFX_EXCEPTIONDBIO_H__CDBC51B3_C088_470A_AA4E_87DE5891C347__INCLUDED_ 11 | 12 | #include "exception.h" 13 | #include "dlstring.h" 14 | 15 | class ExceptionDBIO : public Exception 16 | { 17 | public: 18 | ExceptionDBIO( const DLString &str ) throw( ); 19 | 20 | virtual ~ExceptionDBIO( ) throw( ); 21 | }; 22 | 23 | 24 | #endif // !defined(AFX_EXCEPTIONDBIO_H__CDBC51B3_C088_470A_AA4E_87DE5891C347__INCLUDED_) 25 | -------------------------------------------------------------------------------- /libdreamland/io/exceptiondbioeof.h: -------------------------------------------------------------------------------- 1 | /* $Id: exceptiondbioeof.h,v 1.4.34.1 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | // exceptiondbioeof.h: interface for the ExceptionDBIOEOF class. 6 | // 7 | ////////////////////////////////////////////////////////////////////// 8 | 9 | #if !defined(AFX_EXCEPTIONDBIOEOF_H__D3154446_87DA_4B52_B061_5AFC6CEA98AD__INCLUDED_) 10 | #define AFX_EXCEPTIONDBIOEOF_H__D3154446_87DA_4B52_B061_5AFC6CEA98AD__INCLUDED_ 11 | 12 | #include "exception.h" 13 | 14 | class ExceptionDBIOEOF : public Exception 15 | { 16 | public: 17 | inline ExceptionDBIOEOF( ) 18 | : Exception( "EOF" ) 19 | { 20 | } 21 | 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libdreamland/io/xmlconfigurable.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlconfigurable.cpp,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2009 4 | */ 5 | #include "xmlconfigurable.h" 6 | 7 | XMLConfigurable::~XMLConfigurable( ) 8 | { 9 | } 10 | 11 | bool XMLConfigurable::loadConfig( ) 12 | { 13 | return getConfigXMLFile( ).load( ); 14 | } 15 | 16 | bool XMLConfigurable::saveConfig( ) 17 | { 18 | return getConfigXMLFile( ).save( ); 19 | } 20 | 21 | XMLFile XMLConfigurable::getConfigXMLFile( ) 22 | { 23 | XMLFile configFile; 24 | 25 | configFile.setFile( getConfigFile( ) ); 26 | configFile.setNodeName( getType( ) ); 27 | configFile.setVariable( this ); 28 | 29 | return configFile; 30 | } 31 | 32 | DLFile XMLConfigurable::getConfigFile( ) const 33 | { 34 | return DLFile( getConfigDirPath( ), 35 | getType( ).toLower( ), 36 | ".xml" ); 37 | } 38 | 39 | DLString XMLConfigurable::getConfigDirPath( ) const 40 | { 41 | return DLString::emptyString; 42 | } 43 | 44 | DLFile XMLConfigurableWithPath::getConfigFile( ) const 45 | { 46 | if (!configFilePath.empty( )) 47 | return configFilePath; 48 | 49 | return XMLConfigurable::getConfigFile( ); 50 | } 51 | 52 | -------------------------------------------------------------------------------- /libdreamland/io/xmlconfigurable.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlconfigurable.h,v 1.1.2.3 2009/11/02 13:48:11 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2009 4 | */ 5 | #ifndef XMLCONFIGURABLE_H 6 | #define XMLCONFIGURABLE_H 7 | 8 | #include "xmlfile.h" 9 | #include "xmlpolymorphvariable.h" 10 | 11 | class XMLConfigurable : public virtual XMLPolymorphVariable { 12 | public: 13 | virtual ~XMLConfigurable( ); 14 | 15 | virtual DLFile getConfigFile( ) const; 16 | protected: 17 | virtual DLString getConfigDirPath( ) const; 18 | 19 | bool loadConfig( ); 20 | bool saveConfig( ); 21 | XMLFile getConfigXMLFile( ); 22 | }; 23 | 24 | 25 | class XMLConfigurableWithPath : public XMLConfigurable { 26 | public: 27 | 28 | inline void setConfigFilePath( const DLString & ); 29 | 30 | virtual DLFile getConfigFile( ) const; 31 | protected: 32 | 33 | DLString configFilePath; 34 | }; 35 | 36 | void XMLConfigurableWithPath::setConfigFilePath( const DLString &path ) 37 | { 38 | configFilePath = path; 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /libdreamland/io/xmlloader.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlloader.h,v 1.1.2.6.6.5 2010-09-01 08:21:11 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | #ifndef __XMLLOADER_H__ 6 | #define __XMLLOADER_H__ 7 | 8 | #include "dlstring.h" 9 | 10 | class XMLVariable; 11 | 12 | class XMLLoader { 13 | public: 14 | virtual ~XMLLoader( ); 15 | virtual DLString getTablePath( ) const = 0; 16 | virtual DLString getTableName( ) const = 0; 17 | virtual DLString getNodeName( ) const = 0; 18 | 19 | bool loadXML( XMLVariable *, const DLString &, bool fIgnoreNotFound = false ) const; 20 | bool saveXML( const XMLVariable *, const DLString &, bool fSafe = false ) const; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /libdreamland/io/xmltableelement.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmltableelement.cpp,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | #include "xmltableelement.h" 6 | 7 | /*------------------------------------------------------------------------- 8 | * XMLTableElement 9 | *------------------------------------------------------------------------*/ 10 | void XMLTableElement::loaded( ) 11 | { 12 | } 13 | 14 | void XMLTableElement::unloaded( ) 15 | { 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /libdreamland/io/xmltableelement.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmltableelement.h,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | #ifndef __XMLTABLEELEMENT_H__ 6 | #define __XMLTABLEELEMENT_H__ 7 | 8 | #include "xmlpolymorphvariable.h" 9 | 10 | class XMLTableElement : public virtual XMLPolymorphVariable { 11 | public: 12 | typedef ::Pointer Pointer; 13 | 14 | virtual void loaded( ); 15 | virtual void unloaded( ); 16 | 17 | virtual const DLString & getName( ) const = 0; 18 | virtual void setName( const DLString & ) = 0; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /libdreamland/io/xmltableloader.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmltableloader.h,v 1.1.2.3 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | #ifndef XMLTABLELOADER_H 6 | #define XMLTABLELOADER_H 7 | 8 | #include 9 | 10 | #include "xmltableelement.h" 11 | 12 | /* 13 | * XMLTableLoader 14 | */ 15 | class XMLTableLoader { 16 | public: 17 | typedef list LoadedList; 18 | 19 | virtual ~XMLTableLoader( ); 20 | 21 | virtual DLString getTablePath( ) const = 0; 22 | virtual DLString getTableName( ) const = 0; 23 | virtual DLString getNodeName( ) const = 0; 24 | 25 | void readAll( bool fVerbose = false ); 26 | void saveAll( bool fVerbose = false ); 27 | void loadAll( ); 28 | void unloadAll( ); 29 | 30 | inline const LoadedList & getElements( ) const 31 | { 32 | return elements; 33 | } 34 | 35 | protected: 36 | LoadedList elements; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /libdreamland/l10n/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2007 3 | # 4 | noinst_LTLIBRARIES = libl10n.la 5 | 6 | INCLUDES = \ 7 | -I$(top_builddir) \ 8 | -I$(srcdir) \ 9 | -I$(srcdir)/../xml \ 10 | -I$(srcdir)/../lang \ 11 | -I$(srcdir)/../util 12 | 13 | AM_CPPFLAGS = -Wall 14 | 15 | libl10n_la_SOURCES = \ 16 | grammar_entities.cpp \ 17 | noun.cpp \ 18 | nounholder.cpp \ 19 | verb.cpp \ 20 | pronouns.cpp \ 21 | ru_pronouns.cpp \ 22 | flexer.cpp \ 23 | russianstring.cpp \ 24 | xmlrussianstring.cpp 25 | 26 | -------------------------------------------------------------------------------- /libdreamland/l10n/adjective.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: adjective.cpp,v 1.1.2.3 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #include "grammar_entities_impl.h" 6 | #include "adjective.h" 7 | #include "noun.h" 8 | #include "flexer.h" 9 | 10 | using namespace Grammar; 11 | 12 | Adjective::~Adjective() 13 | { 14 | } 15 | 16 | DLString Adjective::decline(const Noun &who, const Case &c) const 17 | { 18 | return decline(who.getMultiGender(), c); 19 | } 20 | 21 | DLString Adjective::decline(const Case &c, const MultiGender &mg) const 22 | { 23 | int part_num = mg * CASE_MAX + c + 1; 24 | return Flexer::flex(getFullForm(), part_num); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /libdreamland/l10n/adjective.h: -------------------------------------------------------------------------------- 1 | /* $Id: adjective.h,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #ifndef L10N_ADJECTIVE_H 6 | #define L10N_ADJECTIVE_H 7 | 8 | #include "dlstring.h" 9 | #include "grammar_entities.h" 10 | 11 | namespace Grammar { 12 | 13 | class Noun; 14 | 15 | class Adjective { 16 | public: 17 | virtual ~Adjective(); 18 | 19 | virtual const DLString & getFullForm() const = 0; 20 | 21 | DLString decline(const Noun &who, const Case &c) const; 22 | DLString decline(const Case &c, const MultiGender &mg = MultiGender::MASCULINE) const; 23 | }; 24 | 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /libdreamland/l10n/flexer.h: -------------------------------------------------------------------------------- 1 | /* $Id: flexer.h,v 1.1.2.2 2009/10/11 18:35:36 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #ifndef L10N_FLEXER_H 6 | #define L10N_FLEXER_H 7 | 8 | #include "dlstring.h" 9 | 10 | namespace Grammar { 11 | 12 | class Flexer { 13 | public: 14 | 15 | static DLString getRoot(const DLString &str); 16 | static DLString getFlexion(const DLString &str, int num); 17 | static DLString flex(const DLString &str, int num); 18 | 19 | static bool isWordDelimiter(char c); 20 | static bool isFlexDelimiter(char c); 21 | 22 | private: 23 | static const char FLEX_DELIMITER; 24 | enum { 25 | PHASE_NONE, 26 | PHASE_COPYTOBUF, 27 | PHASE_FINDNEED, 28 | PHASE_COPYEND, 29 | PHASE_FINDNEXT, 30 | }; 31 | static DLString flexAux(const DLString &str, int part_num, bool fNeedRoot, bool fNeedEnding); 32 | }; 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /libdreamland/l10n/grammar_entities.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: grammar_entities.cpp,v 1.1.2.3 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #include "grammar_entities.h" 6 | #include "grammar_entities_impl.h" 7 | 8 | -------------------------------------------------------------------------------- /libdreamland/l10n/noun.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: noun.cpp,v 1.1.2.7 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #include "grammar_entities_impl.h" 6 | #include "noun.h" 7 | #include "flexer.h" 8 | 9 | using namespace Grammar; 10 | 11 | /*---------------------------------------------------------------------------- 12 | * Noun 13 | *--------------------------------------------------------------------------*/ 14 | Noun::~Noun() 15 | { 16 | } 17 | 18 | DLString Noun::normal() const 19 | { 20 | return decline(Case::NOMINATIVE); 21 | } 22 | 23 | MultiGender Noun::getMultiGender() const 24 | { 25 | return MultiGender(getGender(), getNumber()); 26 | } 27 | 28 | /*---------------------------------------------------------------------------- 29 | * FlexedNoun 30 | *--------------------------------------------------------------------------*/ 31 | DLString FlexedNoun::decline(const Case &c) const 32 | { 33 | return Flexer::flex(getFullForm(), c + 1); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /libdreamland/l10n/noun.h: -------------------------------------------------------------------------------- 1 | /* $Id: noun.h,v 1.1.2.5 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #ifndef L10N_NOUN_H 6 | #define L10N_NOUN_H 7 | 8 | #include "dlstring.h" 9 | #include "dlobject.h" 10 | #include "grammar_entities.h" 11 | 12 | namespace Grammar { 13 | 14 | class Noun : public virtual DLObject { 15 | public: 16 | typedef ::Pointer Pointer; 17 | 18 | virtual ~Noun(); 19 | 20 | virtual Gender getGender() const = 0; 21 | virtual Number getNumber() const = 0; 22 | virtual DLString decline(const Case &c) const = 0; 23 | 24 | DLString normal() const; 25 | MultiGender getMultiGender() const; 26 | }; 27 | 28 | class FlexedNoun : public Noun { 29 | public: 30 | virtual const DLString &getFullForm() const = 0; 31 | virtual DLString decline(const Case &c) const; 32 | }; 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /libdreamland/l10n/nounholder.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: nounholder.cpp,v 1.1.2.3 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #include "nounholder.h" 6 | 7 | using namespace Grammar; 8 | 9 | NounHolder::~NounHolder() 10 | { 11 | } 12 | 13 | void NounHolder::updateCachedNoun( ) 14 | { 15 | } 16 | 17 | -------------------------------------------------------------------------------- /libdreamland/l10n/nounholder.h: -------------------------------------------------------------------------------- 1 | /* $Id: nounholder.h,v 1.1.2.4 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #ifndef L10N_NOUNHOLDER_H 6 | #define L10N_NOUNHOLDER_H 7 | 8 | #include "pointer.h" 9 | #include "dlobject.h" 10 | 11 | namespace Grammar { 12 | 13 | class Noun; 14 | 15 | class NounHolder : public virtual DLObject { 16 | public: 17 | typedef ::Pointer NounPointer; 18 | 19 | virtual ~NounHolder(); 20 | virtual NounPointer toNoun(const DLObject *forWhom = 0, int flags = 0) const = 0; 21 | virtual void updateCachedNoun( ); 22 | }; 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /libdreamland/l10n/pronouns.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/l10n/pronouns.h -------------------------------------------------------------------------------- /libdreamland/l10n/ru_pronouns.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/l10n/ru_pronouns.cpp -------------------------------------------------------------------------------- /libdreamland/l10n/ru_pronouns.h: -------------------------------------------------------------------------------- 1 | /* $Id: ru_pronouns.h,v 1.1.2.3 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #ifndef RU_PRONOUNS_H 6 | #define RU_PRONOUNS_H 7 | 8 | #include "pronouns.h" 9 | 10 | namespace Grammar { 11 | 12 | extern const IndefinitePronoun::AnimacyCases ru_indefinite_pronouns; 13 | extern const PersonalPronoun::Persons ru_personal_pronouns; 14 | extern const PosessivePronoun::PosessionGenders ru_posessive_pronouns; 15 | 16 | extern const IndefiniteNoun::Pointer somebody; 17 | extern const IndefiniteNoun::Pointer something; 18 | 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /libdreamland/l10n/russianstring.h: -------------------------------------------------------------------------------- 1 | /* $Id: russianstring.h,v 1.1.2.6 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #ifndef RUSSIANSTRING_H 6 | #define RUSSIANSTRING_H 7 | 8 | #include "noun.h" 9 | #include "nounholder.h" 10 | 11 | class RussianString : public Grammar::NounHolder, 12 | public Grammar::FlexedNoun 13 | { 14 | public: 15 | typedef ::Pointer Pointer; 16 | 17 | RussianString(); 18 | RussianString(const DLString &ff); 19 | RussianString(const DLString &ff, const Grammar::MultiGender &mg); 20 | 21 | virtual DLString decline(const Grammar::Case &c) const; 22 | virtual Grammar::Gender getGender() const; 23 | virtual Grammar::Number getNumber() const; 24 | virtual const DLString &getFullForm() const; 25 | virtual NounPointer toNoun(const DLObject *forWhom = 0, int flags = 0) const; 26 | 27 | void setFullForm(const DLString &ff); 28 | void setGender(const Grammar::MultiGender &mg); 29 | 30 | protected: 31 | void fillCachedForms(); 32 | 33 | vector cachedForms; 34 | DLString fullForm; 35 | Grammar::MultiGender mg; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /libdreamland/l10n/verb.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: verb.cpp,v 1.1.2.3 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #include "grammar_entities_impl.h" 6 | #include "verb.h" 7 | #include "noun.h" 8 | #include "flexer.h" 9 | 10 | using namespace Grammar; 11 | 12 | Verb::~Verb() 13 | { 14 | } 15 | 16 | DLString Verb::conjugate(const Noun &who) const 17 | { 18 | return conjugate(who.getMultiGender()); 19 | } 20 | 21 | DLString Verb::conjugate(const MultiGender &mg) const 22 | { 23 | return getRoot() + Flexer::flex(getEndings(), mg + 1); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /libdreamland/l10n/verb.h: -------------------------------------------------------------------------------- 1 | /* $Id: verb.h,v 1.1.2.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #ifndef L10N_VERB_H 6 | #define L10N_VERB_H 7 | 8 | #include "dlstring.h" 9 | #include "grammar_entities.h" 10 | 11 | namespace Grammar { 12 | 13 | class Noun; 14 | 15 | class Verb { 16 | public: 17 | 18 | virtual ~Verb(); 19 | 20 | virtual const DLString & getRoot() const = 0; 21 | virtual const DLString & getEndings() const = 0; 22 | 23 | DLString conjugate(const Noun &who) const; 24 | DLString conjugate(const MultiGender &mg) const; 25 | }; 26 | 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libdreamland/l10n/xmlrussianstring.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlrussianstring.cpp,v 1.1.2.5 2009/11/08 17:33:28 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #include 6 | #include "grammar_entities_impl.h" 7 | #include "xmlrussianstring.h" 8 | 9 | using namespace Grammar; 10 | 11 | const DLString XMLRussianString::ATTRIBUTE_GRAMMAR = "mg"; 12 | 13 | void XMLRussianString::fromXML( const XMLNode::Pointer& parent ) throw( ExceptionBadType ) 14 | { 15 | XMLNode::Pointer node = parent->getFirstNode( ); 16 | 17 | if (parent->hasAttribute( ATTRIBUTE_GRAMMAR )) 18 | mg = MultiGender(parent->getAttribute( ATTRIBUTE_GRAMMAR ).c_str()); 19 | 20 | if (!node.isEmpty( )) 21 | setFullForm(node->getCData( )); 22 | } 23 | 24 | bool XMLRussianString::toXML( XMLNode::Pointer& parent ) const 25 | { 26 | XMLNode::Pointer node( NEW ); 27 | 28 | node->setType( XMLNode::XML_TEXT ); 29 | node->setCData( getFullForm() ); 30 | 31 | if (mg != MultiGender::MASCULINE) 32 | parent->insertAttribute( ATTRIBUTE_GRAMMAR, mg.toString() ); 33 | 34 | parent->appendChild( node ); 35 | return true; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /libdreamland/l10n/xmlrussianstring.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlrussianstring.h,v 1.1.2.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2007 4 | */ 5 | #ifndef XMLRUSSIANSTRING_H 6 | #define XMLRUSSIANSTRING_H 7 | 8 | #include "xmlnode.h" 9 | #include "russianstring.h" 10 | 11 | class XMLRussianString : public RussianString { 12 | public: 13 | static const DLString ATTRIBUTE_GRAMMAR; 14 | 15 | bool toXML( XMLNode::Pointer& node ) const; 16 | void fromXML( const XMLNode::Pointer& node ) throw( ExceptionBadType ); 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /libdreamland/lang/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2003 3 | # NoFate, 2002 4 | noinst_LTLIBRARIES = liblang.la 5 | 6 | INCLUDES = \ 7 | -I$(top_builddir) \ 8 | -I$(srcdir) \ 9 | -I$(srcdir)/../util \ 10 | -I$(srcdir)/../l10n 11 | 12 | AM_CPPFLAGS = -Wall 13 | 14 | liblang_la_SOURCES = \ 15 | boolean.cpp \ 16 | byte.cpp \ 17 | char.cpp \ 18 | dlobject.cpp \ 19 | dlstring.cpp \ 20 | exception.cpp \ 21 | integer.cpp \ 22 | long.cpp \ 23 | longlong.cpp \ 24 | short.cpp \ 25 | stringset.cpp 26 | 27 | -------------------------------------------------------------------------------- /libdreamland/lang/algo.h: -------------------------------------------------------------------------------- 1 | /* $Id: algo.h,v 1.1.4.1.6.1 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | 6 | #ifndef __ALGO_H__ 7 | #define __ALGO_H__ 8 | 9 | // MOC_SKIP_BEGIN 10 | 11 | template 12 | struct Conv { 13 | typedef char (&Small); 14 | typedef char (&Big)[2]; 15 | 16 | static Small cast(...); 17 | static Big cast(T *); 18 | static F *makeF(); 19 | 20 | enum { exists = (sizeof(cast(makeF())) == sizeof(Big)) }; 21 | }; 22 | 23 | template struct Choice; 24 | template struct Choice : public V1 { }; 25 | template struct Choice : public V2 { }; 26 | 27 | // MOC_SKIP_END 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /libdreamland/lang/boolean.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: boolean.cpp,v 1.2.34.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /*************************************************************************** 6 | boolean.cpp - description 7 | ------------------- 8 | begin : Fri Oct 26 2001 9 | copyright : (C) 2001 by Igor S. Petrenko 10 | email : nofate@europe.com 11 | ***************************************************************************/ 12 | 13 | #include "boolean.h" 14 | 15 | const DLString Boolean::TYPE = "Boolean"; 16 | const DLString Boolean::VAL_TRUE = "true"; 17 | const DLString Boolean::VAL_FALSE = "false"; 18 | 19 | void Boolean::fromString( const DLString & value ) throw( ExceptionBadType ) 20 | { 21 | if( value == VAL_TRUE ) 22 | this->value = true; 23 | else if( value == VAL_FALSE ) 24 | this->value = false; 25 | else 26 | throw ExceptionBadType( TYPE, value ); 27 | } 28 | 29 | DLString Boolean::toString( ) const throw( ) 30 | { 31 | return value ? VAL_TRUE : VAL_FALSE; 32 | } 33 | -------------------------------------------------------------------------------- /libdreamland/lang/boolean.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/boolean.h -------------------------------------------------------------------------------- /libdreamland/lang/byte.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: byte.cpp,v 1.3.34.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /*************************************************************************** 6 | byte.cpp - description 7 | ------------------- 8 | begin : Fri Oct 26 2001 9 | copyright : (C) 2001 by Igor S. Petrenko 10 | email : nofate@europe.com 11 | ***************************************************************************/ 12 | 13 | #include 14 | 15 | #include "byte.h" 16 | 17 | const DLString Byte::TYPE = "Byte"; 18 | 19 | 20 | void Byte::fromString( const DLString & value ) throw( ExceptionBadType ) 21 | { 22 | std::basic_istringstream s( value.c_str( ) ); 23 | unsigned char i; 24 | 25 | s >> i; 26 | 27 | if( s ) 28 | { 29 | this->value = i; 30 | return; 31 | } 32 | throw ExceptionBadType( TYPE, value ); 33 | } 34 | 35 | DLString Byte::toString( ) const throw( ) 36 | { 37 | std::basic_ostringstream buf; 38 | 39 | buf << value; 40 | return buf.str( ); 41 | } 42 | -------------------------------------------------------------------------------- /libdreamland/lang/byte.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/byte.h -------------------------------------------------------------------------------- /libdreamland/lang/char.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/char.h -------------------------------------------------------------------------------- /libdreamland/lang/dllist.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/dllist.h -------------------------------------------------------------------------------- /libdreamland/lang/dlmap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/dlmap.h -------------------------------------------------------------------------------- /libdreamland/lang/dlobject.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* $Id: dlobject.cpp,v 1.1.6.2 2009/10/11 18:35:37 rufina Exp $ 3 | * 4 | * ruffina, Dream Land, 2004 5 | */ 6 | #include "dlobject.h" 7 | 8 | DLObject::~DLObject( ) 9 | { 10 | } 11 | -------------------------------------------------------------------------------- /libdreamland/lang/dlobject.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/dlobject.h -------------------------------------------------------------------------------- /libdreamland/lang/dlstring.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/dlstring.h -------------------------------------------------------------------------------- /libdreamland/lang/exception.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/exception.h -------------------------------------------------------------------------------- /libdreamland/lang/exceptionbadtype.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/exceptionbadtype.h -------------------------------------------------------------------------------- /libdreamland/lang/fileformatexception.h: -------------------------------------------------------------------------------- 1 | /* $Id: fileformatexception.h,v 1.1.2.3.28.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #ifndef FILEFORMATEXCEPTION_H 7 | #define FILEFORMATEXCEPTION_H 8 | 9 | #include 10 | #include 11 | 12 | #include "exception.h" 13 | 14 | class FileFormatException : public Exception { 15 | public: 16 | FileFormatException( const char * fmt, ... ) throw( ); 17 | virtual ~FileFormatException( ) throw( ); 18 | }; 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /libdreamland/lang/integer.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: integer.cpp,v 1.9.34.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /*************************************************************************** 6 | integer.cpp - description 7 | ------------------- 8 | begin : Mon Oct 29 2001 9 | copyright : (C) 2001 by Igor S. Petrenko 10 | email : nofate@europe.com 11 | ***************************************************************************/ 12 | 13 | #include 14 | 15 | #include "integer.h" 16 | 17 | const DLString Integer::TYPE = "Integer"; 18 | 19 | 20 | void Integer::fromString( const DLString & value ) throw( ExceptionBadType ) 21 | { 22 | std::basic_istringstream s( value.c_str( ) ); 23 | int i; 24 | 25 | s >> i; 26 | 27 | if( s ) 28 | { 29 | this->value = i; 30 | return; 31 | } 32 | throw ExceptionBadType( TYPE, value ); 33 | } 34 | 35 | DLString Integer::toString( ) const throw( ) 36 | { 37 | std::basic_ostringstream buf; 38 | 39 | buf << value; 40 | return buf.str( ); 41 | } 42 | -------------------------------------------------------------------------------- /libdreamland/lang/integer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/integer.h -------------------------------------------------------------------------------- /libdreamland/lang/long.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: long.cpp,v 1.1.34.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /*************************************************************************** 6 | long.cpp - description 7 | ------------------- 8 | begin : Thu Nov 1 2001 9 | copyright : (C) 2001 by Igor S. Petrenko 10 | email : nofate@europe.com 11 | ***************************************************************************/ 12 | 13 | #include 14 | 15 | #include "long.h" 16 | 17 | const DLString Long::TYPE = "Long"; 18 | 19 | 20 | void Long::fromString( const DLString & str ) throw( ExceptionBadType ) 21 | { 22 | std::basic_istringstream s( str.c_str( ) ); 23 | long i; 24 | 25 | s >> i; 26 | 27 | if( s ) 28 | { 29 | this->value = i; 30 | return; 31 | } 32 | throw ExceptionBadType( TYPE, str ); 33 | } 34 | 35 | DLString Long::toString( ) const throw( ) 36 | { 37 | std::basic_ostringstream buf; 38 | 39 | buf << value; 40 | return buf.str( ); 41 | } 42 | -------------------------------------------------------------------------------- /libdreamland/lang/long.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/long.h -------------------------------------------------------------------------------- /libdreamland/lang/longlong.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: longlong.cpp,v 1.1.34.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /*************************************************************************** 6 | longlong.cpp - description 7 | ------------------- 8 | begin : Thu Nov 1 2001 9 | copyright : (C) 2001 by Igor S. Petrenko 10 | email : nofate@europe.com 11 | ***************************************************************************/ 12 | 13 | #include 14 | 15 | #include "longlong.h" 16 | 17 | const DLString LongLong::TYPE = "LongLong"; 18 | 19 | 20 | void LongLong::fromString( const DLString & str ) throw( ExceptionBadType ) 21 | { 22 | std::basic_istringstream s( str.c_str( ) ); 23 | long long i; 24 | 25 | s >> i; 26 | 27 | if( s ) 28 | { 29 | this->value = i; 30 | return; 31 | } 32 | throw ExceptionBadType( TYPE, str ); 33 | } 34 | 35 | DLString LongLong::toString( ) const throw( ) 36 | { 37 | std::basic_ostringstream buf; 38 | 39 | buf << value; 40 | return buf.str( ); 41 | } 42 | -------------------------------------------------------------------------------- /libdreamland/lang/longlong.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/longlong.h -------------------------------------------------------------------------------- /libdreamland/lang/mallocexception.h: -------------------------------------------------------------------------------- 1 | /* $Id: mallocexception.h,v 1.1.4.1.10.1 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | 6 | #ifndef MALLOCEXCEPTION_H 7 | #define MALLOCEXCEPTION_H 8 | 9 | #include "exception.h" 10 | #include "dlstring.h" 11 | 12 | class MallocException : public Exception { 13 | public: 14 | MallocException( const DLString &msg, int count ) throw( ) 15 | : Exception( "Cannot allocate " + DLString(count) + " bytes for " + msg ) 16 | { 17 | } 18 | }; 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /libdreamland/lang/pointer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/pointer.h -------------------------------------------------------------------------------- /libdreamland/lang/short.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: short.cpp,v 1.2.34.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | /*************************************************************************** 6 | short.cpp - description 7 | ------------------- 8 | begin : Mon Oct 29 2001 9 | copyright : (C) 2001 by Igor S. Petrenko 10 | email : nofate@europe.com 11 | ***************************************************************************/ 12 | 13 | #include 14 | 15 | #include "short.h" 16 | 17 | const DLString Short::TYPE = "Short"; 18 | 19 | 20 | void Short::fromString( const DLString & str ) throw( ExceptionBadType ) 21 | { 22 | std::basic_istringstream s( str.c_str( ) ); 23 | short i; 24 | 25 | s >> i; 26 | 27 | if( s ) 28 | { 29 | this->value = i; 30 | return; 31 | } 32 | throw ExceptionBadType( TYPE, str ); 33 | } 34 | 35 | DLString Short::toString( ) const throw( ) 36 | { 37 | std::basic_ostringstream buf; 38 | 39 | buf << value; 40 | return buf.str( ); 41 | } 42 | -------------------------------------------------------------------------------- /libdreamland/lang/short.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/lang/short.h -------------------------------------------------------------------------------- /libdreamland/lang/stringset.h: -------------------------------------------------------------------------------- 1 | /* $Id: stringset.h,v 1.1.2.3 2011-04-17 19:37:54 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | #ifndef STRINGSET_H 6 | #define STRINGSET_H 7 | 8 | #include 9 | #include "dlstring.h" 10 | 11 | class StringSet : public std::set { 12 | public: 13 | DLString toString( ) const; 14 | StringSet & fromString( const DLString & ); 15 | }; 16 | 17 | class NumberSet : public std::set { 18 | public: 19 | void fromStringSet( const StringSet & ); 20 | StringSet toStringSet( ) const; 21 | }; 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /libdreamland/moc/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2003 3 | # based on: NoFate, 2002 4 | bin_PROGRAMS = moc 5 | 6 | AM_YFLAGS = -d 7 | 8 | AM_CPPFLAGS = -fno-exceptions -fno-rtti -Wall 9 | 10 | moc_SOURCES = \ 11 | generate.cpp \ 12 | main.cpp \ 13 | syn.y++ \ 14 | lex.l++ \ 15 | system.cpp 16 | 17 | CLEANFILES = syn.c++ lex.c++ 18 | -------------------------------------------------------------------------------- /libdreamland/moc/acinclude.m4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/moc/acinclude.m4 -------------------------------------------------------------------------------- /libdreamland/moc/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | aclocal 4 | automake --foreign 5 | autoconf 6 | touch stamp-h.in 7 | 8 | -------------------------------------------------------------------------------- /libdreamland/moc/configure.ac: -------------------------------------------------------------------------------- 1 | dnl ruffina, 2006 2 | dnl Process this file with autoconf to produce a configure script. 3 | 4 | AC_INIT([dl-moc], [0.1]) 5 | AC_CONFIG_SRCDIR(Makefile.am) 6 | AC_CONFIG_AUX_DIR(../../admin) 7 | 8 | AC_CANONICAL_SYSTEM 9 | 10 | AC_PREFIX_DEFAULT(`pwd`) 11 | AM_INIT_AUTOMAKE 12 | 13 | AM_DISABLE_SHARED 14 | AM_PROG_LIBTOOL 15 | 16 | dnl Checks for programs. 17 | 18 | AC_EXEEXT 19 | AC_PROG_CC 20 | AC_PROG_CXX 21 | 22 | AC_LANG_CPLUSPLUS 23 | 24 | AM_PROG_LEX 25 | AC_PROG_YACC 26 | 27 | dnl Checks for header files. 28 | AC_HEADER_STDC 29 | 30 | AC_OUTPUT( Makefile ) 31 | 32 | -------------------------------------------------------------------------------- /libdreamland/moc/generate.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/moc/generate.cpp -------------------------------------------------------------------------------- /libdreamland/moc/mocfunctional.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | mocfunctional.h - description 3 | ------------------- 4 | begin : Fri Apr 13 2001 5 | copyright : (C) 2001 by nofate 6 | email : nofate@europe.com 7 | ***************************************************************************/ 8 | 9 | #ifndef MOCFUNCTIONAL_H 10 | #define MOCFUNCTIONAL_H 11 | 12 | template 13 | inline T toList( string str, char c = ' ' ) 14 | { 15 | T list; 16 | 17 | if( str.empty( ) ) 18 | { 19 | list.push_back( "./" ); 20 | return list; 21 | } 22 | 23 | if( str[str.length( ) - 1] != c ) 24 | { 25 | str += c; 26 | } 27 | string::size_type opos = str.find_first_not_of( c ); 28 | for( string::size_type pos = str.find( c, opos ); 29 | pos != string::npos && opos != string::npos ; 30 | pos = str.find( c, opos ) ) 31 | { 32 | list.push_back( str.substr( opos, pos - opos ) ); 33 | opos = str.find_first_not_of( c, pos + 1 ); 34 | } 35 | return list; 36 | } 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /libdreamland/plugin/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2003 3 | # based on: NoFate, 2002 4 | noinst_LTLIBRARIES = libplugin.la 5 | 6 | INCLUDES = \ 7 | -I$(top_builddir) \ 8 | -I$(srcdir) \ 9 | -I$(srcdir)/../xml \ 10 | -I$(srcdir)/../lang \ 11 | -I$(srcdir)/../alloc \ 12 | -I$(srcdir)/../io \ 13 | -I$(srcdir)/../util 14 | 15 | AM_CPPFLAGS = -Wall 16 | 17 | libplugin_la_SOURCES = \ 18 | sharedobject.cpp \ 19 | initializer.cpp \ 20 | pluginmanager.cpp 21 | 22 | libplugin_la_MOC = \ 23 | sharedobject.h 24 | -------------------------------------------------------------------------------- /libdreamland/plugin/classselfregistratorplugin.h: -------------------------------------------------------------------------------- 1 | /* $Id: classselfregistratorplugin.h,v 1.1.2.3 2010-09-01 21:20:47 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2008 4 | */ 5 | 6 | #ifndef __CLASSSELFREGISTRATORPLUGIN_H__ 7 | #define __CLASSSELFREGISTRATORPLUGIN_H__ 8 | 9 | template 10 | class ClassSelfRegistratorPlugin : 11 | public virtual XMLPolymorphVariable, 12 | public Class::ClassRegistrator, 13 | public virtual Plugin 14 | { 15 | public: 16 | typedef ::Pointer Pointer; 17 | 18 | ClassSelfRegistratorPlugin() { 19 | typeName = tn; 20 | } 21 | 22 | virtual AllocateClass::Pointer clone( ) const { 23 | return Pointer(this); 24 | } 25 | virtual const DLString & getType( ) const { 26 | return typeName; 27 | } 28 | protected: 29 | virtual void initialization( ) 30 | { 31 | Class::regClass(typeName, Pointer(this)); 32 | } 33 | virtual void destruction( ) 34 | { 35 | Class::unRegClass(typeName); 36 | } 37 | private: 38 | DLString typeName; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /libdreamland/plugin/initializer.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: initializer.cpp,v 1.1.2.3 2009/11/02 13:48:11 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2008 4 | */ 5 | #include 6 | #include "initializer.h" 7 | #include "sharedobject.h" 8 | 9 | Initializer::Initializer(int prio = INITPRIO_NORMAL) 10 | { 11 | if(!SharedObject::current) 12 | abort(); 13 | 14 | priority = prio; 15 | 16 | SharedObject::current->addInit(this); 17 | } 18 | 19 | Initializer::~Initializer() 20 | { 21 | if(!SharedObject::current) 22 | abort(); 23 | 24 | SharedObject::current->delInit(this); 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /libdreamland/plugin/initializer.h: -------------------------------------------------------------------------------- 1 | /* $Id: initializer.h,v 1.1.2.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2008 4 | */ 5 | 6 | #ifndef __INITIALIZER_H__ 7 | #define __INITIALIZER_H__ 8 | 9 | #define INITPRIO_NORMAL 100 10 | 11 | class SharedObject; 12 | 13 | class Initializer { 14 | public: 15 | Initializer(int prio); 16 | virtual ~Initializer( ); 17 | 18 | virtual void init(SharedObject *) = 0; 19 | 20 | int getPriority( ) const { 21 | return priority; 22 | } 23 | private: 24 | int priority; 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /libdreamland/plugin/plugin.h: -------------------------------------------------------------------------------- 1 | /* $Id: plugin.h,v 1.12.2.2.18.4 2010-09-01 21:20:47 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2005 4 | * based on idea by NoFate, 2002 5 | */ 6 | #ifndef __PLUGIN_H__ 7 | #define __PLUGIN_H__ 8 | 9 | #include "dlobject.h" 10 | 11 | class Plugin : public virtual DLObject { 12 | friend class SharedObject; 13 | public: 14 | 15 | typedef ::Pointer Pointer; 16 | 17 | template 18 | static inline void registerPlugin( PlugList& ppl ) 19 | { 20 | ppl.push_back( static_cast( new PlugType( ) ) ); 21 | } 22 | 23 | protected: 24 | virtual void initialization( ) = 0; 25 | virtual void destruction( ) = 0; 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libdreamland/plugin/plugininitializer.h: -------------------------------------------------------------------------------- 1 | /* $Id: plugininitializer.h,v 1.1.2.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2008 4 | */ 5 | 6 | #ifndef __PLUGININITIALIZER_H__ 7 | #define __PLUGININITIALIZER_H__ 8 | 9 | #include "plugin.h" 10 | #include "initializer.h" 11 | #include "sharedobject.h" 12 | 13 | #define INITPRIO_PLUGINS 50 14 | 15 | template 16 | class PluginInitializer : public Initializer { 17 | public: 18 | PluginInitializer(int prio = INITPRIO_PLUGINS) : Initializer(prio) { 19 | } 20 | virtual ~PluginInitializer( ) { 21 | } 22 | 23 | virtual void init(SharedObject *so) { 24 | so->plugins.push_back( static_cast( new P( ) ) ); 25 | } 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libdreamland/plugin/so.h: -------------------------------------------------------------------------------- 1 | /* $Id: so.h,v 1.4.2.1.18.1 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2005 4 | */ 5 | #ifndef __SO_H__ 6 | #define __SO_H__ 7 | 8 | /* deprecated api support */ 9 | 10 | #include "sharedobject.h" 11 | typedef SharedObject SO; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /libdreamland/process/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2008 3 | # 4 | noinst_LTLIBRARIES = libprocess.la 5 | 6 | INCLUDES = \ 7 | -I$(top_builddir) \ 8 | -I$(srcdir) \ 9 | -I$(srcdir)/../lang \ 10 | -I$(srcdir)/../util \ 11 | -I$(srcdir)/../xml \ 12 | -I$(srcdir)/../l10n 13 | 14 | AM_CPPFLAGS = -Wall 15 | 16 | libprocess_la_SOURCES = \ 17 | thread.cpp \ 18 | mutex.cpp \ 19 | process.cpp \ 20 | monitor.cpp 21 | 22 | -------------------------------------------------------------------------------- /libdreamland/process/monitor.h: -------------------------------------------------------------------------------- 1 | /* $Id: monitor.h,v 1.1.2.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | 6 | #ifndef __MONITOR_H__ 7 | #define __MONITOR_H__ 8 | 9 | #include "mutex.h" 10 | 11 | class Monitor : public virtual DLObject 12 | { 13 | public: 14 | Monitor(Mutex *mux); 15 | virtual ~Monitor(); 16 | 17 | void wait(); 18 | 19 | void notify(); 20 | void notifyAll(); 21 | 22 | #ifndef __MINGW32__ 23 | pthread_cond_t cnd; 24 | #else 25 | HANDLE evt; 26 | #endif 27 | Mutex *mux; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libdreamland/process/mutex.h: -------------------------------------------------------------------------------- 1 | /* $Id: mutex.h,v 1.1.2.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | 6 | #ifndef __MUTEX_H__ 7 | #define __MUTEX_H__ 8 | 9 | #ifndef __MINGW32__ 10 | #include 11 | #else 12 | #include 13 | #endif 14 | 15 | 16 | #include "dlobject.h" 17 | 18 | class Mutex : public virtual DLObject 19 | { 20 | friend class Monitor; 21 | public: 22 | Mutex(); 23 | virtual ~Mutex(); 24 | 25 | void lock(); 26 | void unlock(); 27 | 28 | private: 29 | #ifndef __MINGW32__ 30 | pthread_mutex_t mux; 31 | #else 32 | HANDLE mux; 33 | #endif 34 | }; 35 | 36 | #endif /* __MUTEX_H__ */ 37 | 38 | -------------------------------------------------------------------------------- /libdreamland/process/process.h: -------------------------------------------------------------------------------- 1 | /* $Id: process.h,v 1.1.2.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | 6 | #ifndef __PROCESS_H__ 7 | #define __PROCESS_H__ 8 | 9 | #include 10 | 11 | #include "mutex.h" 12 | #include "monitor.h" 13 | #include "thread.h" 14 | 15 | using namespace std; 16 | 17 | 18 | class ProcessManager : public virtual DLObject 19 | { 20 | public: 21 | typedef ::Pointer Pointer; 22 | 23 | struct RoundRobinElement { 24 | RoundRobinElement( ); 25 | virtual ~RoundRobinElement( ); 26 | 27 | void fromlist( ); 28 | void tolist(RoundRobinElement &l); 29 | 30 | void speenup( ); 31 | void yield( ); 32 | void speendown( ); 33 | 34 | virtual void getInfo(ostream &os); 35 | 36 | RoundRobinElement *next, *prev; 37 | Mutex mux; 38 | Monitor sync; 39 | }; 40 | 41 | public: 42 | ProcessManager( ); 43 | virtual ~ProcessManager( ); 44 | 45 | void yield(); 46 | 47 | static inline ProcessManager *getThis() { 48 | return thisClass; 49 | } 50 | 51 | RoundRobinElement running, stopped; 52 | private: 53 | static ProcessManager *thisClass; 54 | }; 55 | 56 | #endif /* __PROCESS_H__ */ 57 | -------------------------------------------------------------------------------- /libdreamland/process/thread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/process/thread.h -------------------------------------------------------------------------------- /libdreamland/regex/BUGS: -------------------------------------------------------------------------------- 1 | 2 | UNSIGNED char! 3 | -------------------------------------------------------------------------------- /libdreamland/regex/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2008 3 | # 4 | noinst_LTLIBRARIES = libregex.la 5 | 6 | libregex_la_SOURCES = regcomp.c regerror.c regexec.c regfree.c 7 | 8 | -------------------------------------------------------------------------------- /libdreamland/scheduler/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2003 3 | # 4 | noinst_LTLIBRARIES = libscheduler.la 5 | 6 | INCLUDES = \ 7 | -I$(top_builddir) \ 8 | -I$(srcdir) \ 9 | -I$(srcdir)/../xml \ 10 | -I$(srcdir)/../lang \ 11 | -I$(srcdir)/../util 12 | 13 | AM_CPPFLAGS = -Wall 14 | 15 | libscheduler_la_SOURCES = \ 16 | scheduler.cpp \ 17 | schedulerlist.cpp \ 18 | schedulerprioritymap.cpp \ 19 | schedulerqueue.cpp \ 20 | schedulertask.cpp 21 | 22 | -------------------------------------------------------------------------------- /libdreamland/scheduler/scheduler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/scheduler/scheduler.h -------------------------------------------------------------------------------- /libdreamland/scheduler/schedulerlist.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/scheduler/schedulerlist.h -------------------------------------------------------------------------------- /libdreamland/scheduler/schedulerprioritymap.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: schedulerprioritymap.cpp,v 1.1.4.1.10.3 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #include "schedulerprioritymap.h" 7 | #include "schedulerlist.h" 8 | #include "schedulertask.h" 9 | 10 | SchedulerPriorityMap::SchedulerPriorityMap( ) : priority( 0 ) 11 | { 12 | } 13 | 14 | void SchedulerPriorityMap::tick( ) 15 | { 16 | for (iterator i = begin( ); i != end( ); i++) { 17 | priority = i->first; 18 | i->second.tick( ); 19 | } 20 | 21 | priority = 0; 22 | } 23 | 24 | void SchedulerPriorityMap::slay( SchedulerTaskPointer& task ) 25 | { 26 | for (iterator i = begin( ); i != end( ); i++) 27 | i->second.slay( task ); 28 | } 29 | 30 | void SchedulerPriorityMap::slayInstance( SchedulerTaskPointer& task ) 31 | { 32 | for (iterator i = begin( ); i != end( ); i++) 33 | i->second.slayInstance( task ); 34 | } 35 | 36 | int SchedulerPriorityMap::getPriority( ) const 37 | { 38 | return priority; 39 | } 40 | -------------------------------------------------------------------------------- /libdreamland/scheduler/schedulerprioritymap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/scheduler/schedulerprioritymap.h -------------------------------------------------------------------------------- /libdreamland/scheduler/schedulerqueue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/scheduler/schedulerqueue.h -------------------------------------------------------------------------------- /libdreamland/scheduler/schedulertask.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: schedulertask.cpp,v 1.1.4.3 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #include "schedulertask.h" 7 | #include "schedulerprioritymap.h" 8 | 9 | void 10 | SchedulerTask::before( ) 11 | { 12 | } 13 | 14 | void 15 | SchedulerTask::run( ) 16 | { 17 | } 18 | 19 | void 20 | SchedulerTask::after( ) 21 | { 22 | } 23 | 24 | void SchedulerTask::putInto( SchedulerPriorityMapPointer& pv ) 25 | { 26 | (**pv)[getPriority( )].put( Pointer( this ) ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /libdreamland/scheduler/schedulertask.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/scheduler/schedulertask.h -------------------------------------------------------------------------------- /libdreamland/util/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # ruffina, DreamLand, 2003 3 | # NoFate, 2002 4 | noinst_LTLIBRARIES = libutil.la 5 | 6 | AM_CPPFLAGS = -Wall 7 | 8 | INCLUDES = \ 9 | -I$(srcdir)/../lang \ 10 | -I$(srcdir)/../regex \ 11 | -I$(srcdir)/../l10n \ 12 | -I$(top_srcdir) 13 | 14 | AM_LFLAGS = -olex.yy.c 15 | #-S$(srcdir)/../../admin/flex.skl 16 | 17 | libutil_la_SOURCES = \ 18 | date.cpp \ 19 | logstream.cpp \ 20 | lastlogstream.cpp \ 21 | parsedate.l++ \ 22 | regexp.cpp \ 23 | iconvmap.cpp \ 24 | dl_match.cpp \ 25 | dl_math.cpp \ 26 | dl_strings.cpp \ 27 | dl_ctype.cpp \ 28 | profiler.cpp \ 29 | timer.cpp 30 | 31 | 32 | CLEANFILES = parsedate.c++ 33 | -------------------------------------------------------------------------------- /libdreamland/util/date.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/util/date.h -------------------------------------------------------------------------------- /libdreamland/util/dateparser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/util/dateparser.h -------------------------------------------------------------------------------- /libdreamland/util/dl_ctype.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/util/dl_ctype.cpp -------------------------------------------------------------------------------- /libdreamland/util/dl_ctype.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/util/dl_ctype.h -------------------------------------------------------------------------------- /libdreamland/util/dl_match.h: -------------------------------------------------------------------------------- 1 | /* $Id: dl_match.h,v 1.1.2.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #ifndef __DL_MATCH_H__ 7 | #define __DL_MATCH_H__ 8 | 9 | bool dl_match(const char *pattern, const char *string, bool casefold); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /libdreamland/util/dl_math.h: -------------------------------------------------------------------------------- 1 | /* $Id: dl_math.h,v 1.1.2.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | #ifndef DL_MATH_H 6 | #define DL_MATH_H 7 | 8 | int number_fuzzy ( int number ); 9 | int number_range ( int from, int to ); 10 | bool chance( int ); 11 | int number_disperse ( int value, int disperse ); 12 | int number_percent ( ); 13 | int number_door ( ); 14 | int number_bits ( int width ); 15 | long number_mm ( ); 16 | int dice ( int number, int size ); 17 | int interpolate ( short level, int value_00, int value_32 ); 18 | void init_mm( ); 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /libdreamland/util/dl_strings.h: -------------------------------------------------------------------------------- 1 | /* $Id: dl_strings.h,v 1.1.2.4 2009/11/02 13:48:11 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | #ifndef DL_STRINGS_H 6 | #define DL_STRINGS_H 7 | 8 | class DLString; 9 | 10 | int str_cmp( const char *astr, const char *bstr ); 11 | int strn_cmp(const char *arg1, const char *arg2, int n); 12 | bool str_not_equal( const char *astr, const char *bstr ); 13 | bool str_prefix ( const char *astr, const char *bstr ); 14 | bool is_name( const char *arg1, const char *arg2 ); 15 | DLString russian_case( const DLString & description, char gram_case ); 16 | bool is_number ( const char *arg ); 17 | bool is_positive_number( const char *arg ); 18 | int number_argument ( char *argument, char *arg ); 19 | int mult_argument ( char *argument, char *arg ); 20 | char * dl_one_argument ( char *argument, char *arg_first ); 21 | char * str_str(char *cs, const char *ct); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /libdreamland/util/exceptionbaddatestring.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2004 4 | */ 5 | /*************************************************************************** 6 | exceptionbaddatestring.h - description 7 | ------------------- 8 | begin : Thu Sep 27 2001 9 | copyright : (C) 2001 by nofate 10 | email : nofate@black 11 | ***************************************************************************/ 12 | 13 | #ifndef EXCEPTIONBADDATESTRING_H 14 | #define EXCEPTIONBADDATESTRING_H 15 | 16 | #include "exception.h" 17 | #include "dlstring.h" 18 | 19 | /** 20 | * @author nofate 21 | */ 22 | class ExceptionBadDateString : public Exception 23 | { 24 | public: 25 | inline ExceptionBadDateString( const DLString& date, const char* message, int position ) 26 | : Exception( DLString( message ) << " '" << date << "' at position " << position ) 27 | { 28 | } 29 | }; 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libdreamland/util/iconvmap.cpp: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, Dream Land, 2018 4 | */ 5 | 6 | 7 | #include 8 | 9 | #include "logstream.h" 10 | #include "iconvmap.h" 11 | #include "exception.h" 12 | 13 | IconvMap::IconvMap(const char *from, const char *to) 14 | { 15 | icnv_desc = iconv_open(to, from); 16 | 17 | if (icnv_desc == (iconv_t)(-1)) { 18 | throw new Exception("Failed to iconv_open"); 19 | } 20 | } 21 | 22 | IconvMap::~IconvMap() 23 | { 24 | iconv_close(icnv_desc); 25 | } 26 | 27 | std::string 28 | IconvMap::operator() (const std::string &src) 29 | { 30 | char *in = (char*) src.c_str(); 31 | size_t in_len = src.size(); 32 | char buf[1024]; 33 | std::ostringstream os; 34 | 35 | while(in_len > 0) { 36 | char *out = buf; 37 | size_t len = sizeof(buf); 38 | 39 | if (iconv(icnv_desc, &in, &in_len, &out, &len) < 0) { 40 | throw new Exception("Failed to convert characters"); 41 | } 42 | 43 | if(out == buf) { 44 | LogStream::sendError() << "Incomplete UTF sequence?" << src << endl; 45 | break; 46 | } 47 | os.write(buf, out-buf); 48 | } 49 | 50 | return os.str(); 51 | } 52 | 53 | -------------------------------------------------------------------------------- /libdreamland/util/iconvmap.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, Dream Land, 2018 4 | */ 5 | 6 | 7 | #ifndef ICONVMAP_H 8 | #define ICONVMAP_H 9 | 10 | #include 11 | 12 | class IconvMap { 13 | public: 14 | IconvMap(const char *from, const char *to); 15 | ~IconvMap(); 16 | 17 | std::string operator() (const std::string &src); 18 | 19 | private: 20 | iconv_t icnv_desc; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /libdreamland/util/lastlogstream.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: lastlogstream.cpp,v 1.1.2.1.6.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | #include "lastlogstream.h" 6 | #include "date.h" 7 | 8 | ostringstream LastLogStream::data; 9 | 10 | LastLogStream::~LastLogStream( ) 11 | { 12 | } 13 | 14 | ostream & LastLogStream::send( ) 15 | { 16 | data << Date::getCurrentTimeAsString( "[%b %d %H:%M:%S]: " ); 17 | return data; 18 | } 19 | 20 | void LastLogStream::clear( ) 21 | { 22 | data.str( "" ); 23 | } 24 | -------------------------------------------------------------------------------- /libdreamland/util/lastlogstream.h: -------------------------------------------------------------------------------- 1 | /* $Id: lastlogstream.h,v 1.1.2.1.6.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | #ifndef __LASTLOGSTREAM_H__ 6 | #define __LASTLOGSTREAM_H__ 7 | 8 | #include 9 | 10 | using namespace std; 11 | 12 | class LastLogStream { 13 | public: 14 | virtual ~LastLogStream( ); 15 | static ostream & send( ); 16 | static void clear( ); 17 | 18 | private: 19 | static ostringstream data; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /libdreamland/util/logstream.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/util/logstream.h -------------------------------------------------------------------------------- /libdreamland/util/parsedate.l++: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/util/parsedate.l++ -------------------------------------------------------------------------------- /libdreamland/util/profiler.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: profiler.cpp,v 1.1.4.1.6.4 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #include 7 | 8 | #include "profiler.h" 9 | #include "logstream.h" 10 | 11 | void 12 | Profiler::start() 13 | { 14 | started = clock( ); 15 | } 16 | 17 | void 18 | Profiler::stop() 19 | { 20 | stopped = clock( ); 21 | } 22 | 23 | long Profiler::getStart() const 24 | { 25 | return started; 26 | } 27 | 28 | long Profiler::getStop() const 29 | { 30 | return stopped; 31 | } 32 | 33 | long 34 | Profiler::msec() 35 | { 36 | return 1000*(stopped - started)/CLOCKS_PER_SEC; 37 | } 38 | 39 | 40 | ProfilerBlock::ProfilerBlock(const char *i) : id(i) 41 | { 42 | start(); 43 | } 44 | 45 | ProfilerBlock::~ProfilerBlock() 46 | { 47 | stop(); 48 | LogStream::sendNotice( ) << "Prof: " << id << " takes " << msec() << " msecs" << endl; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /libdreamland/util/profiler.h: -------------------------------------------------------------------------------- 1 | /* $Id: profiler.h,v 1.1.4.1.6.4 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #ifndef __PROFLER_H__ 7 | #define __PROFLER_H__ 8 | 9 | class Profiler { 10 | public: 11 | void start(); 12 | void stop(); 13 | long getStart() const; 14 | long getStop() const; 15 | 16 | long msec(); 17 | 18 | private: 19 | long started, stopped; 20 | }; 21 | 22 | class ProfilerBlock : public Profiler { 23 | public: 24 | ProfilerBlock(const char *id); 25 | ~ProfilerBlock(); 26 | 27 | private: 28 | const char *id; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libdreamland/util/regexp.h: -------------------------------------------------------------------------------- 1 | /* $Id: regexp.h,v 1.1.2.7.10.4 2011-04-19 01:20:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #ifndef REGEXP_H 7 | #define REGEXP_H 8 | 9 | #include "../regex/regex.h" 10 | #include 11 | 12 | #include "dlobject.h" 13 | #include "dlstring.h" 14 | 15 | #include "exception.h" 16 | 17 | class RegExp : public virtual DLObject { 18 | public: 19 | typedef std::vector MatchVector; 20 | 21 | struct Exception : public ::Exception 22 | { 23 | Exception(const char *e) : ::Exception(e) { } 24 | }; 25 | 26 | RegExp( const char * ); 27 | RegExp( const char *, bool ); 28 | ~RegExp( ); 29 | 30 | bool match( const char * ) const; 31 | bool match( const DLString & ) const; 32 | MatchVector subexpr( const char * ) const; 33 | 34 | private: 35 | void prepare( const char *, bool ); 36 | 37 | regex_t preg; 38 | }; 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /libdreamland/util/timer.h: -------------------------------------------------------------------------------- 1 | /* $Id: timer.h,v 1.1.2.4 2009/11/02 13:48:11 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | #ifndef DL_TIMER_H 6 | #define DL_TIMER_H 7 | 8 | #include 9 | #include 10 | 11 | class Timer { 12 | public: 13 | Timer(struct timeval); 14 | Timer(); 15 | virtual ~Timer(); 16 | 17 | void update(); 18 | void sleep(); 19 | bool elapsed() const; 20 | long toLong() const; 21 | 22 | inline long getUSec() const; 23 | inline long getSec() const; 24 | inline void setSec(long); 25 | inline void setUSec(long); 26 | 27 | Timer & operator = (const Timer &); 28 | Timer operator + (const Timer &) const; 29 | Timer operator - (const Timer &) const; 30 | bool operator < (const Timer &) const; 31 | 32 | protected: 33 | struct timeval value; 34 | }; 35 | 36 | inline long Timer::getUSec() const 37 | { 38 | return value.tv_usec; 39 | } 40 | inline long Timer::getSec() const 41 | { 42 | return value.tv_sec; 43 | } 44 | inline void Timer::setSec(long sec) 45 | { 46 | value.tv_sec = sec; 47 | } 48 | inline void Timer::setUSec(long usec) 49 | { 50 | value.tv_usec = usec; 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /libdreamland/xml/exceptionskipvariable.h: -------------------------------------------------------------------------------- 1 | /* $Id: exceptionskipvariable.h,v 1.1.2.2.18.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | #ifndef EXCEPTIONSKIPVARIABLE_H 6 | #define EXCEPTIONSKIPVARIABLE_H 7 | 8 | #include "exception.h" 9 | 10 | class ExceptionSkipVariable : public Exception { 11 | public: 12 | inline ExceptionSkipVariable( ) : Exception( "XML variable skipped while saving" ) 13 | { 14 | } 15 | 16 | virtual ~ExceptionSkipVariable( ) throw( ); 17 | }; 18 | 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /libdreamland/xml/exceptionvariablenotfound.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2004 4 | */ 5 | // exceptionvariablenotfound.h: interface for the ExceptionVariableNotFound_ class. 6 | // 7 | ////////////////////////////////////////////////////////////////////// 8 | 9 | #ifndef __EXCEPTIONVARIABLENOTFOUND_H__ 10 | #define __EXCEPTIONVARIABLENOTFOUND_H__ 11 | 12 | #include "exception.h" 13 | 14 | class ExceptionVariableNotFound : public Exception { 15 | public: 16 | inline ExceptionVariableNotFound( string name, string className ) 17 | : Exception( string( "Variable '" ) + name + "' not found in class '" + className + '\'' ) 18 | { 19 | } 20 | 21 | virtual ~ExceptionVariableNotFound( ) throw( ); 22 | }; 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /libdreamland/xml/exceptionxmlerror.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2004 4 | */ 5 | /*************************************************************************** 6 | exceptionxmlerror.h - description 7 | ------------------- 8 | begin : Fri May 4 2001 9 | copyright : (C) 2001 by Igor S. Petrenko 10 | email : nofate@europe.com 11 | ***************************************************************************/ 12 | 13 | #ifndef EXCEPTIONXMLERROR_H 14 | #define EXCEPTIONXMLERROR_H 15 | 16 | #include "exception.h" 17 | #include "dlstring.h" 18 | 19 | /** 20 | * @author Igor S. Petrenko 21 | */ 22 | class ExceptionXMLError : public Exception 23 | { 24 | public: 25 | inline ExceptionXMLError( string errmsg ) 26 | : Exception( errmsg ), line( 0 ) 27 | { 28 | } 29 | inline ExceptionXMLError( string errmsg, char ch, int line ) 30 | : Exception( errmsg + "::" + ch + ": at line " + DLString(line) ), line( line ) 31 | { 32 | } 33 | 34 | virtual ~ExceptionXMLError( ) throw( ); 35 | 36 | private: 37 | int line; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /libdreamland/xml/exceptionxsl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/exceptionxsl.h -------------------------------------------------------------------------------- /libdreamland/xml/fpstream.h: -------------------------------------------------------------------------------- 1 | /* $Id: fpstream.h,v 1.1.2.2 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #ifndef __FPSTREAM_H__ 7 | #define __FPSTREAM_H__ 8 | 9 | #include "pstream.h" 10 | 11 | #include 12 | 13 | using namespace std; 14 | 15 | class fpstream : public opstream, public ipstream { 16 | public: 17 | void open(const char *fname, ios::openmode m) { 18 | fb.open(fname, m); 19 | } 20 | 21 | void close( ) { 22 | fb.close( ); 23 | } 24 | 25 | void seek(int p) { 26 | fb.pubseekpos(p); 27 | } 28 | 29 | private: 30 | filebuf fb; 31 | protected: 32 | virtual streambuf *buf() { 33 | return &fb; 34 | } 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlboolean.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlboolean.cpp,v 1.9.2.2.28.3 2009/10/11 18:35:37 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | /* 6 | * NoFate, 2001 7 | */ 8 | // xmlboolean.cpp: implementation of the XMLBoolean class. 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | #include "xmlboolean.h" 12 | 13 | void XMLBoolean::fromXML( const XMLNode::Pointer& parent ) throw( ExceptionBadType ) 14 | { 15 | XMLNode::Pointer node = parent->getFirstNode( ); 16 | 17 | if (!node.isEmpty( )) 18 | fromString( node->getCData( ) ); 19 | } 20 | 21 | bool XMLBoolean::toXML( XMLNode::Pointer& parent ) const 22 | { 23 | XMLNode::Pointer node( NEW ); 24 | 25 | node->setType( XMLNode::XML_TEXT ); 26 | node->setCData( toString( ) ); 27 | parent->appendChild( node ); 28 | return true; 29 | } 30 | 31 | bool XMLBooleanNoFalse::toXML( XMLNode::Pointer& parent ) const 32 | { 33 | if (getValue( ) == false) 34 | return false; 35 | else 36 | return XMLBoolean::toXML( parent ); 37 | } 38 | 39 | bool XMLBooleanNoTrue::toXML( XMLNode::Pointer& parent ) const 40 | { 41 | if (getValue( ) == true) 42 | return false; 43 | else 44 | return XMLBoolean::toXML( parent ); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlboolean.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmlboolean.h -------------------------------------------------------------------------------- /libdreamland/xml/xmlbyte.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlbyte.cpp,v 1.9.2.2.28.2 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | /* 6 | * NoFate, 2001 7 | */ 8 | // xmlbyte.cpp: implementation of the XMLByte class. 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | 13 | #include "xmlbyte.h" 14 | 15 | void XMLByte::fromXML( const XMLNode::Pointer& parent ) throw( ExceptionBadType ) { 16 | XMLNode::Pointer node = parent->getFirstNode( ); 17 | 18 | if (!node.isEmpty( )) 19 | fromString( node->getCData( ) ); 20 | } 21 | 22 | bool XMLByte::toXML( XMLNode::Pointer& parent ) const 23 | { 24 | XMLNode::Pointer node( NEW ); 25 | 26 | node->setType( XMLNode::XML_TEXT ); 27 | node->setCData( toString( ) ); 28 | parent->appendChild( node ); 29 | return true; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlbyte.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmlbyte.h -------------------------------------------------------------------------------- /libdreamland/xml/xmlchar.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlchar.cpp,v 1.9.2.2.28.2 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | /* 6 | * NoFate, 2001 7 | */ 8 | // string.cpp: implementation of the String class. 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | #include "xmlchar.h" 13 | 14 | void XMLChar::fromXML( const XMLNode::Pointer& parent ) throw( ExceptionBadType ) 15 | { 16 | XMLNode::Pointer node = parent->getFirstNode( ); 17 | 18 | if (!node.isEmpty( )) 19 | fromString( node->getCData( ) ); 20 | } 21 | 22 | bool XMLChar::toXML( XMLNode::Pointer& parent ) const 23 | { 24 | XMLNode::Pointer node( NEW ); 25 | 26 | node->setType( XMLNode::XML_TEXT ); 27 | node->setCData( toString( ) ); 28 | parent->appendChild( node ); 29 | return true; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlchar.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmlchar.h -------------------------------------------------------------------------------- /libdreamland/xml/xmlclause.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlclause.cpp,v 1.1.2.3.28.3 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | 6 | #include "xmlclause.h" 7 | #include "boolean.h" 8 | 9 | const DLString XMLClause::TYPE = "XMLClause"; 10 | const DLString XMLClause::ATTRIBUTE_ALLOW = "allow"; 11 | 12 | XMLClause::XMLClause( ) 13 | : XMLPredicatesList( true ) 14 | { 15 | } 16 | 17 | bool XMLClause::match( DLObject * arg ) const 18 | { 19 | for (const_iterator i = begin( ); i != end( ); i++) 20 | if (!(*i)->eval( arg )) 21 | return false; 22 | 23 | return true; 24 | } 25 | 26 | void XMLClause::fromXML( const XMLNode::Pointer& parent ) throw (ExceptionBadType) 27 | { 28 | allow = Boolean(parent->getAttribute( ATTRIBUTE_ALLOW )); 29 | XMLPredicatesList::fromXML( parent ); 30 | } 31 | 32 | bool XMLClause::toXML( XMLNode::Pointer& parent ) const 33 | { 34 | if (XMLPredicatesList::toXML( parent )) { 35 | parent->insertAttribute( 36 | ATTRIBUTE_ALLOW, Boolean( allow ).toString( ) ); 37 | return true; 38 | } 39 | else 40 | return false; 41 | } 42 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlclause.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlclause.h,v 1.1.2.3.28.3 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | 6 | #ifndef XMLCLAUSE_H 7 | #define XMLCLAUSE_H 8 | 9 | #include "xmllist.h" 10 | #include "xmlpredicate.h" 11 | 12 | typedef XMLListBase > XMLPredicatesList; 13 | 14 | class XMLClause : public XMLPredicatesList 15 | { 16 | public: 17 | XMLClause( ); 18 | 19 | bool match( DLObject * ) const; 20 | 21 | virtual void fromXML( const XMLNode::Pointer& ) throw( ExceptionBadType ); 22 | virtual bool toXML( XMLNode::Pointer& ) const; 23 | 24 | static const DLString TYPE; 25 | static const DLString ATTRIBUTE_ALLOW; 26 | 27 | bool allow; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlcontainer.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlcontainer.cpp,v 1.1.2.5.10.3 2009/11/02 13:48:11 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | #include 6 | #include "xmlcontainer.h" 7 | #include "logstream.h" 8 | 9 | void 10 | XMLContainer::fromXML( const XMLNode::Pointer & parent ) throw( ExceptionBadType ) 11 | { 12 | XMLNode::NodeList::const_iterator ipos; 13 | const XMLNode::NodeList& children = parent->getNodeList( ); 14 | 15 | for (ipos = children.begin( ); ipos != children.end( ); ipos++) 16 | if (!nodeFromXML( *ipos )) 17 | LogStream::sendWarning( ) 18 | << "Unparsed node <" << parent->getName( ) 19 | << "> <" << (*ipos)->getName( ) 20 | << "> mytype " << typeid( this ).name( ) << endl; 21 | // throw ExceptionBadType( parent->getName( ), (*ipos)->getName( ) ); 22 | } 23 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlcontainer.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlcontainer.h,v 1.6.2.2.18.1 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | #ifndef __XMLCONTAINER_H__ 6 | #define __XMLCONTAINER_H__ 7 | 8 | #include "xmlvariable.h" 9 | 10 | class XMLContainer : public virtual XMLVariable { 11 | public: 12 | 13 | virtual void fromXML( const XMLNode::Pointer& ) throw( ExceptionBadType ); 14 | virtual bool nodeFromXML( const XMLNode::Pointer & ) = 0; 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /libdreamland/xml/xmldate.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmldate.cpp,v 1.7.2.2.28.2 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | /*************************************************************************** 6 | xmldate.cpp - description 7 | ------------------- 8 | begin : Wed May 30 2001 9 | copyright : (C) 2001 by Igor S. Petrenko 10 | email : nofate@europe.com 11 | ***************************************************************************/ 12 | 13 | #include "xmldate.h" 14 | #include "xmllong.h" 15 | #include "exceptionskipvariable.h" 16 | 17 | void XMLDate::fromXML( const XMLNode::Pointer& parent ) throw( ExceptionBadType ) 18 | { 19 | XMLNode::Pointer node = parent->getFirstNode( ); 20 | 21 | if (!node.isEmpty( )) 22 | setTime( Long( node->getCData( ) ) ); 23 | } 24 | 25 | bool XMLDate::toXML( XMLNode::Pointer& parent ) const 26 | { 27 | XMLLong value( getTime( ) ); 28 | 29 | return value.toXML( parent ); 30 | } 31 | 32 | bool XMLDateNoEmpty::toXML( XMLNode::Pointer& parent ) const 33 | { 34 | if (getTime( ) <= 0) 35 | return false; 36 | else 37 | return XMLDate::toXML( parent ); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /libdreamland/xml/xmldate.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmldate.h -------------------------------------------------------------------------------- /libdreamland/xml/xmlinteger.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmlinteger.h -------------------------------------------------------------------------------- /libdreamland/xml/xmllimits.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmllimits.cpp,v 1.1.2.4.24.3 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | 6 | #include "xmllimits.h" 7 | 8 | const DLString XMLLimits::TYPE = "XMLLimits"; 9 | 10 | XMLLimits::XMLLimits( ) 11 | : XMLClausesList( false ) 12 | { 13 | } 14 | 15 | XMLLimits::~XMLLimits( ) 16 | { 17 | } 18 | 19 | bool XMLLimits::allow( DLObject * arg ) const 20 | { 21 | for (const_iterator i = begin( ); i != end( ); i++) 22 | if (i->match( arg )) 23 | return i->allow; 24 | 25 | return true; 26 | } 27 | -------------------------------------------------------------------------------- /libdreamland/xml/xmllimits.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmllimits.h,v 1.1.2.4.24.3 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | 6 | #ifndef XMLLIMITS_H 7 | #define XMLLIMITS_H 8 | 9 | #include "xmlclause.h" 10 | 11 | typedef XMLListBase XMLClausesList; 12 | 13 | class XMLLimits : public XMLClausesList 14 | { 15 | public: 16 | typedef ::Pointer Pointer; 17 | 18 | XMLLimits( ); 19 | virtual ~XMLLimits( ); 20 | 21 | bool allow( DLObject * ) const; 22 | static const DLString TYPE; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /libdreamland/xml/xmllong.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmllong.cpp,v 1.9.2.2.28.2 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | /* 6 | * NoFate, 2001 7 | */ 8 | // xmllong.cpp: implementation of the XMLLong class. 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | 13 | #include "xmllong.h" 14 | 15 | void XMLLong::fromXML( const XMLNode::Pointer& parent ) throw( ExceptionBadType ) 16 | { 17 | XMLNode::Pointer node = parent->getFirstNode( ); 18 | 19 | if (!node.isEmpty( )) 20 | fromString( node->getCData( ) ); 21 | } 22 | 23 | bool XMLLong::toXML( XMLNode::Pointer& parent ) const 24 | { 25 | XMLNode::Pointer node( NEW ); 26 | 27 | node->setType( XMLNode::XML_TEXT ); 28 | node->setCData( toString( ) ); 29 | parent->appendChild( node ); 30 | return true; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /libdreamland/xml/xmllong.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmllong.h -------------------------------------------------------------------------------- /libdreamland/xml/xmllonglong.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmllonglong.cpp,v 1.9.2.2.28.3 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | /* 6 | * NoFate, 2001 7 | */ 8 | // xmllonglong.cpp: implementation of the XMLLongLong class. 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | 13 | #include "xmllonglong.h" 14 | 15 | void XMLLongLong::fromXML( const XMLNode::Pointer& parent ) throw( ExceptionBadType ) 16 | { 17 | XMLNode::Pointer node = parent->getFirstNode( ); 18 | 19 | if (!node.isEmpty( )) 20 | fromString( node->getCData( ) ); 21 | } 22 | 23 | bool XMLLongLong::toXML( XMLNode::Pointer& parent ) const 24 | { 25 | XMLNode::Pointer node( NEW ); 26 | 27 | node->setType( XMLNode::XML_TEXT ); 28 | node->setCData( toString( ) ); 29 | parent->appendChild( node ); 30 | return true; 31 | } 32 | 33 | 34 | bool XMLLongLongNoEmpty::toXML( XMLNode::Pointer& parent ) const 35 | { 36 | if (getValue( ) == 0) 37 | return false; 38 | else 39 | return XMLLongLong::toXML( parent ); 40 | } 41 | -------------------------------------------------------------------------------- /libdreamland/xml/xmllonglong.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmllonglong.h -------------------------------------------------------------------------------- /libdreamland/xml/xmlmatchpattern.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmlmatchpattern.h -------------------------------------------------------------------------------- /libdreamland/xml/xmlmatchpattern.l++: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmlmatchpattern.l++ -------------------------------------------------------------------------------- /libdreamland/xml/xmlnode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmlnode.h -------------------------------------------------------------------------------- /libdreamland/xml/xmlparser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmlparser.h -------------------------------------------------------------------------------- /libdreamland/xml/xmlpolymorphvariable.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlpolymorphvariable.cpp,v 1.1.2.2.18.2 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | #include "xmlpolymorphvariable.h" 6 | 7 | DLObject::Pointer 8 | XMLPolymorphVariable::set( DLObject::Pointer arg1, DLObject::Pointer arg2 ) 9 | { 10 | return DLObject::Pointer( ); 11 | } 12 | 13 | ExceptionXMLClassNotDerived::~ExceptionXMLClassNotDerived( ) throw ( ) 14 | { 15 | } 16 | 17 | ExceptionXMLClassNotRegistered::~ExceptionXMLClassNotRegistered( ) throw ( ) 18 | { 19 | } 20 | 21 | ExceptionXMLClassAllocate::~ExceptionXMLClassAllocate( ) throw ( ) 22 | { 23 | } 24 | 25 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlpredicate.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlpredicate.cpp,v 1.1.2.3.28.2 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | 6 | #include "xmlpredicate.h" 7 | #include "boolean.h" 8 | 9 | const DLString XMLPredicate::ATTRIBUTE_INVERT = "invert"; 10 | 11 | void XMLPredicate::fromXML( const XMLNode::Pointer& parent ) throw (ExceptionBadType) 12 | { 13 | invert = Boolean(parent->getAttribute( ATTRIBUTE_INVERT )); 14 | } 15 | 16 | bool XMLPredicate::toXML( XMLNode::Pointer& parent ) const 17 | { 18 | parent->insertAttribute( ATTRIBUTE_INVERT, Boolean( invert ).toString( ) ); 19 | return true; 20 | } 21 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlpredicate.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlpredicate.h,v 1.1.2.3.28.2 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | 6 | #ifndef XMLPREDICATE_H 7 | #define XMLPREDICATE_H 8 | 9 | #include "xmlpolymorphvariable.h" 10 | 11 | class XMLPredicate : public virtual XMLPolymorphVariable { 12 | public: 13 | 14 | virtual bool eval( DLObject * ) const = 0; 15 | virtual void fromXML( const XMLNode::Pointer& ) throw (ExceptionBadType); 16 | virtual bool toXML( XMLNode::Pointer& ) const; 17 | 18 | static const DLString ATTRIBUTE_INVERT; 19 | 20 | protected: 21 | bool invert; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlreftest.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlreftest.cpp,v 1.1.4.1.6.2 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #include "xmlstreamable.h" 7 | #include "xmlreftest.h" 8 | #include "class.h" 9 | 10 | int main() 11 | { 12 | Class::regMoc(); 13 | Class::regMoc(); 14 | Class::regMoc(); 15 | 16 | XMLPersistent m; 17 | XMLPersistent s; 18 | 19 | m.construct( ); 20 | s.construct( ); 21 | 22 | m->ref = new XMLRefTestTarget(); 23 | s->ref = m->ref; 24 | 25 | cout << sizeof(m) << endl; 26 | 27 | s.backup( ); 28 | m.backup( ); 29 | 30 | m.recover( ); 31 | s.recover( ); 32 | } 33 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlreftest.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlreftest.h,v 1.1.4.1.6.1 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #ifndef __XMLREFTEST_H__ 7 | #define __XMLREFTEST_H__ 8 | 9 | #include "xmlvariablecontainer.h" 10 | #include "xmlinteger.h" 11 | #include "xmlpointer.h" 12 | 13 | class XMLRefTestTarget : public XMLVariableContainer, public XMLRefVariable 14 | { 15 | XML_OBJECT 16 | public: 17 | typedef ::Pointer Pointer; 18 | 19 | XML_VARIABLE XMLInteger var; 20 | }; 21 | 22 | 23 | class XMLRefTestMaster : public XMLVariableContainer 24 | { 25 | XML_OBJECT 26 | public: 27 | typedef ::Pointer Pointer; 28 | 29 | XML_VARIABLE XMLPointer ref; 30 | }; 31 | 32 | class XMLRefTestSlave : public XMLVariableContainer 33 | { 34 | XML_OBJECT 35 | public: 36 | typedef ::Pointer Pointer; 37 | 38 | XML_VARIABLE XMLReference ref; 39 | }; 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlshort.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmlshort.h -------------------------------------------------------------------------------- /libdreamland/xml/xmlstring.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmlstring.h -------------------------------------------------------------------------------- /libdreamland/xml/xmlstringlist.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlstringlist.cpp,v 1.1.2.5 2011-04-17 19:37:54 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | #include "xmlstringlist.h" 6 | 7 | XMLStringList::XMLStringList() 8 | { 9 | } 10 | 11 | void XMLStringList::toSet( StringSet &aset ) const 12 | { 13 | const_iterator i; 14 | 15 | for (i = begin( ); i != end( ); i++) 16 | if (*i != "\'" && *i != "\"") 17 | aset.insert( *i ); 18 | } 19 | 20 | 21 | bool XMLStringSet::toXML( XMLNode::Pointer& node ) const 22 | { 23 | return XMLStringNoEmpty( toString( ) ).toXML( node ); 24 | } 25 | 26 | void XMLStringSet::fromXML( const XMLNode::Pointer& node ) throw( ExceptionBadType ) 27 | { 28 | XMLString str; 29 | 30 | str.fromXML( node ); 31 | fromString( str ); 32 | } 33 | 34 | 35 | bool XMLNumberSet::toXML( XMLNode::Pointer& node ) const 36 | { 37 | return XMLStringNoEmpty( 38 | toStringSet( ).toString( ) ) 39 | .toXML( node ); 40 | } 41 | 42 | void XMLNumberSet::fromXML( const XMLNode::Pointer& node ) throw( ExceptionBadType ) 43 | { 44 | XMLStringSet str; 45 | 46 | str.fromXML( node ); 47 | fromStringSet( str ); 48 | } 49 | 50 | 51 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlstringlist.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmlstringlist.h,v 1.1.2.6 2011-04-17 19:37:54 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | #ifndef XMLSTRINGLIST_H 6 | #define XMLSTRINGLIST_H 7 | 8 | #include "stringset.h" 9 | #include "xmlstring.h" 10 | #include "xmllist.h" 11 | 12 | class XMLStringList : public XMLListBase { 13 | public: 14 | 15 | XMLStringList(); 16 | void toSet( StringSet & ) const; 17 | }; 18 | 19 | class XMLStringSet : public StringSet { 20 | public: 21 | bool toXML( XMLNode::Pointer& node ) const; 22 | void fromXML( const XMLNode::Pointer& node ) throw( ExceptionBadType ); 23 | }; 24 | 25 | class XMLNumberSet : public NumberSet { 26 | public: 27 | bool toXML( XMLNode::Pointer& node ) const; 28 | void fromXML( const XMLNode::Pointer& node ) throw( ExceptionBadType ); 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libdreamland/xml/xmltest.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmltest.cpp,v 1.1.2.2 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #include "xmldocument.h" 7 | #include "fpstream.h" 8 | #include "profiler.h" 9 | 10 | #include 11 | 12 | using namespace std; 13 | 14 | int 15 | main(int argc, char **argv) 16 | { 17 | XMLDocument::Pointer doc(NEW); 18 | doc->load(cin); 19 | 20 | { 21 | ProfilerBlock pb("save xml"); 22 | fstream ofs("1", ios::out); 23 | doc->save(ofs); 24 | } 25 | 26 | { 27 | ProfilerBlock pb("save bin"); 28 | fpstream ofp; 29 | ofp.open("2", ios::out); 30 | ofp << **doc; 31 | } 32 | 33 | { 34 | ProfilerBlock pb("load xml"); 35 | XMLDocument::Pointer d(NEW); 36 | fstream ifs("1", ios::in); 37 | d->load(ifs); 38 | } 39 | 40 | { 41 | ProfilerBlock pb("load bin"); 42 | XMLDocument::Pointer d(NEW); 43 | fpstream ifp; 44 | ifp.open("2", ios::in); 45 | ifp >> **d; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /libdreamland/xml/xmltimestamp.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmltimestamp.cpp,v 1.1.2.2 2009/10/11 18:35:38 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | #include "xmltimestamp.h" 6 | #include "date.h" 7 | 8 | XMLTimeStamp::XMLTimeStamp( ) 9 | : XMLLong( Date::getCurrentTime( ) ) 10 | { 11 | } 12 | 13 | bool XMLTimeStamp::toXML( XMLNode::Pointer& parent ) const 14 | { 15 | return XMLLong( Date::getCurrentTime( ) ).toXML( parent ); 16 | } 17 | 18 | void XMLTimeStamp::fromXML( const XMLNode::Pointer& parent ) throw( ExceptionBadType ) 19 | { 20 | XMLLong::fromXML( parent ); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /libdreamland/xml/xmltimestamp.h: -------------------------------------------------------------------------------- 1 | /* $Id: xmltimestamp.h,v 1.1.2.2 2009/10/11 18:35:39 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | #ifndef XMLTIMESTAMP_H 6 | #define XMLTIMESTAMP_H 7 | 8 | #include "xmllong.h" 9 | #include "xmlvariable.h" 10 | 11 | class XMLTimeStamp : public XMLLong, public virtual XMLVariable { 12 | public: 13 | XMLTimeStamp( ); 14 | 15 | virtual bool toXML( XMLNode::Pointer& ) const; 16 | virtual void fromXML( const XMLNode::Pointer& ) throw( ExceptionBadType ); 17 | }; 18 | 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlvariable.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlvariable.cpp,v 1.1.4.2 2009/10/11 18:35:39 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2003 4 | */ 5 | 6 | #include "xmlvariable.h" 7 | 8 | XMLVariable::~XMLVariable( ) 9 | { 10 | } 11 | 12 | -------------------------------------------------------------------------------- /libdreamland/xml/xmlvariable.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/libdreamland/xml/xmlvariable.h -------------------------------------------------------------------------------- /libdreamland/xml/xmlvariablecontainer.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: xmlvariablecontainer.cpp,v 1.17.2.6.8.2 2009/10/11 18:35:39 rufina Exp $ 2 | * 3 | * ruffina, Dream Land, 2004 4 | */ 5 | 6 | #include "xmlvariablecontainer.h" 7 | #include "xmlnode.h" 8 | 9 | const DLString & XMLVariableContainer::getType( ) const 10 | { 11 | return mocGetType( ); 12 | } 13 | 14 | bool XMLVariableContainer::nodeFromXML( const XMLNode::Pointer& parent ) 15 | { 16 | return mocNodeFromXML( parent ); 17 | } 18 | 19 | bool XMLVariableContainer::toXML( XMLNode::Pointer& parent ) const 20 | { 21 | return mocToXML( parent ); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /plug-ins/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | runtime \ 3 | feniaroot 4 | 5 | 6 | -------------------------------------------------------------------------------- /plug-ins/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | 3 | LIBS = $(top_builddir)/src/libplanescape_impl.la -lm $(top_builddir)/libdreamland/libdreamland.la -lcrypt -lz 4 | 5 | 6 | data_DATA = $(lib_LTLIBRARIES:.la=.xml) 7 | 8 | libdir=$(libexecdir)/plugins 9 | datadir=$(libexecdir)/plugins 10 | 11 | .la.xml: 12 | @echo "Generating $@ from $<" 13 | @echo '' > $@ 14 | @echo '' >> $@ 15 | @echo ' ' >> $@ 16 | @. $<; for i in $$dependency_libs; do \ 17 | case $$i in \ 18 | */libplanescape_impl.la) ;;\ 19 | */libdreamland.la) ;;\ 20 | */libstdc++.la) ;;\ 21 | *.la) basename $$i | sed -e 's!^lib! !' \ 22 | -e 's!\.la$$!!' >> $@ ;; \ 23 | esac; \ 24 | done 25 | @echo ' ' >> $@ 26 | @echo '' >> $@ 27 | 28 | -------------------------------------------------------------------------------- /plug-ins/feniaroot/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libfeniaroot.la 2 | 3 | libfeniaroot_la_SOURCES = \ 4 | ceval.cpp \ 5 | cfindref.cpp \ 6 | characterwrapper.cpp \ 7 | objectwrapper.cpp \ 8 | roomwrapper.cpp \ 9 | impl.cpp \ 10 | root.cpp \ 11 | schedulerwrapperext.cpp \ 12 | validatetask.cpp \ 13 | pluginnativeimpl.cpp \ 14 | wrappermanager.cpp \ 15 | wrappersplugin.cpp \ 16 | idcontainerext.cpp \ 17 | regcontainerext.cpp \ 18 | feniastringext.cpp \ 19 | reglistext.cpp \ 20 | wrap_utils.cpp 21 | 22 | libfeniaroot_la_MOC = \ 23 | characterwrapper.h \ 24 | objectwrapper.h \ 25 | roomwrapper.h \ 26 | root.h \ 27 | wrappersplugin.h 28 | 29 | libfeniaroot_la_LIBADD = \ 30 | ../runtime/libruntime.la 31 | 32 | include $(top_srcdir)/src/Makefile.inc 33 | include $(top_srcdir)/plug-ins/Makefile.inc 34 | INCLUDES = \ 35 | $(INCLUDES_SRC) \ 36 | -I$(top_srcdir)/plug-ins/runtime 37 | -------------------------------------------------------------------------------- /plug-ins/feniaroot/ceval.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/feniaroot/ceval.cpp -------------------------------------------------------------------------------- /plug-ins/feniaroot/cfindref.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/feniaroot/cfindref.cpp -------------------------------------------------------------------------------- /plug-ins/feniaroot/characterwrapper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/feniaroot/characterwrapper.cpp -------------------------------------------------------------------------------- /plug-ins/feniaroot/characterwrapper.h: -------------------------------------------------------------------------------- 1 | /* $Id: characterwrapper.h,v 1.1.4.11.6.1 2007/09/11 00:09:28 margo Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | 6 | #ifndef _CHARACTERWRAPPER_H_ 7 | #define _CHARACTERWRAPPER_H_ 8 | 9 | // MOC_SKIP_BEGIN 10 | #include "lex.h" 11 | #include "scope.h" 12 | #include "xmlregister.h" 13 | #include "exceptions.h" 14 | // MOC_SKIP_END 15 | #include "pluginnativeimpl.h" 16 | 17 | // MOC_SKIP_BEGIN 18 | struct char_data; 19 | // MOC_SKIP_END 20 | 21 | using Scripting::Register; 22 | using Scripting::RegisterList; 23 | 24 | class CharacterWrapper : public PluginWrapperImpl 25 | { 26 | XML_OBJECT 27 | NMI_OBJECT 28 | public: 29 | typedef ::Pointer Pointer; 30 | 31 | CharacterWrapper( ); 32 | 33 | virtual void setSelf( Scripting::Object * ); 34 | virtual void extract( bool ); 35 | void setTarget( struct char_data * ); 36 | void checkTarget( ) const throw( Scripting::Exception ); 37 | struct char_data *getTarget( ) const; 38 | 39 | private: 40 | struct char_data *target; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /plug-ins/feniaroot/feniastringext.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/feniaroot/feniastringext.cpp -------------------------------------------------------------------------------- /plug-ins/feniaroot/idcontainerext.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: idcontainerext.cpp,v 1.1.2.4.18.1 2007/09/11 00:09:28 margo Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | #include 6 | 7 | #include "register-impl.h" 8 | #include "reglist.h" 9 | #include "idcontainer.h" 10 | #include "fenia/object.h" 11 | #include "nativeext.h" 12 | 13 | using namespace Scripting; 14 | 15 | NMI_GET(IdContainer, fieldKeys, "") 16 | { 17 | RegList::Pointer rc(NEW); 18 | 19 | Idmap::const_iterator i; 20 | 21 | for(i = idmap.begin(); i != idmap.end(); i++) 22 | rc->push_back( Register( i->first ) ); 23 | 24 | Scripting::Object *obj = &Scripting::Object::manager->allocate(); 25 | obj->setHandler(rc); 26 | 27 | return Register( obj ); 28 | } 29 | 30 | NMI_INVOKE(IdContainer, size, "") 31 | { 32 | return Register( (int)idmap.size( ) ); 33 | } 34 | 35 | NMI_INVOKE(IdContainer, api, "") 36 | { 37 | Idmap::const_iterator i; 38 | ostringstream buf; 39 | 40 | traitsAPI( buf ); 41 | 42 | buf << endl << endl << "&WRuntime fields:&x" << endl; 43 | for(i = idmap.begin(); i != idmap.end(); i++) 44 | buf << "&x" << Lex::getThis( )->getName( i->first ) << "&x" << endl; 45 | 46 | return Register( buf.str( ) ); 47 | } 48 | -------------------------------------------------------------------------------- /plug-ins/feniaroot/impl.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: impl.cpp,v 1.1.4.6.6.3 2008/03/26 10:57:27 rufina Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | #include "wrappermanager.h" 6 | #include "wrappersplugin.h" 7 | #include "so.h" 8 | 9 | extern "C" 10 | { 11 | SO::PluginList initialize_feniaroot( ) 12 | { 13 | SO::PluginList ppl; 14 | 15 | Plugin::registerPlugin( ppl ); 16 | Plugin::registerPlugin( ppl ); 17 | 18 | return ppl; 19 | } 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /plug-ins/feniaroot/nativeext.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/feniaroot/nativeext.h -------------------------------------------------------------------------------- /plug-ins/feniaroot/objectwrapper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/feniaroot/objectwrapper.cpp -------------------------------------------------------------------------------- /plug-ins/feniaroot/objectwrapper.h: -------------------------------------------------------------------------------- 1 | /* $Id: objectwrapper.h,v 1.1.4.10.6.1 2007/09/11 00:09:28 margo Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | 6 | #ifndef _OBJECTWRAPPER_H_ 7 | #define _OBJECTWRAPPER_H_ 8 | 9 | // MOC_SKIP_BEGIN 10 | #include "lex.h" 11 | #include "scope.h" 12 | #include "xmlregister.h" 13 | #include "exceptions.h" 14 | // MOC_SKIP_END 15 | #include "pluginnativeimpl.h" 16 | 17 | // MOC_SKIP_BEGIN 18 | struct obj_data; 19 | // MOC_SKIP_END 20 | 21 | using Scripting::Register; 22 | using Scripting::RegisterList; 23 | 24 | class ObjectWrapper : public PluginWrapperImpl 25 | { 26 | XML_OBJECT 27 | NMI_OBJECT 28 | public: 29 | typedef ::Pointer Pointer; 30 | 31 | ObjectWrapper( ); 32 | 33 | virtual void setSelf( Scripting::Object * ); 34 | virtual void extract( bool ); 35 | void setTarget( struct obj_data * ); 36 | void checkTarget( ) const throw( Scripting::Exception ); 37 | struct obj_data * getTarget() const; 38 | 39 | private: 40 | struct obj_data *target; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /plug-ins/feniaroot/pluginnativeimpl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/feniaroot/pluginnativeimpl.cpp -------------------------------------------------------------------------------- /plug-ins/feniaroot/regcontainerext.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/feniaroot/regcontainerext.cpp -------------------------------------------------------------------------------- /plug-ins/feniaroot/reglistext.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/feniaroot/reglistext.cpp -------------------------------------------------------------------------------- /plug-ins/feniaroot/roomwrapper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/feniaroot/roomwrapper.cpp -------------------------------------------------------------------------------- /plug-ins/feniaroot/roomwrapper.h: -------------------------------------------------------------------------------- 1 | /* $Id: roomwrapper.h,v 1.1.4.8.6.1 2007/09/11 00:09:28 margo Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | 6 | #ifndef _ROOMWRAPPER_H_ 7 | #define _ROOMWRAPPER_H_ 8 | 9 | // MOC_SKIP_BEGIN 10 | #include "lex.h" 11 | #include "scope.h" 12 | #include "xmlregister.h" 13 | #include "exceptions.h" 14 | // MOC_SKIP_END 15 | #include "pluginnativeimpl.h" 16 | 17 | struct room_data; 18 | 19 | class RoomWrapper : public PluginWrapperImpl 20 | { 21 | XML_OBJECT 22 | NMI_OBJECT 23 | public: 24 | typedef ::Pointer Pointer; 25 | 26 | RoomWrapper( ); 27 | 28 | virtual void setSelf( Scripting::Object * ); 29 | virtual void extract( bool ); 30 | void setTarget( struct room_data *r ); 31 | void checkTarget( ) const throw( Scripting::Exception ); 32 | struct room_data * getTarget( ) const; 33 | 34 | private: 35 | struct room_data *target; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /plug-ins/feniaroot/root.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/feniaroot/root.cpp -------------------------------------------------------------------------------- /plug-ins/feniaroot/root.h: -------------------------------------------------------------------------------- 1 | /* $Id: root.h,v 1.1.4.8.6.2 2007/09/21 21:23:53 margo Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | 6 | #ifndef __ROOT_H__ 7 | #define __ROOT_H__ 8 | 9 | #include 10 | 11 | // MOC_SKIP_BEGIN 12 | #include "lex.h" 13 | #include "scope.h" 14 | #include "exceptions.h" 15 | // MOC_SKIP_END 16 | #include "xmlregister.h" 17 | #include "pluginnativeimpl.h" 18 | 19 | using Scripting::XMLRegister; 20 | using Scripting::Register; 21 | using Scripting::RegisterList; 22 | 23 | class Root : public PluginNativeImpl, 24 | public NativeHandler, 25 | public XMLVariableContainer 26 | { 27 | XML_OBJECT 28 | NMI_OBJECT 29 | public: 30 | 31 | Root() { } 32 | 33 | virtual void setSelf(Scripting::Object *s) { 34 | self = s; 35 | } 36 | 37 | XML_VARIABLE XMLRegister tmp, scheduler; 38 | private: 39 | Scripting::Object *self; 40 | }; 41 | 42 | #endif /* __ROOT_H__ */ 43 | -------------------------------------------------------------------------------- /plug-ins/feniaroot/schedulerwrapperext.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: schedulerwrapperext.cpp,v 1.1.2.2 2005/04/27 18:46:13 rufina Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | #include 6 | 7 | #include "register-impl.h" 8 | #include "nativeext.h" 9 | #include "schedulerwrapper.h" 10 | 11 | using namespace Scripting; 12 | 13 | NMI_INVOKE(FeniaProcess, api, "") 14 | { 15 | ostringstream buf; 16 | 17 | traitsAPI( buf ); 18 | return Register( buf.str( ) ); 19 | } 20 | 21 | NMI_INVOKE(SchedulerWrapper, api, "") 22 | { 23 | ostringstream buf; 24 | 25 | traitsAPI( buf ); 26 | return Register( buf.str( ) ); 27 | } 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /plug-ins/feniaroot/validatetask.h: -------------------------------------------------------------------------------- 1 | /* $Id: validatetask.h,v 1.1.4.3.10.1 2009/09/24 14:09:12 rufina Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | 6 | #ifndef __VALIDATETASK_H__ 7 | #define __VALIDATETASK_H__ 8 | 9 | #include 10 | 11 | struct ValidateTask : public SchedulerTask 12 | { 13 | typedef ::Pointer Pointer; 14 | 15 | virtual void run( ); 16 | virtual int getPriority( ) const; 17 | }; 18 | 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /plug-ins/feniaroot/wrap_utils.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2009 4 | */ 5 | #ifndef WRAP_UTILS_H 6 | #define WRAP_UTILS_H 7 | 8 | #include "wrapperbase.h" 9 | #include "xmlregister.h" 10 | #include "register-decl.h" 11 | 12 | using Scripting::Register; 13 | using Scripting::RegisterList; 14 | 15 | struct char_data; 16 | struct room_data; 17 | struct obj_data; 18 | 19 | Register wrap( struct char_data * ); 20 | Register wrap( struct obj_data * ); 21 | Register wrap( struct room_data * ); 22 | 23 | const Register & get_unique_arg( const RegisterList & ); 24 | const Register & arg_one( const RegisterList & ); 25 | const Register & arg_two( const RegisterList & ); 26 | int args2number( const RegisterList& ); 27 | DLString args2string( const RegisterList& ); 28 | void args2buf(const RegisterList &args, char *buf, size_t bufsize); 29 | 30 | struct char_data * arg2character( const Register & ); 31 | struct room_data * arg2room( const Register ® ); 32 | struct obj_data * arg2item( const Register ® ); 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /plug-ins/feniaroot/wrappersplugin.h: -------------------------------------------------------------------------------- 1 | /* $Id: wrappersplugin.h,v 1.1.4.2 2004/10/29 14:46:17 rufina Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | 6 | #ifndef WRAPPERSPLUGIN_H 7 | #define WRAPPERSPLUGIN_H 8 | 9 | #include "plugin.h" 10 | #include "xmlvariablecontainer.h" 11 | 12 | class WrappersPlugin : public Plugin, public XMLVariableContainer { 13 | XML_OBJECT 14 | public: 15 | typedef ::Pointer Pointer; 16 | 17 | public: 18 | WrappersPlugin( ); 19 | virtual ~WrappersPlugin( ); 20 | 21 | virtual void initialization( ); 22 | virtual void destruction( ); 23 | 24 | static inline WrappersPlugin* getThis( ) { 25 | return thisClass; 26 | } 27 | 28 | static void linkTargets(); 29 | 30 | private: 31 | static WrappersPlugin* thisClass; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /plug-ins/runtime/act.comm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/act.comm.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/act.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/act.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/act.informative.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/act.informative.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/act.item.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/act.item.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/act.movement.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/act.movement.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/act.offensive.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/act.offensive.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/act.other.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/act.other.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/act.social.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/act.social.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/act.social.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/act.social.h -------------------------------------------------------------------------------- /plug-ins/runtime/act.wizard.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/act.wizard.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/ai.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/ai.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/ai.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/ai.h -------------------------------------------------------------------------------- /plug-ins/runtime/alias.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/alias.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/ban.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/ban.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/boards.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/boards.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/case.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/case.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/case.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/case.h -------------------------------------------------------------------------------- /plug-ins/runtime/case_table.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/case_table.h -------------------------------------------------------------------------------- /plug-ins/runtime/class.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/class.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/comm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/comm.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/comm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/comm.h -------------------------------------------------------------------------------- /plug-ins/runtime/commands.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/commands.h -------------------------------------------------------------------------------- /plug-ins/runtime/constants.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/constants.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/constants.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/constants.h -------------------------------------------------------------------------------- /plug-ins/runtime/db.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/db.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/events.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/events.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/events.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/events.h -------------------------------------------------------------------------------- /plug-ins/runtime/exp_fn.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/exp_fn.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/exp_fn.h: -------------------------------------------------------------------------------- 1 | #ifndef EXP_FN_H 2 | #define EXP_FN_H 3 | 4 | #include "expr.h" 5 | 6 | extern EXP_FN_STR expFnsImpl[]; 7 | void ExecExpFunctionImpl(EXP_FN_STR * FnStr, EXP_ITEM & item, EXPFN_PARAMS, EXP_ITEM ** Par); 8 | 9 | void expfn_init(); 10 | void expfn_destroy(); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /plug-ins/runtime/fight.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/fight.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/gameconfig.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/gameconfig.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/gameconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef GAMECONFIG_H 2 | #define GAMECONFIG_H 3 | 4 | /* 5 | * See gameconfig.cc for explanations 6 | */ 7 | 8 | extern int free_crashrent_period; 9 | extern int free_rebootrent_period; 10 | extern int free_rent; 11 | extern int idle_max_level; 12 | extern int idle_rent_time; 13 | extern int idle_void; 14 | extern int auto_save; 15 | extern int autosave_time; 16 | extern int track_through_doors; 17 | extern int siteok_everyone; 18 | extern int nameserver_is_slow; 19 | extern int load_into_inventory; 20 | extern int max_playing; 21 | extern int max_bad_pws; 22 | 23 | extern const char *OK; 24 | extern const char *NOPERSON; 25 | extern const char *NOEFFECT; 26 | extern const char *ONLYSAME; 27 | 28 | extern const char *MENU; 29 | extern const char *START_MESSG; 30 | extern const char *WELC_MESSG; 31 | 32 | extern const char *DFLT_IP; 33 | 34 | extern room_vnum frozen_start_room; 35 | extern room_vnum helled_start_room; 36 | extern room_vnum immort_start_room; 37 | extern room_vnum jail_start_room; 38 | extern room_vnum mortal_start_room; 39 | extern room_vnum named_start_room; 40 | extern room_vnum unreg_start_room; 41 | 42 | int calc_loadroom(struct char_data *ch); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /plug-ins/runtime/graph.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/graph.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/handler.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/help.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/help.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/help.h: -------------------------------------------------------------------------------- 1 | #ifndef HELP_H 2 | #define HELP_H 3 | 4 | struct help_index_data { 5 | int number; 6 | char *title; 7 | char *keyword; 8 | int type; 9 | char *entry; 10 | char *links; 11 | char *format; 12 | int duplicate; 13 | struct help_index_data *next; 14 | }; 15 | 16 | extern struct help_index_data *help_system; 17 | 18 | void load_helpx(); 19 | 20 | void help_init(); 21 | void help_destroy(); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /plug-ins/runtime/house.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/house.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/house.h: -------------------------------------------------------------------------------- 1 | #ifndef HOUSE_H 2 | #define HOUSE_H 3 | 4 | #define NUM_FRACTS 16 5 | #define FRACT_NONE 0 6 | #define FRACT_ATHAR 1 7 | #define FRACT_GODSMEN 2 8 | #define FRACT_MADMEN 3 9 | #define FRACT_DOOMGUARD 4 10 | #define FRACT_DUSTMEN 5 11 | #define FRACT_FATED 6 12 | #define FRACT_CUVNERS 7 13 | #define FRACT_INDEPS 8 14 | #define FRACT_HARMONIUM 9 15 | #define FRACT_RED_DEATH 10 16 | #define FRACT_ANARCHIST 11 17 | #define FRACT_SIGNERS 12 18 | #define FRACT_SENSATES 13 19 | #define FRACT_CIPHERS 14 20 | #define FRACT_CHAOSMEN 15 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /plug-ins/runtime/interpreter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/interpreter.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/iomanager.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/iomanager.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/iptoaddr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/iptoaddr.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/iptoaddr.h: -------------------------------------------------------------------------------- 1 | #ifndef _IPTOADDR__H_ 2 | #define _IPTOADDR__H_ 3 | 4 | #define IPTABLE_WORLD "ipc.bin" 5 | #define IPTABLE_RUSSIA "ipr.bin" 6 | 7 | void load_iptoaddr(); 8 | char *ip_to_addr(unsigned long ip); 9 | 10 | void iptoaddr_init(); 11 | void iptoaddr_destroy(); 12 | 13 | #endif //_IPTOADDR__H_ 14 | -------------------------------------------------------------------------------- /plug-ins/runtime/item.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/item.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/journal.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/journal.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/limits.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/limits.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/magic.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/magic.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/mail.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/mail.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/mail.h: -------------------------------------------------------------------------------- 1 | #ifndef MUD_MAIL_H 2 | #define MUD_MAIL_H 3 | /* ************************************************************************ 4 | * File: mail.h Part of CircleMUD * 5 | * Usage: header file for mail system * 6 | * * 7 | * All rights reserved. See license.doc for complete information. * 8 | * * 9 | * Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * 10 | * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * 11 | ************************************************************************ */ 12 | 13 | #include "mail-decl.h" 14 | 15 | /******* MUD MAIL SYSTEM HEADER FILE ********************** 16 | *** written by Jeremy Elson (jelson@circlemud.org) *** 17 | *********************************************************/ 18 | 19 | int scan_file(void); 20 | int has_mail(long recipient); 21 | void store_mail(long to, long from, char *message_pointer); 22 | char *read_delete(long recipient); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /plug-ins/runtime/map.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/map.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/mobact.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/mobact.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/mobmax.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/mobmax.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/mobmax.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/mobmax.h -------------------------------------------------------------------------------- /plug-ins/runtime/modify.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/modify.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/pk.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/pk.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/pk.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/pk.h -------------------------------------------------------------------------------- /plug-ins/runtime/registration.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/registration.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/remorts.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/remorts.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/scriptboard.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/scriptboard.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/scriptboard.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2009 4 | */ 5 | #ifndef SCRIPTBOARD_H 6 | #define SCRIPTBOARD_H 7 | 8 | 9 | void cs_post(struct char_data *ch, char *arg); 10 | void cs_cancel(struct char_data *ch); 11 | 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /plug-ins/runtime/shop.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/shop.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/shop.h: -------------------------------------------------------------------------------- 1 | #ifndef SHOP_H 2 | #define SHOP_H 3 | /* ************************************************************************ 4 | * File: shop.h Part of CircleMUD * 5 | * Usage: shop file definitions, structures, constants * 6 | * * 7 | * All rights reserved. See license.doc for complete information. * 8 | * * 9 | * Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * 10 | * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * 11 | ************************************************************************ */ 12 | 13 | int transaction_amt(char *arg); 14 | 15 | bool boot_shops(void); 16 | bool save_shops(void); 17 | 18 | bool regain_shops(void); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /plug-ins/runtime/sp_define.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/sp_define.h -------------------------------------------------------------------------------- /plug-ins/runtime/spec_procs.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/spec_procs.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/spell_parser.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/spell_parser.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/spells.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/spells.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/spells.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/spells.h -------------------------------------------------------------------------------- /plug-ins/runtime/utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/utils.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/utils.h -------------------------------------------------------------------------------- /plug-ins/runtime/weather.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/weather.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xbody.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xbody.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xboot.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xboot.h -------------------------------------------------------------------------------- /plug-ins/runtime/xenchant.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xenchant.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xmob.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xmob.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xobj.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xobj.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xquests.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xquests.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xsave.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xsave.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xscripts.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xscripts.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xskills.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xskills.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xspells.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xspells.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xtempl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xtempl.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xwld.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xwld.cpp -------------------------------------------------------------------------------- /plug-ins/runtime/xzon.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/plug-ins/runtime/xzon.cpp -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libplanescape_impl.la 2 | 3 | bin_PROGRAMS = planescape 4 | 5 | CXXLD = $(CXX) 6 | 7 | SUBDIRS = \ 8 | core \ 9 | fenia \ 10 | io \ 11 | xparser \ 12 | xformat 13 | 14 | include $(top_srcdir)/src/Makefile.inc 15 | INCLUDES = $(INCLUDES_SRC) 16 | 17 | 18 | ##################################################### 19 | # planescape implementation library 20 | # 21 | libplanescape_impl_la_SOURCES = \ 22 | impl.cpp \ 23 | memutils.cpp \ 24 | structs.cpp 25 | 26 | libplanescape_impl_la_LIBADD = \ 27 | $(top_builddir)/libdreamland/libdreamland.la \ 28 | core/libcore.la \ 29 | fenia/libfenia.la \ 30 | io/libio.la \ 31 | xparser/libxparser.la \ 32 | xformat/libxformat.la \ 33 | -lcrypt 34 | 35 | ##################################################### 36 | # planescape binary 37 | # 38 | planescape_SOURCES = main.cpp 39 | 40 | planescape_LDADD = \ 41 | libplanescape_impl.la \ 42 | $(top_builddir)/libdreamland/libdreamland.la 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/Makefile.inc: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/libdreamland/Makefile.inc 2 | INCLUDES_SRC = \ 3 | $(INCLUDES_DREAMLAND) \ 4 | -I$(srcdir) \ 5 | -I$(top_builddir)/src \ 6 | -I$(top_builddir) \ 7 | -I$(top_srcdir)/src \ 8 | -I$(top_srcdir)/src/core \ 9 | -I$(top_srcdir)/src/fenia \ 10 | -I$(top_srcdir)/src/io \ 11 | -I$(top_srcdir)/src/xparser \ 12 | -I$(top_srcdir)/src/xformat 13 | -------------------------------------------------------------------------------- /src/core/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libcore.la 2 | 3 | SUBDIRS = 4 | 5 | include $(top_srcdir)/src/Makefile.inc 6 | INCLUDES = $(INCLUDES_SRC) 7 | 8 | libcore_la_SOURCES = \ 9 | mudpluginmanager.cpp \ 10 | mudscheduler.cpp \ 11 | planescape.cpp \ 12 | mudstats.cpp 13 | 14 | libcore_la_MOC = \ 15 | planescape.h \ 16 | mudstats.h 17 | -------------------------------------------------------------------------------- /src/core/mudpluginmanager.cpp: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2009 4 | */ 5 | #include "mudpluginmanager.h" 6 | #include "planescape.h" 7 | 8 | DLString MudPluginManager::getTablePath( ) const 9 | { 10 | return mud->getLibexecDir( ).getPath( ); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/core/mudpluginmanager.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2009 4 | */ 5 | #ifndef MUDPLUGINMANAGER_H 6 | #define MUDPLUGINMANAGER_H 7 | 8 | #include "pluginmanager.h" 9 | 10 | /* 11 | * MudPluginManager: a plugin manager specific for this mud 12 | */ 13 | class MudPluginManager : public PluginManager { 14 | public: 15 | virtual DLString getTablePath( ) const; 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/core/mudscheduler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/core/mudscheduler.h -------------------------------------------------------------------------------- /src/core/planescape.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/core/planescape.cpp -------------------------------------------------------------------------------- /src/db-decl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/db-decl.h -------------------------------------------------------------------------------- /src/events-decl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/events-decl.h -------------------------------------------------------------------------------- /src/fenia/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libfenia.la 2 | 3 | include $(top_srcdir)/src/Makefile.inc 4 | INCLUDES = $(INCLUDES_SRC) 5 | 6 | CXXLD = $(CXX) 7 | 8 | libfenia_la_SOURCES = \ 9 | feniamanager.cpp \ 10 | wrapperbase.cpp \ 11 | wrappermanagerbase.cpp \ 12 | wrappertarget.cpp \ 13 | schedulerwrapper.cpp \ 14 | idcontainer.cpp \ 15 | regcontainer.cpp \ 16 | reglist.cpp \ 17 | guts.cpp 18 | 19 | libfenia_la_MOC = \ 20 | regcontainer.h \ 21 | reglist.h \ 22 | schedulerwrapper.h \ 23 | wrapperbase.h \ 24 | guts.h 25 | -------------------------------------------------------------------------------- /src/fenia/README: -------------------------------------------------------------------------------- 1 | startup: 2 | gc = false 3 | init context (root == 0) -- FeniaWorld ctor 4 | load world -- FeniaWorld fromXML 5 | load root -- --//-- 6 | register classes -- feniaroot initialization 7 | recover -- --//-- 8 | ... 9 | boot db -- ...normal bootup 10 | ... 11 | gc = true -- feniaroot scheduler task 12 | validate world -- --//-- 13 | (if root == 0, create new one) --//-- 14 | 15 | destruction: 16 | gc = false 17 | backup (and clear) 18 | unregister classes 19 | 20 | initialization: 21 | register classes 22 | recover 23 | gc = true 24 | validate world (if root == 0, create new one) 25 | 26 | shutdown: 27 | gc = false 28 | backup (and clear) 29 | unregister classes 30 | save 31 | 32 | -------------------------------------------------------------------------------- /src/fenia/guts.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: guts.cpp,v 1.1.2.1 2009/11/04 03:24:31 rufina Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | #include "guts.h" 6 | 7 | #include "register-impl.h" 8 | #include "xmlregister.h" 9 | 10 | bool 11 | Guts::toXML( XMLNode::Pointer& parent ) const 12 | { 13 | const_iterator i; 14 | 15 | for(i = begin(); i != end(); i++) { 16 | XMLNode::Pointer node(NEW); 17 | 18 | node->setName(Lex::getThis()->getName(i->first)); 19 | 20 | if (i->second.toXML(node)) 21 | parent->appendChild(node); 22 | } 23 | 24 | return true; 25 | } 26 | 27 | void 28 | Guts::fromXML( const XMLNode::Pointer& parent ) throw ( ExceptionBadType ) 29 | { 30 | clear(); 31 | XMLContainer::fromXML(parent); 32 | } 33 | 34 | bool 35 | Guts::nodeFromXML( const XMLNode::Pointer& child) 36 | { 37 | const DLString &name = child->getName(); 38 | Lex::id_t id = Lex::getThis()->resolve(name); 39 | 40 | (*this)[id].fromXML(child); 41 | return true; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/fenia/guts.h: -------------------------------------------------------------------------------- 1 | /* $Id: guts.h,v 1.1.2.1 2009/11/04 03:24:31 rufina Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | #ifndef __GUTS_H__ 6 | #define __GUTS_H__ 7 | 8 | #include 9 | 10 | #include "fenia/handler.h" 11 | #include "xmlregister.h" 12 | #include "xmlvariablecontainer.h" 13 | #include "lex.h" 14 | 15 | using Scripting::Lex; 16 | using Scripting::Register; 17 | using Scripting::RegisterList; 18 | using Scripting::XMLRegister; 19 | 20 | class GutsField : public XMLVariableContainer { 21 | XML_OBJECT 22 | public: 23 | XML_VARIABLE XMLRegister backref, target; 24 | }; 25 | 26 | class Guts : public std::map, public virtual XMLContainer { 27 | public: 28 | typedef ::Pointer Pointer; 29 | 30 | virtual bool nodeFromXML( const XMLNode::Pointer& node ); 31 | virtual void fromXML( const XMLNode::Pointer& node ) throw ( ExceptionBadType ); 32 | virtual bool toXML( XMLNode::Pointer& node ) const; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/fenia/idcontainer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/fenia/idcontainer.cpp -------------------------------------------------------------------------------- /src/fenia/regcontainer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/fenia/regcontainer.cpp -------------------------------------------------------------------------------- /src/fenia/reglist.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/fenia/reglist.cpp -------------------------------------------------------------------------------- /src/fenia/schedulerwrapper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/fenia/schedulerwrapper.cpp -------------------------------------------------------------------------------- /src/fenia/subr.h: -------------------------------------------------------------------------------- 1 | /* $Id: subr.h,v 1.1.2.3 2005/09/11 22:50:53 rufina Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | 6 | #ifndef __SUBR_H__ 7 | #define __SUBR_H__ 8 | 9 | #include "exceptions.h" 10 | #include "register-impl.h" 11 | 12 | template 13 | WT *wrapper_cast(const Scripting::Register ®) 14 | { 15 | WT *t = dynamic_cast(reg.toHandler().getPointer()); 16 | 17 | if(!t) 18 | throw Scripting::InvalidCastException(typeid(WT).name( ), 19 | reg.toHandler()->getType( )); 20 | 21 | return t; 22 | } 23 | 24 | template 25 | WT *wrapper_cast(Scripting::Object *obj) 26 | { 27 | WT *t = dynamic_cast(obj->getHandler().getPointer()); 28 | 29 | if(!t) 30 | throw Scripting::InvalidCastException(typeid(WT).name( ), 31 | obj->getHandler()->getType( )); 32 | 33 | return t; 34 | } 35 | 36 | 37 | #endif /* __SUBR_H__ */ 38 | -------------------------------------------------------------------------------- /src/fenia/wrapperbase.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/fenia/wrapperbase.cpp -------------------------------------------------------------------------------- /src/fenia/wrappermanagerbase.cpp: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2009 4 | */ 5 | #include "logstream.h" 6 | #include "wrappermanagerbase.h" 7 | #include "wrapperbase.h" 8 | #include "subr.h" 9 | 10 | WrapperManagerBase::WrapperMap WrapperManagerBase::map; 11 | 12 | void WrapperManagerBase::markAlive(long long id) 13 | { 14 | WrapperMap::iterator i = map.find(id); 15 | 16 | if (i == map.end()) 17 | return; 18 | 19 | WrapperBase *wbase = i->second->getHandler().getDynamicPointer(); 20 | wbase->setAlive(); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/fenia/wrappertarget.cpp: -------------------------------------------------------------------------------- 1 | /* $Id: wrappertarget.cpp,v 1.1.2.3.6.1 2009/11/04 03:24:31 rufina Exp $ 2 | * 3 | * ruffina, 2004 4 | */ 5 | 6 | #include "fenia/register-impl.h" 7 | 8 | #include "wrapperbase.h" 9 | #include "feniamanager.h" 10 | #include "wrappertarget.h" 11 | 12 | WrapperTarget::WrapperTarget( ) : wrapper( 0 ) 13 | { 14 | } 15 | 16 | WrapperBase * WrapperTarget::getWrapper( ) 17 | { 18 | if (wrapper && wrapper->hasHandler( )) 19 | return wrapper->getHandler( ).getDynamicPointer( ); 20 | else 21 | return NULL; 22 | } 23 | 24 | void WrapperTarget::extractWrapper(bool forever) 25 | { 26 | if (wrapper) 27 | getWrapper()->extract(forever); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/impl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/impl.cpp -------------------------------------------------------------------------------- /src/io/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libio.la 2 | 3 | SUBDIRS = 4 | 5 | include $(top_srcdir)/src/Makefile.inc 6 | INCLUDES = $(INCLUDES_SRC) 7 | 8 | libio_la_SOURCES = \ 9 | textfileloader.cpp \ 10 | mudfilereader.cpp \ 11 | mudfile.cpp 12 | 13 | libio_la_MOC = 14 | -------------------------------------------------------------------------------- /src/io/mudfile.cpp: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2009 4 | */ 5 | #include "mudfile.h" 6 | #include "planescape.h" 7 | 8 | MudFile::MudFile() 9 | { 10 | } 11 | 12 | MudFile::MudFile(const DLString &dirName, const DLString &filename, const DLString &fileext) 13 | : DLFile(DLDirectory(mud->getBaseDir(), dirName), 14 | filename, 15 | fileext) 16 | { 17 | } 18 | 19 | MudFile::MudFile(const DLFile &dir, const DLString &filename, const DLString &fileext) 20 | : DLFile(DLDirectory(mud->getBaseDir(), dir), 21 | filename, 22 | fileext) 23 | { 24 | } 25 | 26 | MudFile::~MudFile() 27 | { 28 | } 29 | 30 | 31 | ShareFile::ShareFile(const DLString &dirName, const DLString &filename, const DLString &fileext) 32 | : DLFile(DLDirectory(mud->getShareDir(), dirName), 33 | filename, 34 | fileext) 35 | { 36 | } 37 | 38 | ShareFile::ShareFile(const DLFile &dir, const DLString &filename, const DLString &fileext) 39 | : DLFile(DLDirectory(mud->getShareDir(), dir), 40 | filename, 41 | fileext) 42 | { 43 | } 44 | 45 | ShareFile::~ShareFile() 46 | { 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/io/mudfile.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2009 4 | */ 5 | #ifndef MUDFILE_H 6 | #define MUDFILE_H 7 | 8 | #include "dlfile.h" 9 | 10 | struct MudFile : public DLFile { 11 | MudFile(); 12 | MudFile(const DLString &dirName, const DLString &filename = DLString::emptyString, const DLString &fileext = DLString::emptyString); 13 | MudFile(const DLFile &dir, const DLString &filename = DLString::emptyString, const DLString &fileext = DLString::emptyString); 14 | virtual ~MudFile(); 15 | }; 16 | 17 | struct ShareFile : public DLFile { 18 | ShareFile(const DLString &dirName, const DLString &filename = DLString::emptyString, const DLString &fileext = DLString::emptyString); 19 | ShareFile(const DLFile &dir, const DLString &filename = DLString::emptyString, const DLString &fileext = DLString::emptyString); 20 | virtual ~ShareFile(); 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/io/mudfilereader.cpp: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2009 4 | */ 5 | #include "mudfilereader.h" 6 | #include "planescape.h" 7 | 8 | MudFileReader::MudFileReader(const DLString &dirName) 9 | { 10 | tableDir = DLDirectory(mud->getShareDir(), dirName); 11 | } 12 | 13 | DLDirectory MudFileReader::getTableDir() const 14 | { 15 | return tableDir; 16 | } 17 | 18 | DLString MudFileReader::getIndexName() const 19 | { 20 | return mud->modMini ? mud->indexFileMini 21 | : mud->indexFile; 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/io/mudfilereader.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2009 4 | */ 5 | #ifndef MUDFILEREADER_H 6 | #define MUDFILEREADER_H 7 | 8 | #include "dlfileloader.h" 9 | 10 | class MudFileReader : public DLFileReaderByIndex { 11 | public: 12 | MudFileReader(const DLString &dirPath); 13 | 14 | protected: 15 | virtual DLDirectory getTableDir() const; 16 | virtual DLString getIndexName() const; 17 | 18 | DLDirectory tableDir; 19 | }; 20 | 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/io/textfileloader.cpp: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2009 4 | */ 5 | #include "textfileloader.h" 6 | #include "planescape.h" 7 | 8 | TextFileLoader::TextFileLoader() 9 | { 10 | checkDuplicate(mud->getTextFileLoader()); 11 | } 12 | 13 | DLDirectory TextFileLoader::getTableDir() const 14 | { 15 | return mud->getTextDir(); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/io/textfileloader.h: -------------------------------------------------------------------------------- 1 | /* $Id$ 2 | * 3 | * ruffina, 2009 4 | */ 5 | #ifndef TEXTFILELOADER_H 6 | #define TEXTFILELOADER_H 7 | 8 | #include "oneallocate.h" 9 | #include "dlfileloader.h" 10 | 11 | class TextFileLoader : public OneAllocate, public DLFileLoader { 12 | public: 13 | TextFileLoader(); 14 | 15 | protected: 16 | virtual DLDirectory getTableDir() const; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/spells-decl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/spells-decl.h -------------------------------------------------------------------------------- /src/structs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/structs.h -------------------------------------------------------------------------------- /src/sysdep.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/sysdep.h -------------------------------------------------------------------------------- /src/xformat/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libxformat.la 2 | 3 | SUBDIRS = 4 | 5 | include $(top_srcdir)/src/Makefile.inc 6 | INCLUDES = $(INCLUDES_SRC) 7 | 8 | libxformat_la_SOURCES = \ 9 | xbody.cpp \ 10 | xenchant.cpp \ 11 | xmaterial.cpp \ 12 | xmob.cpp \ 13 | xobj.cpp \ 14 | xquests.cpp \ 15 | xsave.cpp \ 16 | xscripts.cpp \ 17 | xskills.cpp \ 18 | xspells.cpp \ 19 | xtempl.cpp \ 20 | xwld.cpp \ 21 | xzon.cpp \ 22 | xshop.cpp \ 23 | xhelp.cpp 24 | 25 | libxformat_la_MOC = 26 | -------------------------------------------------------------------------------- /src/xformat/list_commands.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/list_commands.h -------------------------------------------------------------------------------- /src/xformat/parser_id.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/parser_id.h -------------------------------------------------------------------------------- /src/xformat/xbody.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xbody.cpp -------------------------------------------------------------------------------- /src/xformat/xbody.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xbody.h -------------------------------------------------------------------------------- /src/xformat/xenchant.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xenchant.cpp -------------------------------------------------------------------------------- /src/xformat/xenchant.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xenchant.h -------------------------------------------------------------------------------- /src/xformat/xhelp.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xhelp.cpp -------------------------------------------------------------------------------- /src/xformat/xhelp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xhelp.h -------------------------------------------------------------------------------- /src/xformat/xmaterial.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xmaterial.cpp -------------------------------------------------------------------------------- /src/xformat/xmaterial.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xmaterial.h -------------------------------------------------------------------------------- /src/xformat/xmob.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xmob.cpp -------------------------------------------------------------------------------- /src/xformat/xmob.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xmob.h -------------------------------------------------------------------------------- /src/xformat/xobj.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xobj.cpp -------------------------------------------------------------------------------- /src/xformat/xobj.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xobj.h -------------------------------------------------------------------------------- /src/xformat/xquests.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xquests.cpp -------------------------------------------------------------------------------- /src/xformat/xquests.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xquests.h -------------------------------------------------------------------------------- /src/xformat/xsave.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xsave.cpp -------------------------------------------------------------------------------- /src/xformat/xsave.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xsave.h -------------------------------------------------------------------------------- /src/xformat/xscripts.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xscripts.cpp -------------------------------------------------------------------------------- /src/xformat/xscripts.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xscripts.h -------------------------------------------------------------------------------- /src/xformat/xshop.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xshop.cpp -------------------------------------------------------------------------------- /src/xformat/xshop.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xshop.h -------------------------------------------------------------------------------- /src/xformat/xskills.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xskills.cpp -------------------------------------------------------------------------------- /src/xformat/xskills.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xskills.h -------------------------------------------------------------------------------- /src/xformat/xspells.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xspells.cpp -------------------------------------------------------------------------------- /src/xformat/xspells.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xspells.h -------------------------------------------------------------------------------- /src/xformat/xtempl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xtempl.cpp -------------------------------------------------------------------------------- /src/xformat/xtempl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xtempl.h -------------------------------------------------------------------------------- /src/xformat/xwld.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xwld.cpp -------------------------------------------------------------------------------- /src/xformat/xwld.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xwld.h -------------------------------------------------------------------------------- /src/xformat/xzon.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xzon.cpp -------------------------------------------------------------------------------- /src/xformat/xzon.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xformat/xzon.h -------------------------------------------------------------------------------- /src/xparser/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libxparser.la 2 | 3 | SUBDIRS = 4 | 5 | include $(top_srcdir)/src/Makefile.inc 6 | INCLUDES = $(INCLUDES_SRC) 7 | 8 | libxparser_la_SOURCES = \ 9 | parser.cpp \ 10 | parser_const.cpp \ 11 | parser_file.cpp \ 12 | parser_items.cpp \ 13 | parser_readcfg.cpp \ 14 | expr.cpp \ 15 | strlib.cpp 16 | 17 | libxparser_la_MOC = 18 | -------------------------------------------------------------------------------- /src/xparser/expr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/expr.cpp -------------------------------------------------------------------------------- /src/xparser/expr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/expr.h -------------------------------------------------------------------------------- /src/xparser/parser.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/parser.cpp -------------------------------------------------------------------------------- /src/xparser/parser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/parser.h -------------------------------------------------------------------------------- /src/xparser/parser_const.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/parser_const.cpp -------------------------------------------------------------------------------- /src/xparser/parser_const.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/parser_const.h -------------------------------------------------------------------------------- /src/xparser/parser_file.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/parser_file.cpp -------------------------------------------------------------------------------- /src/xparser/parser_file.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSER_FILE_H 2 | #define PARSER_FILE_H 3 | 4 | class CParserFile { 5 | int fd; 6 | int Level; 7 | char Buffer[500]; 8 | 9 | void SaveOld(void); 10 | char* GetNumSp(void); 11 | 12 | int WordPos; 13 | char* GetWord(char*, int&); 14 | 15 | bool StrListOut; 16 | public: 17 | CParserFile(); 18 | ~CParserFile(); 19 | 20 | bool Open(const char*, bool); 21 | void Close(void); 22 | 23 | void StartLevel(void); 24 | void AddCommand(const char*, ...); 25 | void AddString(const char*, char*); 26 | void AddScripts(const char*, int*, int); 27 | 28 | void EndLine(void); 29 | int GetLevel(void); 30 | void NextLevel(void); 31 | void CloseStruct(void); 32 | 33 | void NewStrList(void); 34 | void AddStrList(const char*, char*); 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/xparser/parser_items.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/parser_items.cpp -------------------------------------------------------------------------------- /src/xparser/parser_items.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/parser_items.h -------------------------------------------------------------------------------- /src/xparser/parser_readcfg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/parser_readcfg.cpp -------------------------------------------------------------------------------- /src/xparser/parser_readcfg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/parser_readcfg.h -------------------------------------------------------------------------------- /src/xparser/parser_types.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSER_TYPES_H 2 | #define PARSER_TYPES_H 3 | 4 | #ifndef _MINGW_ 5 | typedef unsigned char BYTE; 6 | #endif 7 | 8 | #define TYPE_INT 0 // int 9 | #define TYPE_STRING 1 // char* 10 | #define TYPE_STRUCT 2 11 | #define TYPE_VECTOR 3 // char* 12 | #define TYPE_LIST 4 // int 13 | #define TYPE_RANDOM 5 // char* 14 | #define TYPE_SCRIPT 6 // int* 15 | #define TYPE_STRLIST 7 // int, int 16 | #define TYPE_FLOAT 8 // float 17 | #define TYPE_EXPR 9 18 | #define TYPE_LONGLONG 10 19 | 20 | #define PARAM_INT 0 21 | #define PARAM_FLOAT 1 22 | #define PARAM_STRING 2 23 | #define PARAM_LONGLONG 3 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/xparser/parser_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSER_UTILS_H 2 | #define PARSER_UTILS_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include "logstream.h" 18 | #define log notice 19 | 20 | #define MEMALARM(size) \ 21 | do { \ 22 | syserr("Memory allocation error, size %d", size); \ 23 | ALARM; \ 24 | } while (0) 25 | 26 | #define ALARM \ 27 | do { \ 28 | syserr("Critical error at %s:%d.", __FILE__, __LINE__); \ 29 | abort(); \ 30 | } while(0) 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/xparser/strlib.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/strlib.cpp -------------------------------------------------------------------------------- /src/xparser/strlib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/planescape-mud/planescape_code/0689e4adcb1c57f4b09a4c911957b11afcaa5e5f/src/xparser/strlib.h --------------------------------------------------------------------------------