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

MAMEHub can't be launched outside of the same folder in Linux #372

Open
Kurolox opened this issue Mar 1, 2016 · 5 comments
Open

MAMEHub can't be launched outside of the same folder in Linux #372

Kurolox opened this issue Mar 1, 2016 · 5 comments

Comments

@Kurolox
Copy link

Kurolox commented Mar 1, 2016

Using Arch Linux 4.4.1-2. When executing the .sh file outside of the folder where it's placed it throws an error. Here's an example.

I executed this from my desktop (It doesn't work):

[kuro@ArchKuro ~]$ /home/kuro/.MAMEHub/MAMEHub.sh
--2016-03-01 22:17:33--  http://10ghost.net/MAMEHubDownloads/Frontend/MAMEHubClient.jar
Resolving 10ghost.net (10ghost.net)... 66.85.171.210
Connecting to 10ghost.net (10ghost.net)|66.85.171.210|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 39647727 (38M) [application/java-archive]
Server file no newer than local file ‘MAMEHubRepo/Binaries/dist/MAMEHubClient.jar’ -- not retrieving.

~/MAMEHubRepo/Binaries/dist ~
SOUND FILE: /sounds/ding.wav
SOUND FILE: /sounds/gamestart.wav
SOUND FILE: /sounds/gamestop.wav
SOUND FILE: /sounds/playerjoin.wav
SOUND FILE: /sounds/startup.wav
Exception in thread "main" java.io.FileNotFoundException: Source 'ume.ini.unix' does not exist
    at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1074)
    at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1038)
    at com.mamehub.client.MAMEHub.main(MAMEHub.java:91)
[kuro@ArchKuro ~]$ 

This is also from my desktop, but this time I cd into the folder before executing the .sh. This time it works.

[kuro@ArchKuro ~]$ cd /home/kuro/.MAMEHub/ && ./MAMEHub.sh
--2016-03-01 22:18:28--  http://10ghost.net/MAMEHubDownloads/Frontend/MAMEHubClient.jar
Resolving 10ghost.net (10ghost.net)... 66.85.171.210
Connecting to 10ghost.net (10ghost.net)|66.85.171.210|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 39647727 (38M) [application/java-archive]
Server file no newer than local file ‘MAMEHubRepo/Binaries/dist/MAMEHubClient.jar’ -- not retrieving.

~/.MAMEHub/MAMEHubRepo/Binaries/dist ~/.MAMEHub
SOUND FILE: /sounds/ding.wav
SOUND FILE: /sounds/gamestart.wav
SOUND FILE: /sounds/gamestop.wav
SOUND FILE: /sounds/playerjoin.wav
SOUND FILE: /sounds/startup.wav
Creating server...
[22:18:29,135  INFO PortOpener.java:153] ONE HOST IP ADDRESS IS 192.168.1.33
[22:18:29,137  INFO PortOpener.java:157] FORWARDING PORTS: 6805 AND 6805
Creating server...
[22:18:29,138  INFO PortOpener.java:174] Starting Cling...
Starting server
Starting server
[22:18:29,174  INFO Server.java:254] jetty-8.0.y.z-SNAPSHOT
[22:18:29,174  INFO Server.java:254] jetty-8.0.y.z-SNAPSHOT
[22:18:29,221  INFO AbstractConnector.java:333] Started [email protected]:6805
Blocking until shutdown
[22:18:29,221  INFO AbstractConnector.java:333] Started [email protected]:8914
Blocking until shutdown
[22:18:29,300  INFO UDPReflectionServer.java:30] SERVER: Waiting for packet
[22:18:29,316  INFO LoginDialog.java:104] Adding intro dialog

Just a minor bug, but It's really annoying because I can't make a working .desktop file properly.

@MisterTea
Copy link
Owner

You can change the sh file to cd to the directory containing the sh file
before starting MAMEHub. Can you submit a pull request with this change?
On Tue, Mar 1, 2016 at 1:28 PM Kurolox [email protected] wrote:

Using Arch Linux 4.4.1-2. When executing the .sh file outside of the
folder where it's placed it throws an error. Here's an example.

