[ox] Fix MC negative int encoding and bump MC version to 2
This commit is contained in:
2
deps/ox/src/ox/claw/read.cpp
vendored
2
deps/ox/src/ox/claw/read.cpp
vendored
@@ -41,7 +41,7 @@ Result<ClawHeader> readClawHeader(const char *buff, std::size_t buffLen) noexcep
|
||||
buffLen -= s3Size + 1;
|
||||
|
||||
ClawHeader hdr;
|
||||
if (fmt == "M1") {
|
||||
if (fmt == "M2") {
|
||||
hdr.fmt = ClawFormat::Metal;
|
||||
} else if (fmt == "O1") {
|
||||
hdr.fmt = ClawFormat::Organic;
|
||||
|
1
deps/ox/src/ox/claw/read.hpp
vendored
1
deps/ox/src/ox/claw/read.hpp
vendored
@@ -45,7 +45,6 @@ Error readClaw(const char *buff, std::size_t buffLen, T *val) {
|
||||
return OxError(Error_ClawTypeMismatch, "Claw Read: Type mismatch");
|
||||
}
|
||||
if (header.typeVersion != getModelTypeVersion<T>()) {
|
||||
oxDebugf("version: {}, {}", header.typeVersion, getModelTypeVersion<T>());
|
||||
return OxError(Error_ClawTypeVersionMismatch, "Claw Read: Type Version mismatch");
|
||||
}
|
||||
switch (header.fmt) {
|
||||
|
2
deps/ox/src/ox/claw/test/tests.cpp
vendored
2
deps/ox/src/ox/claw/test/tests.cpp
vendored
@@ -116,7 +116,7 @@ std::map<std::string_view, ox::Error(*)()> tests = {
|
||||
{
|
||||
"ClawHeaderReader2",
|
||||
[] {
|
||||
ox::String hdr = "M1;com.drinkingtea.ox.claw.test.Header2;3;";
|
||||
ox::String hdr = "M2;com.drinkingtea.ox.claw.test.Header2;3;";
|
||||
auto [ch, err] = ox::readClawHeader(hdr.c_str(), hdr.len() + 1);
|
||||
oxAssert(err, "Error parsing header");
|
||||
oxAssert(ch.fmt == ox::ClawFormat::Metal, "Format wrong");
|
||||
|
2
deps/ox/src/ox/claw/write.hpp
vendored
2
deps/ox/src/ox/claw/write.hpp
vendored
@@ -62,7 +62,7 @@ Result<String> writeClawHeader(T *t, ClawFormat fmt) noexcept {
|
||||
String out;
|
||||
switch (fmt) {
|
||||
case ClawFormat::Metal:
|
||||
out += "M1;";
|
||||
out += "M2;";
|
||||
break;
|
||||
case ClawFormat::Organic:
|
||||
out += "O1;";
|
||||
|
Reference in New Issue
Block a user