Author Topic: op2ext version 2.1.0 - developer updates  (Read 3166 times)

Offline Vagabond

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
op2ext version 2.1.0 - developer updates
« on: December 29, 2018, 05:52:11 PM »
We have been working on op2ext recently. These changes affect how new or recompiled modules should interact with op2ext.

We added a public Log function to unify log messages across all modules and op2ext itself. The function will automatically determine which module called it and decorate the log call with the dll name and a cultural invariant system date/time. Thanks to Hooman for figuring out how to accomplish module lookups and fixing deprecated functions in the date/time code.

One caveat for the logger: Since all console modules are called op2mod.dll, all console mods will decorate with op2mod.dll. If you are creating a console mod, you may want to add the modules' name to the beginning of the message to distinguish it from other console mods.

There is a new function, GetConsoleModDir_s, for getting the absolute directory the console mod is contained in. This deprecates function GetCurrentModDir which handles memory management between boundaries poorly. In addition to making  C++ memory management calls across the public C ABI (new instead of malloc), the deprecated function had the module directly freeing memory allocated by op2ext across module boundaries.

Lastly we added const to the char* used with the function void AddVolToList(const char* volName). This allows easier passing of const char[] into AddVolToList. In particular, it facilitates easy calling of std::string::c_str.

This should all make the next release of Outpost 2.

Hooman's technical expertise has been appreciated getting these changes ready. Open to comments and suggestions.

-Brett