I executed this from my desktop (It doesn't work):

[kuro@ArchKuro ~]$ /home/kuro/.MAMEHub/MAMEHub.sh
--2016-03-01 22:17:33-- http://10ghost.net/MAMEHubDownloads/Frontend/MAMEHubClient.jar
Resolving 10ghost.net (10ghost.net)... 66.85.171.210
Connecting to 10ghost.net (10ghost.net)|66.85.171.210|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 39647727 (38M) [application/java-archive]
Server file no newer than local file ‘MAMEHubRepo/Binaries/dist/MAMEHubClient.jar’ -- not retrieving.

~/MAMEHubRepo/Binaries/dist ~
SOUND FILE: /sounds/ding.wav
SOUND FILE: /sounds/gamestart.wav
SOUND FILE: /sounds/gamestop.wav
SOUND FILE: /sounds/playerjoin.wav
SOUND FILE: /sounds/startup.wav
Exception in thread "main" java.io.FileNotFoundException: Source 'ume.ini.unix' does not exist
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1074)
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1038)
at com.mamehub.client.MAMEHub.main(MAMEHub.java:91)
[kuro@ArchKuro ~]$

This is also from my desktop, but this time I cd into the folder before
executing the .sh. This time it works.

[kuro@ArchKuro ~]$ cd /home/kuro/.MAMEHub/ && ./MAMEHub.sh
--2016-03-01 22:18:28-- http://10ghost.net/MAMEHubDownloads/Frontend/MAMEHubClient.jar
Resolving 10ghost.net (10ghost.net)... 66.85.171.210
Connecting to 10ghost.net (10ghost.net)|66.85.171.210|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 39647727 (38M) [application/java-archive]
Server file no newer than local file ‘MAMEHubRepo/Binaries/dist/MAMEHubClient.jar’ -- not retrieving.

~/.MAMEHub/MAMEHubRepo/Binaries/dist ~/.MAMEHub
SOUND FILE: /sounds/ding.wav
SOUND FILE: /sounds/gamestart.wav
SOUND FILE: /sounds/gamestop.wav
SOUND FILE: /sounds/playerjoin.wav
SOUND FILE: /sounds/startup.wav
Creating server...
[22:18:29,135 INFO PortOpener.java:153] ONE HOST IP ADDRESS IS 192.168.1.33
[22:18:29,137 INFO PortOpener.java:157] FORWARDING PORTS: 6805 AND 6805
Creating server...
[22:18:29,138 INFO PortOpener.java:174] Starting Cling...
Starting server
Starting server
[22:18:29,174 INFO Server.java:254] jetty-8.0.y.z-SNAPSHOT
[22:18:29,174 INFO Server.java:254] jetty-8.0.y.z-SNAPSHOT
[22:18:29,221 INFO AbstractConnector.java:333] Started [email protected]:6805
Blocking until shutdown
[22:18:29,221 INFO AbstractConnector.java:333] Started [email protected]:8914
Blocking until shutdown
[22:18:29,300 INFO UDPReflectionServer.java:30] SERVER: Waiting for packet
[22:18:29,316 INFO LoginDialog.java:104] Adding intro dialog

Just a minor bug, but It's really annoying because I can't make a working
.desktop file properly.


Reply to this email directly or view it on GitHub
#372.

@Kurolox
Copy link
Author

Kurolox commented Mar 1, 2016

I would love to do it, but I don't have the knowledge. Since I know where I placed my folder and how It's called I can cd to it editing the .sh file, but I can't do anything that would work system-wide regardless of the name of the folder and the location.

I apologize for it. At least I can confirm that if you cd to the directory editing the .sh file it works properly.

@MisterTea
Copy link
Owner

Here's the knowledge:
http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in

You can use that one-liner to get the directory of the sh file regardless
of how you call it. Please submit a pull request with the fix, thanks!

On Tue, Mar 1, 2016 at 1:50 PM Kurolox [email protected] wrote:

I would love to do it, but I don't have the knowledge. Since I know where
I placed my folder and how It's called I can cd to it editing the .sh file,
but I can't do anything that would work system-wide regardless of the name
of the folder and the location.

I apologize for it.


Reply to this email directly or view it on GitHub
#372 (comment).

@Kurolox
Copy link
Author

Kurolox commented Mar 1, 2016

I just googled it for the last 15 minutes and you found it in 30 seconds or so. I'm impressed. I'll submit the fix tomorrow. Here is a bit late and I should sleep a bit.

@Jaku2k
Copy link
Contributor

Jaku2k commented Mar 28, 2016

you can use this script http://pastebin.com/CPEK2bvS

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

No branches or pull requests

3 participants