Enet makes love2d not responding

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
QunixDeveloper
Prole
Posts: 2
Joined: Sun Dec 27, 2020 7:54 pm

Enet makes love2d not responding

Post by QunixDeveloper » Sun Dec 27, 2020 7:59 pm

I copied these codes from https://love2d.org/wiki/lua-enet for sever and client side, turned on my t.console = true, but the game screen is just not responding, when I click on the love2d window it just appears white and says Love2d is not reponding > End task. Any solutions?

User avatar
zorg
Party member
Posts: 3057
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Enet makes love2d not responding

Post by zorg » Sun Dec 27, 2020 10:59 pm

Hi and welcome to the forums!

The reason for that is that the two examples on that page are not meant for löve at all, so they both contain infinite loops (the while true do code block) that shouldn't be there; that's why it's not responding.

Get rid of that, and put the contents of that block into love.update; it should work then.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

QunixDeveloper
Prole
Posts: 2
Joined: Sun Dec 27, 2020 7:54 pm

Re: Enet makes love2d not responding

Post by QunixDeveloper » Mon Dec 28, 2020 10:49 am

Thanks works perfectly, now theres another problem I wanna send say when I press key d I wanna send that info to the server and recieve it back. But when I remove event.peer:send("pong") from the code so I dont get spammed all the time the connection gets lost. Is there a way to fix this, can you provide me with some finished love2d enet projects so I can learn from them or make one simmilar to this thank you very much!

User avatar
Gunroar:Cannon()
Party member
Posts: 141
Joined: Thu Dec 10, 2020 1:57 am

Re: Enet makes love2d not responding

Post by Gunroar:Cannon() » Thu Jan 14, 2021 6:07 pm

You can use sock.lua, the wrapper around enet that comes with examples and makes it easier : https://github.com/camchenry/sock.lua
me: I don't always code but when I do it's done flawlessly.
also me:

Code: Select all

 function Gunroar:Cannon()
    for x, enemy in ipairs(self.allEnemies) do
        self:Cannon(enemy)
    end
end

Code: Select all

Lua Error: [file Gunroar.lua]:18: C stack overflow

Post Reply

Who is online

Users browsing this forum: No registered users and 55 guests