Can I force C # /. NET to use the latest build version

While working on tAPI (Terraria (if you don’t know the game, just look, it's awesome) modding API), we encountered the problem of cross-modem references. Basically, you can call methods from another mod (while you tell the developer of the mod to add links to this mod, obviously), but at the moment when you are trying to reload the mods, you really cannot be sure that the material will work: if you refer to any class from another mod, it will always use the version of FIRST downloaded by the game, and not the latest. This means that you cannot call anything static or create class instances from another mod, which is a real problem when you are working on some kind of API.

Mods themselves are standard C # code, and some additional JSON data is processed.

I tried to do the same thing outside of the tAPI source code, here is my approach to it (long code, said pastebin.com so that the paste never expires): http://pastebin.com/hjY57xJh

He has exactly the same problem. The second time the static method is called, it should print “456”, not “123”, as it does.

So my question is: can I do anything to make the game use the latest build, not the first?

We thought about using AppDomains, but it is painful for them to implement, and, as I understand it, they work by serializing the passing data, which can make the game clearly unplayable due to the number of calls that it must make for the mod.

EDIT: , , - "" . , "" .

+4
1

, : . tAPI ModBase, APIModBase. , () - ​​ , . , . , , API, - .

+1

Source: https://habr.com/ru/post/1543693/


All Articles