Jump to content

Recommended Posts

Posted

Λοιπόν αυτός ο οδηγός, είναι αποκλειστικά δικός μου για το συγκεκριμένο forum.

ΟΚ ας αρχίσουμε.

 

Ανοίγουμε το eclipse και πηγαίνουμε στο αρχείο Config.java που βρίσκετε στο : net.sf.l2j

 

Έπειτα πατάμε ctrl(control) + F και ψάχνουμε για την εξής line.

 

 public static final String  L2JMOD_CONFIG_FILE            = "./config/l2jmods.properties";

 

ακριβός κάτω απο αυτήν την γραμμή, προσθέτουμε την δική μας γραμμή .

 

    public static final String  NAME_CONFIG_FILE            = "./config/name.properties";

 

Συνεχίζοντας, ψάχνουμε για :

  catch (Exception e)
            {
                e.printStackTrace();
                throw new Error("Failed to Load "+L2JMOD_CONFIG_FILE+" File.");
            }

 

Και ακριβός κάτω απο αυτό, προσθέτουμε :

 

try

            {

                Properties name  = new Properties();

                InputStream is          = new FileInputStream(new File(NAME_CONFIG_FILE));

                name.load(is);

                is.close();

//** Αντικαθιστάτε αυτό εδώ με τα Config σας. */

 

 

            catch (Exception e)

            {

                e.printStackTrace();

                throw new Error("Failed to Load "+NAME_CONFIG_FILE+" File.");

            }

 

Τέλος, φτιάχνουμε αρχείο με το όνομα που θέλουμε(στο δικό μου παράδειγμα, ειναι name.properties)

Και ναι.. έχουμε το δικό μας .property αρχείο τώρα !!!

 


 

Τώρα ας αναλύσουμε λίγο τον κώδικα μας σειρά προς σειρά σε 3 απλά βήματα.

 

1)    public static final String  NAME_CONFIG_FILE            = "./config/name.properties";

Αυτή η σειρά, κάνει το αρχείο μας έγκυρο και συνοδεύει στον φάκελο που βρίσκετε .

 

2)

try
            {
                Properties name  = new Properties();
                InputStream is          = new FileInputStream(new File(NAME_CONFIG_FILE));
                name.load(is);
                is.close(); 

 

Αυτό εδώ, είναι η αρχή της φόρτωσης των σειρών που έχουμε μέσα στο .property αρχείο μας.Είναι δηλαδή κάτι σαν επαλήθευση του .propertie αρχείου μας.

 

3)

catch (Exception e)
            {
                e.printStackTrace();
                throw new Error("Failed to Load "+NAME_CONFIG_FILE+" File.");
            }

 

Αυτό εδώ λοιπόν, εκτός από το κλείσιμο του κώδικα μας, μας ενημερώνει μέσω της κονσόλας GameServer αν υπάρχει κάποιο πρόβλημα στον κώδικα ή το αρχείο μας.

 

 

P.S: όπου έχω με κόκκινο χρώμα το ΝΑΜΕ/name βάζετε ότι όνομα θέλετε...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • What is the reason for this new behavior where people criticize other users' posts? Do they think people are naive? Here everyone understands and everyone knows who's who. Focus on your work and be happy!    Lately, all they do is criticize anyone who posts anything; it's pure spam. Are they just looking for fame?  
    • Of course, bro So he writes to the admin: “Remove reactions because Skylord talks too much and says things that will make me lose clients.” And boom.. Maxor removes the reactions. Then he says: “Close my topics because too much nonsense is being written on my server.” And boom... the topics get closed. Bro, what century are we living in? People are not stupid. Just think for a second. Of course I won’t be able to fix anything like this. But at the same time, everyone here acts like they’re so great. They write their projects here, selling things for $5k–$10k  but in reality these fools just can’t find clients, so they spam nonsense and pretend they’re some huge professionals selling “super professional” files. From this point on, I can confirm that I will no longer be writing comments, replying to topics, or saying anything about anyone here. Honestly, I no longer care about the people on this forum who are trying to sell things, make a quick $100, and pretend to be something they are not. Many of these so-called “projects” and “official files” turn out to be fake, copied, or misleading. And let’s be honest this is not something new. There have been situations in the past where people asked me for help, copied things from my test servers, took my scripts or folders, and then tried to present them as their own official work. This kind of behavior should be visible to everyone. I am addressing the administration of this forum directly: these things should not be hidden. You should not be deleting posts, closing topics, removing replies, or covering up the truth just because someone is exposing what is actually happening. What kind of community are you building if the truth is constantly being hidden? For years, posts have been removed, topics have been closed, and replies have disappeared just because people said something uncomfortable. That is honestly sad. This is my final message. I no longer care what happens with this forum. Ban me if you want, remove my posts if you want, do whatever you want. I am done here.   I said what I had to say. @Maxtor    
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..