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');
}
public function join()
{
return view('client.join');
}
public function toolbox()
{
return view('client.toolbox');

View File

@ -3,10 +3,9 @@
header("content-type:text/plain");
$port = addslashes($_GET["port"]);
$rbxl = addslashes($_GET["rbxl"]);
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 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(<?php echo $port; ?>)
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(<?php echo $port; ?>)
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 = <?php echo $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)
<?php
$data = ob_get_clean();
$signature;

View File

@ -1,15 +1,22 @@
<?php
@php
header("content-type:text/plain");
$username = addslashes($_GET["username"]);
/*$username = addslashes($_GET["username"]);
$ip = addslashes($_GET["ip"]);
$port = addslashes($_GET["port"]);
$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();
?>
@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)
<?php
@php
$data = ob_get_clean();
$signature;
$key = file_get_contents("../GameRBLX/PrivKey.pem");
$key = file_get_contents(asset('GameRBLX/PrivKey.pem'));
openssl_sign($data, $signature, $key, OPENSSL_ALGO_SHA1);
echo "" . sprintf("%%%s%%%s", base64_encode($signature), $data);
?>
@endphp

View File

@ -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');