Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Blizzard on August 29, 2009, 11:13:45 am

Title: [XP] Remote Restart for RMX-OS
Post by: Blizzard on August 29, 2009, 11:13:45 am
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




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




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
Title: Re: [XP] Remote Restart for RMX-OS
Post by: jcsnider on August 29, 2009, 11:22:37 am
BEST SCRIPT (Plugin/Extension) EVER!!!

If you are using RMX-OS use this!  :D
Title: Re: [XP] Remote Restart for RMX-OS
Post by: Hellfire Dragon on August 30, 2009, 05:47:27 am
I didn't know you were releasing it publicy, oh well. Awesome script :)
Title: Re: [XP] Remote Restart for RMX-OS
Post by: Blizzard on August 30, 2009, 05:49:11 am
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.
Title: Re: [XP] Remote Restart for RMX-OS
Post by: jcsnider on August 30, 2009, 09:01:24 am
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
Title: Re: [XP] Remote Restart for RMX-OS
Post by: Blizzard on August 30, 2009, 09:22:27 am
Why do you think I made it? I don't have access to your server at all. xD
Title: Re: [XP] Remote Restart for RMX-OS
Post by: 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:
Title: Re: [XP] Remote Restart for RMX-OS
Post by: fugibo on September 09, 2009, 09:56:26 pm
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:
Title: Re: [XP] Remote Restart for RMX-OS
Post by: Blizzard on September 10, 2009, 03:38:21 am
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
Title: Re: [XP] Remote Restart for RMX-OS
Post by: jcsnider on September 10, 2009, 07:42:49 am
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.
Title: Re: [XP] Remote Restart for RMX-OS
Post by: Blizzard on January 03, 2010, 10:07:50 am
v1.01 is out. It works properly with RMX-OS v1.08.
Title: Re: [XP] Remote Restart for RMX-OS
Post by: crzyone9584 on February 06, 2010, 02:29:45 pm
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.)
Title: Re: [XP] Remote Restart for RMX-OS
Post by: 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
Title: Re: [XP] Remote Restart for RMX-OS
Post by: crzyone9584 on February 07, 2010, 02:33:46 pm
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.
Title: Re: [XP] Remote Restart for RMX-OS
Post by: Ryex 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.
Title: Re: [XP] Remote Restart for RMX-OS
Post by: crzyone9584 on February 07, 2010, 05:02:58 pm
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.
Title: Re: [XP] Remote Restart for RMX-OS
Post by: Blizzard on April 07, 2013, 11:19:04 am
I did a small update to make the script work only in debug mode.
Title: Re: [XP] Remote Restart for RMX-OS
Post by: Blizzard on June 12, 2013, 01:19:34 pm
Updated for RMX-OS 2.0.