powdered

Untitled

Jul 7th, 2023
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.64 KB | None | 0 0
  1. <?php
  2. $uname = $_GET['name'] ?? "Guest ".rand();
  3. $settings = (object)[
  4. "username" => $uname,
  5. "uid" => $_GET['id'] ?? rand(),
  6. "ip" => $_GET['ip'] ?? "nil",
  7. "port" => $_GET['port'] ?? "nil",
  8. ];
  9. header("content-type: text/plain; X-Robots-Tag: noindex;charset=UTF-8");
  10. ob_start();?>
  11. -- functions --------------------------
  12. function onPlayerAdded(player)
  13. -- override
  14. end
  15.  
  16.  
  17. if true then
  18. delay(0, function()
  19. while (game.Players.LocalPlayer == nil) do wait(1) end
  20. while (game.Players.LocalPlayer:FindFirstChild("PlayerGui") == nil) do wait (1) end
  21. local m = Instance.new("GuiMain")
  22. local l = Instance.new("ImageLabel")
  23. m.Name = "AdGUI"
  24. l.BackgroundTransparency = 1
  25. l.Image = "http://www.berafta.tk/asset/?id=23573247"
  26. l.Position = UDim2.new(.3,5,0,5)
  27. l.Size = UDim2.new(0,470,0,165)
  28. l.Parent = m
  29. m.Parent = game.Players.LocalPlayer.PlayerGui
  30.  
  31. wait(15)
  32.  
  33. m:Remove()
  34. end)
  35. end
  36.  
  37.  
  38. -- MultiplayerSharedScript.lua inserted here ------ Prepended to GroupBuild.lua and Join.lua --
  39. pcall(function() game:SetPlaceID(1818, true) end)
  40.  
  41. local startTime = tick()
  42. local loadResolved = false
  43. local joinResolved = false
  44. local playResolved = true
  45. local playStartTime = 0
  46.  
  47. local cdnSuccess = 0
  48. local cdnFailure = 0
  49.  
  50. settings()["Game Options"].CollisionSoundEnabled = true
  51. pcall(function() settings().Rendering.EnableFRM = true end)
  52. pcall(function() settings().Physics.Is30FpsThrottleEnabled = true end)
  53. pcall(function() settings()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.AccumulatedError end)
  54. pcall(function() settings().Physics.PhysicsEnvironmentalThrottle = Enum.EnviromentalPhysicsThrottle.DefaultAuto end)
  55.  
  56. function reportContentProvider(time, queueLength, blocking)
  57. pcall(function()
  58. game:HttpGet("http://www.berafta.tk/Analytics/ContentProvider.ashx?t=" .. time .. "&ql=" .. queueLength, blocking)
  59. end)
  60. end
  61. function reportCdn(blocking)
  62. pcall(function()
  63. local newCdnSuccess = settings().Diagnostics.CdnSuccessCount
  64. local newCdnFailure = settings().Diagnostics.CdnFailureCount
  65. local successDelta = newCdnSuccess - cdnSuccess
  66. local failureDelta = newCdnFailure - cdnFailure
  67. cdnSuccess = newCdnSuccess
  68. cdnFailure = newCdnFailure
  69. if successDelta > 0 or failureDelta > 0 then
  70. game:HttpGet("http://www.berafta.tk/Game/Cdn.ashx?source=client&success=" .. successDelta .. "&failure=" .. failureDelta, blocking)
  71. end
  72. end)
  73. end
  74.  
  75. function reportDuration(category, result, duration, blocking,errorType)
  76. if not errorType then
  77. errorType = ''
  78. end
  79. local platform = settings().Diagnostics.OsPlatform
  80. pcall(function() game:HttpGet("http://www.berafta.tk/Game/JoinRate.ashx?st=0&i=0&p=-1&c=" .. category .. "&r=" .. result .. "&d=" .. (math.floor(duration*1000)) .. "&ip=localhost&errorType=" .. errorType .. "&platform=" .. platform, blocking) end)
  81. end
  82. -- arguments ---------------------------------------
  83. local threadSleepTime = ...
  84.  
  85. if threadSleepTime==nil then
  86. threadSleepTime = 15
  87. end
  88.  
  89. local test = true
  90.  
  91. print("! Joining game '' place -1 at localhost")
  92. local closeConnection = game.Close:connect(function()
  93. if 0 then
  94. reportCdn(true)
  95. if (not loadResolved) or (not joinResolved) then
  96. local duration = tick() - startTime;
  97. if not loadResolved then
  98. loadResolved = true
  99. reportDuration("GameLoad","Cancel", duration, true)
  100. end
  101. if not joinResolved then
  102. joinResolved = true
  103. reportDuration("GameJoin","Cancel", duration, true)
  104. end
  105. elseif not playResolved then
  106. local duration = tick() - playStartTime;
  107. playResolved = true
  108. reportDuration("GameDuration","Success", duration, true)
  109. end
  110. end
  111. end)
  112.  
  113. game:GetService("ChangeHistoryService"):SetEnabled(false)
  114. game:GetService("ContentProvider"):SetThreadPool(16)
  115. game:GetService("InsertService"):SetBaseSetsUrl("http://www.berafta.tk/Game/Tools/InsertAsset.ashx?nsets=10&type=base")
  116. game:GetService("InsertService"):SetUserSetsUrl("http://www.berafta.tk/Game/Tools/InsertAsset.ashx?nsets=20&type=user&userid=%d")
  117. game:GetService("InsertService"):SetCollectionUrl("http://www.berafta.tk/Game/Tools/InsertAsset.ashx?sid=%d")
  118. game:GetService("InsertService"):SetAssetUrl("http://www.berafta.tk/Asset/?id=%d")
  119. game:GetService("InsertService"):SetAssetVersionUrl("http://www.berafta.tk/Asset/?assetversionid=%d")
  120.  
  121. pcall(function() game:GetService("SocialService"):SetFriendUrl("http://www.berafta.tk/Game/LuaWebService/HandleSocialRequest.ashx?method=IsFriendsWith&playerid=%d&userid=%d") end)
  122. pcall(function() game:GetService("SocialService"):SetBestFriendUrl("http://www.berafta.tk/Game/LuaWebService/HandleSocialRequest.ashx?method=IsBestFriendsWith&playerid=%d&userid=%d") end)
  123. pcall(function() game:GetService("SocialService"):SetGroupUrl("http://www.berafta.tk/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=%d&groupid=%d") end)
  124. pcall(function() game:GetService("SocialService"):SetGroupRankUrl("http://www.berafta.tk/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=%d&groupid=%d") end)
  125. pcall(function() game:GetService("SocialService"):SetGroupRoleUrl("http://www.berafta.tk/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRole&playerid=%d&groupid=%d") end)
  126. pcall(function() game:GetService("GamePassService"):SetPlayerHasPassUrl("http://www.berafta.tk/Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d") end)
  127.  
  128. --local result = pcall(function() game:GetService("ScriptContext"):AddStarterScript(37801172) end)
  129. --if not result then
  130. -- pcall(function() --game:GetService("ScriptContext"):AddCoreScript(37801172,game:GetService("ScriptContext"),"StarterScript"--) end)
  131. --end
  132. pcall(function() game:SetCreatorID(0, Enum.CreatorType.User) end)
  133.  
  134. -- Bubble chat. This is all-encapsulated to allow us to turn it off with a config setting
  135. pcall(function() game:GetService("Players"):SetChatStyle(Enum.ChatStyle.ClassicAndBubble) end)
  136.  
  137. local waitingForCharacter = false
  138. local waitingForCharacterGuid = "8b2f9e4f-d1a4-4284-9b07-25dcb72bedfd";
  139. pcall( function()
  140. if settings().Network.MtuOverride == 0 then
  141. settings().Network.MtuOverride = 1400
  142. end
  143. end)
  144.  
  145.  
  146. -- globals -----------------------------------------
  147.  
  148. client = game:GetService("NetworkClient")
  149. visit = game:GetService("Visit")
  150.  
  151. -- functions ---------------------------------------
  152. function ifSeleniumThenSetCookie(key, value)
  153. if false then
  154. game:GetService("CookiesService"):SetCookieValue(key, value)
  155. end
  156. end
  157.  
  158. function setMessage(message)
  159. -- todo: animated "..."
  160. if not false then
  161. game:SetMessage(message)
  162. else
  163. -- hack, good enought for now
  164. game:SetMessage("Teleporting ...")
  165. end
  166. end
  167.  
  168. function showErrorWindow(message, errorType, errorCategory)
  169. if 0 then
  170. if (not loadResolved) or (not joinResolved) then
  171. local duration = tick() - startTime;
  172. if not loadResolved then
  173. loadResolved = true
  174. reportDuration("GameLoad","Failure", duration, false,errorType)
  175. end
  176. if not joinResolved then
  177. joinResolved = true
  178. reportDuration("GameJoin",errorCategory, duration, false,errorType)
  179. end
  180.  
  181. pcall(function() game:HttpGet("?FilterName=Type&FilterValue=" .. errorType .. "&Type=JoinFailure", false) end)
  182. elseif not playResolved then
  183. local duration = tick() - playStartTime;
  184. playResolved = true
  185. reportDuration("GameDuration",errorCategory, duration, false,errorType)
  186.  
  187. pcall(function() game:HttpGet("?FilterName=Type&FilterValue=" .. errorType .. "&Type=GameDisconnect", false) end)
  188. end
  189. end
  190.  
  191. game:SetMessage(message)
  192. end
  193.  
  194. function registerPlay(key)
  195. if true and game:GetService("CookiesService"):GetCookieValue(key) == "" then
  196. game:GetService("CookiesService"):SetCookieValue(key, "{ \"userId\" : 0, \"placeId\" : -1, \"os\" : \"" .. settings().Diagnostics.OsPlatform .. "\" }")
  197. end
  198. end
  199.  
  200. function analytics(name)
  201. if not test and false then
  202. pcall(function() game:HttpGet("?IPFilter=Primary&SecondaryFilterName=UserId&SecondaryFilterValue=0&Type=" .. name, false) end)
  203. end
  204. end
  205.  
  206. function analyticsGuid(name, guid)
  207. if not test and false then
  208. pcall(function() game:HttpGet("?IPFilter=Primary&SecondaryFilterName=guid&SecondaryFilterValue=" .. guid .. "&Type=" .. name, false) end)
  209. end
  210. end
  211.  
  212. function reportError(err, message)
  213. print("***ERROR*** " .. err)
  214. if not test then visit:SetUploadUrl("") end
  215. client:Disconnect()
  216. wait(4)
  217. showErrorWindow("Error: " .. err, message, "Other")
  218. end
  219.  
  220. -- called when the client connection closes
  221. function onDisconnection(peer, lostConnection)
  222. if lostConnection then
  223. if waitingForCharacter then analyticsGuid("Waiting for Character Lost Connection",waitingForCharacterGuid) end
  224. showErrorWindow("You have lost the connection to the game", "LostConnection", "LostConnection")
  225. else
  226. if waitingForCharacter then analyticsGuid("Waiting for Character Game Shutdown",waitingForCharacterGuid) end
  227. showErrorWindow("This game has shut down", "Kick", "Kick")
  228. end
  229. end
  230.  
  231. function requestCharacter(replicator)
  232.  
  233. -- prepare code for when the Character appears
  234. local connection
  235. connection = player.Changed:connect(function (property)
  236. if property=="Character" then
  237. game:ClearMessage()
  238. waitingForCharacter = false
  239. analyticsGuid("Waiting for Character Success", waitingForCharacterGuid)
  240.  
  241. connection:disconnect()
  242.  
  243. if 0 then
  244. if not joinResolved then
  245. local duration = tick() - startTime;
  246. joinResolved = true
  247. reportDuration("GameJoin","Success", duration, false)
  248.  
  249. playStartTime = tick()
  250. playResolved = false
  251. end
  252. end
  253. end
  254. end)
  255.  
  256. setMessage("Requesting character")
  257.  
  258. if 0 and not loadResolved then
  259. local duration = tick() - startTime;
  260. loadResolved = true
  261. reportDuration("GameLoad","Success", duration, false)
  262. end
  263.  
  264. local success, err = pcall(function()
  265. replicator:RequestCharacter()
  266. setMessage("Waiting for character")
  267. waitingForCharacter = true
  268. analyticsGuid("Waiting for Character Begin",waitingForCharacterGuid);
  269. end)
  270. if not success then
  271. reportError(err,"W4C")
  272. return
  273. end
  274. end
  275.  
  276. -- called when the client connection is established
  277. function onConnectionAccepted(url, replicator)
  278.  
  279. local waitingForMarker = true
  280.  
  281. local success, err = pcall(function()
  282. if not test then
  283. visit:SetPing("", 300)
  284. end
  285.  
  286. if not false then
  287. game:SetMessageBrickCount()
  288. else
  289. setMessage("Teleporting ...")
  290. end
  291.  
  292. replicator.Disconnection:connect(onDisconnection)
  293.  
  294. -- Wait for a marker to return before creating the Player
  295. local marker = replicator:SendMarker()
  296.  
  297. marker.Received:connect(function()
  298. waitingForMarker = false
  299. requestCharacter(replicator)
  300. end)
  301. end)
  302.  
  303. if not success then
  304. reportError(err,"ConnectionAccepted")
  305. return
  306. end
  307.  
  308. -- TODO: report marker progress
  309.  
  310. while waitingForMarker do
  311. workspace:ZoomToExtents()
  312. wait(0.5)
  313. end
  314. end
  315.  
  316. -- called when the client connection fails
  317. function onConnectionFailed(_, error)
  318. showErrorWindow("Failed to connect to the Game. (ID=" .. error .. ")", "ID" .. error, "Other")
  319. end
  320.  
  321. -- called when the client connection is rejected
  322. function onConnectionRejected()
  323. connectionFailed:disconnect()
  324. showErrorWindow("This game is not available. Please try another", "WrongVersion", "WrongVersion")
  325. end
  326.  
  327. idled = false
  328. function onPlayerIdled(time)
  329. if time > 20*60 then
  330. showErrorWindow(string.format("You were disconnected for being idle %d minutes", time/60), "Idle", "Idle")
  331. client:Disconnect()
  332. if not idled then
  333. idled = true
  334. end
  335. end
  336. end
  337.  
  338.  
  339. -- main ------------------------------------------------------------
  340.  
  341. analytics("Start Join Script")
  342.  
  343. ifSeleniumThenSetCookie("SeleniumTest1", "Started join script")
  344.  
  345. pcall(function() settings().Diagnostics:LegacyScriptMode() end)
  346. local success, err = pcall(function()
  347.  
  348. game:SetRemoteBuildMode(true)
  349.  
  350. setMessage("Connecting to Server")
  351. client.ConnectionAccepted:connect(onConnectionAccepted)
  352. client.ConnectionRejected:connect(onConnectionRejected)
  353. connectionFailed = client.ConnectionFailed:connect(onConnectionFailed)
  354. client.Ticket = ""
  355. ifSeleniumThenSetCookie("SeleniumTest2", "Successfully connected to server")
  356.  
  357. playerConnectSucces, player = pcall(function() return client:PlayerConnect(<?=$settings->uid?>, "<?=$settings->ip?>", <?=$settings->port?>, 0, threadSleepTime) end)
  358. if not playerConnectSucces then
  359. --Old player connection scheme
  360. player = game:GetService("Players"):CreateLocalPlayer(<?=$settings->uid?>)
  361. analytics("Created Player")
  362. client:Connect("<?=$settings->ip?>", <?=$settings->port?>, 0, threadSleepTime)
  363. else
  364. analytics("Created Player")
  365. end
  366.  
  367. pcall(function()
  368. registerPlay("rbx_evt_ftp")
  369. delay(60*5, function() registerPlay("rbx_evt_fmp") end)
  370. end)
  371.  
  372. player:SetSuperSafeChat(false)
  373. pcall(function() player:SetMembershipType(Enum.MembershipType.None) end)
  374. pcall(function() player:SetAccountAge(365) end)
  375. player.Idled:connect(onPlayerIdled)
  376.  
  377. -- Overriden
  378. onPlayerAdded(player)
  379.  
  380. pcall(function() player.Name = [========[<?=$settings->username?>]========] end)
  381. --player.CharacterAppearance = "{charapp}"
  382. if not test then visit:SetUploadUrl("")end
  383.  
  384. analytics("Connect Client")
  385. end)
  386.  
  387. if not success then
  388. reportError(err,"CreatePlayer")
  389. end
  390.  
  391. ifSeleniumThenSetCookie("SeleniumTest3", "Successfully created player")
  392.  
  393. if not test then
  394. -- TODO: Async get?
  395. loadfile("")("", -1, 0)
  396. end
  397.  
  398. if 0 then
  399. delay(60*5, function()
  400. while true do
  401. reportCdn(false)
  402. wait(60*5)
  403. end
  404. end)
  405. local cpTime = 30
  406. delay(cpTime, function()
  407. while cpTime <= 480 do
  408. reportContentProvider(cpTime, game:GetService("ContentProvider").RequestQueueSize, false)
  409. wait(cpTime)
  410. cpTime = cpTime * 2
  411. end
  412. end)
  413. end
  414.  
  415. pcall(function() game:SetScreenshotInfo("") end)
  416. pcall(function() game:SetVideoInfo('<?xml version="1.0"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"><media:group><media:title type="plain"><![CDATA[ROBLOX Place]]></media:title><media:description type="plain"><![CDATA[ For more games visit http://www.berafta.tk]]></media:description><media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Games</media:category><media:keywords>ROBLOX, video, free game, online virtual world</media:keywords></media:group></entry>') end)
  417. -- use single quotes here because the video info string may have unescaped double quotes
  418.  
  419. analytics("Join Finished")
  420.  
  421. ifSeleniumThenSetCookie("SeleniumTest4", "Finished join")
  422. <?php
  423. $data = "\r\n" . ob_get_clean();
  424. $key = file_get_contents($_SERVER['DOCUMENT_ROOT']."/private/keys/PrivateKey.pem");
  425. openssl_sign($data, $sig, $key, OPENSSL_ALGO_SHA1);
  426. echo "%" . base64_encode($sig) . "%" . $data;
  427. ?>
  428.  
Add Comment
Please, Sign In to add comment