Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to index field 'connection' (a nil value) - server.lua Line 38 #14

Open
Camble opened this issue Jun 14, 2023 · 11 comments
Open

Comments

@Camble
Copy link
Contributor

Camble commented Jun 14, 2023

Intermittent error when starting DCS

"[string "C:\Users\username\Saved Games\DCS.openbeta\Scripts\twitch\server.lua"]:38: attempt to index field 'connection' (a nil value)"

Originally posted by @danw-eth in #13 (comment)

@HangmanGlenn
Copy link

i have got this issue an can not get it back to work again?

@ozdeadmeat
Copy link

i have got this issue an can not get it back to work again?

In my experience, if the error is popping up, you need to reauth to Twitch again. Give that a go and see if it works.

@HangmanGlenn
Copy link

HangmanGlenn commented Jul 27, 2024 via email

@Camble
Copy link
Contributor Author

Camble commented Jul 27, 2024

@HangmanGlenn is the line number 38? If not, it may be a different issue which was resolved, but not included in the latest release. If the line number is different, download the latest server.lua directly instead of from the GitHub releases.

@HangmanGlenn
Copy link

HangmanGlenn commented Jul 27, 2024 via email

@HangmanGlenn
Copy link

also try that server.lua file does not work an together with this signed out my oauth en reconnect again stil no response an the server.lua 38 fault keeps poppin up..

@HangmanGlenn
Copy link

i also deleted the options.lua file like they say in the read.me an than i have to set all the settings again to how it was also for vr an all the other stuff it works for only that matter in game there is no server.lua fault but it also does'nt work(the in game chat). when i restart the game the server.lua 38 is back

@Camble
Copy link
Contributor Author

Camble commented Jul 28, 2024

The problem is that self.connection is nil when line 38 is executed

The only place I can see self.connection being set to nil is inside the Server:reset() function above. A bit of guesswork here, but above line 38, something like this could be added:
if not self.connection then self.connection = socket.tcp() end

Or maybe Server:reset() should just do self.connection = socket.tcp(). Not sure what else this would impact. The code is called from here.

@HangmanGlenn
Copy link

HangmanGlenn commented Jul 29, 2024 via email

@HangmanGlenn
Copy link

HangmanGlenn commented Aug 3, 2024 via email

@HangmanGlenn
Copy link

HangmanGlenn commented Aug 4, 2024 via email

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

No branches or pull requests

3 participants