mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Crashdump privacy
This commit is contained in:
parent
344ed7fc31
commit
eeb043e52b
8 changed files with 34 additions and 27 deletions
|
|
@ -267,6 +267,7 @@ set(BINDING_HEADERS
|
||||||
binding-mri/flashable-binding.h
|
binding-mri/flashable-binding.h
|
||||||
binding-mri/keybindings-binding.h
|
binding-mri/keybindings-binding.h
|
||||||
binding-mri/signalconnection-binding.h
|
binding-mri/signalconnection-binding.h
|
||||||
|
binding-mri/sunshine-binding.h
|
||||||
)
|
)
|
||||||
set(BINDING_SOURCE
|
set(BINDING_SOURCE
|
||||||
binding-mri/binding-mri.cpp
|
binding-mri/binding-mri.cpp
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,17 @@
|
||||||
#include "ruby/internal/intern/class.h"
|
#include "ruby/internal/intern/class.h"
|
||||||
#include "security.h"
|
#include "security.h"
|
||||||
#include "eventthread.h"
|
#include "eventthread.h"
|
||||||
//Просто на C реализуем методы мне в падлу ебаться со статической линковкой и прочим дерьмом.
|
#include "sunshine-binding.h"
|
||||||
//Аминь.
|
bool is_privacy_crashdump_enabled = false;
|
||||||
|
|
||||||
|
static VALUE sunshine_get_crash_privacy(VALUE self) {
|
||||||
|
return is_privacy_crashdump_enabled ? Qtrue : Qfalse;
|
||||||
|
}
|
||||||
|
|
||||||
|
static VALUE sunshine_set_crash_privacy(VALUE, VALUE v) {
|
||||||
|
is_privacy_crashdump_enabled = RTEST(v);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
static VALUE obj_clone(VALUE self){
|
static VALUE obj_clone(VALUE self){
|
||||||
return rb_obj_clone(self);
|
return rb_obj_clone(self);
|
||||||
|
|
@ -46,6 +55,8 @@ void SunshineBindingInit(){
|
||||||
rb_const_set(module, rb_intern("SDLVersion_minor"), INT2NUM(SDL_MINOR_VERSION));
|
rb_const_set(module, rb_intern("SDLVersion_minor"), INT2NUM(SDL_MINOR_VERSION));
|
||||||
rb_const_set(module, rb_intern("SDLVersion_micro"), INT2NUM(SDL_MICRO_VERSION));
|
rb_const_set(module, rb_intern("SDLVersion_micro"), INT2NUM(SDL_MICRO_VERSION));
|
||||||
rb_const_set(module, rb_intern("SECURITYSTATE"), rb_str_new_cstr(securitystate));
|
rb_const_set(module, rb_intern("SECURITYSTATE"), rb_str_new_cstr(securitystate));
|
||||||
|
rb_define_singleton_method(module, "crashprivacy", RUBY_METHOD_FUNC(sunshine_get_crash_privacy), 0);
|
||||||
|
rb_define_singleton_method(module, "crashprivacy=", RUBY_METHOD_FUNC(sunshine_set_crash_privacy), 1);
|
||||||
//если методы доступны то просто не перезаписываем их
|
//если методы доступны то просто не перезаписываем их
|
||||||
if (!rb_respond_to(rb_cObject, rb_intern("class"))) {
|
if (!rb_respond_to(rb_cObject, rb_intern("class"))) {
|
||||||
rb_define_method(rb_cObject, "class", rb_obj_class, 0);
|
rb_define_method(rb_cObject, "class", rb_obj_class, 0);
|
||||||
|
|
|
||||||
1
binding-mri/sunshine-binding.h
Normal file
1
binding-mri/sunshine-binding.h
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
extern bool is_privacy_crashdump_enabled;
|
||||||
|
|
@ -28,8 +28,10 @@ module Settings
|
||||||
:true_memory_mode => false,
|
:true_memory_mode => false,
|
||||||
:oneshot_mode => false,
|
:oneshot_mode => false,
|
||||||
:twm_shader_footprint => true,
|
:twm_shader_footprint => true,
|
||||||
# Advanced
|
|
||||||
|
|
||||||
|
# Advanced
|
||||||
|
:crashlog_privacy => false,
|
||||||
|
|
||||||
#controls
|
#controls
|
||||||
:gamepad_led => true,
|
:gamepad_led => true,
|
||||||
:gamepad_deadzone => 5,
|
:gamepad_deadzone => 5,
|
||||||
|
|
@ -326,8 +328,9 @@ class Window_Settings
|
||||||
tr("Advanced") => [
|
tr("Advanced") => [
|
||||||
{
|
{
|
||||||
:type => :bool,
|
:type => :bool,
|
||||||
:name => tr('useless option:3'),
|
:name => tr('Crashlog privacy'),
|
||||||
:default => false
|
:parameter => :crashlog_privacy
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
tr("Debug") => [
|
tr("Debug") => [
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,11 @@ module Settings
|
||||||
# if you do not take the value from settings directly.
|
# if you do not take the value from settings directly.
|
||||||
|
|
||||||
# name must be same as the parameter identifier
|
# name must be same as the parameter identifier
|
||||||
|
|
||||||
|
def crashlog_privacy(value)
|
||||||
|
Sunshine.crashprivacy=value
|
||||||
|
end
|
||||||
|
|
||||||
# Audio
|
|
||||||
def bgm_volume(value)
|
def bgm_volume(value)
|
||||||
Audio.bgm_volume = value
|
Audio.bgm_volume = value
|
||||||
end
|
end
|
||||||
|
|
@ -16,7 +19,6 @@ module Settings
|
||||||
Audio.sfx_volume = value
|
Audio.sfx_volume = value
|
||||||
end
|
end
|
||||||
|
|
||||||
# Video
|
|
||||||
def fullscreen(value)
|
def fullscreen(value)
|
||||||
Graphics.fullscreen = $console = value
|
Graphics.fullscreen = $console = value
|
||||||
end
|
end
|
||||||
|
|
@ -56,7 +58,6 @@ module Settings
|
||||||
# TODO: fix languages on new ruby versions
|
# TODO: fix languages on new ruby versions
|
||||||
end
|
end
|
||||||
|
|
||||||
# Gameplay
|
|
||||||
def movement(value)
|
def movement(value)
|
||||||
$game_switches[251] = value != 0
|
$game_switches[251] = value != 0
|
||||||
end
|
end
|
||||||
|
|
@ -65,7 +66,6 @@ module Settings
|
||||||
# TODO: fix skip_text settings setter
|
# TODO: fix skip_text settings setter
|
||||||
end
|
end
|
||||||
|
|
||||||
# Advanced
|
|
||||||
def frameskip(value)
|
def frameskip(value)
|
||||||
Graphics.frameskip = value
|
Graphics.frameskip = value
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ class Sprite_Footprint < Sprite
|
||||||
self.oy = 16
|
self.oy = 16
|
||||||
self.bitmap = RPG::Cache.misc('footprints')
|
self.bitmap = RPG::Cache.misc('footprints')
|
||||||
self.src_rect.set(0, 16 * (direction / 2 - 1), 16, 16)
|
self.src_rect.set(0, 16 * (direction / 2 - 1), 16, 16)
|
||||||
|
|
||||||
self.shader = (Settings[:twm_shader] and Settings[:twm_shader_footprint]) and ($game_switches[160] or Settings[:true_memory_mode]) and (character_name.start_with?("en") or character_name.start_with?("niko")) ? Shader::WorldMachine : Shader::Sprite
|
|
||||||
update
|
update
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -336,10 +336,6 @@ int main(int argc, char *argv[]){
|
||||||
SDL_Window *win;
|
SDL_Window *win;
|
||||||
Uint32 winFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_INPUT_FOCUS;
|
Uint32 winFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_INPUT_FOCUS;
|
||||||
|
|
||||||
// #ifdef __APPLE__
|
|
||||||
// winFlags |= SDL_WINDOW_RESIZABLE;
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
win = SDL_CreateWindow(conf.windowTitle.c_str(), conf.defScreenW, conf.defScreenH, winFlags);
|
win = SDL_CreateWindow(conf.windowTitle.c_str(), conf.defScreenW, conf.defScreenH, winFlags);
|
||||||
if (conf.fullscreen)
|
if (conf.fullscreen)
|
||||||
SDL_SetWindowFullscreen(win, true);
|
SDL_SetWindowFullscreen(win, true);
|
||||||
|
|
@ -368,10 +364,6 @@ int main(int argc, char *argv[]){
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_DisplayMode mode;
|
SDL_DisplayMode mode;
|
||||||
/* Can't sync to display refresh rate if its value is unknown */
|
|
||||||
//if (!mode.refresh_rate)
|
|
||||||
// conf.syncToRefreshrate = false;
|
|
||||||
|
|
||||||
EventThread eventThread;
|
EventThread eventThread;
|
||||||
RGSSThreadData rtData(&eventThread, win, alcDev, mode.refresh_rate, conf);
|
RGSSThreadData rtData(&eventThread, win, alcDev, mode.refresh_rate, conf);
|
||||||
|
|
||||||
|
|
|
||||||
17
src/meow.cpp
17
src/meow.cpp
|
|
@ -25,6 +25,7 @@
|
||||||
#include <SDL3/SDL_system.h>
|
#include <SDL3/SDL_system.h>
|
||||||
#include <boost/stacktrace.hpp>
|
#include <boost/stacktrace.hpp>
|
||||||
#include <SDL3/SDL_cpuinfo.h>
|
#include <SDL3/SDL_cpuinfo.h>
|
||||||
|
#include "sunshine-binding.h"
|
||||||
#ifdef __LINUX__
|
#ifdef __LINUX__
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include "xdg-user-dir-lookup.h"
|
#include "xdg-user-dir-lookup.h"
|
||||||
|
|
@ -120,12 +121,14 @@ void crash(Exception::Type t, const char *fmt, ...){
|
||||||
o << "Internal storage path: " << SDL_GetAndroidInternalStoragePath() << std::endl;
|
o << "Internal storage path: " << SDL_GetAndroidInternalStoragePath() << std::endl;
|
||||||
o << "External Storage path: " << SDL_GetAndroidExternalStoragePath() << ats::endl;
|
o << "External Storage path: " << SDL_GetAndroidExternalStoragePath() << ats::endl;
|
||||||
o << "Cache path: " << SDL_GetAndroidCachePath() << std::endl;
|
o << "Cache path: " << SDL_GetAndroidCachePath() << std::endl;
|
||||||
o << "Is ChromeBook? " << SDL_IsChromebook() << std::endl;
|
if(!is_privacy_crashdump_enabled){
|
||||||
o << "Is Phone? " << SDL_IsPhone() << std::endl;
|
o << "Is ChromeBook? " << SDL_IsChromebook() << std::endl;
|
||||||
o << "Is Tablet? " << SDL_IsTablet() << std::endl;
|
o << "Is Phone? " << SDL_IsPhone() << std::endl;
|
||||||
o << "Is Samsung DeX? " << SDL_IsDeXMode() << std::endl;
|
o << "Is Tablet? " << SDL_IsTablet() << std::endl;
|
||||||
o << "Is TV? " << SDL_IsTV() << std::endl;
|
o << "Is Samsung DeX? " << SDL_IsDeXMode() << std::endl;
|
||||||
o << "Is Ubuntu Touch? " << SDL_IsUbuntuTouch() << std::endl;
|
o << "Is TV? " << SDL_IsTV() << std::endl;
|
||||||
|
o << "Is Ubuntu Touch? " << SDL_IsUbuntuTouch() << std::endl;
|
||||||
|
}
|
||||||
#elif __EMSCRIPTEN__
|
#elif __EMSCRIPTEN__
|
||||||
o << "Emscripten start address of the stack: " << emscripten_stack_get_base() << std::endl;
|
o << "Emscripten start address of the stack: " << emscripten_stack_get_base() << std::endl;
|
||||||
o << "Emscripten end address of the stack: " << emscripten_stack_get_end() << std::endl;
|
o << "Emscripten end address of the stack: " << emscripten_stack_get_end() << std::endl;
|
||||||
|
|
@ -135,9 +138,7 @@ void crash(Exception::Type t, const char *fmt, ...){
|
||||||
o << "PSPdev MIPS Stack Trace: " << int pspDebugGetStackTrace() << std::endl;
|
o << "PSPdev MIPS Stack Trace: " << int pspDebugGetStackTrace() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
o << "[Hardware]" << std::endl;
|
o << "[Hardware]" << std::endl;
|
||||||
o << "L1 cache line size: " << SDL_GetCPUCacheLineSize() << std::endl;
|
|
||||||
o << "number of logical CPU cores: " << SDL_GetNumLogicalCPUCores() << std::endl;
|
o << "number of logical CPU cores: " << SDL_GetNumLogicalCPUCores() << std::endl;
|
||||||
//o << "System page size: " << SDL_GetSystemPageSize() << " bytes" << std::endl;
|
|
||||||
o << "System RAM size: " << SDL_GetSystemRAM() << " MiB" << std::endl;
|
o << "System RAM size: " << SDL_GetSystemRAM() << " MiB" << std::endl;
|
||||||
o.close();
|
o.close();
|
||||||
}else{
|
}else{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue