You might have to change the directories in the server code.
|
I hope theres a linux user here that can help.
Due to a few events i am now stuck with running my popular server on Linux (used to be runned on XP) Anyways, i got linux working and i got the server working, people can log in and all that, but my problem is that i think linux has a problem with java going into folders and receiving data. I Can not get it to load or save any files, nor load .cfg files which are all in folders.
My Code is correct on how to load out of these folders cause like i said it worked with XP.
Is there a thing i need to change to it allows it to read from the folder it needs or what is necessary?
Any help is perfect, Thanks,
-Chi kitory
You might have to change the directories in the server code.
Which i thought of, but the thing is / is root, would that mess things up?
heres what my code looks like:
wouldnt "./SavedGames" be enough for this to work?PlayerSave tempPlayer;
try {
ObjectInputStream in = new ObjectInputStream(new FileInputStream("./SavedGames"+playerName+".dat"));
tempPlayer = (PlayerSave)in.readObject();
in.close();
}
catch(Exception e){
return null;
}
return tempPlayer;
or would i have to do /home/server/SaveGames?
i already tried that and it did not work....
Assuming your server is in your home dir and the folder SavedGames is in the server dir.ObjectInputStream in = new ObjectInputStream(new FileInputStream("~/server/SavedGames"+playerName+".dat"));
EDIT: I think thats it anyway.
Okay i tried this:
ObjectInputStream in = new ObjectInputStream(new FileInputStream("~/chikitory/vico/SavedGames"+playerName+".dat"));
Then this:
bjectInputStream in = new ObjectInputStream(new FileInputStream("~/vico/SavedGames"+playerName+".dat"));
tried serveral otherthings as well.
No luck. is it cause of .dat?
Well no cause .cfg dont work as well.. :/
it might just be the folder names cause my config folder was called CFG and it didnt load the config files but then i changed it to cfg and it worked fine.
Edit: Try changing "SavedGames" to "savedgames"
I was using ubuntu 9.10 but im on windows 7 atm..
Im talking about my config folder.. it was called "CFG" and it didnt work so i changed it to "cfg" and it worked fine.
mint is based on ubuntu so it will be fine..
So you've turned this..
Into this?ObjectInputStream in = new ObjectInputStream(new FileInputStream("./SavedGames"+playerName+".dat"));
OrObjectInputStream in = new ObjectInputStream(new FileInputStream("/home/server/SavedGames"+playerName+".dat"));
(Both the same)ObjectInputStream in = new ObjectInputStream(new FileInputStream("~/server/SavedGames"+playerName+".dat"));
Ooooo i might know what the problem is.. the .dat part means /dat
Try removing the .dat part so its like this..
Or somthing like that.ObjectInputStream in = new ObjectInputStream(new FileInputStream("~/server/SavedGames"+playerName));
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |