… | |
… | |
1046 | close $fh; |
1046 | close $fh; |
1047 | |
1047 | |
1048 | if (@$objs) { |
1048 | if (@$objs) { |
1049 | if (my $fh = aio_open "$filename.pst~", O_WRONLY | O_CREAT, 0600) { |
1049 | if (my $fh = aio_open "$filename.pst~", O_WRONLY | O_CREAT, 0600) { |
1050 | chmod SAVE_MODE, $fh; |
1050 | chmod SAVE_MODE, $fh; |
1051 | my $data = Coro::Storable::nfreeze { version => 1, objs => $objs }; |
1051 | my $data = Coro::Storable::blocking_nfreeze { version => 1, objs => $objs }; |
1052 | aio_write $fh, 0, (length $data), $data, 0; |
1052 | aio_write $fh, 0, (length $data), $data, 0; |
1053 | aio_fsync $fh if $cf::USE_FSYNC; |
1053 | aio_fsync $fh if $cf::USE_FSYNC; |
1054 | close $fh; |
1054 | close $fh; |
1055 | aio_rename "$filename.pst~", "$filename.pst"; |
1055 | aio_rename "$filename.pst~", "$filename.pst"; |
1056 | } |
1056 | } |
… | |
… | |
2896 | =pod |
2896 | =pod |
2897 | |
2897 | |
2898 | The following functions and methods are available within a safe environment: |
2898 | The following functions and methods are available within a safe environment: |
2899 | |
2899 | |
2900 | cf::object |
2900 | cf::object |
2901 | contr pay_amount pay_player map x y force_find force_add |
2901 | contr pay_amount pay_player map x y force_find force_add destroy |
2902 | insert remove name archname title slaying race decrease_ob_nr |
2902 | insert remove name archname title slaying race decrease_ob_nr |
2903 | |
2903 | |
2904 | cf::object::player |
2904 | cf::object::player |
2905 | player |
2905 | player |
2906 | |
2906 | |
… | |
… | |
2913 | =cut |
2913 | =cut |
2914 | |
2914 | |
2915 | for ( |
2915 | for ( |
2916 | ["cf::object" => qw(contr pay_amount pay_player map force_find force_add x y |
2916 | ["cf::object" => qw(contr pay_amount pay_player map force_find force_add x y |
2917 | insert remove inv name archname title slaying race |
2917 | insert remove inv name archname title slaying race |
2918 | decrease_ob_nr)], |
2918 | decrease_ob_nr destroy)], |
2919 | ["cf::object::player" => qw(player)], |
2919 | ["cf::object::player" => qw(player)], |
2920 | ["cf::player" => qw(peaceful)], |
2920 | ["cf::player" => qw(peaceful)], |
2921 | ["cf::map" => qw(trigger)], |
2921 | ["cf::map" => qw(trigger)], |
2922 | ) { |
2922 | ) { |
2923 | no strict 'refs'; |
2923 | no strict 'refs'; |