Quellcode durchsuchen

Online update

tags/online
madiwka3 vor 4 Jahren
Ursprung
Commit
8b2d326d89
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. +3
    -2
      main.lua

+ 3
- 2
main.lua Datei anzeigen

@@ -768,7 +768,7 @@ function nettest(dt)
end
for i = 1, maxBalls do
print (tostring(ball[i].dy))
udp:send(tostring(lastSentKey) ..'|'.. tostring(ball[i].dy) .. '|' .. tostring(player2.y) .. '|' .. tostring(player1.y) .. '|' .. tostring(player1score) .. '|' .. tostring(player2score) .. '|' .. tostring(player1nukescore) .. '|' .. tostring(player2nukescore) .. tostring(ball[i].x) .. '|' .. tostring(ball[i].y) .. '|' .. gameState .. '|' .. tostring(ball[i].dx) .. "|HOST")
udp:send(tostring(lastSentKey) ..'|'.. tostring(ball[i].dy) .. '|' .. tostring(player2.y) .. '|' .. tostring(player1.y) .. '|' .. tostring(player1score) .. '|' .. tostring(player2score) .. '|' .. tostring(player1nukescore) .. '|' .. tostring(player2nukescore) .. '|' tostring(ball[i].x) .. '|' .. tostring(ball[i].y) .. '|' .. gameState .. '|' .. tostring(ball[i].dx) .. "|HOST")
print("SENT: " .. lastSentKey .. " TO ADDRESS: " .. IP)
end
data = udp:receive()
@@ -803,8 +803,9 @@ function clienttest(dt)
udp:send(tostring(lastSentKey) .. '|' .. tostring(player2.y) .. "|CLIENT")
print("SENT TO SERVER:" .. lastSentKey .. " AT ADDRESS: " .. IP)
data = udp:receive()
--print(data)
if data then
print(data)
confirmation = "N"
local p = split(data, '|')
if p[13] then


Laden…
Abbrechen
Speichern