Skip to content

Commit

Permalink
HSTracker 2.5.8
Browse files Browse the repository at this point in the history
Fix crashes due to Rylak (issue #1316)
  • Loading branch information
fmoraes74 committed Oct 17, 2023
1 parent cf39e17 commit af78957
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 2.5.8
## Fixes
- Fixed discovered secrets not being tracked (issue #1327)
- Fixed crashes due to interaction with Rylak (issue #1316)
**Bob's Buddy**
- Fixed an issue where Choral Mrrrglr was not simulated correctly.

# 2.5.7
## New
- Updated for Hearthstone 27.4.2
Expand Down
6 changes: 3 additions & 3 deletions HSTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2632,7 +2632,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# exit 0\n\n# Version\nMONO_VERSION=6.0.8\nNET_VERSION=net7.0\nASSEMBLIES=\"mscorlib.dll netstandard.dll System.dll System.Collections.dll System.Collections.Concurrent.dll System.Collections.NonGeneric.dll System.Collections.Specialized.dll System.Configuration.dll System.Core.dll System.Diagnostics.TraceSource.dll System.Diagnostics.Tracing.dll System.Linq.dll System.Linq.Expressions.dll System.Memory.dll System.ObjectModel.dll System.Private.Uri.dll System.Private.Xml.dll System.Reflection.Emit.dll System.Reflection.Emit.ILGeneration.dll System.Reflection.Emit.Lightweight.dll System.Reflection.Primitives.dll System.Runtime.dll System.Runtime.CompilerServices.Unsafe.dll System.Runtime.InteropServices.dll System.Runtime.Loader.dll System.Text.Encoding.Extensions.dll System.Text.RegularExpressions.dll System.Threading.dll System.Threading.Tasks.Parallel.dll System.Threading.Thread.dll System.Xml.dll System.Xml.ReaderWriter.dll System.Xml.XmlSerializer.dll\"\n\n# Locations\nMONO_LOCATION=$SRCROOT/downloaded-frameworks/mono/runtimes/osx-x64/lib/${NET_VERSION}\nMONO_NATIVE=$SRCROOT/downloaded-frameworks/mono/runtimes/osx-x64/native\n\nLOCATION=\"${BUILT_PRODUCTS_DIR}\"/\"${FRAMEWORKS_FOLDER_PATH}\"\nBIN_LOCATION=\"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}\"\nRES_LOCATION=\"${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Resources/Resources/Managed\"\n\nmkdir -p \"${LOCATION}\"\n\nset -x\nset -e\n\n# Copy needed files\ncp $MONO_NATIVE/libcoreclr.dylib \"${LOCATION}\"\ncp $MONO_NATIVE/libSystem.Native.dylib \"${LOCATION}\"\n\ncp $MONO_NATIVE/System.Private.CoreLib.dll \"${RES_LOCATION}\"\n\n# Copy system assemblies needed\nfor assembly in $ASSEMBLIES; do cp ${MONO_LOCATION}/$assembly \"${RES_LOCATION}\"; done\n\ntouch $SRCROOT/downloaded-frameworks/mono/embedding.done\n\n# Change runtime paths\n#install_name_tool -change /Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.1.dylib \"${BIN_LOCATION}/${EXECUTABLE_NAME}\"\n#install_name_tool -change /Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/lib/libsqlite3.0.dylib @rpath/libsqlite3.0.dylib \"${BIN_LOCATION}/${EXECUTABLE_NAME}\"\n";
shellScript = "# exit 0\n\n# Version\nMONO_VERSION=6.0.8\nNET_VERSION=net7.0\nASSEMBLIES=\"mscorlib.dll netstandard.dll System.dll System.Collections.dll System.Collections.Concurrent.dll System.Collections.NonGeneric.dll System.Collections.Specialized.dll System.Configuration.dll System.Core.dll System.Diagnostics.TraceSource.dll System.Diagnostics.Tracing.dll System.Linq.dll System.Linq.Expressions.dll System.Memory.dll System.Numerics.Vectors.dll System.ObjectModel.dll System.Private.Uri.dll System.Private.Xml.dll System.Reflection.Emit.dll System.Reflection.Emit.ILGeneration.dll System.Reflection.Emit.Lightweight.dll System.Reflection.Primitives.dll System.Runtime.dll System.Runtime.CompilerServices.Unsafe.dll System.Runtime.InteropServices.dll System.Runtime.Loader.dll System.Text.Encoding.Extensions.dll System.Text.RegularExpressions.dll System.Threading.dll System.Threading.Tasks.Parallel.dll System.Threading.Thread.dll System.Xml.dll System.Xml.ReaderWriter.dll System.Xml.XmlSerializer.dll\"\n\n# Locations\nMONO_LOCATION=$SRCROOT/downloaded-frameworks/mono/runtimes/osx-x64/lib/${NET_VERSION}\nMONO_NATIVE=$SRCROOT/downloaded-frameworks/mono/runtimes/osx-x64/native\n\nLOCATION=\"${BUILT_PRODUCTS_DIR}\"/\"${FRAMEWORKS_FOLDER_PATH}\"\nBIN_LOCATION=\"${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}\"\nRES_LOCATION=\"${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Resources/Resources/Managed\"\n\nmkdir -p \"${LOCATION}\"\n\nset -x\nset -e\n\n# Copy needed files\ncp $MONO_NATIVE/libcoreclr.dylib \"${LOCATION}\"\ncp $MONO_NATIVE/libSystem.Native.dylib \"${LOCATION}\"\n\ncp $MONO_NATIVE/System.Private.CoreLib.dll \"${RES_LOCATION}\"\n\n# Copy system assemblies needed\nfor assembly in $ASSEMBLIES; do cp ${MONO_LOCATION}/$assembly \"${RES_LOCATION}\"; done\n\ntouch $SRCROOT/downloaded-frameworks/mono/embedding.done\n\n# Change runtime paths\n#install_name_tool -change /Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/lib/libmonosgen-2.0.1.dylib @rpath/libmonosgen-2.0.1.dylib \"${BIN_LOCATION}/${EXECUTABLE_NAME}\"\n#install_name_tool -change /Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/lib/libsqlite3.0.dylib @rpath/libsqlite3.0.dylib \"${BIN_LOCATION}/${EXECUTABLE_NAME}\"\n";
};
B849674128A57C7300D90B30 /* Download Mono */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -3946,7 +3946,7 @@
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/downloaded-frameworks/mono/runtimes/osx-x64/native";
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 2.5.7;
MARKETING_VERSION = 2.5.8;
OTHER_CFLAGS = "$(inherited)";
OTHER_CODE_SIGN_FLAGS = "--deep";
OTHER_LDFLAGS = "$(inherited)";
Expand Down Expand Up @@ -3991,7 +3991,7 @@
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/downloaded-frameworks/mono/runtimes/osx-x64/native";
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 2.5.7;
MARKETING_VERSION = 2.5.8;
OTHER_CODE_SIGN_FLAGS = "--deep";
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = net.hearthsim.hstracker;
Expand Down
2 changes: 2 additions & 0 deletions HSTracker/BobsBuddy/BobsBuddyInvoker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ class BobsBuddyInvoker {
exc.deallocate()
if str.contains("BobsBuddy.UnsupportedInteractionException") {
throw UnsupportedInteraction()
} else {
throw RuntimeError(str)
}
}
exc.deallocate()
Expand Down
23 changes: 21 additions & 2 deletions HSTracker/Mono/MonoHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,14 @@ class MonoHelper {
fatalError("Property \(property) not found")
}

static func createMinion(f: MinionFactoryProxy, id: String, player: Bool, attack: Int, health: Int) -> MinionProxy {
let m = f.createFromCardid(id: id, player: player)
m.baseAttack = Int32(attack)
m.baseHealth = Int32(health)

return m
}

static func testSimulation() {
let handle = mono_thread_attach(MonoHelper._monoInstance)

Expand Down Expand Up @@ -429,8 +437,19 @@ class MonoHelper {

let mw = MonoHelper.getMethod(c, "Wait", 0)

_ = mono_runtime_invoke(mw, inst2, nil, nil)

let exc = UnsafeMutablePointer<UnsafeMutablePointer<MonoObject>?>.allocate(capacity: 1)
exc[0] = nil
_ = mono_runtime_invoke(mw, inst2, nil, exc)
if exc[0] != nil {
let handle = MonoHandle(obj: exc[0])
let str = MonoHelper.toString(obj: handle)
exc.deallocate()
if str.contains("BobsBuddy.UnsupportedInteractionException") {
abort()
}
}
exc.deallocate()

let meth2 = MonoHelper.getMethod(c, "get_Result", 0)
let output = mono_runtime_invoke(meth2, inst2, nil, nil)
let top = OutputProxy(obj: output)
Expand Down
12 changes: 12 additions & 0 deletions HSTracker/Mono/SimulationRunner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ struct UnsupportedInteraction: Error {

}

struct RuntimeError: LocalizedError {
let description: String

init(_ description: String) {
self.description = description
}

var errorDescription: String? {
return description
}
}

class SimulationRunnerProxy: MonoHandle, MonoClassInitializer {
static var _class: OpaquePointer?

Expand Down

0 comments on commit af78957

Please sign in to comment.