Mwyann / ydkjs

You Don't Know Javascript
https://www.ydkjs.eu/
GNU General Public License v3.0
62 stars 9 forks source link

howto install #1

Open frostworx opened 5 years ago

frostworx commented 5 years ago

thank you for this cool project! I'l like to install the game on my local server, but unfortunately I can't get it into a usable state. this is what I've done so far:

when I launch the main page on my local server I get the main french title screen (unfortunately I don't speak french - me idiot had latin at school long ago and I was bad ;)). no problem I can't read it, but I'm stuck now here:

looks like the sql schema file isn't complete, right? would be great if you could update it as I'd love to play the good old classic ydkj in german together with my wife again :)

Mwyann commented 5 years ago

Wow... Well I didn't think someone would actually want to install this on their own machine ;) That's why I didn't even bother including database schemas.

Some information in the database is extracted from the CD (like question titles, answers...) and some has been extracted by me by hand (animation data mainly), so I'll make an export with only my handcrafted data in it and the empty schema for the copyrighted content that can be filled by another script in the toolbox (i'll also explain it to you). Give me a few days to prepare this :)

frostworx commented 5 years ago

oh cool! thank you very much for your friendly help! :) many people still like the german ydkj (the voice was amazingly funny) and thanks to your work it will live forever! :) have a nice weekend!

Mwyann commented 5 years ago

@frostworx I updated the SQL exports and I've put detailed installation instructions for you to follow. I followed the same instructions to make sure it works, but please tell me if something isn't clear or missing.

frostworx commented 5 years ago

yay! thank you very much @Mwyann! I'll try it tomorrow! :)

frostworx commented 5 years ago

hi again! great readme update, but I have still some issues with the installation: 1) the convertwav.sh doesn't work like that in this state, as the second exec line for both commands isn't accepted. probably this wasn't your intension to leave both commented in, as you probably only require either ogg or mp3 and not both. so I cropped it down to find . -type f -iname '*.wav' -exec bash -c 'ffmpeg -i "{}" -b 64k -f ogg -acodec libvorbis "dirname "{}"/basename "{}" .wav.ogg"' \; find . -iname "*.aifc" -exec bash -c 'ffmpeg -i "{}" -b 64k -f ogg -acodec libvorbis "dirname "{}"/basename "{}" .aifc.ogg"' \; find . \( -iname \*.wav -o -iname \*.aifc \) -delete 2) I have no idea what I should insert as $GETsalt in api/local/config.inc.php 3) session_save_path() in api/get.php line 10 wasn't defined here, so I set it to /tmp/http, chowned that dir to my apache user/group but there's no session* file (error log shows that it is only searching for a session there, but doesn't seem to write one anywhere)

probably following errors are that: a) I can't login with a random user/password under /html/?login=1 (should I?) b) when trying to start a 1 player game it fails with opening above session file c) under /joinsession.php I get the error PHP Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ydkj.players' doesn't exist

maybe I should just re-start from scratch, mysql and php are not really my world tbh :) thank your for your time and work!

frostworx commented 5 years ago

just noticed that both csvs have broken umlauts, not sure if those should be converted before db import

Mwyann commented 5 years ago

Are you talking about the "Ü"? In theory I took care of the conversion (YDKJUnit.pas, line 595, function MactoUTF8) but if that means a display problem in game, then it'll have to be fixed indeed :)

frostworx commented 5 years ago

nah, I just have seen it when trying to open the files with my text editor. no idea if it would work in game so far :)

Mwyann commented 5 years ago

I just looked out the original file and Macintosh layout, and I can confirm that the used character 0x86 is indeed Ü, and the font displays it as a Ü too. I didn't play the German game enough to tell if there's any difference, you'll tell me :)

frostworx commented 5 years ago

ther eare several umlauts which could cause problems when formatting is wrong (I assumed this is the case as the csv files are not utf-8). these are mainly upper and lowercase ÄÖÜ and ß. qhdr.csv can't be opened at all in the texteditor as it is seen as binary file, the strings.csv has broken umlauts. hex editor sees f.e. the "ä" as octal 303 and 244 "ö" as octal 303 and 266 "ß" as octal 303 and 237 "ü" as octal 303 and 274

until I have the other issues from earlier today and therefore can not start a game I can't tell if this even is a problem inside the game, but the file doesn't look really useable at all. the lines with the filepaths at the beginning look like this f.e.: ¾\qfold9\aot¾½¾

Mwyann commented 5 years ago

½ and ¾ are the two characters that I'm using as custom separators for the CSV file. And all the string data is indeed UTF-8. I used custom separators as I didn't wanted to mess around with more character problems (dealing with Mac -> UTF-8 was enough).

frostworx commented 5 years ago

ic, so this might not be an issue. do you have a hint for above session file problem? maybe it is php 7.3 related, at least I found some problems on the web with 7.1 shrug the problem described under c) is no longer reproducable, maybe a mysql restart fixed it - no idea.

Mwyann commented 5 years ago

Oops, sorry I missed the long message, here are my answers:

  1. I convert both mp3 and ogg because some browsers tend to prefer one or the other format. That's weird that the second line isn't accepted, I tried it here and it works...
  2. This $GETsalt var is used to hide the real file name when the server sends data to the client. So you should put your own random characters here.
  3. session_save_path is a standar php4+ function, weird that it wasn't defined... 3.a. You don't need to login, I left it out for now because I'm not planning on making user profiles any time soon. 3.b. This session problem is weird, I don't have the problem here.
frostworx commented 5 years ago

thanks for your answer! unfortunately I didn't have the time to test today, but I'll try asap :) session_save_path defaults to /tmp if not set (afaik) but as that didn't work I tried with the defined subdirectory - which didn't work as well. good to know that I don't have to login, so chances are high that the missing session files are the problem first line when starting 1 or 2 player game looks like this: sessionstart(): open(/tmp/http/sess$RANDOM, O_RDWR) failed: No such file or directory (2) in /path/to/ydkjs/html/index.php on line 3, referer: http://serverip/ydkjs/

the page is stuck with a white "loading loop animation" on a black screen then (mobile users click here disappears after clicking) have a nice weekend! :)

frostworx commented 5 years ago

the "umlauts" above seem to be not the only characters which are "broken" in the csv files. I'll try to convert all broken chars to useable (at first with a texteditor, if the result works with some sed lines :)). are " chars are problem? because some look like “ currently. apart from that I'll setup a new test vm in the next days to install everything from scratch.

Mwyann commented 5 years ago

Hi, if you fix anything let me know, with examples (like questions hat shows the problem specifically). I guess the " char are not simple " in fact, it may be more like « ». Again, theorically the CSV is meant to be inserted in database with the import-csv.php script. So before fixing chars, first try to insert it, and then use phpmyadmin for example to browse data and see if the problem still exists (maybe your text editor is messing up things because of the weird charset?) Let me know about your VM install.

frostworx commented 5 years ago

thank you for your help again! :) you're right, makes sense to check the db before changing any chars. of course I'll let you know about the process!

frostworx commented 5 years ago

me again :) so on my breandnew (arch linux) test vm I restarted from scratch. I can confirm that the chars look all fine within the db, so no problem here :) unfortunately I'm stuck anyway with a black loading screen when starting a quick 7 questions game. and the only log in apache error_log is again PHP Warning: file_get_contents(/sess_ophgvumc521uprbr7fl820odbp): failed to open stream: No such file or directory in /srv/http/ydkjs/api/common.inc.php on line 10, referer: http://atest.lan/ydkjs/alpha.php (which even is a warning and no error and therefore shouldn't be fatal, right). I guess I'll have to find out why sessions files aren't written here :) have a nice sunday!

frostworx commented 5 years ago

now I set the session.save_path to session.save_path = "/var/lib/php/sessions" in /etc/php/php.ini and changed the permissions and added for testing $save_path = ini_get('session.save_path'); echo 'alpha session save_path: ', $save_path; before session_start(); in alpha.php the path is correct now (no idea why it didn't accept /tmp/http/ before) and the session files are written. they are probably also read, because the error_log stays silent, but I'm stuck at a black screen anyway grml

Mwyann commented 5 years ago

Have a look at the JS console when you start a game, and also Apache logs, if any error shows up.

frostworx commented 5 years ago

wow, you're fast! I already did so: both apache access_log and network console complain about a missing /ydkjs/api/get.php?uid=LONGRANDOMUID"

Mwyann commented 5 years ago

Do you have a Skype account or any chat for example, so we could discuss it in real time, faster? (my Skype ID is the same than my GitHub)

frostworx commented 5 years ago

I don't have skype, but we could meet on irc if you like. just entered #ydkjs on freenode :)

frostworx commented 5 years ago

could it be possible that filenames are case-sensitive and therefore the generated url in uriToUid points to 404? at least in api/index.php there is for example "res-full/30TIMER" but my dir is "res-full/30timer" and looks like all paths in the db (at least the first directory) is always uppercase

Mwyann commented 5 years ago

Yes, all files are case-sensitive. That may totally be the reason why it doesn't work :)

frostworx commented 5 years ago

YES! it was casesensitive!

frostworx commented 5 years ago

hehe, same time reply su -s /bin/sh http -c './symlup.sh'

cat symlup.sh

!/bin/bash

for dir in $(find . -type d -maxdepth 1 ); do ln -s $dir $(echo $dir | awk '{ print toupper($0) }') ;done

works for me :)

frostworx commented 5 years ago

thank you very much for your friendly help! do you accept some donation f.e. via paypal?

Mwyann commented 5 years ago

I don't accept donations for those reasons:

frostworx commented 5 years ago

thank you very very much! :) yeah, I really hope we get native language in future games! Jackbox Games rock! they ported all of their party packs to linux! :)

frostworx commented 5 years ago

thank you for your friendly help also on irc. with fixing the case-sensitive directory names (QFOLD dirs to qfold and GROOVES/grooveXX to GROOVES/GROOVEXX) the game worked fine to the end :)

frostworx commented 5 years ago

your irc connection just timeouted. in case you haven't seen my suggestions for the readme anymore just tell me :)

Mwyann commented 5 years ago

Yes please paste your suggestions here :) Thanks!

frostworx commented 5 years ago

your README was working mostly ootb, but maybe following changes are useful: you might want to add a hint regarding the session.save_path variable to the readme (the path to the php config should be adjusted to ubuntu to avoid distro hopping in the readme :))

ydkjs saves sessions files on the server using the php "session.save_path" variable. depending on your distribution "session.save_path" isn't defined in your php installation. on arch linux you can set it in /etc/php/php.ini ( f.e. session.save_path = "/var/lib/php/sessions" ) make sure the path exists and your web-browser user has read/write access to it.

maybe the GETsalt variable should be explained a bit. I'm pretty sure you can do that better than me :)

it should be mentioned somewhere that the filenames of the extracted files are case-sensitive :)

apart from that the readme works ootb. I found a funny bug/easteregg btw: in the jackattack I rapidly hit my player button as fast as possible. my final score was 326000 ;) looks like I inverted an integer :)

Pokefinder-org commented 2 years ago

Not sure what help other than the comments given here is still required. Indeed the instructions work pretty straight ahead. Mainly problems arised from case sensitivity and a clear version statement on my side. The database you supply for "de1" (german) has "You Don't Know Jack Volume 1" data (of course). Even when fixing filenames, etc. "Volume 2" will not work (yet). (That got me first. :) )

The extractor/.srf file format could use some explanation or the (always same) results should be descibed/verified. Had to run it twice to get the full Volume 1 extraction e.g. - hashes/filesizes of the resulting csv files would come to mind. So, my german "Volume 1" has: md5sum *.csv 407cac95e0814fc554f46dc8aec37ef5 qhdr.csv 5214a8344104d5644cb11ee94c9870fb strings.csv

The easter egg doesn't seem to be there. My top negative JackAttack ended at -DM3197000. Maybe the minus sign was overseen? :)

Would be great to have the HTML/PHP stuff from the english (and german) site as well. Translating with google is no fun :)