join script and gameserver fixes

This commit is contained in:
Conkley 2022-07-10 20:38:14 +10:00
parent a46cafa53e
commit c5c4f82b51
4 changed files with 40 additions and 41 deletions

View File

@ -25,6 +25,11 @@ class ClientController extends Controller
return view('client.visit'); return view('client.visit');
} }
public function join()
{
return view('client.join');
}
public function toolbox() public function toolbox()
{ {
return view('client.toolbox'); return view('client.toolbox');

View File

@ -3,10 +3,9 @@
header("content-type:text/plain"); header("content-type:text/plain");
$port = addslashes($_GET["port"]); $port = addslashes($_GET["port"]);
$rbxl = addslashes($_GET["rbxl"]);
ob_start(); ob_start();
?> ?>
game:Load('rbxasset://<?php echo $rbxl; ?>') 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 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="} 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 end
print("DONE! Replaced " .. replacedProperties .. " properties") print("DONE! Replaced " .. replacedProperties .. " properties")
game:GetService("NetworkServer"):Start(<?php echo $port; ?>) local Port = <?php echo $port ; ?>
game:GetService("RunService"):Run() Server = game:GetService("NetworkServer")
game.Lighting.GlobalShadows = true RunService = game:GetService("RunService")
game.Players.PlayerAdded:connect(function(plr) Server:start(Port, 20)
Player.Changed:connect(function(Property) game:GetService("Visit")
if (Property=="Character") and (Player.Character~=nil) then RunService:run()
local Character=Player.Character function onJoined(newPlayer)
local Humanoid=Character:FindFirstChild("Humanoid") print ("An new connection was accepted.")
if (Humanoid~=nil) then newPlayer:LoadCharacter()
Humanoid.Died:connect(function() delay(RespawnTime,function() Player:LoadCharacter() LoadCharacterNew(newWaitForChild(Player,"Appearance"),Player.Character,Player.Backpack) end) end) while true do
end wait(0.001)
end if newPlayer.Character.Humanoid.Health == 0
end) then print ("Player died") wait(5) newPlayer:LoadCharacter() print("Player respawned")
end) elseif newPlayer.Character.Parent == nil then wait(5) newPlayer:LoadCharacter() -- to make sure nobody is deleted.
game.Players.PlayerAdded:connect(onJoined) end
game:GetService("NetworkServer"):Start(<?php echo $port; ?>) end
game:GetService("RunService"):Run() end
game.Lighting.GlobalShadows = true
game.Players.PlayerAdded:connect(function(plr) game.Players.PlayerAdded:connect(onJoined)
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)
<?php <?php
$data = ob_get_clean(); $data = ob_get_clean();
$signature; $signature;

View File

@ -1,15 +1,22 @@
<?php @php
header("content-type:text/plain"); header("content-type:text/plain");
$username = addslashes($_GET["username"]); /*$username = addslashes($_GET["username"]);
$ip = addslashes($_GET["ip"]); $ip = addslashes($_GET["ip"]);
$port = addslashes($_GET["port"]); $port = addslashes($_GET["port"]);
$id = addslashes($_GET["id"]); $id = addslashes($_GET["id"]);
$app = addslashes($_GET["app"]); $app = addslashes($_GET["app"]);*/
$username = addslashes(Auth::user()->name);
$ip = addslashes($_GET["ip"]);
$port = addslashes($_GET["port"]);
$id = addslashes(Auth::id());
$app = 'test';
//$app = addslashes($_GET["app"]);
ob_start(); ob_start();
?> @endphp
--This is a joinscript that works in 2013 and back, etc. --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()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.AccumulatedError end)
pcall(function() settings().Physics.PhysicsEnvironmentalThrottle = Enum.EnviromentalPhysicsThrottle.DefaultAuto end) pcall(function() settings().Physics.PhysicsEnvironmentalThrottle = Enum.EnviromentalPhysicsThrottle.DefaultAuto end)
pcall(function() game:GetService("ScriptContext"):AddCoreScript(1,game:GetService("ScriptContext"),"StarterScript") end)
local threadSleepTime = ... local threadSleepTime = ...
if threadSleepTime==nil then if threadSleepTime==nil then
@ -227,10 +232,10 @@ local success, err = pcall(function()
end) end)
pcall(function() game:SetScreenshotInfo("") end) pcall(function() game:SetScreenshotInfo("") end)
<?php @php
$data = ob_get_clean(); $data = ob_get_clean();
$signature; $signature;
$key = file_get_contents("../GameRBLX/PrivKey.pem"); $key = file_get_contents(asset('GameRBLX/PrivKey.pem'));
openssl_sign($data, $signature, $key, OPENSSL_ALGO_SHA1); openssl_sign($data, $signature, $key, OPENSSL_ALGO_SHA1);
echo "" . sprintf("%%%s%%%s", base64_encode($signature), $data); echo "" . sprintf("%%%s%%%s", base64_encode($signature), $data);
?> @endphp

View File

@ -51,5 +51,6 @@ Route::group(['middleware' => 'AdminCheck'], function() {
// Client routes // Client routes
Route::get('/game/studio.ashx', [App\Http\Controllers\ClientController::class, 'studio'])->name('studio'); 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/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/welcome', [App\Http\Controllers\ClientController::class, 'ide'])->name('ide');
Route::get('/IDE/ClientToolbox.aspx', [App\Http\Controllers\ClientController::class, 'toolbox'])->name('toolbox'); Route::get('/IDE/ClientToolbox.aspx', [App\Http\Controllers\ClientController::class, 'toolbox'])->name('toolbox');