aldostools / webMAN-MOD

Extended services for PS3 console (web server, ftp server, netiso, ntfs, ps3mapi, etc.)
https://aldostools.github.io/webMAN-MOD/
GNU General Public License v3.0
1.3k stars 176 forks source link

[Bug?] Write Command #1071

Closed LuanTeles closed 5 months ago

LuanTeles commented 5 months ago

Aldo, some of my write commands are wierd, see here

<Pair key="module_action"><String>/dev_blind?1;/xmb.ps3$close_list;/xmb.ps3$close_list;/xmb.ps3$close_list;/xmb.ps3$open_list;/write.ps3/dev_blind/vsh/resource/explore/xmb/category_video.xml&t=%20%20%20%20%20%20%20%20%20%20%20%20%3C!--%20%3CQuery%20class="type:x-xmb/folder-pixmap"%20key="online_video"%20attr="online_video"%20src="xmb://localhost/dev_hdd0/game/PS34KPROX/USRDIR/toolbox/online/online_video.xml#seg_online_video_items"/%3E%20--%3E&line=229;/dev_blind?0</String></Pair>

I'm writing to line 229

But in the file it is being written in line 232, (most commands work and write to the right line but some doesn't)

This file is 17KB, i successfully write to bigger files in the right lines.

image

aldostools commented 5 months ago

If it works with other files, the issue could be specific to that file.

The command only counts line feeds (0x0A aka \n). for(i = 0; i < size; i++) if(buffer[i] == '\n' && (++c >= line)) {i++; break;}

Some options that you could try are: -Test using a more simple write command on a file in /dev_hdd0 or /dev_usb to confirm that the write command is working fine.

LuanTeles commented 5 months ago

If it works with other files, the issue could be specific to that file.

The command only counts line feeds (0x0A aka \n). for(i = 0; i < size; i++) if(buffer[i] == '\n' && (++c >= line)) {i++; break;}

Some options that you could try are: -Test using a more simple write command on a file in /dev_hdd0 or /dev_usb to confirm that the write command is working fine.

  • Try writing to line 226. Maybe that will write to 229 if it's counting 3 additional lines.
  • Consider swapping the file with one already modified instead of patch the file.

Yeap for the problematic ones, I'm making the command to write to different lines from where it really is

For example, i need to write in line 300, so I set it to 297 in webMAN.

But this one is the most problematic , I need to write 235, i was using the command to write to 229 because 227 was writing to 236, so I set 229 and it is writing to 232 ahahah

I'll check my xml via hex to see if something strange is there.

aldostools commented 5 months ago

Test using a more simple file. It's possible that your XML has hidden characters that could be causing the bug.

In my opinion you should try changing the approach to swap the files like DeViL303 did with Ultimate Toolbox.

LuanTeles commented 5 months ago

Test using a more simple file. It's possible that your XML has hidden characters that could be causing the bug.

By looking at it via HEX evertything is right, but i'm making another one fro scratch to see.

In my opinion you should try changing the approach to swap the files like DeViL303 did with Ultimate Toolbox.

Yeap, it would be much better, but i started doing this way, mainly because of hen

in hen, my items are only displayed when hen is enabled, i created a pro_features.xml that is mapped only when hen is enabled ofc.

image

LuanTeles commented 5 months ago

I could easily split the items into individual files, but it would require remapping for each item, so I've avoided that and am using the webMAN mod for this.

Thinking about it now, I could have remapped the :face_palm folder, so I could disable it item by item, disabling the xml.

Also i'm using webman for these operations instead of xai plugin move/copy operations, because i'm using explore_plugin commands to swap the icons to indicated enabled/disabled (when nat release the source of his xai, i may start learning how to add my own operations there)