Skip to content

Feature/mod compatibility#94

Merged
mroote merged 14 commits intoOpenFactorioServerManager:masterfrom
knoxfighter:feature/mod-compatibility
Jun 2, 2018
Merged

Feature/mod compatibility#94
mroote merged 14 commits intoOpenFactorioServerManager:masterfrom
knoxfighter:feature/mod-compatibility

Conversation

@knoxfighter
Copy link
Copy Markdown
Member

added checks for mod compatibility:

  • incompatible mods will be highlighted
  • on downloading mods, a compatible version will be preselected
  • updating mods only to compatible versions
  • downgrading mods, when version to high (e.g: 0.15 server and 0.16 mods installed)
  • everything also for modpacks

@mroote
Copy link
Copy Markdown
Member

mroote commented May 23, 2018

Nice! some useful features there.

I tested out your branch but I'm running into an error trying to download a mod in the UI. It looks like the downloads completes but then I get an index out of range error, let me know if you want any other details.

2018/05/23 18:02:33 download complete                                                                                                                                                                            
 StatusCode: 200                                                                                                                                                                                                 
 Status: 200 OK                                                                                                                                                                                                  
2018/05/23 18:02:33 http: panic serving 10.42.0.101:51686: runtime error: index out of range                                                                                                                     
goroutine 137 [running]:                                                                                                                                                                                         
net/http.(*conn).serve.func1(0xc420184000)                                                                                                                                                                       
        /usr/lib/go/src/net/http/server.go:1726 +0xd0                                                                                                                                                            
panic(0x7ca740, 0xa69970)                                                                                                                                                                                        
        /usr/lib/go/src/runtime/panic.go:502 +0x229                                                                                                                                                              
main.(*ModInfoList).listInstalledMods.func1(0xc4202a5200, 0x2f, 0x89fc00, 0xc42009d930, 0x0, 0x0, 0x0, 0x0)                                                                                                      
        /home/mitch/src/go/src/github.com/mroote/factorio-server-manager/src/mod_modInfo.go:77 +0x67d                                                                                                            
path/filepath.walk(0xc4202a5200, 0x2f, 0x89fc00, 0xc42009d930, 0xc420502d10, 0x0, 0x0)                                                                                                                           
        /usr/lib/go/src/path/filepath/path.go:357 +0x402                                                                                                                                                         
path/filepath.walk(0xc4200ba7c0, 0x1d, 0x89fc00, 0xc42009d790, 0xc420502d10, 0x0, 0x10)                                                                                                                          
        /usr/lib/go/src/path/filepath/path.go:381 +0x2c2                                                                                                                                                         
path/filepath.Walk(0xc4200ba7c0, 0x1d, 0xc420502d10, 0xa764c0, 0xc42009bbc0)                                                                                                                                     
        /usr/lib/go/src/path/filepath/path.go:403 +0x106                                                                                                                                                         
main.(*ModInfoList).listInstalledMods(0xc42024a528, 0xc4202a5140, 0x2f)                                                                                                                                          
        /home/mitch/src/go/src/github.com/mroote/factorio-server-manager/src/mod_modInfo.go:50 +0x97                                                                                                             
main.(*ModInfoList).createMod(0xc42024a528, 0xc420349259, 0x7, 0xc42034923f, 0x11, 0x89aa60, 0xc420306e40, 0x0, 0x0)                                                                                             
        /home/mitch/src/go/src/github.com/mroote/factorio-server-manager/src/mod_modInfo.go:190 +0x3fb
main.(*Mods).createMod(0xc42024a500, 0xc420349259, 0x7, 0xc42034923f, 0x11, 0x89aa60, 0xc420306e40, 0xc4200ba7c0, 0x1d)                                                                                         
        /home/mitch/src/go/src/github.com/mroote/factorio-server-manager/src/mod_Mods.go:113 +0xcc
main.(*Mods).downloadMod(0xc42024a500, 0xc4202a4fc0, 0x2a, 0xc42034923f, 0x11, 0xc420349259, 0x7, 0x0, 0x0)                                                                                                     
        /home/mitch/src/go/src/github.com/mroote/factorio-server-manager/src/mod_Mods.go:160 +0x588
main.ModPortalInstallHandler(0x89e4a0, 0xc4203b4540, 0xc4201e7700)
        /home/mitch/src/go/src/github.com/mroote/factorio-server-manager/src/mods_handler.go:210 +0x65e
net/http.HandlerFunc.ServeHTTP(0x8670a0, 0x89e4a0, 0xc4203b4540, 0xc4201e7700)
        /usr/lib/go/src/net/http/server.go:1947 +0x44
main.AuthorizeHandler.func1(0x89e4a0, 0xc4203b4540, 0xc4201e7700)
        /home/mitch/src/go/src/github.com/mroote/factorio-server-manager/src/routes.go:116 +0x233
net/http.HandlerFunc.ServeHTTP(0xc420120f00, 0x89e4a0, 0xc4203b4540, 0xc4201e7700)
        /usr/lib/go/src/net/http/server.go:1947 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc42005a2d0, 0x89e4a0, 0xc4203b4540, 0xc4201e7700)
        /home/mitch/src/go/src/github.com/gorilla/mux/mux.go:114 +0xdc
net/http.serverHandler.ServeHTTP(0xc42009d2b0, 0x89e4a0, 0xc4203b4540, 0xc4201e7500)
        /usr/lib/go/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc420184000, 0x89e860, 0xc4200a9740)
        /usr/lib/go/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
        /usr/lib/go/src/net/http/server.go:2795 +0x27b
2018/05/23 18:02:33 http: panic serving 10.42.0.101:51688: runtime error: index out of range

@knoxfighter
Copy link
Copy Markdown
Member Author

It's not possible for me to reproduce this error. To test further, send me more informations.

  • Which factorio-version did you use?
  • Which mod did you tried to install?
  • At what point did the error occur (after clicking on GO, after selecting the version, ...)?

Or did you forget to recompile the UI again?

@mroote
Copy link
Copy Markdown
Member

mroote commented May 25, 2018

It occurs when I search for 'rso-mod', then I select the version and click download. After the download the UI shows an error some error occured and the panic is logged to the console.

It looks like it could be there is an index error when trying to list the contents of the mod directory.

@knoxfighter
Copy link
Copy Markdown
Member Author

ok, you need to rebuild the ui (npm run build)
In the current version, there is no search anymore. So you have a text-field, in which the mod-id needs to be written.

@mroote
Copy link
Copy Markdown
Member

mroote commented May 25, 2018

Yes I rebuilt the UI with the latest code. I used rso-mod as the ID and it seemed to find the mods and listed a few versions. Is there another ID I should use?

@knoxfighter
Copy link
Copy Markdown
Member Author

knoxfighter commented May 25, 2018

ok, the problem is definitly caused by the rso-mod. With every other mod it works fine.
I look, where it fails and if this is a problem, caused by me.

@knoxfighter
Copy link
Copy Markdown
Member Author

knoxfighter commented May 25, 2018

ok, i found the error: The info.json from the mod rso-mod is invalid. It doesn't use semver for defining its dependencies, what is default for factorio-versioning. This mod shouldn't work in the game at all (hopefully).

Edit:
I will create a function, that checks, if the dependencies are valid and if not, just throws an error message. Result wil be, that this mod is installable, but it doesn't break the system anymore.

@mroote
Copy link
Copy Markdown
Member

mroote commented May 25, 2018

Ah nice find. I'm suprised rso-mod has an invalid info.json, considering it's the most popular mod on the Factorio website I guess they aren't autogenerated.

It might be good to rename the mod-id field in the UI to 'mod name'. I thought you needed to supply a numeric ID on the form at first.

@knoxfighter
Copy link
Copy Markdown
Member Author

ok, i fixed it, by searching for the base mod and if its not there, using the factorioVersion field :)

@mroote
Copy link
Copy Markdown
Member

mroote commented Jun 2, 2018

Nice works for me now. This looks great thanks for the contribution!

@mroote mroote merged commit 1fa3adf into OpenFactorioServerManager:master Jun 2, 2018
@knoxfighter knoxfighter deleted the feature/mod-compatibility branch June 2, 2018 22:34
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.

2 participants