itstehkman / n64docker

Nintendo 64 server in docker
Do What The F*ck You Want To Public License
12 stars 5 forks source link

out of the box errors #1

Closed dbiscan closed 8 months ago

dbiscan commented 4 years ago

20:21:29 david@Centos:~/Downloads/n64docker-master $make build expr: syntax error expr: syntax error ruby util/gentranslation.rb > config/keysym-translation.json util/gentranslation.rb:10: syntax error, unexpected ':', expecting => "w": {"sdl_keycode": 0x77, "x11_keysym": 0x77}, ^ util/gentranslation.rb:10: syntax error, unexpected ':', expecting => "w": {"sdl_keycode": 0x77, "x11_keysym": 0x77}, ^ make: *** [mupen-config] Error 1

Can you elaborate on the method you used to create the files? Or possibly the requirements since probably no one has the exact same setup/libraries you have installed?

Thanks in advance.

itstehkman commented 4 years ago

Hey @dbiscan it's been a while since I've worked on this, let me take a look. Seems like a ruby versioning error, where the current syntax works with the version I had of ruby locally, and probably not for yours.

itstehkman commented 4 years ago

What is your ruby version? Take a look at https://stackoverflow.com/a/8675314, you can see that this syntax is supported in Ruby 2.2+:

hash = { 'key': 'value' }

which is what the util/gentranslation.rb uses.

Excited to see somebody else using this repo! I hope it works out for you.

dbiscan commented 4 years ago

Hey Kareem, I'm running

ruby 2.0.0p648 (2015-12-16) [x86_64-linux]

I'm on centos 7 currently but I can spin this up in a vm. So a requirement is ruby 2.2+?

Also, thanks for getting back to me. I was banging my head against the wall trying to get this working. I have a grade school buddy in Florida and I wanted to make him some N64 emulators he could either vpn or http-browse to for his birthday because we were talking about the old days and how fun N64 was.

-David

itstehkman commented 4 years ago

@dbiscan that sounds like fun! One issue you may hit is latency depending on where you run the n64 server. I would recommend running it on your local network with your buddy. I have tried running it in AWS within California (where I live) and it was somewhat playable but the lag was noticeable.

Yes you have two solutions:

1) Use ruby 2.2+ 2) Edit util/gentranslation.rb to use ruby hash rockets instead of colons. I generated this locally with :%s/:/=>/g

original_keys = {
  "w"=> {"sdl_keycode"=> 0x77, "x11_keysym"=> 0x77},
  "a"=> {"sdl_keycode"=> 0x61, "x11_keysym"=> 0x61},
  "s"=> {"sdl_keycode"=> 0x73, "x11_keysym"=> 0x73},
  "d"=> {"sdl_keycode"=> 0x64, "x11_keysym"=> 0x64},
  "i"=> {"sdl_keycode"=> 0x69, "x11_keysym"=> 0x69},
  "j"=> {"sdl_keycode"=> 0x6a, "x11_keysym"=> 0x6a},
  "k"=> {"sdl_keycode"=> 0x6b, "x11_keysym"=> 0x6b},
  "l"=> {"sdl_keycode"=> 0x6c, "x11_keysym"=> 0x6c},
  "z"=> {"sdl_keycode"=> 0x7a, "x11_keysym"=> 0x7a},
  "x"=> {"sdl_keycode"=> 0x78, "x11_keysym"=> 0x78},
  "c"=> {"sdl_keycode"=> 0x63, "x11_keysym"=> 0x63},
  "lshift"=> {"sdl_keycode"=> 0x130, "x11_keysym"=> 0xffe1},
  "lctrl"=> {"sdl_keycode"=> 0x132, "x11_keysym"=> 0xffe3},
  "up"=> {"sdl_keycode"=> 0x111, "x11_keysym"=> 0xff52},
  "down"=> {"sdl_keycode"=> 0x112, "x11_keysym"=> 0xff54},
  "left"=> {"sdl_keycode"=> 0x114, "x11_keysym"=> 0xff51},
  "right"=> {"sdl_keycode"=> 0x113, "x11_keysym"=> 0xff53},
  "enter"=> {"sdl_keycode"=> 0xd, "x11_keysym"=> 0xff0d},
}
dbiscan commented 4 years ago

great. Thanks man. I'll try it out today. I'm in CA too btw, San Diego specifically. I hope you had a good halloween and stayed safe! Thanks again!