xray-16 icon indicating copy to clipboard operation
xray-16 copied to clipboard

Path to fsgame.ltx corrupted

Open xrombik opened this issue 6 years ago • 10 comments

This output: command line -fsltx /mnt/sda2/Programs/Steam/steamapps/common/Stalker Call of Pripyat/fsgame.ltx

and then this in same time: using fs-ltx /mnt/sda2/Programs/Steam/steamapps/common/Stalker Shows that path to fsgame.ltx is corrupted at runtime - it was split by white space.

Console output $:./run.sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/sdc1/stalkercop1/usr/games LD_LIBRARY_PATH=:/mnt/sdc1/stalkercop1/usr/lib:/mnt/sdc1/stalkercop1/lib/mimalloc-1.6 ! Couldn't create surface from image: Couldn't open logo.bmp OpenXRay Rx64 build 7729, Apr 5 2020 Custom build from commit[34cd539079a836703401bca64bab435717c9b149] branch[xd_dev]

command line -fsltx /mnt/sda2/Programs/Steam/steamapps/common/Stalker Call of Pripyat/fsgame.ltx

  • CPU features: RDTSC, MMX, SSE, SSE2, SSE3, SSE4.1
  • CPU cores/threads: 4/4
  • CPU current freq: 3780 MHz

Initializing File System... using fs-ltx /mnt/sda2/Programs/Steam/steamapps/common/Stalker

FATAL ERROR

[error] Expression : file_size == (u32)r_bytes [error] Function : FileDownload [error] File : /mnt/sdc1/openxray/xray-16/src/xrCore/FS.cpp [error] Line : 146 [error] Description : can't read from file : [error] Arguments : \mnt\sda2\Programs\Steam\steamapps\

stack trace:

xrDebug::GatherInfo(char*, unsigned long, ErrorLocation const&, char const*, char const*, char const*, char const*) xrDebug::Fail(bool&, ErrorLocation const&, char const*, char const*, char const*, char const*) /mnt/sdc1/stalkercop1/usr/lib/xrCore.so(+0x2a822) [0x7f908d86e822] CLocatorAPI::setup_fs_ltx(char const*) CLocatorAPI::_initialize(unsigned int, char const*, char const*) xrCore::Initialize(char const*, char const*, LogCallback, bool, char const*, bool) xr_3da(+0x177f) [0x5624d27f977f] xr_3da(+0x139f) [0x5624d27f939f] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f908cb4ab97] xr_3da(_start+0x2a) [0x5624d27f95aa] Trace/breakpoint trap (core dumped)

xrombik avatar Apr 05 '20 08:04 xrombik

Исправлено в https://github.com/OpenXRay/xray-16/pull/572

xrombik avatar Apr 09 '20 19:04 xrombik

I think it's best to use a library go parse command line options, like getopt but portable. Then we can parse all possible parameters into a configuration struct in Core and replace things like strstr(Core.Params, ....

jjdredd avatar Mar 01 '21 01:03 jjdredd

No 3rd party libraries. No.

Xottab-DUTY avatar Mar 01 '21 04:03 Xottab-DUTY

I mean xray is already using 3rd party libraries and reimplementing what's been implemented before is a bad practice in general. What alternatives do you offer? What about my second suggestion?

jjdredd avatar Mar 01 '21 05:03 jjdredd

I already told about custom solution in Discord.

Xottab-DUTY avatar Mar 01 '21 05:03 Xottab-DUTY

I meant this: "Then we can parse all possible parameters into a configuration struct in Core and replace things like strstr(Core.Params, ...."

jjdredd avatar Mar 01 '21 05:03 jjdredd

It is included in the custom solution, of course.

Xottab-DUTY avatar Mar 01 '21 05:03 Xottab-DUTY

What I offer is: You just declare any key anywhere in the code (locally to the place where it is used) like this: static key g_fsltx_key("fsltx", "key for custom fs.ltx path"); Then you use it like this: if (g_fsltx_key.is_set()) ...

All keys will be registered automatically and then initialized on core initialize.

Xottab-DUTY avatar Mar 01 '21 05:03 Xottab-DUTY

Sounds good.

jjdredd avatar Mar 01 '21 05:03 jjdredd

Без этого исправлеия что либо делать не возможно. Это исправление позволяет запускать игру с ресурсами раположеными в самом удобном месте, без необходимости их копировать. Можно проверить как игра отрабатывает разные моды ресурсов, не копируя лишний раз ничего. Так же можно спокойно зарефакторить работу с командой строкой, убедиться что всё работает как надо и после чего исправить это исправление.

xrombik avatar Mar 10 '21 19:03 xrombik