Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- --------------------------------------------------------------------------------
- Access key 1.0.0.1
- Author: Faherya
- --------------------------------------------------------------------------------
- This code allows you to distribute access keys manually. It is recommended
- only for demo distribution, trial versions and other situations in which the
- number of copies distributed will be controlled.
- --------------------------------------------------------------------------------
- Instructions:
- First, you must create your access keys. The file can be created in any text
- editor and all key files NEED to have the same name. Here is an example:
- # Thank you for purchasing your copy of {GAME NAME}!
- # Here is your access key:
- key = {
- :accKey => 106839
- }
- You can upload your game normally. Then distribute the access files one by
- one. These files must be in the same directory as the game executable.
- --------------------------------------------------------------------------------
- Terms of Use:
- Free for non-commercial projects. For commercial use please contact.
- --------------------------------------------------------------------------------
- Credits and Acknowledgments:
- Alisson
- Kyo Panda
- MayLeone
- starlight dream
- TheoAllen
- If they want, these people can use the code in commercial projects freely.
- For more codes access centrorpg.com !
- --------------------------------------------------------------------------------
- =end
- # ------------------------------------------------------------------------------
- # Normally your keys should be saved only in .rvdata2 format, highly
- # recommended thing, but if you prefer to use another this fix
- # allows you to use different formats.
- class << Marshal
- alias :marshall_load:load
- def load(port, proc = nil)
- marshall_load(port, proc)
- rescue TypeError
- if port.kind_of?(File)
- port.rewind
- port.read
- else
- port
- end
- end
- end unless Marshal.respond_to?(:marshall_load)
- #-------------------------------------------------------------------------------
- class Scene_Key < Scene_Base
- #-------------------------------------------------------------------------------
- # Setup Instructions:
- # Below is a verification structure. Each line beginning with "when" checks for
- # a possible key. To add new keys just copy and paste this and the subsequent
- # line by modifying the numerical value by your key.
- # Remember one thing:
- # - All key files NEED to have the same name.
- def start
- super
- # Verifying that the file exists:
- if File.exists?("Key.rvdata2")# This is the file name and format.
- # Reading the file:
- key = eval(load_data("Key.rvdata2"))
- # Start verification:
- case key[:accKey]
- # These keys are just examples. I recommend you use random numbers.
- when 000000
- validate_key
- when 000001
- validate_key
- # [...]
- else # Invalid key
- msgbox "Invalid key."
- exit
- end
- else # The key file does not exist.
- msgbox "File not found."
- exit
- end
- end
- # Validate Key
- def validate_key
- SceneManager.call(Scene_Title)
- end
- #-------------------------------------------------------------------------------
- end
- #-------------------------------------------------------------------------------
- # Modifying the SceneManager:
- module SceneManager
- def self.first_scene_class
- $BTEST ? Scene_Battle : Scene_Key
- end
- end
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement