Thread: Help with Running Server [Linux]

Page 1 of 3 123 LastLast
Results 1 to 10 of 28
  1. #1 Help with Running Server [Linux] 
    Registered Member
    Join Date
    Aug 2009
    Posts
    143
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    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



    Reply With Quote  
     

  2. #2  
    isAwesome = true;
    Typhoeus's Avatar
    Join Date
    Nov 2008
    Posts
    815
    Thanks given
    18
    Thanks received
    13
    Rep Power
    246
    You might have to change the directories in the server code.
    Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction.
    - Albert Einstein

    It is one thing to show a man that he is in an error, and another to put him in possession of the truth.
    - John Locke
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2009
    Posts
    143
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    Which i thought of, but the thing is / is root, would that mess things up?
    heres what my code looks like:

    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;
    wouldnt "./SavedGames" be enough for this to work?
    or would i have to do /home/server/SaveGames?
    i already tried that and it did not work....



    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Aug 2008
    Posts
    918
    Thanks given
    1
    Thanks received
    12
    Rep Power
    34
    ObjectInputStream in = new ObjectInputStream(new FileInputStream("~/server/SavedGames"+playerName+".dat"));
    Assuming your server is in your home dir and the folder SavedGames is in the server dir.

    EDIT: I think thats it anyway.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Aug 2009
    Posts
    143
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    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.. :/



    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Aug 2008
    Posts
    918
    Thanks given
    1
    Thanks received
    12
    Rep Power
    34
    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"
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Aug 2009
    Posts
    143
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    yeah but all my .cfg's are all lower cased.
    Which linux are you using?



    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Aug 2008
    Posts
    918
    Thanks given
    1
    Thanks received
    12
    Rep Power
    34
    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.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Aug 2009
    Posts
    143
    Thanks given
    3
    Thanks received
    0
    Rep Power
    1
    yeah i changed SavedGames to savedgames nothing happened....
    Guhhh.. why are thinks so hard all the time?
    im using mintlinux

    edit: my cfg folder is called config with no caps, and i never changed it so i know its not that. Do you think its the client im using?
    its czar...



    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Aug 2008
    Posts
    918
    Thanks given
    1
    Thanks received
    12
    Rep Power
    34
    mint is based on ubuntu so it will be fine..
    So you've turned this..
    ObjectInputStream in = new ObjectInputStream(new FileInputStream("./SavedGames"+playerName+".dat"));
    Into this?

    ObjectInputStream in = new ObjectInputStream(new FileInputStream("/home/server/SavedGames"+playerName+".dat"));
    Or
    ObjectInputStream in = new ObjectInputStream(new FileInputStream("~/server/SavedGames"+playerName+".dat"));
    (Both the same)


    Ooooo i might know what the problem is.. the .dat part means /dat

    Try removing the .dat part so its like this..
    ObjectInputStream in = new ObjectInputStream(new FileInputStream("~/server/SavedGames"+playerName));
    Or somthing like that.
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •