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 »

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: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Enet makes love2d not responding

Post by zorg »

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 »

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: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Enet makes love2d not responding

Post by Gunroar:Cannon() »

You can use sock.lua, the wrapper around enet that comes with examples and makes it easier : https://github.com/camchenry/sock.lua
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 47 guests