Closed blenderman94 closed 3 weeks ago
Thanks for the issue. I just tried out the sample from the enet tutorial to make sure it works. Here's what I did:
First, I created a folder named client
, made a file named main.lua
in there, and put this code in it:
local enet = require 'enet'
function lovr.load()
local host = enet.host_create()
local server = host:connect('localhost:6789')
local done = false
while not done do
local event = host:service(100)
if event then
if event.type == 'connect' then
print('Connected to', event.peer)
event.peer:send('hello world')
elseif event.type == 'receive' then
print('Got message: ', event.data, event.peer)
done = true
end
end
end
server:disconnect()
host:flush()
end
Then, I made a folder named server
, made a file named main.lua
in there, and put this code in it:
local enet = require 'enet'
function lovr.load()
local host = enet.host_create('localhost:6789')
while true do
local event = host:service(100)
if event and event.type == 'receive' then
print('Got message: ', event.data, event.peer)
event.peer:send(event.data)
end
end
end
I also put a conf.lua
file in the server folder with this, since the server doesn't need to render anything:
function lovr.conf(t)
t.modules.graphics = false
t.modules.headset = false
t.window = nil
end
Then, I started the server with lovr .
from the server folder, and ran the client with lovr .
from the client folder.
The server printed this:
Got message: hello world 127.0.0.1:53034
The client printed this:
Connected to 127.0.0.1:6789
Got message: hello world 127.0.0.1:6789
Can you share any more details about what you tried with the enet tutorial and how it failed? I'd love to improve the documentation, and I could start with the more specific steps I wrote out here, but I'm not sure if it would actually improve things without knowing the problem you're running into.
im working on solution to use my vr heqadset with virtualy any device. by simulating what steam vr does but without need to have xr on the device what runs the game ( Linux sucks with vr a lot ) rest is confidential.
greetings im trying to send a simple string over local on windows for a few months now (7) but lövr semingly is seariusly broken in a terms of ding anything over internet.
what i tryed so far.
used the tutorial for enet - never worket at all. tryed to compilea socket libary - failed tryed to ask the os to do some wit hos. execute failed.
basicaly what a wanted is to send a string hello from lövr to an other program on the same machine.
can you lease make a proper tutorial not what we have right now or just fix the networking in lövr?
it will be a lifesaver for my nerves thanks in advance!