[XP] Remote Restart for RMX-OS

Started by Blizzard, August 29, 2009, 11:13:45 am

Previous topic - Next topic

Blizzard

August 29, 2009, 11:13:45 am Last Edit: March 23, 2019, 11:33:42 am by Blizzard
Remote Restart for RMX-OS
Authors: Blizzard
Version: 1.1
Type: RMX-OS Plugin
Key Term: RMX-OS Plugin



Introduction

This script allows you to restart the RMX-OS server remotely from the login screen.

This script is to be distributed under the same terms and conditions like the script it was created for: RMX-OS.


Features


  • remote restart server on button press
  • very easy to use



Screenshots

N/A for this sort of script.


Demo

N/A


Script

Just make a new script above main and paste this code into it.
Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Remote Restart for RMX-OS by Blizzard
# Version: 1.1
# Type: RMX-OS Plugin
# Date: 29.8.2009
# Date v1.01: 3.1.2010
# Date v1.02: 7.4.2013
# Date v1.1: 12.6.2013
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  This script is to be distributed under the same terms and conditions like
#  the script it was created for: RMX-OS.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Information:
#
#   This script must be placed below RMX-OS and requires RMX-OS to work
#   properly. This script allows you to restart the RMX-OS server remotely
#   from the login screen or within the game if the game is run in $DEBUG mode.
#   
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if !defined?(RMXOS) || RMXOS::VERSION < 2.0
  raise 'ERROR: The "Remote Restart" requires RMX-OS 2.0 or higher.'
end

#==============================================================================
# module BlizzCFG
#==============================================================================

module BlizzCFG

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
  # the button to press
  REMOTE_BUTTON = Input::Key['F11']
 
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

end

#==============================================================================
# module Input
#==============================================================================

module Input
 
  class << Input
    alias update_remoterestart_later update
  end
 
  def self.update
    update_remoterestart_later
    if $DEBUG && $network.connected? && self.trigger?(BlizzCFG::REMOTE_BUTTON)
      $network.send('RSTRT')
      $network.disconnect
      $scene = Scene_Servers.new
    end
  end
 
end


Make a new file with an .rb extension in the Extensions folder of RMX-OS and copy-paste this script into it.
Spoiler: ShowHide
module RMXOS
 
  def self.load_current_extension
    return RemoteRestart
  end
 
end

#======================================================================
# module RemoteRestart
#======================================================================

module RemoteRestart
 
  VERSION = 1.1
  RMXOS_VERSION = 2.0
  SERVER_THREAD = false
 
  def self.initialize
    @mutex = Mutex.new
  end
 
  def self.mutex
    return @mutex
  end
 
  def self.main
    while RMXOS.server.running
      @mutex.synchronize {
        self.server_update
      }
      sleep(0.1)
    end
  end
 
  def self.server_update
  end
 
  def self.client_update(client)
    case client.message
    when /\ARSTRT\Z/
      RMXOS.server.shutdown
      return true
    end
    return false
  end
 
end




Instructions

In the script in the first comment.


Compatibility

Requires RMX-OS to work.


Credits and Thanks


  • Boris "Blizzard" Mikić



Author's Notes

This tool can be very useful during development, but is not recommended to use for the actual game.
Remember to activate the server extension by adding the server extension filename to the list in the configuration.

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! N-Joy! =D
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

jcsnider

BEST SCRIPT (Plugin/Extension) EVER!!!

If you are using RMX-OS use this!  :D

Hellfire Dragon

I didn't know you were releasing it publicy, oh well. Awesome script :)

Blizzard

I didn't intend to. But when jc told me on MSN that it's... *points to his post before* ... I decided to put it up.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

jcsnider

Well it is the best script for me because unlike most people that will host the game on their home comp, I have it on a server 45 mins away, so I have te login to remote desktop to fool with it, so when the problem can be fixed with as easy as press the F11 key... then it becomes one of my favorite scripts  :P

Blizzard

Why do you think I made it? I don't have access to your server at all. xD
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

jcsnider

It wouldnt take u long to make an extensions so u could start stealing files and stuff from my comp with RMX OS though and I wouldnt know  :roll:

fugibo

Quote from: jcsnider on September 09, 2009, 09:08:26 pm
It wouldnt take u long to make an extensions so u could start stealing files and stuff from my comp with RMX OS though and I wouldnt know  :roll:


Run it as an unprivileged user, duh. :roll:

Blizzard

I can't steal files unless I do a lot of manual script calls on the server or unless I make an extension which he obviously wouldn't install. :P
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

jcsnider

If you were to name the extension "Blizz-ABS" or something... I dont look at the code cuz I cant understand it  :o

Off topic XD, either way...

If you use RMX-OS use the remote restart.

Blizzard

v1.01 is out. It works properly with RMX-OS v1.08.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

crzyone9584

Wondering if this could be limited to people with admin or mod status? Don't want users to have people kicked for no reason. (although im sure it be a long time before i get a working game out. More worried about it being tested and people finding this out.)

Jackolas

make 2 clients...

1 for addmin where you include this script
1 for normal peep where you don't include this script?

its simple. but works

crzyone9584

Quote from: Jackolas on February 06, 2010, 05:22:23 pm
make 2 clients...

1 for addmin where you include this script
1 for normal peep where you don't include this script?

its simple. but works


Simple? thats a lot of work just for admins and non admins. But i guess it works.

Ryex

what are you talking about, it IS simple, no work at all. it is the same project but one of them has the client side restart script and you give the admin client to admins and use the other for public distributions.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

crzyone9584

Quote from: Ryexander on February 07, 2010, 04:29:40 pm
what are you talking about, it IS simple, no work at all. it is the same project but one of them has the client side restart script and you give the admin client to admins and use the other for public distributions.


i was over thinking the problem. Had 1 to many for the pre-game last night lol.

Blizzard

I did a small update to make the script work only in debug mode.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.