Compare commits

...

2 Commits

Author SHA1 Message Date
teverse d158723832 wip improvements 2019-12-14 11:48:31 +00:00
teverse 42215f3e5a fiox 2019-12-12 20:06:18 +00:00
3 changed files with 35 additions and 3 deletions

View File

@ -41,7 +41,7 @@ end
local function characterSpawnedHandler(newClientId)
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
print("waiting")
repeat wait() until workspace[engine.networking.me.id]

View File

@ -35,7 +35,7 @@ update = function(client, cameraDirection)
return moved
end
engine.networking.clients:clientConnected(function (client)
function onConnection(client)
wait(1)
print("spawning", client.id)
local char = engine.construct("block", workspace, {
@ -78,7 +78,13 @@ engine.networking.clients:clientConnected(function (client)
end)
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)
if controller.characters[client] then

View File

@ -26,6 +26,32 @@ local tabs = {
{"Settings", "fa:s-cog", function ()
shared.windows.settings.visible = not shared.windows.settings.visible
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},
}
}