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

client.host a nil value #21

Closed
Ismoh opened this issue Nov 12, 2021 · 1 comment
Closed

client.host a nil value #21

Ismoh opened this issue Nov 12, 2021 · 1 comment

Comments

@Ismoh
Copy link

Ismoh commented Nov 12, 2021

Hey guys,
I am using sock.lua for modding for Noita.
I added lua-enet via enet.dll from https://leafo.net/lua-enet/#download_and_install see "windows". Downloaded all versions, but 1.0 was the only working one. The others threw this error: leafo/lua-enet#1 (comment)

server.host:
image

client.host:
image

Error when client:connect():
image
image
See:

sock.lua/sock.lua

Lines 745 to 752 in 4c9fd32

--- Connect to the chosen server.
-- Connection will not actually occur until the next time `Client:update` is called.
-- @tparam ?number code A number that can be associated with the connect event.
function Client:connect(code)
-- number of channels for the client and server must match
self.connection = self.host:connect(self.address .. ":" .. self.port, self.maxChannels, code)
self.connectId = self.connection:connect_id()
end

Can anyone give me a hint?
or
Are you somehow able to provide a working enet.dll / lua-enet, which is used in löve?

@Ismoh
Copy link
Author

Ismoh commented Nov 12, 2021

For everyone stumble on this:
Make sure parameters have the correct type.
Port was a string, but has to be a number/integer.
Use tonumber() function to be on the safe side.

sock.lua/sock.lua

Line 1363 in 4c9fd32

sock.newClient = function(serverOrAddress, port, maxChannels)

@Ismoh Ismoh closed this as completed Nov 12, 2021
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

1 participant