瀏覽代碼

FINAL FIX PLEASE PLEASE PLEASE

tags/online
madiwka3 4 年之前
父節點
當前提交
6074030f5e
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. +4
    -5
      main.lua

+ 4
- 5
main.lua 查看文件

@@ -792,14 +792,13 @@ function nettest(dt)
print("ReceivedINFO: " .. data)
confirmation = "N"
local p = split(data, '|')
if p[3] ~= "CLIENT" then
if p[2] ~= "CLIENT" then
confirmation = "U"
end
if tonumber(p[4]) > 90 then
if tonumber(p[3]) > 90 then
confirmation = "L"
end
lastSentKeyClient = p[1]
player2.y = tonumber(p[2])
end
until not data
@@ -812,12 +811,12 @@ function clienttest(dt)
udp = socket.udp()
udp:setpeername(address, port)
udp:settimeout(0)
udp:send(tostring(lastSentKey) .. '|' .. tostring(player2.y) .. "|CLIENT")
udp:send(tostring(lastSentKey) .. "|CLIENT")
clientinit = true
end
ts = ts + dt
if ts > updaterate then
udp:send(tostring(lastSentKey) .. '|' .. tostring(player2.y) .. "|CLIENT")
udp:send(tostring(lastSentKey) .. "|CLIENT")
ts = 0
end
local data


Loading…
取消
儲存