Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

howto install #1

Open
frostworx opened this issue Jan 10, 2019 · 35 comments
Open

howto install #1

frostworx opened this issue Jan 10, 2019 · 35 comments
Assignees

Comments

@frostworx
Copy link

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:

  • created a mysql db,a user and pass and adjusted his privileges on the db.
  • filled the db with the provided german sql schema
  • edited api/local/mysql-data.inc.php local/mysql-data.inc.php toolbox/mysql-data.inc.php
    with those credentials (no idea if those are all required), which works
  • launched the YDKJ.exe (works with wine, I'm on linux) and extracted/converted all files from my german cd into a "res" directory which I put into the html subdirectory.
  • enabled required php modules in apache

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:

  • login prompt with random user/pass leads to PHP Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ydkj.accounts' doesn't exist
  • selecting quick 1 player game: PHP Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ydkj.errors' doesn't exist
  • join session: PHP Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ydkj.players'

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
Copy link
Owner

Mwyann commented Jan 11, 2019

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 :)

@Mwyann Mwyann self-assigned this Jan 11, 2019
@frostworx
Copy link
Author

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
Copy link
Owner

Mwyann commented Jan 21, 2019

@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
Copy link
Author

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

@frostworx
Copy link
Author

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
Copy link
Author

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

@Mwyann
Copy link
Owner

Mwyann commented Jan 22, 2019

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
Copy link
Author

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
Copy link
Owner

Mwyann commented Jan 22, 2019

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
Copy link
Author

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
Copy link
Owner

Mwyann commented Jan 22, 2019

½ 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
Copy link
Author

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
Copy link
Owner

Mwyann commented Jan 24, 2019

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
Copy link
Author

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:
session_start(): 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
Copy link
Author

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
Copy link
Owner

Mwyann commented Jan 27, 2019

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

Mwyann commented Jan 27, 2019

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

@frostworx
Copy link
Author

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
Copy link
Owner

Mwyann commented Jan 27, 2019

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
Copy link
Author

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

@frostworx
Copy link
Author

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
Copy link
Owner

Mwyann commented Jan 27, 2019

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

@frostworx
Copy link
Author

YES! it was casesensitive!

@frostworx
Copy link
Author

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
Copy link
Author

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

@Mwyann
Copy link
Owner

Mwyann commented Jan 27, 2019

I don't accept donations for those reasons:

  • I don't want to "make money" with this project - Jackbox Games may not like it and I don't want to take the risk.
  • I don't want to be liable to the people who donate to me.
  • I clearly don't work "enough" on this project to pretend to receive money for it. It's a long-term passion project that may take ages to finish, so there's no reason to get anything more than kind words from fans.
  • Best reward for me would be if Jackbox Games decides to do something about YDKJ for us French, German or UK people :)

@frostworx
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@Mwyann
Copy link
Owner

Mwyann commented Jan 27, 2019

Yes please paste your suggestions here :) Thanks!

@frostworx
Copy link
Author

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
Copy link

Pokefinder-org commented Apr 3, 2022

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants