Started by edwardthefma, May 19, 2010, 11:03:12 pm
module RMXOS #------------------------------------------------------------------ # Passes the extension's main module to RMX-OS on the top # level so it can handle this extension. # Returns: Module of this extension for update. #------------------------------------------------------------------ def self.load_current_extension return Server_States end end#======================================================================# module ExtensionSkeleton#======================================================================module Server_States # extension version VERSION = 1.0 # required RMX-OS version RMXOS_VERSION = 1.11 # whether the server should update this extension in an idividual thread or not SERVER_THREAD = true # :::: START Configuration # - YOUR CONFIGURATION HERE # :::: END Configuration #------------------------------------------------------------------ # Initializes the extension (i.e. instantiation of classes). #------------------------------------------------------------------ def self.initialize end #------------------------------------------------------------------ # Calls constant updating on the server. #------------------------------------------------------------------ def self.main # while server is running while RMXOS.server.running self.server_update sleep(0.1) # 0.1 seconds pause, decreases server load end file = File.open('server_status.txt', 'wb') file.write("Offline\r\n") file.close end #------------------------------------------------------------------ # Handles the server update. #------------------------------------------------------------------ def self.server_update file = File.open('server_status.txt', 'wb') file.write("Online\r\n") file.close end #------------------------------------------------------------------ # Handles updating from a client. # client - Client instance (from Client.rb) # Returns: Whether to stop check the message or not. #------------------------------------------------------------------ def self.client_update(client) # - YOUR CLIENT MESSAGE CODE HERE return false end end