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

Initial port of SlippiDirectCodes to Rust #18

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ryanmcgrath
Copy link
Collaborator

This moves the direct codes parsing/loading/vending from C++ to Rust. Where applicable, certain things that weren't in use in the C++ version - but may be useful in the future - were also ported but commented out.

The only significant change here is that this changes the lastPlayed field in codes files to be a unix timestamp rather than a datetimestamp that requires a full parser. There's fallback code in the parser to handle the older format, though; subsequent writes will just write unix timestamps to the file instead. This entire bit should be transparent to users and is purely a convenience thing.

This also makes a change to the public interface of the Rust lib: rather than passing over a fully qualified user.json path, we now just pass the folder where it's found and then build paths on the Rust side - since we need to do this for direct code file paths anyway.

This moves the direct codes parsing/loading/vending from C++ to Rust.
Where applicable, certain things that weren't in use in the C++ version
- but may be useful in the future - were also ported but commented out.

The only significant change here is that this changes the `lastPlayed`
field in codes files to be a unix timestamp rather than a datetimestamp
that requires a full parser. There's fallback code in the parser to
handle the older format, though; subsequent writes will just write unix
timestamps to the file instead. This entire bit should be transparent to
users and is purely a convenience thing.

This also makes a change to the public interface of the Rust lib: rather
than passing over a fully qualified `user.json` path, we now just pass
the folder where it's found and then build paths on the Rust side -
since we need to do this for direct code file paths anyway.
…that c/cpp do not complain incessantly about overrides
It looks like the mainline build might use different cased keys, so
adding an alias here so they all centralize and the lib can work across
builds.
…t-extensions into port/direct-codes

* 'port/direct-codes' of github.com:ryanmcgrath/slippi-rust-extensions:
  Tweak cbindgen to guard itself a bit more, alter an FFI enum name so that c/cpp do not complain incessantly about overrides
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.

1 participant