Games-Axmud

 view release on metacpan or  search on metacpan

lib/Games/Axmud/Obj/File.pm  view on Meta::CPAN

            '# Number commification mode',
                $client->commifyMode,
            '# Detect short weblinks',
                $self->convert($client->shortUrlFlag),
            '# List of IP lookup services',
                scalar $client->ipLookupList,
                $client->ipLookupList,
            '# Prompt wait time (seconds)',
                $client->promptWaitTime,
            '# Login warning time (seconds)',
                $client->loginWarningTime,
            '# Show explicit line numbers in \'main\' window',
                $self->convert($client->debugLineNumsFlag),
            '# Show explicit tags in \'main\' window',
                $self->convert($client->debugLineTagsFlag),
            '# Show Locator task debug messages',
                $self->convert($client->debugLocatorFlag),
            '# Show extensive Locator task debug messages',
                $self->convert($client->debugMaxLocatorFlag),
            '# Show illegal exit direction debug messages',
                $self->convert($client->debugExitFlag),
            '# Show Locator task expected room statements',
                $self->convert($client->debugMoveListFlag),
            '# Show object parsing debug messages',
                $self->convert($client->debugParseObjFlag),
            '# Show object comparison debug messages',
                $self->convert($client->debugCompareObjFlag),
            '# Show plugin failure debug messages',
                $self->convert($client->debugExplainPluginFlag),
            '# Show non-existent IV debug messages',
                $self->convert($client->debugCheckIVFlag),
            '# Show errors when table objects can\'t be added/resized',
                $self->convert($client->debugTableFitFlag),
            '# Show Perl errors/warnings in \'main\' window',
                $self->convert($client->debugTrapErrorFlag),
            '# Show toolbar button labels',
                $self->convert($client->toolbarLabelFlag),
            '# Show irreversible icon in \'edit\' windows',
                $self->convert($client->irreversibleIconFlag),
            '# Allow popup windows showing the ' . $axmud::SCRIPT . ' logo',
                $self->convert($client->allowBusyWinFlag),
            '# Allow system messages to be displayed in the \'main\' window',
                $self->convert($client->mainWinSystemMsgFlag),
            '# Set \'main\' window\'s urgency hint when text received',
                $self->convert($client->mainWinUrgencyFlag),
            '# Show tooltips in a session\'s default tab',
                $self->convert($client->mainWinTooltipFlag),
            '# Session tab mode',
                $client->sessionTabMode,
            '# Use xterm titles',
                $self->convert($client->xTermTitleFlag),
            '# Use long world names in tab labels',
                $self->convert($client->longTabLabelFlag),
            '# Don\'t use tab labels when only one session open',
                $self->convert($client->simpleTabFlag),
            '# Prompt user before closing \'main\' window',
                $self->convert($client->confirmCloseMainWinFlag),
            '# Prompt user before closing \'main\' window tabs',
                $self->convert($client->confirmCloseTabFlag),
            '# Prompt user before closing session from the \'main\' window menu',
                $self->convert($client->confirmCloseMenuFlag),
            '# Prompt user before closing session from the \'main\' window toolbar',
                $self->convert($client->confirmCloseToolButtonFlag),
            '# Character set',
                $client->charSet,
            '# Maximum concurrent sessions',
                $client->sessionMax,
            '# Switch to \'offline\' mode on disconnection',
                $self->convert($client->offlineOnDisconnectFlag),
            '# Store connection history',
                $self->convert($client->connectHistoryFlag),
            '# Use page up (etc) to scroll in textviews',
                $self->convert($client->useScrollKeysFlag),
            '# Page up (etc) doesn\'t scroll the entire page length',
                $self->convert($client->smoothScrollKeysFlag),
            '# Page up (etc) auto-engages split mode',
                $self->convert($client->autoSplitKeysFlag),
            '# Use tab/cursor keys to auto-complete commands',
                $self->convert($client->useCompleteKeysFlag),
            '# Use tab to switch between sessions',
                $self->convert($client->useSwitchKeysFlag),
            '@@@ eos',
        );

        # Prepare footer
        push @list, ('@@@ eof');

        # Add newline characters to every entry in @list before writing the whole list to the file
        foreach my $item (@list) {

            $item .= "\n";
        }

        print $fileHandle @list;

        # Writing complete
        $result = close $fileHandle;

        # Precautions taken when an emergency save is NOT in progress...
        if (! $emergFlag) {

            # Release the lock on the semaphore file
            $self->releaseFileLock($semaphoreHandle);

            if (! $result) {

                # Restore the config file from backup
                File::Copy::copy($backupFile, $path);

                # Set global flags and display an error message
                return $self->disableSaveLoad(FALSE);

            } elsif (! $axmud::CLIENT->autoRetainFileFlag) {

                # Delete the backup file, unless the user has opted to retain it
                unlink ($backupFile);
            }

            # Save the file's header (metadata) in this object's variables
            $self->ivPoke('scriptName', $axmud::NAME_FILE);
            $self->ivPoke('scriptVersion', $axmud::VERSION);

lib/Games/Axmud/Obj/File.pm  view on Meta::CPAN

                $client->ivPoke('debugLineTagsFlag', $dataHash{'debug_line_tags_flag'});
            }
        }
        $client->ivPoke('debugLocatorFlag', $dataHash{'debug_locator_flag'});
        if ($self->scriptConvertVersion >= 1_000_482) {

            $client->ivPoke('debugMaxLocatorFlag', $dataHash{'debug_max_locator_flag'});
        }
        if ($self->scriptConvertVersion >= 1_001_282) {

            $client->ivPoke('debugExitFlag', $dataHash{'debug_exit_flag'});
        }
        $client->ivPoke('debugMoveListFlag', $dataHash{'debug_move_list_flag'});
        $client->ivPoke('debugParseObjFlag', $dataHash{'debug_parse_obj_flag'});
        $client->ivPoke('debugCompareObjFlag', $dataHash{'debug_compare_obj_flag'});
        $client->ivPoke('debugExplainPluginFlag', $dataHash{'debug_explain_plugin_flag'});
        $client->ivPoke('debugCheckIVFlag', $dataHash{'debug_check_iv_flag'});
        if ($self->scriptConvertVersion >= 1_000_800) {

            $client->ivPoke('debugTableFitFlag', $dataHash{'debug_table_fit_flag'});
        }
        $client->ivPoke('debugTrapErrorFlag', $dataHash{'debug_trap_error_flag'});
        if ($self->scriptConvertVersion >= 1_000_949) {

            $client->ivPoke('toolbarLabelFlag', $dataHash{'toolbar_label_flag'});
        }
        $client->ivPoke('irreversibleIconFlag', $dataHash{'irreversible_icon_flag'});
        if ($self->scriptConvertVersion >= 1_001_136) {

            $client->ivPoke('allowBusyWinFlag', $dataHash{'allow_busy_win_flag'});
        }
        if ($self->scriptConvertVersion >= 1_001_202) {

            $client->ivPoke('mainWinSystemMsgFlag', $dataHash{'main_win_system_msg_flag'});
        }
        if ($self->scriptConvertVersion >= 1_000_344) {

            $client->ivPoke('mainWinUrgencyFlag', $dataHash{'main_win_urgency_flag'});
        }
        if ($self->scriptConvertVersion >= 1_000_883) {

            $client->ivPoke('mainWinTooltipFlag', $dataHash{'main_win_tooltip_flag'});
        }
        $client->ivPoke('sessionTabMode', $dataHash{'session_tab_mode'});
        if ($self->scriptConvertVersion >= 1_000_184) {

            $client->ivPoke('xTermTitleFlag', $dataHash{'xterm_title_flag'});
        }
        if ($self->scriptConvertVersion >= 1_000_365) {

            $client->ivPoke('longTabLabelFlag', $dataHash{'long_tab_label_flag'});
            $client->ivPoke('simpleTabFlag', $dataHash{'simple_tab_flag'});
        }
        if ($self->scriptConvertVersion >= 1_000_917) {

            $client->ivPoke('confirmCloseMainWinFlag', $dataHash{'confirm_close_main_win_flag'});
            $client->ivPoke('confirmCloseTabFlag', $dataHash{'confirm_close_tab_flag'});
        }
        if ($self->scriptConvertVersion >= 1_002_102) {

            $client->ivPoke('confirmCloseMenuFlag', $dataHash{'confirm_close_menu_flag'});
            $client->ivPoke(
                'confirmCloseToolButtonFlag',
                $dataHash{'confirm_close_tool_button_flag'},
            );
        }
        if ($self->scriptConvertVersion >= 1_000_185) {

            $client->ivPoke('charSet', $dataHash{'char_set'});
        }
        if ($self->scriptConvertVersion >= 1_000_616) {

            $client->ivPoke('sessionMax', $dataHash{'session_max'});
        }
        if ($self->scriptConvertVersion >= 1_001_256) {

            $client->ivPoke('offlineOnDisconnectFlag', $dataHash{'offline_on_disconnect_flag'});
        }
        if ($self->scriptConvertVersion >= 1_000_884) {

            $client->ivPoke('connectHistoryFlag', $dataHash{'connect_history_flag'});
        }
        if ($self->scriptConvertVersion >= 1_000_338) {

            $client->ivPoke('useScrollKeysFlag', $dataHash{'use_scroll_keys_flag'});
        }
        if ($self->scriptConvertVersion >= 1_000_884) {

            $client->ivPoke('smoothScrollKeysFlag', $dataHash{'smooth_scroll_keys_flag'});
            $client->ivPoke('autoSplitKeysFlag', $dataHash{'auto_split_keys_flag'});
        }
        if ($self->scriptConvertVersion >= 1_000_338) {

            $client->ivPoke('useCompleteKeysFlag', $dataHash{'use_complete_keys_flag'});
            $client->ivPoke('useSwitchKeysFlag', $dataHash{'use_switch_keys_flag'});
        }

        ######################
        # Load complete

        # If the loaded config file was saved by an earlier version of Axmud than the one we're
        #   using now, the file object's data must be marked as needing to be saved (in case the
        #   config file uses new IVs)
        if ($self->scriptConvertVersion < $axmud::CLIENT->convertVersion($axmud::VERSION)) {

            $self->set_modifyFlag(TRUE, $self->_objClass . '->loadConfigFile');

        } else {

            # Otherwise, mark the file object's data as not needing to be saved
            $self->set_modifyFlag(FALSE, $self->_objClass . '->loadConfigFile');
        }

        return 1;
    }

    sub setupDataFile {

        # Called by GA::Client->loadOtherFiles for the file types:
        #   'tasks', 'scripts', 'contacts', 'dicts', 'toolbar', 'usercmds', 'zonemaps', 'winmaps',
        #   'tts'



( run in 3.301 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )