Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Blizzard on May 30, 2010, 04:42:57 am

Title: [XP] Versioning for RMX-OS
Post by: Blizzard on May 30, 2010, 04:42:57 am
Versioning for RMX-OS
Authors: Blizzard
Version: 1.21
Type: RMX-OS Plugin
Key Term: RMX-OS Plugin



Introduction

This script allows you to create updates for your game and is fully integrated into RMX-OS which makes external systems unnecessary.

This script is to be distributed under the same terms and conditions like the scripts 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

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Versioning for RMX-OS by Blizzard
# Version: 1.21
# Type: RMX-OS Add-on
# Date: 30.5.2010
# Date v1.01: 12.9.2010
# Date v1.1: 17.9.2010
# Date v1.2: 12.6.2013
# Date v1.21: 29.7.2014
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  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. It is able to update the game client connecting to the server to
#   the newest game version.
#   
#   
# Instructions:
#   
#   The server extension validates the game version from the client and if the
#   client game version is lower than the server game version, the server will
#   refuse a connection. Instead the server will notify the client that it is
#   possible to update. After the player has confirmed that he wants to update
#   the client, the server will initiate version updating of the server. For
#   the server to know which files need to be sent, you need to create version
#   log files.
#   
#   
# Version Logs:
#   
#   The version log files on the server have a simple format. Each file is
#   named like "NUMBER.txt" where NUMBER is the version.
#   
#   examples:
#     
#     10.txt - version log for updating from version 9 to 10
#     15.txt - version log for updating from version 14 to 15
#     5475685.txt - version log for updating from version 5475684 to 5475685
#     
#   Version log files have a specific format that allows you to define which
#   files need to be updated. The basic format is:
#     
#     :COMMAND
#     FILES
#   
#   The following commands are at your disposal:
#     
#     file - update a single file
#     dir - update an entire directory with all subdirectories recursively
#     delete - delete a file OR a directory with all subdirectories recursively
#   
#   When using the ":delete" command, the FILES parameter is the name of the
#   file or directory that is affected.
#   When using the ":file" or the ":dir" command, there are 2 FILES parameters.
#   The first is the source file path and the second the destination file path.
#   You can add many files as you want with one single command.
#   
#   example:
#     
#     :file
#     versions/24/Game.rgssad
#     Game.rgssad
#     versions/Fonts.zip
#     fonts/fonts.dat
#     :dir
#     versions/24/BGM
#     Audio/BGM
#     :delete
#     utils/screenshot.dll
#     game.ico
#     artwork
#     :dir
#     versions/24/Audio/ME
#     Audio/ME
#     
#   The example above will do following:
#     
#     1. The file "versions/24/Game.rgssad" from the RMX-OS root directory will
#        be transferred to the client and store in the file "Game.rgssad" in
#        his game's root directory.
#     2. The file "versions/Fonts.zip" from the RMX-OS root directory will be
#        transferred to the client and stored in the file "fonts/fonts.dat" in
#        his game's root directory.
#     3. The directory "versions/24/BGM" and all of its contents (recursively)
#        from the RMX-OS root directory will be transferred to the client and
#        store in the directory "Audio/BGM" in his game's root directory.
#     4. The file or directory "utils/screenshot.dll" will be deleted.
#     5. The file or directory "game.ico" will be deleted.
#     6. The file or directory "artwork" will be deleted.
#     7. The directory "versions/24/Audio/ME" and all of its contents
#        (recursively) from the RMX-OS root directory will be transferred to
#        the client and stored in the directory "Audio/ME" in his game's root
#        directory.
#   
#   
# Notes:
#   
#   - There is no syntax checking or other verification of your version log
#     files. It is recommended not to use batch processing with one command but
#     use a command for every single file or directory.
#     
#     example:
#     
#       Instead of this type of writing:
#       
#       :file
#       versions/24/Game.rgssad
#       Game.rgssad
#       versions/Fonts.zip
#       fonts/fonts.dat
#     
#       use this type of writing:
#       
#       :file
#       versions/24/Game.rgssad
#       Game.rgssad
#       :file
#       versions/Fonts.zip
#       fonts/fonts.dat
#       
#   - The constant INTERNAL_VERSION is independent from RMXOS::GAME_VERSION,
#     keep that in mind.
#   - Make sure to update the client scripts each time because you need to
#     update the constant INTERNAL_VERSION in the configuration of this script to
#     make sure the client knows it's up to date. Either update Scripts.rxdata
#     or update Game.rgssad where Scripts.rxdata is contained.
#   - Update is done only all at once. First all files are downloaded into a
#     temporary directory. After a successful download of ALL files, first the
#     files and directories that need to be delete are deleted, then the
#     downloaded files are moved into the actual game's directory and are
#     updated.
#   - Multiple version updates work one after another and are all done at once.
#     If one version update fails for some reason, the previous updates will
#     not be lost.
#   - It is recommended to keep version updates small. Big updates are more
#     likely to break. You can simply split an update into several updates if
#     it's too big.
#   
#   
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

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

$rmxos_versioning = 1.21

#==============================================================================
# module RMXOS
#==============================================================================

module RMXOS
 
  CONNECTION_VERSION_MISMATCH = 1034
  UPDATING_END                = 1035
 
  #============================================================================
  # module RMXOS::Options
  #============================================================================

  module Options
 
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    # START Configuration
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
    INTERNAL_VERSION = 1 # internal version number, use integers only
    EXECUTABLE = 'Game.exe' # game executable (usually Game.exe)

    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    # END Configuration
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
  end
 
  #============================================================================
  # module RMXOS::Data
  #============================================================================
 
  module Data
   
    AnswerNo      = 'No'
    AnswerYes     = 'Yes'
    UpdatingNow   = 'Updating now. This may take a while.'
    UpdatePrompt  = 'Your client needs to be updated. Continue?'
    UpdateRestart = 'Update finished. If the game does not restart automatically, please restart it manually.'
   
    TempDir = ENV['TEMP'].gsub('\\', '/') + '/RMXP_update' # system temp folder
    # don't change this
    TempDir += '/' + Options::INTERNAL_VERSION.to_s
   
  end

  #============================================================================
  # RMXOS::Network
  #============================================================================

  class Network
   
    def request_connection
      self.send('CON', RMXOS::VERSION, RMXOS::Options::GAME_VERSION, RMXOS::Options::INTERNAL_VERSION)
    end
   
    def request_update
      if FileTest.exist?(RMXOS::Data::TempDir)
        Dir.clear(RMXOS::Data::TempDir)
      else
        Dir.mkdirs(RMXOS::Data::TempDir)
      end
      @delete_queue = []
      self.send('UPDT', RMXOS::Options::INTERNAL_VERSION)
    end
   
    alias check_connection_versioning_later check_connection
    def check_connection(message)
      case message
      when /\VFAIL\Z/ # game version mismatch
        @messages.push(CONNECTION_VERSION_MISMATCH)
        return true
      when /\AMKDIR\t(.+)/ # make directory
        Dir.mkdirs("#{RMXOS::Data::TempDir}/#{$1}")
        return true
      when /\AFILE\t(.+)\t(.+)/ # copy file
        path = "#{RMXOS::Data::TempDir}/#{$1}"
        Dir.create_path(path)
        data = eval($2)
        file = File.open(path, 'wb')
        file.write(data)
        file.close
        return true
      when /\AFILE\t(.+)/ # copy empty file
        path = "#{RMXOS::Data::TempDir}/#{$1}"
        Dir.create_path(path)
        file = File.open(path, 'wb')
        file.close
      when /\AFILC\t(.+)\t(.+)/ # append to file (in case of big files)
        path = "#{RMXOS::Data::TempDir}/#{$1}"
        Dir.create_path(path)
        data = eval($2)
        file = File.open(path, 'ab')
        file.write(data)
        file.close
        return true
      when /\ADELE\t(.+)/ # delete directory / file
        @delete_queue.push($1)
        return true
      when /\AUEND\Z/ # updating end
        Dir.clear(RMXOS::Data::TempDir)
        Dir.rmdirs(RMXOS::Data::TempDir)
        @messages.push(UPDATING_END)
        return true
      when /\AUNEX\Z/ # execute update
        @delete_queue.each {|filename|
            if FileTest.directory?(filename)
              Dir.clear(filename)
              Dir.rmdirs(filename)
            else
              File.delete(filename) rescue nil
            end
            Graphics.update}
        Dir.copy(RMXOS::Data::TempDir, '.')
        Dir.clear(RMXOS::Data::TempDir)
        @delete_queue = []
        return true
      end
      return check_connection_versioning_later(message)
    end
   
  end
 
end

#==============================================================================
# Dir
#==============================================================================

class Dir
 
  def self.clear(source)
    dirs = [source]
    while dirs.size > 0
      dir = dirs.shift
      dirs += self.clear_non_recursive(dir)
    end
  end
 
  def self.clear_non_recursive(source)
    dirs = []
    Dir.foreach(source) {|name|
        if name != '.' && name != '..'
          filename = "#{source}/#{name}"
          if FileTest.directory?(filename)
            dirs.push(filename)
          elsif FileTest.file?(filename)
            File.delete(filename) rescue nil
          end
        end}
    return dirs
  end
 
  def self.copy(source, destination)
    dirs = [[source, destination]]
    while dirs.size > 0
      dir = dirs.shift
      Dir.mkdirs(dir[1]) if !FileTest.exist?(dir[1])
      dirs += self.copy_non_recursive(dir[0], dir[1])
    end
  end
 
  def self.copy_non_recursive(source, destination)
    dirs = []
    Dir.foreach(source) {|name|
        if name != '.' && name != '..'
          filename = "#{source}/#{name}"
          target = "#{destination}/#{name}"
          if FileTest.directory?(filename)
            dirs.push([filename, target])
          elsif FileTest.file?(filename)
            File.copy(filename, target) rescue nil
          end
        end}
    return dirs
  end
 
  def self.create_path(source)
    dirs = source.split('/')
    dirs.pop
    Dir.mkdirs(dirs.join('/')) if dirs.size > 0
  end
 
  def self.mkdirs(source)
    dirs = source.split('/')
    path = dirs.shift
    loop do
      Dir.mkdir(path) rescue nil if !FileTest.exist?(path)
      break if dirs.size == 0
      path += '/' + dirs.shift
    end
  end
 
  def self.rmdirs(source)
    all_dirs = [source]
    dirs = [source]
    while dirs.size > 0
      dir = dirs.shift
      new_dirs = self.get_subdirs(dir)
      dirs += new_dirs
      all_dirs += new_dirs
    end
    all_dirs.sort.reverse.each {|dir| Dir.rmdir(dir) rescue nil}
  end
 
  def self.get_subdirs(source)
    dirs = []
    Dir.foreach(source) {|name|
        if name != '.' && name != '..'
          filename = "#{source}/#{name}"
          dirs.push(filename) if FileTest.directory?(filename)
        end}
    return dirs
  end
 
end

#==============================================================================
# File
#==============================================================================

class File

  def self.copy(source, destination)
    file = File.open(source, 'rb')
    data = file.read
    file.close
    file = File.open(destination, 'wb')
    file.write(data)
    file.close
    Graphics.update # prevent script is hanging error
  end
 
end

#==============================================================================
# Window_Dialog
#==============================================================================

class Window_Dialog < Window_Command
 
  def initialize(width, commands = ['Yes', 'No'], caption = 'Are you sure?')
    commands.push('')
    @caption = caption
    @cursor_width = 32
    super(width, commands)
    if $fontface != nil
      self.contents.font.name = $fontface
      self.contents.font.size = $fontsize
    elsif $defaultfonttype != nil
      self.contents.font.name = $defaultfonttype
      self.contents.font.size = $defaultfontsize
    end
    self.x, self.y, self.z = 320 - self.width/2, 240 - self.height/2, 1500
    @item_max, self.opacity = commands.size-1, 192
    commands.each {|c|
        w = self.contents.text_size(c).width
        @cursor_width = w if @cursor_width < w}
    @cursor_width += 32
    refresh
    update_cursor_rect
  end
 
  def refresh
    super
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, self.width-40, 32, @caption, 1)
  end
 
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * (index+1), self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
 
  def update_cursor_rect
    if @index < 0 || @item_max == 0
      self.cursor_rect.empty
    else
      x = (self.contents.width - @cursor_width) / 2
      self.cursor_rect.set(x, (@index+1)*32, @cursor_width, 32)
    end
  end
 
end

#==============================================================================
# Scene_Servers
#==============================================================================

class Scene_Servers
 
  alias update_versioning_later update
  def update
    if @dialog_window == nil
      update_versioning_later
      if @wait_count == 0 && @update_mode
        @update_mode = nil
        @help_window.set_text(@helptext)
        Dir.clear(RMXOS::Data::TempDir)
        Dir.rmdirs(RMXOS::Data::TempDir)
      end
    else
      @dialog_window.update
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        @dialog_window.dispose
        @dialog_window = nil
      elsif Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        if @dialog_window.index == 0
          @help_window.set_text(RMXOS::Data::UpdatingNow)
          @wait_count = RMXOS::Options::SERVER_TIMEOUT * 2
          $network.request_update
          @update_mode = true
        end
        @dialog_window.dispose
        @dialog_window = nil
      end
    end
  end
 
  alias waiting_for_server_versioning_later waiting_for_server
  def waiting_for_server
    waiting_for_server_versioning_later
    $network.messages.each {|message|
        case message
        when RMXOS::CONNECTION_VERSION_MISMATCH # version mismatch
          @dialog_window = Window_Dialog.new(416, [RMXOS::Data::AnswerYes,
              RMXOS::Data::AnswerNo], RMXOS::Data::UpdatePrompt)
          refresh_server_states
          @refresh_count = RMXOS::Options::SERVER_REFRESH
          return false
        when RMXOS::UPDATING_END # updating done
          @update_mode = false
          p RMXOS::Data::UpdateRestart
          Thread.new {system(RMXOS::Options::EXECUTABLE)}
          exit
          return false
        end}
    return true
  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 Versioning
  end
 
end

#======================================================================
# module Versioning
#======================================================================

module Versioning

  VERSION = 1.21
  RMXOS_VERSION = 2.0
  SERVER_THREAD = false
 
  # START Configuration
  INTERNAL_VERSION = 2 # game version
  VERSION_LOG_PATH = 'Extensions' # where are the version log files located
  CHUNK_MAX_SIZE = 5000 # maximum number of bytes transferred at once
  # END Configuration
 
  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 /\ACON\t(.+)\t(.+)\t(.+)/ # connection request
      version = $3.to_i
      if version < INTERNAL_VERSION
        client.send('VFAIL')
        return true
      end
      client.message = RMXOS.make_message('CON', $1, $2)
      return false
    when /\AUPDT\t(.+)/ # update request
      version = $1.to_i
      while version < INTERNAL_VERSION
        version += 1
        file = File.open("#{VERSION_LOG_PATH}/#{version}.txt", 'rb')
        lines = file.readlines
        file.close
        lines.each {|line|
          line.gsub!("\r") {''}
          line.gsub!("\n") {''}}
        self.parse_version(client, lines)
        client.send('UNEX')
      end
      client.send('UEND')
      return true
    end
    return false
  end
 
  def self.parse_version(client, lines)
    command = ''
    while lines.size > 0
      current = lines.shift
      next if current.size == 0
      if current[0, 1] == ':'
        command = current
      else
        case command
        when ':file'
          self.send_file(client, current, lines.shift)
        when ':dir'
          self.send_dir(client, current, lines.shift)
        when ':delete'
          client.send('DELE', current)
        end
      end
    end
  end
 
  def self.send_file(client, source, destination)
    file = File.open(source, 'rb')
    data = file.read
    file.close
    if data.size <= CHUNK_MAX_SIZE
      rawdata = data.inspect
      client.send('FILE', destination, rawdata)
    else
      client.send('FILE', destination)
      while data.size > CHUNK_MAX_SIZE
        current = data[0, CHUNK_MAX_SIZE].inspect
        data = data[CHUNK_MAX_SIZE, data.size - CHUNK_MAX_SIZE]
        client.send('FILC', destination, current)
      end
      rawdata = data.inspect
      client.send('FILC', destination, rawdata)
    end
  end
 
  def self.send_dir(client, source, destination)
    client.send('MKDIR', destination)
    Dir.foreach(source) {|name|
      if name != '.' && name != '..'
        filename = "#{source}/#{name}"
        if FileTest.directory?(filename)
          self.send_dir(client, filename, "#{destination}/#{name}")
        elsif FileTest.file?(filename)
          self.send_file(client, filename, "#{destination}/#{name}")
        end
      end
    }
  end
 
end




Instructions

In the script in the first comment.


Compatibility

Requires RMX-OS to work.


Credits and Thanks




Author's Notes

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] Versioning for RMX-OS
Post by: AliveDrive on May 30, 2010, 04:45:33 am
OMG YES.  :haha:
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on May 30, 2010, 04:52:15 am
As I said, I will release it later. Now it is "later". xD
Title: Re: [XP] Versioning for RMX-OS
Post by: SBR* on May 30, 2010, 06:15:52 am
Oh yeah! Now the only thing left to do is making MySQL work again :'(... It keeps on giving me errors that say "Host 'localhost' is not allowed to connect to the server". I tried searching it on google, but it didn't work. I'm now trying to FULLY delete it...
Title: Re: [XP] Versioning for RMX-OS
Post by: Wizered67 on May 30, 2010, 11:44:13 am
I'm slightly confused on this (sorry for being noobish)
So in the RMX-OS folder that we downloaded do we put in the game and rename it "versions/2/Game"? If so, my computer won't let me rename things with "/"......


Nevermind, I think I get it....



Edit: Now I'm having more problems. At first, it showed that there was no "2.txt" so I tried restarting the server. Now it doesn't seem to do this anymore, but it now says "You have been disconected" and gives this error in the error logs.....

Spoiler: ShowHide
Quoteundefined method `gsub!' for nil:NilClass
./Extensions/AU.rb:54:in `block in client_update'
C:/Users/Brian/Desktop/RMX-OS 1.14/RMX-OS Server/Extensions/AU.rb:54:in `each'
C:/Users/Brian/Desktop/RMX-OS 1.14/RMX-OS Server/Extensions/AU.rb:54:in `client_update'
C:/Users/Brian/Desktop/RMX-OS 1.14/RMX-OS Server/Data/Client.rb:43:in `block in handle'
C:/Users/Brian/Desktop/RMX-OS 1.14/RMX-OS Server/Data/Client.rb:43:in `each_value'
C:/Users/Brian/Desktop/RMX-OS 1.14/RMX-OS Server/Data/Client.rb:43:in `handle'
C:/Users/Brian/Desktop/RMX-OS 1.14/RMX-OS Server/Data/Server.rb:275:in `block in run'
2010-05-30 15:45:55 UTC; -1 () - Error:


edit: Are you sure syntax is the problem, because I get this error even when I just copy one of the examples for the comments in the script
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on May 30, 2010, 04:40:17 pm
Quote from: Blizzard on May 30, 2010, 04:42:57 am
# Notes:
#   
#   - There is no syntax checking or other verification of your version log
#     files. It is recommended not to use batch processing with one command but
#     use a command for every single file or directory.
Title: Re: [XP] Versioning for RMX-OS
Post by: G_G on May 30, 2010, 08:17:49 pm
I thought you were retired >___>

Anyways nice job!
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on May 31, 2010, 02:46:35 am
I promised to post this before I retired. Since I couldn't post it months ago, I've posted it now. Think of it as a script that traveled through  time into the future. :V:
Title: Re: [XP] Versioning for RMX-OS
Post by: tipsta on June 05, 2010, 07:00:50 am
Well,
Its a great idea, but im having trouble getting it to work.

Currently im getting this error,

undefined method `gsub!' for nil:NilClass
./Extensions/(RMX-OS) Version.rb:54:in `block in client_update'
C:/Documents and Settings/Owner/Desktop/Project/Server/Extensions/(RMX-OS) Version.rb:54:in `each'
C:/Documents and Settings/Owner/Desktop/Project/Server/Extensions/(RMX-OS) Version.rb:54:in `client_update'
C:/Documents and Settings/Owner/Desktop/Project/Server/Data/Client.rb:43:in `block in handle'
C:/Documents and Settings/Owner/Desktop/Project/Server/Data/Client.rb:43:in `each_value'
C:/Documents and Settings/Owner/Desktop/Project/Server/Data/Client.rb:43:in `handle'
C:/Documents and Settings/Owner/Desktop/Project/Server/Data/Server.rb:275:in `block in run'


And my version file looks like,

:file
v/Scripts.rgssad
Scripts.rgssad


Not sure if i have done something wrong, or if its the script itself.

Also,
Would it be possible to set this up so the server directs the clients to download the file from a web server?
So basically,

Client connects
Server tells client it needs to be updated
Client Accepts
Server reads update file and tells client to download from "http://url.of.updates.com/updates/*number/*file.*"
Client downloads from "http://url.of.updates.com/updates/*number/*file.*"


I think it would be better than downloading the updates from the server.

Yours,
Tipsta
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 07, 2010, 07:39:52 am
Quote from: tipsta on June 05, 2010, 07:00:50 am
Well,
Its a great idea, but im having trouble getting it to work.

Currently im getting this error,

undefined method `gsub!' for nil:NilClass
./Extensions/(RMX-OS) Version.rb:54:in `block in client_update'
C:/Documents and Settings/Owner/Desktop/Project/Server/Extensions/(RMX-OS) Version.rb:54:in `each'
C:/Documents and Settings/Owner/Desktop/Project/Server/Extensions/(RMX-OS) Version.rb:54:in `client_update'
C:/Documents and Settings/Owner/Desktop/Project/Server/Data/Client.rb:43:in `block in handle'
C:/Documents and Settings/Owner/Desktop/Project/Server/Data/Client.rb:43:in `each_value'
C:/Documents and Settings/Owner/Desktop/Project/Server/Data/Client.rb:43:in `handle'
C:/Documents and Settings/Owner/Desktop/Project/Server/Data/Server.rb:275:in `block in run'


And my version file looks like,

:file
v/Scripts.rgssad
Scripts.rgssad


Not sure if i have done something wrong, or if its the script itself.


If you are getting that error, then you haven't set it up right or put your files in the right folder.

Quote from: tipsta on June 05, 2010, 07:00:50 am
Also,
Would it be possible to set this up so the server directs the clients to download the file from a web server?
So basically,

Client connects
Server tells client it needs to be updated
Client Accepts
Server reads update file and tells client to download from "http://url.of.updates.com/updates/*number/*file.*"
Client downloads from "http://url.of.updates.com/updates/*number/*file.*"


I think it would be better than downloading the updates from the server.


This is not a download system, this is an updating system. It uses the connection to the game server to update the game.
If you want a system that downloads files, get one.
Title: Re: [XP] Versioning for RMX-OS
Post by: tipsta on June 07, 2010, 05:14:25 pm
Well, i don't think i set it up wrong because if i leave my update file (2.txt) empty it works until it throws the error, "Unable to find temp dir"
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 07, 2010, 05:57:25 pm
I think your operating system is messed up. The script uses the temporary folder of the operating system and when you are getting that error, then it's possible that you TEMP environment variable doesn't exist.
Title: Re: [XP] Versioning for RMX-OS
Post by: Wizered67 on June 23, 2010, 11:50:44 am
Yes!!!!!! I finnally figured out why I was getting that error before! It was all because I had listed my extensions in the wrong order!

Anyway, now that thats over, it gives an error saying
No such file or directory -C:/Users/ME/AppData/Local/Temp/RMXP_update


So do I have to go in and MAKE this folder and put the updates in there? Please can you help me. I'm hopelessly lost!
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 23, 2010, 06:52:30 pm
No, the script automatically makes those folders that you need.
Title: Re: [XP] Versioning for RMX-OS
Post by: Wizered67 on June 23, 2010, 07:04:02 pm
So then how come it's giving me this error?
What can I do to fix it?
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 24, 2010, 02:23:01 am
Well, obviously the folders aren't created. To which folder does the path exist?
Title: Re: [XP] Versioning for RMX-OS
Post by: Wizered67 on June 24, 2010, 08:43:11 pm
I'm not completely sure I understand your question, but if I know it right then:
I have the AppData folder, then local, then temp, just not the RMXP_Update folder.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 25, 2010, 03:00:44 am
I'll remember to check that then. The game should create the RMPX_update folder.
Title: Re: [XP] Versioning for RMX-OS
Post by: Wizered67 on June 25, 2010, 11:31:21 am
Thanks Blizzard. I appreciate you looking into it even though you're retired.
Title: Re: [XP] Versioning for RMX-OS
Post by: G_G on June 25, 2010, 07:05:12 pm
Quote from: Wizered67 on June 25, 2010, 11:31:21 am
Thanks Blizzard. I appreciate you looking into it even though you're retired.


*whispers* Dont remind him! He may remember then not fix it :V*whispers*
Title: Re: [XP] Versioning for RMX-OS
Post by: Wizered67 on July 26, 2010, 11:29:22 pm
Are you still looking into my problem? Sorry, but its been a while since there has been a response on this thread......
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 27, 2010, 02:16:04 am
I got a new laptop just a week ago, I haven't looked into it yet. I'll see if I can go it today or tomorrow.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on August 02, 2010, 07:43:09 pm
I can't seem to get this script to work. I placed it in the right spot. I just don't understand how to get it to update, I make a new .txt file called 2, and it doesn't do anything.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on August 02, 2010, 08:16:19 pm
Have you added any commands in that file? Have you changed the version on the server extension? Have you changed the version on the client?
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on August 02, 2010, 09:12:53 pm
where do I save the 2.txt file? that may be one problem I am having
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on August 03, 2010, 04:34:48 am
Wherever you specify it in the script. That's what the constant VERSION_LOG_PATH is for. It defines the relative path from wherever the server is running.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on August 03, 2010, 06:21:30 pm
So I have it in a folder located at Extensions\Updates\2.txt, and I changed the VERSION_LOG_PATH to Extensions\Updates, but it still won't update :/
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on August 03, 2010, 06:38:25 pm
Make sure you use \\ because \ is the escape character in strings. Best you just used /, that one works just fine on Windows operating systems.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on August 03, 2010, 11:01:36 pm
ok ,I did that. I have a question though.
if my scripts are located at C:\Users\WindowsUser\Desktop\RMX-OS Client\Data\Scripts.rxdata
how would I make a .txt file?

:file
C:/Users/WindowsUser/Desktop/RMX-OS Client/Data/Scripts.rxdata

and thats it?

oh and I get this error when I try to update

A client at 2010-08-04 03:14:42 UTC has caused an error:
undefined method `gsub!' for nil:NilClass
./Extensions/Updates.rb:54:in `block in client_update'
C:/Users/WindowsUser/Desktop/RMX-OS Server/Extensions/Updates.rb:54:in `each'
C:/Users/WindowsUser/Desktop/RMX-OS Server/Extensions/Updates.rb:54:in `client_update'

C:/Users/WindowsUser/Desktop/RMX-OS Server/Data/Client.rb:43:in `block in handle'
C:/Users/WindowsUser/Desktop/RMX-OS Server/Data/Client.rb:43:in `each_value'
C:/Users/WindowsUser/Desktop/RMX-OS Server/Data/Client.rb:43:in `handle'
C:/Users/WindowsUser/Desktop/RMX-OS Server/Data/Server.rb:275:in `block in run'
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on August 04, 2010, 04:05:01 am
The text file is not the file that is transfered, it contains a list of files that should be transfered for the update from the previous version to the version specified by the number in the file name.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on August 04, 2010, 05:21:40 pm
ok, I understand. But what does this error mean?

A client at 2010-08-04 03:14:42 UTC has caused an error:
undefined method `gsub!' for nil:NilClass
./Extensions/Updates.rb:54:in `block in client_update'
C:/Users/WindowsUser/Desktop/RMX-OS Server/Extensions/Updates.rb:54:in `each'
C:/Users/WindowsUser/Desktop/RMX-OS Server/Extensions/Updates.rb:54:in `client_update'

C:/Users/WindowsUser/Desktop/RMX-OS Server/Data/Client.rb:43:in `block in handle'
C:/Users/WindowsUser/Desktop/RMX-OS Server/Data/Client.rb:43:in `each_value'
C:/Users/WindowsUser/Desktop/RMX-OS Server/Data/Client.rb:43:in `handle'
C:/Users/WindowsUser/Desktop/RMX-OS Server/Data/Server.rb:275:in `block in run'
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on August 04, 2010, 06:00:57 pm
It means that no line could be read because the file was not found at the location that you specified. Or you left the update specification file empty. I think the latter should apply because if the path was incorrect, it should have crashed a few lines before.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on August 04, 2010, 06:29:48 pm
somehow got it to work, but now I get this problem

Spoiler: ShowHide

http://img535.imageshack.us/img535/5787/updateerrory.png (http://img535.imageshack.us/img535/5787/updateerrory.png)

Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on August 04, 2010, 06:57:42 pm
Are you sure you are running the game with proper permissions? Because that seems to me that Windows is not letting you access the system temp folder.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on August 04, 2010, 07:34:37 pm
I ran as administrator and it still pops up... Should I create the Directory manually? But what about other users? :/
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on August 04, 2010, 08:20:51 pm
It was always working fine for me on XP.

If you want, you can change the directory for the temp folder in the script. There should be a piece of code saying ENV['TEMP'] or ENV['TEMP'] + '/'. Just change it to ''. This will put the temporary folder into the game's folder. But that probably isn't so safe either because usually on Vista/7 programs aren't supposed to write into their folder in Program Files. But as I said, you can try.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on August 04, 2010, 08:41:17 pm
you were right, still no good. :/
Title: Re: [XP] Versioning for RMX-OS
Post by: G_G on August 04, 2010, 08:55:46 pm
Thats why you turn UAC Off :V
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on August 04, 2010, 09:05:11 pm
ok, I'll try turning off UAC

EDIT: turned of UAC and it still did not work
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on August 05, 2010, 04:59:58 am
Please don't doublepost. Use the Modify button instead.

Well, then I don't really know. Somebody posted the same problem in the topic and I haven't really been able to look into it yet. I'm not sure what's the cause either. :/
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on August 05, 2010, 06:46:41 pm
Alright, thanks anyway.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 08, 2010, 02:52:16 pm
It's explained in the instructions.
Title: Re: [XP] Versioning for RMX-OS
Post by: ForeverZer0 on September 08, 2010, 04:39:23 pm
Quote from: Blizzard on September 08, 2010, 02:52:16 pm
It's explained in the instructions.


You should just make that an auto-reply to this thread.  :)
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 08, 2010, 04:53:26 pm
Possibly a good idea. xD Sure, there is no demo, but I explained it really thoroughly in the instructions how to use it, how to set up where the files are located and how it works. :/ If people don't understand relative folder paths (which is, honestly, a very basic thing today), they won't be able to use this. "." means current folder and ".." means parent folder. Folders are separated with "/" characters and that's already it. :/ I really don't understand why it is so hard to get it.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on September 08, 2010, 08:53:18 pm
too bad this won't work with windows 7 -.- or my computer just doesn't like me.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 09, 2010, 03:06:23 am
I am able to run it on Windows 7 x64 without problems.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on September 09, 2010, 06:52:27 pm
mine is 32-bit so maybe that is why it won't create the folder
Title: Re: [XP] Versioning for RMX-OS
Post by: Ryex on September 10, 2010, 01:55:38 am
that would make absolutely no difference. have the game run as administrator. that should fix the problem
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 12, 2010, 04:04:04 am
As I already said, when you run your client, it does not have the permission to write on your harddisk.

EDIT: My bad, that problem happens when you don't configure the version log file properly.

Anyway, I updated the script a small change. It might help you with the problem.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on September 12, 2010, 09:11:36 pm
:DDDD Thanks you sooo much, that fixed the creation of the tmp folder. It works now :)

EDIT:

Quick Question though, where do we put the files that we want to be update, because I get the error that Data/Map001.rxdata does not exist
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 13, 2010, 02:13:49 am
Wherever you want. You just need to specify where it is in the extension relatively from the folder where RMX-OS.rb is located.
Title: Re: [XP] Versioning for RMX-OS
Post by: jrbault on September 13, 2010, 06:05:51 am
AAARRRGGHHH!!!! I dont know what i'm doing wrong.
my version log looks like this

:file
updates/version2/Data/Actors.rxdata
Actors.rxdata

I created a folder in my rmx-os server folder called updates. In the folder i put another named version2, that has all the files for second "edition" of my game. but i keep getting this error.

Spoiler: ShowHide
H:/Documents and Settings/Jeremy/Desktop/RMX-OS Server/Data/Server.rb:275:in `block in run'
2010-09-13 09:59:23 UTC; -1 () - Error:
No such file or directory -  updates/version2/Data/Actors.rxdata
./Extensions/updater.rb:87:in `initialize'
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 13, 2010, 07:53:43 am
Are you sure that the file is there? Also, your target location should be Data/Actors.rxdata, not Actors.rxdata.
Title: Re: [XP] Versioning for RMX-OS
Post by: jrbault on September 13, 2010, 10:13:42 am
K updated the log file

and this is my path directory for the actors data

H:\Documents and Settings\Jeremy\Desktop\RMX-OS Server\updates\version2\Data
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 13, 2010, 11:11:04 am
Wait a moment, do you have a space before the filename? It seems to me that the first folder is called " updates" rather than "updates".
I just tested it and it works fine for me.
Title: Re: [XP] Versioning for RMX-OS
Post by: jrbault on September 13, 2010, 01:18:42 pm
you sir are awesome and i feel kinda retarded. Sorry for all the trouble. thanks again
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 13, 2010, 02:14:59 pm
Lol! Good that I took a really, really good look at the update definition you posted. xD
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on September 13, 2010, 07:47:35 pm
dang it, I thought it was fixed, but now I get the error that there is no such file or directory for the RMXP_update folder


and the weirdest part is that I decided to manually put the folder in there, and I get the same error because it deletes the folder :/
Title: Re: [XP] Versioning for RMX-OS
Post by: Wizered67 on September 13, 2010, 08:05:01 pm
I am so close to getting this to work its not even funny. The probelm I'm having now is that whenever I try to update it, it says thats its updating for a while, and then says that scripts.rxdata could not be found. In the script, it mentions that you need to update scripts.rxdata OR game.rgssad which is what I'm updating. I'd really appreciate if you could help me get this to work.
:'(
Title: Re: [XP] Versioning for RMX-OS
Post by: jrbault on September 17, 2010, 02:27:34 pm
whenever i run my game it gives me the updating message but when its done it pops this up and kicks me off.
Spoiler: ShowHide
(http://img1.UploadScreenshot.com/images/main/9/25914231223.png) (http://www.UploadScreenshot.com/image/129412/5983417)


The next time i start my game though it starts fine and it has been updated. so its more of an annoyance then a problem.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 17, 2010, 04:27:19 pm
That's weird. I think you don't have administrative rights on your PC or something because that should be deleting the temporary files. Anyway, I'll edit the script so it handles that a bit better.

EDIT: Ok, try now.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on September 18, 2010, 03:55:07 pm
hmmm, So now it says "update finished and if game doesn't start automatically then restart it", so It restarts automatically but it still says I have to update again afterwards.  :???:
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 18, 2010, 04:01:50 pm
You didn't update your files properly. If the server is set to version 5 and the client is set to version 4, then you have to replace the Game.rgssad that has been compiled with scripts (or the Scripts.rxdata if your game is unencrypted) that has the new client version defined (which would be 5 in this particular example). Then, when the game is restarted, it will use the new scripts that have the version defined as 5 and the client won't have to be updated "again".
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on September 18, 2010, 08:23:17 pm
oh kk, i'll try it

EDIT:ok I did that, but it keeps getting closed by the 'remote host'
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 19, 2010, 03:45:34 am
Then your new version is faulty.
Title: Re: [XP] Versioning for RMX-OS
Post by: jrbault on September 19, 2010, 09:43:10 pm
ok yet another quick question.  This list time i tried updating it gave me the updating message and then after about a minute it says the server didn't  respond.  Are my updates to large?
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 20, 2010, 02:27:47 am
I'm not sure, I can't reproduce the problem.
Title: Re: [XP] Versioning for RMX-OS
Post by: Trider250 on September 20, 2010, 08:18:37 pm
yeah The error I get on the client is 'server won't respond' I have the same problem as him lol
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 21, 2010, 02:18:08 am
I'll take a look at it then. I had no problems with it.
Title: Re: [XP] Versioning for RMX-OS
Post by: BeAddicted on September 24, 2010, 10:15:50 am
Whenever I want to connect to the server I become this error "error! Your client is out of date! Client Version: 1.15; Server Version: 1.15"
When I dont use versioning it works normal.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 24, 2010, 11:47:38 am
Quote from: Blizzard on September 18, 2010, 04:01:50 pm
You didn't update your files properly. If the server is set to version 5 and the client is set to version 4, then you have to replace the Game.rgssad that has been compiled with scripts (or the Scripts.rxdata if your game is unencrypted) that has the new client version defined (which would be 5 in this particular example). Then, when the game is restarted, it will use the new scripts that have the version defined as 5 and the client won't have to be updated "again".
Title: Re: [XP] Versioning for RMX-OS
Post by: BeAddicted on September 24, 2010, 01:21:26 pm
hm still doesn't work
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 24, 2010, 01:25:40 pm
Weird. Try changing the version on both client and server to 1.16. It's possible that it's literally a computation error (so-called floating point precision error, you can look it up if you are interested).
Title: Re: [XP] Versioning for RMX-OS
Post by: BeAddicted on September 24, 2010, 02:00:31 pm
Ok I'm silly^^ when I start the server there stands no extensions found,
but I don't know why. I've made a new rb-file in the extensions folder and copied the script into it
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 24, 2010, 02:28:24 pm
You didn't define in the configuration file which extensions to use. (Also, change back the versions, that obviously wasn't the problem you were having.)
Title: Re: [XP] Versioning for RMX-OS
Post by: kanade on November 07, 2010, 04:48:38 pm
okaaay... my problem is ... i have a file what is big (177kb ... Scripts.rxdata) ^^ what do u mean with split the file / in the comments on the script?

sry for bad english ... me from switzerland ^^

- kanade-chan
Title: Re: [XP] Versioning for RMX-OS
Post by: [Luke] on November 12, 2010, 04:28:31 pm
Okay, I haven't read the code, but I bet that Scripts.rxdata is one of the files that you definitely CANNOT update through a script. You know, Versioning is a script, so it's inside that file. But what do I know :p
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on November 13, 2010, 04:21:13 am
Actually you can. All scripts are read and loaded upon start up and you can delete or edit the original file without problems. But you have to make sure that the new file works right when you put it up for updating. If you don't set up the new file properly, it will either keep trying to update the scripts or not work at all.
Title: Re: [XP] Versioning for RMX-OS
Post by: Wizered67 on February 20, 2011, 01:55:46 pm
After all this time of not realizing my mistake, I've finally figured out what I was doing wrong! Now I think the script should work. Basically my problem now is that my Game.rgssad is too big for the updater and it crashes with "Server has Disconnected". Is there any way for me to make it smaller? Thanks in advance.

edit: The error the server gives is:

An operation was attempted on something that wasn't a socket. In sender line 21. I'm assuming that this is because my update was too big, but I could be wrong.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on February 20, 2011, 02:10:32 pm
If the client gets disconnected during the transfer, then yes, this can be the cause of the problem.
You can split up the RGSSAD archive if you don't add the graphic files when you create it. Keep in mind that it would be a good idea to have an alternate encryption for the graphic files then.
Title: Re: [XP] Versioning for RMX-OS
Post by: Wizered67 on February 20, 2011, 02:11:55 pm
Good idea. I'll try it and hopefully it will help.
edit: I tried not adding graphics and audio, but I still get the same error. The Game.rgssad size is 1.49 MB. I'm not sure if this is too big. Also, if it makes a difference, the client error was actually server did not respons, not the disconnection.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on February 20, 2011, 02:24:32 pm
I have had a problem with transfer of large files earlier, but I solved that problem a long time ago. I have no problem transferring a file of 60 MB. :/
Title: Re: [XP] Versioning for RMX-OS
Post by: Wizered67 on February 20, 2011, 02:25:48 pm
That's weird.....I'll check if I'm doing soemthing wrong.
Title: Re: [XP] Versioning for RMX-OS
Post by: Vaelen on June 05, 2011, 04:24:25 pm
Hi short question. I can update in my Lan without any problems. Now a friend tested it (normaly we work with svn) and he can't update. Always a error with Server did not respond. Normal connection works fine.

maybe you know the problem.. or do I need a other port forwarded?
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 05, 2011, 04:31:05 pm
Did you install both client plugin and server extension properly? Is the plugin below the RMX-OS script? Does the RMX-OS server tell you that it has successfully loaded the server extension?
Title: Re: [XP] Versioning for RMX-OS
Post by: Vaelen on June 05, 2011, 09:23:59 pm
The Plugin is below the RMX-OS script and above the main.
The Extension is loaded and like i said it works fine for me.. but not for my friends.
I tried it in a virtual box and it works fine too.. so I don't have any idea why it doesn't work outsite..

One thing is, I can only connect through local ip adresses (192.168..) or over loopback (127..)  if I try to connect over my outside IP (wich is shown as online) I can't connect, my friends can. But I think that behaviour is normal. But with this I can reconstruct the error message. .. but that doesn't help very much why every one can connect to my server but the update don't work..
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 06, 2011, 02:09:13 am
Well, the only thing that's left is that you should check once more time if the proper port has been forwarded. :/
Title: Re: [XP] Versioning for RMX-OS
Post by: Vaelen on June 06, 2011, 10:12:35 am
54629 in the settings of the server and port forwarded.. .. hmm  ok maybe its his firewall or UAC..  I will try with several other friends.. maybe it will work someday on a root server
Title: Re: [XP] Versioning for RMX-OS
Post by: mroedesigns on July 18, 2011, 02:53:45 am
Having a problem getting this to update correctly. It recognizes it needs an update, but disconnects when it tries. I'm updating game.exe, so that might be why, but it's also throwing an error saying the directory doesn't exist when it does. The 'Version' folder is in the RMX-OS Server folder, and I changed the path in the extension to Version from Extensions.

Spoiler: ShowHide
(http://img16.imageshack.us/img16/5985/screenieue.png)


and here's what 2.txt says, located in the Version folder.
:file
   Version/2/Game.exe
   Game.exe
Title: Re: [XP] Versioning for RMX-OS
Post by: G_G on July 18, 2011, 03:34:40 am
The client itself is trying to open "/Version/2/Game.exe" thats clear. Maybe it has something to do with trying to overwrite Game.exe, which it can't since Game.exe is the one processing everything and since its open, it very well can't be replaced can it?
Title: Re: [XP] Versioning for RMX-OS
Post by: mroedesigns on July 18, 2011, 04:03:24 am
Well I tried it with Version/2/Data/Scripts.rxdata and it's giving me the same error. Client side it tries to update, says is updating, and then says you've been disconnected from the server. And the server is showing the same error as below.

I'm thinking I've got the relative directory wrong? It was just 'Extensions' so I changed it to 'Version' and put everything in that folder (2.txt and the folder '2' (with 2/Data/Scripts.rxdata)
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 18, 2011, 06:51:29 am
It should be working like that. O_o
Try removing "Version/" after ":file". I don't think it will work, but try it anyway.
Title: Re: [XP] Versioning for RMX-OS
Post by: mroedesigns on July 18, 2011, 01:01:52 pm
Nope, it's giving me the same error. It's trying the directory as just '2/Data/Scripts.rxdata' so I wonder if that has something to do with it? Is it not pointing to the Version folder correctly perhaps?

A client at 2011-07-18 08:55:10 UTC has caused an error:
No such file or directory - 2/Data/Scripts.rxdata
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 18, 2011, 02:08:41 pm
Are you sure that you have configured the extension right? I set the VERSION_LOG_PATH to "Version" and it worked just fine when I put everything into the Version folder.
Title: Re: [XP] Versioning for RMX-OS
Post by: mroedesigns on July 18, 2011, 02:17:13 pm
Spoiler: ShowHide
module RMXOS
 
  def self.load_current_extension
    return Versioning
  end
 
end

#======================================================================
# module Versioning
#======================================================================

module Versioning

  VERSION = 1.1
  RMXOS_VERSION = 1.15
  SERVER_THREAD = false
 
  # START Configuration
  GAME_VERSION = 1 # game version
  VERSION_LOG_PATH = 'Version' # where are the version log files located
  CHUNK_MAX_SIZE = 5000 # maximum number of bytes transferred at once
  # END Configuration
 
  def self.initialize
  end
 
  def self.main
    while RMXOS.server.running
      self.server_update
      sleep(0.1)
    end
  end
 
  def self.server_update
  end
 
  def self.client_update(client)
    case client.message
    when /\ACON(.+)\t(.+)/ # connection request
      version = $1.to_i
      if version < GAME_VERSION
        client.send('VNO')
        return true
      end
      client.message = "CON#{$2}"
    when /\AUPD(.+)/ # update request
      version = $1.to_i
      while version < GAME_VERSION
        version += 1
        file = File.open("#{VERSION_LOG_PATH}/#{version}.txt", 'r')
        lines = file.readlines
        file.close
        lines.each {|line|
          line.gsub!("\r") {''}
          line.gsub!("\n") {''}}
        self.parse_version(client, lines)
        client.send('UEX')
      end
      client.send('UEN')
      return true
    end
    return false
  end
 
  def self.parse_version(client, lines)
    command = ''
    while lines.size > 0
      current = lines.shift
      next if current.size == 0
      if current[0, 1] == ':'
        command = current
      else
        case command
        when ':file'
          self.send_file(client, current, lines.shift)
        when ':dir'
          self.send_dir(client, current, lines.shift)
        when ':delete'
          client.send("DEL#{current}")
        end
      end
    end
  end
 
  def self.send_file(client, source, destination)
    file = File.open(source, 'rb')
    data = file.read
    file.close
    if data.size <= CHUNK_MAX_SIZE
      rawdata = data.inspect
      client.send("FIL#{destination}\t#{rawdata}")
    else
      client.send("FIL#{destination}\t")
      while data.size > CHUNK_MAX_SIZE
        current = data[0, CHUNK_MAX_SIZE].inspect
        data = data[CHUNK_MAX_SIZE, data.size - CHUNK_MAX_SIZE]
        client.send("APP#{destination}\t#{current}")
      end
      rawdata = data.inspect
      client.send("APP#{destination}\t#{rawdata}")
    end
  end
 
  def self.send_dir(client, source, destination)
    client.send("MKD#{destination}")
    Dir.foreach(source) {|name|
      if name != '.' && name != '..'
        filename = "#{source}/#{name}"
        if FileTest.directory?(filename)
          self.send_dir(client, filename, "#{destination}/#{name}")
        elsif FileTest.file?(filename)
          self.send_file(client, filename, "#{destination}/#{name}")
        end
      end
    }
  end
 
end


named Updater.rb and i know its in the config extensions right because the server starts and loads all the extensions correctly [right now only blizz-abs and this since im testing compatibility]
Title: Re: [XP] Versioning for RMX-OS
Post by: G_G on July 18, 2011, 02:33:05 pm
*adds to "Blizzards will eventually look at" list* :V
Title: Re: [XP] Versioning for RMX-OS
Post by: mroedesigns on July 18, 2011, 03:06:33 pm
Hopefully sooner rather than later haha
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 18, 2011, 03:49:19 pm
Lol! As I said, it works for me. :/
Title: Re: [XP] Versioning for RMX-OS
Post by: mroedesigns on July 18, 2011, 05:23:57 pm
Well it doesn't work for me :/ ill post the script as well since the extensions already posted..

Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Versioning for RMX-OS by Blizzard
# Version: 1.1
# Type: RMX-OS Add-on
# Date: 30.5.2010
# Date v1.01: 12.9.2010
# Date v1.1: 17.9.2010
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  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 v1.15 or
#   higher to work properly. It is able to update the game client connecting
#   to the server to the newest game version.
#  
#  
# Instructions:
#  
#   The server extension validates the game version from the client and if the
#   client game version is lower than the server game version, the server will
#   refuse a connection. Instead the server will notify the client that it is
#   possible to update. After the player has confirmed that he wants to update
#   the client, the server will initiate version updating of the server. For
#   the server to know which files need to be sent, you need to create version
#   log files.
#  
#  
# Version Logs:
#  
#   The version log files on the server have a simple format. Each file is
#   named like "NUMBER.txt" where NUMBER is the version.
#  
#   examples:
#    
#     10.txt - version log for updating from version 9 to 10
#     15.txt - version log for updating from version 14 to 15
#     5475685.txt - version log for updating from version 5475684 to 5475685
#    
#   Version log files have a specific format that allows you to define which
#   files need to be updated. The basic format is:
#    
#     :COMMAND
#     FILES
#  
#   The following commands are at your disposal:
#    
#     file - update a single file
#     dir - update an entire directory with all subdirectories recursively
#     delete - delete a file OR a directory with all subdirectories recursively
#  
#   When using the ":delete" command, the FILES parameter is the name of the
#   file or directory that is affected.
#   When using the ":file" or the ":dir" command, there are 2 FILES parameters.
#   The first is the source file path and the second the destination file path.
#   You can add many files as you want with one single command.
#  
#   example:
#    
#     :file
#     versions/24/Game.rgssad
#     Game.rgssad
#     versions/Fonts.zip
#     fonts/fonts.dat
#     :dir
#     versions/24/BGM
#     Audio/BGM
#     :delete
#     utils/screenshot.dll
#     game.ico
#     artwork
#     :dir
#     versions/24/Audio/ME
#     Audio/ME
#    
#   The example above will do following:
#    
#     1. The file "versions/24/Game.rgssad" from the RMX-OS root directory will
#        be transferred to the client and store in the file "Game.rgssad" in
#        his game's root directory.
#     2. The file "versions/Fonts.zip" from the RMX-OS root directory will be
#        transferred to the client and stored in the file "fonts/fonts.dat" in
#        his game's root directory.
#     3. The directory "versions/24/BGM" and all of its contents (recursively)
#        from the RMX-OS root directory will be transferred to the client and
#        store in the directory "Audio/BGM" in his game's root directory.
#     4. The file or directory "utils/screenshot.dll" will be deleted.
#     5. The file or directory "game.ico" will be deleted.
#     6. The file or directory "artwork" will be deleted.
#     7. The directory "versions/24/Audio/ME" and all of its contents
#        (recursively) from the RMX-OS root directory will be transferred to
#        the client and stored in the directory "Audio/ME" in his game's root
#        directory.
#  
#  
# Notes:
#  
#   - There is no syntax checking or other verification of your version log
#     files. It is recommended not to use batch processing with one command but
#     use a command for every single file or directory.
#    
#     example:
#    
#       Instead of this type of writing:
#      
#       :file
#       versions/24/Game.rgssad
#       Game.rgssad
#       versions/Fonts.zip
#       fonts/fonts.dat
#    
#       use this type of writing:
#      
#       :file
#       versions/24/Game.rgssad
#       Game.rgssad
#       :file
#       versions/Fonts.zip
#       fonts/fonts.dat
#      
#   - Make sure to update the client scripts each time because you need to
#     update the constant GAME_VERSION in the configuration of this script to
#     make sure the client knows it's up to date. Either update Scripts.rxdata
#     or update Game.rgssad where Scripts.rxdata is contained.
#   - Update is done only all at once. First all files are downloaded into a
#     temporary directory. After a successful download of ALL files, first the
#     files and directories that need to be delete are deleted, then the
#     downloaded files are moved into the actual game's directory and are
#     updated.
#   - Multiple version updates work one after another and are all done at once.
#     If one version update fails for some reason, the previous updates will
#     not be lost.
#   - It is recommended to keep version updates small. Big updates are more
#     likely to break. You can simply split an update into several updates if
#     it's too big.
#  
#  
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

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

$rmxos_versioning = 1.1

#==============================================================================
# module RMXOS
#==============================================================================

module RMXOS
 
 CONNECTION_VERSION_MISMATCH = 134
 UPDATING_END                = 135
 
 #============================================================================
 # module RMXOS::Options
 #============================================================================

 module Options
 
   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   # START Configuration
   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
   GAME_VERSION = 1 # internal version number, use integers only
   EXECUTABLE = 'Game.exe' # game executable (usually Game.exe)

   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   # END Configuration
   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
 end
 
 #============================================================================
 # module RMXOS::Data
 #============================================================================
 
 module Data
   
   AnswerNo      = 'No'
   AnswerYes     = 'Yes'
   UpdatingNow   = 'Updating now. This may take a while.'
   UpdatePrompt  = 'Your client needs to be updated. Continue?'
   UpdateRestart = 'Update finished. If the game does not restart automatically, please restart it manually.'
   
   TempDir = ENV['TEMP'].gsub('\\', '/') + '/RMXP_update' # system temp folder
   # don't change this
   TempDir += Options::GAME_VERSION.to_s
   
 end

 #============================================================================
 # RMXOS::Network
 #============================================================================

 class Network
   
   def request_connection
     self.send("CON#{RMXOS::Options::GAME_VERSION}\t#{RMXOS::VERSION}")
   end
   
   def request_update
     if FileTest.exist?(RMXOS::Data::TempDir)
       Dir.clear(RMXOS::Data::TempDir)
     else
       Dir.mkdirs(RMXOS::Data::TempDir)
     end
     @delete_queue = []
     self.send("UPD#{RMXOS::Options::GAME_VERSION}")
   end
   
   alias check_connection_versioning_later check_connection
   def check_connection(message)
     case message
     when /\AVNO\Z/ # game version mismatch
       @messages.push(CONNECTION_VERSION_MISMATCH)
       return true
     when /\AMKD(.+)/ # make directory
       Dir.mkdirs("#{RMXOS::Data::TempDir}/#{$1}")
       return true
     when /\AFIL(.+)\t\Z/ # copy empty file
       path = "#{RMXOS::Data::TempDir}/#{$1}"
       Dir.create_path(path)
       file = File.open(path, 'wb')
       file.close
     when /\AFIL(.+)\t(.+)/ # copy file
       path = "#{RMXOS::Data::TempDir}/#{$1}"
       Dir.create_path(path)
       data = eval($2)
       file = File.open(path, 'wb')
       file.write(data)
       file.close
       return true
     when /\AAPP(.+)\t(.+)/ # append to file (in case of big files)
       path = "#{RMXOS::Data::TempDir}/#{$1}"
       Dir.create_path(path)
       data = eval($2)
       file = File.open(path, 'ab')
       file.write(data)
       file.close
       return true
     when /\ADEL(.+)/ # delete directory / file
       @delete_queue.push($1)
       return true
     when /\AUEN\Z/ # updating end
       Dir.clear(RMXOS::Data::TempDir)
       Dir.rmdirs(RMXOS::Data::TempDir)
       @messages.push(UPDATING_END)
       return true
     when /\AUEX\Z/ # execute update
       @delete_queue.each {|filename|
           if FileTest.directory?(filename)
             Dir.clear(filename)
             Dir.rmdirs(filename)
           else
             File.delete(filename) rescue nil
           end
           Graphics.update}
       Dir.copy(RMXOS::Data::TempDir, '.')
       Dir.clear(RMXOS::Data::TempDir)
       @delete_queue = []
       return true
     end
     return check_connection_versioning_later(message)
   end
   
 end
 
end

#==============================================================================
# Dir
#==============================================================================

class Dir
 
 def self.clear(source)
   dirs = [source]
   while dirs.size > 0
     dir = dirs.shift
     dirs += self.clear_non_recursive(dir)
   end
 end
 
 def self.clear_non_recursive(source)
   dirs = []
   Dir.foreach(source) {|name|
       if name != '.' && name != '..'
         filename = "#{source}/#{name}"
         if FileTest.directory?(filename)
           dirs.push(filename)
         elsif FileTest.file?(filename)
           File.delete(filename) rescue nil
         end
       end}
   return dirs
 end
 
 def self.copy(source, destination)
   dirs = [[source, destination]]
   while dirs.size > 0
     dir = dirs.shift
     Dir.mkdirs(dir[1]) if !FileTest.exist?(dir[1])
     dirs += self.copy_non_recursive(dir[0], dir[1])
   end
 end
 
 def self.copy_non_recursive(source, destination)
   dirs = []
   Dir.foreach(source) {|name|
       if name != '.' && name != '..'
         filename = "#{source}/#{name}"
         target = "#{destination}/#{name}"
         if FileTest.directory?(filename)
           dirs.push([filename, target])
         elsif FileTest.file?(filename)
           File.copy(filename, target) rescue nil
         end
       end}
   return dirs
 end
 
 def self.create_path(source)
   dirs = source.split('/')
   dirs.pop
   Dir.mkdirs(dirs.join('/')) if dirs.size > 0
 end
 
 def self.mkdirs(source)
   dirs = source.split('/')
   path = dirs.shift
   loop do
     Dir.mkdir(path) rescue nil if !FileTest.exist?(path)
     break if dirs.size == 0
     path += '/' + dirs.shift
   end
 end
 
 def self.rmdirs(source)
   all_dirs = [source]
   dirs = [source]
   while dirs.size > 0
     dir = dirs.shift
     new_dirs = self.get_subdirs(dir)
     dirs += new_dirs
     all_dirs += new_dirs
   end
   all_dirs.sort.reverse.each {|dir| Dir.rmdir(dir) rescue nil}
 end
 
 def self.get_subdirs(source)
   dirs = []
   Dir.foreach(source) {|name|
       if name != '.' && name != '..'
         filename = "#{source}/#{name}"
         dirs.push(filename) if FileTest.directory?(filename)
       end}
   return dirs
 end
 
end

#==============================================================================
# File
#==============================================================================

class File

 def self.copy(source, destination)
   file = File.open(source, 'rb')
   data = file.read
   file.close
   file = File.open(destination, 'wb')
   file.write(data)
   file.close
   Graphics.update # prevent script is hanging error
 end
 
end

#==============================================================================
# Window_Dialog
#==============================================================================

class Window_Dialog < Window_Command
 
 def initialize(width, commands = ['Yes', 'No'], caption = 'Are you sure?')
   commands.push('')
   @caption = caption
   @cursor_width = 32
   super(width, commands)
   if $fontface != nil
     self.contents.font.name = $fontface
     self.contents.font.size = $fontsize
   elsif $defaultfonttype != nil
     self.contents.font.name = $defaultfonttype
     self.contents.font.size = $defaultfontsize
   end
   self.x, self.y, self.z = 320 - self.width/2, 200 - self.height/2, 1500
   @item_max, self.opacity = commands.size-1, 192
   commands.each {|c|
       w = self.contents.text_size(c).width
       @cursor_width = w if @cursor_width < w}
   @cursor_width += 32
   refresh
   update_cursor_rect
 end
 
 def refresh
   super
   self.contents.font.color = system_color
   self.contents.draw_text(4, 0, self.width-40, 32, @caption, 1)
 end
 
 def draw_item(index, color)
   self.contents.font.color = color
   rect = Rect.new(4, 32 * (index+1), self.contents.width - 8, 32)
   self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
   self.contents.draw_text(rect, @commands[index], 1)
 end
 
 def update_cursor_rect
   if @index < 0 || @item_max == 0
     self.cursor_rect.empty
   else
     x = (self.contents.width - @cursor_width) / 2
     self.cursor_rect.set(x, (@index+1)*32, @cursor_width, 32)
   end
 end
 
end

#==============================================================================
# Scene_Servers
#==============================================================================

class Scene_Servers
 
 alias update_versioning_later update
 def update
   if @dialog_window == nil
     update_versioning_later
     if @wait_count == 0 && @update_mode
       @update_mode = nil
       @help_window.set_text(@helptext)
       Dir.clear(RMXOS::Data::TempDir)
       Dir.rmdirs(RMXOS::Data::TempDir)
     end
   else
     @dialog_window.update
     if Input.trigger?(Input::B)
       $game_system.se_play($data_system.cancel_se)
       @dialog_window.dispose
       @dialog_window = nil
     elsif Input.trigger?(Input::C)
       $game_system.se_play($data_system.decision_se)
       if @dialog_window.index == 0
         @help_window.set_text(RMXOS::Data::UpdatingNow)
         @wait_count = RMXOS::Options::SERVER_TIMEOUT * 2
         $network.request_update
         @update_mode = true
       end
       @dialog_window.dispose
       @dialog_window = nil
     end
   end
 end
 
 alias waiting_for_server_versioning_later waiting_for_server
 def waiting_for_server
   waiting_for_server_versioning_later
   $network.messages.each {|message|
       case message
       when RMXOS::CONNECTION_VERSION_MISMATCH # version mismatch
         @dialog_window = Window_Dialog.new(416, [RMXOS::Data::AnswerYes,
             RMXOS::Data::AnswerNo], RMXOS::Data::UpdatePrompt)
         return false
       when RMXOS::UPDATING_END # updating done
         @update_mode = false
         p RMXOS::Data::UpdateRestart
         Thread.new {system(RMXOS::Options::EXECUTABLE)}
         exit
         return false
       end}
   return true
 end
 
end
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 18, 2011, 05:40:49 pm
As I said, I don't know why it doesn't work for you. :/ It works fine for me regardless of the absolute path. Have you checked the capitalization of the letters? "Version" is different from "version". That's the last thing I can think of. :/
Title: Re: [XP] Versioning for RMX-OS
Post by: G_G on July 18, 2011, 05:41:31 pm
Just a suggestion. Make the folder "Version" in your client folder. Then inside it make a folder "2". Thats where the error is pointing towards.
Title: Re: [XP] Versioning for RMX-OS
Post by: mroedesigns on July 18, 2011, 05:51:36 pm
I tried it, didn't work. I figured the version folder would go in the server though? I also tried putting it in the Extensions folder like Extensions/Version/2/Scripts.rxdata but it's doing the same thing.
Title: Re: [XP] Versioning for RMX-OS
Post by: mroedesigns on July 18, 2011, 10:46:39 pm
So I probably shouldn't be double-posting so soon, but I still haven't been able to figure this out. Either I'm putting the directory structure together wrong, or I'm missing something. But the fact that everything up to that point (game version checking, recognizes the update is needed, and tries to update) works is really confusing me. Anyone have any idea what could be causing this?
Title: Re: [XP] Versioning for RMX-OS
Post by: diagostimo on February 03, 2012, 04:29:48 am
i know that this might be a bit of necro, but if your still having the issue of it relizing it needs to update but closing the conection to the server, i resolved this after a mess around, so i coppied the client folder to the desktop, with the game version as 1, i then edited some tilling in my project that is still in the rpg m os folder, then changed its game version to 2, also changing its extension version to 2, i test the rpg m os folders client, and it works, i can see the tiles i just edited, i also add 2.txt to the extensions folder and add this comand to it:

:dir
C:/Documents and Settings/User/Desktop/2112 with rmx-os/RMX-OS Client/Data
Data

then i launch the client i copied to my desktop that is still at version 1, it updates it and allows the game to launch, i can see the tiles i edited.
obviously i got:
C:/Documents and Settings/User/Desktop/2112 with rmx-os/RMX-OS Client/Data
from the location of folder that im using to apply the update so it will vary depending wheres yours is, i hope this is some help to who ever it may concern :)
Title: Re: [XP] Versioning for RMX-OS
Post by: Xolitude on March 31, 2013, 06:52:09 pm
Would I be allowed/be able to re-write this for my own RPG Maker VX master-server?
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on March 31, 2013, 07:30:53 pm
Yes, sure. Feel free to do so. Just don't forget to include me in the credits and release it under the same license.
Title: Re: [XP] Versioning for RMX-OS
Post by: Xolitude on March 31, 2013, 07:58:24 pm
Quote from: Blizzard on March 31, 2013, 07:30:53 pm
Yes, sure. Feel free to do so. Just don't forget to include me in the credits and release it under the same license.


Of course ^.^

Is it possible to write it for RPG Maker VX client+server?
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on March 31, 2013, 08:20:53 pm
Yeah, you only have to change to code to fit your server and the VX client.
Title: Re: [XP] Versioning for RMX-OS
Post by: Xolitude on March 31, 2013, 08:40:31 pm
Quote from: Blizzard on March 31, 2013, 08:20:53 pm
Yeah, you only have to change to code to fit your server and the VX client.


Oh ok :)
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 12, 2013, 01:51:03 pm
Updated to work with RMX-OS 2.0.
Title: Re: [XP] Versioning for RMX-OS
Post by: goth1sniper on June 17, 2014, 12:19:58 pm
this is the error i get when updateing the Scripts.rxdata file
Tue Jun 17 09:15:46 Pacific Daylight Time 2014:
Invalid argument - C:/Users/User/AppData/Local/Temp/RMXP_update1/Data/Scripts.rxdata
Versioning updater:242:in `initialize'
Versioning updater:242:in `open'
Versioning updater:242:in `check_connection'
(RMX-OS) Script:929:in `listen'
(RMX-OS) Script:926:in `each'
(RMX-OS) Script:926:in `listen'
(RMX-OS) Script:5873:in `waiting_for_server_versioning_later'
Versioning updater:481:in `waiting_for_server'
(RMX-OS) Script:5685:in `waiting?'
(RMX-OS) Script:5821:in `update_versioning_later'
Versioning updater:452:in `update'
(RMX-OS) Script:5550:in `main'
(RMX-OS) Script:5547:in `loop'
(RMX-OS) Script:5552:in `main'
-<:::RMX-OS Main:::>-:47


Here is the update text file
:file
versions/2/Scripts.rxdata
Data/Scripts.rxdata


If I try it with this it works
:file
versions/2/test.txt
Data/test.txt
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 17, 2014, 03:45:03 pm
Check if the file exists. It might be possible that your PC doesn't allow temporary files. :/
Title: Re: [XP] Versioning for RMX-OS
Post by: goth1sniper on June 18, 2014, 02:23:21 am
The file is there.
if i do this
:file
versions/2/test.txt
Data/test.txt

It workes but if I add the scripts file it gives me the error.
I even made a blank text file an named it test.rxdata an it gave me the error.
It has somthing to do with the .rxdata
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 18, 2014, 03:41:31 am
No, I meant check if it exists in the temporary folder on the client's PC.
Title: Re: [XP] Versioning for RMX-OS
Post by: goth1sniper on June 19, 2014, 12:17:49 pm
Quote from: Blizzard on June 17, 2014, 03:45:03 pm
Check if the file exists. It might be possible that your PC doesn't allow temporary files. :/


Oh om sorry.
No It wont send it. I looked in C:\Users\User\AppData\Local\Temp\RMXP_update1\Data
The text file I send will be in there When I test the update with that.
Title: Re: [XP] Versioning for RMX-OS
Post by: Sylphe on July 22, 2014, 02:40:42 pm
Having exactly the same error "Script  'Versionning' at line 241 : Errno::EINVAL occurred.

Invalid Argument -
C:/Users ... /Temp/RMXP_update2/Game.rgssad

The line is "file = File.open(path, 'wb')"
Maybe it is because it tries to Open the rgssad file ?

:/ annoying error though
Title: Re: [XP] Versioning for RMX-OS
Post by: whitespirits on July 25, 2014, 01:14:56 pm
OK so im having an error with this system similar to everyone else

Spoiler: ShowHide
(http://i804.photobucket.com/albums/yy324/richadam111/versionerror_zps3b0e6de3.png) (http://s804.photobucket.com/user/richadam111/media/versionerror_zps3b0e6de3.png.html)


I have my config set to

:dir
versions\2

is it again to do with the temps not being there? is there a way around it?

Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 26, 2014, 05:37:28 am
Just change the temp dir in the extended configuration then.

TempDir = ENV['TEMP'].gsub('\\', '/') + '/RMXP_update' # system temp folder


TempDir = 'RMXP_update'
Title: Re: [XP] Versioning for RMX-OS
Post by: whitespirits on July 26, 2014, 06:53:53 am
Thanks blizz i see it makes the folder now in game Dir its still having this error tho man

Spoiler: ShowHide
(http://i804.photobucket.com/albums/yy324/richadam111/erorrupdates_zps51ea51fb.png) (http://s804.photobucket.com/user/richadam111/media/erorrupdates_zps51ea51fb.png.html)
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 26, 2014, 07:34:55 am
Ok, you didn't set up the version file properly in the first place. Look at the examples. Do you see any \ characters? No, they are all / characters, because \ is an escape character that is not interpreted as an actual character.
Title: Re: [XP] Versioning for RMX-OS
Post by: whitespirits on July 26, 2014, 08:57:36 am
Thanks for replies blizz, im still having error either way the go :(
I have a folder in server dir called versions with a 2.txt file inside and a folder called 2 with all the updated game files in

Spoiler: ShowHide
(http://i804.photobucket.com/albums/yy324/richadam111/currenterror_zps1deda41d.gif) (http://s804.photobucket.com/user/richadam111/media/currenterror_zps1deda41d.gif.html)
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 26, 2014, 12:54:39 pm
You should revert the TempDir change to the original.

Also, you haven't configured WHERE the folder should be copied. That's why your path contains two consecutive slash characters ("//") and it doesn't work. You file should look like this.


:dir
versions/2
.
Title: Re: [XP] Versioning for RMX-OS
Post by: Sylphe on July 26, 2014, 06:04:28 pm
I changed the temp like you said and I get the same error

Invalid Argument RMXP_update2/Game.rgssad

I did'nt do any mistake in my version file (3.txt) :

:file
last_game_version/Stanland_Online/Game.rgssad
Game.rgssad
:file
last_game_version/Stanland_Online/MAJ_Log.txt
MAJ_Log.txt
:dir
last_game_version/Stanland_Online/Audio/SE
Audio/SE

The Game.rgssad isn't created at all in the folder RMXP_update2, it still empty :(
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 26, 2014, 06:20:01 pm
No, you have to change the TempDir back to what it was in the original script.
Title: Re: [XP] Versioning for RMX-OS
Post by: whitespirits on July 27, 2014, 05:26:53 am
Hi Blizz thanks for patience! im rolling with another error :( feel like im getting closer tho :)

Spoiler: ShowHide
(http://i804.photobucket.com/albums/yy324/richadam111/continuederror_zpsf8241fcf.gif) (http://s804.photobucket.com/user/richadam111/media/continuederror_zpsf8241fcf.gif.html)


Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 27, 2014, 05:42:12 am
You probably should define the proper folders and fine, not just "everything in versions/2".
Title: Re: [XP] Versioning for RMX-OS
Post by: whitespirits on July 27, 2014, 07:46:20 am
I just tried single files copy and pasting examples and changing the files and its all the same errors on which ever file i choose :(
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 27, 2014, 09:10:45 am
Then I'm really out of ideas. When I do the same thing, it works.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 29, 2014, 03:59:19 pm
Alright, I found and fixed the problem with "big" files.
Title: Re: [XP] Versioning for RMX-OS
Post by: whitespirits on July 29, 2014, 06:16:18 pm
Great blizz have u changed script for us to use?
Title: Re: [XP] Versioning for RMX-OS
Post by: Sylphe on July 29, 2014, 07:01:05 pm
 Last Edit: July 29, 2014, 09:58:45 PM by Blizzard »

I think he did x)
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on July 30, 2014, 01:22:26 am
Yes, I did. I actually only had to change one line in the extension
Title: Re: [XP] Versioning for RMX-OS
Post by: ShinoTakadora on June 21, 2015, 11:19:17 pm
Good day,
We have an error in our test client.
We will be happy if you help us. Thanks in advance.

VERSION_LOG_PATH = 'C:\Ruby\bin\Server\Extensions\versions'

* There is a file 2.txt
:dir
clients\2


"clients\2" directory is exists. Folder "2" is contains files of game client.

When my friend tries to update client, in the console there is an error:
"No such file or directory - clients\2".
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 22, 2015, 02:44:09 am
Hm, you shouldn't put the logs in the same folder where the versions are supposed to be.

As for the actual error, I'm not sure. Where exactly is the game located? There is no place in the code where a folder named "ver" is referenced.
Title: Re: [XP] Versioning for RMX-OS
Post by: ShinoTakadora on June 22, 2015, 02:14:38 pm
Quote from: Blizzard on June 22, 2015, 02:44:09 am
Hm, you shouldn't put the logs in the same folder where the versions are supposed to be.

As for the actual error, I'm not sure. Where exactly is the game located? There is no place in the code where a folder named "ver" is referenced.


Oh, sorry, I forgot to correct a typographical error.
"No such file or directory - clients\2".

Also we have tried to allocate a separate file using the command ":file", but nothing happened.
Client doesn't see the files and directories.

Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on June 22, 2015, 07:06:09 pm
The files are usually first extracted into a temp directory. Try changing the temp directory name in the client script. Currently it should be something with ENV["TEMP"]
Title: Re: [XP] Versioning for RMX-OS
Post by: ShinoTakadora on September 02, 2015, 07:54:30 am
I'm sorry, that I didn't answer soon. Thanks for the help.

Also, there is two small problems.
:delete doesn't remove the directory.
Example:

:delete
Versions/Clients/2/Audio/ME

Directory and files are not deleted, although the client shows: "Updated".

:dir isn't working.
Example:

:dir
Versions/Clients/2/Audio/BGM
Audio/BGM


Instead, I receive: "Server is not responding", even though the folder appeared in the directory "Temp", but not in the client.

However, the :file is working well. Just don't send mp3 files. Also music file in mp3 not removed with :delete. Could there be a problem with this?

I apologize for my English in advance.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 02, 2015, 08:56:10 am
It's possible that Windows is being a bitch with permissions. Try to run the game as admin.
Title: Re: [XP] Versioning for RMX-OS
Post by: ShinoTakadora on September 02, 2015, 11:32:38 am
Quote from: Blizzard on September 02, 2015, 08:56:10 am
It's possible that Windows is being a bitch with permissions. Try to run the game as admin.


Sorry, it hasn't helped. :(

And now, I tried to check a game client with my friend.

Outcome - "Server not responding". :^_^':
He could not update anything, even files with the :file.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 02, 2015, 01:49:56 pm
This is a network problem. Make sure your firewall and router are configured properly.
Title: Re: [XP] Versioning for RMX-OS
Post by: ShinoTakadora on September 02, 2015, 02:53:42 pm
Quote from: Blizzard on September 02, 2015, 01:49:56 pm
This is a network problem. Make sure your firewall and router are configured properly.


But people can play with me on the server, didn't works only auto-update.
Also, if I make a mistake and enter a non-existent file or directory, appears message in the console:
"No such file or directory".
That means that people can connect, I suppose, О.о
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 02, 2015, 04:14:12 pm
I'm really not sure what the problem could be then if people can connect and play.
Make sure that you define only files and folders that actually exist on the server. Otherwise you will likely have problems.
Title: Re: [XP] Versioning for RMX-OS
Post by: ShinoTakadora on September 03, 2015, 12:42:45 pm
Quote from: Blizzard on September 02, 2015, 04:14:12 pm
I'm really not sure what the problem could be then if people can connect and play.
Make sure that you define only files and folders that actually exist on the server. Otherwise you will likely have problems.


Another small issue. If the client is updated, what should appear in the server console?
Thanking you in advance.
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 03, 2015, 01:03:48 pm
The game should display a message that it needs to be restarted.
Title: Re: [XP] Versioning for RMX-OS
Post by: ShinoTakadora on September 03, 2015, 01:19:43 pm
Quote from: Blizzard on September 03, 2015, 01:03:48 pm
The game should display a message that it needs to be restarted.


Sorry. Not the game client, namely the server console. :^_^':
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 03, 2015, 03:49:52 pm
I haven't touched this code in years, but quickly looking through the server extension, it probably doesn't print out anything when the server is done sending.

Are you sure you're setting it up right? If there are mistakes in the formatting of the update file, it won't work. Also make sure that the version of the client and the server don't match so that updating is initiated properly. Be careful to use forward slashes (/) when specifying directories instead of backward slashes (/). Also keep in mind that you can't copy files from the server to a client location if that client location doesn't exist in the directory tree. I can't remember exactly, but I don't think I added code to handle this case so it's best to avoid it to be safe.
Title: Re: [XP] Versioning for RMX-OS
Post by: ShinoTakadora on September 04, 2015, 11:11:49 am
Quote from: Blizzard on September 03, 2015, 03:49:52 pm
I haven't touched this code in years, but quickly looking through the server extension, it probably doesn't print out anything when the server is done sending.

Are you sure you're setting it up right? If there are mistakes in the formatting of the update file, it won't work. Also make sure that the version of the client and the server don't match so that updating is initiated properly. Be careful to use forward slashes (/) when specifying directories instead of backward slashes (/). Also keep in mind that you can't copy files from the server to a client location if that client location doesn't exist in the directory tree. I can't remember exactly, but I don't think I added code to handle this case so it's best to avoid it to be safe.


Thank you that you spend time on the solution to my problem.
I read all posts in this thread for the fifth time, studying the problems of others. :^_^':

There was another small question.
With each new version of an update of the game, version of the game should be changed in:

(RMX-OS) Options Script - GAME_VERSION = 2
Versioning for RMX-OS Script - INTERNAL_VERSION = 2
Ruby File Versioning for RMX-OS - INTERNAL_VERSION = 2
..and in the server configuration file - GAME_VERSION = 2

Is it right?

However, the game doesn't get updated. I have reviewed all the settings of the router, I tried different combinations of commands, and even now I can't update the game client. When friends trying to update, files appear in the folder "Temp", but still there is an error: "Server is not responding".
I recieved another message "The client has been updated". However, it's not updated, and requires updating again.
In this topic has already appeared people with similar problems, but I can't find a solution. :(
Title: Re: [XP] Versioning for RMX-OS
Post by: Blizzard on September 04, 2015, 02:53:50 pm
GAME_VERSION is not really important for this script. It's only used for display to the player. INTERNAL_VERSION is the one that is being used. The update will start if INTERNAL_VERSION of the client is less than INTERNAL_VERSION on the server. The idea is that a client with e.g. version 4 can ask a server with version 7 to send him the data packs for version 5, then 6, then finally 7. Each datapack should obviously define INTERNAL_VERSION in its scripts differently (5, 6 and 7).

If you're having trouble with the temp folder, try changing it to something else in the client script. This line:

TempDir = ENV['TEMP'].gsub('\\', '/') + '/RMXP_update' # system temp folder


Change it to let's say this:

TempDir = 'temp/'


This might solve the problem of not being able to download and copy the files properly. But IDK if it will solve the "Server did not respond" issue.

EDIT: BTW, I updated the client script in the first post. Something caught my attention that might cause problems so I fixed it quickly.
Title: Re: [XP] Versioning for RMX-OS
Post by: ShinoTakadora on September 06, 2015, 10:50:45 am
All right, we have tried many different ways, again.
I can update the client now. :haha:
When my friends trying to update, they are also get registered files in the log "2.txt" and files appeared in a folder "Temp", but the connection is dropped, and the file "Game.rgssad" isn't downloaded completely. It breaks the file, or don't download it fully. :facepalm: