mirror of https://github.com/teverse/teverse
Compare commits
2 Commits
5c70b55a67
...
d158723832
Author | SHA1 | Date |
---|---|---|
![]() |
d158723832 | |
![]() |
42215f3e5a |
|
@ -41,7 +41,7 @@ end
|
||||||
|
|
||||||
local function characterSpawnedHandler(newClientId)
|
local function characterSpawnedHandler(newClientId)
|
||||||
repeat wait() until engine.networking.me -- we shouldnt need to do this
|
repeat wait() until engine.networking.me -- we shouldnt need to do this
|
||||||
print("spawning")
|
print("spawning", newClientId, engine.networking.me.id)
|
||||||
if engine.networking.me.id == newClientId then
|
if engine.networking.me.id == newClientId then
|
||||||
print("waiting")
|
print("waiting")
|
||||||
repeat wait() until workspace[engine.networking.me.id]
|
repeat wait() until workspace[engine.networking.me.id]
|
||||||
|
|
|
@ -35,7 +35,7 @@ update = function(client, cameraDirection)
|
||||||
return moved
|
return moved
|
||||||
end
|
end
|
||||||
|
|
||||||
engine.networking.clients:clientConnected(function (client)
|
function onConnection(client)
|
||||||
wait(1)
|
wait(1)
|
||||||
print("spawning", client.id)
|
print("spawning", client.id)
|
||||||
local char = engine.construct("block", workspace, {
|
local char = engine.construct("block", workspace, {
|
||||||
|
@ -78,7 +78,13 @@ engine.networking.clients:clientConnected(function (client)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
controller.characters[client] = { updating=false, character = char, keys = {false,false,false,false}, speed = controller.defaultSpeed }
|
controller.characters[client] = { updating=false, character = char, keys = {false,false,false,false}, speed = controller.defaultSpeed }
|
||||||
end)
|
end
|
||||||
|
|
||||||
|
for _,v in pairs(engine.networking.clients.children) do
|
||||||
|
onConnection(v)
|
||||||
|
end
|
||||||
|
|
||||||
|
engine.networking.clients:clientConnected(onConnection)
|
||||||
|
|
||||||
engine.networking.clients:clientDisconnected(function (client) wait(1)
|
engine.networking.clients:clientDisconnected(function (client) wait(1)
|
||||||
if controller.characters[client] then
|
if controller.characters[client] then
|
||||||
|
|
|
@ -26,6 +26,32 @@ local tabs = {
|
||||||
{"Settings", "fa:s-cog", function ()
|
{"Settings", "fa:s-cog", function ()
|
||||||
shared.windows.settings.visible = not shared.windows.settings.visible
|
shared.windows.settings.visible = not shared.windows.settings.visible
|
||||||
end},
|
end},
|
||||||
|
{"Test", "fa:s-satellite-dish", function ()
|
||||||
|
if not shared.workshop.gameFilePath or shared.workshop.gameFilePath == "" then
|
||||||
|
ui.prompt("Please save this game before testing.")
|
||||||
|
else
|
||||||
|
|
||||||
|
local content = engine.construct("guiTextBox", shared.workshop.interface, {
|
||||||
|
name = "_loadingTest",
|
||||||
|
backgroundAlpha = 0,
|
||||||
|
textAlpha = 0,
|
||||||
|
backgroundColour = colour:black(),
|
||||||
|
size = guiCoord(1, 0, 1, 0),
|
||||||
|
position = guiCoord(0, 0, 0, 0),
|
||||||
|
zIndex = 5000,
|
||||||
|
fontSize = 24,
|
||||||
|
align = enums.align.middle,
|
||||||
|
text = "Uploading to Remote Testing Server\nServer: London"
|
||||||
|
})
|
||||||
|
|
||||||
|
engine.tween:begin(content, 1, {
|
||||||
|
backgroundAlpha = 0.95,
|
||||||
|
textAlpha = 1
|
||||||
|
}, "inOutQuad")
|
||||||
|
|
||||||
|
shared.workshop:remoteTestServer()
|
||||||
|
end
|
||||||
|
end},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue