Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 16 Jun 2016 02:56 PM |
I'm close to releasing the first version of my game, and I plan to update it very often. I want to make sure that servers aren't stale, so I'd like to shut them down after 48 hours of uptime.
I know that people will suggest :Kick(), but isn't that problematic for new players who join? Won't they get kicked, be like "wtf?", and the server still persists because of their interaction?
|
|
|
| Report Abuse |
|
|
ByDefault
|
  |
| Joined: 25 Jul 2014 |
| Total Posts: 3197 |
|
|
| 16 Jun 2016 02:57 PM |
| Press the 3 buttons on the top right corner of the game page, and click "Shutdown all Instances" |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 16 Jun 2016 02:57 PM |
Not at all what I'm looking for
|
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 16 Jun 2016 02:59 PM |
game:Shutdown(), the only way I see, is currently locked in scripts
just call Kick() on all players and Kick() on players who are attempting to join
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 16 Jun 2016 02:59 PM |
@skello,
there's another way, give me a second.
the power of the meme ( ͡° ͜ʖ ͡°) |
|
|
| Report Abuse |
|
|
Borsy
|
  |
| Joined: 31 Jul 2014 |
| Total Posts: 15111 |
|
|
| 16 Jun 2016 03:00 PM |
for k, v in ipairs(game.Players:GetChildren()) do if v.ClassName == "Player" then v:Kick("Server 48 hours of uptime reached, shutting down to prevent lag. Please join another server.") end end
try this
Has anyone really been far even as decided to use even go want to do look more like? |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 16 Jun 2016 03:02 PM |
Hmmm that still uses the :Kick() function - won't the server continue to run (for a short while) because of new players' connection?
|
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 16 Jun 2016 03:02 PM |
@borsy game.Players:GetPlayers()
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 16 Jun 2016 03:03 PM |
Can you explain what you're trying to do?
the power of the meme ( ͡° ͜ʖ ͡°) |
|
|
| Report Abuse |
|
|
Borsy
|
  |
| Joined: 31 Jul 2014 |
| Total Posts: 15111 |
|
|
| 16 Jun 2016 03:04 PM |
game.Players.PlayerAdded:connect(function(ply) if shutdown == true then ply:Kick("Please join another server, game is attempting shutdown.") end end
Has anyone really been far even as decided to use even go want to do look more like? |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 16 Jun 2016 03:04 PM |
I think I explained it as best I can in the original post. Basically I want to shut down the entire server after 48 hours so that at any given time I don't have a game that is out-of-date by more than 2 days
|
|
|
| Report Abuse |
|
|
|
| 16 Jun 2016 03:04 PM |
local Services = { Players = game:GetService("Players") } local Settings = { ServerLocked = true } Services.Players.PlayerAdded:connect(function(Player) if Settings.ServerLocked then Player:Kick() end end) for _, Player in pairs(Services.Players:GetChildren()) do Player:Kick() end
-=[ RAP: 311,243 || DurstAuric; the narb of ROBLOX ]=- |
|
|
| Report Abuse |
|
|
|
| 16 Jun 2016 03:05 PM |
This might seem stupid, but
while true do end while true do end while true do end |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 16 Jun 2016 03:06 PM |
So, I could kick everyone, then use a while true do end loop to crash the server?
Is that a sound method?
|
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 16 Jun 2016 03:09 PM |
That's a great way to damage roblox servers and potentially get yourself banned e.e
the power of the meme ( ͡° ͜ʖ ͡°) |
|
|
| Report Abuse |
|
|
|
| 16 Jun 2016 03:09 PM |
You want it to shut down after 48 hours? Okay.
local Services = { Players = game:GetService("Players") } local Settings = { ServerLocked = false } wait(151200) ServerLocked = true Services.Players.PlayerAdded:connect(function(Player) if Settings.ServerLocked then Player:Kick() end end) for _, Player in pairs(Services.Players:GetChildren()) do Player:Kick() end
-=[ RAP: 310,888 || DurstAuric; the narb of ROBLOX ]=- |
|
|
| Report Abuse |
|
|
|
| 16 Jun 2016 03:11 PM |
Oops, change the wait to wait(172800)
-=[ RAP: 310,888 || DurstAuric; the narb of ROBLOX ]=- |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 16 Jun 2016 03:11 PM |
Kick everyone, this will force the game to close automagically.
If you use an infinite loop to crash the server then you can't use the onClose callback to save data and st00f |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 16 Jun 2016 03:13 PM |
@Durst
local Services = { Players = game:GetService("Players") } local Settings = { ServerLocked = false } Services.Players.PlayerAdded:connect(function(Player) if Settings.ServerLocked then Player:Kick() end end) wait(2*24*60*60) Settings.ServerLocked = true for _, Player in ipairs(Services.Players:GetPlayers()) do Player:Kick() end |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 16 Jun 2016 03:14 PM |
So kicking everyone is a valid solution? I remember years ago it was problematic because the server would stay open as long as it received new join requests.
Thank you!
|
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 16 Jun 2016 03:15 PM |
^ yep, kicking and kicking when they try to join
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
|
| 16 Jun 2016 03:15 PM |
It does stay open, but for a short while to allow scripts to save a player's progress if needed.
-=[ RAP: 310,889 || DurstAuric; the narb of ROBLOX ]=- |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 16 Jun 2016 03:16 PM |
^Only if you use the OnClose callback and new players cannot join during this time
|
|
|
| Report Abuse |
|
|
Grevok
|
  |
| Joined: 07 Jul 2013 |
| Total Posts: 1652 |
|
|
| 16 Jun 2016 03:26 PM |
This is how you do it to prevent them from rejoining. 1- Shutdown All Instances via Game Instances 2- Make the game Inactive |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
| |
|