th3-z / kf2-magicked-admin

:spider: Mutator-free management, statistics, and in-game bot for ranked Killing Floor 2 servers
https://kf2-ma.th3-z.xyz
MIT License
32 stars 7 forks source link

[BUG] IndexError: list index out of range #147

Closed R31GNDEV closed 4 years ago

R31GNDEV commented 4 years ago

Untitled Receiving these errors on start:

[] Connecting to server_one (http://192.168.1.89:8080)... [] Detected KF2-MA install on server. [*] Connected to server_one (http://192.168.1.89:8080) Traceback (most recent call last): File "C:\Python\lib\site-packages\cx_Freeze\initscripts__startup__.py", line 14, in run File "C:\Python\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run File "magicked_admin\magicked_admin.py", line 161, in File "magicked_admin\magicked_admin.py", line 126, in run File "magicked_admin\magicked_admin.py", line 80, in make_server File "C:\Users\wabbi\Documents\kf2-magicked-admin\kf2-magicked-admin\magicked_admin\web_admin\web_admin.py", line 24, in init File "C:\Users\wabbi\Documents\kf2-magicked-admin\kf2-magicked-admin\magicked_admin\web_admin\web_interface.py", line 387, in get_payload_map_settings IndexError: list index out of range

Let me know what you think...

th3-z commented 4 years ago

Hi, thanks for the bug report. I can tell you what is happening here.

kf2-ma is trying to find the name of the current map on this line. It's getting this information from the /ServerAdmin/current/change page, specifically the selected item in the dropdown labeled 'map'. Each value in that dropdown has a hidden 'value' field that contains the internally used name for the map.

I think the issue arises either when no map is currently active/selected (I don't think this is possible but there could of been changes), or the selected map doesn't have any 'value' field.

I'll need more information to solve the issue:

R31GNDEV commented 4 years ago

A copy of your [KF-* KFMapSummary] sections from PCServer-KFGame.ini

This was my issue. I moved PC's and previously had a server that was running 0.1.5 MA.... Completely forgot to add my KFMapSummary's also, I know Wabbit so now I run 0.1.6 Here's proof:

           _     _         _

__ ||_| | | | | | .'| . | | | '| -| . | |||_|,| |||,||| |_| | |____|_| <<0.1.5>> | .'| . | | | | https://th3-z.xyz/kf2-ma |,||||||||

[] Connecting to server_one (http://192.168.1.89:8080)... [] Detected KF2-MA install on server. [] Connected to server_one (http://192.168.1.89:8080) [] [Lua] Initialisation complete [] [Lua] Creating namespace - chat [] [Lua] Creating Python bind - chat.say -> submit_message [] [Lua] Creating namespace - hooks [] [Lua] Creating namespace - server [] [Lua] Creating Python bind - server.write_players -> write_all_players [] [Lua] Creating Python bind - server.write_game -> write_game_map [] [Lua] Creating Python bind - server.get_player -> get_player_by_sid [] [Lua] Creating Python bind - server.get_players -> get_players [] [Lua] Creating Python bind - server.set_game_password -> set_game_password [] [Lua] Creating Python bind - server.set_difficulty -> set_difficulty [] [Lua] Creating Python bind - server.set_length -> set_length [] [Lua] Creating namespace - motd [] [Lua] Creating namespace - db [] [Lua] Creating Python bind - db.execute -> execute [] [Lua] Creating Python bind - db.rank_kills -> execute [] [Lua] Creating Python bind - db.top_kills -> execute [] [Lua] Creating Python bind - db.get_player -> load_player [] [Lua] Creating namespace - requests [] [Lua] Creating Python bind - requests.get -> get [] [Lua] Creating Python bind - requests.post -> post [*] Initialisation complete!

New game on server_one, map: Kill Zone_WabbitEdit, mode: Endless

th3-z commented 4 years ago

Nice, I'm glad you got it sorted. I think I'll add an error message informing the user what is wrong when this is encountered. I'll leave the issue open until that's done.

th3-z commented 4 years ago

Added a warning and fallback map