Im ready to upload mod :) I want to know when can the problem to be fixed, or do you wanna more experiment data ? :D
+0 / -0
|
Frankly, I'm not sure we can fix this on our end. The attempted fix was to update the engine-supplied code that parses mods and maps, but this broke the uploading of basically everything else. So it is something that needs fixing engine-side.    Licho said that the crash occurred here earlier:
var mod = new Mod(ae)
{
UnitDefs = GetUnitList().Select(ui => new UnitInfo(ui.Name, ui.FullName)).ToArray(),
StartUnits = new SerializableDictionary<string, string>(GetStartUnits(out sides)),
Sides = sides,
Options = GetModOptions().ToArray(),
SideIcons = GetSideIcons(sides).ToArray(),
ModAis = GetAis().Where(ai => ai.IsLuaAi).ToArray()
};
You should check that your mod is supplying each of those things, in a way that doesn't seem too dissimilar from other mods. Have you done anything extra to unitdefs_posts? Check that first. I don't want you just trying to upload and crashing the server.
+0 / -0
|
Can I have some error log? I will collect what weird things did I do. [Spoiler]
New CustomUnits: I do VFS.Include("units/".. udname ..".lua")[udname] when loading gadget, with Shared={}. I create a global variable GameData when loading defs and loading gadgets. Some ud and wd may or may not be loaded, depends on modoptions. I changed unit_script.lua with Spring.UnitScript.scripts=scripts then used it in scripts/custom_unit_proxy.lua
My unitdef files may VFS.Include other unitdef files.
SillyModSystem: I changed Spring.GetModOptions (I see other code does it too)
I changed movedefs.lua and lets it run Spring.Utilities.to_make_op_things.MoveDef_TryGen for each moveDef found in ud but not in moveDefs
I added AutoAdd("chickens", defaultOpts) in sounds.lua
btw, is the code that throws error really necessary? we do can play the mod. I had read some code. Spring\tools\unitsync\unitsync.cpp LoadGameDataUnitDefs() executes gamedata/defs.lua, seems to be the entry of the bug. The problem is what is the environment of this execute? Also, After i try my mod at local, I always get desync playing multi players, and desync occurs at a ramdom time (e.g. after 3min or 10min). Idk how
+0 / -0
|
My guess would be that you're doing something too fancy in _posts. The environment for parsing games is old, since newer ones seem to fail to parse maps correctly.
+0 / -0
|
what about
Mod mod;
if (ae.Name.Contains("Silly Wars")) {
mod=new Mod(ae)
{
UnitDefs = [],
StartUnits = new SerializableDictionary<string, string>(GetStartUnits(out sides)),
Sides = sides,
Options = GetModOptions().ToArray(),
SideIcons = GetSideIcons(sides).ToArray(),
ModAis = GetAis().Where(ai => ai.IsLuaAi).ToArray()
};
}else {...}
:3 And I had fixed some bug and really want to upload my mod. I had changed smth that MAY works (custom_units will not be loaded without modoptions)... Can you firstly capture C++ error (like https://learn.microsoft.com/en-us/dotnet/csharp/how-to/how-to-catch-a-non-cls-exception or smth I don't know alot) to prevent server boom then I can try throw
+0 / -0
|
Can I see your mod files @XNTWSAD?
+0 / -0
|
You can see it in github https://github.com/XNTEABDSC/Silly-Wars , main branch You can run 7z.py to generate .sd7. It just change modinfo's name and version, and remove some files.
+0 / -0
|
|
wat. I tried cooked the server again, almost same as last time. I uploaded mod Silly_Wars_v0.8.1.1.sd7, web page rotated for a while then says Status: RegistrationError. Server is fine. Some minutes later, I uploaded mod Silly_Wars_v0.8.1.1.sd7 again, then SERVER BOOOM. The question is: why first time error, second time boom? are there anything left in the environment while Status: RegistrationError, and causes boom when second upload? Welp I will start putting something from sillywars to zk modders' dream and test it bit by bit (by upload), if I met RegistrationError,I ll upload a empty mod to test, then stop
+0 / -0
|
I tried to upload ZK_Modders_Dream_v0.0.0.1.sd7 twice which succeed. I noticed that the second uploading shows Status: AlreadyExist. Is it possible that, e.g. my last attemp to upload mod that causes server boom, first time my uploading caused RegisterError but has some wrong information registerred, and caused second uploading boom.
+0 / -0
|
I uploaded ZK_Modders_Dream_v0.0.0.7.sd7 and Silly_Wars_v0.9.0.0.sd7 successfully. Then I uploaded ZK_Modders_Dream_v0.0.0.8.sd7 successfully. Then I uploaded Silly_Wars_v0.9.0.1.sd7 and RegisterError occurred. I didnt try again because it may cooks server. There are very little changes between this 2 versions. At ZK_Modders_Dream_v0.0.0.8 I fixed some bug in unit_centeroffset.lua and unit_attributes_generic.lua. At Silly_Wars_v0.9.0.0 I added 2 new units. Then where is the bug?
+0 / -0
|
|
Finally. I setup server locally. And I can upload my mod without any problem, even the previously buggy version (Silly_Wars_v0.8.1.1.sd7). And they can be uploaded to zk as well ??? (wait server seems boomed I didnt see) So the problem just pop up randomly ?? I guess after RegisterError any attemp of uploading will coom server. ( So I can lay a mine and wait Future War to cook server) I had spamed some mods (v0.9.0.3 ~ v0.9.0.6), all succeed.
+0 / -0
|
|
A big question. In my local server I uploaded Silly_Wars_v0.9.0.11.sd7 which needs ZK_Modders_Dream_v0.0.0.12.sd7 which is NOT uploaded. and register passed. So what did unitdync do? At AutoRegistrator.UnitSyncer.Scan() you seems to forgot to unitsync.Reset() when a error has thrown, im not sure thether this can causes another error throw.
+0 / -0
|
Finally I did debug and found smth useful: At first upload, UnitSync is executing gamedata/defs.lua and I have something logged. but log stopped freshing when logging movedef.lua. Idk what happened. After about a min, 0x000000006A17A8D2 at (unitsync.dll) raise error : accessing NULL. After RegisterationError, some process got bypass. Then at next upload, unitSync line 63 NativeMethods.Init() throws c error which caused server boom. ( and, throwing a mod which just crash(e,g, syntax error) can just bypass UnitSync and can register successfully)
+0 / -0
|
Do you think you will be able to find a fix and make a pull request?
+0 / -0
|
|
Ok I finally found my big problem and I fixed it. [Spoiler] ( the proof of why ownership mechanism is a great invention )
Unitsync somehow loaded all unitdef file twice idk why, it doesn't happens at other place.
at turretheavylaserlv20.lua, I called to_make_very_op_things.units_level_up(ud,to_make_very_op_things.units_level_up_table,20)
at to_make_very_op_things/unit_level_up.lua, to_make_very_op_things.units_level_up_table is a table contains lv up mults.
at to_make_very_op_things.units_level_up, it used to not having `ulutable=Spring.Utilities.CopyTable(ulutable,true)`
and it do ulutable[key]=value^lv,
at second loading turretheavylaserlv20, scaleMult becomes (1.025^20)^20 ~~= 20000
Then unitdef_post do wacky_utils.set_scale, which do ScaleYardMap which needs to fill a 50000x50000 map
yay. .....
About server [Spoiler] Add [HandleProcessCorruptedStateExceptions] at function (if it is a enum function, rewrite it to return List), and try catch, and return new List<...>(); if error can make upload mod successfully.
move NativeMethods.Init(false, 666) into another function and HandleProcessCorruptedStateExceptions can prevent server boom.
but infintity loop seems breaks state of unitsync.dll, and after error throw, any upload will throw error unless you can refresh unitsync.dll's state.
+3 / -0
|