Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tbaMUD Development Update #13

Merged
merged 33 commits into from Nov 23, 2022
Merged

tbaMUD Development Update #13

merged 33 commits into from Nov 23, 2022

Conversation

JosephVTK
Copy link
Owner

Changelog

Minor

  • Provided significant cosmetic formatting in dg_XXXX.c for consistency and superior readability
  • Updated .gitignore to include logs, player files, workspace files etc..
  • Added additional error messages and extra context to existing messages in the dg_XXX_cmd.c files
  • Fixed bug in act.informative.c that caused room description to be displayed twice
  • Fixed bug in act.informative.c that prevented room contents from being displayed
  • Fixed bug in one of the dg_XXX_cmds that would attempt to move a character to a non-existant room

Ongoing

  • I've exchanged the majority of the sprintf functions for snprintf as was suggested in the development thread on tbamud.com. Most of these changes were superficial and overkill however I did stumble across a few that were medium-to-high risk for buffer overflows. I will look into strlcpy and strlcat later.
  • I've added a new zone, currently at 450, for use in testing. I don't know if this will make the final cut but by using the dg-script engine for testing I've already uncovered and addressed some bugs that would otherwise of been near-impossible to find alone.

Major

I wrote a JSON converter for C which can be found here in my github called jsIOn.c and added it to the tbamud core. This is the most significant addition to the code, but it is mostly abstract and doesn't touch anything except potentially lib/misc/messages. The purpose of this was to offer the option of converting our current file system into a JSON compatible format for the benefit of importing/exporting it into third-party applications. As it currently stands, to ensure stability, it only touches lib/misc/messages, it only activates by toggling the CEDIT option in the operation options menu, and it leaves the original messages file intact.

Screenshot from 2022-11-23 11-14-46

Obviously no one gets excited over the arranging letters and numbers in a different way, but the ease of importing/exporting the data makes third party applications so much more feasible now.

# Python
import json

with open('../lib/misc/messages.json', 'r') as f:
            data = json.load(f)

And now you can alter, inspect, create data through a python script, send it to a web app for manipulation, or whatever your heart desires. Just 3 lines of code.


Additionally, there is also a new scripts folder in the base directory. I've added a dirty python script which, if your JSON messages are enabled & created, will do an assessment of your messages for potential issues and write them to a JSON report AND create a mobile friendly HTML document for easy viewing of the report. Probably took 10-15 minutes.
Screenshot from 2022-11-23 11-30-26


Finally, although there are a lot of changes, in the name of stability and reliability, I've kept most everything relatively surface or made it opt-in.

JosephVTK and others added 30 commits November 6, 2022 16:44
 -  Different coders/IDEs over the years have left the formatting a mess
 - I've performed "by hand" formatting for consistency and readability.
 - An auto-formatter was used on a "per selection" basis to reduce the potential for bugs.
  - Due to the lack of automated testing capabilities, changes have been limited to mostly white space.
Fixed bug in do_omove where object could be moved to NOWHERE room.
changed do_dgoload to do_oload for consistency.
- Fixed missing int declaration in do_Xdoor commands
Fixed formatting for readability.
Indentations should be correct.
Tested on fresh install. 
It does compile. 
Room descriptions display properly.
Added new cedit option for choosing JSON files
Added messages.json
… ROOMFLAG to not see any of the room contents

- Fixed erroneous 'else' statement which was causing double up of room descriptions and automap.
Added zone 450 to world for purpose of testing
"It worked on my machine..."
- Fixed bug where fight message was being saved in wrong slot
Updated jsIOn to allow for better handing of in value tabs, quotes and newlines.
Added a comment to dg_scripts where valgrind found an issue. WIll investigate later.
@JosephVTK JosephVTK merged commit f3f9498 into master Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants