Thread: [SlashMUD-developers] SF.net SVN: slashmud: [2] trunk
Status: Alpha
Brought to you by:
koryn
From: <ko...@us...> - 2008-05-04 04:05:13
|
Revision: 2 http://slashmud.svn.sourceforge.net/slashmud/?rev=2&view=rev Author: koryn Date: 2008-05-03 21:05:10 -0700 (Sat, 03 May 2008) Log Message: ----------- Remove .svn directories from 'dist/' after copy from 'world/'. Modified Paths: -------------- trunk/Makefile.am trunk/Makefile.in Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2008-05-03 05:56:27 UTC (rev 1) +++ trunk/Makefile.am 2008-05-04 04:05:10 UTC (rev 2) @@ -335,7 +335,6 @@ cp src/BUILD_NUMBER src/BUILD_NUMBER.dist # Runs after the 'all' target. -# The touch commands prevent the application from being built again if only the build number has changed. epilogue: $(FIND) src -type f -name "*.[ch]" | $(XARGS) $(WC) | $(GREP) total @scripts/auto_increment.sh @@ -344,6 +343,7 @@ @if [ -f ./slashmudx.debug ] ; then cp ./slashmudx.debug ./dist/ ; fi @if [ -f ./slashmudx ] ; then cp ./slashmudx ./dist/ ; fi @cp -r ./world/* ./dist/ + @pushd dist && find . -type d -name ".svn" | xargs rm -rf && popd src/version.c: cp src/version.c.dist src/version.c Modified: trunk/Makefile.in =================================================================== --- trunk/Makefile.in 2008-05-03 05:56:27 UTC (rev 1) +++ trunk/Makefile.in 2008-05-04 04:05:10 UTC (rev 2) @@ -5650,7 +5650,6 @@ cp src/BUILD_NUMBER src/BUILD_NUMBER.dist # Runs after the 'all' target. -# The touch commands prevent the application from being built again if only the build number has changed. epilogue: $(FIND) src -type f -name "*.[ch]" | $(XARGS) $(WC) | $(GREP) total @scripts/auto_increment.sh @@ -5659,6 +5658,7 @@ @if [ -f ./slashmudx.debug ] ; then cp ./slashmudx.debug ./dist/ ; fi @if [ -f ./slashmudx ] ; then cp ./slashmudx ./dist/ ; fi @cp -r ./world/* ./dist/ + @pushd dist && find . -type d -name ".svn" | xargs rm -rf && popd src/version.c: cp src/version.c.dist src/version.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ko...@us...> - 2008-05-04 06:20:33
|
Revision: 3 http://slashmud.svn.sourceforge.net/slashmud/?rev=3&view=rev Author: koryn Date: 2008-05-03 23:20:32 -0700 (Sat, 03 May 2008) Log Message: ----------- Build 3235: fix for portal selftest. Modified Paths: -------------- trunk/TODO trunk/src/config.h trunk/src/portal_object.c trunk/src/portal_object.h trunk/src/portal_overrides.c trunk/src/self_test.c trunk/src/version.c Modified: trunk/TODO =================================================================== --- trunk/TODO 2008-05-04 04:05:10 UTC (rev 2) +++ trunk/TODO 2008-05-04 06:20:32 UTC (rev 3) @@ -3,12 +3,12 @@ * REMEMBER TO INCLUDE THE BUILD NUMBER IN THE CVS LOG MESSAGE. - 98349 235304 2472628 total -Auto-incrementing build number to 3209. -* 70 FIXMEs remaining in src/. -* 40 TODOs remaining in src/. -* 6 FIXMEs remaining in plugins/. -* 153 TODOs remaining in plugins/. + 98454 235542 2476290 total +Auto-incrementing build number to 3235. +* 99 FIXMEs remaining in src/. +* 80 TODOs remaining in src/. +* 10 FIXMEs remaining in plugins/. +* 260 TODOs remaining in plugins/. * [FEATURE] Creatures heal quicker when they have less than a third of their HP remaining. @@ -17,6 +17,8 @@ * [INTERNAL] Implemented many FIXME and TODO items. +* [SELFTEST] Fixed bug in portal selftest. + ------------------------------------------------------------------------------- * [BUG] (Koryn) Agents can't examine items by ID. Modified: trunk/src/config.h =================================================================== --- trunk/src/config.h 2008-05-04 04:05:10 UTC (rev 2) +++ trunk/src/config.h 2008-05-04 06:20:32 UTC (rev 3) @@ -185,22 +185,22 @@ #define SELECT_TYPE_ARG5 (struct timeval *) /* build version C compiler flags. */ -#define SLASHMUD_BUILD_CFLAGS "-arch i386 -arch ppc -Wall -I/usr/local/include -std=c99 -no-cpp-precomp -Werror-implicit-function-declaration -O2 -finline-functions" +#define SLASHMUD_BUILD_CFLAGS " -Wall -I/Users/koryn/development/temp2/slashmud/trunk/libraries/kdg/include -std=c99 -no-cpp-precomp -Werror-implicit-function-declaration -O2 -finline-functions" /* build version C++ compiler flags. */ -#define SLASHMUD_BUILD_CXXFLAGS "-arch i386 -arch ppc -Wall -Wall -I/usr/local/include -no-cpp-precomp -O2 -finline-functions" +#define SLASHMUD_BUILD_CXXFLAGS " -Wall -Wall -I/Users/koryn/development/temp2/slashmud/trunk/libraries/kdg/include -no-cpp-precomp -O2 -finline-functions" /* canonical host string. */ -#define SLASHMUD_CANONICAL_HOST "i686-apple-darwin8.11.1" +#define SLASHMUD_CANONICAL_HOST "i386-apple-darwin9.2.2" /* debug version C compiler flags. */ -#define SLASHMUD_DEBUG_CFLAGS "-arch i386 -arch ppc -Wall -I/usr/local/include -std=c99 -no-cpp-precomp -Werror-implicit-function-declaration -g -O0 -fbounds-check" +#define SLASHMUD_DEBUG_CFLAGS " -Wall -I/Users/koryn/development/temp2/slashmud/trunk/libraries/kdg/include -std=c99 -no-cpp-precomp -Werror-implicit-function-declaration -g -O0 -fbounds-check" /* debug version C++ compiler flags. */ -#define SLASHMUD_DEBUG_CXXFLAGS "-arch i386 -arch ppc -Wall -Wall -I/usr/local/include -no-cpp-precomp -g -O0 -fbounds-check" +#define SLASHMUD_DEBUG_CXXFLAGS " -Wall -Wall -I/Users/koryn/development/temp2/slashmud/trunk/libraries/kdg/include -no-cpp-precomp -g -O0 -fbounds-check" /* linker flags. */ -#define SLASHMUD_LDFLAGS "-arch i386 -arch ppc -L/usr/local/lib -all_load" +#define SLASHMUD_LDFLAGS " -L/Users/koryn/development/temp2/slashmud/trunk/libraries/kdg -all_load" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 Modified: trunk/src/portal_object.c =================================================================== --- trunk/src/portal_object.c 2008-05-04 04:05:10 UTC (rev 2) +++ trunk/src/portal_object.c 2008-05-04 06:20:32 UTC (rev 3) @@ -45,14 +45,14 @@ void dispose_portal_data(PortalHeaderPtr portal) { - if (portal->mTargetRoom) + if (portal->mTargetRoomName) { - release_string(portal->mTargetRoom); + release_string(portal->mTargetRoomName); } - if (portal->mTargetPortal) + if (portal->mTargetPortalName) { - release_string(portal->mTargetPortal); + release_string(portal->mTargetPortalName); } if (portal->mPortalCommand) @@ -145,9 +145,9 @@ assert(living); /* Try for a destination portal. */ - if (self->portal_data.mTargetPortal) + if (self->portal_data.mTargetPortalName) { - name = self->portal_data.mTargetPortal; + name = self->portal_data.mTargetPortalName; dst_portal = portal_manager_get_by_name(name); if (dst_portal) @@ -169,9 +169,9 @@ } /* Otherwise check the destination room. */ - if ((NULL == dst_room) && self->portal_data.mTargetRoom) + if ((NULL == dst_room) && self->portal_data.mTargetRoomName) { - name = self->portal_data.mTargetRoom; + name = self->portal_data.mTargetRoomName; dst_room = room_manager_get_by_name(name); } @@ -427,13 +427,43 @@ portal_set_target_room(PortalPtr self, const char* target) { assert(self); - self->portal_data.mTargetRoom = replace_string(self->portal_data.mTargetRoom, target); + assert(target); + + self->portal_data.mTargetRoomName = replace_string(self->portal_data.mTargetRoomName, target); } void +portal_clear_target_room(PortalPtr self) +{ + assert(self); + + if (self->portal_data.mTargetRoomName) + { + release_string(self->portal_data.mTargetRoomName); + self->portal_data.mTargetRoomName = NULL; + } +} + + +void portal_set_target_portal(PortalPtr self, const char* target) { assert(self); - self->portal_data.mTargetPortal = replace_string(self->portal_data.mTargetPortal, target); + assert(target); + + self->portal_data.mTargetPortalName = replace_string(self->portal_data.mTargetPortalName, target); } + + +void +portal_clear_target_portal(PortalPtr self) +{ + assert(self); + + if (self->portal_data.mTargetPortalName) + { + release_string(self->portal_data.mTargetPortalName); + self->portal_data.mTargetPortalName = NULL; + } +} Modified: trunk/src/portal_object.h =================================================================== --- trunk/src/portal_object.h 2008-05-04 04:05:10 UTC (rev 2) +++ trunk/src/portal_object.h 2008-05-04 06:20:32 UTC (rev 3) @@ -11,8 +11,8 @@ struct PortalHeader { - const char* mTargetRoom; - const char* mTargetPortal; + const char* mTargetRoomName; + const char* mTargetPortalName; const char* mPortalCommand; const char* mPortalEnterMessageTarget; const char* mPortalEnterMessageRoom; @@ -56,7 +56,9 @@ void portal_convert_wander_message_enter(PortalPtr self, char* buffer, unsigned int buflen); void portal_convert_wander_message_exit(PortalPtr self, char* buffer, unsigned int buflen); void portal_set_target_room(PortalPtr self, const char* target); +void portal_clear_target_room(PortalPtr self); void portal_set_target_portal(PortalPtr self, const char* target); +void portal_clear_target_portal(PortalPtr self); #ifdef __cplusplus Modified: trunk/src/portal_overrides.c =================================================================== --- trunk/src/portal_overrides.c 2008-05-04 04:05:10 UTC (rev 2) +++ trunk/src/portal_overrides.c 2008-05-04 06:20:32 UTC (rev 3) @@ -231,11 +231,11 @@ } else if (strcmp(token, "portal-target-room") == 0) { - self->portal_data.mTargetRoom = replace_string(self->portal_data.mTargetRoom, remainder); + self->portal_data.mTargetRoomName = replace_string(self->portal_data.mTargetRoomName, remainder); } else if (strcmp(token, "portal-target-portal") == 0) { - self->portal_data.mTargetPortal = replace_string(self->portal_data.mTargetPortal, remainder); + self->portal_data.mTargetPortalName = replace_string(self->portal_data.mTargetPortalName, remainder); } else { @@ -337,15 +337,15 @@ kg_save_text_add_line(save_text, buffer); } - if (self->portal_data.mTargetRoom) + if (self->portal_data.mTargetRoomName) { - snprintf(buffer, kSaveBufferBytes, "portal-target-room %s", self->portal_data.mTargetRoom); + snprintf(buffer, kSaveBufferBytes, "portal-target-room %s", self->portal_data.mTargetRoomName); kg_save_text_add_line(save_text, buffer); } - if (self->portal_data.mTargetPortal) + if (self->portal_data.mTargetPortalName) { - snprintf(buffer, kSaveBufferBytes, "portal-target-portal %s", self->portal_data.mTargetPortal); + snprintf(buffer, kSaveBufferBytes, "portal-target-portal %s", self->portal_data.mTargetPortalName); kg_save_text_add_line(save_text, buffer); } @@ -396,14 +396,14 @@ thing_note_ptrs(base); - if (self->portal_data.mTargetRoom) + if (self->portal_data.mTargetRoomName) { - kg_memory_note_ptr((Ptr) self->portal_data.mTargetRoom); + kg_memory_note_ptr((Ptr) self->portal_data.mTargetRoomName); } - if (self->portal_data.mTargetPortal) + if (self->portal_data.mTargetPortalName) { - kg_memory_note_ptr((Ptr) self->portal_data.mTargetPortal); + kg_memory_note_ptr((Ptr) self->portal_data.mTargetPortalName); } if (self->portal_data.mPortalCommand) Modified: trunk/src/self_test.c =================================================================== --- trunk/src/self_test.c 2008-05-04 04:05:10 UTC (rev 2) +++ trunk/src/self_test.c 2008-05-04 06:20:32 UTC (rev 3) @@ -60,6 +60,9 @@ /* Maximum amount of time the group combat can go without a death before it is declared a draw. */ #define GROUP_COMBAT_SECONDS 300 +/* How many times to repeat the portal transportation tests. */ +#define PORTAL_TRANSPORTATION_COUNT 500 + /* Mac OS X headers. */ #if CALENDAR_CACHE_PROFILE #include <ppc_intrinsics.h> @@ -119,6 +122,7 @@ static unsigned int test_owner_uuid(void); static unsigned int test_plugin_callback(PluginPtr plugin, void* context); static unsigned int test_plugins(void); +static unsigned int test_portal_bug(void); static unsigned int test_portal_transport(void); static unsigned int test_portals(void); static unsigned int test_potions(void); @@ -238,11 +242,15 @@ get_quarantine_room(void) { RoomPtr quarantine = (RoomPtr) new_room_instance(); + char buffer[64]; assert(quarantine); - base_set_name((BasePtr) quarantine, "quarantine"); - room_set_room_name(quarantine, "quarantine"); + snprintf(buffer, 64, "quarantine_%u", (unsigned int) clock()); + + base_set_name((BasePtr) quarantine, buffer); + base_set_standard_name((BasePtr) quarantine, buffer); + room_set_room_name(quarantine, buffer); base_increment_light((BasePtr) quarantine, 10); quarantine->room_data.mZone = zone_manager_get_by_name("default"); @@ -2916,10 +2924,10 @@ static unsigned int -test_portal_transport(void) +test_portal_bug(void) { RoomPtr quarantine = get_quarantine_room(); - RoomPtr destination = (RoomPtr) get_random_room(); + RoomPtr destination = room_manager_get_by_name("kanesouthhall01"); PortalPtr portal; PortalPtr target_portal; MonsterPtr monster; @@ -2929,41 +2937,23 @@ virtual_finish_loading((BasePtr) portal, (BasePtr) quarantine); assert(portal->base_data.mEnvironment == (BasePtr) quarantine); - /* Set the portal's destination room. */ - portal_set_target_room(portal, base_get_standard_name((BasePtr) destination)); - /* Create a monster. */ - monster = (MonsterPtr) get_random_object(kStandardLibraryMonster, quarantine); + monster = (MonsterPtr) standard_library_load_typed_object(kStandardLibraryMonster, "golddragon2"); + virtual_finish_loading((BasePtr) monster, (BasePtr) quarantine); assert(monster->base_data.mEnvironment == (BasePtr) quarantine); - /* Put the monster through the portal. */ - portal_transport_living(portal, (LivingPtr) monster); - assert(monster->base_data.mEnvironment == (BasePtr) destination); - assert(portal->base_data.mEnvironment == (BasePtr) quarantine); - - /* Clean up. */ - virtual_finished((BasePtr) monster); - virtual_finished((BasePtr) portal); - - /* Try with a portal that has a destination portal (as opposed to a destination room. */ - portal = new_portal_instance(); - virtual_finish_loading((BasePtr) portal, (BasePtr) quarantine); - assert(portal->base_data.mEnvironment == (BasePtr) quarantine); - /* Create the destination portal. */ - target_portal = get_random_object(kStandardLibraryPortal, destination); + target_portal = (PortalPtr) standard_library_load_typed_object(kStandardLibraryPortal, "portal_a"); + virtual_finish_loading((BasePtr) target_portal, (BasePtr) destination); assert(target_portal->base_data.mEnvironment == (BasePtr) destination); - assert(mud_manager_verify_object(get_portal_manager(), target_portal)); + assert(target_portal == mud_manager_verify_object(get_portal_manager(), target_portal)); /* Set the portal's destination portal. */ portal_set_target_portal(portal, base_get_standard_name((BasePtr) target_portal)); - /* Create a monster. */ - monster = (MonsterPtr) get_random_object(kStandardLibraryMonster, quarantine); - assert(monster->base_data.mEnvironment == (BasePtr) quarantine); - /* Put the monster through the portal. */ portal_transport_living(portal, (LivingPtr) monster); + assert(target_portal->base_data.mEnvironment == (BasePtr) destination); assert(monster->base_data.mEnvironment == (BasePtr) destination); assert(portal->base_data.mEnvironment == (BasePtr) quarantine); @@ -2971,12 +2961,90 @@ virtual_finished((BasePtr) monster); virtual_finished((BasePtr) portal); virtual_finished((BasePtr) target_portal); + virtual_finished((BasePtr) destination); assert(NULL == mud_manager_verify_object(get_portal_manager(), portal)); assert(NULL == mud_manager_verify_object(get_portal_manager(), target_portal)); quarantine = dispose_quarantine_room(quarantine); + + return 1; +} + + +static unsigned int +test_portal_transport(void) +{ + unsigned int index; + for (index = 0; index < PORTAL_TRANSPORTATION_COUNT; index++) + { + RoomPtr quarantine = get_quarantine_room(); + RoomPtr destination = get_random_room(); + PortalPtr portal; + PortalPtr target_portal; + MonsterPtr monster; + + /* Create a portal and put it in the quarantine room. */ + portal = new_portal_instance(); + virtual_finish_loading((BasePtr) portal, (BasePtr) quarantine); + assert(portal->base_data.mEnvironment == (BasePtr) quarantine); + + /* Set the portal's destination room. */ + portal_clear_target_room(portal); + portal_clear_target_portal(portal); + portal_set_target_room(portal, base_get_standard_name((BasePtr) destination)); + + /* Create a monster. */ + monster = (MonsterPtr) get_random_object(kStandardLibraryMonster, quarantine); + assert(monster->base_data.mEnvironment == (BasePtr) quarantine); + + /* Put the monster through the portal. */ + portal_transport_living(portal, (LivingPtr) monster); + assert(monster->base_data.mEnvironment == (BasePtr) destination); + assert(portal->base_data.mEnvironment == (BasePtr) quarantine); + + /* Clean up. */ + virtual_finished((BasePtr) monster); + virtual_finished((BasePtr) portal); + + /* Try with a portal that has a destination portal (as opposed to a destination room. */ + portal = new_portal_instance(); + virtual_finish_loading((BasePtr) portal, (BasePtr) quarantine); + assert(portal->base_data.mEnvironment == (BasePtr) quarantine); + + /* Create the destination portal. */ + target_portal = get_random_object(kStandardLibraryPortal, destination); + assert(target_portal->base_data.mEnvironment == (BasePtr) destination); + assert(target_portal == mud_manager_verify_object(get_portal_manager(), target_portal)); + + /* Set the portal's destination portal. */ + portal_clear_target_room(portal); + portal_clear_target_portal(portal); + portal_set_target_portal(portal, base_get_standard_name((BasePtr) target_portal)); + + /* Create a monster. */ + monster = (MonsterPtr) get_random_object(kStandardLibraryMonster, quarantine); + assert(monster->base_data.mEnvironment == (BasePtr) quarantine); + + /* Put the monster through the portal. */ + portal_transport_living(portal, (LivingPtr) monster); + assert(target_portal->base_data.mEnvironment == (BasePtr) destination); + assert(monster->base_data.mEnvironment == (BasePtr) destination); + assert(portal->base_data.mEnvironment == (BasePtr) quarantine); + + /* Clean up. */ + virtual_finished((BasePtr) monster); + virtual_finished((BasePtr) portal); + virtual_finished((BasePtr) target_portal); + virtual_finished((BasePtr) destination); + + assert(NULL == mud_manager_verify_object(get_portal_manager(), portal)); + assert(NULL == mud_manager_verify_object(get_portal_manager(), target_portal)); + + quarantine = dispose_quarantine_room(quarantine); + } + return 1; } @@ -4327,7 +4395,6 @@ } } server_dispose_objects(); - quarantine = dispose_quarantine_room(quarantine); return 1; } @@ -4337,7 +4404,7 @@ static TestInfo uSelfTest[] = { /* New tests go at the top for convenience. - { test_room_connections, "Testing rooms for non-existent connections", 0 }, + { test_portal_transport, "Testing portal transportation", 0 }, { NULL, NULL }, */ /* Bug regression tests. */ @@ -4345,6 +4412,7 @@ { test_stats, "Regression test for missing stat name", 0 }, { test_talk_list_manager, "Regression test for uninitialized talk list manager", 0 }, { test_unwield_all, "Regression test for 'unwield all' bug. Also tests 'wield all' command.", 0 }, + { test_portal_bug, "Regression test for portal transportation", 0 }, /* Object Library tests. */ { test_ammoboxes, "Testing ammo boxes from the Object Library", 0 }, Modified: trunk/src/version.c =================================================================== --- trunk/src/version.c 2008-05-04 04:05:10 UTC (rev 2) +++ trunk/src/version.c 2008-05-04 06:20:32 UTC (rev 3) @@ -48,4 +48,4 @@ } -const unsigned int gBuildNumber = 3216; +const unsigned int gBuildNumber = 3235; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nt...@us...> - 2008-05-04 18:56:09
|
Revision: 6 http://slashmud.svn.sourceforge.net/slashmud/?rev=6&view=rev Author: ntiffin Date: 2008-05-04 11:55:56 -0700 (Sun, 04 May 2008) Log Message: ----------- Add scripts to run debug server and deprecate cvs instructions. Modified Paths: -------------- trunk/INSTALL Added Paths: ----------- trunk/scripts/gdb_commands.txt trunk/scripts/runServerDebug.sh Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2008-05-04 17:01:11 UTC (rev 5) +++ trunk/INSTALL 2008-05-04 18:55:56 UTC (rev 6) @@ -145,8 +145,57 @@ http://ccache.samba.org/ -Running the server from CVS +Running the server from SVN =========================== +TODO + + +Working with telnet clients +=========================== +The client used to communcate with the SlashMUD server must operate in +line mode. Windows XP & 2003 telent client does not. They both operate in character +mode. + +Windows clients known to work (mostly checked early 2007) +----------------------------- +AVPlay - (ANSI Colors do not work) http://www.avalon-rpg.com/connect/avplay.html +DoNClient - http://www.deadofnight.org/DoNClient.shtml +KildClient - http://kildclient.sourceforge.net/phpwebsite/index.php +MudMagic - http://www.mudmagic.com/mud-client/windows_download +MushClient - http://www.gammon.com.au/downloads/dlmushclient.htm +PuTTY - http://www.chiark.greenend.org.uk/~sgtatham/putty/ +TinTin++ - http://tintin.sourceforge.net/ +TinyFugue - http://tinyfugue.sourceforge.net/ +WinTin.Net - http://wintin.org/ +z/Scope Express VT Local echo does not work, must be in line mode 'always' or RFC 1180 Compliant mode. - http://www.cybelesoft.com/ +zMUD - http://www.zuggsoft.com/zmud/zmudinfo.htm + +OS X clients known to work +-------------------------- +Apple OS X telnet +Savitar - http://www.heynow.com/Savitar/ (as of August 2007) +Nuntius - http://www.lobotomo.com/products/Nuntius/index.html (as of August 2007) + +Windows clients known NOT to work are +------------------------------------- +GMud +TeraTerm +Windows telnet +RoAClient - http://rhoneworld.com/rhoneware/roaclient/ +HyperTerminal Private Edition 6.3 +Absolute Telnet 5.35 +Dave's telnet - http://sourceforge.net/projects/dtelnet/ +mTelnet 1.0 +Kerberos Telnet - http://www.stacken.kth.se/~thn/ktelnet/ +Nexus Terminal - http://www.nexit.com/ + +OS X clients known NOT to work +------------------------------ +None at this time. + + +Running the server from CVS (deprecated) +======================================== Q: Would you please explain what I need to move in order to have a running server? @@ -199,46 +248,4 @@ 9. Enter the "auxiliary" folder and run the server from the terminal. Type "./slashmudx" or "./debug_slashmudx.sh" -Working with telnet clients -=========================== -The client used to communcate with the SlashMUD server must operate in -line mode. Windows XP & 2003 telent client does not. They both operate in character -mode. -Windows clients known to work (mostly checked early 2007) ------------------------------ -AVPlay - (ANSI Colors do not work) http://www.avalon-rpg.com/connect/avplay.html -DoNClient - http://www.deadofnight.org/DoNClient.shtml -KildClient - http://kildclient.sourceforge.net/phpwebsite/index.php -MudMagic - http://www.mudmagic.com/mud-client/windows_download -MushClient - http://www.gammon.com.au/downloads/dlmushclient.htm -PuTTY - http://www.chiark.greenend.org.uk/~sgtatham/putty/ -TinTin++ - http://tintin.sourceforge.net/ -TinyFugue - http://tinyfugue.sourceforge.net/ -WinTin.Net - http://wintin.org/ -z/Scope Express VT � Local echo does not work, must be in line mode 'always' or RFC 1180 Compliant mode. - http://www.cybelesoft.com/ -zMUD - http://www.zuggsoft.com/zmud/zmudinfo.htm - -OS X clients known to work --------------------------- -Apple OS X telnet -Savitar - http://www.heynow.com/Savitar/ (as of August 2007) -Nuntius - http://www.lobotomo.com/products/Nuntius/index.html (as of August 2007) - -Windows clients known NOT to work are -------------------------------------- -GMud -TeraTerm -Windows telnet -RoAClient - http://rhoneworld.com/rhoneware/roaclient/ -HyperTerminal Private Edition 6.3 -Absolute Telnet 5.35 -Dave's telnet - http://sourceforge.net/projects/dtelnet/ -mTelnet 1.0 -Kerberos Telnet - http://www.stacken.kth.se/~thn/ktelnet/ -Nexus Terminal - http://www.nexit.com/ - -OS X clients known NOT to work ------------------------------- -None at this time. - Added: trunk/scripts/gdb_commands.txt =================================================================== --- trunk/scripts/gdb_commands.txt (rev 0) +++ trunk/scripts/gdb_commands.txt 2008-05-04 18:55:56 UTC (rev 6) @@ -0,0 +1,55 @@ +# gdb commands + +define checkheap +set env MallocCheckHeapStart 1 +set env MallocCheckHeapEach 500 +end + +define mallocguard +set env MallocGuardEdges 1 +set env MallocCheckHeapAbort 1 +set env MallocBadFreeAbort 1 +end + +define guard +set env DYLD_FORCE_FLAT_NAMESPACE 1 +set env DYLD_INSERT_LIBRARIES /usr/lib/libgmalloc.B.dylib +end + +define guard-before +set env MALLOC_PROTECT_BEFORE 1 +end + +define guard-strict +set env MALLOC_STRING_SIZE 1 +end + +define maxguard +guard +guard-before +guard-strict +end + +mallocguard + +# break plugin_call_main_routine +# break plugin_init +# break plugin_dispose +# break plugin_manager_load_files + +# break mud_manager.c:1468 + +# break player_overrides.c:616 + +# fb advancementstone.c:pi_do_command + +# fb treknobabbler.c:pi_spout_off +# fb treknobabbler.c:pi_get_random_string + +# fb shop.c:pi_do_command +# fb shop.c:1575 +# fb shop.c:pi_parse_line +# fb shop.c:pi_do_list_goods + +# fb bandagebox.c:pi_do_command +# fb bandagebox.c:pi_bandage \ No newline at end of file Added: trunk/scripts/runServerDebug.sh =================================================================== --- trunk/scripts/runServerDebug.sh (rev 0) +++ trunk/scripts/runServerDebug.sh 2008-05-04 18:55:56 UTC (rev 6) @@ -0,0 +1,28 @@ +#!/bin/bash + +# Remove log files. +echo "" +echo "Removing log files in 3 seconds..." +sleep 3 +rm -f -v ../world/Logs/* + +# Determine if gdb is available. +if [ -f /usr/bin/gdb ]; then + + echo "" + echo "Found GDB - running slashmudx.debug in the debugger." + echo "If slashmudx crashes send the output from the 'bt' (backtrace) command to the slashmud-general mailing list," + echo "(see http://sourceforge.net/mail/?group_id=7518 for more) along with a description of what you were doing at the time." + echo "" + + gdb -x ./gdb_commands.txt -args ../slashmudx.debug --world ../world --loglevel debug --debug + +else + + echo "" + echo "Didn't find GDB - running slashmudx.debug without a debugger (bug reports are unlikely to be useful)." + echo "" + sleep 3 + ../slashmudx.debug + +fi \ No newline at end of file Property changes on: trunk/scripts/runServerDebug.sh ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nt...@us...> - 2008-06-01 23:43:36
|
Revision: 16 http://slashmud.svn.sourceforge.net/slashmud/?rev=16&view=rev Author: ntiffin Date: 2008-06-01 16:43:32 -0700 (Sun, 01 Jun 2008) Log Message: ----------- Add python server test code from cvs. Added Paths: ----------- trunk/test/ trunk/test/slashmud_test_common.py trunk/test/slashmud_test_config.py trunk/test/slashmud_test_misc.py trunk/test/slashmud_test_shop.py Added: trunk/test/slashmud_test_common.py =================================================================== --- trunk/test/slashmud_test_common.py (rev 0) +++ trunk/test/slashmud_test_common.py 2008-06-01 23:43:32 UTC (rev 16) @@ -0,0 +1,328 @@ +#!/sw/bin/python + +# $Id: slashmud_test_common.py,v 1.1 2007/06/10 20:41:15 ntiffin Exp $ + +# tested with python 2.4 +# (c) 2005, 2006, 2007 Neil Tiffin +# Released under the SlashMUD License + +import sys +import telnetlib +import time +import re +import sys + +from slashmud_test_config import * + +test_agent_commands = [] +test_living_commands = [] + +def calc_money( money_tuple ): + """ + Calculate the amount of money from individual denominations. + The Argument is a tuple with the following format: + (mithril, gold, silver, copper) + """ + return money_tuple[0] * 1000 + money_tuple[1] * 100 + money_tuple[2] * 10 + money_tuple[3] + + +def get_purse(): + """ + Get the amount of money from the purse. For example: + +-------- Purse of Neil ----------------------------------------+ + | 84 mithril. + | 4 gold. + | 3 silvers. + | 2 coppers. + +---------------------------------------------------------------+ + """ + global tn + tn.read_until(my_server_prompt, 2) + tn.write("purse\r\n") + mithril = 0 + gold = 0 + silver = 0 + copper = 0 + + string = ' ' + result = tn.read_until(my_server_prompt, 5) + print result + m = re.search(r'(\d+)\smithril', result) + if m != None: + string = m.group(1) + mithril = int(string) + m = re.search(r'(\d+)\sgold', result) + if m != None: + string = m.group(1) + gold = int(string) + m = re.search(r'(\d+)\ssilver', result) + if m != None: + string = m.group(1) + silver = int(string) + m = re.search(r'(\d+)\scopper', result) + if m != None: + string = m.group(1) + copper = int(string) + print (mithril, gold, silver, copper) + money = calc_money( (mithril, gold, silver, copper) ) + print_test_results(' Found in purse: %d' % (money) ) + return money + + +def get_score_details(): + """ + Result of score command + +-------- Agent Score for Neil ---------------------------------+ + | Neil the human. + | Class: None Score: 2923 Exploration: 0 + | Points: 1327/458 Victories: 0 Wimpy: 60 + | Hitpoints: 250 of 250. + | Spellpoints: 215 of 215. + | Charisma: 1 Initiative: 1 Intelligence: 25 + | Intuition: 25 Luck: 1 Skill: 25 + | Speed: 25 Stamina: 25 Strength: 25 + | You have been alive for 18 hours, 23 minutes and 42 seconds. + | Natural weapon (right hand): Up to 10 points of damage + | Natural weapon (left hand): Up to 10 points of damage + | Hunger: 0 Thirst: 100 Intoxication: 0 + +---------------------------------------------------------------+ + """ + global tests_passed, tests_failed, tn + + tn.read_until(my_server_prompt, 2) + tn.write('score\r\n') + # time.sleep(2) + result = tn.read_until(my_server_prompt, 5) + print result + + score_details = {} + string = '' + + m = re.search(r'Class\:\s+(\w+)', result) + if m != None: + string = m.group(1) + score_details["class"] = string + + m = re.search(r'Hitpoints\:.+?(\d+)\s+of\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["hitpoints"] = int(string) + string = m.group(2) + score_details["hitpoints_max"] = int(string) + + m = re.search(r'Spellpoints\:.+?(\d+)\s+of\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["spellpoints"] = int(string) + string = m.group(2) + score_details["spellpoints_max"] = int(string) + + m = re.search(r'Wimpy\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["wimpy"] = int(string) + + m = re.search(r'Victories\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["victories"] = int(string) + + m = re.search(r'Score\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["score"] = int(string) + + m = re.search(r'Exploration\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["exploration"] = int(string) + + m = re.search(r'Points\:\s+(\d+)\/(\d+)', result) + if m != None: + string = m.group(1) + score_details["spend_points"] = int(string) + string = m.group(2) + score_details["kill_points"] = int(string) + + m = re.search(r'Hunger\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["hunger"] = int(string) + + m = re.search(r'Thirst\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["thirst"] = int(string) + + m = re.search(r'Intoxication\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["intoxication"] = int(string) + + m = re.search(r'Charisma\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["charisma"] = int(string) + + m = re.search(r'Initiative\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["initiative"] = int(string) + + m = re.search(r'Intelligence\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["intelligence"] = int(string) + + m = re.search(r'Intuition\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["intuition"] = int(string) + + m = re.search(r'Luck\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["luck"] = int(string) + + m = re.search(r'Skill\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["skill"] = int(string) + + m = re.search(r'Speed\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["speed"] = int(string) + + m = re.search(r'Stamina\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["stamina"] = int(string) + + m = re.search(r'Strength\:\s+(\d+)', result) + if m != None: + string = m.group(1) + score_details["strength"] = int(string) + + return score_details + + +def login_to_server(): + """ Open test file and log into server. """ + global test_file_results, tn + + test_file_results = open(my_results_file_path + my_results_file_name, my_results_file_wa) + print_test_results("\n---------------------------------------------------------------------") + print_test_results("Test File Open: " + my_results_file_path + my_results_file_name) + + print_test_results( "Test Started At: " + time.asctime(time.localtime()) ) + print_test_results( sys.version ) + + tn = telnetlib.Telnet(my_server_addr, my_server_port) + print_test_results("Connection Open To: " + my_server_addr + " " + my_server_port) + + print tn.read_until("character:") + tn.write(my_character_name + '\r\n') + + print tn.read_until("password:") + tn.write(my_character_password + '\r\n') + print_test_results("Logged In To Character: " + my_character_name) + print tn.read_until(my_server_prompt) + return tn + + +def logout_of_server(tn, tests_passed, tests_failed): + """ Logout, close files, and print summary results. """ + + print_test_results('\n\nSummary Results %d Passed, %d Failed\n' % (tests_passed, tests_failed) ) + if tests_failed != 0: + print_test_results('*********** Tests Failed ***********\n') + + test_file_results.close() + + # to end the connection, make sure we are in a known room + tn.write("teleport n_shop1\r\n") + print tn.read_until(my_server_prompt, 2) + tn.write("quit\r\n") + print tn.read_until(my_server_prompt, 2) + + time.sleep(2) # let server close the connection + tn.close() + +def create_agent_commands(): + global test_agent_commands + # format of the commands + # ( command, arg1, arg1, arg3, arg4, success_string, failure_string) + + # ansi + # attach <object> [to] [<object>] + # attack + # badge [<local living>] + # body [<object>] + # clan + # class [<object>] + # coerce <target> <command> + # create <object> + # defend <object> + # drop <object> + # echo [<target>] <text> + # eq + # equipment + # events [<object>] + # exa + # examine [at][<object>][<direction>] + # find <item name> + # force + # frisk <local living> + # get <object> [from][<living>] + # gecho + # gecho + # goto <player> + # i + # inv + # inventory + # ip [<player>] + # listen + # lookall + # purse + # reclass + # reimburse <player> <integer> [<denomination>] + # renew + # restart [<seconds>] + # restore <target> [hitpoints | spellpoints | diseases | intoxication | hungar | thirst | gold | healing time] + # room + # score + # shape + # shutdown [<seconds>] + # sizeof [base | thing | armour | weapon | living | monster | player | room | game | attachment | skill | mood | social | race | door | armourtype | spirit | weapontype | plugin] + # skills + # snoop + # stat <local living> + test_agent_commands.append( ('stat', my_character_name, None, None, None, None, 'Sorry') ) + # teleport [<target>][to] <room name> + test_agent_commands.append( ('teleport', my_character_name, 'to', 'neilshop1a', None, None, 'Sorry') ) + # unlisten + # unsnoop + # visible (true | false ) + # where [all | living | monster | player] + # zap <local living> + + +def run_general_test_commands( command_list ): + for x in command_list: + if x[0] != None: + command = x[0] + else: + break; # error TODO + for y in [1, 2, 3, 4]: + if x[y] != None: + command = command + ' ' + x[y] + tn.write(command) + #TODO check command success + + +def print_test_results(string): + if my_print_to_file: + test_file_results.write(string + '\n') + if my_print_on_terminal: + print string Added: trunk/test/slashmud_test_config.py =================================================================== --- trunk/test/slashmud_test_config.py (rev 0) +++ trunk/test/slashmud_test_config.py 2008-06-01 23:43:32 UTC (rev 16) @@ -0,0 +1,26 @@ +#!/sw/bin/python + +# $Id: slashmud_test_config.py,v 1.1 2007/06/10 20:41:15 ntiffin Exp $ + +# tested with python 2.4 +# (c) 2007 Neil Tiffin +# Released under the SlashMUD License + +# ------------------------------------------------------------------ +# configurable variables +# to run tests on your system change these variables as necessary +# +my_character_password = 'nightmare' +my_character_name = 'neil' +my_results_file_name = 'slashmud_test_results.txt' +my_results_file_wa = 'a' # 'a' for append, 'w' for write over +my_results_file_path = '' +my_server_addr = 'localhost' +my_server_port = '6100' +my_server_prompt = 'Ok> ' +my_print_on_terminal = 1 # 1 = true, 0 = false +my_print_to_file = 1 # 1 = true, 0 = false +# +# end of configurable variables +# you should not have to change anything below this line +# ------------------------------------------------------------------ Added: trunk/test/slashmud_test_misc.py =================================================================== --- trunk/test/slashmud_test_misc.py (rev 0) +++ trunk/test/slashmud_test_misc.py 2008-06-01 23:43:32 UTC (rev 16) @@ -0,0 +1,94 @@ +#!/sw/bin/python + +# $Id: slashmud_test_misc.py,v 1.1 2007/06/10 20:41:15 ntiffin Exp $ + +# tested with python 2.4 +# (c) 2005, 2006, 2007 Neil Tiffin +# Released under the SlashMUD License + +import sys +import telnetlib +import time +import re +import sys + +from slashmud_test_config import * +from slashmud_test_common import * + +tests_failed = 0 +tests_passed = 0 +test_agent_commands = [] +test_living_commands = [] + +def test_drink(): + """Test fountains.""" + global tests_passed, tests_failed, tn + + tn.write("teleport n_fountains\r\n") + print_test_results( tn.read_until(my_server_prompt) ) + + score = get_score_details() + thirst = score.get("thirst") + tox = score.get("intoxication") + if thirst >= 100: + tests_failed += 1 + print_test_results("** Failed, thirst already at %d, can't go higher. **********" % (thirst)) + else: + print_test_results('\nStart Test: %s' % ('thirst')) + print score + tn.write("drink water\r\n") + print_test_results( tn.read_until(my_server_prompt) ) + score = get_score_details() + after_thirst = score.get("thirst") + print_test_results(" Thirst Effect: %d" % (after_thirst - thirst )) + if after_thirst == thirst + 10: + tests_passed += 1 + else: + tests_failed += 1 + # TODO finish test evaluation + + +def test_load_all_plugins(): + """Test plugins buy running around to each room and loading them.""" + global tests_passed, tests_failed, tn + + tn.write("teleport n_mentor\r\n") + print_test_results( tn.read_until(my_server_prompt) ) + + tn.write("teleport n_treknobabbler\r\n") + print_test_results( tn.read_until(my_server_prompt) ) + + tn.write("teleport n_fireswamp\r\n") + print_test_results( tn.read_until(my_server_prompt) ) + + tn.write("teleport n_gate2\r\n") + print_test_results( tn.read_until(my_server_prompt) ) + + tn.write("teleport n_advance\r\n") + print_test_results( tn.read_until(my_server_prompt) ) + + tn.write("teleport n_spouter\r\n") + print_test_results( tn.read_until(my_server_prompt) ) + + tn.write("teleport n_eliza\r\n") + print_test_results( tn.read_until(my_server_prompt) ) + + tn.write("teleport n_rent\r\n") + print_test_results( tn.read_until(my_server_prompt) ) + + tn.write("teleport n_autodestruct\r\n") + print_test_results( tn.read_until(my_server_prompt) ) + +########################## +# perform tests +########################## +tn = login_to_server() + +test_drink() + +test_load_all_plugins() + +########################## +#end tests +########################## +logout_of_server(tn, tests_passed, tests_failed) Added: trunk/test/slashmud_test_shop.py =================================================================== --- trunk/test/slashmud_test_shop.py (rev 0) +++ trunk/test/slashmud_test_shop.py 2008-06-01 23:43:32 UTC (rev 16) @@ -0,0 +1,141 @@ +#!/sw/bin/python + +# $Id: slashmud_test_shop.py,v 1.1 2007/06/10 20:41:15 ntiffin Exp $ + +# tested with python 2.4 +# (c) 2005, 2006, 2007 Neil Tiffin +# Released under the SlashMUD License + +import sys +import telnetlib +import time +import re +import sys + +############################### +# Global variables +############################### +tests_failed = 0 +tests_passed = 0 +tn = None +test_file_results = None + +from slashmud_test_config import * +from slashmud_test_common import * + +############################### +# Test Functions Follow +############################### + +def test_check_purse( needed_value ): + """ Validates the purse to have more money than the needed_value.""" + global tests_passed, tests_failed + print_test_results('\nCheck Initial Purse Value') + if needed_value <= 0: + print_test_results('** Failed to specify enough purse value ***************') + tests_failed += 1 + return 0 + before_buy = get_purse() + if before_buy >= needed_value: + print_test_results(' Found Enough Purse Value') + tests_passed += 1 + return before_buy + print_test_results('** Failed to Find Enough Purse Value ***************') + tests_failed += 1 + return 0 + + +def test_exhausted_items(): + """ Validates that no items remain in the shop.""" + global tn + global tests_passed, tests_failed + tn.write("list\r\n") + print_test_results('\nStart Item Exhausted Test') + test_string = "says, 'We do not have" + result = tn.read_until(test_string, 5) + if result.find(test_string) != -1: + print_test_results(" Item Exhausted Success") + tests_passed += 1 + return 1 + # print_test_results(result) + print_test_results("** Item Exhausted Failed **********") + tests_failed += 1 + return 0 + + +def test_buy_item( buy_item, before_buy_amount, buy_amount_tuple ): + global tests_passed, tests_failed, tn + + print_test_results('\nStart Test: %s' % ('buy ' + buy_item)) + tn.write('buy ' + buy_item + '\r\n') + after_buy = get_purse() + should_be = before_buy_amount - calc_money( buy_amount_tuple ) + print_test_results(' Before Buy: %d, After Buy: %d, After Should be: %d' % (before_buy_amount, after_buy, should_be) ) + if after_buy == should_be: + print_test_results(' Passed') + tests_passed += 1 + else: + print_test_results('** Failed **********') + tests_failed += 1 + return after_buy + + +def test_buy_items_no_replenish_followup(): + """Should be run after test_buy_items_no_replenish() and a suitable + time has elapsed to assure items did not show up again.""" + global tn + tn.write("teleport n_shop1b\r\n") + print tn.read_until(my_server_prompt) + test_exhausted_items() + print_test_results(" Exhausted items tested at: " + time.asctime(time.localtime())) + return + + +def test_buy_items_no_replenish(): + """test buying items that do not replinish. """ + tn.write("teleport n_shop1b\r\n") + time.sleep(1) + print tn.read_until(my_server_prompt) + + tn.write("list\r\n") + time.sleep(1) + print tn.read_until(my_server_prompt) + print tn.read_until(my_server_prompt, 2) + + before_buy = test_check_purse(120000) + if before_buy: + before_buy = test_buy_item('shield1', before_buy, (0, 0, 0, 1)) + before_buy = test_buy_item('shield2', before_buy, (0, 0, 0, 2)) + before_buy = test_buy_item('shield4', before_buy, (0, 0, 0, 9)) + before_buy = test_buy_item('shield5', before_buy, (0, 0, 1, 0)) + before_buy = test_buy_item('shield6', before_buy, (0, 0, 1, 1)) + before_buy = test_buy_item('shield7', before_buy, (0, 0, 9, 9)) + before_buy = test_buy_item('shield8', before_buy, (0, 1, 0, 0)) + before_buy = test_buy_item('shield9', before_buy, (0, 1, 0, 1)) + before_buy = test_buy_item('shield10', before_buy, (0, 9, 9, 9)) + before_buy = test_buy_item('shield11', before_buy, (1, 0, 0, 0)) + before_buy = test_buy_item('shield12', before_buy, (1, 0, 0, 1)) + before_buy = test_buy_item('shield13', before_buy, (10, 0, 0, 1)) + + print_test_results(" Last item bought at: " + time.asctime(time.localtime())) + return + + +########################## +# perform tests +########################## +tn = login_to_server() +create_agent_commands() +test_buy_items_no_replenish() +test_buy_items_no_replenish_followup() + +# delay +time.sleep(60) + +# run this test again at end just to be sure items did not show up +test_buy_items_no_replenish_followup() +########################## +#end tests +########################## +logout_of_server(tn, tests_passed, tests_failed) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nt...@us...> - 2008-05-04 19:38:34
|
Revision: 7 http://slashmud.svn.sourceforge.net/slashmud/?rev=7&view=rev Author: ntiffin Date: 2008-05-04 12:38:30 -0700 (Sun, 04 May 2008) Log Message: ----------- Update for correct run location. Modified Paths: -------------- trunk/INSTALL trunk/scripts/gdb_commands.txt trunk/scripts/runServerDebug.sh Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2008-05-04 18:55:56 UTC (rev 6) +++ trunk/INSTALL 2008-05-04 19:38:30 UTC (rev 7) @@ -8,21 +8,44 @@ * To build: Mac OS X Developer Tools - libgc 6.8 installed in /usr/local/lib - libgc can be found at http://hpl.hp.com/personal/Hans_Boehm/gc/ - GNU libtool 1.5 * To regenerate the slashlex parser: bison 2.1 (http://ftp.gnu.org/gnu/bison/bison-2.1.tar.gz) flex 2.5.4 -* To regenerate the configure script from configure.ac: - automake 1.9.6 (v1.6.3 that ships with OS X will report errors) - autoconf 2.59 - BUILDING ======== +Conversion to SVN done - the tag in CVS is "SVN_MIGRATION_POINT". (May 3, 2008) + +Assuming all the prerequisites are in place: + + autoconf 2.61 + automake 1.10 + gcc 4.0.1 + libtool 1.5.24 + +it should just work by checking out the repository and using the +provided scripts: + + $ mkdir my_subversion_directory + $ cd my_subversion_directory + $ svn checkout https://slashmud.svn.sourceforge.net/svnroot/slashmud slashmud + $ cd slashmud/trunk + $ scripts/buildStandard.sh + +The contents of the "dist" directory will then contain the server +binaries, plugins, and world files ready to use. Once the +buildStandard.sh script has been run, a simple 'make' will rebuild the +server and plugin binaries. + +To run the server do the following: + $ cd dists + $ ./slashmudx + + +OLD CVS BUILD INSTRUCTIONS (FIXME Do these stay?) +========================== Configure the server and plugins with the provided configure script: $ ./configure Modified: trunk/scripts/gdb_commands.txt =================================================================== --- trunk/scripts/gdb_commands.txt 2008-05-04 18:55:56 UTC (rev 6) +++ trunk/scripts/gdb_commands.txt 2008-05-04 19:38:30 UTC (rev 7) @@ -52,4 +52,4 @@ # fb shop.c:pi_do_list_goods # fb bandagebox.c:pi_do_command -# fb bandagebox.c:pi_bandage \ No newline at end of file +# fb bandagebox.c:pi_bandage Modified: trunk/scripts/runServerDebug.sh =================================================================== --- trunk/scripts/runServerDebug.sh 2008-05-04 18:55:56 UTC (rev 6) +++ trunk/scripts/runServerDebug.sh 2008-05-04 19:38:30 UTC (rev 7) @@ -4,7 +4,7 @@ echo "" echo "Removing log files in 3 seconds..." sleep 3 -rm -f -v ../world/Logs/* +rm -f -v ../dist/Logs/* # Determine if gdb is available. if [ -f /usr/bin/gdb ]; then @@ -15,7 +15,8 @@ echo "(see http://sourceforge.net/mail/?group_id=7518 for more) along with a description of what you were doing at the time." echo "" - gdb -x ./gdb_commands.txt -args ../slashmudx.debug --world ../world --loglevel debug --debug + gdb -x ./gdb_commands.txt -args ../dist/slashmudx.debug --world ../dist --loglevel debug --debug + #gdb -x ./gdb_commands.txt -args ../dist/slashmudx.debug --world ../dist --loglevel debug --check-memory else @@ -25,4 +26,4 @@ sleep 3 ../slashmudx.debug -fi \ No newline at end of file +fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nt...@us...> - 2008-05-06 14:05:34
|
Revision: 9 http://slashmud.svn.sourceforge.net/slashmud/?rev=9&view=rev Author: ntiffin Date: 2008-05-06 07:05:11 -0700 (Tue, 06 May 2008) Log Message: ----------- Parse line updates. Modified Paths: -------------- trunk/plugins/BountyHunter/bountyhunter.c trunk/plugins/CommonPluginSources/plugin_utilities.c trunk/plugins/CountAPIUsage.pl trunk/plugins/CurrencyExchange/currencyexchange.c trunk/plugins/DisarmSkill/disarmskill.c trunk/plugins/Dragonbane/dragonbane.c trunk/plugins/EnergyDrainAttachment/energydrainattachment.c trunk/plugins/EnergyDrainSkill/energydrainskill.c trunk/plugins/Housing/housing.c trunk/plugins/InvisibilityAttachment/invisibilityattachment.c trunk/plugins/InvisibilitySkill/invisibilityskill.c trunk/plugins/InvulnerabilityAttachment/invulnerabilityattachment.c trunk/plugins/InvulnerabilitySkill/invulnerabilityskill.c trunk/plugins/MagicShieldAttachment/magicshieldattachment.c trunk/plugins/MagicShieldSkill/magicshieldskill.c trunk/plugins/ParrySkill/parryskill.c trunk/plugins/PoisonAttachment/poisonattachment.c trunk/plugins/PreemptSkill/preemptskill.c trunk/plugins/PushSkill/pushskill.c trunk/plugins/QuestAttachment/questattachment.c trunk/plugins/QuestEvent/questevent.c trunk/plugins/QuestEvent/questevent.h trunk/plugins/QuestMaster/questmaster.cc trunk/plugins/Rent/rent.c trunk/plugins/Riddle/riddle.c trunk/plugins/Shop/shop.c trunk/plugins/SleepAttachment/sleepattachment.c trunk/plugins/SleepSkill/sleepskill.c trunk/plugins/SummonSkill/summonskill.c trunk/plugins/TeleportSkill/teleportskill.c trunk/plugins/TestCPluginThing/testcpluginthing.c trunk/world/Modules/Testing/Areas/neiltestrooms Added Paths: ----------- trunk/scripts/openLogs.sh trunk/scripts/open_plugins_bbedit.sh Property Changed: ---------------- trunk/plugins/CommonPluginSources/plugin_utilities.h trunk/plugins/CountAPIUsage.pl trunk/plugins/QuestEvent/questevent.h Modified: trunk/plugins/BountyHunter/bountyhunter.c =================================================================== --- trunk/plugins/BountyHunter/bountyhunter.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/BountyHunter/bountyhunter.c 2008-05-06 14:05:11 UTC (rev 9) @@ -55,25 +55,34 @@ } InstanceData, *InstanceDataPtr; + +/* Plugin Defaults. */ static const char *kBountyHunterDefaultName = "bounty hunter"; static const char *kBountyHunterDefaultAlias = "bounty hunter mercenary"; static const char *kBountyHunterDefaultShortDesc = "A combat-hardened bounty hunter."; static const unsigned int kBountyHunterDefaultLevel = 15; static const gender_tag_t kBountyHunterDefaultGender = kMale; + +/* Lifecycle Event Handling Routines. */ static void pi_initialise(unsigned int event_ref); +static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); +static void pi_dispose_instance_data(InstanceDataPtr instance_data); + +/* Game Event Handling Routines. */ static void pi_register_events(unsigned int event_ref); static void pi_update(InstanceDataPtr instance_data); static unsigned int pi_parse_line(unsigned int selector, InstanceDataPtr instance_data); static ListPtr pi_create_save_list(InstanceDataPtr instance_data); -static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); -static void pi_dispose_instance_data(InstanceDataPtr instance_data); +/* Plugin Routines. */ +static void pi_enter_room(unsigned int event_ref, InstanceDataPtr instance_data); +static void pi_exit_room(unsigned int event_ref, InstanceDataPtr instance_data); + +/* Debug Routines. */ #ifndef NDEBUG static void pi_note_ptrs(InstanceDataPtr instance_data); #endif /* Debugging code. */ -static void pi_enter_room(unsigned int event_ref, InstanceDataPtr instance_data); -static void pi_exit_room(unsigned int event_ref, InstanceDataPtr instance_data); void @@ -277,7 +286,7 @@ if (line == NULL) { - return 0; + return kEventNotHandled; } strncpy(token_buf, line, LINE_MAX); @@ -285,6 +294,10 @@ token = strtok_r(token_buf, " \t\"\n", &context); if (token) { + if (strncmp(token, "bountyhunter-", 13) != 0) + { + return kEventNotHandled; + } remainder = strtok_r(NULL, "\"\n", &context); if (remainder) { @@ -295,46 +308,45 @@ if (race) { instance_data->mKillRace = race; - return 1; + return kEventHandledToCompletion; } else { - snprintf(token_buf, LINE_MAX, "BountyHunter plugin could not find race: %s", remainder); + snprintf(token_buf, LINE_MAX, "BountyHunter plugin could not find named race: %s", remainder); smapi_log_notice(token_buf); - return 0; } } else if (strcmp(token, "bountyhunter-name") == 0) { smapi_set_name((BasePtr) instance_data->mSelf, remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "bountyhunter-alias") == 0) { smapi_set_alias((BasePtr) instance_data->mSelf, remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "bountyhunter-short-desc") == 0) { smapi_set_short_desc((BasePtr) instance_data->mSelf, remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "bountyhunter-gender") == 0) { if (strcmp(remainder, "male") == 0) { smapi_set_gender((LivingPtr) instance_data->mSelf, kMale); - return 1; + return kEventHandledToCompletion; } else if (strcmp(remainder, "female") == 0) { smapi_set_gender((LivingPtr) instance_data->mSelf, kFemale); - return 1; + return kEventHandledToCompletion; } else { smapi_set_gender((LivingPtr) instance_data->mSelf, kNeuter); - return 1; + return kEventHandledToCompletion; } } else if (strcmp(token, "bountyhunter-level") == 0) @@ -344,15 +356,16 @@ if ((1 <= temp_uint) && (temp_uint <= 99)) { smapi_set_all_stats((LivingPtr) instance_data->mSelf, temp_uint); - return 1; + return kEventHandledToCompletion; } } } } - snprintf(token_buf, LINE_MAX, "BountyHunter plugin could not parse line: %s", line); + BasePtr object = (BasePtr) smapi_extract_parameter(event_ref, kParameterSelf); + assert(object); + snprintf(token_buf, LINE_MAX, "BountyHunter plugin: %s can not parse line: %s", smapi_get_standard_name(object), line); smapi_log_warning(token_buf); - - return 0; + return kEventNotHandled; } Modified: trunk/plugins/CommonPluginSources/plugin_utilities.c =================================================================== --- trunk/plugins/CommonPluginSources/plugin_utilities.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/CommonPluginSources/plugin_utilities.c 2008-05-06 14:05:11 UTC (rev 9) @@ -161,38 +161,41 @@ /* For disposing of a long description. Usually used in the Finished() routine */ /* for the plugin. */ -/* - void dispose_longdescription( PILongDescriptionPtr* theLD ) - { - if (theLD != NULL) - { - theLD.Finished; - theLD = NULL; - } - } +void +dispose_longdescription(PILongDescriptionPtr * theLD) +{ + if (theLD != NULL) + { + theLD.Finished; + theLD = NULL; + } +} - void add_to_longdescription( const char* theLine, PILongDescriptionPtr* theLongDescription ) - { - if (theLongDescription == NULL) - { - new(theLongDescription); - if (theLongDescription != NULL) - { - theLongDescription.Initialise; - theLongDescription.AddReference; - } - } +void +add_to_longdescription(const char *theLine, PILongDescriptionPtr * theLongDescription) +{ + if (theLongDescription == NULL) + { + new(theLongDescription); + if (theLongDescription != NULL) + { + theLongDescription.Initialise; + theLongDescription.AddReference; + } + } - if (theLongDescription != NULL) - { - #ifndef NDEBUG - /* smapi_assert_valid_ptr(theLongDescription, "", __FILE__, __LINE__); */ + if (theLongDescription != NULL) + { +#ifndef NDEBUG + smapi_assert_valid_ptr(theLongDescription, "", __FILE__, __LINE__); #endif -theLongDescription.AddLine(theLine); + theLongDescription.AddLine(theLine); + } } -} -*/char * + + +char * binary_to_str(unsigned int theunsigned) /*unsigned int Text */ { char *result = NULL; Property changes on: trunk/plugins/CommonPluginSources/plugin_utilities.h ___________________________________________________________________ Name: svn:keywords + Date Author Revision Id Modified: trunk/plugins/CountAPIUsage.pl =================================================================== --- trunk/plugins/CountAPIUsage.pl 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/CountAPIUsage.pl 2008-05-06 14:05:11 UTC (rev 9) @@ -5,7 +5,7 @@ # Written November 21, 2004 by Neil Tiffin # (c) 2004 Neil Tiffin, all rights reserved. # -# $Id: CountAPIUsage.pl,v 1.4 2007/04/16 21:34:57 ntiffin Exp $ +# $Id$ # # This source file is distributed under the terms of "The SlashMUD Licence". # Property changes on: trunk/plugins/CountAPIUsage.pl ___________________________________________________________________ Name: svn:keywords + Date Author Revision Id Modified: trunk/plugins/CurrencyExchange/currencyexchange.c =================================================================== --- trunk/plugins/CurrencyExchange/currencyexchange.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/CurrencyExchange/currencyexchange.c 2008-05-06 14:05:11 UTC (rev 9) @@ -9,7 +9,8 @@ This source file is distributed under the terms of the accompanying "Licence". - Created Wed April 11 + Created Wed April 11, 2007 + Not sure this is needed, started as an idea that was never finished. ----------------------------------------------------------------------------- */ @@ -50,12 +51,12 @@ ListPtr mCurrencyNameList; /* The list of Currencies the currency exchange can exchange. */ const char *mDefaultClerkName; - const char *mClerkName; /* The name of the shop clerk. */ + const char *mClerkName; /* The name of the clerk. */ unsigned int mExchangeFee; /* In server base value. */ - unsigned int mOpenDay; /* Is the shop normally open during the day. */ - unsigned int mOpenNight; /* Is the shop normally open during the night. */ - unsigned int mOpen; /* Is the shop currently open. */ + unsigned int mOpenDay; /* Is normally open during the day. */ + unsigned int mOpenNight; /* Is normally open during the night. */ + unsigned int mOpen; /* Is currently open. */ /* TODO Make this global configurable or from area files. */ unsigned int mLogTransactions; /* 1 = log, 0 = not logged */ @@ -64,32 +65,33 @@ } InstanceData, *InstanceDataPtr; -/* Lifecycle routines. */ -static void pi_initialise(unsigned int event_ref); +/* Lifecycle Event Handling Routines. */ static void pi_register_events(unsigned int event_ref); static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); static void pi_dispose_instance_data(InstanceDataPtr instance_data); +static void pi_initialise(unsigned int event_ref); -#ifndef NDEBUG -static void pi_note_ptrs(InstanceDataPtr instance_data); -static unsigned int pi_do_debug_room(LivingPtr living, const char *what, InstanceDataPtr instance_data); -#endif /* Debugging code. */ - +/* Game Event Handling Routines. */ static void pi_update(unsigned int event_ref, InstanceDataPtr instance_data); static void pi_enter_room(unsigned int event_ref, InstanceDataPtr instance_data); static void pi_exit_room(unsigned int event_ref, InstanceDataPtr instance_data); static unsigned int pi_do_command(unsigned int event_ref, InstanceDataPtr instance_data); static unsigned int pi_parse_line(unsigned int event_code, InstanceDataPtr instance_data); static ListPtr pi_create_save_list(InstanceDataPtr instance_data); + +/* Plugin Routines. */ static void pi_do_exchange(LivingPtr buyer, const char *what, InstanceDataPtr instance_data); static void pi_do_list_goods(LivingPtr living, InstanceDataPtr instance_data); static void pi_do_estimate(LivingPtr living, const char *what, InstanceDataPtr instance_data); static unsigned int pi_can_enter_room(unsigned int event_ref, InstanceDataPtr instance_data); +/* Debug Routines. */ +#ifndef NDEBUG +static void pi_note_ptrs(InstanceDataPtr instance_data); +static unsigned int pi_do_debug_room(LivingPtr living, const char *what, InstanceDataPtr instance_data); +#endif /* Debugging code. */ -static const unsigned int kShopPluginDefaultMarkup = 10; /* Default markup as a percent of item value. */ - void plugin_main(void *instance_data, unsigned int event_code, unsigned int event_ref) { @@ -181,9 +183,6 @@ line = smapi_get_string("Id: $Id$"); kg_list_add_last(list, (Ptr) line); - line = smapi_get_string("Author: Koryn Grant"); - kg_list_add_last(list, (Ptr) line); - line = smapi_get_string("Author: Neil Tiffin"); kg_list_add_last(list, (Ptr) line); @@ -209,7 +208,7 @@ smapi_register_event(event_ref, kPluginUpdate); smapi_register_event(event_ref, kPluginParseLine); smapi_register_event(event_ref, kPluginSave); - // smapi_register_event(event_ref, kPluginDoCommand); + smapi_register_event(event_ref, kPluginDoCommand); smapi_register_event(event_ref, kPluginEnterRoom); smapi_register_event(event_ref, kPluginExitRoom); smapi_register_event(event_ref, kPluginRoomCanEnterRoom); @@ -638,9 +637,8 @@ { char buffer[kCatchTellBufferBytes]; - snprintf(buffer, kCatchTellBufferBytes, "Shop plugin could not find currency: %s, used default currency in room %s.", remainder, smapi_get_name((BasePtr) instance_data->mRoom)); + snprintf(buffer, kCatchTellBufferBytes, "CurrencyExchange plugin could not find currency: %s, used default currency in room %s.", remainder, smapi_get_name((BasePtr) instance_data->mRoom)); smapi_log_notice(buffer); - return kEventNotHandled; } else { @@ -673,7 +671,7 @@ } } - snprintf(token_buf, LINE_MAX, "Shop plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "CurrencyExchange plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mRoom), line); smapi_log_warning(token_buf); return kEventNotHandled; } Modified: trunk/plugins/DisarmSkill/disarmskill.c =================================================================== --- trunk/plugins/DisarmSkill/disarmskill.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/DisarmSkill/disarmskill.c 2008-05-06 14:05:11 UTC (rev 9) @@ -56,12 +56,19 @@ } InstanceData, *InstanceDataPtr; + +/* Lifecycle Event Handling Routines. */ +static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); +static void pi_dispose_instance_data(InstanceDataPtr instance_data); + +/* Game Event Handling Routines. */ static void pi_register_events(unsigned int event_ref); static unsigned int pi_do_command(unsigned int event_ref, InstanceDataPtr instance_data); + +/* Plugin Routines. */ static void pi_attempt_disarm(LivingPtr invoker, LivingPtr target, InstanceDataPtr instance_data); -static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); -static void pi_dispose_instance_data(InstanceDataPtr instance_data); +/* Debug Routines. */ #ifndef NDEBUG static void pi_note_ptrs(InstanceDataPtr instance_data); #endif /* Debugging code. */ Modified: trunk/plugins/Dragonbane/dragonbane.c =================================================================== --- trunk/plugins/Dragonbane/dragonbane.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/Dragonbane/dragonbane.c 2008-05-06 14:05:11 UTC (rev 9) @@ -59,18 +59,24 @@ } InstanceData, *InstanceDataPtr; +/* Lifecycle Event Handling Routines. */ static void pi_register_events(unsigned int event_ref); static void pi_dispose_instance_data(InstanceDataPtr instance_data); +static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); -#ifndef NDEBUG -static void pi_note_ptrs(InstanceDataPtr instance_data); -#endif /* Debugging code. */ -static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); +/* Game Event Handling Routines. */ static unsigned int pi_parse_line(unsigned int event_ref, InstanceDataPtr instance_data); static ListPtr pi_create_save_list(InstanceDataPtr instance_data); + +/* Plugin Routines. */ static unsigned int pi_weapon_special_attack(InstanceDataPtr instance_data); +/* Debug Routines. */ +#ifndef NDEBUG +static void pi_note_ptrs(InstanceDataPtr instance_data); +#endif /* Debugging code. */ + void plugin_main(void *instance_data, unsigned int event_code, unsigned int event_ref) { @@ -214,8 +220,6 @@ { if (strncmp(token, "dragonbane-", 11)) { - snprintf(token_buf, LINE_MAX, "Received parse line that did not belong to plugin: %s", line); - smapi_log_debug(token_buf); return kEventNotHandled; } remainder = strtok_r(NULL, "\"\n", &context); @@ -227,7 +231,7 @@ if (strcmp(remainder, "") != 0) { instance_data->mRace = smapi_get_named_race(remainder); - return 1; + return kEventHandledToCompletion; } } else if (strcmp(token, "dragonbane-damage") == 0) @@ -236,15 +240,15 @@ if ((0 < temp_uint) && (temp_uint <= 999999)) { instance_data->mRaceDamage = temp_uint; - return 1; + return kEventHandledToCompletion; } } } } - snprintf(token_buf, LINE_MAX, "Dragonbane plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "Dragonbane plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mSelf), line); smapi_log_warning(token_buf); - return 0; + return kEventNotHandled; } Modified: trunk/plugins/EnergyDrainAttachment/energydrainattachment.c =================================================================== --- trunk/plugins/EnergyDrainAttachment/energydrainattachment.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/EnergyDrainAttachment/energydrainattachment.c 2008-05-06 14:05:11 UTC (rev 9) @@ -50,6 +50,11 @@ #define PLUGIN_NAME "energydrainattachment" +/* Plugin Defaults. */ +static const unsigned int kDefaultDrainSeconds = 30; + + +/* Instance Data. */ typedef struct InstanceData { AttachmentPtr mSelf; @@ -64,7 +69,6 @@ } InstanceData, *InstanceDataPtr; -static const unsigned int kDefaultDrainSeconds = 30; /* Lifecycle events. */ static void pi_register_events(unsigned int event_ref); Modified: trunk/plugins/EnergyDrainSkill/energydrainskill.c =================================================================== --- trunk/plugins/EnergyDrainSkill/energydrainskill.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/EnergyDrainSkill/energydrainskill.c 2008-05-06 14:05:11 UTC (rev 9) @@ -233,8 +233,6 @@ { if (strncmp(token, "energydrain-", 12)) { - snprintf(token_buf, LINE_MAX, "Received parse line that did not belong to plugin: %s", line); - smapi_log_debug(token_buf); return kEventNotHandled; } @@ -247,7 +245,7 @@ if (remainder) { instance_data->mAttachmentName = smapi_replace_string(instance_data->mAttachmentName, remainder); - return 1; + return kEventHandledToCompletion; } } else if (strcmp(token, "energydrain-skill-name") == 0) @@ -256,7 +254,7 @@ if (remainder) { instance_data->mSkillName = smapi_replace_string(instance_data->mSkillName, remainder); - return 1; + return kEventHandledToCompletion; } } else if (strcmp(token, "energydrain-duration") == 0) @@ -269,21 +267,21 @@ if (temp_uint <= kMaximumDuration) { instance_data->mDuration = temp_uint; - return 1; + return kEventHandledToCompletion; } else { instance_data->mDuration = kMaximumDuration; snprintf(token_buf, LINE_MAX, "Received energydrain-duration of %u which is greater than the max of %u.", temp_uint, kMaximumDuration); - smapi_log_notice(token_buf); + smapi_log_warning(token_buf); } } } } } - snprintf(token_buf, LINE_MAX, "EnergyDrain plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "EnergyDrain plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mSkill), line); smapi_log_warning(token_buf); - return 0; + return kEventNotHandled; } Modified: trunk/plugins/Housing/housing.c =================================================================== --- trunk/plugins/Housing/housing.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/Housing/housing.c 2008-05-06 14:05:11 UTC (rev 9) @@ -1,13 +1,17 @@ /* $Id$ */ -/* - * Housing. - * - * Copyright 2007 Koryn Grant. All Rights Reserved. - * Feel free to adapt this code to create your own SlashMUD Plugins. - */ +/* ----------------------------------------------------------------------------- + Housing from SlashMUDServer. + \xA9 Copyright 2007 Koryn Grant. All Rights Reserved. + Feel free to adapt this code to create your own SlashMUD Plugins. + + This source file is distributed under the terms of "The SlashMUD Licence". + + ----------------------------------------------------------------------------- */ + + /* SlashMUD headers. */ #include "buffer_sizes.h" #include "object_types.h" @@ -50,25 +54,30 @@ } HousingData, *HousingDataPtr; -/* Lifecycle events. */ -static void pi_initialise(unsigned int event_ref); + +/* Lifecycle Event Handling Routines. */ static void pi_register_events(unsigned int event_ref); -static void pi_finished(void); static HousingDataPtr pi_create_instance_data(unsigned int event_ref); static void pi_dispose_instance_data(HousingDataPtr housing); -#ifndef NDEBUG -static void pi_note_ptrs(HousingDataPtr housing); -#endif /* Debugging code. */ - +/* Game Event Handling Routines. */ static unsigned int pi_do_command(unsigned int event_ref, HousingDataPtr housing); static unsigned int pi_parse_line(unsigned int event_ref, HousingDataPtr housing); +static void pi_initialise(unsigned int event_ref); +static void pi_finished(void); + +/* Plugin Routines. */ static void pi_save_housing(unsigned int event_ref, HousingDataPtr housing); static void pi_store_item(HousingDataPtr housing, BasePtr invoker, const char *remainder); static void pi_remove_item(HousingDataPtr housing, BasePtr invoker, const char *remainder); static void pi_list_items(HousingDataPtr housing, BasePtr invoker, const char *player_name); +/* Debug Routines. */ +#ifndef NDEBUG +static void pi_note_ptrs(HousingDataPtr housing); +#endif /* Debugging code. */ + void plugin_main(void *instance_data, unsigned int event_code, unsigned int event_ref) { @@ -300,6 +309,10 @@ token = strtok_r(token_buf, " \"\t\n", &context); if (token && strlen(token)) { + if (strncmp(token, "housing-", 8) != 0) + { + return kEventNotHandled; + } remainder = strtok_r(NULL, " \"\t\n", &context); if (remainder && strlen(remainder)) { @@ -312,14 +325,14 @@ snprintf(userfield_buf, LINE_MAX, "plugins.housing.%s", remainder); housing->mUserfieldKey = smapi_get_string(userfield_buf); - return 1; + return kEventHandledToCompletion; } } } - snprintf(token_buf, LINE_MAX, "Housing plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "Housing plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) housing->mRoom), line); smapi_log_warning(token_buf); - return 0; + return kEventNotHandled; } Modified: trunk/plugins/InvisibilityAttachment/invisibilityattachment.c =================================================================== --- trunk/plugins/InvisibilityAttachment/invisibilityattachment.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/InvisibilityAttachment/invisibilityattachment.c 2008-05-06 14:05:11 UTC (rev 9) @@ -60,13 +60,19 @@ } InstanceData, *InstanceDataPtr; +/* Lifecycle Event Handling Routines. */ static void pi_register_events(unsigned int event_ref); +static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); +static void pi_dispose_instance_data(InstanceDataPtr instance_data); + +/* Game Event Handling Routines. */ static void pi_update(unsigned int event_ref, InstanceDataPtr instance_data); static unsigned int pi_parse_line(unsigned int event_code, InstanceDataPtr instance_data); static ListPtr pi_create_save_list(InstanceDataPtr instance_data); -static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); -static void pi_dispose_instance_data(InstanceDataPtr instance_data); +/* Plugin Routines. */ + +/* Debug Routines. */ #ifndef NDEBUG static void pi_note_ptrs(InstanceDataPtr instance_data); #endif /* Debugging code. */ @@ -283,6 +289,10 @@ token = strtok_r(token_buf, " \t\"", &context); if (token) { + if (strncmp(token, "invisibility-", 13) != 0) + { + return kEventNotHandled; + } remainder = strtok_r(NULL, "\"", &context); if (remainder) { @@ -302,7 +312,7 @@ } } } - snprintf(token_buf, LINE_MAX, "InvisibilityAttachment plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "InvisibilityAttachment plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mSelf), line); smapi_log_warning(token_buf); return kEventNotHandled; } Modified: trunk/plugins/InvisibilitySkill/invisibilityskill.c =================================================================== --- trunk/plugins/InvisibilitySkill/invisibilityskill.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/InvisibilitySkill/invisibilityskill.c 2008-05-06 14:05:11 UTC (rev 9) @@ -241,6 +241,10 @@ token = strtok_r(token_buf, " \t\n", &context); if (token) { + if (strncmp(token, "invisibility-", 13) != 0) + { + return kEventNotHandled; + } remainder = strtok_r(NULL, " \t\n", &context); if (remainder) { @@ -260,7 +264,7 @@ } } - snprintf(token_buf, LINE_MAX, "InvisibilitySkill plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "InvisibilitySkill plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mSkill), line); smapi_log_warning(token_buf); return kEventNotHandled; } Modified: trunk/plugins/InvulnerabilityAttachment/invulnerabilityattachment.c =================================================================== --- trunk/plugins/InvulnerabilityAttachment/invulnerabilityattachment.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/InvulnerabilityAttachment/invulnerabilityattachment.c 2008-05-06 14:05:11 UTC (rev 9) @@ -58,15 +58,21 @@ } InstanceData, *InstanceDataPtr; +/* Lifecycle Event Handling Routines. */ static void pi_register_events(unsigned int event_ref); +static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); +static void pi_dispose_instance_data(InstanceDataPtr instance_data); + +/* Game Event Handling Routines. */ static void pi_update(unsigned int event_ref, InstanceDataPtr instance_data); static void pi_add_score_line(unsigned int event_ref, InstanceDataPtr instance_data); static void pi_add_examine_line(unsigned int event_ref, InstanceDataPtr instance_data); static unsigned int pi_parse_line(unsigned int event_ref, InstanceDataPtr instance_data); static ListPtr pi_create_save_list(InstanceDataPtr instance_data); -static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); -static void pi_dispose_instance_data(InstanceDataPtr instance_data); +/* Plugin Routines. */ + +/* Debug Routines. */ #ifndef NDEBUG static void pi_note_ptrs(InstanceDataPtr instance_data); #endif /* Debugging code. */ @@ -286,6 +292,11 @@ token = strtok_r(token_buf, " \t\n", &context); if (token) { + + if (strncmp(token, "invulnerability-", 16) != 0) + { + return kEventNotHandled; + } remainder = strtok_r(NULL, " \t\n", &context); if (remainder) { @@ -309,7 +320,7 @@ } } - snprintf(token_buf, LINE_MAX, "InvulnerabilityAttachment could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "InvulnerabilityAttachment plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mSelf), line); smapi_log_warning(token_buf); return kEventNotHandled; } Modified: trunk/plugins/InvulnerabilitySkill/invulnerabilityskill.c =================================================================== --- trunk/plugins/InvulnerabilitySkill/invulnerabilityskill.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/InvulnerabilitySkill/invulnerabilityskill.c 2008-05-06 14:05:11 UTC (rev 9) @@ -33,6 +33,7 @@ #include <string.h> +/* Plugin Defaults. */ static const int kInvulnerabilitySetTicks = -1; static const int kInvulnerabilitySetName = -2; @@ -61,21 +62,26 @@ } InstanceData, *InstanceDataPtr; +/* Lifecycle Event Handling Routines. */ static void pi_register_events(unsigned int event_ref); -static unsigned int pi_parse_line(unsigned int event_ref, InstanceDataPtr instance_data); - static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); static void pi_dispose_instance_data(InstanceDataPtr instance_data); -#ifndef NDEBUG -static void pi_note_ptrs(InstanceDataPtr instance_data); -#endif /* Debugging code. */ +/* Game Event Handling Routines. */ static unsigned int pi_do_command(unsigned int event_ref, InstanceDataPtr instance_data); static void pi_do_cast(unsigned int event_ref, InstanceDataPtr instance_data); +static unsigned int pi_parse_line(unsigned int event_ref, InstanceDataPtr instance_data); + +/* Plugin Routines. */ static void pi_attempt_cast(LivingPtr caster, LivingPtr target, InstanceDataPtr instance_data); static void pi_perform_invulnerability(LivingPtr caster, LivingPtr target, InstanceDataPtr instance_data); +/* Debug Routines. */ +#ifndef NDEBUG +static void pi_note_ptrs(InstanceDataPtr instance_data); +#endif /* Debugging code. */ + void plugin_main(void *instance_data, unsigned int event_code, unsigned int event_ref) { @@ -228,6 +234,10 @@ token = strtok_r(token_buf, " \t\"", &context); if (token) { + if (strncmp(token, "invulnerability-", 16) != 0) + { + return kEventNotHandled; + } remainder = strtok_r(NULL, "\"", &context); if (remainder) { @@ -235,21 +245,21 @@ { /* Which skill does this plugin relate to? */ instance_data->mSkillName = smapi_replace_string(instance_data->mSkillName, remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "invulnerability-attachment-name") == 0) { /* Which attachment does this plugin use? */ instance_data->mAttachmentName = smapi_replace_string(instance_data->mAttachmentName, remainder); - return 1; + return kEventHandledToCompletion; } } } - snprintf(token_buf, LINE_MAX, "InvulnerabilitySkill plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "InvulnerabilitySkill plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mSkill), line); smapi_log_warning(token_buf); - return 0; + return kEventNotHandled; } Modified: trunk/plugins/MagicShieldAttachment/magicshieldattachment.c =================================================================== --- trunk/plugins/MagicShieldAttachment/magicshieldattachment.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/MagicShieldAttachment/magicshieldattachment.c 2008-05-06 14:05:11 UTC (rev 9) @@ -57,18 +57,24 @@ } InstanceData, *InstanceDataPtr; +/* Lifecycle Event Handling Routines. */ static void pi_register_events(unsigned int event_ref); +static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); static void pi_dispose_instance_data(InstanceDataPtr instance_data); -#ifndef NDEBUG -static void pi_note_ptrs(InstanceDataPtr instance_data); -#endif /* Debugging code. */ -static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); +/* Game Event Handling Routines. */ static unsigned int pi_receive_damage(unsigned int event_ref, unsigned int damage, InstanceDataPtr instance_data); static void pi_add_score_line(unsigned int event_ref, InstanceDataPtr instance_data); static void pi_add_examine_line(unsigned int event_ref, InstanceDataPtr instance_data); +/* Plugin Routines. */ +/* Debug Routines. */ +#ifndef NDEBUG +static void pi_note_ptrs(InstanceDataPtr instance_data); +#endif /* Debugging code. */ + + void plugin_main(void *instance_data, unsigned int event_code, unsigned int event_ref) { Modified: trunk/plugins/MagicShieldSkill/magicshieldskill.c =================================================================== --- trunk/plugins/MagicShieldSkill/magicshieldskill.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/MagicShieldSkill/magicshieldskill.c 2008-05-06 14:05:11 UTC (rev 9) @@ -241,6 +241,10 @@ token = strtok_r(token_buf, " \t\"", &context); if (token) { + if (strncmp(token, "magicshield-", 12) != 0) + { + return kEventNotHandled; + } remainder = strtok_r(NULL, "\"", &context); if (remainder) { @@ -258,7 +262,7 @@ } } - snprintf(token_buf, LINE_MAX, "magicshield plugin: Error parsing line: %s", line); + snprintf(token_buf, LINE_MAX, "Magicshield plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mSkill), line); smapi_log_warning(token_buf); return kEventNotHandled; } Modified: trunk/plugins/ParrySkill/parryskill.c =================================================================== --- trunk/plugins/ParrySkill/parryskill.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/ParrySkill/parryskill.c 2008-05-06 14:05:11 UTC (rev 9) @@ -45,8 +45,16 @@ } #endif /* __cplusplus */ + #define PLUGIN_NAME "parryskill" + +/* Plugin Defaults. */ +/* TODO kParryBasic and kParryFactor should come from header file and not be defined here! */ +const static unsigned int kParryBasic = 4; +const static unsigned int kParryFactor = 90; + + typedef struct InstanceData { const char *mSkillName; @@ -54,20 +62,22 @@ } InstanceData, *InstanceDataPtr; -/* TODO kParryBasic and kParryFactor should come from header file and not be defined here! */ -const static unsigned int kParryBasic = 4; -const static unsigned int kParryFactor = 90; - +/* Lifecycle Event Handling Routines. */ static void pi_register_events(unsigned int event_ref); -static unsigned int pi_parse_line(unsigned int event_code, InstanceDataPtr instance_data); static void pi_dispose_instance_data(InstanceDataPtr instance_data); +static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); +/* Game Event Handling Routines. */ +static unsigned int pi_parse_line(unsigned int event_code, InstanceDataPtr instance_data); + +/* Plugin Routines. */ +static unsigned int pi_reduce_damage_hook(unsigned int eventRef, InstanceDataPtr instance_data); + +/* Debug Routines. */ #ifndef NDEBUG static void pi_note_ptrs(InstanceDataPtr instance_data); #endif /* Debugging code. */ -static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); -static unsigned int pi_reduce_damage_hook(unsigned int eventRef, InstanceDataPtr instance_data); void @@ -207,7 +217,7 @@ { if (strncmp(token, "parry-skill-", 12) != 0) { - return 0; + return kEventNotHandled; } remainder = strtok_r(NULL, " \t\"", &context); if (remainder) @@ -218,15 +228,15 @@ if (strlen(remainder) > 0) { instance_data->mSkillName = smapi_get_string(remainder); - return 1; + return kEventHandledToCompletion; } } } } - snprintf(token_buf, LINE_MAX, "ParrySkill plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "ParrySkill plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mSkill), line); smapi_log_warning(token_buf); - return 0; + return kEventNotHandled; } Modified: trunk/plugins/PoisonAttachment/poisonattachment.c =================================================================== --- trunk/plugins/PoisonAttachment/poisonattachment.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/PoisonAttachment/poisonattachment.c 2008-05-06 14:05:11 UTC (rev 9) @@ -317,18 +317,22 @@ token = strtok_r(token_buf, " \t\"", &context); if (token) { + if (strncmp(token, "poison-", 7) != 0) + { + return kEventNotHandled; + } remainder = strtok_r(NULL, "\"", &context); if (remainder) { if (strcmp(token, "poison-hitpoints") == 0) { instance_data->mHitpointEffect = (unsigned int) strtoul(remainder, NULL, 10); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "poison-spellpoints") == 0) { instance_data->mSpellpointEffect = (unsigned int) strtoul(remainder, NULL, 10); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "poison-duration") == 0) { @@ -341,19 +345,19 @@ instance_data->mDuration = (unsigned int) strtoul(remainder, NULL, 10); } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "poison-period") == 0) { instance_data->mPeriod = (unsigned int) strtoul(remainder, NULL, 10); - return 1; + return kEventHandledToCompletion; } } } - snprintf(token_buf, LINE_MAX, "PoisonAttachment plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "PoisonAttachment plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mSelf), line); smapi_log_warning(token_buf); - return 0; + return kEventNotHandled; } Modified: trunk/plugins/PreemptSkill/preemptskill.c =================================================================== --- trunk/plugins/PreemptSkill/preemptskill.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/PreemptSkill/preemptskill.c 2008-05-06 14:05:11 UTC (rev 9) @@ -205,28 +205,28 @@ token = strtok_r(token_buf, " \t\"", &context); if (token) { + if (strncmp(token, "preempt-skill", 13) != 0) + { + /* Not for this plugin, but not an error either. */ + return kEventNotHandled; + } remainder = strtok_r(NULL, "\"", &context); if (remainder) { - if (strncmp(token, "preempt-skill", 13) != 0) - { - /* not for this plugin, but not an error either */ - return kEventNotHandled; - } if (strcmp(token, "preempt-skill-name") == 0) { if (strlen(remainder) > 0) { instance_data->mSkillName = smapi_get_string(remainder); - return 1; + return kEventHandledToCompletion; } } } } - snprintf(token_buf, LINE_MAX, "PreemptSkill plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "PreemptSkill plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mPreemptSkill), line); smapi_log_warning(token_buf); - return 0; + return kEventNotHandled; } Modified: trunk/plugins/PushSkill/pushskill.c =================================================================== --- trunk/plugins/PushSkill/pushskill.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/PushSkill/pushskill.c 2008-05-06 14:05:11 UTC (rev 9) @@ -58,19 +58,24 @@ } InstanceData, *InstanceDataPtr; +/* Lifecycle Event Handling Routines. */ static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); static void pi_dispose_instance_data(InstanceDataPtr instance_data); - -#ifndef NDEBUG -static void pi_note_ptrs(InstanceDataPtr instance_data); -#endif /* Debugging code. */ static void pi_register_events(unsigned int event_ref); +/* Game Event Handling Routines. */ static unsigned int pi_parse_line(unsigned int event_code, InstanceDataPtr instance_data); static unsigned int pi_do_command(unsigned int eventRef, InstanceDataPtr instance_data); + +/* Plugin Routines. */ static void pi_attempt_push(LivingPtr caster, LivingPtr target, unsigned int direction, InstanceDataPtr instance_data); +/* Debug Routines. */ +#ifndef NDEBUG +static void pi_note_ptrs(InstanceDataPtr instance_data); +#endif /* Debugging code. */ + void plugin_main(void *instance_data, unsigned int event_code, unsigned int event_ref) { @@ -207,7 +212,7 @@ { if (strncmp(token, "push-skill-", 11) != 0) { - return 0; + return kEventNotHandled; } remainder = strtok_r(NULL, " \t\n", &context); if (remainder) @@ -220,15 +225,15 @@ if (temp_uint <= 9999) { instance_data->mInitialDamage = temp_uint; - return 1; + return kEventHandledToCompletion; } } } } - snprintf(token_buf, LINE_MAX, "PushSkill plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "PushSkill plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mSkill), line); smapi_log_warning(token_buf); - return 0; + return kEventNotHandled; } Modified: trunk/plugins/QuestAttachment/questattachment.c =================================================================== --- trunk/plugins/QuestAttachment/questattachment.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/QuestAttachment/questattachment.c 2008-05-06 14:05:11 UTC (rev 9) @@ -53,6 +53,20 @@ #define PLUGIN_NAME "questattachment" +/* Plugin Defaults. */ +static const int kDefaultPlayerCompletes = 1; +static const int kDefaultStartsAllowed = 32767; // high limit. +static const int kDefaultQuestStatus = kQuestStatusNew; // start with status = new +static const int kDefaultRewardStatAmount = 1; +static const int kDefaultResignDelay = 3600; // 1 game hour. +static const int kDefaultResignStatAmount = 1; +static const int kDefaultResignsAllowed = 32767; // high limit. +static const int kDefaultExpireDelay = 2419200; // 28 game days. +static const int kDefaultExpireStatAmount = 1; +static const int kDefaultExpiresAllowed = 32767; // high limit. +static const int kDefaultUpdateInterval = 3600; // 1 game hour. + + typedef struct InstanceData { LivingPtr mHost; /* The host, if known, for this attachment. */ @@ -100,32 +114,25 @@ } InstanceData, *InstanceDataPtr; -static const int kDefaultPlayerCompletes = 1; -static const int kDefaultStartsAllowed = 32767; // high limit. -static const int kDefaultQuestStatus = kQuestStatusNew; // start with status = new -static const int kDefaultRewardStatAmount = 1; -static const int kDefaultResignDelay = 3600; // 1 game hour. -static const int kDefaultResignStatAmount = 1; -static const int kDefaultResignsAllowed = 32767; // high limit. -static const int kDefaultExpireDelay = 2419200; // 28 game days. -static const int kDefaultExpireStatAmount = 1; -static const int kDefaultExpiresAllowed = 32767; // high limit. -static const int kDefaultUpdateInterval = 3600; // 1 game hour. +/* Lifecycle Event Handling Routines. */ +static void pi_register_events(unsigned int event_ref); +static void pi_dispose_instance_data(InstanceDataPtr instance_data); +static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); -static void pi_register_events(unsigned int event_ref); +/* Game Event Handling Routines. */ static void pi_post_initialise(unsigned int eventRef, InstanceDataPtr instance_data); static void pi_update(unsigned int eventRef, InstanceDataPtr instance_data); static unsigned int pi_do_command(unsigned int eventRef, InstanceDataPtr instance_data); static unsigned int pi_parse_line(unsigned int event_code, InstanceDataPtr instance_data); static ListPtr pi_create_save_list(InstanceDataPtr instance_data); -static void pi_dispose_instance_data(InstanceDataPtr instance_data); -static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); +/* Plugin Routines. */ static void pi_do_hint(LivingPtr living, InstanceDataPtr instance_data); static unsigned int pi_do_reward(InstanceDataPtr instance_data); static void pi_add_examine_line(unsigned int eventRef, InstanceDataPtr instance_data); +/* Debug Routines. */ #ifndef NDEBUG static void pi_note_ptrs(InstanceDataPtr instance_data); static void pi_agent_room_stat(LivingPtr living, const char *what, InstanceDataPtr instance_data); @@ -582,31 +589,24 @@ token = strtok_r(token_buf, " \t\"", &context); if (token) { + if (strncmp(token, "questattachment-", 16) != 0) + { + return kEventNotHandled; + } remainder = strtok_r(NULL, "\"", &context); if (remainder) { - if ((token == NULL) || (remainder == NULL)) - { - return kEventNotHandled; - } - - if (strncmp(token, "questattachment", 15) != 0) - { - /* not for this plugin, but not an error either */ - return kEventNotHandled; - } - if (strcmp(token, "questattachment-reward-item-name") == 0) { namePointer = smapi_get_string(remainder); kg_list_add_last(instance_data->mRewardItemNames, (Ptr) namePointer); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-reward-stat-name") == 0) { instance_data->mRewardStatName = smapi_replace_string(instance_data->mRewardStatName, remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-reward-stat-amount") == 0) @@ -616,27 +616,27 @@ { instance_data->mRewardStatAmount = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-reward-monster-name") == 0) { namePointer = smapi_get_string(remainder); kg_list_add_last(instance_data->mRewardMonsterNames, (Ptr) namePointer); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-required-item-name") == 0) { namePointer = smapi_get_string(remainder); kg_list_add_last(instance_data->mRequiredItemNames, (Ptr) namePointer); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-hint") == 0) { kg_std_text_add_line(instance_data->mHintText, remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-resign-delay") == 0) @@ -647,13 +647,13 @@ { instance_data->mResignDelay = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-resign-stat-name") == 0) { instance_data->mResignStatName = smapi_replace_string(instance_data->mResignStatName, remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-resign-stat-amount") == 0) @@ -664,13 +664,13 @@ { instance_data->mResignStatAmount = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-resign-message") == 0) { instance_data->mResignMessage = smapi_replace_string(instance_data->mResignMessage, remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-starts-allowed") == 0) @@ -681,7 +681,7 @@ { instance_data->mQuestStartsAllowed = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-expire-delay") == 0) @@ -692,13 +692,13 @@ { instance_data->mExpireDelay = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-expire-penality-type") == 0) { instance_data->mExpireStatName = smapi_replace_string(instance_data->mExpireStatName, remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-expire-penality-amount") == 0) @@ -708,19 +708,19 @@ { instance_data->mExpireStatAmount = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-expire-message") == 0) { instance_data->mExpireMessage = smapi_replace_string(instance_data->mExpireMessage, remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-description") == 0) { instance_data->mDescription = smapi_replace_string(instance_data->mDescription, remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-expires-allowed") == 0) @@ -730,7 +730,7 @@ { instance_data->mExpiresAllowed = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-update-interval") == 0) @@ -746,7 +746,7 @@ instance_data->mNextUpdate = gameSeconds + instance_data->mUpdateInterval; } } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-resigns-allowed") == 0) @@ -756,13 +756,13 @@ { instance_data->mResignsAllowed = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-update-message") == 0) { instance_data->mUpdateMessage = smapi_replace_string(instance_data->mUpdateMessage, remainder); - return 1; + return kEventHandledToCompletion; } /* Save format only. */ @@ -774,7 +774,7 @@ { instance_data->mQuestStartTime = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-starts") == 0) @@ -785,7 +785,7 @@ { instance_data->mQuestStarts = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-resigns") == 0) @@ -796,7 +796,7 @@ { instance_data->mResigns = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-expires") == 0) @@ -807,7 +807,7 @@ { instance_data->mExpires = temp_uint; } - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-resign-time") == 0) @@ -817,7 +817,7 @@ gameSeconds = smapi_get_date_time(); instance_data->mResignTime = gameSeconds + temp_uint; - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-expire-time") == 0) @@ -827,7 +827,7 @@ gameSeconds = smapi_get_date_time(); instance_data->mExpireTime = gameSeconds + temp_uint; - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "questattachment-status") == 0) @@ -835,39 +835,41 @@ if (strcmp(remainder, "active") == 0) { instance_data->mQuestStatus = kQuestStatusActive; - return 1; + return kEventHandledToCompletion; } else if (strcmp(remainder, "new") == 0) { instance_data->mQuestStatus = kQuestStatusNew; - return 1; + return kEventHandledToCompletion; } else if (strcmp(remainder, "resigned") == 0) { instance_data->mQuestStatus = kQuestStatusResigned; - return 1; + return kEventHandledToCompletion; } else if (strcmp(remainder, "expired") == 0) { instance_data->mQuestStatus = kQuestStatusExpired; - return 1; + return kEventHandledToCompletion; } else if (strcmp(remainder, "completed") == 0) { instance_data->mQuestStatus = kQuestStatusCompleted; - return 1; + return kEventHandledToCompletion; } else if (strcmp(remainder, "waiting-to-resign") == 0) { instance_data->mQuestStatus = kQuestStatusWaitToResign; - return 1; + return kEventHandledToCompletion; } } } } - snprintf(token_buf, LINE_MAX, "QuestAttachment plugin could not parse line: %s", line); + BasePtr object = (BasePtr) smapi_extract_parameter(event_ref, kParameterSelf); + assert(object); + snprintf(token_buf, LINE_MAX, "QuestAttachment plugin: %s can not parse line: %s", smapi_get_standard_name(object), line); smapi_log_warning(token_buf); - return 0; + return kEventNotHandled; } Modified: trunk/plugins/QuestEvent/questevent.c =================================================================== --- trunk/plugins/QuestEvent/questevent.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/QuestEvent/questevent.c 2008-05-06 14:05:11 UTC (rev 9) @@ -1,3 +1,17 @@ +/* $Id$ */ + +/* ----------------------------------------------------------------------------- + QuestEvent.c from SlashMUDServer. + + \xA9 Copyright 1996 - 2008 Neil Tiffin. All Rights Reserved. + + Feel free to adapt this code to create your own SlashMUD Plugins. + + This source file is distributed under the terms of "The SlashMUD Licence". + + ----------------------------------------------------------------------------- */ + + /* File header. */ #include "questevent.h" Modified: trunk/plugins/QuestEvent/questevent.h =================================================================== --- trunk/plugins/QuestEvent/questevent.h 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/QuestEvent/questevent.h 2008-05-06 14:05:11 UTC (rev 9) @@ -1,3 +1,16 @@ +/* $Id$ */ + +/* ----------------------------------------------------------------------------- + QuestEvent.h from SlashMUDServer. + + \xA9 Copyright 1996-2008 Neil Tiffin. All Rights Reserved. + + Feel free to adapt this code to create your own SlashMUD Plugins. + + This source file is distributed under the terms of "The SlashMUD Licence". + + ----------------------------------------------------------------------------- */ + #ifndef QUEST_EVENT_H #define QUEST_EVENT_H Property changes on: trunk/plugins/QuestEvent/questevent.h ___________________________________________________________________ Name: svn:keywords + Date Author Revision Id Modified: trunk/plugins/QuestMaster/questmaster.cc =================================================================== --- trunk/plugins/QuestMaster/questmaster.cc 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/QuestMaster/questmaster.cc 2008-05-06 14:05:11 UTC (rev 9) @@ -82,18 +82,18 @@ #define PLUGIN_NAME "questmaster" -// File scope function prototypes. -void pi_update(unsigned int event_ref, InstanceDataPtr instance_data); +/* Lifecycle Event Handling Routines. */ InstanceDataPtr pi_create_instance_data(void); void pi_register_events(unsigned int event_ref); void pi_dispose_instance_data(InstanceDataPtr instance_data); -#ifndef NDEBUG -static void pi_note_ptrs(InstanceDataPtr instance_data); -#endif /* NDEBUG */ + +/* Game Event Handling Routines. */ +void pi_update(unsigned int event_ref, InstanceDataPtr instance_data); unsigned int pi_parse_line(unsigned int selector, InstanceDataPtr instance_data); ListPtr pi_create_save_list(InstanceDataPtr instance_data, unsigned int show_defaults); unsigned int pi_do_command(const unsigned int event_ref, InstanceDataPtr instance_data); +/* Plugin Routines. */ void pi_do_debug(const LivingPtr living, const string & remainder, InstanceDataPtr instance_data); unsigned int pi_do_quest(const LivingPtr living, const string & remainder, InstanceDataPtr instance_data); void pi_do_list(const LivingPtr living, InstanceDataPtr instance_data); @@ -103,7 +103,12 @@ unsigned int pi_do_receive_gift(const unsigned int event_ref, InstanceDataPtr instance_data); static void questmaster_plugin_main(void* instance_data, unsigned int event_code, unsigned int event_ref); +/* Debug Routines. */ +#ifndef NDEBUG +static void pi_note_ptrs(InstanceDataPtr instance_data); +#endif /* NDEBUG */ + void plugin_main(void* instance_data, unsigned int event_code, unsigned int event_ref) { Modified: trunk/plugins/Rent/rent.c =================================================================== --- trunk/plugins/Rent/rent.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/Rent/rent.c 2008-05-06 14:05:11 UTC (rev 9) @@ -48,6 +48,16 @@ #define PLUGIN_NAME "rent" +/* Plugin Defaults. */ +static const unsigned int kRentPluginDefaultRentAmount = 5; +static const unsigned int kRentPluginDefaultMaxDays = 60; +static const unsigned int kRentPluginDefaultMinDays = 5; +static const unsigned int kRentPluginDefaultMinLevel = 10; + +/* TODO should read calendar ticks per day values instead of using kRentPluginTicksPerDay. */ +static const unsigned int kRentPluginTicksPerDay = 400; + + /* Instance data. */ typedef struct InstanceData { @@ -102,15 +112,6 @@ #endif /* Debugging code. */ -static const unsigned int kRentPluginDefaultRentAmount = 5; -static const unsigned int kRentPluginDefaultMaxDays = 60; -static const unsigned int kRentPluginDefaultMinDays = 5; -static const unsigned int kRentPluginDefaultMinLevel = 10; - -/* TODO should read calendar ticks per day values instead of using kRentPluginTicksPerDay. */ -static const unsigned int kRentPluginTicksPerDay = 400; - - void plugin_main(void *instance_data, unsigned int event_code, unsigned int event_ref) { @@ -610,7 +611,7 @@ } } - snprintf(token_buf, LINE_MAX, "Rent plugin could not parse line: %s", line); + snprintf(token_buf, LINE_MAX, "Rent plugin: %s could not parse line: %s", smapi_get_standard_name((BasePtr) instance_data->mRoom), line); smapi_log_warning(token_buf); return kEventHandledToCompletion; } Modified: trunk/plugins/Riddle/riddle.c =================================================================== --- trunk/plugins/Riddle/riddle.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/Riddle/riddle.c 2008-05-06 14:05:11 UTC (rev 9) @@ -66,18 +66,23 @@ } InstanceData, *InstanceDataPtr; -/* Local prototypes. */ +/* Lifecycle Event Handling Routines. */ +static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); +static void pi_dispose_instance_data(InstanceDataPtr instance_data); +static void pi_register_events(unsigned int event_ref); + +/* Game Event Handling Routines. */ static void pi_initialise(unsigned int event_ref); static void pi_finished(unsigned int event_ref); -static void pi_register_events(unsigned int event_ref); static void pi_update(unsigned int event_ref, InstanceDataPtr instance_data); -static InstanceDataPtr pi_create_instance_data(unsigned int event_ref); -static void pi_dispose_instance_data(InstanceDataPtr instance_data); static unsigned int pi_parse_line(unsigned int event_code, InstanceDataPtr instance_data); static ListPtr pi_create_save_list(InstanceDataPtr instance_data); static unsigned int pi_do_command(unsigned int event_ref, InstanceDataPtr instance_data); + +/* Plugin Routines. */ static unsigned int pi_do_solve_riddle(LivingPtr living, const char *remainder, InstanceDataPtr instance_data); +/* Debug Routines. */ #ifndef NDEBUG static void pi_note_ptrs(InstanceDataPtr instance_data); static void pi_agent_room_stat(LivingPtr living, const char *what, InstanceDataPtr instance_data); @@ -269,6 +274,10 @@ token = strtok_r(token_buf, " \t\"", &context); if (token) { + if (strncmp(token, "riddle-", 7) != 0) + { + return kEventNotHandled; + } remainder = strtok_r(NULL, "\"\n", &context); if (remainder) { @@ -278,14 +287,14 @@ { /* TODO validate exit */ instance_data->mExit = smapi_get_string(remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "riddle-answer") == 0) { /* TODO validate string length */ instance_data->mAnswer = smapi_get_string(remainder); - return 1; + return kEventHandledToCompletion; } else if (strcmp(token, "riddle-answer-type") == 0) @@ -293,26 +302,28 @@ if (strcmp(remainder, "word") == 0) { instance_data->mAnswerType = kRiddleWord; - return 1; + return kEventHandledToCompletion; } else if (strcmp(remainder, "phrase") == 0) { instance_data->mAnswerType = kRiddlePhrase; - return 1; + return kEventHandledToCompletion; } else if (strcmp(remainder, "exact") == 0) { instance_data->mAnswerType = kRiddleExact; - return 1; + return kEventHandledToCompletion; } } } } } - snprintf(token_buf, LINE_MAX, "Riddle plugincould not parse line: %s", line); + BasePtr object = (BasePtr) smapi_extract_parameter(event_ref, kParameterSelf); + assert(object); + snprintf(token_buf, LINE_MAX, "Riddle plugin: %s can not parse line: %s", smapi_get_standard_name(object), line); smapi_log_warning(token_buf); - return 0; + return kEventNotHandled; } Modified: trunk/plugins/Shop/shop.c =================================================================== --- trunk/plugins/Shop/shop.c 2008-05-05 22:50:23 UTC (rev 8) +++ trunk/plugins/Shop/shop.c 2008-05-06 14:05:11 UTC (rev 9) @@ -45,7 +45,18 @@ #define PLUGIN_NAME "shop" +/* Plugin Defaults. */ +static const unsigned int kShopPluginDefaultMarkup = 10; /* Default markup as a percen... [truncated message content] |
From: <ko...@us...> - 2008-05-10 05:51:28
|
Revision: 13 http://slashmud.svn.sourceforge.net/slashmud/?rev=13&view=rev Author: koryn Date: 2008-05-09 22:51:19 -0700 (Fri, 09 May 2008) Log Message: ----------- Build 3259: fixed portal self-test bug (finally). Modified Paths: -------------- trunk/NEWS trunk/TODO trunk/src/config.h trunk/src/portal_object.c trunk/src/self_test.c trunk/src/version.c Property Changed: ---------------- trunk/NEWS trunk/TODO Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-05-07 09:51:23 UTC (rev 12) +++ trunk/NEWS 2008-05-10 05:51:19 UTC (rev 13) @@ -1,8 +1,26 @@ -$Header: /cvsroot/slashmud/slashmudx/NEWS,v 1.69 2008/04/21 03:57:00 koryn Exp $ +$Id$ Previous changes, most recent first: + 98542 235695 2475658 total +Auto-incrementing build number to 3259. +* 99 FIXMEs remaining in src/. +* 80 TODOs remaining in src/. +* 10 FIXMEs remaining in plugins/. +* 260 TODOs remaining in plugins/. + + +* [FEATURE] Creatures heal quicker when they have less than a third of their HP remaining. + +* [FEATURE] Server now initiates a restart when sent a SIGHUP. + +* [INTERNAL] Implemented many FIXME and TODO items. + +* [SELFTEST] Fixed bug in portal selftest. + +------------------------------------------------------------------------------- + 98379 235548 2473524 total Auto-incrementing build number to 3195. * 112 FIXMEs remaining in src/. Property changes on: trunk/NEWS ___________________________________________________________________ Name: svn:keywords + Id Modified: trunk/TODO =================================================================== --- trunk/TODO 2008-05-07 09:51:23 UTC (rev 12) +++ trunk/TODO 2008-05-10 05:51:19 UTC (rev 13) @@ -1,24 +1,16 @@ -$Header: /cvsroot/slashmud/slashmudx/TODO,v 1.194 2008/04/25 05:26:13 koryn Exp $ +$Id$ * REMEMBER TO INCLUDE THE BUILD NUMBER IN THE CVS LOG MESSAGE. - 98454 235542 2476290 total -Auto-incrementing build number to 3235. + 98542 235695 2475658 total +Auto-incrementing build number to 3259. * 99 FIXMEs remaining in src/. * 80 TODOs remaining in src/. * 10 FIXMEs remaining in plugins/. * 260 TODOs remaining in plugins/. -* [FEATURE] Creatures heal quicker when they have less than a third of their HP remaining. - -* [FEATURE] Server now initiates a restart when sent a SIGHUP. - -* [INTERNAL] Implemented many FIXME and TODO items. - -* [SELFTEST] Fixed bug in portal selftest. - ------------------------------------------------------------------------------- * [BUG] (Koryn) Agents can't examine items by ID. Property changes on: trunk/TODO ___________________________________________________________________ Name: svn:keywords + Id Modified: trunk/src/config.h =================================================================== --- trunk/src/config.h 2008-05-07 09:51:23 UTC (rev 12) +++ trunk/src/config.h 2008-05-10 05:51:19 UTC (rev 13) @@ -185,22 +185,22 @@ #define SELECT_TYPE_ARG5 (struct timeval *) /* build version C compiler flags. */ -#define SLASHMUD_BUILD_CFLAGS " -Wall -I/Users/koryn/development/temp2/slashmud/trunk/libraries/kdg/include -std=c99 -no-cpp-precomp -Werror-implicit-function-declaration -O2 -finline-functions" +#define SLASHMUD_BUILD_CFLAGS " -Wall -I/Users/koryn/development/slashmudx/slashmud/trunk/libraries/kdg/include -std=c99 -no-cpp-precomp -Werror-implicit-function-declaration -O2 -finline-functions" /* build version C++ compiler flags. */ -#define SLASHMUD_BUILD_CXXFLAGS " -Wall -Wall -I/Users/koryn/development/temp2/slashmud/trunk/libraries/kdg/include -no-cpp-precomp -O2 -finline-functions" +#define SLASHMUD_BUILD_CXXFLAGS " -Wall -Wall -I/Users/koryn/development/slashmudx/slashmud/trunk/libraries/kdg/include -no-cpp-precomp -O2 -finline-functions" /* canonical host string. */ #define SLASHMUD_CANONICAL_HOST "i386-apple-darwin9.2.2" /* debug version C compiler flags. */ -#define SLASHMUD_DEBUG_CFLAGS " -Wall -I/Users/koryn/development/temp2/slashmud/trunk/libraries/kdg/include -std=c99 -no-cpp-precomp -Werror-implicit-function-declaration -g -O0 -fbounds-check" +#define SLASHMUD_DEBUG_CFLAGS " -Wall -I/Users/koryn/development/slashmudx/slashmud/trunk/libraries/kdg/include -std=c99 -no-cpp-precomp -Werror-implicit-function-declaration -g -O0 -fbounds-check" /* debug version C++ compiler flags. */ -#define SLASHMUD_DEBUG_CXXFLAGS " -Wall -Wall -I/Users/koryn/development/temp2/slashmud/trunk/libraries/kdg/include -no-cpp-precomp -g -O0 -fbounds-check" +#define SLASHMUD_DEBUG_CXXFLAGS " -Wall -Wall -I/Users/koryn/development/slashmudx/slashmud/trunk/libraries/kdg/include -no-cpp-precomp -g -O0 -fbounds-check" /* linker flags. */ -#define SLASHMUD_LDFLAGS " -L/Users/koryn/development/temp2/slashmud/trunk/libraries/kdg -all_load" +#define SLASHMUD_LDFLAGS " -L/Users/koryn/development/slashmudx/slashmud/trunk/libraries/kdg -all_load" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 Modified: trunk/src/portal_object.c =================================================================== --- trunk/src/portal_object.c 2008-05-07 09:51:23 UTC (rev 12) +++ trunk/src/portal_object.c 2008-05-10 05:51:19 UTC (rev 13) @@ -5,6 +5,7 @@ #include "base_object.h" #include "base_virtuals.h" #include "buffer_sizes.h" +#include "logging.h" #include "mud_manager.h" #include "object_types.h" #include "portal_overrides.h" @@ -140,6 +141,7 @@ const char* living_msg = NULL; const char* all_msg = NULL; const char* name = NULL; + char logbuf[kLogBufferBytes]; assert(self); assert(living); @@ -147,8 +149,14 @@ /* Try for a destination portal. */ if (self->portal_data.mTargetPortalName) { + snprintf(logbuf, kLogBufferBytes, "*** have target portal name: %s", self->portal_data.mTargetPortalName); + SLASHLOG_DEBUG(logbuf); + name = self->portal_data.mTargetPortalName; dst_portal = portal_manager_get_by_name(name); + + snprintf(logbuf, kLogBufferBytes, "*** have target portal: %08x", (unsigned int) dst_portal); + SLASHLOG_DEBUG(logbuf); if (dst_portal) { @@ -171,12 +179,20 @@ /* Otherwise check the destination room. */ if ((NULL == dst_room) && self->portal_data.mTargetRoomName) { + snprintf(logbuf, kLogBufferBytes, "*** no target portal name, have target room name: %s", self->portal_data.mTargetRoomName); + SLASHLOG_DEBUG(logbuf); + name = self->portal_data.mTargetRoomName; dst_room = room_manager_get_by_name(name); } if (dst_room) { + char logbuf[kLogBufferBytes]; + + snprintf(logbuf, kLogBufferBytes, "*** have destination room: %s (%s)", dst_room->base_data.mStandardName, dst_room->room_data.mName); + SLASHLOG_DEBUG(logbuf); + item = base_get_environment((BasePtr) living); if (1 == virtual_instance_of(item, kRoomObject)) { @@ -187,6 +203,7 @@ if ((current_room == NULL) || (dst_room == NULL)) { virtual_catch_tell((BasePtr) living, (BasePtr) self, "The portal seems devoid of power."); + SLASHLOG_DEBUG("return 1"); return; } @@ -194,6 +211,7 @@ if ((0 == room_can_exit(current_room, living)) || (0 == room_can_enter(dst_room, living))) { virtual_catch_tell((BasePtr) living, (BasePtr) self, "Something prevents you from leaving this room."); + SLASHLOG_DEBUG("return 2"); return; } @@ -253,6 +271,9 @@ buffer[0] = toupper(buffer[0]); virtual_catch_tell((BasePtr) dst_room, (BasePtr) living, buffer); } + + snprintf(logbuf, kLogBufferBytes, "*** living is now in: %s", living->base_data.mEnvironment->base_data.mStandardName); + SLASHLOG_DEBUG(logbuf); } Modified: trunk/src/self_test.c =================================================================== --- trunk/src/self_test.c 2008-05-07 09:51:23 UTC (rev 12) +++ trunk/src/self_test.c 2008-05-10 05:51:19 UTC (rev 13) @@ -61,7 +61,7 @@ #define GROUP_COMBAT_SECONDS 300 /* How many times to repeat the portal transportation tests. */ -#define PORTAL_TRANSPORTATION_COUNT 500 +#define PORTAL_TRANSPORTATION_COUNT 2000 /* Mac OS X headers. */ #if CALENDAR_CACHE_PROFILE @@ -69,7 +69,7 @@ #endif /* CALENDAR_CACHE_PROFILE */ -#define NAMEBUF_BYTES 128 +#define NAMEBUF_BYTES 256 typedef unsigned int (*TestRoutine)(void); typedef struct TestInfo @@ -92,6 +92,7 @@ static void do_base_object_tests(BasePtr item, BasePtr quarantine); static void group_combat_internal(unsigned int multiplier, const char* logname); static void single_combat_internal(unsigned int repeats, const char* logname); +static void display_portal_transport_details(MonsterPtr monster, RoomPtr quarantine, RoomPtr destination, PortalPtr portal, PortalPtr target_portal); static unsigned int test_aliases(void); static unsigned int test_ammoboxes(void); static unsigned int test_armours(void); @@ -658,6 +659,63 @@ } +static void +display_portal_transport_details(MonsterPtr monster, RoomPtr quarantine, RoomPtr destination, PortalPtr portal, PortalPtr target_portal) +{ + if (monster->base_data.mEnvironment != (BasePtr) destination) + { + char logbuf[kLogBufferBytes]; + + snprintf(logbuf, kLogBufferBytes, "Quarantine '%s'", base_get_standard_name((BasePtr) quarantine)); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, "Destination '%s'", base_get_standard_name((BasePtr) destination)); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, "Monster '%s'", base_get_standard_name((BasePtr) monster)); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, " mEnvironment '%s'", base_get_standard_name((BasePtr) monster->base_data.mEnvironment)); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, "Portal '%s'", base_get_standard_name((BasePtr) portal)); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, " mEnvironment '%s'", base_get_standard_name((BasePtr) portal->base_data.mEnvironment)); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, " mTargetRoomName '%s'", portal->portal_data.mTargetRoomName); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, " mTargetPortalName '%s'", portal->portal_data.mTargetPortalName); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, "Target Portal '%s'", base_get_standard_name((BasePtr) target_portal)); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, " mEnvironment '%s'", base_get_standard_name((BasePtr) target_portal->base_data.mEnvironment)); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, " mTargetRoomName '%s'", target_portal->portal_data.mTargetRoomName); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, " mTargetPortalName '%s'", target_portal->portal_data.mTargetPortalName); + SLASHLOG_ERROR(logbuf); + + if (target_portal->portal_data.mTargetPortalName) + { + PortalPtr temp_portal = portal_manager_get_by_name(target_portal->portal_data.mTargetPortalName); + + if (temp_portal) + { + snprintf(logbuf, kLogBufferBytes, "Temp Portal '%s'", base_get_standard_name((BasePtr) temp_portal)); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, " mEnvironment '%s'", base_get_standard_name((BasePtr) temp_portal->base_data.mEnvironment)); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, " mTargetRoomName '%s'", temp_portal->portal_data.mTargetRoomName); + SLASHLOG_ERROR(logbuf); + snprintf(logbuf, kLogBufferBytes, " mTargetPortalName '%s'", temp_portal->portal_data.mTargetPortalName); + SLASHLOG_ERROR(logbuf); + } + else + { + snprintf(logbuf, kLogBufferBytes, "Temp Portal '(null)'"); + SLASHLOG_ERROR(logbuf); + } + } + } +} + + static unsigned int test_aliases(void) { @@ -2943,13 +3001,13 @@ assert(monster->base_data.mEnvironment == (BasePtr) quarantine); /* Create the destination portal. */ - target_portal = (PortalPtr) standard_library_load_typed_object(kStandardLibraryPortal, "portal_a"); + target_portal = (PortalPtr) standard_library_load_typed_object(kStandardLibraryPortal, "portal_b"); virtual_finish_loading((BasePtr) target_portal, (BasePtr) destination); assert(target_portal->base_data.mEnvironment == (BasePtr) destination); assert(target_portal == mud_manager_verify_object(get_portal_manager(), target_portal)); /* Set the portal's destination portal. */ - portal_set_target_portal(portal, base_get_standard_name((BasePtr) target_portal)); + portal_set_target_portal(portal, "portal_b"); /* Put the monster through the portal. */ portal_transport_living(portal, (LivingPtr) monster); @@ -2984,6 +3042,7 @@ PortalPtr portal; PortalPtr target_portal; MonsterPtr monster; + char testportal_namebuf[64]; /* Create a portal and put it in the quarantine room. */ portal = new_portal_instance(); @@ -3014,77 +3073,31 @@ assert(portal->base_data.mEnvironment == (BasePtr) quarantine); /* Create the destination portal. */ - target_portal = get_random_object(kStandardLibraryPortal, destination); + target_portal = new_portal_instance(); + snprintf(testportal_namebuf, 64, "testportal_%u", (unsigned int) clock()); + base_set_name((BasePtr) target_portal, testportal_namebuf); + base_set_standard_name((BasePtr) target_portal, testportal_namebuf); + + virtual_finish_loading((BasePtr) target_portal, (BasePtr) destination); assert(target_portal->base_data.mEnvironment == (BasePtr) destination); assert(target_portal == mud_manager_verify_object(get_portal_manager(), target_portal)); /* Set the portal's destination portal. */ - portal_clear_target_room(portal); - portal_clear_target_portal(portal); + portal_clear_target_room(target_portal); + portal_clear_target_portal(target_portal); portal_set_target_portal(portal, base_get_standard_name((BasePtr) target_portal)); /* Create a monster. */ monster = (MonsterPtr) get_random_object(kStandardLibraryMonster, quarantine); assert(monster->base_data.mEnvironment == (BasePtr) quarantine); - + /* Put the monster through the portal. */ portal_transport_living(portal, (LivingPtr) monster); + display_portal_transport_details(monster, quarantine, destination, portal, target_portal); + + assert(portal->base_data.mEnvironment == (BasePtr) quarantine); assert(target_portal->base_data.mEnvironment == (BasePtr) destination); - - if (monster->base_data.mEnvironment != (BasePtr) destination) - { - char logbuf[kLogBufferBytes]; - - snprintf(logbuf, kLogBufferBytes, "Quarantine '%s'", base_get_standard_name((BasePtr) quarantine)); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, "Destination '%s'", base_get_standard_name((BasePtr) destination)); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, "Monster '%s'", base_get_standard_name((BasePtr) monster)); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, " mEnvironment '%s'", base_get_standard_name((BasePtr) monster->base_data.mEnvironment)); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, "Portal '%s'", base_get_standard_name((BasePtr) portal)); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, " mEnvironment '%s'", base_get_standard_name((BasePtr) portal->base_data.mEnvironment)); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, " mTargetRoomName '%s'", portal->portal_data.mTargetRoomName); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, " mTargetPortalName '%s'", portal->portal_data.mTargetPortalName); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, "Target Portal '%s'", base_get_standard_name((BasePtr) target_portal)); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, " mEnvironment '%s'", base_get_standard_name((BasePtr) target_portal->base_data.mEnvironment)); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, " mTargetRoomName '%s'", target_portal->portal_data.mTargetRoomName); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, " mTargetPortalName '%s'", target_portal->portal_data.mTargetPortalName); - SLASHLOG_ERROR(logbuf); - - if (target_portal->portal_data.mTargetPortalName) - { - PortalPtr temp_portal = portal_manager_get_by_name(target_portal->portal_data.mTargetPortalName); - - if (temp_portal) - { - snprintf(logbuf, kLogBufferBytes, "Temp Portal '%s'", base_get_standard_name((BasePtr) temp_portal)); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, " mEnvironment '%s'", base_get_standard_name((BasePtr) temp_portal->base_data.mEnvironment)); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, " mTargetRoomName '%s'", temp_portal->portal_data.mTargetRoomName); - SLASHLOG_ERROR(logbuf); - snprintf(logbuf, kLogBufferBytes, " mTargetPortalName '%s'", temp_portal->portal_data.mTargetPortalName); - SLASHLOG_ERROR(logbuf); - } - else - { - snprintf(logbuf, kLogBufferBytes, "Temp Portal '(null)'"); - SLASHLOG_ERROR(logbuf); - } - } - } - assert(monster->base_data.mEnvironment == (BasePtr) destination); - assert(portal->base_data.mEnvironment == (BasePtr) quarantine); /* Clean up. */ virtual_finished((BasePtr) monster); @@ -3096,6 +3109,7 @@ assert(NULL == mud_manager_verify_object(get_portal_manager(), target_portal)); quarantine = dispose_quarantine_room(quarantine); + assert(NULL == quarantine); } return 1; @@ -4461,7 +4475,7 @@ { NULL, NULL }, */ /* Bug regression tests. */ - { test_base_name_contains, "Regression test for broken base_name_contains", 0 }, + { test_base_name_contains, "Regression test for broken base_name_contains()", 0 }, { test_stats, "Regression test for missing stat name", 0 }, { test_talk_list_manager, "Regression test for uninitialized talk list manager", 0 }, { test_unwield_all, "Regression test for 'unwield all' bug. Also tests 'wield all' command.", 0 }, @@ -4502,7 +4516,7 @@ { test_money, "Testing money system", 0 }, { test_owner_uuid, "Testing thing owner uuids", 0 }, { test_plugins, "Testing plugins", 0 }, - { test_portal_transport, "Testing portal transportation", 0 }, + { test_portal_transport, "Testing portal transportation with standard destination portals", 0 }, { test_projectile_weapons, "Testing projectile weapons from the Object Library", 0 }, { test_reload_projectile_weapons, "Testing projectile weapon reload", 0 }, { test_fire_projectile_weapons, "Testing projectile weapon firing", 0 }, Modified: trunk/src/version.c =================================================================== --- trunk/src/version.c 2008-05-07 09:51:23 UTC (rev 12) +++ trunk/src/version.c 2008-05-10 05:51:19 UTC (rev 13) @@ -48,4 +48,4 @@ } -const unsigned int gBuildNumber = 3241; +const unsigned int gBuildNumber = 3260; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ko...@us...> - 2008-05-18 21:10:52
|
Revision: 14 http://slashmud.svn.sourceforge.net/slashmud/?rev=14&view=rev Author: koryn Date: 2008-05-18 14:10:40 -0700 (Sun, 18 May 2008) Log Message: ----------- Added svn keywords. Modified Paths: -------------- trunk/plugins/CommonPluginSources/plugin_utilities.c trunk/plugins/CommonPluginSources/plugin_utilities.h trunk/slashlex/scanner.c Property Changed: ---------------- trunk/plugins/CommonPluginSources/plugin_utilities.c trunk/plugins/CommonPluginSources/plugin_utilities.h trunk/slashlex/scanner.c Modified: trunk/plugins/CommonPluginSources/plugin_utilities.c =================================================================== --- trunk/plugins/CommonPluginSources/plugin_utilities.c 2008-05-10 05:51:19 UTC (rev 13) +++ trunk/plugins/CommonPluginSources/plugin_utilities.c 2008-05-18 21:10:40 UTC (rev 14) @@ -13,7 +13,7 @@ Converted to C, 4 July 2003 Neil Tiffin - $Header: /cvsroot/slashmud/slashmudx/plugins/CommonPluginSources/plugin_utilities.c,v 1.8 2007/04/15 21:51:58 ntiffin Exp $ + $Id$ ------------------------------------------------------------------------------ */ Property changes on: trunk/plugins/CommonPluginSources/plugin_utilities.c ___________________________________________________________________ Name: svn:keywords - Date Author Revision Id + Id Modified: trunk/plugins/CommonPluginSources/plugin_utilities.h =================================================================== --- trunk/plugins/CommonPluginSources/plugin_utilities.h 2008-05-10 05:51:19 UTC (rev 13) +++ trunk/plugins/CommonPluginSources/plugin_utilities.h 2008-05-18 21:10:40 UTC (rev 14) @@ -13,7 +13,7 @@ Converted to C, 4 July 2003 Neil Tiffin - $Header: /cvsroot/slashmud/slashmudx/plugins/CommonPluginSources/plugin_utilities.h,v 1.3 2004/03/29 10:51:28 koryn Exp $ + $Id$ ------------------------------------------------------------------------------ */ #ifndef PLUGIN_UTILITIES_H Property changes on: trunk/plugins/CommonPluginSources/plugin_utilities.h ___________________________________________________________________ Name: svn:keywords - Date Author Revision Id + Id Modified: trunk/slashlex/scanner.c =================================================================== --- trunk/slashlex/scanner.c 2008-05-10 05:51:19 UTC (rev 13) +++ trunk/slashlex/scanner.c 2008-05-18 21:10:40 UTC (rev 14) @@ -1,9 +1,12 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvsroot/slashmud/slashmudx/slashlex/scanner.c,v 1.8 2005/05/08 02:15:57 koryn Exp $ + * $Header: /cvs/root/flex/flex/skel.c,v 1.1.1.1 1999/04/23 00:46:30 wsanchez Exp $ */ +/* $Id$ */ + + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 Property changes on: trunk/slashlex/scanner.c ___________________________________________________________________ Name: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nt...@us...> - 2008-06-01 19:26:23
|
Revision: 15 http://slashmud.svn.sourceforge.net/slashmud/?rev=15&view=rev Author: ntiffin Date: 2008-06-01 12:26:22 -0700 (Sun, 01 Jun 2008) Log Message: ----------- Update scripts, remove incorrect stuff from docs, revise bulletboard to return version. Modified Paths: -------------- trunk/plugins/BountyHunter/README trunk/plugins/BulletinBoard/BulletinBoard.cc trunk/scripts/open_plugins_bbedit.sh trunk/scripts/runServerDebug.sh trunk/world/Documentation/thing.sdoc Modified: trunk/plugins/BountyHunter/README =================================================================== --- trunk/plugins/BountyHunter/README 2008-05-18 21:10:40 UTC (rev 14) +++ trunk/plugins/BountyHunter/README 2008-06-01 19:26:22 UTC (rev 15) @@ -7,10 +7,6 @@ bountyhunter-race <racename> # The name of the race to attack. -bountyhunter-name <name> -# The name of this monsters. -# Defaults to "bounty hunter" - bountyhunter-level <level> # The level of this monster. # Defaults to 15. @@ -18,11 +14,3 @@ bountyhunter-short-desc <description> # The short description of this monster. # Defaults to "A combat-hardened bounty hunter." - -bountyhunter-alias <alias> -# The alias' for this monster. -# Defaults to "bounty hunter mercenary" - -bountyhunter-gender <gender> -# Defaults to "male". -# Values are "male", "female", "neuter" Modified: trunk/plugins/BulletinBoard/BulletinBoard.cc =================================================================== --- trunk/plugins/BulletinBoard/BulletinBoard.cc 2008-05-18 21:10:40 UTC (rev 14) +++ trunk/plugins/BulletinBoard/BulletinBoard.cc 2008-06-01 19:26:22 UTC (rev 15) @@ -9,6 +9,8 @@ This source file is distributed under the terms of "The SlashMUD Licence". + ** DEPRECATED ** + Created: 15 December 1999 by Neil Tiffin. ------------------------------------------------------------------------------ */ @@ -113,10 +115,44 @@ { smapi_log_warning("BulletinBoard plugin is deprecated, please do not use!"); - return; switch (event_code) { + + case kPluginQueryInfo: + { + ListPtr list = kg_list_init(kListInterfacePlain, kListRepresentationDynamic, (DisposeRoutine) smapi_release_string); + + if (list) + { + const char *line; + +#ifndef NDEBUG + line = smapi_get_string("Name: " PLUGIN_NAME " (debug)"); +#else + line = smapi_get_string("Name: " PLUGIN_NAME " (build)"); +#endif /* NDEBUG */ + kg_list_add_last(list, (Ptr) line); + + line = smapi_get_string("Id: $Id$"); + kg_list_add_last(list, (Ptr) line); + + line = smapi_get_string("Author: Neil Tiffin"); + kg_list_add_last(list, (Ptr) line); + + smapi_set_query_info(event_ref, list); + } + } + break; + } +} + +void +old_plugin_main(void *instance_data, unsigned int event_code, unsigned int event_ref) +{ + switch (event_code) + { + case kPluginUpdate: pi_update((InstanceDataPtr) instance_data); break; Modified: trunk/scripts/open_plugins_bbedit.sh =================================================================== --- trunk/scripts/open_plugins_bbedit.sh 2008-05-18 21:10:40 UTC (rev 14) +++ trunk/scripts/open_plugins_bbedit.sh 2008-06-01 19:26:22 UTC (rev 15) @@ -14,6 +14,7 @@ bbedit ../plugins/Dragonbane/dragonbane.c bbedit ../plugins/EnergyDrainAttachment/energydrainattachment.c bbedit ../plugins/EnergyDrainSkill/energydrainskill.c +bbedit ../plugins/FireSwamp/fireswamp.c bbedit ../plugins/Fountain/fountain.c bbedit ../plugins/Gate/gate.c bbedit ../plugins/GeneralSpell/generalspell.c @@ -46,18 +47,17 @@ bbedit ../plugins/TestCPluginThing/testcpluginthing.c bbedit ../plugins/TheTrash/thetrash.c bbedit ../plugins/Torch/torch.c -bbedit ../plugins/Treknobabbler/treknobabbler.c -bbedit ../plugins/TriggerAttachment/triggerattachment.c -bbedit ../plugins/UnarmedSkill/unarmedskill.c -bbedit ../plugins/VirusAttachment/virusattachment.c -bbedit ../plugins/WaterSkin/waterskin.c -bbedit ../plugins/WeapontypeSkill/weapontypeskill.c +bbedit ../plugins/Treknobabbler/treknobabbler.c +bbedit ../plugins/TriggerAttachment/triggerattachment.c +bbedit ../plugins/UnarmedSkill/unarmedskill.c +bbedit ../plugins/VirusAttachment/virusattachment.c +bbedit ../plugins/Wanderer/wanderer.c +bbedit ../plugins/WaterSkin/waterskin.c +bbedit ../plugins/WeapontypeSkill/weapontypeskill.c bbedit --new-window ../plugins/BulletinBoard/BulletinBoard.cc bbedit ../plugins/BulletinBoard/Message.cc bbedit ../plugins/BulletinBoard/MessageList.cc bbedit ../plugins/Eliza/eliza.cc -bbedit ../plugins/FireSwamp/fireswamp.cc bbedit ../plugins/QuestMaster/questmaster.cc -bbedit ../plugins/Wanderer/wanderer.cc Modified: trunk/scripts/runServerDebug.sh =================================================================== --- trunk/scripts/runServerDebug.sh 2008-05-18 21:10:40 UTC (rev 14) +++ trunk/scripts/runServerDebug.sh 2008-06-01 19:26:22 UTC (rev 15) @@ -3,9 +3,15 @@ # Remove log files. echo "" echo "Removing log files in 3 seconds..." +echo "" sleep 3 rm -f -v ../dist/Logs/* +if [ -f ../dist/Plugins/README ]; then + echo "" + rm -fv ../dist/Plugins/README +fi + # Determine if gdb is available. if [ -f /usr/bin/gdb ]; then Modified: trunk/world/Documentation/thing.sdoc =================================================================== --- trunk/world/Documentation/thing.sdoc 2008-05-18 21:10:40 UTC (rev 14) +++ trunk/world/Documentation/thing.sdoc 2008-06-01 19:26:22 UTC (rev 15) @@ -1,43 +1,20 @@ Things ====== -begin-syntax -name <text> -# The name of the Thing. Ignored if the Thing is a PluginWeapon or PluginThing, in which case the name of the file is the name of the Thing. Don't begin your name with "a", "an" or "the". The server may add these to the beginning of the name in certain cases. +Object Hierarchy: base -> thing -alias <wordlist> -# A space-delimited list of aliases for the Thing. +When defining a thing it also accepts keywords for a base object. -short <text> -# The short description of the Thing. - -long <text> -# Lines beginning with 'long' are the long description for the Thing. You can use colour codes and the following special tokens in long descriptions: - -# %self -# is replaced by the name of the Thing. -# -# %target -# is replaced by the name of the creature that is shown the long description, i.e. examines the Thing. - +begin-syntax liardn <text> # The text that is displayed when the item is Lying In A Room Doing Nothing. location <wordlist> # A space-delimited list of body parts that the Thing covers/requires for use. This is primarily used for Weapons and Armours, and determines where they are located. -size smallest|smaller|small|normal|large|larger|largest -# The size of the Thing. Used for armours and weapons to determine if a creature can use the item. The default is normal. - usage-count <integer>|infinite # For armours and weapons, the number of times the item can be used. Once this reaches zero, the item disintegrates. -light <boolean> -# Whether or not the Thing provides light to whoever is carrying it. - -weight <integer> -# The weight of the Thing. - value <integer> # The nominal value of the Thing. The actual value depends on the current rate of inflation in the MUD. @@ -47,24 +24,18 @@ trashable <boolean> # Whether the Thing can be trashed or not. -visible <boolean> -# Whether the Thing is visible or not. - intelligence <integer> <integer> <integer> intuition <integer> <integer> <integer> skill <integer> <integer> <integer> stamina <integer> <integer> <integer> strength <integer> <integer> <integer> alignment <integer> <integer> <integer> -level <integer> <integer> <integer> -end-syntax - # The first value is the effect that the Thing has on the stat of the wearer/wielder. The second value is the minimum value of the stat required to wield/wear the Thing is the second integer, and the third value is the maximum value of the stat. A value of - is used to indicate that the corresponding field is ignored, e.g. - # strength - 14 - - # means that the Thing requires a minimum of 14 strength to use. These only affect Things that can be used, e.g. Armours and Weapons. recovery-chance <integer> # Chance out of 1000 that this object will be available for use when a monster carrying it is killed. +end-syntax + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |