roman-murashov / hedgewars

Automatically exported from code.google.com/p/hedgewars
GNU General Public License v2.0
0 stars 0 forks source link

Stupid check for DLC/Stupid asterisk #651

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Pack game resources into .hwp file
2. Try network play
3. All your resources are prepended with asterisk effectively preventing other 
from seeing the match to your settings on their side ("*Highlander" for 
example).

Also potentially there could be other sources of triggering DLC flag from this 
code:

QString scriptPath = 
PHYSFS_getRealDir(QString("Scripts/Multiplayer/%1.lua").arg(script).toLocal8Bit(
).data());
bool isDLC = !scriptPath.startsWith(datadir->absolutePath());

"/" vs "\" mismatch for example

Original issue reported on code.google.com by unC0Rr on 2 Jun 2013 at 7:06

GoogleCodeExporter commented 8 years ago
Also PHYSFS_getRealDir returns *char of utf-8 encoded data. Maybe 
QString::fromUtf8 would be better choice to assign value to scriptPath. Anyway, 
I don't see a good reason to prepend asterisk in network traffic.

Original comment by unC0Rr on 2 Jun 2013 at 7:09

GoogleCodeExporter commented 8 years ago
Well, that's... Not great, but.  Luckily not that serious since that's not 
default layout and there's no really good reason for anyone to do that :)

Well, it would be helpful for Android but luckily they have their own frontend, 
and it doesn't work anyway, and certainly doesn't work with physfs.

Original comment by kyberneticist@gmail.com on 3 Jun 2013 at 12:05

GoogleCodeExporter commented 8 years ago
Ah, not sure I fully follow, but, is this the reason so many people seem to 
have trouble playing scripts with me lately? I give them the script and they 
copy and claim they have copied it correctly and restarted hedgewars, but still 
can't seem to see my script. I thought they were just being nubs, but... ?

Original comment by RedGrin...@gmail.com on 3 Jun 2013 at 4:11

GoogleCodeExporter commented 8 years ago
"/" vs "\" should be handled internally by Qt iirc
however fromUtf8 seems a better candidate for scriptPath

Original comment by vittorio...@gmail.com on 3 Jun 2013 at 7:14

GoogleCodeExporter commented 8 years ago
"/" vs "\" are handled ofc, but I don't think we could blindly rely on that 
path returned by Qt and path returned by physfs would match char-to-char.

Original comment by unC0Rr on 3 Jun 2013 at 8:47