From c5c4f82b51c026c92c98c98cc3aaafc41f77b3e9 Mon Sep 17 00:00:00 2001 From: Conkley Date: Sun, 10 Jul 2022 20:38:14 +1000 Subject: [PATCH] join script and gameserver fixes --- app/Http/Controllers/ClientController.php | 5 ++ public/game/gameserver.php | 52 +++++++------------ .../views/client/join.blade.php | 23 ++++---- routes/web.php | 1 + 4 files changed, 40 insertions(+), 41 deletions(-) rename public/game/join.php => resources/views/client/join.blade.php (95%) diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 7f9df16..c0a2069 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -25,6 +25,11 @@ class ClientController extends Controller return view('client.visit'); } + public function join() + { + return view('client.join'); + } + public function toolbox() { return view('client.toolbox'); diff --git a/public/game/gameserver.php b/public/game/gameserver.php index b973315..7d66d6e 100644 --- a/public/game/gameserver.php +++ b/public/game/gameserver.php @@ -3,10 +3,9 @@ header("content-type:text/plain"); $port = addslashes($_GET["port"]); -$rbxl = addslashes($_GET["rbxl"]); ob_start(); ?> -game:Load('rbxasset://') +game:Load('rbxasset://temp.rbxl') local assetPropertyNames = {"Texture", "TextureId", "SoundId", "MeshId", "SkyboxUp", "SkyboxLf", "SkyboxBk", "SkyboxRt", "SkyboxFt", "SkyboxDn", "PantsTemplate", "ShirtTemplate", "Graphic", "Frame", "ImageLabel", "GuiMain", "Image", "LinkedSource", "AnimationId"} local variations = {"http://www%.roblox%.com/asset/%?id=", "http://www%.roblox%.com/asset%?id=", "http://%.roblox%.com/asset/%?id=", "http://%.roblox%.com/asset%?id="} @@ -43,36 +42,25 @@ for i, v in pairs(GetDescendants(game)) do end print("DONE! Replaced " .. replacedProperties .. " properties") -game:GetService("NetworkServer"):Start() -game:GetService("RunService"):Run() -game.Lighting.GlobalShadows = true -game.Players.PlayerAdded:connect(function(plr) -Player.Changed:connect(function(Property) -if (Property=="Character") and (Player.Character~=nil) then -local Character=Player.Character -local Humanoid=Character:FindFirstChild("Humanoid") -if (Humanoid~=nil) then -Humanoid.Died:connect(function() delay(RespawnTime,function() Player:LoadCharacter() LoadCharacterNew(newWaitForChild(Player,"Appearance"),Player.Character,Player.Backpack) end) end) -end -end -end) -end) -game.Players.PlayerAdded:connect(onJoined) -game:GetService("NetworkServer"):Start() -game:GetService("RunService"):Run() -game.Lighting.GlobalShadows = true -game.Players.PlayerAdded:connect(function(plr) -Player.Changed:connect(function(Property) -if (Property=="Character") and (Player.Character~=nil) then -local Character=Player.Character -local Humanoid=Character:FindFirstChild("Humanoid") -if (Humanoid~=nil) then -Humanoid.Died:connect(function() delay(RespawnTime,function() Player:LoadCharacter() LoadCharacterNew(newWaitForChild(Player,"Appearance"),Player.Character,Player.Backpack) end) end) -end -end -end) -end) -game.Players.PlayerAdded:connect(onJoined) +local Port = +Server = game:GetService("NetworkServer") +RunService = game:GetService("RunService") +Server:start(Port, 20) +game:GetService("Visit") +RunService:run() +function onJoined(newPlayer) +print ("An new connection was accepted.") +newPlayer:LoadCharacter() +while true do +wait(0.001) +if newPlayer.Character.Humanoid.Health == 0 +then print ("Player died") wait(5) newPlayer:LoadCharacter() print("Player respawned") +elseif newPlayer.Character.Parent == nil then wait(5) newPlayer:LoadCharacter() -- to make sure nobody is deleted. +end +end +end + +game.Players.PlayerAdded:connect(onJoined) name); +$ip = addslashes($_GET["ip"]); +$port = addslashes($_GET["port"]); +$id = addslashes(Auth::id()); +$app = 'test'; +//$app = addslashes($_GET["app"]); ob_start(); -?> +@endphp --This is a joinscript that works in 2013 and back, etc. @@ -36,8 +43,6 @@ pcall(function() settings().Physics.Is30FpsThrottleEnabled = false end) pcall(function() settings()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.AccumulatedError end) pcall(function() settings().Physics.PhysicsEnvironmentalThrottle = Enum.EnviromentalPhysicsThrottle.DefaultAuto end) -pcall(function() game:GetService("ScriptContext"):AddCoreScript(1,game:GetService("ScriptContext"),"StarterScript") end) - local threadSleepTime = ... if threadSleepTime==nil then @@ -227,10 +232,10 @@ local success, err = pcall(function() end) pcall(function() game:SetScreenshotInfo("") end) - \ No newline at end of file +@endphp \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index ef3c010..190401d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -51,5 +51,6 @@ Route::group(['middleware' => 'AdminCheck'], function() { // Client routes Route::get('/game/studio.ashx', [App\Http\Controllers\ClientController::class, 'studio'])->name('studio'); Route::get('/game/visit.ashx', [App\Http\Controllers\ClientController::class, 'visit'])->name('visit'); +Route::get('/game/join.php', [App\Http\Controllers\ClientController::class, 'join'])->name('join'); Route::get('/ide/welcome', [App\Http\Controllers\ClientController::class, 'ide'])->name('ide'); Route::get('/IDE/ClientToolbox.aspx', [App\Http\Controllers\ClientController::class, 'toolbox'])->name('toolbox'); \ No newline at end of file