file_id
int64 1
250k
| content
stringlengths 0
562k
| repo
stringlengths 6
115
| path
stringlengths 1
147
|
---|---|---|---|
248,928 | /*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package model;
/**
*
* @author Sofiane
*/
public class Admin {
private int id;
private String nom;
private String prenom;
private String login;
private String mdp;
private Groupe groupe;
private Membre membre;
private Jury jury;
private Festival festival;
private LieuConcert lieuConcert;
private Dispositif dispositif;
private Titre titre;
private Album album;
private Genre genre;
private Instrument instrument;
private Statut statut;
private Utilisateur utilisateur;
private Partenaire partenaire;
public Admin() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getMdp() {
return mdp;
}
public void setMdp(String mdp) {
this.mdp = mdp;
}
public Groupe getGroupe() {
return groupe;
}
public void setGroupe(Groupe groupe) {
this.groupe = groupe;
}
public Membre getMembre() {
return membre;
}
public void setMembre(Membre membre) {
this.membre = membre;
}
public Jury getJury() {
return jury;
}
public void setJury(Jury jury) {
this.jury = jury;
}
public Festival getFestival() {
return festival;
}
public void setFestival(Festival festival) {
this.festival = festival;
}
public LieuConcert getLieuConcert() {
return lieuConcert;
}
public void setLieuConcert(LieuConcert lieuConcert) {
this.lieuConcert = lieuConcert;
}
public Dispositif getDispositif() {
return dispositif;
}
public void setDispositif(Dispositif dispositif) {
this.dispositif = dispositif;
}
public Titre getTitre() {
return titre;
}
public void setTitre(Titre titre) {
this.titre = titre;
}
public Album getAlbum() {
return album;
}
public void setAlbum(Album album) {
this.album = album;
}
public Genre getGenre() {
return genre;
}
public void setGenre(Genre genre) {
this.genre = genre;
}
public Instrument getInstrument() {
return instrument;
}
public void setInstrument(Instrument instrument) {
this.instrument = instrument;
}
public Statut getStatut() {
return statut;
}
public void setStatut(Statut statut) {
this.statut = statut;
}
public Utilisateur getUtilisateur() {
return utilisateur;
}
public void setUtilisateur(Utilisateur utilisateur) {
this.utilisateur = utilisateur;
}
public Partenaire getPartenaire() {
return partenaire;
}
public void setPartenaire(Partenaire partenaire) {
this.partenaire = partenaire;
}
}
| ZakinaA/22STATIC | src/main/java/model/Admin.java |
248,929 | /*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package model;
import java.util.ArrayList;
/**
*
* @author Zakina
*/
public class Groupe {
private int id;
private String nom;
private String dateCreation;
private String telephone;
private String mail;
private String siteWeb;
private String lieuRepetition;
private int estSelectionne;
private Genre genre ;
private Dispositif dispositif;
private Festival festival;
private ArrayList<Titre> lesTitres;
private ArrayList<Membre> lesMembres;
private Membre leMembreContact;
private ArrayList<Dispositif> lesDispositifs;
private ArrayList<Concert> lesConcerts;
private ArrayList<Festival> lesFestivals;
public Groupe() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getDateCreation() {
return dateCreation;
}
public void setDateCreation(String dateCreation) {
this.dateCreation = dateCreation;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getSiteWeb() {
return siteWeb;
}
public void setSiteWeb(String siteWeb) {
this.siteWeb = siteWeb;
}
public String getLieuRepetition() {
return lieuRepetition;
}
public void setLieuRepetition(String lieuRepetition) {
this.lieuRepetition = lieuRepetition;
}
public int getEstSelectionne() {
return estSelectionne;
}
public void setEstSelectionne(int estSelectionne) {
this.estSelectionne = estSelectionne;
}
public Genre getGenre() {
return genre;
}
public void setGenre(Genre genre) {
this.genre = genre;
}
public Dispositif getDispositif() {
return dispositif;
}
public void setDispositif(Dispositif dispositif) {
this.dispositif = dispositif;
}
public ArrayList<Titre> getLesTitres() {
return lesTitres;
}
public void setLesTitres(ArrayList<Titre> lesTitres) {
this.lesTitres = lesTitres;
}
public void addUnTitre(Titre unTitre){
if (lesTitres == null){
lesTitres = new ArrayList<>();
}
lesTitres.add(unTitre);
}
public ArrayList<Membre> getLesMembres() {
return lesMembres;
}
public void setLesMembres(ArrayList<Membre> lesMembres) {
this.lesMembres = lesMembres;
}
public void addUnMembre(Membre unMembre){
if (lesMembres == null){
lesMembres = new ArrayList<>();
}
lesMembres.add(unMembre);
}
public Membre getLeMembreContact() {
return leMembreContact;
}
public void setLeMembreContact(Membre leMembreContact) {
this.leMembreContact = leMembreContact;
}
public ArrayList<Concert> getLesConcerts() {
return lesConcerts;
}
public void setLesConcerts(ArrayList<Concert> lesConcerts) {
this.lesConcerts = lesConcerts;
}
public void addUnConcert(Concert unConcert){
if (lesConcerts == null){
lesConcerts = new ArrayList<>();
}
lesConcerts.add(unConcert);
}
public String getMail() {
return mail;
}
public void setMail(String mail) {
this.mail = mail;
}
public Festival getFestival() {
return festival;
}
public void setFestival(Festival festival) {
this.festival = festival;
}
public ArrayList<Festival> getLesFestivals() {
return lesFestivals;
}
public void setLesFestivals(ArrayList<Festival> lesFestivals) {
this.lesFestivals = lesFestivals;
}
public void addUnFestival(Festival unFestival){
if (lesFestivals == null){
lesFestivals = new ArrayList<>();
}
lesFestivals.add(unFestival);
}
public ArrayList<Dispositif> getLesDispositifs() {
return lesDispositifs;
}
public void setLesDispositifs(ArrayList<Dispositif> lesDispositifs) {
this.lesDispositifs = lesDispositifs;
}
}
| ZakinaA/22CAFEL | src/main/java/model/Groupe.java |
248,930 | package tb;
import cn.damai.common.AppConfig;
import com.android.alibaba.ip.runtime.AndroidInstantRuntime;
import com.android.alibaba.ip.runtime.IpChange;
/* compiled from: Taobao */
public class vz2 {
private static transient /* synthetic */ IpChange $ipChange = null;
public static final String BRANCH_DRAMA = "drama_home";
public static final String BRANCH_MUSIC = "music_festival";
public static final String BRANCH_WEB = "web_fragment";
public static final String BRANCH_WEB_URL_APPEND_ERROR_CODE = "-4700";
public static final String BRANCH_WEB_URL_APPEND_ERROR_MSG = "url拼接异常";
public static final String DRAMA_HOME_API_ERROR_CODE = "-4600";
public static final String DRAMA_HOME_API_ERROR_MSG = "话剧音乐剧组件化接口异常";
public static final String MUSIC_FESTIVAL_API_ERROR_CODE = "-4500";
public static final String MUSIC_FESTIVAL_API_ERROR_MSG = "音乐节首页组件化接口异常";
public static String a(String str, String str2, String str3, String str4) {
IpChange ipChange = $ipChange;
if (AndroidInstantRuntime.support(ipChange, "688480970")) {
return (String) ipChange.ipc$dispatch("688480970", new Object[]{str, str2, str3, str4});
}
return str + ":jsondata={apiName:" + str2 + ",appVersion:" + AppConfig.q() + ",retCode:" + str3 + ",retMsg:" + str4 + "}";
}
public static void b(String str, String str2, String str3) {
IpChange ipChange = $ipChange;
if (AndroidInstantRuntime.support(ipChange, "-118219071")) {
ipChange.ipc$dispatch("-118219071", new Object[]{str, str2, str3});
return;
}
yz2.a(a(BRANCH_WEB, str, str2, str3), BRANCH_WEB_URL_APPEND_ERROR_CODE, BRANCH_WEB_URL_APPEND_ERROR_MSG);
}
public static void c(String str, String str2, String str3) {
IpChange ipChange = $ipChange;
if (AndroidInstantRuntime.support(ipChange, "1852348990")) {
ipChange.ipc$dispatch("1852348990", new Object[]{str, str2, str3});
return;
}
yz2.a(a(BRANCH_DRAMA, str, str2, str3), DRAMA_HOME_API_ERROR_CODE, DRAMA_HOME_API_ERROR_MSG);
}
public static void d(String str, String str2, String str3) {
IpChange ipChange = $ipChange;
if (AndroidInstantRuntime.support(ipChange, "1051702983")) {
ipChange.ipc$dispatch("1051702983", new Object[]{str, str2, str3});
return;
}
yz2.a(a("music_festival", str, str2, str3), MUSIC_FESTIVAL_API_ERROR_CODE, MUSIC_FESTIVAL_API_ERROR_MSG);
}
}
| thefuckingcode/damai | source-code/tb/vz2.java |
248,931 | package d13;
import java.net.URLEncoder;
import java.util.List;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import d13.dao.DueCalculator.Tier;
public class ThisYear {
public static final int CAMP_YEAR = 2017;
public static final String CAMP_NAME = "DISOR1E7T";
public static final String SYSTEM_VERSION = "v1.24";
public static final String CSS_VERSION;
public static final DateTime PLAYA_MONDAY = new DateTime(2017, 8, 28, 12, 0);
public static final DateTime FESTIVAL_START = PlayaWeek.FESTIVAL.getDate(-1); // sunday
public static final DateTime FESTIVAL_END = PlayaWeek.DISENGAGE.getDate(0); // monday
static {
String css_version = "";
try {
css_version = URLEncoder.encode(SYSTEM_VERSION, "us-ascii");
} catch (Exception x) {
// won't happen.
}
CSS_VERSION = css_version;
}
/*
* 2017
*
2017
Tier 1 $395 Camp Dues: 11:59 PM (Eastern Time) on Wednesday, July 12
Tier 2 $545 Camp Dues : 11:59 PM (Eastern Time) on Wednesday, July 26
Tier 3 $665 Camp Dues: 11:59 PM (Eastern Time) on Wednesday, August 16
Tier 1 $1050 RV Fee: Wednesday, July 12 at 11:59 PM (Eastern Time)
Tier 2 $1250 RV Fee: Wednesdsay, July 26 at 11:59 PM (Eastern Time)
Tier 3 $1550 RV Fee: Wednesday, August 16 at 11:59 PM (Eastern Time)
*/
public static final int GRACE_PERIOD_DAYS = 3;
public static void setupPersonalTiers (List<Tier> personalTiers) {
DateTimeZone tz = DateTimeZone.forID("America/New_York");
personalTiers.clear();
personalTiers.add(new Tier(new DateTime(2017, 7, 13, 0, 0, 0, tz), 39500, "Tier 1"));
personalTiers.add(new Tier(new DateTime(2017, 7, 27, 0, 0, 0, tz), 54500, "Tier 2"));
personalTiers.add(new Tier(null, 66500, "Tier 3"));
}
public static void setupRVTiers (List<Tier> rvTiers) {
DateTimeZone tz = DateTimeZone.forID("America/New_York");
rvTiers.clear();
rvTiers.add(new Tier(new DateTime(2017, 7, 13, 0, 0, 0, tz), 105000, "R.V. Tier 1"));
rvTiers.add(new Tier(new DateTime(2017, 7, 27, 0, 0, 0, tz), 125000, "R.V. Tier 2"));
rvTiers.add(new Tier(null, 155000, "R.V. Tier 3"));
}
public static enum PlayaWeek {
ALPHA(-1),
FESTIVAL(0),
DISENGAGE(1);
final int offset;
PlayaWeek (int offset) {
this.offset = offset;
}
public DateTime getDate (int daysFromMonday) {
return PLAYA_MONDAY.plusWeeks(offset).plusDays(daysFromMonday);
}
public String getPhase (int daysFromMonday) {
return getPhase(getDate(daysFromMonday));
}
public static String getPhase (DateTime when) {
if (when == null)
return null;
else if (when.isBefore(FESTIVAL_START))
return "BUILD WEEK (Alpha)";
else if (when.equals(FESTIVAL_START))
return "Festival Opens";
else if (when.equals(FESTIVAL_END))
return "Festival Ends";
else if (when.isAfter(FESTIVAL_END))
return "TEAR-DOWN (Disengage)";
else
return "Festival Week";
}
public static String getPhaseShortName (DateTime when) {
if (when == null)
return null;
else if (when.isBefore(FESTIVAL_START))
return "alpha";
else if (when.equals(FESTIVAL_START))
return "festival-open";
else if (when.equals(FESTIVAL_END))
return "festival-end";
else if (when.isAfter(FESTIVAL_END))
return "disengage";
else
return "festival";
}
}
}
| JC3/D13 | src/d13/ThisYear.java |
248,932 | import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
public class GUI extends JFrame {
private static final long serialVersionUID = 1L;
Object[][] rows;
Agenda agenda;
File festivalFile = null;
DefaultTableModel model;
Simulator tiled = new Simulator(10);
public GUI() {
super("Festival Planner");
String[] columns = new String[] { "Artist", "Stage", "Start Time", "End Time", "Popularity" };
agenda = new Agenda();
JPanel content = new JPanel(new BorderLayout());
JTable table = new JTable(new DefaultTableModel(rows, columns));
model = (DefaultTableModel) table.getModel();
JScrollPane scrollPane = new JScrollPane(table);
JMenuBar menuBar = new JMenuBar();
menuBar.setLayout(new FlowLayout(FlowLayout.LEFT));
this.setJMenuBar(menuBar);
JMenu options = new JMenu("Options");
menuBar.add(options);
JMenuItem open = new JMenuItem("Open");
options.add(open);
JMenuItem save = new JMenuItem("Save");
options.add(save);
JMenuItem deleteAll = new JMenuItem("Delete all rows");
options.add(deleteAll);
JMenuItem undo = new JMenuItem("Undo");
options.add(undo);
JMenuItem changeActivity = new JMenuItem("Change activity");
options.add(changeActivity);
JMenuItem addArtist = new JMenuItem("Add artist");
menuBar.add(addArtist);
JMenuItem addItem = new JMenuItem("Add activity");
menuBar.add(addItem);
JMenuItem simulation = new JMenuItem("Start stimulation");
menuBar.add(simulation);
JMenuItem info = new JMenuItem("Information");
menuBar.add(info);
JMenuItem exit = new JMenuItem("Exit");
menuBar.add(exit);
save.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser(festivalFile);
if (fileChooser.showSaveDialog(GUI.this) == JFileChooser.APPROVE_OPTION) {
festivalFile = fileChooser.getSelectedFile();
ObjectOutputStream oos = null;
try {
oos = new ObjectOutputStream(new FileOutputStream(festivalFile));
oos.writeObject(agenda);
oos.close();
} catch (IOException e1) {
e1.printStackTrace();
} finally {
if (oos != null) {
}
}
}
}
});
open.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser(festivalFile);
if (fileChooser.showOpenDialog(GUI.this) == JFileChooser.APPROVE_OPTION) {
festivalFile = fileChooser.getSelectedFile();
try {
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(festivalFile));
agenda = (Agenda) ois.readObject();
System.out.println(agenda);
updateTable();
agenda.test();
repaint();
} catch (IOException e1) {
e1.printStackTrace();
} catch (ClassNotFoundException e2) {
e2.printStackTrace();
}
}
}
});
deleteAll.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
deleteAllRows();
}
});
addArtist.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
addArtist();
}
});
addItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
addActivity();
}
});
changeActivity.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
changeActivity(0);
}
});
simulation.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String visitorString = JOptionPane.showInputDialog(GUI.this, "How many visitors?");
try {
int visitorAmount = Integer.parseInt(visitorString);
if (visitorAmount > 1000) {
visitorAmount = 1000;
} else if (0 > visitorAmount) {
visitorAmount = 1;
}
tiled.makeGUI(visitorAmount);
} catch (NumberFormatException exception) {
JOptionPane.showMessageDialog(GUI.this, "Vul een getal in");
actionPerformed(e);
}
}
});
info.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(GUI.this, "This project was made by A4 o3o");
}
});
exit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dispose();
}
});
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent me) {
if (SwingUtilities.isLeftMouseButton(me) == true) {
int row = table.rowAtPoint(me.getPoint());
table.clearSelection();
table.addRowSelectionInterval(row, row);
}
JPopupMenu popupMenu = new JPopupMenu();
JMenuItem menuItemAdd = new JMenuItem("Add activity");
JMenuItem menuItemArtist = new JMenuItem("Add artist");
JMenuItem menuItemRemove = new JMenuItem("Remove selected activity");
JMenuItem menuItemChange = new JMenuItem("Change selected activity");
JMenuItem menuItemRemoveAll = new JMenuItem("Remove all activities");
menuItemAdd.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
addActivity();
}
});
menuItemArtist.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
addArtist();
}
});
menuItemRemove.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int selectedRow = table.getSelectedRow();
if (selectedRow != -1) {
model.removeRow(selectedRow);
agenda.getActivity().remove(selectedRow);
}
}
});
menuItemChange.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int selectedRow = table.getSelectedRow();
if (selectedRow != -1) {
changeActivity(table.getSelectedRow());
}
}
});
menuItemRemoveAll.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
deleteAllRows();
}
});
if (SwingUtilities.isLeftMouseButton(me) == true) {
popupMenu.add(menuItemRemove);
popupMenu.add(menuItemChange);
} else {
table.clearSelection();
popupMenu.remove(menuItemRemove);
popupMenu.remove(menuItemChange);
}
popupMenu.add(menuItemAdd);
popupMenu.add(menuItemArtist);
popupMenu.add(menuItemRemoveAll);
table.setComponentPopupMenu(popupMenu);
}
});
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
table.setAutoCreateRowSorter(true);
table.setFillsViewportHeight(true);
setContentPane(content);
content.add(scrollPane);
table.setEnabled(false);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setExtendedState(JFrame.MAXIMIZED_BOTH);
setVisible(true);
setResizable(false);
}
public void addActivity() {
JFrame addFrame = new JFrame("Add activity");
JPanel addPanel = new JPanel(null);
addFrame.setContentPane(addPanel);
JButton addButton = new JButton("Add");
JLabel artistLabel = new JLabel("Artist");
JLabel stageLabel = new JLabel("Stage");
JLabel startLabel = new JLabel("Start time");
JLabel endLabel = new JLabel("End time");
JLabel hdLabel = new JLabel(":");
JLabel mdLabel = new JLabel(":");
JTextField startHourField = new JTextField();
JTextField endHourField = new JTextField();
JTextField startMinField = new JTextField();
JTextField endMinField = new JTextField();
JComboBox<String> stagesBox = new JComboBox<String>();
JComboBox<String> artistBox = new JComboBox<String>();
for (Stage s : agenda.getStages())
stagesBox.addItem(s.getStage());
for (Artist a : agenda.getArtists()) {
artistBox.addItem(a.getName());
}
addPanel.add(artistLabel);
addPanel.add(stageLabel);
addPanel.add(startLabel);
addPanel.add(endLabel);
addPanel.add(addButton);
addPanel.add(stagesBox);
addPanel.add(artistBox);
addPanel.add(hdLabel);
addPanel.add(mdLabel);
addPanel.add(startHourField);
addPanel.add(endHourField);
addPanel.add(startMinField);
addPanel.add(endMinField);
artistLabel.setBounds(22, 30, 70, 20);
stageLabel.setBounds(20, 60, 70, 20);
stagesBox.setBounds(120, 60, 110, 20);
artistBox.setBounds(120, 30, 110, 20);
startLabel.setBounds(20, 90, 90, 20);
endLabel.setBounds(21, 120, 90, 20);
startHourField.setBounds(120, 90, 30, 20);
endHourField.setBounds(120, 120, 30, 20);
hdLabel.setBounds(155, 90, 10, 20);
mdLabel.setBounds(155, 120, 10, 20);
startMinField.setBounds(165, 90, 30, 20);
endMinField.setBounds(165, 120, 30, 20);
addButton.setBounds(90, 150, 60, 20);
addButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String name = (String) artistBox.getSelectedItem();
Stage stage = agenda.getStages().get(stagesBox.getSelectedIndex());
int rating = agenda.getArtists().get(artistBox.getSelectedIndex()).getPop();
int bHour = Integer.parseInt(startHourField.getText());
int bMin = Integer.parseInt(startMinField.getText());
int eHour = Integer.parseInt(endHourField.getText());
int eMin = Integer.parseInt(endMinField.getText());
agenda.addActivity(name, bHour, bMin, eHour, eMin, rating, stage);
int counter = agenda.getActivity().size() - 1;
model.addRow(new Object[] { name, (String) stagesBox.getSelectedItem(),
agenda.getActivity().get(counter).getStartTime(),
agenda.getActivity().get(counter).getEndTime(),
agenda.getActivity().get(counter).getPopularity() });
addFrame.setVisible(false);
}
});
addFrame.setVisible(true);
addFrame.setSize(270, 240);
addFrame.setLocationRelativeTo(null);
}
public void addArtist() {
JFrame artistFrame = new JFrame("Artist");
JPanel artistPanel = new JPanel(null);
JButton addArtistButton = new JButton("Add");
JTextField addArtistNameField = new JTextField();
JTextField addArtistPopField = new JTextField();
JLabel nameLabel = new JLabel("Name");
JLabel ratingLabel = new JLabel("Rating");
artistFrame.setContentPane(artistPanel);
artistFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
artistPanel.add(nameLabel);
artistPanel.add(ratingLabel);
artistPanel.add(addArtistButton);
artistPanel.add(addArtistNameField);
artistPanel.add(addArtistPopField);
nameLabel.setBounds(100, 20, 70, 20);
ratingLabel.setBounds(180, 20, 70, 20);
addArtistButton.setBounds(20, 50, 70, 20);
addArtistNameField.setBounds(100, 50, 70, 20);
addArtistPopField.setBounds(180, 50, 40, 20);
artistFrame.setVisible(true);
artistFrame.setSize(280, 150);
artistFrame.setLocationRelativeTo(null);
artistFrame.setResizable(false);
addArtistButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String artistName = addArtistNameField.getText();
addArtistNameField.setText("");
int artistRating = Integer.parseInt(addArtistPopField.getText());
addArtistPopField.setText("");
if (artistRating < 0 || artistRating > 10) {
JOptionPane.showMessageDialog(GUI.this, "No valid data!");
return;
}
agenda.addArtist(artistName, artistRating);
artistFrame.setVisible(false);
artistFrame.getRootPane().setDefaultButton(addArtistButton);
artistPanel.removeAll();
}
});
}
public void updateTable() {
while (model.getRowCount() > 0) {
model.removeRow(0);
}
for (Activity a : agenda.getActivity()) {
model.addRow(new Object[] { a.getName(), a.getStage().getStage(), a.getStartTime(), a.getEndTime(),
a.getPopularity() });
}
}
public void changeActivity(int index) {
JFrame changeFrame = new JFrame("Change activity");
JPanel changePanel = new JPanel(null);
changeFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
changeFrame.setContentPane(changePanel);
JButton changeButton = new JButton("Change");
JTextField beginHourField = new JTextField();
JTextField endHourField = new JTextField();
JTextField beginMinField = new JTextField();
JTextField endMinField = new JTextField();
JTextField popularityField = new JTextField();
JComboBox<String> activityBox = new JComboBox<String>();
int item = 0;
for (Activity a : agenda.getActivity()) {
item++;
activityBox.addItem("Activity: " + item);
}
activityBox.setSelectedIndex(index);
JComboBox<String> stageBox = new JComboBox<String>();
for (Stage s : agenda.getStages())
stageBox.addItem(s.getStage());
JLabel beginTimeLabel = new JLabel("Begin time");
JLabel endTimeLabel = new JLabel("End time");
JLabel hd = new JLabel(":");
JLabel md = new JLabel(":");
JLabel popularityLabel = new JLabel("Rating");
JLabel stageLabel = new JLabel("Stages");
JLabel activityLabel = new JLabel("Activities");
changePanel.add(changeButton);
changePanel.add(beginHourField);
changePanel.add(endHourField);
changePanel.add(beginMinField);
changePanel.add(endMinField);
changePanel.add(hd);
changePanel.add(md);
changePanel.add(popularityField);
changePanel.add(stageBox);
changePanel.add(activityBox);
changePanel.add(beginTimeLabel);
changePanel.add(endTimeLabel);
changePanel.add(popularityLabel);
changePanel.add(stageLabel);
changePanel.add(activityLabel);
if (agenda.getActivity().size() > 0) {
beginHourField.setText("" + agenda.getActivity().get(index).getStartHour());
endHourField.setText("" + agenda.getActivity().get(index).getEndHour());
beginMinField.setText("" + agenda.getActivity().get(index).getStartMin());
endMinField.setText("" + agenda.getActivity().get(index).getEndMin());
popularityField.setText("" + agenda.getActivity().get(index).getRating());
stageBox.setSelectedItem(agenda.getActivity().get(index).getStage().getStage());
}
activityBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
beginHourField.setText("" + agenda.getActivity().get(activityBox.getSelectedIndex()).getStartHour());
endHourField.setText("" + agenda.getActivity().get(activityBox.getSelectedIndex()).getEndHour());
beginMinField.setText("" + agenda.getActivity().get(activityBox.getSelectedIndex()).getStartMin());
endMinField.setText("" + agenda.getActivity().get(activityBox.getSelectedIndex()).getEndMin());
popularityField.setText("" + agenda.getActivity().get(activityBox.getSelectedIndex()).getRating());
stageBox.setSelectedItem(
agenda.getActivity().get(activityBox.getSelectedIndex()).getStage().getStage());
}
});
changeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (Integer.parseInt(popularityField.getText()) < 0
|| Integer.parseInt(popularityField.getText()) > 10) {
JOptionPane.showMessageDialog(GUI.this, "M8, u fucked up");
return;
}
agenda.getActivity().get(activityBox.getSelectedIndex())
.setPopularity(Integer.parseInt(popularityField.getText()));
agenda.getActivity().get(activityBox.getSelectedIndex()).getStage()
.setStage(stageBox.getSelectedItem().toString());
agenda.getActivity().get(activityBox.getSelectedIndex())
.setStartHour(Integer.parseInt(beginHourField.getText()));
agenda.getActivity().get(activityBox.getSelectedIndex())
.setStartMin(Integer.parseInt(beginMinField.getText()));
agenda.getActivity().get(activityBox.getSelectedIndex())
.setEndHour(Integer.parseInt(endHourField.getText()));
agenda.getActivity().get(activityBox.getSelectedIndex())
.setEndMin(Integer.parseInt(endMinField.getText()));
agenda.getActivity().get(activityBox.getSelectedIndex()).setStartTime(
Integer.parseInt(beginHourField.getText()), Integer.parseInt(beginMinField.getText()));
agenda.getActivity().get(activityBox.getSelectedIndex())
.setEndTime(Integer.parseInt(endHourField.getText()), Integer.parseInt(endMinField.getText()));
// model.removeRow(row);
updateTable();
changeFrame.setVisible(false);
changePanel.removeAll();
}
});
activityBox.setBounds(120, 50, 100, 20);
stageBox.setBounds(120, 80, 100, 20);
changeButton.setBounds(160, 140, 100, 20);
beginHourField.setBounds(120, 110, 30, 20);
endHourField.setBounds(290, 110, 30, 20);
beginMinField.setBounds(170, 110, 30, 20);
endMinField.setBounds(340, 110, 30, 20);
hd.setBounds(155, 110, 10, 20);
md.setBounds(325, 110, 10, 20);
popularityField.setBounds(290, 80, 70, 20);
beginTimeLabel.setBounds(50, 110, 70, 20);
endTimeLabel.setBounds(230, 110, 70, 20);
popularityLabel.setBounds(230, 80, 70, 20);
stageLabel.setBounds(50, 80, 70, 20);
activityLabel.setBounds(50, 50, 70, 20);
changeFrame.setVisible(true);
changeFrame.setSize(440, 250);
changeFrame.setLocationRelativeTo(null);
}
public void deleteAllRows() {
while (model.getRowCount() > 0) {
model.removeRow(0);
}
for (int i = 0; i <= agenda.getActivity().size(); i++) {
agenda.getActivity().remove(i);
}
}
}
| jbwwboom/FestivalPlanner | FestivalPlannerBeta/src/GUI.java |
248,933 | import java.io.*;
import java.util.*;
public class boj9205 {
static int x, T, N;
static Deque<Pos> store;
static Pos home, festival;
static List<Pos> notVisited;
static StringBuilder sb;
public static void bfs() {
store.add(home);
while (!store.isEmpty()) {
Pos cur = store.poll();
if (cur.x == festival.x && cur.y == festival.y) {
sb.append("happy").append('\n');
return;
}
for (int i = 0; i < notVisited.size(); i++) {
Pos next = notVisited.get(i);
if (ManhattanDist(next.x, next.y, cur.x, cur.y) <= 1000) {
store.add(next);
notVisited.remove(i);
i--;
}
}
}
sb.append("sad").append('\n');
}
public static int ManhattanDist(int x1,int y1,int x2,int y2) {
return Math.abs(x1 - x2) + Math.abs(y1 - y2);
}
public static void pre() throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
T = Integer.parseInt(br.readLine());
store = new ArrayDeque<>();
sb = new StringBuilder();
notVisited = new ArrayList<>();
for (int x = 1; x <= T; x++) {
N = Integer.parseInt(br.readLine());
store.clear();
notVisited.clear();
st = new StringTokenizer(br.readLine());
home = new Pos(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()));
for (int i = 0; i < N; i++) {
st = new StringTokenizer(br.readLine());
notVisited.add(new Pos(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken())));
}
st = new StringTokenizer(br.readLine());
festival = new Pos(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()));
notVisited.add(festival);
bfs();
}
}
public static void main(String args[]) throws IOException {
pre();
System.out.print(sb);
}
static class Pos {
int x, y;
public Pos() {
}
public Pos(int x, int y) {
this.x = x;
this.y = y;
}
}
}
| duckddud213/BOJ | boj9205.java |
248,934 | package entities;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.mindrot.jbcrypt.BCrypt;
@Entity
@Table(name = "users")
@NamedQuery(name = "User.deleteAllRows", query = "DELETE from User")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Column(name = "user_name", length = 25)
private String userName;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 255)
@Column(name = "user_pass")
private String userPass;
@Column(name = "phone", length = 8)
private String phone;
@Column(name = "email", length = 50)
private String email;
@Column(name = "status", length = 50)
private String status;
@ManyToMany(mappedBy = "users", cascade = CascadeType.PERSIST)
private List<Movie> movies = new ArrayList<>();
@ManyToOne(cascade = CascadeType.PERSIST)
private Festival festival;
@ManyToMany(cascade = CascadeType.PERSIST)
@JoinTable(name = "user_roles", joinColumns = {
@JoinColumn(name = "user_name", referencedColumnName = "user_name")}, inverseJoinColumns = {
@JoinColumn(name = "role_name", referencedColumnName = "role_name")})
private List<Role> roleList = new ArrayList<>();
public List<String> getRolesAsStrings() {
if (roleList.isEmpty()) {
return null;
}
List<String> rolesAsStrings = new ArrayList<>();
roleList.forEach((role) -> {
rolesAsStrings.add(role.getRoleName());
});
return rolesAsStrings;
}
public User() {
}
//TODO Change when password is hashed
public boolean verifyPassword(String pw) {
return BCrypt.checkpw(pw, userPass);
}
public User(String userName, String userPass) {
this.userName = userName;
this.userPass = BCrypt.hashpw(userPass, BCrypt.gensalt());
}
public User(String userName, String userPass, String phone, String email, String status) {
this.userName = userName;
this.userPass = BCrypt.hashpw(userPass, BCrypt.gensalt());
this.phone = phone;
this.email = email;
this.status = status;
this.movies = new ArrayList<>();
// this.festival = new Festival();
// this.roleList = new ArrayList<>();
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserPass() {
return this.userPass;
}
public void setUserPass(String userPass) {
this.userPass = BCrypt.hashpw(userPass, BCrypt.gensalt());
;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public List<Role> getRoleList() {
return roleList;
}
public void setRoleList(List<Role> roleList) {
this.roleList = roleList;
}
public void addRole(Role userRole) {
roleList.add(userRole);
}
public List<Movie> getMovies() {
return movies;
}
public void setMovies(List<Movie> movies) {
this.movies = movies;
}
public void addMovie(Movie movie) {
this.movies.add(movie);
movie.addUser(this);
}
public Festival getFestival() {
return festival;
}
public void setFestival(Festival festival) {
this.festival = festival;
}
@Override
public String toString() {
return "User{" +
"userName = " + userName + '\n' +
"userPass = " + userPass + '\n' +
"phone = " + phone + '\n' +
"email = " + email + '\n' +
"status = " + status + '\n' +
"movies = " + movies + '\n' +
'}';
}
}
| Chriswihu/Exam_Backend_2 | src/main/java/entities/User.java |
248,936 | package etc;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Festival {
public static void main(String args[]){
int c ; //테스트 케이스 ( <= 100 )
int n ; //공연장을 대여할 수 있는 날들의 수 ( 1 <= n <= 100)
int l ; //공연 팀의 수 ( 1 <= ㅣ <= 100)
//입력 받는 버퍼 리더 ( .read() / .readLine() )
BufferedReader bufferedReader = new BufferedReader((new InputStreamReader(System.in)));
}
}
| moonkii/AlgorithmStudy | java/src/etc/Festival.java |
248,937 | /*
* This file is part of the L2JServer project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jserver;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import java.io.OutputStream;
import java.math.BigInteger;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.l2jserver.commons.enums.ServerMode;
import org.l2jserver.commons.util.ClassMasterSettings;
import org.l2jserver.commons.util.PropertiesParser;
import org.l2jserver.commons.util.StringUtil;
import org.l2jserver.gameserver.model.entity.olympiad.OlympiadPeriod;
import org.l2jserver.gameserver.util.FloodProtectorConfig;
import org.l2jserver.loginserver.LoginController;
public class Config
{
private static final Logger LOGGER = Logger.getLogger(Config.class.getName());
// --------------------------------------------------
// Files
// --------------------------------------------------
// standard
private static final String FILTER_FILE = "./config/chatfilter.txt";
private static final String HEXID_FILE = "./config/hexid.txt";
// main
private static final String ACCESS_CONFIG_FILE = "./config/main/Access.ini";
private static final String CHARACTER_CONFIG_FILE = "./config/main/Character.ini";
private static final String CLANHALL_CONFIG_FILE = "./config/main/Clanhall.ini";
public static final String CLASS_DAMAGE_CONFIG_FILE = "./config/main/ClassDamage.ini";
private static final String CONQUERABLE_CLANHALL_CONFIG_FILE = "./config/main/ConquerableClanHalls.ini";
private static final String CRAFTING_CONFIG_FILE = "./config/main/Crafting.ini";
private static final String ENCHANT_CONFIG_FILE = "./config/main/Enchant.ini";
public static final String FORTSIEGE_CONFIG_FILE = "./config/main/Fort.ini";
private static final String GENERAL_CONFIG_FILE = "./config/main/General.ini";
private static final String GEOENGINE_CONFIG_FILE = "./config/main/GeoEngine.ini";
private static final String OLYMP_CONFIG_FILE = "./config/main/Olympiad.ini";
private static final String PHYSICS_CONFIG_FILE = "./config/main/Physics.ini";
private static final String PVP_CONFIG_FILE = "./config/main/PvP.ini";
private static final String RAIDBOSS_CONFIG_FILE = "./config/main/RaidBoss.ini";
private static final String RATES_CONFIG_FILE = "./config/main/Rates.ini";
private static final String SERVER_CONFIG_FILE = "./config/main/Server.ini";
private static final String SEVENSIGNS_CONFIG_FILE = "./config/main/SevenSigns.ini";
public static final String SIEGE_CONFIG_FILE = "./config/main/Siege.ini";
// protected
private static final String DAEMONS_CONFIG_FILE = "./config/protected/Daemons.ini";
private static final String PROTECT_FLOOD_CONFIG_FILE = "./config/protected/Flood.ini";
private static final String PROTECT_OTHER_CONFIG_FILE = "./config/protected/Other.ini";
public static final String TELNET_CONFIG_FILE = "./config/protected/Telnet.ini";
// events
private static final String EVENT_CTF_CONFIG_FILE = "./config/events/CtF.ini";
private static final String EVENT_DM_CONFIG_FILE = "./config/events/DM.ini";
private static final String EVENT_PC_BANG_POINT_CONFIG_FILE = "./config/events/PcBang.ini";
private static final String EVENT_TVT_CONFIG_FILE = "./config/events/TvT.ini";
private static final String EVENT_TW_CONFIG_FILE = "./config/events/TW.ini";
// custom
private static final String BANK_CONFIG_FILE = "./config/custom/Bank.ini";
private static final String CHAMPION_CONFIG_FILE = "./config/custom/Champion.ini";
private static final String MERCHANT_ZERO_SELL_PRICE_CONFIG_FILE = "./config/custom/MerchantZeroSellPrice.ini";
private static final String OFFLINE_CONFIG_FILE = "./config/custom/Offline.ini";
private static final String OTHER_CONFIG_FILE = "./config/custom/Other.ini";
private static final String SCHEME_BUFFER_CONFIG_FILE = "./config/custom/SchemeBuffer.ini";
private static final String EVENT_REBIRTH_CONFIG_FILE = "./config/custom/Rebirth.ini";
private static final String EVENT_WEDDING_CONFIG_FILE = "./config/custom/Wedding.ini";
private static final String L2JSERVER_CUSTOM = "./config/custom/L2JServer.ini";
// login
private static final String LOGIN_CONFIG_FILE = "./config/main/LoginServer.ini";
// others
private static final String BANNED_IP_FILE = "./config/others/banned_ip.cfg";
public static final String SERVER_NAME_FILE = "./config/others/servername.xml";
// legacy
private static final String LEGACY_BANNED_IP = "./config/banned_ip.cfg";
// --------------------------------------------------
// Constants
// --------------------------------------------------
public static final String EOL = System.lineSeparator();
public static ServerMode SERVER_MODE = ServerMode.NONE;
public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
public static boolean SHOW_GM_LOGIN;
public static boolean GM_STARTUP_INVISIBLE;
public static boolean GM_SPECIAL_EFFECT;
public static boolean GM_STARTUP_SILENCE;
public static boolean GM_STARTUP_AUTO_LIST;
public static boolean GM_HERO_AURA;
public static boolean GM_STARTUP_BUILDER_HIDE;
public static boolean GM_STARTUP_INVULNERABLE;
public static boolean GM_ANNOUNCER_NAME;
public static boolean GM_CRITANNOUNCER_NAME;
public static boolean GM_DEBUG_HTML_PATHS;
public static boolean USE_SUPER_HASTE_AS_GM_SPEED;
public static String DEFAULT_GLOBAL_CHAT;
public static String DEFAULT_TRADE_CHAT;
public static boolean TRADE_CHAT_WITH_PVP;
public static int TRADE_PVP_AMOUNT;
public static boolean GLOBAL_CHAT_WITH_PVP;
public static int GLOBAL_PVP_AMOUNT;
public static int BRUT_AVG_TIME;
public static int BRUT_LOGON_ATTEMPTS;
public static int BRUT_BAN_IP_TIME;
public static int MAX_CHAT_LENGTH;
public static boolean TRADE_CHAT_IS_NOOBLE;
public static boolean PRECISE_DROP_CALCULATION;
public static boolean MULTIPLE_ITEM_DROP;
public static int DELETE_DAYS;
public static int MAX_DRIFT_RANGE;
public static boolean AGGRO_DISTANCE_CHECK_ENABLED;
public static int AGGRO_DISTANCE_CHECK_RANGE;
public static boolean AGGRO_DISTANCE_CHECK_RAIDS;
public static boolean AGGRO_DISTANCE_CHECK_INSTANCES;
public static boolean AGGRO_DISTANCE_CHECK_RESTORE_LIFE;
public static boolean ALLOWFISHING;
public static boolean ALLOW_MANOR;
public static int AUTODESTROY_ITEM_AFTER;
public static int HERB_AUTO_DESTROY_TIME;
public static String PROTECTED_ITEMS;
public static List<Integer> LIST_PROTECTED_ITEMS = new ArrayList<>();
public static boolean DESTROY_DROPPED_PLAYER_ITEM;
public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
public static boolean SAVE_DROPPED_ITEM;
public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
public static int SAVE_DROPPED_ITEM_INTERVAL;
public static boolean CLEAR_DROPPED_ITEM_TABLE;
public static boolean ALLOW_DISCARDITEM;
public static boolean ALLOW_FREIGHT;
public static boolean ALLOW_WAREHOUSE;
public static boolean WAREHOUSE_CACHE;
public static int WAREHOUSE_CACHE_TIME;
public static boolean ALLOW_WEAR;
public static int WEAR_DELAY;
public static int WEAR_PRICE;
public static boolean ALLOW_LOTTERY;
public static boolean ALLOW_RACE;
public static boolean ALLOW_RENTPET;
public static boolean ALLOW_BOAT;
public static boolean ALLOW_CURSED_WEAPONS;
public static boolean ALLOW_NPC_WALKERS;
public static int MIN_NPC_ANIMATION;
public static int MAX_NPC_ANIMATION;
public static int MIN_MONSTER_ANIMATION;
public static int MAX_MONSTER_ANIMATION;
public static boolean ENABLE_COMMUNITY_BOARD;
public static String BBS_DEFAULT;
public static boolean SHOW_NPC_LVL;
public static boolean SHOW_NPC_AGGRESSION;
public static int ZONE_TOWN;
public static int DEFAULT_PUNISH;
public static int DEFAULT_PUNISH_PARAM;
public static int CHAR_DATA_STORE_INTERVAL;
public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
public static boolean AUTODELETE_INVALID_QUEST_DATA;
public static boolean GRIDS_ALWAYS_ON;
public static int GRID_NEIGHBOR_TURNON_TIME;
public static int GRID_NEIGHBOR_TURNOFF_TIME;
public static boolean BYPASS_VALIDATION;
public static boolean HIGH_RATE_SERVER_DROPS;
public static boolean FORCE_COMPLETE_STATUS_UPDATE;
public static int PORT_GAME;
public static String GAMESERVER_HOSTNAME;
public static String DATABASE_DRIVER;
public static String DATABASE_URL;
public static String DATABASE_LOGIN;
public static String DATABASE_PASSWORD;
public static int DATABASE_MAX_CONNECTIONS;
public static boolean BACKUP_DATABASE;
public static String MYSQL_BIN_PATH;
public static String BACKUP_PATH;
public static int BACKUP_DAYS;
public static boolean RESERVE_HOST_ON_LOGIN = false;
public static boolean IS_TELNET_ENABLED;
public static boolean JAIL_IS_PVP;
public static boolean JAIL_DISABLE_CHAT;
public static int WYVERN_SPEED;
public static int STRIDER_SPEED;
public static boolean ALLOW_WYVERN_UPGRADER;
public static String NONDROPPABLE_ITEMS;
public static List<Integer> LIST_NONDROPPABLE_ITEMS = new ArrayList<>();
public static String PET_RENT_NPC;
public static List<Integer> LIST_PET_RENT_NPC = new ArrayList<>();
public static boolean ENABLE_AIO_SYSTEM;
public static Map<Integer, Integer> AIO_SKILLS;
public static boolean ALLOW_AIO_NCOLOR;
public static int AIO_NCOLOR;
public static boolean ALLOW_AIO_TCOLOR;
public static int AIO_TCOLOR;
public static boolean ALLOW_AIO_USE_GK;
public static boolean ALLOW_AIO_USE_CM;
public static boolean ALLOW_AIO_IN_EVENTS;
public static int CHAT_FILTER_PUNISHMENT_PARAM1;
public static int CHAT_FILTER_PUNISHMENT_PARAM2;
public static int CHAT_FILTER_PUNISHMENT_PARAM3;
public static boolean USE_SAY_FILTER;
public static String CHAT_FILTER_CHARS;
public static String CHAT_FILTER_PUNISHMENT;
public static List<String> FILTER_LIST = new ArrayList<>();
public static int FS_TIME_ATTACK;
public static int FS_TIME_COOLDOWN;
public static int FS_TIME_ENTRY;
public static int FS_TIME_WARMUP;
public static int FS_PARTY_MEMBER_COUNT;
public static boolean ALLOW_QUAKE_SYSTEM;
public static boolean ENABLE_ANTI_PVP_FARM_MSG;
public static float RATE_XP;
public static float RATE_SP;
public static float RATE_PARTY_XP;
public static float RATE_PARTY_SP;
public static float RATE_QUESTS_REWARD;
public static float RATE_DROP_ADENA;
public static float RATE_CONSUMABLE_COST;
public static float RATE_DROP_ITEMS;
public static float RATE_DROP_SEAL_STONES;
public static float RATE_DROP_SPOIL;
public static float RATE_DROP_MANOR;
public static float RATE_DROP_QUEST;
public static float RATE_KARMA_EXP_LOST;
public static float RATE_SIEGE_GUARDS_PRICE;
public static float RATE_DROP_COMMON_HERBS;
public static float RATE_DROP_MP_HP_HERBS;
public static float RATE_DROP_GREATER_HERBS;
public static float RATE_DROP_SUPERIOR_HERBS;
public static float RATE_DROP_SPECIAL_HERBS;
public static int PLAYER_DROP_LIMIT;
public static int PLAYER_RATE_DROP;
public static int PLAYER_RATE_DROP_ITEM;
public static int PLAYER_RATE_DROP_EQUIP;
public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
public static float PET_XP_RATE;
public static int PET_FOOD_RATE;
public static float SINEATER_XP_RATE;
public static int KARMA_DROP_LIMIT;
public static int KARMA_RATE_DROP;
public static int KARMA_RATE_DROP_ITEM;
public static int KARMA_RATE_DROP_EQUIP;
public static int KARMA_RATE_DROP_EQUIP_WEAPON;
public static float ADENA_BOSS;
public static float ADENA_RAID;
public static float ADENA_MINION;
public static float ITEMS_BOSS;
public static float ITEMS_RAID;
public static float ITEMS_MINION;
public static float SPOIL_BOSS;
public static float SPOIL_RAID;
public static float SPOIL_MINION;
public static boolean REMOVE_CASTLE_CIRCLETS;
public static float ALT_GAME_SKILL_HIT_RATE;
public static boolean ALT_GAME_VIEWNPC;
public static int ALT_CLAN_MEMBERS_FOR_WAR;
public static int ALT_CLAN_JOIN_DAYS;
public static int ALT_CLAN_CREATE_DAYS;
public static int ALT_CLAN_DISSOLVE_DAYS;
public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
public static boolean ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE;
public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
public static boolean ALT_PRIVILEGES_SECURE_CHECK;
public static int ALT_PRIVILEGES_DEFAULT_LEVEL;
public static int ALT_MANOR_REFRESH_TIME;
public static int ALT_MANOR_REFRESH_MIN;
public static int ALT_MANOR_APPROVE_TIME;
public static int ALT_MANOR_APPROVE_MIN;
public static int ALT_MANOR_MAINTENANCE_PERIOD;
public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
public static int ALT_MANOR_SAVE_PERIOD_RATE;
public static int ALT_LOTTERY_PRIZE;
public static int ALT_LOTTERY_TICKET_PRICE;
public static float ALT_LOTTERY_5_NUMBER_RATE;
public static float ALT_LOTTERY_4_NUMBER_RATE;
public static float ALT_LOTTERY_3_NUMBER_RATE;
public static int ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
public static boolean ALT_FISH_CHAMPIONSHIP_ENABLED;
public static int ALT_FISH_CHAMPIONSHIP_REWARD_ITEM;
public static int ALT_FISH_CHAMPIONSHIP_REWARD_1;
public static int ALT_FISH_CHAMPIONSHIP_REWARD_2;
public static int ALT_FISH_CHAMPIONSHIP_REWARD_3;
public static int ALT_FISH_CHAMPIONSHIP_REWARD_4;
public static int ALT_FISH_CHAMPIONSHIP_REWARD_5;
public static int RIFT_MIN_PARTY_SIZE;
public static int RIFT_SPAWN_DELAY;
public static int RIFT_MAX_JUMPS;
public static int RIFT_AUTO_JUMPS_TIME_MIN;
public static int RIFT_AUTO_JUMPS_TIME_MAX;
public static int RIFT_ENTER_COST_RECRUIT;
public static int RIFT_ENTER_COST_SOLDIER;
public static int RIFT_ENTER_COST_OFFICER;
public static int RIFT_ENTER_COST_CAPTAIN;
public static int RIFT_ENTER_COST_COMMANDER;
public static int RIFT_ENTER_COST_HERO;
public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
public static boolean FORCE_INVENTORY_UPDATE;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
public static boolean ALT_KARMA_TELEPORT_TO_FLORAN;
public static boolean DONT_DESTROY_SS;
public static int STANDARD_RESPAWN_DELAY;
public static int RAID_RANKING_1ST;
public static int RAID_RANKING_2ND;
public static int RAID_RANKING_3RD;
public static int RAID_RANKING_4TH;
public static int RAID_RANKING_5TH;
public static int RAID_RANKING_6TH;
public static int RAID_RANKING_7TH;
public static int RAID_RANKING_8TH;
public static int RAID_RANKING_9TH;
public static int RAID_RANKING_10TH;
public static int RAID_RANKING_UP_TO_50TH;
public static int RAID_RANKING_UP_TO_100TH;
public static boolean EXPERTISE_PENALTY;
public static boolean MASTERY_PENALTY;
public static int LEVEL_TO_GET_PENALTY;
public static boolean MASTERY_WEAPON_PENALTY;
public static int LEVEL_TO_GET_WEAPON_PENALTY;
public static int ACTIVE_AUGMENTS_START_REUSE_TIME;
public static boolean NPC_ATTACKABLE;
public static List<Integer> INVUL_NPC_LIST;
public static boolean DISABLE_ATTACK_NPC_TYPE;
public static String ALLOWED_NPC_TYPES;
public static List<String> LIST_ALLOWED_NPC_TYPES = new ArrayList<>();
public static boolean SELL_BY_ITEM;
public static int SELL_ITEM;
public static String DISABLE_BOW_CLASSES_STRING;
public static List<Integer> DISABLE_BOW_CLASSES = new ArrayList<>();
public static boolean ALT_MOBS_STATS_BONUS;
public static boolean ALT_PETS_STATS_BONUS;
public static double RAID_HP_REGEN_MULTIPLIER;
public static double RAID_MP_REGEN_MULTIPLIER;
public static double RAID_P_DEFENCE_MULTIPLIER;
public static double RAID_M_DEFENCE_MULTIPLIER;
public static double RAID_MINION_RESPAWN_TIMER;
public static float RAID_MIN_RESPAWN_MULTIPLIER;
public static float RAID_MAX_RESPAWN_MULTIPLIER;
public static long CLICK_TASK;
public static boolean ANNOUNCE_CASTLE_LORDS;
public static boolean ANNOUNCE_MAMMON_SPAWN;
public static boolean ALLOW_GUARDS;
public static boolean ALT_GAME_REQUIRE_CASTLE_DAWN;
public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
public static boolean ALT_REQUIRE_WIN_7S;
public static int ALT_FESTIVAL_MIN_PLAYER;
public static int ALT_MAXIMUM_PLAYER_CONTRIB;
public static long ALT_FESTIVAL_MANAGER_START;
public static long ALT_FESTIVAL_LENGTH;
public static long ALT_FESTIVAL_CYCLE_LENGTH;
public static long ALT_FESTIVAL_FIRST_SPAWN;
public static long ALT_FESTIVAL_FIRST_SWARM;
public static long ALT_FESTIVAL_SECOND_SPAWN;
public static long ALT_FESTIVAL_SECOND_SWARM;
public static long ALT_FESTIVAL_CHEST_SPAWN;
public static long CH_TELE_FEE_RATIO;
public static int CH_TELE1_FEE;
public static int CH_TELE2_FEE;
public static long CH_ITEM_FEE_RATIO;
public static int CH_ITEM1_FEE;
public static int CH_ITEM2_FEE;
public static int CH_ITEM3_FEE;
public static long CH_MPREG_FEE_RATIO;
public static int CH_MPREG1_FEE;
public static int CH_MPREG2_FEE;
public static int CH_MPREG3_FEE;
public static int CH_MPREG4_FEE;
public static int CH_MPREG5_FEE;
public static long CH_HPREG_FEE_RATIO;
public static int CH_HPREG1_FEE;
public static int CH_HPREG2_FEE;
public static int CH_HPREG3_FEE;
public static int CH_HPREG4_FEE;
public static int CH_HPREG5_FEE;
public static int CH_HPREG6_FEE;
public static int CH_HPREG7_FEE;
public static int CH_HPREG8_FEE;
public static int CH_HPREG9_FEE;
public static int CH_HPREG10_FEE;
public static int CH_HPREG11_FEE;
public static int CH_HPREG12_FEE;
public static int CH_HPREG13_FEE;
public static long CH_EXPREG_FEE_RATIO;
public static int CH_EXPREG1_FEE;
public static int CH_EXPREG2_FEE;
public static int CH_EXPREG3_FEE;
public static int CH_EXPREG4_FEE;
public static int CH_EXPREG5_FEE;
public static int CH_EXPREG6_FEE;
public static int CH_EXPREG7_FEE;
public static long CH_SUPPORT_FEE_RATIO;
public static int CH_SUPPORT1_FEE;
public static int CH_SUPPORT2_FEE;
public static int CH_SUPPORT3_FEE;
public static int CH_SUPPORT4_FEE;
public static int CH_SUPPORT5_FEE;
public static int CH_SUPPORT6_FEE;
public static int CH_SUPPORT7_FEE;
public static int CH_SUPPORT8_FEE;
public static long CH_CURTAIN_FEE_RATIO;
public static int CH_CURTAIN1_FEE;
public static int CH_CURTAIN2_FEE;
public static long CH_FRONT_FEE_RATIO;
public static int CH_FRONT1_FEE;
public static int CH_FRONT2_FEE;
public static int DEVASTATED_DAY;
public static int DEVASTATED_HOUR;
public static int DEVASTATED_MINUTES;
public static int PARTISAN_DAY;
public static int PARTISAN_HOUR;
public static int PARTISAN_MINUTES;
public static boolean CHAMPION_ENABLE;
public static int CHAMPION_FREQUENCY;
public static int CHAMP_MIN_LVL;
public static int CHAMP_MAX_LVL;
public static int CHAMPION_HP;
public static int CHAMPION_REWARDS;
public static int CHAMPION_ADENAS_REWARDS;
public static float CHAMPION_HP_REGEN;
public static float CHAMPION_ATK;
public static float CHAMPION_SPD_ATK;
public static int CHAMPION_REWARD;
public static int CHAMPION_REWARD_ID;
public static int CHAMPION_REWARD_QTY;
public static String CHAMP_TITLE;
public static boolean MERCHANT_ZERO_SELL_PRICE;
public static boolean ALLOW_WEDDING;
public static int WEDDING_PRICE;
public static boolean WEDDING_PUNISH_INFIDELITY;
public static boolean WEDDING_TELEPORT;
public static int WEDDING_TELEPORT_PRICE;
public static int WEDDING_TELEPORT_DURATION;
public static int WEDDING_NAME_COLOR_NORMAL;
public static int WEDDING_NAME_COLOR_GEY;
public static int WEDDING_NAME_COLOR_LESBO;
public static boolean WEDDING_SAMESEX;
public static boolean WEDDING_FORMALWEAR;
public static int WEDDING_DIVORCE_COSTS;
public static boolean GIVE_CUPID_BOW;
public static boolean ANNOUNCE_WEDDING;
public static final int REWARD_PER_TIME_MODE_RESTRICTION = 2;
public static int DAILY_REWARD_ITEM_ID;
public static boolean ENABLE_DAILY;
public static int MIN_LEVEL_TO_DAILYREWARD;
public static int DAILY_REWARD_AMOUNT;
public static String TVT_EVEN_TEAMS;
public static boolean TVT_ALLOW_INTERFERENCE;
public static boolean TVT_ALLOW_POTIONS;
public static boolean TVT_ALLOW_SUMMON;
public static boolean TVT_ON_START_REMOVE_ALL_EFFECTS;
public static boolean TVT_ON_START_UNSUMMON_PET;
public static boolean TVT_REVIVE_RECOVERY;
public static boolean TVT_ANNOUNCE_TEAM_STATS;
public static boolean TVT_ANNOUNCE_REWARD;
public static boolean TVT_PRICE_NO_KILLS;
public static boolean TVT_JOIN_CURSED;
public static boolean TVT_COMMAND;
public static long TVT_REVIVE_DELAY;
public static boolean TVT_OPEN_FORT_DOORS;
public static boolean TVT_CLOSE_FORT_DOORS;
public static boolean TVT_OPEN_ADEN_COLOSSEUM_DOORS;
public static boolean TVT_CLOSE_ADEN_COLOSSEUM_DOORS;
public static int TVT_TOP_KILLER_REWARD;
public static int TVT_TOP_KILLER_QTY;
public static boolean TVT_AURA;
public static boolean TVT_STATS_LOGGER;
public static boolean TVT_REMOVE_BUFFS_ON_DIE;
public static int TW_TOWN_ID;
public static boolean TW_ALL_TOWNS;
public static int TW_ITEM_ID;
public static int TW_ITEM_AMOUNT;
public static boolean TW_ALLOW_KARMA;
public static boolean TW_DISABLE_GK;
public static boolean TW_RESS_ON_DIE;
public static boolean REBIRTH_ENABLE;
public static String[] REBIRTH_ITEM_PRICE;
public static String[] REBIRTH_MAGE_SKILL;
public static String[] REBIRTH_FIGHTER_SKILL;
public static int REBIRTH_MIN_LEVEL;
public static int REBIRTH_MAX;
public static int REBIRTH_RETURN_TO_LEVEL;
public static boolean PCB_ENABLE;
public static int PCB_MIN_LEVEL;
public static int PCB_POINT_MIN;
public static int PCB_POINT_MAX;
public static int PCB_CHANCE_DUAL_POINT;
public static int PCB_INTERVAL;
public static boolean ALT_DEV_NO_QUESTS;
public static boolean ALT_DEV_NO_SPAWNS;
public static boolean ALT_DEV_NO_SCRIPT;
public static boolean ALT_DEV_NO_RB;
public static boolean SERVER_LIST_TESTSERVER;
public static boolean SERVER_GMONLY;
public static boolean GMAUDIT;
public static boolean LOG_CHAT;
public static boolean LOG_ITEMS;
public static boolean LAZY_CACHE;
public static boolean CHECK_HTML_ENCODING;
public static boolean IS_CRAFTING_ENABLED;
public static int DWARF_RECIPE_LIMIT;
public static int COMMON_RECIPE_LIMIT;
public static boolean ALT_GAME_CREATION;
public static double ALT_GAME_CREATION_SPEED;
public static double ALT_GAME_CREATION_XP_RATE;
public static double ALT_GAME_CREATION_SP_RATE;
public static boolean ALT_BLACKSMITH_USE_RECIPES;
public static boolean BANKING_SYSTEM_ENABLED;
public static int BANKING_SYSTEM_GOLDBARS;
public static int BANKING_SYSTEM_ADENA;
public static int BUFFER_MAX_SCHEMES;
public static int BUFFER_STATIC_BUFF_COST;
public static boolean OFFLINE_TRADE_ENABLE;
public static boolean OFFLINE_CRAFT_ENABLE;
public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR;
public static boolean OFFLINE_MODE_IN_PEACE_ZONE;
public static boolean OFFLINE_MODE_SET_INVULNERABLE;
public static boolean OFFLINE_COMMAND1;
public static boolean OFFLINE_COMMAND2;
public static boolean OFFLINE_LOGOUT;
public static boolean OFFLINE_SLEEP_EFFECT;
public static boolean RESTORE_OFFLINERS;
public static int OFFLINE_MAX_DAYS;
public static boolean OFFLINE_DISCONNECT_FINISHED;
public static boolean DM_ALLOW_INTERFERENCE;
public static boolean DM_ALLOW_POTIONS;
public static boolean DM_ALLOW_SUMMON;
public static boolean DM_JOIN_CURSED;
public static boolean DM_ON_START_REMOVE_ALL_EFFECTS;
public static boolean DM_ON_START_UNSUMMON_PET;
public static long DM_REVIVE_DELAY;
public static boolean DM_COMMAND;
public static boolean DM_ENABLE_KILL_REWARD;
public static int DM_KILL_REWARD_ID;
public static int DM_KILL_REWARD_AMOUNT;
public static boolean DM_ANNOUNCE_REWARD;
public static boolean DM_REVIVE_RECOVERY;
public static int DM_SPAWN_OFFSET;
public static boolean DM_STATS_LOGGER;
public static boolean DM_ALLOW_HEALER_CLASSES;
public static boolean DM_REMOVE_BUFFS_ON_DIE;
public static String CTF_EVEN_TEAMS;
public static boolean CTF_ALLOW_INTERFERENCE;
public static boolean CTF_ALLOW_POTIONS;
public static boolean CTF_ALLOW_SUMMON;
public static boolean CTF_ON_START_REMOVE_ALL_EFFECTS;
public static boolean CTF_ON_START_UNSUMMON_PET;
public static boolean CTF_ANNOUNCE_TEAM_STATS;
public static boolean CTF_ANNOUNCE_REWARD;
public static boolean CTF_JOIN_CURSED;
public static boolean CTF_REVIVE_RECOVERY;
public static boolean CTF_COMMAND;
public static boolean CTF_AURA;
public static boolean CTF_STATS_LOGGER;
public static int CTF_SPAWN_OFFSET;
public static boolean CTF_REMOVE_BUFFS_ON_DIE;
public static boolean ONLINE_PLAYERS_ON_LOGIN;
public static boolean SUBSTUCK_SKILLS;
public static boolean ALT_SERVER_NAME_ENABLED;
public static boolean ANNOUNCE_TO_ALL_SPAWN_RB;
public static boolean ANNOUNCE_TRY_BANNED_ACCOUNT;
public static String ALT_Server_Name;
public static boolean DONATOR_NAME_COLOR_ENABLED;
public static int DONATOR_NAME_COLOR;
public static int DONATOR_TITLE_COLOR;
public static float DONATOR_XPSP_RATE;
public static float DONATOR_ADENA_RATE;
public static float DONATOR_DROP_RATE;
public static float DONATOR_SPOIL_RATE;
public static boolean CUSTOM_SPAWNLIST_TABLE;
public static boolean SAVE_GMSPAWN_ON_CUSTOM;
public static boolean DELETE_GMSPAWN_ON_CUSTOM;
public static boolean CUSTOM_NPC_TABLE = true;
public static boolean CUSTOM_TELEPORT_TABLE = true;
public static boolean CUSTOM_DROPLIST_TABLE = true;
public static boolean CUSTOM_MERCHANT_TABLES = true;
public static boolean ALLOW_SIMPLE_STATS_VIEW;
public static boolean ALLOW_DETAILED_STATS_VIEW;
public static boolean ALLOW_ONLINE_VIEW;
public static boolean WELCOME_HTM;
public static String ALLOWED_SKILLS;
public static List<Integer> ALLOWED_SKILLS_LIST = new ArrayList<>();
public static boolean PROTECTOR_PLAYER_PK;
public static boolean PROTECTOR_PLAYER_PVP;
public static int PROTECTOR_RADIUS_ACTION;
public static int PROTECTOR_SKILLID;
public static int PROTECTOR_SKILLLEVEL;
public static int PROTECTOR_SKILLTIME;
public static String PROTECTOR_MESSAGE;
public static boolean CASTLE_SHIELD;
public static boolean CLANHALL_SHIELD;
public static boolean APELLA_ARMORS;
public static boolean OATH_ARMORS;
public static boolean CASTLE_CROWN;
public static boolean CASTLE_CIRCLETS;
public static boolean KEEP_SUBCLASS_SKILLS;
public static boolean CHAR_TITLE;
public static String ADD_CHAR_TITLE;
public static boolean NOBLE_CUSTOM_ITEMS;
public static boolean HERO_CUSTOM_ITEMS;
public static boolean ALLOW_CREATE_LVL;
public static int CHAR_CREATE_LVL;
public static boolean SPAWN_CHAR;
public static int SPAWN_X;
public static int SPAWN_Y;
public static int SPAWN_Z;
public static boolean ALLOW_HERO_SUBSKILL;
public static int HERO_COUNT;
public static int CRUMA_TOWER_LEVEL_RESTRICT;
public static boolean ALLOW_RAID_BOSS_PETRIFIED;
public static int ALT_PLAYER_PROTECTION_LEVEL;
public static boolean ALLOW_LOW_LEVEL_TRADE;
public static boolean USE_CHAT_FILTER;
public static int MONSTER_RETURN_DELAY;
public static boolean SCROLL_STACKABLE;
public static boolean ALLOW_CHAR_KILL_PROTECT;
public static int CLAN_LEADER_COLOR;
public static int CLAN_LEADER_COLOR_CLAN_LEVEL;
public static boolean CLAN_LEADER_COLOR_ENABLED;
public static int CLAN_LEADER_COLORED;
public static boolean SAVE_RAIDBOSS_STATUS_INTO_DB;
public static boolean DISABLE_WEIGHT_PENALTY;
public static int DIFFERENT_Z_CHANGE_OBJECT;
public static int DIFFERENT_Z_NEW_MOVIE;
public static int HERO_CUSTOM_ITEM_ID;
public static int NOOBLE_CUSTOM_ITEM_ID;
public static int HERO_CUSTOM_DAY;
public static boolean ALLOW_FARM1_COMMAND;
public static boolean ALLOW_FARM2_COMMAND;
public static boolean ALLOW_PVP1_COMMAND;
public static boolean ALLOW_PVP2_COMMAND;
public static int FARM1_X;
public static int FARM1_Y;
public static int FARM1_Z;
public static int PVP1_X;
public static int PVP1_Y;
public static int PVP1_Z;
public static int FARM2_X;
public static int FARM2_Y;
public static int FARM2_Z;
public static int PVP2_X;
public static int PVP2_Y;
public static int PVP2_Z;
public static String FARM1_CUSTOM_MESSAGE;
public static String FARM2_CUSTOM_MESSAGE;
public static String PVP1_CUSTOM_MESSAGE;
public static String PVP2_CUSTOM_MESSAGE;
public static boolean GM_TRADE_RESTRICTED_ITEMS;
public static boolean GM_RESTART_FIGHTING;
public static boolean PM_MESSAGE_ON_START;
public static boolean SERVER_TIME_ON_START;
public static String PM_SERVER_NAME;
public static String PM_TEXT1;
public static String PM_TEXT2;
public static boolean NEW_PLAYER_EFFECT;
public static int KARMA_MIN_KARMA;
public static int KARMA_MAX_KARMA;
public static int KARMA_XP_DIVIDER;
public static int KARMA_LOST_BASE;
public static boolean KARMA_DROP_GM;
public static boolean KARMA_AWARD_PK_KILL;
public static int KARMA_PK_LIMIT;
public static String KARMA_NONDROPPABLE_PET_ITEMS;
public static String KARMA_NONDROPPABLE_ITEMS;
public static List<Integer> KARMA_LIST_NONDROPPABLE_PET_ITEMS = new ArrayList<>();
public static List<Integer> KARMA_LIST_NONDROPPABLE_ITEMS = new ArrayList<>();
public static int PVP_NORMAL_TIME;
public static int PVP_PVP_TIME;
public static boolean PVP_COLOR_SYSTEM_ENABLED;
public static int PVP_AMOUNT1;
public static int PVP_AMOUNT2;
public static int PVP_AMOUNT3;
public static int PVP_AMOUNT4;
public static int PVP_AMOUNT5;
public static int NAME_COLOR_FOR_PVP_AMOUNT1;
public static int NAME_COLOR_FOR_PVP_AMOUNT2;
public static int NAME_COLOR_FOR_PVP_AMOUNT3;
public static int NAME_COLOR_FOR_PVP_AMOUNT4;
public static int NAME_COLOR_FOR_PVP_AMOUNT5;
public static boolean PK_COLOR_SYSTEM_ENABLED;
public static int PK_AMOUNT1;
public static int PK_AMOUNT2;
public static int PK_AMOUNT3;
public static int PK_AMOUNT4;
public static int PK_AMOUNT5;
public static int TITLE_COLOR_FOR_PK_AMOUNT1;
public static int TITLE_COLOR_FOR_PK_AMOUNT2;
public static int TITLE_COLOR_FOR_PK_AMOUNT3;
public static int TITLE_COLOR_FOR_PK_AMOUNT4;
public static int TITLE_COLOR_FOR_PK_AMOUNT5;
public static boolean PVP_REWARD_ENABLED;
public static int PVP_REWARD_ID;
public static int PVP_REWARD_AMOUNT;
public static boolean PK_REWARD_ENABLED;
public static int PK_REWARD_ID;
public static int PK_REWARD_AMOUNT;
public static int REWARD_PROTECT;
public static boolean ENABLE_PK_INFO;
public static boolean FLAGED_PLAYER_USE_BUFFER;
public static boolean FLAGED_PLAYER_CAN_USE_GK;
public static boolean PVPEXPSP_SYSTEM;
public static int ADD_EXP;
public static int ADD_SP;
public static boolean ALLOW_POTS_IN_PVP;
public static boolean ALLOW_SOE_IN_PVP;
public static boolean ANNOUNCE_PVP_KILL;
public static boolean ANNOUNCE_PK_KILL;
public static boolean ANNOUNCE_ALL_KILL;
public static int DUEL_SPAWN_X;
public static int DUEL_SPAWN_Y;
public static int DUEL_SPAWN_Z;
public static boolean PVP_PK_TITLE;
public static String PVP_TITLE_PREFIX;
public static String PK_TITLE_PREFIX;
public static boolean WAR_LEGEND_AURA;
public static int KILLS_TO_GET_WAR_LEGEND_AURA;
public static boolean ANTI_FARM_ENABLED;
public static boolean ANTI_FARM_CLAN_ALLY_ENABLED;
public static boolean ANTI_FARM_LVL_DIFF_ENABLED;
public static int ANTI_FARM_MAX_LVL_DIFF;
public static boolean ANTI_FARM_PDEF_DIFF_ENABLED;
public static int ANTI_FARM_MAX_PDEF_DIFF;
public static boolean ANTI_FARM_PATK_DIFF_ENABLED;
public static int ANTI_FARM_MAX_PATK_DIFF;
public static boolean ANTI_FARM_PARTY_ENABLED;
public static boolean ANTI_FARM_IP_ENABLED;
public static boolean ANTI_FARM_SUMMON;
public static int ALT_OLY_NUMBER_HEROS_EACH_CLASS;
public static boolean ALT_OLY_LOG_FIGHTS;
public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
public static boolean ALT_OLY_ANNOUNCE_GAMES;
public static List<Integer> LIST_OLY_RESTRICTED_SKILLS = new ArrayList<>();
public static boolean ALT_OLY_AUGMENT_ALLOW;
public static int ALT_OLY_TELEPORT_COUNTDOWN;
public static int ALT_OLY_START_TIME;
public static int ALT_OLY_MIN;
public static long ALT_OLY_CPERIOD;
public static long ALT_OLY_BATTLE;
public static long ALT_OLY_WPERIOD;
public static long ALT_OLY_VPERIOD;
public static int ALT_OLY_CLASSED;
public static int ALT_OLY_NONCLASSED;
public static int ALT_OLY_BATTLE_REWARD_ITEM;
public static int ALT_OLY_CLASSED_RITEM_C;
public static int ALT_OLY_NONCLASSED_RITEM_C;
public static int ALT_OLY_GP_PER_POINT;
public static int ALT_OLY_MIN_POINT_FOR_EXCH;
public static int ALT_OLY_HERO_POINTS;
public static String ALT_OLY_RESTRICTED_ITEMS;
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>();
public static boolean ALLOW_EVENTS_DURING_OLY;
public static boolean ALT_OLY_RECHARGE_SKILLS;
public static int ALT_OLY_COMP_RITEM;
public static boolean REMOVE_CUBIC_OLYMPIAD;
public static boolean ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS;
public static OlympiadPeriod ALT_OLY_PERIOD;
public static int ALT_OLY_PERIOD_MULTIPLIER;
public static List<Integer> ALT_OLY_COMPETITION_DAYS;
public static Map<Integer, Integer> NORMAL_WEAPON_ENCHANT_LEVEL = new HashMap<>();
public static Map<Integer, Integer> BLESS_WEAPON_ENCHANT_LEVEL = new HashMap<>();
public static Map<Integer, Integer> CRYSTAL_WEAPON_ENCHANT_LEVEL = new HashMap<>();
public static Map<Integer, Integer> NORMAL_ARMOR_ENCHANT_LEVEL = new HashMap<>();
public static Map<Integer, Integer> BLESS_ARMOR_ENCHANT_LEVEL = new HashMap<>();
public static Map<Integer, Integer> CRYSTAL_ARMOR_ENCHANT_LEVEL = new HashMap<>();
public static Map<Integer, Integer> NORMAL_JEWELRY_ENCHANT_LEVEL = new HashMap<>();
public static Map<Integer, Integer> BLESS_JEWELRY_ENCHANT_LEVEL = new HashMap<>();
public static Map<Integer, Integer> CRYSTAL_JEWELRY_ENCHANT_LEVEL = new HashMap<>();
public static int ENCHANT_SAFE_MAX;
public static int ENCHANT_SAFE_MAX_FULL;
public static int ENCHANT_WEAPON_MAX;
public static int ENCHANT_ARMOR_MAX;
public static int ENCHANT_JEWELRY_MAX;
public static int CRYSTAL_ENCHANT_MAX;
public static int CRYSTAL_ENCHANT_MIN;
public static boolean ENABLE_DWARF_ENCHANT_BONUS;
public static int DWARF_ENCHANT_MIN_LEVEL;
public static int DWARF_ENCHANT_BONUS;
public static int AUGMENTATION_NG_SKILL_CHANCE;
public static int AUGMENTATION_MID_SKILL_CHANCE;
public static int AUGMENTATION_HIGH_SKILL_CHANCE;
public static int AUGMENTATION_TOP_SKILL_CHANCE;
public static int AUGMENTATION_BASESTAT_CHANCE;
public static int AUGMENTATION_NG_GLOW_CHANCE;
public static int AUGMENTATION_MID_GLOW_CHANCE;
public static int AUGMENTATION_HIGH_GLOW_CHANCE;
public static int AUGMENTATION_TOP_GLOW_CHANCE;
public static boolean DELETE_AUGM_PASSIVE_ON_CHANGE;
public static boolean DELETE_AUGM_ACTIVE_ON_CHANGE;
public static boolean ENCHANT_HERO_WEAPON;
public static int SOUL_CRYSTAL_BREAK_CHANCE;
public static int SOUL_CRYSTAL_LEVEL_CHANCE;
public static int SOUL_CRYSTAL_MAX_LEVEL;
public static int CUSTOM_ENCHANT_VALUE;
public static int ALT_OLY_ENCHANT_LIMIT;
public static int BREAK_ENCHANT;
public static int GM_OVER_ENCHANT;
public static int MAX_ITEM_ENCHANT_KICK;
public static FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM;
public static FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE;
public static FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK;
public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON;
public static FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE;
public static FloodProtectorConfig FLOOD_PROTECTOR_GLOBAL_CHAT;
public static FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS;
public static FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM;
public static FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS;
public static FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL;
public static FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION;
public static FloodProtectorConfig FLOOD_PROTECTOR_MANUFACTURE;
public static FloodProtectorConfig FLOOD_PROTECTOR_MANOR;
public static FloodProtectorConfig FLOOD_PROTECTOR_CHARACTER_SELECT;
public static FloodProtectorConfig FLOOD_PROTECTOR_UNKNOWN_PACKETS;
public static FloodProtectorConfig FLOOD_PROTECTOR_PARTY_INVITATION;
public static FloodProtectorConfig FLOOD_PROTECTOR_SAY_ACTION;
public static FloodProtectorConfig FLOOD_PROTECTOR_MOVE_ACTION;
public static FloodProtectorConfig FLOOD_PROTECTOR_GENERIC_ACTION;
public static FloodProtectorConfig FLOOD_PROTECTOR_MACRO;
public static FloodProtectorConfig FLOOD_PROTECTOR_POTION;
public static boolean CHECK_SKILLS_ON_ENTER;
public static boolean CHECK_NAME_ON_LOGIN;
public static boolean L2WALKER_PROTECTION;
public static boolean PROTECTED_ENCHANT;
public static boolean ONLY_GM_ITEMS_FREE;
public static boolean ONLY_GM_TELEPORT_FREE;
public static boolean ALLOW_DUALBOX;
public static int ALLOWED_BOXES;
public static boolean ALLOW_DUALBOX_OLY;
public static boolean ALLOW_DUALBOX_EVENT;
public static int BLOW_ATTACK_FRONT;
public static int BLOW_ATTACK_SIDE;
public static int BLOW_ATTACK_BEHIND;
public static int BACKSTAB_ATTACK_FRONT;
public static int BACKSTAB_ATTACK_SIDE;
public static int BACKSTAB_ATTACK_BEHIND;
public static int MAX_PATK_SPEED;
public static int MAX_MATK_SPEED;
public static int MAX_PCRIT_RATE;
public static int MAX_MCRIT_RATE;
public static float MCRIT_RATE_MUL;
public static int RUN_SPD_BOOST;
public static int MAX_RUN_SPEED;
public static float ALT_MAGES_PHYSICAL_DAMAGE_MULTI;
public static float ALT_MAGES_MAGICAL_DAMAGE_MULTI;
public static float ALT_FIGHTERS_PHYSICAL_DAMAGE_MULTI;
public static float ALT_FIGHTERS_MAGICAL_DAMAGE_MULTI;
public static float ALT_PETS_PHYSICAL_DAMAGE_MULTI;
public static float ALT_PETS_MAGICAL_DAMAGE_MULTI;
public static float ALT_NPC_PHYSICAL_DAMAGE_MULTI;
public static float ALT_NPC_MAGICAL_DAMAGE_MULTI;
public static float ALT_DAGGER_DMG_VS_HEAVY;
public static float ALT_DAGGER_DMG_VS_ROBE;
public static float ALT_DAGGER_DMG_VS_LIGHT;
public static boolean ALLOW_RAID_LETHAL;
public static boolean ALLOW_LETHAL_PROTECTION_MOBS;
public static String LETHAL_PROTECTED_MOBS;
public static List<Integer> LIST_LETHAL_PROTECTED_MOBS = new ArrayList<>();
public static float MAGIC_CRITICAL_POWER;
public static float STUN_CHANCE_MODIFIER;
public static float BLEED_CHANCE_MODIFIER;
public static float POISON_CHANCE_MODIFIER;
public static float PARALYZE_CHANCE_MODIFIER;
public static float ROOT_CHANCE_MODIFIER;
public static float SLEEP_CHANCE_MODIFIER;
public static float FEAR_CHANCE_MODIFIER;
public static float CONFUSION_CHANCE_MODIFIER;
public static float DEBUFF_CHANCE_MODIFIER;
public static float BUFF_CHANCE_MODIFIER;
public static boolean SEND_SKILLS_CHANCE_TO_PLAYERS;
public static boolean REMOVE_WEAPON_SUBCLASS;
public static boolean REMOVE_CHEST_SUBCLASS;
public static boolean REMOVE_LEG_SUBCLASS;
public static boolean ENABLE_CLASS_DAMAGE_SETTINGS;
public static boolean ENABLE_CLASS_DAMAGE_SETTINGS_IN_OLY;
public static boolean ENABLE_CLASS_DAMAGE_LOGGER;
public static boolean LEAVE_BUFFS_ON_DIE;
public static boolean ALT_RAIDS_STATS_BONUS;
public static String GEODATA_PATH;
public static int COORD_SYNCHRONIZE;
public static int PART_OF_CHARACTER_HEIGHT;
public static int MAX_OBSTACLE_HEIGHT;
public static boolean PATHFINDING;
public static String PATHFIND_BUFFERS;
public static int BASE_WEIGHT;
public static int DIAGONAL_WEIGHT;
public static int HEURISTIC_WEIGHT;
public static int OBSTACLE_MULTIPLIER;
public static int MAX_ITERATIONS;
public static boolean FALL_DAMAGE;
public static boolean ALLOW_WATER;
public static int RBLOCKRAGE;
public static boolean PLAYERS_CAN_HEAL_RB;
public static HashMap<Integer, Integer> RBS_SPECIFIC_LOCK_RAGE;
public static boolean ALLOW_DIRECT_TP_TO_BOSS_ROOM;
public static boolean ANTHARAS_OLD;
public static int ANTHARAS_CLOSE;
public static int ANTHARAS_DESPAWN_TIME;
public static int ANTHARAS_RESP_FIRST;
public static int ANTHARAS_RESP_SECOND;
public static int ANTHARAS_WAIT_TIME;
public static float ANTHARAS_POWER_MULTIPLIER;
public static int BAIUM_SLEEP;
public static int BAIUM_RESP_FIRST;
public static int BAIUM_RESP_SECOND;
public static float BAIUM_POWER_MULTIPLIER;
public static int CORE_RESP_MINION;
public static int CORE_RESP_FIRST;
public static int CORE_RESP_SECOND;
public static int CORE_LEVEL;
public static int CORE_RING_CHANCE;
public static float CORE_POWER_MULTIPLIER;
public static int QA_RESP_NURSE;
public static int QA_RESP_ROYAL;
public static int QA_RESP_FIRST;
public static int QA_RESP_SECOND;
public static int QA_LEVEL;
public static int QA_RING_CHANCE;
public static float QA_POWER_MULTIPLIER;
public static float LEVEL_DIFF_MULTIPLIER_MINION;
public static int HPH_FIXINTERVALOFHALTER;
public static int HPH_RANDOMINTERVALOFHALTER;
public static int HPH_APPTIMEOFHALTER;
public static int HPH_ACTIVITYTIMEOFHALTER;
public static int HPH_FIGHTTIMEOFHALTER;
public static int HPH_CALLROYALGUARDHELPERCOUNT;
public static int HPH_CALLROYALGUARDHELPERINTERVAL;
public static int HPH_INTERVALOFDOOROFALTER;
public static int HPH_TIMEOFLOCKUPDOOROFALTAR;
public static int ZAKEN_RESP_FIRST;
public static int ZAKEN_RESP_SECOND;
public static int ZAKEN_LEVEL;
public static int ZAKEN_EARRING_CHANCE;
public static float ZAKEN_POWER_MULTIPLIER;
public static int ORFEN_RESP_FIRST;
public static int ORFEN_RESP_SECOND;
public static int ORFEN_LEVEL;
public static int ORFEN_EARRING_CHANCE;
public static float ORFEN_POWER_MULTIPLIER;
public static int VALAKAS_RESP_FIRST;
public static int VALAKAS_RESP_SECOND;
public static int VALAKAS_WAIT_TIME;
public static int VALAKAS_DESPAWN_TIME;
public static float VALAKAS_POWER_MULTIPLIER;
public static int FRINTEZZA_RESP_FIRST;
public static int FRINTEZZA_RESP_SECOND;
public static float FRINTEZZA_POWER_MULTIPLIER;
public static boolean BYPASS_FRINTEZZA_PARTIES_CHECK;
public static int FRINTEZZA_MIN_PARTIES;
public static int FRINTEZZA_MAX_PARTIES;
public static String RAID_INFO_IDS;
public static List<Integer> RAID_INFO_IDS_LIST = new ArrayList<>();
public static boolean AUTO_LOOT;
public static boolean AUTO_LOOT_HERBS;
public static boolean AUTO_LOOT_BOSS;
public static boolean AUTO_LEARN_SKILLS;
public static boolean AUTO_LEARN_DIVINE_INSPIRATION;
public static boolean LIFE_CRYSTAL_NEEDED;
public static boolean SP_BOOK_NEEDED;
public static boolean ES_SP_BOOK_NEEDED;
public static boolean DIVINE_SP_BOOK_NEEDED;
public static boolean ALT_GAME_SKILL_LEARN;
public static int ALLOWED_SUBCLASS;
public static byte BASE_SUBCLASS_LEVEL;
public static byte MAX_SUBCLASS_LEVEL;
public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
public static boolean ALT_RESTORE_EFFECTS_ON_SUBCLASS_CHANGE;
public static int ALT_PARTY_RANGE;
public static double ALT_WEIGHT_LIMIT;
public static boolean ALT_GAME_DELEVEL;
public static boolean ALT_GAME_MAGICFAILURES;
public static boolean ALT_GAME_CANCEL_CAST;
public static boolean ALT_GAME_CANCEL_BOW;
public static boolean ALT_GAME_SHIELD_BLOCKS;
public static int ALT_PERFECT_SHLD_BLOCK;
public static boolean ALT_GAME_MOB_ATTACK_AI;
public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
public static boolean ALT_GAME_FREIGHTS;
public static int ALT_GAME_FREIGHT_PRICE;
public static float ALT_GAME_EXPONENT_XP;
public static float ALT_GAME_EXPONENT_SP;
public static boolean ALT_GAME_TIREDNESS;
public static boolean ALT_GAME_FREE_TELEPORT;
public static boolean ALT_RECOMMEND;
public static int ALT_RECOMMENDATIONS_NUMBER;
public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
public static int MAX_LEVEL_NEWBIE;
public static int MAX_LEVEL_NEWBIE_STATUS;
public static boolean DISABLE_TUTORIAL;
public static int STARTING_ADENA;
public static int STARTING_AA;
public static boolean CUSTOM_STARTER_ITEMS_ENABLED;
public static List<int[]> STARTING_CUSTOM_ITEMS_F = new ArrayList<>();
public static List<int[]> STARTING_CUSTOM_ITEMS_M = new ArrayList<>();
public static int INVENTORY_MAXIMUM_NO_DWARF;
public static int INVENTORY_MAXIMUM_DWARF;
public static int INVENTORY_MAXIMUM_GM;
public static int MAX_ITEM_IN_PACKET;
public static int WAREHOUSE_SLOTS_DWARF;
public static int WAREHOUSE_SLOTS_NO_DWARF;
public static int WAREHOUSE_SLOTS_CLAN;
public static int FREIGHT_SLOTS;
public static int MAX_PVTSTORE_SLOTS_DWARF;
public static int MAX_PVTSTORE_SLOTS_OTHER;
public static double HP_REGEN_MULTIPLIER;
public static double MP_REGEN_MULTIPLIER;
public static double CP_REGEN_MULTIPLIER;
public static boolean ENABLE_KEYBOARD_MOVEMENT;
public static int UNSTUCK_INTERVAL;
public static int PLAYER_SPAWN_PROTECTION;
public static int PLAYER_TELEPORT_PROTECTION;
public static int PLAYER_FAKEDEATH_UP_PROTECTION;
public static boolean DEEPBLUE_DROP_RULES;
public static String PARTY_XP_CUTOFF_METHOD;
public static double PARTY_XP_CUTOFF_PERCENT;
public static int PARTY_XP_CUTOFF_LEVEL;
public static double RESPAWN_RESTORE_CP;
public static double RESPAWN_RESTORE_HP;
public static double RESPAWN_RESTORE_MP;
public static boolean RESPAWN_RANDOM_ENABLED;
public static int RESPAWN_RANDOM_MAX_OFFSET;
public static boolean PETITIONING_ALLOWED;
public static int MAX_PETITIONS_PER_PLAYER;
public static int MAX_PETITIONS_PENDING;
public static int DEATH_PENALTY_CHANCE;
public static boolean EFFECT_CANCELING;
public static boolean STORE_SKILL_COOLTIME;
public static byte BUFFS_MAX_AMOUNT;
public static byte DEBUFFS_MAX_AMOUNT;
public static boolean ENABLE_MODIFY_SKILL_DURATION;
public static Map<Integer, Integer> SKILL_DURATION_LIST;
public static boolean ALLOW_CLASS_MASTERS;
public static boolean CLASS_MASTER_STRIDER_UPDATE;
public static boolean ALLOW_CLASS_MASTERS_FIRST_CLASS;
public static boolean ALLOW_CLASS_MASTERS_SECOND_CLASS;
public static boolean ALLOW_CLASS_MASTERS_THIRD_CLASS;
public static ClassMasterSettings CLASS_MASTER_SETTINGS;
public static boolean ALLOW_REMOTE_CLASS_MASTERS;
public static long DEADLOCKCHECK_INTIAL_TIME;
public static long DEADLOCKCHECK_DELAY_TIME;
public static ArrayList<String> QUESTION_LIST = new ArrayList<>();
public static int SERVER_ID;
public static byte[] HEX_ID;
public static int PORT_LOGIN;
public static String LOGIN_BIND_ADDRESS;
public static int LOGIN_TRY_BEFORE_BAN;
public static int LOGIN_BLOCK_AFTER_BAN;
public static int GAME_SERVER_LOGIN_PORT;
public static String GAME_SERVER_LOGIN_HOST;
public static String INTERNAL_HOSTNAME;
public static String EXTERNAL_HOSTNAME;
public static int REQUEST_ID;
public static boolean ACCEPT_ALTERNATE_ID;
public static File DATAPACK_ROOT;
public static File SCRIPT_ROOT;
public static int MAXIMUM_ONLINE_USERS;
public static boolean SERVER_LIST_BRACKET;
public static boolean SERVER_LIST_CLOCK;
public static int MIN_PROTOCOL_REVISION;
public static int MAX_PROTOCOL_REVISION;
public static int SCHEDULED_THREAD_POOL_COUNT;
public static int INSTANT_THREAD_POOL_COUNT;
public static String CNAME_TEMPLATE;
public static String PET_NAME_TEMPLATE;
public static String CLAN_NAME_TEMPLATE;
public static String ALLY_NAME_TEMPLATE;
public static int IP_UPDATE_TIME;
public static boolean SHOW_LICENCE;
public static boolean FORCE_GGAUTH;
public static boolean FLOOD_PROTECTION;
public static int FAST_CONNECTION_LIMIT;
public static int NORMAL_CONNECTION_TIME;
public static int FAST_CONNECTION_TIME;
public static int MAX_CONNECTION_PER_IP;
public static boolean ACCEPT_NEW_GAMESERVER;
public static boolean AUTO_CREATE_ACCOUNTS;
public static String NETWORK_IP_LIST;
public static long SESSION_TTL;
public static int MAX_LOGINSESSIONS;
/** MMO settings */
public static final int MMO_SELECTOR_SLEEP_TIME = 20; // default 20
public static final int MMO_MAX_SEND_PER_PASS = 80; // default 80
public static final int MMO_MAX_READ_PER_PASS = 80; // default 80
public static final int MMO_HELPER_BUFFER_COUNT = 20; // default 20
/** Client Packets Queue settings */
public static final int CLIENT_PACKET_QUEUE_SIZE = 14; // default MMO_MAX_READ_PER_PASS + 2
public static final int CLIENT_PACKET_QUEUE_MAX_BURST_SIZE = 13; // default MMO_MAX_READ_PER_PASS + 1
public static final int CLIENT_PACKET_QUEUE_MAX_PACKETS_PER_SECOND = 160; // default 160
public static final int CLIENT_PACKET_QUEUE_MEASURE_INTERVAL = 5; // default 5
public static final int CLIENT_PACKET_QUEUE_MAX_AVERAGE_PACKETS_PER_SECOND = 80; // default 80
public static final int CLIENT_PACKET_QUEUE_MAX_FLOODS_PER_MIN = 2; // default 2
public static final int CLIENT_PACKET_QUEUE_MAX_OVERFLOWS_PER_MIN = 1; // default 1
public static final int CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN = 1; // default 1
public static final int CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN = 5; // default 5
/** Packet handler settings */
public static final boolean PACKET_HANDLER_DEBUG = false;
public static void loadAccessConfig()
{
final PropertiesParser accessConfig = new PropertiesParser(ACCESS_CONFIG_FILE);
EVERYBODY_HAS_ADMIN_RIGHTS = accessConfig.getBoolean("EverybodyHasAdminRights", false);
GM_STARTUP_AUTO_LIST = accessConfig.getBoolean("GMStartupAutoList", true);
GM_HERO_AURA = accessConfig.getBoolean("GMHeroAura", false);
GM_STARTUP_BUILDER_HIDE = accessConfig.getBoolean("GMStartupBuilderHide", true);
GM_STARTUP_INVULNERABLE = accessConfig.getBoolean("GMStartupInvulnerable", true);
GM_ANNOUNCER_NAME = accessConfig.getBoolean("AnnounceGmName", false);
GM_CRITANNOUNCER_NAME = accessConfig.getBoolean("CritAnnounceName", false);
SHOW_GM_LOGIN = accessConfig.getBoolean("ShowGMLogin", false);
GM_STARTUP_INVISIBLE = accessConfig.getBoolean("GMStartupInvisible", true);
GM_SPECIAL_EFFECT = accessConfig.getBoolean("GmLoginSpecialEffect", false);
GM_STARTUP_SILENCE = accessConfig.getBoolean("GMStartupSilence", true);
GM_DEBUG_HTML_PATHS = accessConfig.getBoolean("GMDebugHtmlPaths", true);
USE_SUPER_HASTE_AS_GM_SPEED = accessConfig.getBoolean("UseSuperHasteAsGMSpeed", false);
}
public static void loadServerConfig()
{
final PropertiesParser serverConfig = new PropertiesParser(SERVER_CONFIG_FILE);
GAMESERVER_HOSTNAME = serverConfig.getString("GameserverHostname", "");
PORT_GAME = serverConfig.getInt("GameserverPort", 7777);
EXTERNAL_HOSTNAME = serverConfig.getString("ExternalHostname", "*");
INTERNAL_HOSTNAME = serverConfig.getString("InternalHostname", "*");
GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014);
GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1");
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
DATABASE_URL = serverConfig.getString("URL", "jdbc:mariadb://localhost/");
DATABASE_LOGIN = serverConfig.getString("Login", "root");
DATABASE_PASSWORD = serverConfig.getString("Password", "");
DATABASE_MAX_CONNECTIONS = serverConfig.getInt("MaximumDbConnections", 10);
BACKUP_DATABASE = serverConfig.getBoolean("BackupDatabase", false);
MYSQL_BIN_PATH = serverConfig.getString("MySqlBinLocation", "C:/xampp/mysql/bin/");
BACKUP_PATH = serverConfig.getString("BackupPath", "../backup/");
BACKUP_DAYS = serverConfig.getInt("BackupDays", 30);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
try
{
DATAPACK_ROOT = new File(serverConfig.getString("DatapackRoot", ".")).getCanonicalFile();
SCRIPT_ROOT = new File(serverConfig.getString("ScriptRoot", "./data/scripts").replaceAll("\\\\", "/")).getCanonicalFile();
}
catch (IOException e)
{
e.printStackTrace();
}
MAXIMUM_ONLINE_USERS = serverConfig.getInt("MaximumOnlineUsers", 100);
SERVER_LIST_BRACKET = serverConfig.getBoolean("ServerListBrackets", false);
SERVER_LIST_CLOCK = serverConfig.getBoolean("ServerListClock", false);
MIN_PROTOCOL_REVISION = serverConfig.getInt("MinProtocolRevision", 660);
MAX_PROTOCOL_REVISION = serverConfig.getInt("MaxProtocolRevision", 665);
if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
{
throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
}
SCHEDULED_THREAD_POOL_COUNT = serverConfig.getInt("ScheduledThreadPoolCount", 40);
INSTANT_THREAD_POOL_COUNT = serverConfig.getInt("InstantThreadPoolCount", 20);
CNAME_TEMPLATE = serverConfig.getString("CnameTemplate", ".*");
PET_NAME_TEMPLATE = serverConfig.getString("PetNameTemplate", ".*");
CLAN_NAME_TEMPLATE = serverConfig.getString("ClanNameTemplate", ".*");
ALLY_NAME_TEMPLATE = serverConfig.getString("AllyNameTemplate", ".*");
}
public static void loadTelnetConfig()
{
final PropertiesParser telnetConfig = new PropertiesParser(TELNET_CONFIG_FILE);
IS_TELNET_ENABLED = telnetConfig.getBoolean("EnableTelnet", false);
}
public static void loadRatesConfig()
{
final PropertiesParser ratesConfig = new PropertiesParser(RATES_CONFIG_FILE);
RATE_XP = ratesConfig.getFloat("RateXp", 1f);
RATE_SP = ratesConfig.getFloat("RateSp", 1f);
RATE_PARTY_XP = ratesConfig.getFloat("RatePartyXp", 1f);
RATE_PARTY_SP = ratesConfig.getFloat("RatePartySp", 1f);
RATE_QUESTS_REWARD = ratesConfig.getFloat("RateQuestsReward", 1f);
RATE_DROP_ADENA = ratesConfig.getFloat("RateDropAdena", 1f);
RATE_CONSUMABLE_COST = ratesConfig.getFloat("RateConsumableCost", 1f);
RATE_DROP_ITEMS = ratesConfig.getFloat("RateDropItems", 1f);
RATE_DROP_SEAL_STONES = ratesConfig.getFloat("RateDropSealStones", 1f);
RATE_DROP_SPOIL = ratesConfig.getFloat("RateDropSpoil", 1f);
RATE_DROP_MANOR = ratesConfig.getFloat("RateDropManor", 1f);
RATE_DROP_QUEST = ratesConfig.getFloat("RateDropQuest", 1f);
RATE_KARMA_EXP_LOST = ratesConfig.getFloat("RateKarmaExpLost", 1f);
RATE_SIEGE_GUARDS_PRICE = ratesConfig.getFloat("RateSiegeGuardsPrice", 1f);
RATE_DROP_COMMON_HERBS = ratesConfig.getFloat("RateCommonHerbs", 15f);
RATE_DROP_MP_HP_HERBS = ratesConfig.getFloat("RateHpMpHerbs", 10f);
RATE_DROP_GREATER_HERBS = ratesConfig.getFloat("RateGreaterHerbs", 4f);
RATE_DROP_SUPERIOR_HERBS = ratesConfig.getFloat("RateSuperiorHerbs", 0.80f) * 10;
RATE_DROP_SPECIAL_HERBS = ratesConfig.getFloat("RateSpecialHerbs", 0.20f) * 10;
PLAYER_DROP_LIMIT = ratesConfig.getInt("PlayerDropLimit", 3);
PLAYER_RATE_DROP = ratesConfig.getInt("PlayerRateDrop", 5);
PLAYER_RATE_DROP_ITEM = ratesConfig.getInt("PlayerRateDropItem", 70);
PLAYER_RATE_DROP_EQUIP = ratesConfig.getInt("PlayerRateDropEquip", 25);
PLAYER_RATE_DROP_EQUIP_WEAPON = ratesConfig.getInt("PlayerRateDropEquipWeapon", 5);
PET_XP_RATE = ratesConfig.getFloat("PetXpRate", 1f);
PET_FOOD_RATE = ratesConfig.getInt("PetFoodRate", 1);
SINEATER_XP_RATE = ratesConfig.getFloat("SinEaterXpRate", 1f);
KARMA_DROP_LIMIT = ratesConfig.getInt("KarmaDropLimit", 10);
KARMA_RATE_DROP = ratesConfig.getInt("KarmaRateDrop", 70);
KARMA_RATE_DROP_ITEM = ratesConfig.getInt("KarmaRateDropItem", 50);
KARMA_RATE_DROP_EQUIP = ratesConfig.getInt("KarmaRateDropEquip", 40);
KARMA_RATE_DROP_EQUIP_WEAPON = ratesConfig.getInt("KarmaRateDropEquipWeapon", 10);
ADENA_BOSS = ratesConfig.getFloat("AdenaBoss", 1f);
ADENA_RAID = ratesConfig.getFloat("AdenaRaid", 1f);
ADENA_MINION = ratesConfig.getFloat("AdenaMinion", 1f);
ITEMS_BOSS = ratesConfig.getFloat("ItemsBoss", 1f);
ITEMS_RAID = ratesConfig.getFloat("ItemsRaid", 1f);
ITEMS_MINION = ratesConfig.getFloat("ItemsMinion", 1f);
SPOIL_BOSS = ratesConfig.getFloat("SpoilBoss", 1f);
SPOIL_RAID = ratesConfig.getFloat("SpoilRaid", 1f);
SPOIL_MINION = ratesConfig.getFloat("SpoilMinion", 1f);
}
public static void loadGeneralConfig()
{
final PropertiesParser generalConfig = new PropertiesParser(GENERAL_CONFIG_FILE);
SERVER_LIST_TESTSERVER = generalConfig.getBoolean("TestServer", false);
SERVER_GMONLY = generalConfig.getBoolean("ServerGMOnly", false);
ALT_DEV_NO_QUESTS = generalConfig.getBoolean("AltDevNoQuests", false);
ALT_DEV_NO_SPAWNS = generalConfig.getBoolean("AltDevNoSpawns", false);
ALT_DEV_NO_SCRIPT = generalConfig.getBoolean("AltDevNoScript", false);
ALT_DEV_NO_RB = generalConfig.getBoolean("AltDevNoRB", false);
GMAUDIT = generalConfig.getBoolean("GMAudit", false);
LOG_CHAT = generalConfig.getBoolean("LogChat", false);
LOG_ITEMS = generalConfig.getBoolean("LogItems", false);
LAZY_CACHE = generalConfig.getBoolean("LazyCache", false);
CHECK_HTML_ENCODING = generalConfig.getBoolean("CheckHtmlEncoding", true);
REMOVE_CASTLE_CIRCLETS = generalConfig.getBoolean("RemoveCastleCirclets", true);
ALT_GAME_VIEWNPC = generalConfig.getBoolean("AltGameViewNpc", false);
ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = generalConfig.getBoolean("AltNewCharAlwaysIsNewbie", false);
ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = generalConfig.getBoolean("AltMembersCanWithdrawFromClanWH", false);
ALT_MAX_NUM_OF_CLANS_IN_ALLY = generalConfig.getInt("AltMaxNumOfClansInAlly", 3);
ALT_CLAN_MEMBERS_FOR_WAR = generalConfig.getInt("AltClanMembersForWar", 15);
ALT_CLAN_JOIN_DAYS = generalConfig.getInt("DaysBeforeJoinAClan", 5);
ALT_CLAN_CREATE_DAYS = generalConfig.getInt("DaysBeforeCreateAClan", 10);
ALT_CLAN_DISSOLVE_DAYS = generalConfig.getInt("DaysToPassToDissolveAClan", 7);
ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = generalConfig.getInt("DaysBeforeJoinAllyWhenLeaved", 1);
ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = generalConfig.getInt("DaysBeforeJoinAllyWhenDismissed", 1);
ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = generalConfig.getInt("DaysBeforeAcceptNewClanWhenDismissed", 1);
ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = generalConfig.getInt("DaysBeforeCreateNewAllyWhenDissolved", 10);
ALT_MANOR_REFRESH_TIME = generalConfig.getInt("AltManorRefreshTime", 20);
ALT_MANOR_REFRESH_MIN = generalConfig.getInt("AltManorRefreshMin", 0);
ALT_MANOR_APPROVE_TIME = generalConfig.getInt("AltManorApproveTime", 6);
ALT_MANOR_APPROVE_MIN = generalConfig.getInt("AltManorApproveMin", 0);
ALT_MANOR_MAINTENANCE_PERIOD = generalConfig.getInt("AltManorMaintenancePeriod", 360000);
ALT_MANOR_SAVE_ALL_ACTIONS = generalConfig.getBoolean("AltManorSaveAllActions", false);
ALT_MANOR_SAVE_PERIOD_RATE = generalConfig.getInt("AltManorSavePeriodRate", 2);
ALT_LOTTERY_PRIZE = generalConfig.getInt("AltLotteryPrize", 50000);
ALT_LOTTERY_TICKET_PRICE = generalConfig.getInt("AltLotteryTicketPrice", 2000);
ALT_LOTTERY_5_NUMBER_RATE = generalConfig.getFloat("AltLottery5NumberRate", 0.6f);
ALT_LOTTERY_4_NUMBER_RATE = generalConfig.getFloat("AltLottery4NumberRate", 0.2f);
ALT_LOTTERY_3_NUMBER_RATE = generalConfig.getFloat("AltLottery3NumberRate", 0.2f);
ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = generalConfig.getInt("AltLottery2and1NumberPrize", 200);
ALT_FISH_CHAMPIONSHIP_ENABLED = generalConfig.getBoolean("AltFishChampionshipEnabled", true);
ALT_FISH_CHAMPIONSHIP_REWARD_ITEM = generalConfig.getInt("AltFishChampionshipRewardItemId", 57);
ALT_FISH_CHAMPIONSHIP_REWARD_1 = generalConfig.getInt("AltFishChampionshipReward1", 800000);
ALT_FISH_CHAMPIONSHIP_REWARD_2 = generalConfig.getInt("AltFishChampionshipReward2", 500000);
ALT_FISH_CHAMPIONSHIP_REWARD_3 = generalConfig.getInt("AltFishChampionshipReward3", 300000);
ALT_FISH_CHAMPIONSHIP_REWARD_4 = generalConfig.getInt("AltFishChampionshipReward4", 200000);
ALT_FISH_CHAMPIONSHIP_REWARD_5 = generalConfig.getInt("AltFishChampionshipReward5", 100000);
RIFT_MIN_PARTY_SIZE = generalConfig.getInt("RiftMinPartySize", 5);
RIFT_MAX_JUMPS = generalConfig.getInt("MaxRiftJumps", 4);
RIFT_SPAWN_DELAY = generalConfig.getInt("RiftSpawnDelay", 10000);
RIFT_AUTO_JUMPS_TIME_MIN = generalConfig.getInt("AutoJumpsDelayMin", 480);
RIFT_AUTO_JUMPS_TIME_MAX = generalConfig.getInt("AutoJumpsDelayMax", 600);
RIFT_ENTER_COST_RECRUIT = generalConfig.getInt("RecruitCost", 18);
RIFT_ENTER_COST_SOLDIER = generalConfig.getInt("SoldierCost", 21);
RIFT_ENTER_COST_OFFICER = generalConfig.getInt("OfficerCost", 24);
RIFT_ENTER_COST_CAPTAIN = generalConfig.getInt("CaptainCost", 27);
RIFT_ENTER_COST_COMMANDER = generalConfig.getInt("CommanderCost", 30);
RIFT_ENTER_COST_HERO = generalConfig.getInt("HeroCost", 33);
RIFT_BOSS_ROOM_TIME_MUTIPLY = generalConfig.getFloat("BossRoomTimeMultiply", 1.5f);
DONT_DESTROY_SS = generalConfig.getBoolean("DontDestroySS", false);
STANDARD_RESPAWN_DELAY = generalConfig.getInt("StandardRespawnDelay", 180);
RAID_RANKING_1ST = generalConfig.getInt("1stRaidRankingPoints", 1250);
RAID_RANKING_2ND = generalConfig.getInt("2ndRaidRankingPoints", 900);
RAID_RANKING_3RD = generalConfig.getInt("3rdRaidRankingPoints", 700);
RAID_RANKING_4TH = generalConfig.getInt("4thRaidRankingPoints", 600);
RAID_RANKING_5TH = generalConfig.getInt("5thRaidRankingPoints", 450);
RAID_RANKING_6TH = generalConfig.getInt("6thRaidRankingPoints", 350);
RAID_RANKING_7TH = generalConfig.getInt("7thRaidRankingPoints", 300);
RAID_RANKING_8TH = generalConfig.getInt("8thRaidRankingPoints", 200);
RAID_RANKING_9TH = generalConfig.getInt("9thRaidRankingPoints", 150);
RAID_RANKING_10TH = generalConfig.getInt("10thRaidRankingPoints", 100);
RAID_RANKING_UP_TO_50TH = generalConfig.getInt("UpTo50thRaidRankingPoints", 25);
RAID_RANKING_UP_TO_100TH = generalConfig.getInt("UpTo100thRaidRankingPoints", 12);
EXPERTISE_PENALTY = generalConfig.getBoolean("ExpertisePenalty", true);
MASTERY_PENALTY = generalConfig.getBoolean("MasteryPenalty", false);
LEVEL_TO_GET_PENALTY = generalConfig.getInt("LevelToGetPenalty", 20);
MASTERY_WEAPON_PENALTY = generalConfig.getBoolean("MasteryWeaponPenality", false);
LEVEL_TO_GET_WEAPON_PENALTY = generalConfig.getInt("LevelToGetWeaponPenalty", 20);
ACTIVE_AUGMENTS_START_REUSE_TIME = generalConfig.getInt("AugmStartReuseTime", 0);
INVUL_NPC_LIST = new ArrayList<>();
final String t = generalConfig.getString("InvulNpcList", "30001-32132,35092-35103,35142-35146,35176-35187,35218-35232,35261-35278,35308-35319,35352-35367,35382-35407,35417-35427,35433-35469,35497-35513,35544-35587,35600-35617,35623-35628,35638-35640,35644,35645,50007,70010,99999");
String as[];
final int k = (as = t.split(",")).length;
for (int j = 0; j < k; j++)
{
final String t2 = as[j];
if (t2.contains("-"))
{
final int a1 = Integer.parseInt(t2.split("-")[0]);
final int a2 = Integer.parseInt(t2.split("-")[1]);
for (int i = a1; i <= a2; i++)
{
INVUL_NPC_LIST.add(Integer.valueOf(i));
}
}
else
{
INVUL_NPC_LIST.add(Integer.valueOf(Integer.parseInt(t2)));
}
}
DISABLE_ATTACK_NPC_TYPE = generalConfig.getBoolean("DisableAttackToNpcs", false);
ALLOWED_NPC_TYPES = generalConfig.getString("AllowedNPCTypes", "");
LIST_ALLOWED_NPC_TYPES = new ArrayList<>();
for (String npc_type : ALLOWED_NPC_TYPES.split(","))
{
LIST_ALLOWED_NPC_TYPES.add(npc_type);
}
NPC_ATTACKABLE = generalConfig.getBoolean("NpcAttackable", false);
SELL_BY_ITEM = generalConfig.getBoolean("SellByItem", false);
SELL_ITEM = generalConfig.getInt("SellItem", 57);
ALT_MOBS_STATS_BONUS = generalConfig.getBoolean("AltMobsStatsBonus", true);
ALT_PETS_STATS_BONUS = generalConfig.getBoolean("AltPetsStatsBonus", true);
RAID_HP_REGEN_MULTIPLIER = generalConfig.getDouble("RaidHpRegenMultiplier", 100) / 100;
RAID_MP_REGEN_MULTIPLIER = generalConfig.getDouble("RaidMpRegenMultiplier", 100) / 100;
RAID_P_DEFENCE_MULTIPLIER = generalConfig.getDouble("RaidPhysicalDefenceMultiplier", 100) / 100;
RAID_M_DEFENCE_MULTIPLIER = generalConfig.getDouble("RaidMagicalDefenceMultiplier", 100) / 100;
RAID_MINION_RESPAWN_TIMER = generalConfig.getDouble("RaidMinionRespawnTime", 300000);
RAID_MIN_RESPAWN_MULTIPLIER = generalConfig.getFloat("RaidMinRespawnMultiplier", 1f);
RAID_MAX_RESPAWN_MULTIPLIER = generalConfig.getFloat("RaidMaxRespawnMultiplier", 1f);
CLICK_TASK = generalConfig.getInt("ClickTaskDelay", 50);
WYVERN_SPEED = generalConfig.getInt("WyvernSpeed", 100);
STRIDER_SPEED = generalConfig.getInt("StriderSpeed", 80);
ALLOW_WYVERN_UPGRADER = generalConfig.getBoolean("AllowWyvernUpgrader", false);
ENABLE_AIO_SYSTEM = generalConfig.getBoolean("EnableAioSystem", true);
ALLOW_AIO_NCOLOR = generalConfig.getBoolean("AllowAioNameColor", true);
AIO_NCOLOR = Integer.decode("0x" + generalConfig.getString("AioNameColor", "88AA88"));
ALLOW_AIO_TCOLOR = generalConfig.getBoolean("AllowAioTitleColor", true);
AIO_TCOLOR = Integer.decode("0x" + generalConfig.getString("AioTitleColor", "88AA88"));
ALLOW_AIO_USE_GK = generalConfig.getBoolean("AllowAioUseGk", false);
ALLOW_AIO_USE_CM = generalConfig.getBoolean("AllowAioUseClassMaster", false);
ALLOW_AIO_IN_EVENTS = generalConfig.getBoolean("AllowAioInEvents", false);
if (ENABLE_AIO_SYSTEM)
{
final String[] AioSkillsSplit = generalConfig.getString("AioSkills", "").split(";");
AIO_SKILLS = new HashMap<>(AioSkillsSplit.length);
for (String skill : AioSkillsSplit)
{
final String[] skillSplit = skill.split(",");
if (skillSplit.length != 2)
{
LOGGER.info("[Aio System]: invalid config property in " + GENERAL_CONFIG_FILE + " -> AioSkills \"" + skill + "\"");
}
else
{
try
{
AIO_SKILLS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
}
catch (NumberFormatException nfe)
{
if (!skill.equals(""))
{
LOGGER.info("[Aio System]: invalid config property in " + GENERAL_CONFIG_FILE + " -> AioSkills \"" + skillSplit[0] + "\"" + skillSplit[1]);
}
}
}
}
}
PET_RENT_NPC = generalConfig.getString("ListPetRentNpc", "30827");
LIST_PET_RENT_NPC = new ArrayList<>();
for (String id : PET_RENT_NPC.split(","))
{
LIST_PET_RENT_NPC.add(Integer.parseInt(id));
}
JAIL_IS_PVP = generalConfig.getBoolean("JailIsPvp", true);
JAIL_DISABLE_CHAT = generalConfig.getBoolean("JailDisableChat", true);
USE_SAY_FILTER = generalConfig.getBoolean("UseChatFilter", false);
CHAT_FILTER_CHARS = generalConfig.getString("ChatFilterChars", "[I love L2jServer]");
CHAT_FILTER_PUNISHMENT = generalConfig.getString("ChatFilterPunishment", "off");
CHAT_FILTER_PUNISHMENT_PARAM1 = generalConfig.getInt("ChatFilterPunishmentParam1", 1);
CHAT_FILTER_PUNISHMENT_PARAM2 = generalConfig.getInt("ChatFilterPunishmentParam2", 1000);
FS_TIME_ATTACK = generalConfig.getInt("TimeOfAttack", 50);
FS_TIME_COOLDOWN = generalConfig.getInt("TimeOfCoolDown", 5);
FS_TIME_ENTRY = generalConfig.getInt("TimeOfEntry", 3);
FS_TIME_WARMUP = generalConfig.getInt("TimeOfWarmUp", 2);
FS_PARTY_MEMBER_COUNT = generalConfig.getInt("NumberOfNecessaryPartyMembers", 4);
if (FS_TIME_ATTACK <= 0)
{
FS_TIME_ATTACK = 50;
}
if (FS_TIME_COOLDOWN <= 0)
{
FS_TIME_COOLDOWN = 5;
}
if (FS_TIME_ENTRY <= 0)
{
FS_TIME_ENTRY = 3;
}
if (FS_TIME_WARMUP <= 0)
{
FS_TIME_WARMUP = 2;
}
if (FS_PARTY_MEMBER_COUNT <= 0)
{
FS_PARTY_MEMBER_COUNT = 4;
}
ALLOW_QUAKE_SYSTEM = generalConfig.getBoolean("AllowQuakeSystem", false);
ENABLE_ANTI_PVP_FARM_MSG = generalConfig.getBoolean("EnableAntiPvpFarmMsg", false);
ANNOUNCE_CASTLE_LORDS = generalConfig.getBoolean("AnnounceCastleLords", false);
ANNOUNCE_MAMMON_SPAWN = generalConfig.getBoolean("AnnounceMammonSpawn", true);
ALLOW_GUARDS = generalConfig.getBoolean("AllowGuards", false);
AUTODESTROY_ITEM_AFTER = generalConfig.getInt("AutoDestroyDroppedItemAfter", 0);
HERB_AUTO_DESTROY_TIME = generalConfig.getInt("AutoDestroyHerbTime", 15) * 1000;
PROTECTED_ITEMS = generalConfig.getString("ListOfProtectedItems", "");
LIST_PROTECTED_ITEMS = new ArrayList<>();
for (String id : PROTECTED_ITEMS.split(","))
{
LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
}
DESTROY_DROPPED_PLAYER_ITEM = generalConfig.getBoolean("DestroyPlayerDroppedItem", false);
DESTROY_EQUIPABLE_PLAYER_ITEM = generalConfig.getBoolean("DestroyEquipableItem", false);
SAVE_DROPPED_ITEM = generalConfig.getBoolean("SaveDroppedItem", false);
EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = generalConfig.getBoolean("EmptyDroppedItemTableAfterLoad", false);
SAVE_DROPPED_ITEM_INTERVAL = generalConfig.getInt("SaveDroppedItemInterval", 0) * 60000;
CLEAR_DROPPED_ITEM_TABLE = generalConfig.getBoolean("ClearDroppedItemTable", false);
PRECISE_DROP_CALCULATION = generalConfig.getBoolean("PreciseDropCalculation", true);
MULTIPLE_ITEM_DROP = generalConfig.getBoolean("MultipleItemDrop", true);
ALLOW_WAREHOUSE = generalConfig.getBoolean("AllowWarehouse", true);
WAREHOUSE_CACHE = generalConfig.getBoolean("WarehouseCache", false);
WAREHOUSE_CACHE_TIME = generalConfig.getInt("WarehouseCacheTime", 15);
ALLOW_FREIGHT = generalConfig.getBoolean("AllowFreight", true);
ALLOW_WEAR = generalConfig.getBoolean("AllowWear", false);
WEAR_DELAY = generalConfig.getInt("WearDelay", 5);
WEAR_PRICE = generalConfig.getInt("WearPrice", 10);
ALLOW_LOTTERY = generalConfig.getBoolean("AllowLottery", false);
ALLOW_RACE = generalConfig.getBoolean("AllowRace", false);
ALLOW_RENTPET = generalConfig.getBoolean("AllowRentPet", false);
ALLOW_DISCARDITEM = generalConfig.getBoolean("AllowDiscardItem", true);
ALLOWFISHING = generalConfig.getBoolean("AllowFishing", false);
ALLOW_MANOR = generalConfig.getBoolean("AllowManor", false);
ALLOW_BOAT = generalConfig.getBoolean("AllowBoat", false);
ALLOW_NPC_WALKERS = generalConfig.getBoolean("AllowNpcWalkers", true);
ALLOW_CURSED_WEAPONS = generalConfig.getBoolean("AllowCursedWeapons", false);
DEFAULT_GLOBAL_CHAT = generalConfig.getString("GlobalChat", "ON");
DEFAULT_TRADE_CHAT = generalConfig.getString("TradeChat", "ON");
MAX_CHAT_LENGTH = generalConfig.getInt("MaxChatLength", 100);
TRADE_CHAT_IS_NOOBLE = generalConfig.getBoolean("TradeChatIsNooble", false);
TRADE_CHAT_WITH_PVP = generalConfig.getBoolean("TradeChatWithPvP", false);
TRADE_PVP_AMOUNT = generalConfig.getInt("TradePvPAmount", 800);
GLOBAL_CHAT_WITH_PVP = generalConfig.getBoolean("GlobalChatWithPvP", false);
GLOBAL_PVP_AMOUNT = generalConfig.getInt("GlobalPvPAmount", 1500);
ENABLE_COMMUNITY_BOARD = generalConfig.getBoolean("EnableCommunityBoard", true);
BBS_DEFAULT = generalConfig.getString("BBSDefault", "_bbshome");
ZONE_TOWN = generalConfig.getInt("ZoneTown", 0);
MAX_DRIFT_RANGE = generalConfig.getInt("MaxDriftRange", 300);
AGGRO_DISTANCE_CHECK_ENABLED = generalConfig.getBoolean("AggroDistanceCheckEnabled", false);
AGGRO_DISTANCE_CHECK_RANGE = generalConfig.getInt("AggroDistanceCheckRange", 1500);
AGGRO_DISTANCE_CHECK_RAIDS = generalConfig.getBoolean("AggroDistanceCheckRaids", false);
AGGRO_DISTANCE_CHECK_INSTANCES = generalConfig.getBoolean("AggroDistanceCheckInstances", false);
AGGRO_DISTANCE_CHECK_RESTORE_LIFE = generalConfig.getBoolean("AggroDistanceCheckRestoreLife", true);
MIN_NPC_ANIMATION = generalConfig.getInt("MinNpcAnimation", 5);
MAX_NPC_ANIMATION = generalConfig.getInt("MaxNpcAnimation", 60);
MIN_MONSTER_ANIMATION = generalConfig.getInt("MinMonsterAnimation", 5);
MAX_MONSTER_ANIMATION = generalConfig.getInt("MaxMonsterAnimation", 60);
SHOW_NPC_LVL = generalConfig.getBoolean("ShowNpcLevel", false);
SHOW_NPC_AGGRESSION = generalConfig.getBoolean("ShowNpcAggression", false);
FORCE_INVENTORY_UPDATE = generalConfig.getBoolean("ForceInventoryUpdate", false);
FORCE_COMPLETE_STATUS_UPDATE = generalConfig.getBoolean("ForceCompletePlayerStatusUpdate", true);
CHAR_DATA_STORE_INTERVAL = generalConfig.getInt("CharacterDataStoreInterval", 15) * 60 * 1000;
UPDATE_ITEMS_ON_CHAR_STORE = generalConfig.getBoolean("UpdateItemsOnCharStore", false);
AUTODELETE_INVALID_QUEST_DATA = generalConfig.getBoolean("AutoDeleteInvalidQuestData", false);
DELETE_DAYS = generalConfig.getInt("DeleteCharAfterDays", 7);
DEFAULT_PUNISH = generalConfig.getInt("DefaultPunish", 2);
DEFAULT_PUNISH_PARAM = generalConfig.getInt("DefaultPunishParam", 0);
GRIDS_ALWAYS_ON = generalConfig.getBoolean("GridsAlwaysOn", false);
GRID_NEIGHBOR_TURNON_TIME = generalConfig.getInt("GridNeighborTurnOnTime", 30);
GRID_NEIGHBOR_TURNOFF_TIME = generalConfig.getInt("GridNeighborTurnOffTime", 300);
HIGH_RATE_SERVER_DROPS = generalConfig.getBoolean("HighRateServerDrops", false);
}
public static void load7sConfig()
{
final PropertiesParser sevenSignsConfig = new PropertiesParser(SEVENSIGNS_CONFIG_FILE);
ALT_GAME_REQUIRE_CASTLE_DAWN = sevenSignsConfig.getBoolean("AltRequireCastleForDawn", false);
ALT_GAME_REQUIRE_CLAN_CASTLE = sevenSignsConfig.getBoolean("AltRequireClanCastle", false);
ALT_REQUIRE_WIN_7S = sevenSignsConfig.getBoolean("AltRequireWin7s", true);
ALT_FESTIVAL_MIN_PLAYER = sevenSignsConfig.getInt("AltFestivalMinPlayer", 5);
ALT_MAXIMUM_PLAYER_CONTRIB = sevenSignsConfig.getInt("AltMaxPlayerContrib", 1000000);
ALT_FESTIVAL_MANAGER_START = sevenSignsConfig.getLong("AltFestivalManagerStart", 120000);
ALT_FESTIVAL_LENGTH = sevenSignsConfig.getLong("AltFestivalLength", 1080000);
ALT_FESTIVAL_CYCLE_LENGTH = sevenSignsConfig.getLong("AltFestivalCycleLength", 2280000);
ALT_FESTIVAL_FIRST_SPAWN = sevenSignsConfig.getLong("AltFestivalFirstSpawn", 120000);
ALT_FESTIVAL_FIRST_SWARM = sevenSignsConfig.getLong("AltFestivalFirstSwarm", 300000);
ALT_FESTIVAL_SECOND_SPAWN = sevenSignsConfig.getLong("AltFestivalSecondSpawn", 540000);
ALT_FESTIVAL_SECOND_SWARM = sevenSignsConfig.getLong("AltFestivalSecondSwarm", 720000);
ALT_FESTIVAL_CHEST_SPAWN = sevenSignsConfig.getLong("AltFestivalChestSpawn", 900000);
}
public static void loadCHConfig()
{
final PropertiesParser clanhallConfig = new PropertiesParser(CLANHALL_CONFIG_FILE);
CH_TELE_FEE_RATIO = clanhallConfig.getLong("ClanHallTeleportFunctionFeeRation", 86400000);
CH_TELE1_FEE = clanhallConfig.getInt("ClanHallTeleportFunctionFeeLvl1", 86400000);
CH_TELE2_FEE = clanhallConfig.getInt("ClanHallTeleportFunctionFeeLvl2", 86400000);
CH_SUPPORT_FEE_RATIO = clanhallConfig.getLong("ClanHallSupportFunctionFeeRation", 86400000);
CH_SUPPORT1_FEE = clanhallConfig.getInt("ClanHallSupportFeeLvl1", 86400000);
CH_SUPPORT2_FEE = clanhallConfig.getInt("ClanHallSupportFeeLvl2", 86400000);
CH_SUPPORT3_FEE = clanhallConfig.getInt("ClanHallSupportFeeLvl3", 86400000);
CH_SUPPORT4_FEE = clanhallConfig.getInt("ClanHallSupportFeeLvl4", 86400000);
CH_SUPPORT5_FEE = clanhallConfig.getInt("ClanHallSupportFeeLvl5", 86400000);
CH_SUPPORT6_FEE = clanhallConfig.getInt("ClanHallSupportFeeLvl6", 86400000);
CH_SUPPORT7_FEE = clanhallConfig.getInt("ClanHallSupportFeeLvl7", 86400000);
CH_SUPPORT8_FEE = clanhallConfig.getInt("ClanHallSupportFeeLvl8", 86400000);
CH_MPREG_FEE_RATIO = clanhallConfig.getLong("ClanHallMpRegenerationFunctionFeeRation", 86400000);
CH_MPREG1_FEE = clanhallConfig.getInt("ClanHallMpRegenerationFeeLvl1", 86400000);
CH_MPREG2_FEE = clanhallConfig.getInt("ClanHallMpRegenerationFeeLvl2", 86400000);
CH_MPREG3_FEE = clanhallConfig.getInt("ClanHallMpRegenerationFeeLvl3", 86400000);
CH_MPREG4_FEE = clanhallConfig.getInt("ClanHallMpRegenerationFeeLvl4", 86400000);
CH_MPREG5_FEE = clanhallConfig.getInt("ClanHallMpRegenerationFeeLvl5", 86400000);
CH_HPREG_FEE_RATIO = clanhallConfig.getLong("ClanHallHpRegenerationFunctionFeeRation", 86400000);
CH_HPREG1_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl1", 86400000);
CH_HPREG2_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl2", 86400000);
CH_HPREG3_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl3", 86400000);
CH_HPREG4_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl4", 86400000);
CH_HPREG5_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl5", 86400000);
CH_HPREG6_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl6", 86400000);
CH_HPREG7_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl7", 86400000);
CH_HPREG8_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl8", 86400000);
CH_HPREG9_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl9", 86400000);
CH_HPREG10_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl10", 86400000);
CH_HPREG11_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl11", 86400000);
CH_HPREG12_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl12", 86400000);
CH_HPREG13_FEE = clanhallConfig.getInt("ClanHallHpRegenerationFeeLvl13", 86400000);
CH_EXPREG_FEE_RATIO = clanhallConfig.getLong("ClanHallExpRegenerationFunctionFeeRation", 86400000);
CH_EXPREG1_FEE = clanhallConfig.getInt("ClanHallExpRegenerationFeeLvl1", 86400000);
CH_EXPREG2_FEE = clanhallConfig.getInt("ClanHallExpRegenerationFeeLvl2", 86400000);
CH_EXPREG3_FEE = clanhallConfig.getInt("ClanHallExpRegenerationFeeLvl3", 86400000);
CH_EXPREG4_FEE = clanhallConfig.getInt("ClanHallExpRegenerationFeeLvl4", 86400000);
CH_EXPREG5_FEE = clanhallConfig.getInt("ClanHallExpRegenerationFeeLvl5", 86400000);
CH_EXPREG6_FEE = clanhallConfig.getInt("ClanHallExpRegenerationFeeLvl6", 86400000);
CH_EXPREG7_FEE = clanhallConfig.getInt("ClanHallExpRegenerationFeeLvl7", 86400000);
CH_ITEM_FEE_RATIO = clanhallConfig.getLong("ClanHallItemCreationFunctionFeeRation", 86400000);
CH_ITEM1_FEE = clanhallConfig.getInt("ClanHallItemCreationFunctionFeeLvl1", 86400000);
CH_ITEM2_FEE = clanhallConfig.getInt("ClanHallItemCreationFunctionFeeLvl2", 86400000);
CH_ITEM3_FEE = clanhallConfig.getInt("ClanHallItemCreationFunctionFeeLvl3", 86400000);
CH_CURTAIN_FEE_RATIO = clanhallConfig.getLong("ClanHallCurtainFunctionFeeRation", 86400000);
CH_CURTAIN1_FEE = clanhallConfig.getInt("ClanHallCurtainFunctionFeeLvl1", 86400000);
CH_CURTAIN2_FEE = clanhallConfig.getInt("ClanHallCurtainFunctionFeeLvl2", 86400000);
CH_FRONT_FEE_RATIO = clanhallConfig.getLong("ClanHallFrontPlatformFunctionFeeRation", 86400000);
CH_FRONT1_FEE = clanhallConfig.getInt("ClanHallFrontPlatformFunctionFeeLvl1", 86400000);
CH_FRONT2_FEE = clanhallConfig.getInt("ClanHallFrontPlatformFunctionFeeLvl2", 86400000);
}
public static void loadElitCHConfig()
{
final PropertiesParser conquerableConfig = new PropertiesParser(CONQUERABLE_CLANHALL_CONFIG_FILE);
DEVASTATED_DAY = conquerableConfig.getInt("DevastatedDay", 1);
DEVASTATED_HOUR = conquerableConfig.getInt("DevastatedHour", 18);
DEVASTATED_MINUTES = conquerableConfig.getInt("DevastatedMinutes", 0);
PARTISAN_DAY = conquerableConfig.getInt("PartisanDay", 5);
PARTISAN_HOUR = conquerableConfig.getInt("PartisanHour", 21);
PARTISAN_MINUTES = conquerableConfig.getInt("PartisanMinutes", 0);
}
public static void loadChampionConfig()
{
final PropertiesParser championConfig = new PropertiesParser(CHAMPION_CONFIG_FILE);
CHAMPION_ENABLE = championConfig.getBoolean("ChampionEnable", false);
CHAMPION_FREQUENCY = championConfig.getInt("ChampionFrequency", 0);
CHAMP_MIN_LVL = championConfig.getInt("ChampionMinLevel", 20);
CHAMP_MAX_LVL = championConfig.getInt("ChampionMaxLevel", 60);
CHAMPION_HP = championConfig.getInt("ChampionHp", 7);
CHAMPION_HP_REGEN = championConfig.getFloat("ChampionHpRegen", 1f);
CHAMPION_REWARDS = championConfig.getInt("ChampionRewards", 8);
CHAMPION_ADENAS_REWARDS = championConfig.getInt("ChampionAdenasRewards", 1);
CHAMPION_ATK = championConfig.getFloat("ChampionAtk", 1f);
CHAMPION_SPD_ATK = championConfig.getFloat("ChampionSpdAtk", 1f);
CHAMPION_REWARD = championConfig.getInt("ChampionRewardItem", 0);
CHAMPION_REWARD_ID = championConfig.getInt("ChampionRewardItemID", 6393);
CHAMPION_REWARD_QTY = championConfig.getInt("ChampionRewardItemQty", 1);
CHAMP_TITLE = championConfig.getString("ChampionTitle", "Champion");
}
public static void loadMerchantZeroPriceConfig()
{
final PropertiesParser merchantZeroSellPriceConfig = new PropertiesParser(MERCHANT_ZERO_SELL_PRICE_CONFIG_FILE);
MERCHANT_ZERO_SELL_PRICE = merchantZeroSellPriceConfig.getBoolean("MerchantZeroSellPrice", false);
}
public static void loadWeddingConfig()
{
final PropertiesParser weddingConfig = new PropertiesParser(EVENT_WEDDING_CONFIG_FILE);
ALLOW_WEDDING = weddingConfig.getBoolean("AllowWedding", false);
WEDDING_PRICE = weddingConfig.getInt("WeddingPrice", 250000000);
WEDDING_PUNISH_INFIDELITY = weddingConfig.getBoolean("WeddingPunishInfidelity", true);
WEDDING_TELEPORT = weddingConfig.getBoolean("WeddingTeleport", true);
WEDDING_TELEPORT_PRICE = weddingConfig.getInt("WeddingTeleportPrice", 50000);
WEDDING_TELEPORT_DURATION = weddingConfig.getInt("WeddingTeleportDuration", 60);
WEDDING_NAME_COLOR_NORMAL = Integer.decode("0x" + weddingConfig.getString("WeddingNameCollorN", "FFFFFF"));
WEDDING_NAME_COLOR_GEY = Integer.decode("0x" + weddingConfig.getString("WeddingNameCollorB", "FFFFFF"));
WEDDING_NAME_COLOR_LESBO = Integer.decode("0x" + weddingConfig.getString("WeddingNameCollorL", "FFFFFF"));
WEDDING_SAMESEX = weddingConfig.getBoolean("WeddingAllowSameSex", false);
WEDDING_FORMALWEAR = weddingConfig.getBoolean("WeddingFormalWear", true);
WEDDING_DIVORCE_COSTS = weddingConfig.getInt("WeddingDivorceCosts", 20);
GIVE_CUPID_BOW = weddingConfig.getBoolean("WeddingGiveBow", false);
ANNOUNCE_WEDDING = weddingConfig.getBoolean("AnnounceWedding", true);
}
public static void loadL2jServerConfig()
{
final PropertiesParser L2jServer = new PropertiesParser(L2JSERVER_CUSTOM);
ENABLE_DAILY = L2jServer.getBoolean("EnableDailySystem", false);
DAILY_REWARD_ITEM_ID = L2jServer.getInt("DailySystemItemId", 57);
DAILY_REWARD_AMOUNT = L2jServer.getInt("DailyRewardAmount", 1500);
MIN_LEVEL_TO_DAILYREWARD = L2jServer.getInt("DailyMinLevelRequired", 20);
}
public static void loadTVTConfig()
{
final PropertiesParser tvtConfig = new PropertiesParser(EVENT_TVT_CONFIG_FILE);
TVT_EVEN_TEAMS = tvtConfig.getString("TvTEvenTeams", "BALANCE");
TVT_ALLOW_INTERFERENCE = tvtConfig.getBoolean("TvTAllowInterference", false);
TVT_ALLOW_POTIONS = tvtConfig.getBoolean("TvTAllowPotions", false);
TVT_ALLOW_SUMMON = tvtConfig.getBoolean("TvTAllowSummon", false);
TVT_ON_START_REMOVE_ALL_EFFECTS = tvtConfig.getBoolean("TvTOnStartRemoveAllEffects", true);
TVT_ON_START_UNSUMMON_PET = tvtConfig.getBoolean("TvTOnStartUnsummonPet", true);
TVT_REVIVE_RECOVERY = tvtConfig.getBoolean("TvTReviveRecovery", false);
TVT_ANNOUNCE_TEAM_STATS = tvtConfig.getBoolean("TvTAnnounceTeamStats", false);
TVT_ANNOUNCE_REWARD = tvtConfig.getBoolean("TvTAnnounceReward", false);
TVT_PRICE_NO_KILLS = tvtConfig.getBoolean("TvTPriceNoKills", false);
TVT_JOIN_CURSED = tvtConfig.getBoolean("TvTJoinWithCursedWeapon", true);
TVT_COMMAND = tvtConfig.getBoolean("TvTCommand", true);
TVT_REVIVE_DELAY = tvtConfig.getLong("TvTReviveDelay", 20000);
if (TVT_REVIVE_DELAY < 1000)
{
TVT_REVIVE_DELAY = 1000; // can't be set less then 1 second
}
TVT_OPEN_FORT_DOORS = tvtConfig.getBoolean("TvTOpenFortDoors", false);
TVT_CLOSE_FORT_DOORS = tvtConfig.getBoolean("TvTCloseFortDoors", false);
TVT_OPEN_ADEN_COLOSSEUM_DOORS = tvtConfig.getBoolean("TvTOpenAdenColosseumDoors", false);
TVT_CLOSE_ADEN_COLOSSEUM_DOORS = tvtConfig.getBoolean("TvTCloseAdenColosseumDoors", false);
TVT_TOP_KILLER_REWARD = tvtConfig.getInt("TvTTopKillerRewardId", 5575);
TVT_TOP_KILLER_QTY = tvtConfig.getInt("TvTTopKillerRewardQty", 2000000);
TVT_AURA = tvtConfig.getBoolean("TvTAura", false);
TVT_STATS_LOGGER = tvtConfig.getBoolean("TvTStatsLogger", true);
TVT_REMOVE_BUFFS_ON_DIE = tvtConfig.getBoolean("TvTRemoveBuffsOnPlayerDie", false);
}
public static void loadTWConfig()
{
final PropertiesParser twConfig = new PropertiesParser(EVENT_TW_CONFIG_FILE);
TW_TOWN_ID = twConfig.getInt("TWTownId", 9);
TW_ALL_TOWNS = twConfig.getBoolean("TWAllTowns", false);
TW_ITEM_ID = twConfig.getInt("TownWarItemId", 57);
TW_ITEM_AMOUNT = twConfig.getInt("TownWarItemAmount", 5000);
TW_ALLOW_KARMA = twConfig.getBoolean("AllowKarma", false);
TW_DISABLE_GK = twConfig.getBoolean("DisableGK", true);
TW_RESS_ON_DIE = twConfig.getBoolean("SendRessOnDeath", false);
}
public static void loadRebirthConfig()
{
final PropertiesParser rebirthConfig = new PropertiesParser(EVENT_REBIRTH_CONFIG_FILE);
REBIRTH_ENABLE = rebirthConfig.getBoolean("REBIRTH_ENABLE", false);
REBIRTH_MIN_LEVEL = rebirthConfig.getInt("REBIRTH_MIN_LEVEL", 80);
REBIRTH_MAX = rebirthConfig.getInt("REBIRTH_MAX", 3);
REBIRTH_RETURN_TO_LEVEL = rebirthConfig.getInt("REBIRTH_RETURN_TO_LEVEL", 1);
REBIRTH_ITEM_PRICE = rebirthConfig.getString("REBIRTH_ITEM_PRICE", "").split(";");
REBIRTH_MAGE_SKILL = rebirthConfig.getString("REBIRTH_MAGE_SKILL", "").split(";");
REBIRTH_FIGHTER_SKILL = rebirthConfig.getString("REBIRTH_FIGHTER_SKILL", "").split(";");
}
public static void loadPCBPointConfig()
{
final PropertiesParser pcBangConfig = new PropertiesParser(EVENT_PC_BANG_POINT_CONFIG_FILE);
PCB_ENABLE = pcBangConfig.getBoolean("PcBangPointEnable", true);
PCB_MIN_LEVEL = pcBangConfig.getInt("PcBangPointMinLevel", 20);
PCB_POINT_MIN = pcBangConfig.getInt("PcBangPointMinCount", 20);
PCB_POINT_MAX = pcBangConfig.getInt("PcBangPointMaxCount", 1000000);
if (PCB_POINT_MAX < 1)
{
PCB_POINT_MAX = Integer.MAX_VALUE;
}
PCB_CHANCE_DUAL_POINT = pcBangConfig.getInt("PcBangPointDualChance", 20);
PCB_INTERVAL = pcBangConfig.getInt("PcBangPointTimeStamp", 900);
}
public static void loadCraftConfig()
{
final PropertiesParser craftConfig = new PropertiesParser(CRAFTING_CONFIG_FILE);
DWARF_RECIPE_LIMIT = craftConfig.getInt("DwarfRecipeLimit", 50);
COMMON_RECIPE_LIMIT = craftConfig.getInt("CommonRecipeLimit", 50);
IS_CRAFTING_ENABLED = craftConfig.getBoolean("CraftingEnabled", true);
ALT_GAME_CREATION = craftConfig.getBoolean("AltGameCreation", false);
ALT_GAME_CREATION_SPEED = craftConfig.getDouble("AltGameCreationSpeed", 1);
ALT_GAME_CREATION_XP_RATE = craftConfig.getDouble("AltGameCreationRateXp", 1);
ALT_GAME_CREATION_SP_RATE = craftConfig.getDouble("AltGameCreationRateSp", 1);
ALT_BLACKSMITH_USE_RECIPES = craftConfig.getBoolean("AltBlacksmithUseRecipes", true);
}
public static void loadBankingConfig()
{
final PropertiesParser bankConfig = new PropertiesParser(BANK_CONFIG_FILE);
BANKING_SYSTEM_ENABLED = bankConfig.getBoolean("BankingEnabled", false);
BANKING_SYSTEM_GOLDBARS = bankConfig.getInt("BankingGoldbarCount", 1);
BANKING_SYSTEM_ADENA = bankConfig.getInt("BankingAdenaCount", 500000000);
}
public static void loadBufferConfig()
{
final PropertiesParser shemeBufferConfig = new PropertiesParser(SCHEME_BUFFER_CONFIG_FILE);
BUFFER_MAX_SCHEMES = shemeBufferConfig.getInt("BufferMaxSchemesPerChar", 4);
BUFFER_STATIC_BUFF_COST = shemeBufferConfig.getInt("BufferStaticCostPerBuff", -1);
}
public static void loadOfflineConfig()
{
final PropertiesParser offlineConfig = new PropertiesParser(OFFLINE_CONFIG_FILE);
OFFLINE_TRADE_ENABLE = offlineConfig.getBoolean("OfflineTradeEnable", false);
OFFLINE_CRAFT_ENABLE = offlineConfig.getBoolean("OfflineCraftEnable", false);
OFFLINE_SET_NAME_COLOR = offlineConfig.getBoolean("OfflineNameColorEnable", false);
OFFLINE_NAME_COLOR = Integer.decode("0x" + offlineConfig.getString("OfflineNameColor", "ff00ff"));
OFFLINE_MODE_IN_PEACE_ZONE = offlineConfig.getBoolean("OfflineModeInPeaceZone", false);
OFFLINE_MODE_SET_INVULNERABLE = offlineConfig.getBoolean("OfflineModeSetInvulnerable", false);
OFFLINE_COMMAND1 = offlineConfig.getBoolean("OfflineCommand1", true);
OFFLINE_COMMAND2 = offlineConfig.getBoolean("OfflineCommand2", false);
OFFLINE_LOGOUT = offlineConfig.getBoolean("OfflineLogout", false);
OFFLINE_SLEEP_EFFECT = offlineConfig.getBoolean("OfflineSleepEffect", true);
RESTORE_OFFLINERS = offlineConfig.getBoolean("RestoreOffliners", false);
OFFLINE_MAX_DAYS = offlineConfig.getInt("OfflineMaxDays", 10);
OFFLINE_DISCONNECT_FINISHED = offlineConfig.getBoolean("OfflineDisconnectFinished", true);
}
public static void loadDMConfig()
{
final PropertiesParser dmConfig = new PropertiesParser(EVENT_DM_CONFIG_FILE);
DM_ALLOW_INTERFERENCE = dmConfig.getBoolean("DMAllowInterference", false);
DM_ALLOW_POTIONS = dmConfig.getBoolean("DMAllowPotions", false);
DM_ALLOW_SUMMON = dmConfig.getBoolean("DMAllowSummon", false);
DM_JOIN_CURSED = dmConfig.getBoolean("DMJoinWithCursedWeapon", false);
DM_ON_START_REMOVE_ALL_EFFECTS = dmConfig.getBoolean("DMOnStartRemoveAllEffects", true);
DM_ON_START_UNSUMMON_PET = dmConfig.getBoolean("DMOnStartUnsummonPet", true);
DM_REVIVE_DELAY = dmConfig.getLong("DMReviveDelay", 20000);
if (DM_REVIVE_DELAY < 1000)
{
DM_REVIVE_DELAY = 1000; // can't be set less then 1 second
}
DM_REVIVE_RECOVERY = dmConfig.getBoolean("DMReviveRecovery", false);
DM_COMMAND = dmConfig.getBoolean("DMCommand", false);
DM_ENABLE_KILL_REWARD = dmConfig.getBoolean("DMEnableKillReward", false);
DM_KILL_REWARD_ID = dmConfig.getInt("DMKillRewardID", 6392);
DM_KILL_REWARD_AMOUNT = dmConfig.getInt("DMKillRewardAmount", 1);
DM_ANNOUNCE_REWARD = dmConfig.getBoolean("DMAnnounceReward", false);
DM_SPAWN_OFFSET = dmConfig.getInt("DMSpawnOffset", 100);
DM_STATS_LOGGER = dmConfig.getBoolean("DMStatsLogger", true);
DM_ALLOW_HEALER_CLASSES = dmConfig.getBoolean("DMAllowedHealerClasses", true);
DM_REMOVE_BUFFS_ON_DIE = dmConfig.getBoolean("DMRemoveBuffsOnPlayerDie", false);
}
public static void loadCTFConfig()
{
final PropertiesParser ctfConfig = new PropertiesParser(EVENT_CTF_CONFIG_FILE);
CTF_EVEN_TEAMS = ctfConfig.getString("CTFEvenTeams", "BALANCE");
CTF_ALLOW_INTERFERENCE = ctfConfig.getBoolean("CTFAllowInterference", false);
CTF_ALLOW_POTIONS = ctfConfig.getBoolean("CTFAllowPotions", false);
CTF_ALLOW_SUMMON = ctfConfig.getBoolean("CTFAllowSummon", false);
CTF_ON_START_REMOVE_ALL_EFFECTS = ctfConfig.getBoolean("CTFOnStartRemoveAllEffects", true);
CTF_ON_START_UNSUMMON_PET = ctfConfig.getBoolean("CTFOnStartUnsummonPet", true);
CTF_ANNOUNCE_TEAM_STATS = ctfConfig.getBoolean("CTFAnnounceTeamStats", false);
CTF_ANNOUNCE_REWARD = ctfConfig.getBoolean("CTFAnnounceReward", false);
CTF_JOIN_CURSED = ctfConfig.getBoolean("CTFJoinWithCursedWeapon", true);
CTF_REVIVE_RECOVERY = ctfConfig.getBoolean("CTFReviveRecovery", false);
CTF_COMMAND = ctfConfig.getBoolean("CTFCommand", true);
CTF_AURA = ctfConfig.getBoolean("CTFAura", true);
CTF_STATS_LOGGER = ctfConfig.getBoolean("CTFStatsLogger", true);
CTF_SPAWN_OFFSET = ctfConfig.getInt("CTFSpawnOffset", 100);
CTF_REMOVE_BUFFS_ON_DIE = ctfConfig.getBoolean("CTFRemoveBuffsOnPlayerDie", false);
}
public static void loadCustomServerConfig()
{
final PropertiesParser customServerConfig = new PropertiesParser(OTHER_CONFIG_FILE);
CUSTOM_SPAWNLIST_TABLE = customServerConfig.getBoolean("CustomSpawnlistTable", true);
SAVE_GMSPAWN_ON_CUSTOM = customServerConfig.getBoolean("SaveGmSpawnOnCustom", true);
DELETE_GMSPAWN_ON_CUSTOM = customServerConfig.getBoolean("DeleteGmSpawnOnCustom", true);
ONLINE_PLAYERS_ON_LOGIN = customServerConfig.getBoolean("OnlineOnLogin", false);
PROTECTOR_PLAYER_PK = customServerConfig.getBoolean("ProtectorPlayerPK", false);
PROTECTOR_PLAYER_PVP = customServerConfig.getBoolean("ProtectorPlayerPVP", false);
PROTECTOR_RADIUS_ACTION = customServerConfig.getInt("ProtectorRadiusAction", 500);
PROTECTOR_SKILLID = customServerConfig.getInt("ProtectorSkillId", 1069);
PROTECTOR_SKILLLEVEL = customServerConfig.getInt("ProtectorSkillLevel", 42);
PROTECTOR_SKILLTIME = customServerConfig.getInt("ProtectorSkillTime", 800);
PROTECTOR_MESSAGE = customServerConfig.getString("ProtectorMessage", "Protector, not spawnkilling here, go read the rules !!!");
DONATOR_NAME_COLOR_ENABLED = customServerConfig.getBoolean("DonatorNameColorEnabled", false);
DONATOR_NAME_COLOR = Integer.decode("0x" + customServerConfig.getString("DonatorColorName", "00FFFF"));
DONATOR_TITLE_COLOR = Integer.decode("0x" + customServerConfig.getString("DonatorTitleColor", "00FF00"));
DONATOR_XPSP_RATE = customServerConfig.getFloat("DonatorXpSpRate", 1.5f);
DONATOR_ADENA_RATE = customServerConfig.getFloat("DonatorAdenaRate", 1.5f);
DONATOR_DROP_RATE = customServerConfig.getFloat("DonatorDropRate", 1.5f);
DONATOR_SPOIL_RATE = customServerConfig.getFloat("DonatorSpoilRate", 1.5f);
WELCOME_HTM = customServerConfig.getBoolean("WelcomeHtm", false);
ALT_SERVER_NAME_ENABLED = customServerConfig.getBoolean("ServerNameEnabled", false);
ANNOUNCE_TO_ALL_SPAWN_RB = customServerConfig.getBoolean("AnnounceToAllSpawnRb", false);
ANNOUNCE_TRY_BANNED_ACCOUNT = customServerConfig.getBoolean("AnnounceTryBannedAccount", false);
ALT_Server_Name = customServerConfig.getString("ServerName", "");
DIFFERENT_Z_CHANGE_OBJECT = customServerConfig.getInt("DifferentZchangeObject", 650);
DIFFERENT_Z_NEW_MOVIE = customServerConfig.getInt("DifferentZnewmovie", 1000);
ALLOW_SIMPLE_STATS_VIEW = customServerConfig.getBoolean("AllowSimpleStatsView", false);
ALLOW_DETAILED_STATS_VIEW = customServerConfig.getBoolean("AllowDetailedStatsView", false);
ALLOW_ONLINE_VIEW = customServerConfig.getBoolean("AllowOnlineView", false);
KEEP_SUBCLASS_SKILLS = customServerConfig.getBoolean("KeepSubClassSkills", false);
ALLOWED_SKILLS = customServerConfig.getString("AllowedSkills", "541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,617,618,619");
ALLOWED_SKILLS_LIST = new ArrayList<>();
for (String id : ALLOWED_SKILLS.trim().split(","))
{
ALLOWED_SKILLS_LIST.add(Integer.parseInt(id.trim()));
}
CASTLE_SHIELD = customServerConfig.getBoolean("CastleShieldRestriction", true);
CLANHALL_SHIELD = customServerConfig.getBoolean("ClanHallShieldRestriction", true);
APELLA_ARMORS = customServerConfig.getBoolean("ApellaArmorsRestriction", true);
OATH_ARMORS = customServerConfig.getBoolean("OathArmorsRestriction", true);
CASTLE_CROWN = customServerConfig.getBoolean("CastleLordsCrownRestriction", true);
CASTLE_CIRCLETS = customServerConfig.getBoolean("CastleCircletsRestriction", true);
CHAR_TITLE = customServerConfig.getBoolean("CharTitle", false);
ADD_CHAR_TITLE = customServerConfig.getString("CharAddTitle", "Welcome");
NOBLE_CUSTOM_ITEMS = customServerConfig.getBoolean("EnableNobleCustomItem", true);
NOOBLE_CUSTOM_ITEM_ID = customServerConfig.getInt("NoobleCustomItemId", 6673);
HERO_CUSTOM_ITEMS = customServerConfig.getBoolean("EnableHeroCustomItem", true);
HERO_CUSTOM_ITEM_ID = customServerConfig.getInt("HeroCustomItemId", 3481);
HERO_CUSTOM_DAY = customServerConfig.getInt("HeroCustomDay", 0);
ALLOW_CREATE_LVL = customServerConfig.getBoolean("CustomStartingLvl", false);
CHAR_CREATE_LVL = customServerConfig.getInt("CharLvl", 80);
SPAWN_CHAR = customServerConfig.getBoolean("CustomSpawn", false);
SPAWN_X = customServerConfig.getInt("SpawnX", 50821);
SPAWN_Y = customServerConfig.getInt("SpawnY", 186527);
SPAWN_Z = customServerConfig.getInt("SpawnZ", -3625);
ALLOW_LOW_LEVEL_TRADE = customServerConfig.getBoolean("AllowLowLevelTrade", true);
ALLOW_HERO_SUBSKILL = customServerConfig.getBoolean("CustomHeroSubSkill", false);
HERO_COUNT = customServerConfig.getInt("HeroCount", 1);
CRUMA_TOWER_LEVEL_RESTRICT = customServerConfig.getInt("CrumaTowerLevelRestrict", 56);
ALLOW_RAID_BOSS_PETRIFIED = customServerConfig.getBoolean("AllowRaidBossPetrified", true);
ALT_PLAYER_PROTECTION_LEVEL = customServerConfig.getInt("AltPlayerProtectionLevel", 0);
MONSTER_RETURN_DELAY = customServerConfig.getInt("MonsterReturnDelay", 1200);
SCROLL_STACKABLE = customServerConfig.getBoolean("ScrollStackable", false);
ALLOW_CHAR_KILL_PROTECT = customServerConfig.getBoolean("AllowLowLvlProtect", false);
CLAN_LEADER_COLOR_ENABLED = customServerConfig.getBoolean("ClanLeaderNameColorEnabled", true);
CLAN_LEADER_COLORED = customServerConfig.getInt("ClanLeaderColored", 1);
CLAN_LEADER_COLOR = Integer.decode("0x" + customServerConfig.getString("ClanLeaderColor", "00FFFF"));
CLAN_LEADER_COLOR_CLAN_LEVEL = customServerConfig.getInt("ClanLeaderColorAtClanLevel", 1);
SAVE_RAIDBOSS_STATUS_INTO_DB = customServerConfig.getBoolean("SaveRBStatusIntoDB", false);
DISABLE_WEIGHT_PENALTY = customServerConfig.getBoolean("DisableWeightPenalty", false);
ALLOW_FARM1_COMMAND = customServerConfig.getBoolean("AllowFarm1Command", false);
ALLOW_FARM2_COMMAND = customServerConfig.getBoolean("AllowFarm2Command", false);
ALLOW_PVP1_COMMAND = customServerConfig.getBoolean("AllowPvP1Command", false);
ALLOW_PVP2_COMMAND = customServerConfig.getBoolean("AllowPvP2Command", false);
FARM1_X = customServerConfig.getInt("farm1_X", 81304);
FARM1_Y = customServerConfig.getInt("farm1_Y", 14589);
FARM1_Z = customServerConfig.getInt("farm1_Z", -3469);
PVP1_X = customServerConfig.getInt("pvp1_X", 81304);
PVP1_Y = customServerConfig.getInt("pvp1_Y", 14589);
PVP1_Z = customServerConfig.getInt("pvp1_Z", -3469);
FARM2_X = customServerConfig.getInt("farm2_X", 81304);
FARM2_Y = customServerConfig.getInt("farm2_Y", 14589);
FARM2_Z = customServerConfig.getInt("farm2_Z", -3469);
PVP2_X = customServerConfig.getInt("pvp2_X", 81304);
PVP2_Y = customServerConfig.getInt("pvp2_Y", 14589);
PVP2_Z = customServerConfig.getInt("pvp2_Z", -3469);
FARM1_CUSTOM_MESSAGE = customServerConfig.getString("Farm1CustomMeesage", "You have been teleported to Farm Zone 1!");
FARM2_CUSTOM_MESSAGE = customServerConfig.getString("Farm2CustomMeesage", "You have been teleported to Farm Zone 2!");
PVP1_CUSTOM_MESSAGE = customServerConfig.getString("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!");
PVP2_CUSTOM_MESSAGE = customServerConfig.getString("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
GM_TRADE_RESTRICTED_ITEMS = customServerConfig.getBoolean("GMTradeRestrictedItems", false);
GM_RESTART_FIGHTING = customServerConfig.getBoolean("GMRestartFighting", false);
PM_MESSAGE_ON_START = customServerConfig.getBoolean("PMWelcomeShow", false);
SERVER_TIME_ON_START = customServerConfig.getBoolean("ShowServerTimeOnStart", false);
PM_SERVER_NAME = customServerConfig.getString("PMServerName", "Server");
PM_TEXT1 = customServerConfig.getString("PMText1", "Have Fun and Nice Stay on");
PM_TEXT2 = customServerConfig.getString("PMText2", "Vote for us every 24h");
NEW_PLAYER_EFFECT = customServerConfig.getBoolean("NewPlayerEffect", true);
}
public static void loadPvpConfig()
{
final PropertiesParser pvpConfig = new PropertiesParser(PVP_CONFIG_FILE);
KARMA_MIN_KARMA = pvpConfig.getInt("MinKarma", 240);
KARMA_MAX_KARMA = pvpConfig.getInt("MaxKarma", 10000);
KARMA_XP_DIVIDER = pvpConfig.getInt("XPDivider", 260);
KARMA_LOST_BASE = pvpConfig.getInt("BaseKarmaLost", 0);
KARMA_DROP_GM = pvpConfig.getBoolean("CanGMDropEquipment", false);
KARMA_AWARD_PK_KILL = pvpConfig.getBoolean("AwardPKKillPVPPoint", true);
KARMA_PK_LIMIT = pvpConfig.getInt("MinimumPKRequiredToDrop", 5);
KARMA_NONDROPPABLE_PET_ITEMS = pvpConfig.getString("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650");
KARMA_NONDROPPABLE_ITEMS = pvpConfig.getString("ListOfNonDroppableItems", "57,1147,425,1146,461,10,2368,7,6,2370,2369,6842,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621");
KARMA_LIST_NONDROPPABLE_PET_ITEMS = new ArrayList<>();
for (String id : KARMA_NONDROPPABLE_PET_ITEMS.split(","))
{
KARMA_LIST_NONDROPPABLE_PET_ITEMS.add(Integer.parseInt(id));
}
KARMA_LIST_NONDROPPABLE_ITEMS = new ArrayList<>();
for (String id : KARMA_NONDROPPABLE_ITEMS.split(","))
{
KARMA_LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
}
PVP_NORMAL_TIME = pvpConfig.getInt("PvPVsNormalTime", 15000);
PVP_PVP_TIME = pvpConfig.getInt("PvPVsPvPTime", 30000);
ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = pvpConfig.getBoolean("AltKarmaPlayerCanBeKilledInPeaceZone", false);
ALT_GAME_KARMA_PLAYER_CAN_SHOP = pvpConfig.getBoolean("AltKarmaPlayerCanShop", true);
ALT_GAME_KARMA_PLAYER_CAN_USE_GK = pvpConfig.getBoolean("AltKarmaPlayerCanUseGK", false);
ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = pvpConfig.getBoolean("AltKarmaPlayerCanTeleport", true);
ALT_GAME_KARMA_PLAYER_CAN_TRADE = pvpConfig.getBoolean("AltKarmaPlayerCanTrade", true);
ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = pvpConfig.getBoolean("AltKarmaPlayerCanUseWareHouse", true);
ALT_KARMA_TELEPORT_TO_FLORAN = pvpConfig.getBoolean("AltKarmaTeleportToFloran", false);
PVP_REWARD_ENABLED = pvpConfig.getBoolean("PvpRewardEnabled", false);
PVP_REWARD_ID = pvpConfig.getInt("PvpRewardItemId", 6392);
PVP_REWARD_AMOUNT = pvpConfig.getInt("PvpRewardAmmount", 1);
PK_REWARD_ENABLED = pvpConfig.getBoolean("PKRewardEnabled", false);
PK_REWARD_ID = pvpConfig.getInt("PKRewardItemId", 6392);
PK_REWARD_AMOUNT = pvpConfig.getInt("PKRewardAmmount", 1);
REWARD_PROTECT = pvpConfig.getInt("RewardProtect", 1);
PVP_COLOR_SYSTEM_ENABLED = pvpConfig.getBoolean("EnablePvPColorSystem", false);
PVP_AMOUNT1 = pvpConfig.getInt("PvpAmount1", 500);
PVP_AMOUNT2 = pvpConfig.getInt("PvpAmount2", 1000);
PVP_AMOUNT3 = pvpConfig.getInt("PvpAmount3", 1500);
PVP_AMOUNT4 = pvpConfig.getInt("PvpAmount4", 2500);
PVP_AMOUNT5 = pvpConfig.getInt("PvpAmount5", 5000);
NAME_COLOR_FOR_PVP_AMOUNT1 = Integer.decode("0x" + pvpConfig.getString("ColorForAmount1", "00FF00"));
NAME_COLOR_FOR_PVP_AMOUNT2 = Integer.decode("0x" + pvpConfig.getString("ColorForAmount2", "00FF00"));
NAME_COLOR_FOR_PVP_AMOUNT3 = Integer.decode("0x" + pvpConfig.getString("ColorForAmount3", "00FF00"));
NAME_COLOR_FOR_PVP_AMOUNT4 = Integer.decode("0x" + pvpConfig.getString("ColorForAmount4", "00FF00"));
NAME_COLOR_FOR_PVP_AMOUNT5 = Integer.decode("0x" + pvpConfig.getString("ColorForAmount5", "00FF00"));
PK_COLOR_SYSTEM_ENABLED = pvpConfig.getBoolean("EnablePkColorSystem", false);
PK_AMOUNT1 = pvpConfig.getInt("PkAmount1", 500);
PK_AMOUNT2 = pvpConfig.getInt("PkAmount2", 1000);
PK_AMOUNT3 = pvpConfig.getInt("PkAmount3", 1500);
PK_AMOUNT4 = pvpConfig.getInt("PkAmount4", 2500);
PK_AMOUNT5 = pvpConfig.getInt("PkAmount5", 5000);
TITLE_COLOR_FOR_PK_AMOUNT1 = Integer.decode("0x" + pvpConfig.getString("TitleForAmount1", "00FF00"));
TITLE_COLOR_FOR_PK_AMOUNT2 = Integer.decode("0x" + pvpConfig.getString("TitleForAmount2", "00FF00"));
TITLE_COLOR_FOR_PK_AMOUNT3 = Integer.decode("0x" + pvpConfig.getString("TitleForAmount3", "00FF00"));
TITLE_COLOR_FOR_PK_AMOUNT4 = Integer.decode("0x" + pvpConfig.getString("TitleForAmount4", "00FF00"));
TITLE_COLOR_FOR_PK_AMOUNT5 = Integer.decode("0x" + pvpConfig.getString("TitleForAmount5", "00FF00"));
FLAGED_PLAYER_USE_BUFFER = pvpConfig.getBoolean("AltKarmaFlagPlayerCanUseBuffer", false);
FLAGED_PLAYER_CAN_USE_GK = pvpConfig.getBoolean("FlaggedPlayerCanUseGK", false);
PVPEXPSP_SYSTEM = pvpConfig.getBoolean("AllowAddExpSpAtPvP", false);
ADD_EXP = pvpConfig.getInt("AddExpAtPvp", 0);
ADD_SP = pvpConfig.getInt("AddSpAtPvp", 0);
ALLOW_SOE_IN_PVP = pvpConfig.getBoolean("AllowSoEInPvP", true);
ALLOW_POTS_IN_PVP = pvpConfig.getBoolean("AllowPotsInPvP", true);
ENABLE_PK_INFO = pvpConfig.getBoolean("EnablePkInfo", false);
ANNOUNCE_ALL_KILL = pvpConfig.getBoolean("AnnounceAllKill", false);
ANNOUNCE_PVP_KILL = pvpConfig.getBoolean("AnnouncePvPKill", false);
ANNOUNCE_PK_KILL = pvpConfig.getBoolean("AnnouncePkKill", false);
DUEL_SPAWN_X = pvpConfig.getInt("DuelSpawnX", -102495);
DUEL_SPAWN_Y = pvpConfig.getInt("DuelSpawnY", -209023);
DUEL_SPAWN_Z = pvpConfig.getInt("DuelSpawnZ", -3326);
PVP_PK_TITLE = pvpConfig.getBoolean("PvpPkTitle", false);
PVP_TITLE_PREFIX = pvpConfig.getString("PvPTitlePrefix", " ");
PK_TITLE_PREFIX = pvpConfig.getString("PkTitlePrefix", " | ");
WAR_LEGEND_AURA = pvpConfig.getBoolean("WarLegendAura", false);
KILLS_TO_GET_WAR_LEGEND_AURA = pvpConfig.getInt("KillsToGetWarLegendAura", 30);
ANTI_FARM_ENABLED = pvpConfig.getBoolean("AntiFarmEnabled", false);
ANTI_FARM_CLAN_ALLY_ENABLED = pvpConfig.getBoolean("AntiFarmClanAlly", false);
ANTI_FARM_LVL_DIFF_ENABLED = pvpConfig.getBoolean("AntiFarmLvlDiff", false);
ANTI_FARM_MAX_LVL_DIFF = pvpConfig.getInt("AntiFarmMaxLvlDiff", 40);
ANTI_FARM_PDEF_DIFF_ENABLED = pvpConfig.getBoolean("AntiFarmPdefDiff", false);
ANTI_FARM_MAX_PDEF_DIFF = pvpConfig.getInt("AntiFarmMaxPdefDiff", 300);
ANTI_FARM_PATK_DIFF_ENABLED = pvpConfig.getBoolean("AntiFarmPatkDiff", false);
ANTI_FARM_MAX_PATK_DIFF = pvpConfig.getInt("AntiFarmMaxPatkDiff", 300);
ANTI_FARM_PARTY_ENABLED = pvpConfig.getBoolean("AntiFarmParty", false);
ANTI_FARM_IP_ENABLED = pvpConfig.getBoolean("AntiFarmIP", false);
ANTI_FARM_SUMMON = pvpConfig.getBoolean("AntiFarmSummon", false);
}
public static void loadOlympConfig()
{
final PropertiesParser olympiadConfig = new PropertiesParser(OLYMP_CONFIG_FILE);
ALT_OLY_START_TIME = olympiadConfig.getInt("AltOlyStartTime", 18);
ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 21600000);
ALT_OLY_BATTLE = olympiadConfig.getLong("AltOlyBattle", 360000);
ALT_OLY_WPERIOD = olympiadConfig.getLong("AltOlyWPeriod", 604800000);
ALT_OLY_VPERIOD = olympiadConfig.getLong("AltOlyVPeriod", 86400000);
ALT_OLY_CLASSED = olympiadConfig.getInt("AltOlyClassedParticipants", 5);
ALT_OLY_NONCLASSED = olympiadConfig.getInt("AltOlyNonClassedParticipants", 9);
ALT_OLY_BATTLE_REWARD_ITEM = olympiadConfig.getInt("AltOlyBattleRewItem", 6651);
ALT_OLY_CLASSED_RITEM_C = olympiadConfig.getInt("AltOlyClassedRewItemCount", 50);
ALT_OLY_NONCLASSED_RITEM_C = olympiadConfig.getInt("AltOlyNonClassedRewItemCount", 30);
ALT_OLY_COMP_RITEM = olympiadConfig.getInt("AltOlyCompRewItem", 6651);
ALT_OLY_GP_PER_POINT = olympiadConfig.getInt("AltOlyGPPerPoint", 1000);
ALT_OLY_MIN_POINT_FOR_EXCH = olympiadConfig.getInt("AltOlyMinPointForExchange", 50);
ALT_OLY_HERO_POINTS = olympiadConfig.getInt("AltOlyHeroPoints", 100);
ALT_OLY_RESTRICTED_ITEMS = olympiadConfig.getString("AltOlyRestrictedItems", "0");
LIST_OLY_RESTRICTED_ITEMS = new ArrayList<>();
for (String id : ALT_OLY_RESTRICTED_ITEMS.split(","))
{
LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
}
ALLOW_EVENTS_DURING_OLY = olympiadConfig.getBoolean("AllowEventsDuringOly", false);
ALT_OLY_RECHARGE_SKILLS = olympiadConfig.getBoolean("AltOlyRechargeSkills", false);
REMOVE_CUBIC_OLYMPIAD = olympiadConfig.getBoolean("RemoveCubicOlympiad", false);
ALT_OLY_NUMBER_HEROS_EACH_CLASS = olympiadConfig.getInt("AltOlyNumberHerosEachClass", 1);
ALT_OLY_LOG_FIGHTS = olympiadConfig.getBoolean("AlyOlyLogFights", false);
ALT_OLY_SHOW_MONTHLY_WINNERS = olympiadConfig.getBoolean("AltOlyShowMonthlyWinners", true);
ALT_OLY_ANNOUNCE_GAMES = olympiadConfig.getBoolean("AltOlyAnnounceGames", true);
LIST_OLY_RESTRICTED_SKILLS = new ArrayList<>();
for (String id : olympiadConfig.getString("AltOlyRestrictedSkills", "0").split(","))
{
LIST_OLY_RESTRICTED_SKILLS.add(Integer.parseInt(id));
}
ALT_OLY_AUGMENT_ALLOW = olympiadConfig.getBoolean("AltOlyAugmentAllow", true);
ALT_OLY_TELEPORT_COUNTDOWN = olympiadConfig.getInt("AltOlyTeleportCountDown", 120);
ALT_OLY_USE_CUSTOM_PERIOD_SETTINGS = olympiadConfig.getBoolean("AltOlyUseCustomPeriodSettings", false);
ALT_OLY_PERIOD = OlympiadPeriod.valueOf(olympiadConfig.getString("AltOlyPeriod", "MONTH"));
ALT_OLY_PERIOD_MULTIPLIER = olympiadConfig.getInt("AltOlyPeriodMultiplier", 1);
ALT_OLY_COMPETITION_DAYS = new ArrayList<>();
for (String s : olympiadConfig.getString("AltOlyCompetitionDays", "1,2,3,4,5,6,7").split(","))
{
ALT_OLY_COMPETITION_DAYS.add(Integer.parseInt(s));
}
}
public static void loadEnchantConfig()
{
final PropertiesParser enchantConfig = new PropertiesParser(ENCHANT_CONFIG_FILE);
String[] propertySplit = enchantConfig.getString("NormalWeaponEnchantLevel", "").split(";");
for (String readData : propertySplit)
{
final String[] writeData = readData.split(",");
if (writeData.length != 2)
{
LOGGER.info("invalid config property");
}
else
{
try
{
NORMAL_WEAPON_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
}
catch (NumberFormatException nfe)
{
if (!readData.equals(""))
{
LOGGER.info("invalid config property");
}
}
}
}
propertySplit = enchantConfig.getString("BlessWeaponEnchantLevel", "").split(";");
for (String readData : propertySplit)
{
final String[] writeData = readData.split(",");
if (writeData.length != 2)
{
LOGGER.info("invalid config property");
}
else
{
try
{
BLESS_WEAPON_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
}
catch (NumberFormatException nfe)
{
if (!readData.equals(""))
{
LOGGER.info("invalid config property");
}
}
}
}
propertySplit = enchantConfig.getString("CrystalWeaponEnchantLevel", "").split(";");
for (String readData : propertySplit)
{
final String[] writeData = readData.split(",");
if (writeData.length != 2)
{
LOGGER.info("invalid config property");
}
else
{
try
{
CRYSTAL_WEAPON_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
}
catch (NumberFormatException nfe)
{
if (!readData.equals(""))
{
LOGGER.info("invalid config property");
}
}
}
}
propertySplit = enchantConfig.getString("NormalArmorEnchantLevel", "").split(";");
for (String readData : propertySplit)
{
final String[] writeData = readData.split(",");
if (writeData.length != 2)
{
LOGGER.info("invalid config property");
}
else
{
try
{
NORMAL_ARMOR_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
}
catch (NumberFormatException nfe)
{
if (!readData.equals(""))
{
LOGGER.info("invalid config property");
}
}
}
}
propertySplit = enchantConfig.getString("BlessArmorEnchantLevel", "").split(";");
for (String readData : propertySplit)
{
final String[] writeData = readData.split(",");
if (writeData.length != 2)
{
LOGGER.info("invalid config property");
}
else
{
try
{
BLESS_ARMOR_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
}
catch (NumberFormatException nfe)
{
if (!readData.equals(""))
{
LOGGER.info("invalid config property");
}
}
}
}
propertySplit = enchantConfig.getString("CrystalArmorEnchantLevel", "").split(";");
for (String readData : propertySplit)
{
final String[] writeData = readData.split(",");
if (writeData.length != 2)
{
LOGGER.info("invalid config property");
}
else
{
try
{
CRYSTAL_ARMOR_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
}
catch (NumberFormatException nfe)
{
if (!readData.equals(""))
{
LOGGER.info("invalid config property");
}
}
}
}
propertySplit = enchantConfig.getString("NormalJewelryEnchantLevel", "").split(";");
for (String readData : propertySplit)
{
final String[] writeData = readData.split(",");
if (writeData.length != 2)
{
LOGGER.info("invalid config property");
}
else
{
try
{
NORMAL_JEWELRY_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
}
catch (NumberFormatException nfe)
{
if (!readData.equals(""))
{
LOGGER.info("invalid config property");
}
}
}
}
propertySplit = enchantConfig.getString("BlessJewelryEnchantLevel", "").split(";");
for (String readData : propertySplit)
{
final String[] writeData = readData.split(",");
if (writeData.length != 2)
{
LOGGER.info("invalid config property");
}
else
{
try
{
BLESS_JEWELRY_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
}
catch (NumberFormatException nfe)
{
if (!readData.equals(""))
{
LOGGER.info("invalid config property");
}
}
}
}
propertySplit = enchantConfig.getString("CrystalJewelryEnchantLevel", "").split(";");
for (String readData : propertySplit)
{
final String[] writeData = readData.split(",");
if (writeData.length != 2)
{
LOGGER.info("invalid config property");
}
else
{
try
{
CRYSTAL_JEWELRY_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
}
catch (NumberFormatException nfe)
{
if (!readData.equals(""))
{
LOGGER.info("invalid config property");
}
}
}
}
ENCHANT_SAFE_MAX = enchantConfig.getInt("EnchantSafeMax", 3);
ENCHANT_SAFE_MAX_FULL = enchantConfig.getInt("EnchantSafeMaxFull", 4);
ENCHANT_WEAPON_MAX = enchantConfig.getInt("EnchantWeaponMax", 25);
ENCHANT_ARMOR_MAX = enchantConfig.getInt("EnchantArmorMax", 25);
ENCHANT_JEWELRY_MAX = enchantConfig.getInt("EnchantJewelryMax", 25);
CRYSTAL_ENCHANT_MIN = enchantConfig.getInt("CrystalEnchantMin", 20);
CRYSTAL_ENCHANT_MAX = enchantConfig.getInt("CrystalEnchantMax", 0);
ENABLE_DWARF_ENCHANT_BONUS = enchantConfig.getBoolean("EnableDwarfEnchantBonus", false);
DWARF_ENCHANT_MIN_LEVEL = enchantConfig.getInt("DwarfEnchantMinLevel", 80);
DWARF_ENCHANT_BONUS = enchantConfig.getInt("DwarfEnchantBonus", 15);
AUGMENTATION_NG_SKILL_CHANCE = enchantConfig.getInt("AugmentationNGSkillChance", 15);
AUGMENTATION_MID_SKILL_CHANCE = enchantConfig.getInt("AugmentationMidSkillChance", 30);
AUGMENTATION_HIGH_SKILL_CHANCE = enchantConfig.getInt("AugmentationHighSkillChance", 45);
AUGMENTATION_TOP_SKILL_CHANCE = enchantConfig.getInt("AugmentationTopSkillChance", 60);
AUGMENTATION_BASESTAT_CHANCE = enchantConfig.getInt("AugmentationBaseStatChance", 1);
AUGMENTATION_NG_GLOW_CHANCE = enchantConfig.getInt("AugmentationNGGlowChance", 0);
AUGMENTATION_MID_GLOW_CHANCE = enchantConfig.getInt("AugmentationMidGlowChance", 40);
AUGMENTATION_HIGH_GLOW_CHANCE = enchantConfig.getInt("AugmentationHighGlowChance", 70);
AUGMENTATION_TOP_GLOW_CHANCE = enchantConfig.getInt("AugmentationTopGlowChance", 100);
DELETE_AUGM_PASSIVE_ON_CHANGE = enchantConfig.getBoolean("DeleteAgmentPassiveEffectOnChangeWep", true);
DELETE_AUGM_ACTIVE_ON_CHANGE = enchantConfig.getBoolean("DeleteAgmentActiveEffectOnChangeWep", true);
ENCHANT_HERO_WEAPON = enchantConfig.getBoolean("EnableEnchantHeroWeapons", false);
SOUL_CRYSTAL_BREAK_CHANCE = enchantConfig.getInt("SoulCrystalBreakChance", 10);
SOUL_CRYSTAL_LEVEL_CHANCE = enchantConfig.getInt("SoulCrystalLevelChance", 32);
SOUL_CRYSTAL_MAX_LEVEL = enchantConfig.getInt("SoulCrystalMaxLevel", 13);
CUSTOM_ENCHANT_VALUE = enchantConfig.getInt("CustomEnchantValue", 1);
ALT_OLY_ENCHANT_LIMIT = enchantConfig.getInt("AltOlyMaxEnchant", -1);
BREAK_ENCHANT = enchantConfig.getInt("BreakEnchant", 0);
MAX_ITEM_ENCHANT_KICK = enchantConfig.getInt("EnchantKick", 0);
GM_OVER_ENCHANT = enchantConfig.getInt("GMOverEnchant", 0);
}
public static void loadFloodConfig()
{
FLOOD_PROTECTOR_USE_ITEM = new FloodProtectorConfig("UseItemFloodProtector");
FLOOD_PROTECTOR_ROLL_DICE = new FloodProtectorConfig("RollDiceFloodProtector");
FLOOD_PROTECTOR_FIREWORK = new FloodProtectorConfig("FireworkFloodProtector");
FLOOD_PROTECTOR_ITEM_PET_SUMMON = new FloodProtectorConfig("ItemPetSummonFloodProtector");
FLOOD_PROTECTOR_HERO_VOICE = new FloodProtectorConfig("HeroVoiceFloodProtector");
FLOOD_PROTECTOR_GLOBAL_CHAT = new FloodProtectorConfig("GlobalChatFloodProtector");
FLOOD_PROTECTOR_SUBCLASS = new FloodProtectorConfig("SubclassFloodProtector");
FLOOD_PROTECTOR_DROP_ITEM = new FloodProtectorConfig("DropItemFloodProtector");
FLOOD_PROTECTOR_SERVER_BYPASS = new FloodProtectorConfig("ServerBypassFloodProtector");
FLOOD_PROTECTOR_MULTISELL = new FloodProtectorConfig("MultiSellFloodProtector");
FLOOD_PROTECTOR_TRANSACTION = new FloodProtectorConfig("TransactionFloodProtector");
FLOOD_PROTECTOR_MANUFACTURE = new FloodProtectorConfig("ManufactureFloodProtector");
FLOOD_PROTECTOR_MANOR = new FloodProtectorConfig("ManorFloodProtector");
FLOOD_PROTECTOR_CHARACTER_SELECT = new FloodProtectorConfig("CharacterSelectFloodProtector");
FLOOD_PROTECTOR_UNKNOWN_PACKETS = new FloodProtectorConfig("UnknownPacketsFloodProtector");
FLOOD_PROTECTOR_PARTY_INVITATION = new FloodProtectorConfig("PartyInvitationFloodProtector");
FLOOD_PROTECTOR_SAY_ACTION = new FloodProtectorConfig("SayActionFloodProtector");
FLOOD_PROTECTOR_MOVE_ACTION = new FloodProtectorConfig("MoveActionFloodProtector");
FLOOD_PROTECTOR_GENERIC_ACTION = new FloodProtectorConfig("GenericActionFloodProtector", true);
FLOOD_PROTECTOR_MACRO = new FloodProtectorConfig("MacroFloodProtector", true);
FLOOD_PROTECTOR_POTION = new FloodProtectorConfig("PotionFloodProtector", true);
final PropertiesParser floodProtectConfig = new PropertiesParser(PROTECT_FLOOD_CONFIG_FILE);
loadFloodProtectorConfigs(floodProtectConfig);
}
/**
* Loads single flood protector configuration.
* @param properties PropertiesParser file reader
* @param config flood protector configuration instance
* @param configString flood protector configuration string that determines for which flood protector configuration should be read
* @param defaultInterval default flood protector interval
*/
private static void loadFloodProtectorConfig(PropertiesParser properties, FloodProtectorConfig config, String configString, float defaultInterval)
{
config.FLOOD_PROTECTION_INTERVAL = properties.getFloat(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval);
config.LOG_FLOODING = properties.getBoolean(StringUtil.concat("FloodProtector", configString, "LogFlooding"), false);
config.PUNISHMENT_LIMIT = properties.getInt(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), 0);
config.PUNISHMENT_TYPE = properties.getString(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
config.PUNISHMENT_TIME = properties.getInt(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), 0);
}
public static void loadProtectedOtherConfig()
{
final PropertiesParser protectedOtherConfig = new PropertiesParser(PROTECT_OTHER_CONFIG_FILE);
CHECK_NAME_ON_LOGIN = protectedOtherConfig.getBoolean("CheckNameOnEnter", true);
CHECK_SKILLS_ON_ENTER = protectedOtherConfig.getBoolean("CheckSkillsOnEnter", true);
L2WALKER_PROTECTION = protectedOtherConfig.getBoolean("L2WalkerProtection", false);
PROTECTED_ENCHANT = protectedOtherConfig.getBoolean("ProtectorEnchant", false);
ONLY_GM_TELEPORT_FREE = protectedOtherConfig.getBoolean("OnlyGMTeleportFree", false);
ONLY_GM_ITEMS_FREE = protectedOtherConfig.getBoolean("OnlyGMItemsFree", false);
BYPASS_VALIDATION = protectedOtherConfig.getBoolean("BypassValidation", true);
ALLOW_DUALBOX_OLY = protectedOtherConfig.getBoolean("AllowDualBoxInOly", true);
ALLOW_DUALBOX_EVENT = protectedOtherConfig.getBoolean("AllowDualBoxInEvent", true);
ALLOWED_BOXES = protectedOtherConfig.getInt("AllowedBoxes", 99);
ALLOW_DUALBOX = protectedOtherConfig.getBoolean("AllowDualBox", true);
}
public static void loadPhysicsConfig()
{
final PropertiesParser physicsSetting = new PropertiesParser(PHYSICS_CONFIG_FILE);
ENABLE_CLASS_DAMAGE_SETTINGS = physicsSetting.getBoolean("EnableClassDamageSettings", true);
ENABLE_CLASS_DAMAGE_SETTINGS_IN_OLY = physicsSetting.getBoolean("EnableClassDamageSettingsInOly", true);
ENABLE_CLASS_DAMAGE_LOGGER = physicsSetting.getBoolean("EnableClassDamageLogger", false);
BLOW_ATTACK_FRONT = physicsSetting.getInt("BlowAttackFront", 50);
BLOW_ATTACK_SIDE = physicsSetting.getInt("BlowAttackSide", 60);
BLOW_ATTACK_BEHIND = physicsSetting.getInt("BlowAttackBehind", 70);
BACKSTAB_ATTACK_FRONT = physicsSetting.getInt("BackstabAttackFront", 0);
BACKSTAB_ATTACK_SIDE = physicsSetting.getInt("BackstabAttackSide", 0);
BACKSTAB_ATTACK_BEHIND = physicsSetting.getInt("BackstabAttackBehind", 70);
MAX_PATK_SPEED = physicsSetting.getInt("MaxPAtkSpeed", 1500);
MAX_MATK_SPEED = physicsSetting.getInt("MaxMAtkSpeed", 1999);
if (MAX_PATK_SPEED < 1)
{
MAX_PATK_SPEED = Integer.MAX_VALUE;
}
if (MAX_MATK_SPEED < 1)
{
MAX_MATK_SPEED = Integer.MAX_VALUE;
}
MAX_PCRIT_RATE = physicsSetting.getInt("MaxPCritRate", 500);
MAX_MCRIT_RATE = physicsSetting.getInt("MaxMCritRate", 300);
MCRIT_RATE_MUL = physicsSetting.getFloat("McritMulDif", 1f);
MAGIC_CRITICAL_POWER = physicsSetting.getFloat("MagicCriticalPower", 3f);
STUN_CHANCE_MODIFIER = physicsSetting.getFloat("StunChanceModifier", 1f);
BLEED_CHANCE_MODIFIER = physicsSetting.getFloat("BleedChanceModifier", 1f);
POISON_CHANCE_MODIFIER = physicsSetting.getFloat("PoisonChanceModifier", 1f);
PARALYZE_CHANCE_MODIFIER = physicsSetting.getFloat("ParalyzeChanceModifier", 1f);
ROOT_CHANCE_MODIFIER = physicsSetting.getFloat("RootChanceModifier", 1f);
SLEEP_CHANCE_MODIFIER = physicsSetting.getFloat("SleepChanceModifier", 1f);
FEAR_CHANCE_MODIFIER = physicsSetting.getFloat("FearChanceModifier", 1f);
CONFUSION_CHANCE_MODIFIER = physicsSetting.getFloat("ConfusionChanceModifier", 1f);
DEBUFF_CHANCE_MODIFIER = physicsSetting.getFloat("DebuffChanceModifier", 1f);
BUFF_CHANCE_MODIFIER = physicsSetting.getFloat("BuffChanceModifier", 1f);
ALT_MAGES_PHYSICAL_DAMAGE_MULTI = physicsSetting.getFloat("AltPDamageMages", 1f);
ALT_MAGES_MAGICAL_DAMAGE_MULTI = physicsSetting.getFloat("AltMDamageMages", 1f);
ALT_FIGHTERS_PHYSICAL_DAMAGE_MULTI = physicsSetting.getFloat("AltPDamageFighters", 1f);
ALT_FIGHTERS_MAGICAL_DAMAGE_MULTI = physicsSetting.getFloat("AltMDamageFighters", 1f);
ALT_PETS_PHYSICAL_DAMAGE_MULTI = physicsSetting.getFloat("AltPDamagePets", 1f);
ALT_PETS_MAGICAL_DAMAGE_MULTI = physicsSetting.getFloat("AltMDamagePets", 1f);
ALT_NPC_PHYSICAL_DAMAGE_MULTI = physicsSetting.getFloat("AltPDamageNpc", 1f);
ALT_NPC_MAGICAL_DAMAGE_MULTI = physicsSetting.getFloat("AltMDamageNpc", 1f);
ALT_DAGGER_DMG_VS_HEAVY = physicsSetting.getFloat("DaggerVSHeavy", 2.5f);
ALT_DAGGER_DMG_VS_ROBE = physicsSetting.getFloat("DaggerVSRobe", 1.8f);
ALT_DAGGER_DMG_VS_LIGHT = physicsSetting.getFloat("DaggerVSLight", 2f);
RUN_SPD_BOOST = physicsSetting.getInt("RunSpeedBoost", 0);
MAX_RUN_SPEED = physicsSetting.getInt("MaxRunSpeed", 250);
ALLOW_RAID_LETHAL = physicsSetting.getBoolean("AllowLethalOnRaids", false);
ALLOW_LETHAL_PROTECTION_MOBS = physicsSetting.getBoolean("AllowLethalProtectionMobs", false);
LETHAL_PROTECTED_MOBS = physicsSetting.getString("LethalProtectedMobs", "");
LIST_LETHAL_PROTECTED_MOBS = new ArrayList<>();
for (String id : LETHAL_PROTECTED_MOBS.split(","))
{
LIST_LETHAL_PROTECTED_MOBS.add(Integer.parseInt(id));
}
SEND_SKILLS_CHANCE_TO_PLAYERS = physicsSetting.getBoolean("SendSkillsChanceToPlayers", false);
REMOVE_WEAPON_SUBCLASS = physicsSetting.getBoolean("RemoveWeaponSubclass", false);
REMOVE_CHEST_SUBCLASS = physicsSetting.getBoolean("RemoveChestSubclass", false);
REMOVE_LEG_SUBCLASS = physicsSetting.getBoolean("RemoveLegSubclass", false);
DISABLE_BOW_CLASSES_STRING = physicsSetting.getString("DisableBowForClasses", "");
DISABLE_BOW_CLASSES = new ArrayList<>();
for (String class_id : DISABLE_BOW_CLASSES_STRING.split(","))
{
if (!class_id.equals(""))
{
DISABLE_BOW_CLASSES.add(Integer.parseInt(class_id));
}
}
LEAVE_BUFFS_ON_DIE = physicsSetting.getBoolean("LeaveBuffsOnDie", true);
}
public static void loadgeodataConfig()
{
final PropertiesParser geoengineConfig = new PropertiesParser(GEOENGINE_CONFIG_FILE);
GEODATA_PATH = geoengineConfig.getString("GeoDataPath", "./data/geodata/");
COORD_SYNCHRONIZE = geoengineConfig.getInt("CoordSynchronize", -1);
PART_OF_CHARACTER_HEIGHT = geoengineConfig.getInt("PartOfCharacterHeight", 75);
MAX_OBSTACLE_HEIGHT = geoengineConfig.getInt("MaxObstacleHeight", 32);
PATHFINDING = geoengineConfig.getBoolean("PathFinding", true);
PATHFIND_BUFFERS = geoengineConfig.getString("PathFindBuffers", "100x6;128x6;192x6;256x4;320x4;384x4;500x2");
BASE_WEIGHT = geoengineConfig.getInt("BaseWeight", 10);
DIAGONAL_WEIGHT = geoengineConfig.getInt("DiagonalWeight", 14);
OBSTACLE_MULTIPLIER = geoengineConfig.getInt("ObstacleMultiplier", 10);
HEURISTIC_WEIGHT = geoengineConfig.getInt("HeuristicWeight", 20);
MAX_ITERATIONS = geoengineConfig.getInt("MaxIterations", 3500);
FALL_DAMAGE = geoengineConfig.getBoolean("FallDamage", false);
ALLOW_WATER = geoengineConfig.getBoolean("AllowWater", false);
}
public static void loadBossConfig()
{
final PropertiesParser bossConfig = new PropertiesParser(RAIDBOSS_CONFIG_FILE);
ALT_RAIDS_STATS_BONUS = bossConfig.getBoolean("AltRaidsStatsBonus", true);
RBLOCKRAGE = bossConfig.getInt("RBlockRage", 5000);
if ((RBLOCKRAGE > 0) && (RBLOCKRAGE < 100))
{
LOGGER.info("ATTENTION: RBlockRage, if enabled (>0), must be >=100");
LOGGER.info(" -- RBlockRage setted to 100 by default");
RBLOCKRAGE = 100;
}
RBS_SPECIFIC_LOCK_RAGE = new HashMap<>();
final String RaidBossesSpecificLockRage = bossConfig.getString("RaidBossesSpecificLockRage", "");
if (!RaidBossesSpecificLockRage.equals(""))
{
final String[] lockedBosses = RaidBossesSpecificLockRage.split(";");
for (String actualBossRage : lockedBosses)
{
final String[] bossRage = actualBossRage.split(",");
int rage = Integer.parseInt(bossRage[1]);
if ((rage > 0) && (rage < 100))
{
LOGGER.info("ATTENTION: RaidBossesSpecificLockRage Value for boss " + bossRage[0] + ", if enabled (>0), must be >=100");
LOGGER.info(" -- RaidBossesSpecificLockRage Value for boss " + bossRage[0] + " setted to 100 by default");
rage = 100;
}
RBS_SPECIFIC_LOCK_RAGE.put(Integer.parseInt(bossRage[0]), rage);
}
}
PLAYERS_CAN_HEAL_RB = bossConfig.getBoolean("PlayersCanHealRb", true);
ALLOW_DIRECT_TP_TO_BOSS_ROOM = bossConfig.getBoolean("AllowDirectTeleportToBossRoom", false);
// Antharas
ANTHARAS_OLD = bossConfig.getBoolean("AntharasOldScript", true);
ANTHARAS_CLOSE = bossConfig.getInt("AntharasClose", 1200);
ANTHARAS_DESPAWN_TIME = bossConfig.getInt("AntharasDespawnTime", 240);
ANTHARAS_RESP_FIRST = bossConfig.getInt("AntharasRespFirst", 192);
ANTHARAS_RESP_SECOND = bossConfig.getInt("AntharasRespSecond", 145);
ANTHARAS_WAIT_TIME = bossConfig.getInt("AntharasWaitTime", 30);
ANTHARAS_POWER_MULTIPLIER = bossConfig.getFloat("AntharasPowerMultiplier", 1f);
// Baium
BAIUM_SLEEP = bossConfig.getInt("BaiumSleep", 1800);
BAIUM_RESP_FIRST = bossConfig.getInt("BaiumRespFirst", 121);
BAIUM_RESP_SECOND = bossConfig.getInt("BaiumRespSecond", 8);
BAIUM_POWER_MULTIPLIER = bossConfig.getFloat("BaiumPowerMultiplier", 1f);
// Core
CORE_RESP_MINION = bossConfig.getInt("CoreRespMinion", 60);
CORE_RESP_FIRST = bossConfig.getInt("CoreRespFirst", 37);
CORE_RESP_SECOND = bossConfig.getInt("CoreRespSecond", 42);
CORE_LEVEL = bossConfig.getInt("CoreLevel", 0);
CORE_RING_CHANCE = bossConfig.getInt("CoreRingChance", 0);
CORE_POWER_MULTIPLIER = bossConfig.getFloat("CorePowerMultiplier", 1f);
// Queen Ant
QA_RESP_NURSE = bossConfig.getInt("QueenAntRespNurse", 60);
QA_RESP_ROYAL = bossConfig.getInt("QueenAntRespRoyal", 120);
QA_RESP_FIRST = bossConfig.getInt("QueenAntRespFirst", 19);
QA_RESP_SECOND = bossConfig.getInt("QueenAntRespSecond", 35);
QA_LEVEL = bossConfig.getInt("QALevel", 0);
QA_RING_CHANCE = bossConfig.getInt("QARingChance", 0);
QA_POWER_MULTIPLIER = bossConfig.getFloat("QueenAntPowerMultiplier", 1f);
// Zaken
ZAKEN_RESP_FIRST = bossConfig.getInt("ZakenRespFirst", 60);
ZAKEN_RESP_SECOND = bossConfig.getInt("ZakenRespSecond", 8);
ZAKEN_LEVEL = bossConfig.getInt("ZakenLevel", 0);
ZAKEN_EARRING_CHANCE = bossConfig.getInt("ZakenEarringChance", 0);
ZAKEN_POWER_MULTIPLIER = bossConfig.getFloat("ZakenPowerMultiplier", 1f);
// Orfen
ORFEN_RESP_FIRST = bossConfig.getInt("OrfenRespFirst", 20);
ORFEN_RESP_SECOND = bossConfig.getInt("OrfenRespSecond", 8);
ORFEN_LEVEL = bossConfig.getInt("OrfenLevel", 0);
ORFEN_EARRING_CHANCE = bossConfig.getInt("OrfenEarringChance", 0);
ORFEN_POWER_MULTIPLIER = bossConfig.getFloat("OrfenPowerMultiplier", 1f);
// Valakas
VALAKAS_RESP_FIRST = bossConfig.getInt("ValakasRespFirst", 192);
VALAKAS_RESP_SECOND = bossConfig.getInt("ValakasRespSecond", 44);
VALAKAS_WAIT_TIME = bossConfig.getInt("ValakasWaitTime", 30);
VALAKAS_POWER_MULTIPLIER = bossConfig.getFloat("ValakasPowerMultiplier", 1f);
VALAKAS_DESPAWN_TIME = bossConfig.getInt("ValakasDespawnTime", 15);
// Frintezza
FRINTEZZA_RESP_FIRST = bossConfig.getInt("FrintezzaRespFirst", 48);
FRINTEZZA_RESP_SECOND = bossConfig.getInt("FrintezzaRespSecond", 8);
FRINTEZZA_POWER_MULTIPLIER = bossConfig.getFloat("FrintezzaPowerMultiplier", 1f);
BYPASS_FRINTEZZA_PARTIES_CHECK = bossConfig.getBoolean("BypassPartiesCheck", false);
FRINTEZZA_MIN_PARTIES = bossConfig.getInt("FrintezzaMinParties", 4);
FRINTEZZA_MAX_PARTIES = bossConfig.getInt("FrintezzaMaxParties", 5);
LEVEL_DIFF_MULTIPLIER_MINION = bossConfig.getFloat("LevelDiffMultiplierMinion", 0.5f);
RAID_INFO_IDS = bossConfig.getString("RaidInfoIDs", "");
RAID_INFO_IDS_LIST = new ArrayList<>();
for (String id : RAID_INFO_IDS.split(","))
{
RAID_INFO_IDS_LIST.add(Integer.parseInt(id));
}
// High Priestess van Halter
HPH_FIXINTERVALOFHALTER = bossConfig.getInt("FixIntervalOfHalter", 172800);
if ((HPH_FIXINTERVALOFHALTER < 300) || (HPH_FIXINTERVALOFHALTER > 864000))
{
HPH_FIXINTERVALOFHALTER = 172800;
}
HPH_FIXINTERVALOFHALTER *= 6000;
HPH_RANDOMINTERVALOFHALTER = bossConfig.getInt("RandomIntervalOfHalter", 86400);
if ((HPH_RANDOMINTERVALOFHALTER < 300) || (HPH_RANDOMINTERVALOFHALTER > 864000))
{
HPH_RANDOMINTERVALOFHALTER = 86400;
}
HPH_RANDOMINTERVALOFHALTER *= 6000;
HPH_APPTIMEOFHALTER = bossConfig.getInt("AppTimeOfHalter", 20);
if ((HPH_APPTIMEOFHALTER < 5) || (HPH_APPTIMEOFHALTER > 60))
{
HPH_APPTIMEOFHALTER = 20;
}
HPH_APPTIMEOFHALTER *= 6000;
HPH_ACTIVITYTIMEOFHALTER = bossConfig.getInt("ActivityTimeOfHalter", 21600);
if ((HPH_ACTIVITYTIMEOFHALTER < 7200) || (HPH_ACTIVITYTIMEOFHALTER > 86400))
{
HPH_ACTIVITYTIMEOFHALTER = 21600;
}
HPH_ACTIVITYTIMEOFHALTER *= 1000;
HPH_FIGHTTIMEOFHALTER = bossConfig.getInt("FightTimeOfHalter", 7200);
if ((HPH_FIGHTTIMEOFHALTER < 7200) || (HPH_FIGHTTIMEOFHALTER > 21600))
{
HPH_FIGHTTIMEOFHALTER = 7200;
}
HPH_FIGHTTIMEOFHALTER *= 6000;
HPH_CALLROYALGUARDHELPERCOUNT = bossConfig.getInt("CallRoyalGuardHelperCount", 6);
if ((HPH_CALLROYALGUARDHELPERCOUNT < 1) || (HPH_CALLROYALGUARDHELPERCOUNT > 6))
{
HPH_CALLROYALGUARDHELPERCOUNT = 6;
}
HPH_CALLROYALGUARDHELPERINTERVAL = bossConfig.getInt("CallRoyalGuardHelperInterval", 10);
if ((HPH_CALLROYALGUARDHELPERINTERVAL < 1) || (HPH_CALLROYALGUARDHELPERINTERVAL > 60))
{
HPH_CALLROYALGUARDHELPERINTERVAL = 10;
}
HPH_CALLROYALGUARDHELPERINTERVAL *= 6000;
HPH_INTERVALOFDOOROFALTER = bossConfig.getInt("IntervalOfDoorOfAlter", 5400);
if ((HPH_INTERVALOFDOOROFALTER < 60) || (HPH_INTERVALOFDOOROFALTER > 5400))
{
HPH_INTERVALOFDOOROFALTER = 5400;
}
HPH_INTERVALOFDOOROFALTER *= 6000;
HPH_TIMEOFLOCKUPDOOROFALTAR = bossConfig.getInt("TimeOfLockUpDoorOfAltar", 180);
if ((HPH_TIMEOFLOCKUPDOOROFALTAR < 60) || (HPH_TIMEOFLOCKUPDOOROFALTAR > 600))
{
HPH_TIMEOFLOCKUPDOOROFALTAR = 180;
}
HPH_TIMEOFLOCKUPDOOROFALTAR *= 6000;
}
public static void loadCharacterConfig()
{
final PropertiesParser characterConfig = new PropertiesParser(CHARACTER_CONFIG_FILE);
AUTO_LOOT = characterConfig.getBoolean("AutoLoot", true);
AUTO_LOOT_HERBS = characterConfig.getBoolean("AutoLootHerbs", true);
AUTO_LOOT_BOSS = characterConfig.getBoolean("AutoLootBoss", true);
AUTO_LEARN_SKILLS = characterConfig.getBoolean("AutoLearnSkills", false);
AUTO_LEARN_DIVINE_INSPIRATION = characterConfig.getBoolean("AutoLearnDivineInspiration", false);
LIFE_CRYSTAL_NEEDED = characterConfig.getBoolean("LifeCrystalNeeded", true);
SP_BOOK_NEEDED = characterConfig.getBoolean("SpBookNeeded", true);
ES_SP_BOOK_NEEDED = characterConfig.getBoolean("EnchantSkillSpBookNeeded", true);
DIVINE_SP_BOOK_NEEDED = characterConfig.getBoolean("DivineInspirationSpBookNeeded", true);
ALT_GAME_SKILL_LEARN = characterConfig.getBoolean("AltGameSkillLearn", false);
ALLOWED_SUBCLASS = characterConfig.getInt("AllowedSubclass", 3);
BASE_SUBCLASS_LEVEL = characterConfig.getByte("BaseSubclassLevel", (byte) 40);
MAX_SUBCLASS_LEVEL = characterConfig.getByte("MaxSubclassLevel", (byte) 81);
ALT_GAME_SUBCLASS_WITHOUT_QUESTS = characterConfig.getBoolean("AltSubClassWithoutQuests", false);
ALT_RESTORE_EFFECTS_ON_SUBCLASS_CHANGE = characterConfig.getBoolean("AltRestoreEffectOnSub", false);
ALT_PARTY_RANGE = characterConfig.getInt("AltPartyRange", 1500);
ALT_WEIGHT_LIMIT = characterConfig.getDouble("AltWeightLimit", 1);
ALT_GAME_DELEVEL = characterConfig.getBoolean("Delevel", true);
ALT_GAME_MAGICFAILURES = characterConfig.getBoolean("MagicFailures", false);
ALT_GAME_CANCEL_CAST = characterConfig.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || characterConfig.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
ALT_GAME_CANCEL_BOW = characterConfig.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || characterConfig.getString("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
ALT_GAME_SHIELD_BLOCKS = characterConfig.getBoolean("AltShieldBlocks", false);
ALT_PERFECT_SHLD_BLOCK = characterConfig.getInt("AltPerfectShieldBlockRate", 10);
ALT_GAME_MOB_ATTACK_AI = characterConfig.getBoolean("AltGameMobAttackAI", false);
ALT_MOB_AGRO_IN_PEACEZONE = characterConfig.getBoolean("AltMobAgroInPeaceZone", true);
ALT_GAME_FREIGHTS = characterConfig.getBoolean("AltGameFreights", false);
ALT_GAME_FREIGHT_PRICE = characterConfig.getInt("AltGameFreightPrice", 1000);
ALT_GAME_EXPONENT_XP = characterConfig.getFloat("AltGameExponentXp", 0f);
ALT_GAME_EXPONENT_SP = characterConfig.getFloat("AltGameExponentSp", 0f);
ALT_GAME_TIREDNESS = characterConfig.getBoolean("AltGameTiredness", false);
ALT_GAME_FREE_TELEPORT = characterConfig.getBoolean("AltFreeTeleporting", false);
ALT_RECOMMEND = characterConfig.getBoolean("AltRecommend", false);
ALT_RECOMMENDATIONS_NUMBER = characterConfig.getInt("AltMaxRecommendationNumber", 255);
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = characterConfig.getInt("CharMaxNumber", 0);
MAX_LEVEL_NEWBIE = characterConfig.getInt("MaxLevelNewbie", 20);
MAX_LEVEL_NEWBIE_STATUS = characterConfig.getInt("MaxLevelNewbieStatus", 40);
DISABLE_TUTORIAL = characterConfig.getBoolean("DisableTutorial", false);
STARTING_ADENA = characterConfig.getInt("StartingAdena", 100);
STARTING_AA = characterConfig.getInt("StartingAncientAdena", 0);
CUSTOM_STARTER_ITEMS_ENABLED = characterConfig.getBoolean("CustomStarterItemsEnabled", false);
if (CUSTOM_STARTER_ITEMS_ENABLED)
{
STARTING_CUSTOM_ITEMS_M.clear();
String[] propertySplit = characterConfig.getString("StartingCustomItemsMage", "57,0").split(";");
for (String reward : propertySplit)
{
final String[] rewardSplit = reward.split(",");
if (rewardSplit.length != 2)
{
LOGGER.warning("StartingCustomItemsMage[Config.load()]: invalid config property -> StartingCustomItemsMage \"" + reward + "\"");
}
else
{
try
{
STARTING_CUSTOM_ITEMS_M.add(new int[]
{
Integer.parseInt(rewardSplit[0]),
Integer.parseInt(rewardSplit[1])
});
}
catch (NumberFormatException nfe)
{
if (!reward.isEmpty())
{
LOGGER.warning("StartingCustomItemsMage[Config.load()]: invalid config property -> StartingCustomItemsMage \"" + reward + "\"");
}
}
}
}
STARTING_CUSTOM_ITEMS_F.clear();
propertySplit = characterConfig.getString("StartingCustomItemsFighter", "57,0").split(";");
for (String reward : propertySplit)
{
final String[] rewardSplit = reward.split(",");
if (rewardSplit.length != 2)
{
LOGGER.warning("StartingCustomItemsFighter[Config.load()]: invalid config property -> StartingCustomItemsFighter \"" + reward + "\"");
}
else
{
try
{
STARTING_CUSTOM_ITEMS_F.add(new int[]
{
Integer.parseInt(rewardSplit[0]),
Integer.parseInt(rewardSplit[1])
});
}
catch (NumberFormatException nfe)
{
if (!reward.isEmpty())
{
LOGGER.warning("StartingCustomItemsFighter[Config.load()]: invalid config property -> StartingCustomItemsFighter \"" + reward + "\"");
}
}
}
}
}
INVENTORY_MAXIMUM_NO_DWARF = characterConfig.getInt("MaximumSlotsForNoDwarf", 80);
INVENTORY_MAXIMUM_DWARF = characterConfig.getInt("MaximumSlotsForDwarf", 100);
INVENTORY_MAXIMUM_GM = characterConfig.getInt("MaximumSlotsForGMPlayer", 250);
MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
WAREHOUSE_SLOTS_DWARF = characterConfig.getInt("MaximumWarehouseSlotsForDwarf", 120);
WAREHOUSE_SLOTS_NO_DWARF = characterConfig.getInt("MaximumWarehouseSlotsForNoDwarf", 100);
WAREHOUSE_SLOTS_CLAN = characterConfig.getInt("MaximumWarehouseSlotsForClan", 150);
FREIGHT_SLOTS = characterConfig.getInt("MaximumFreightSlots", 20);
MAX_PVTSTORE_SLOTS_DWARF = characterConfig.getInt("MaxPvtStoreSlotsDwarf", 5);
MAX_PVTSTORE_SLOTS_OTHER = characterConfig.getInt("MaxPvtStoreSlotsOther", 4);
HP_REGEN_MULTIPLIER = characterConfig.getDouble("HpRegenMultiplier", 100) / 100;
MP_REGEN_MULTIPLIER = characterConfig.getDouble("MpRegenMultiplier", 100) / 100;
CP_REGEN_MULTIPLIER = characterConfig.getDouble("CpRegenMultiplier", 100) / 100;
ENABLE_KEYBOARD_MOVEMENT = characterConfig.getBoolean("KeyboardMovement", true);
UNSTUCK_INTERVAL = characterConfig.getInt("UnstuckInterval", 300);
PLAYER_SPAWN_PROTECTION = characterConfig.getInt("PlayerSpawnProtection", 0);
PLAYER_TELEPORT_PROTECTION = characterConfig.getInt("PlayerTeleportProtection", 0);
PLAYER_FAKEDEATH_UP_PROTECTION = characterConfig.getInt("PlayerFakeDeathUpProtection", 0);
DEEPBLUE_DROP_RULES = characterConfig.getBoolean("UseDeepBlueDropRules", true);
PARTY_XP_CUTOFF_METHOD = characterConfig.getString("PartyXpCutoffMethod", "percentage");
PARTY_XP_CUTOFF_PERCENT = characterConfig.getDouble("PartyXpCutoffPercent", 3);
PARTY_XP_CUTOFF_LEVEL = characterConfig.getInt("PartyXpCutoffLevel", 30);
RESPAWN_RESTORE_CP = characterConfig.getDouble("RespawnRestoreCP", 0) / 100;
RESPAWN_RESTORE_HP = characterConfig.getDouble("RespawnRestoreHP", 70) / 100;
RESPAWN_RESTORE_MP = characterConfig.getDouble("RespawnRestoreMP", 70) / 100;
RESPAWN_RANDOM_ENABLED = characterConfig.getBoolean("RespawnRandomInTown", false);
RESPAWN_RANDOM_MAX_OFFSET = characterConfig.getInt("RespawnRandomMaxOffset", 50);
PETITIONING_ALLOWED = characterConfig.getBoolean("PetitioningAllowed", true);
MAX_PETITIONS_PER_PLAYER = characterConfig.getInt("MaxPetitionsPerPlayer", 5);
MAX_PETITIONS_PENDING = characterConfig.getInt("MaxPetitionsPending", 25);
DEATH_PENALTY_CHANCE = characterConfig.getInt("DeathPenaltyChance", 20);
EFFECT_CANCELING = characterConfig.getBoolean("CancelLesserEffect", true);
STORE_SKILL_COOLTIME = characterConfig.getBoolean("StoreSkillCooltime", true);
BUFFS_MAX_AMOUNT = characterConfig.getByte("MaxBuffAmount", (byte) 24);
DEBUFFS_MAX_AMOUNT = characterConfig.getByte("MaxDebuffAmount", (byte) 6);
ENABLE_MODIFY_SKILL_DURATION = characterConfig.getBoolean("EnableModifySkillDuration", false);
if (ENABLE_MODIFY_SKILL_DURATION)
{
SKILL_DURATION_LIST = new HashMap<>();
String[] propertySplit;
propertySplit = characterConfig.getString("SkillDurationList", "").split(";");
for (String skill : propertySplit)
{
final String[] skillSplit = skill.split(",");
if (skillSplit.length != 2)
{
LOGGER.info("[SkillDurationList]: invalid config property -> SkillDurationList \"" + skill + "\"");
}
else
{
try
{
SKILL_DURATION_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
}
catch (NumberFormatException nfe)
{
if (!skill.equals(""))
{
LOGGER.info("[SkillDurationList]: invalid config property -> SkillList \"" + skillSplit[0] + "\"" + skillSplit[1]);
}
}
}
}
}
ALLOW_CLASS_MASTERS = characterConfig.getBoolean("AllowClassMasters", false);
CLASS_MASTER_STRIDER_UPDATE = characterConfig.getBoolean("AllowClassMastersStriderUpdate", false);
ALLOW_CLASS_MASTERS_FIRST_CLASS = characterConfig.getBoolean("AllowClassMastersFirstClass", true);
ALLOW_CLASS_MASTERS_SECOND_CLASS = characterConfig.getBoolean("AllowClassMastersSecondClass", true);
ALLOW_CLASS_MASTERS_THIRD_CLASS = characterConfig.getBoolean("AllowClassMastersThirdClass", true);
CLASS_MASTER_SETTINGS = new ClassMasterSettings(characterConfig.getString("ConfigClassMaster", ""));
ALLOW_REMOTE_CLASS_MASTERS = characterConfig.getBoolean("AllowRemoteClassMasters", false);
}
public static void loadDaemonsConf()
{
final PropertiesParser deamonsConfig = new PropertiesParser(DAEMONS_CONFIG_FILE);
DEADLOCKCHECK_INTIAL_TIME = deamonsConfig.getLong("DeadLockCheck", 0);
DEADLOCKCHECK_DELAY_TIME = deamonsConfig.getLong("DeadLockDelay", 0);
}
/**
* Loads all Filter Words
*/
public static void loadFilter()
{
LineNumberReader lnr = null;
try
{
final File file = new File(FILTER_FILE);
if (!file.exists())
{
return;
}
lnr = new LineNumberReader(new BufferedReader(new FileReader(file)));
String line = null;
while ((line = lnr.readLine()) != null)
{
if ((line.trim().length() == 0) || line.startsWith("#"))
{
continue;
}
FILTER_LIST.add(line.trim());
}
LOGGER.info("Loaded " + FILTER_LIST.size() + " Filter Words.");
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + FILTER_FILE + " File.");
}
finally
{
if (lnr != null)
{
try
{
lnr.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}
public static void loadHexId()
{
final PropertiesParser hexIdConfig = new PropertiesParser(HEXID_FILE);
SERVER_ID = hexIdConfig.getInt("ServerID", 1);
HEX_ID = new BigInteger(hexIdConfig.getString("HexID", null), 16).toByteArray();
}
public static void loadLoginStartConfig()
{
final PropertiesParser serverSettings = new PropertiesParser(LOGIN_CONFIG_FILE);
GAME_SERVER_LOGIN_HOST = serverSettings.getString("LoginHostname", "*");
GAME_SERVER_LOGIN_PORT = serverSettings.getInt("LoginPort", 9013);
LOGIN_BIND_ADDRESS = serverSettings.getString("LoginserverHostname", "*");
PORT_LOGIN = serverSettings.getInt("LoginserverPort", 2106);
ACCEPT_NEW_GAMESERVER = serverSettings.getBoolean("AcceptNewGameServer", true);
LOGIN_TRY_BEFORE_BAN = serverSettings.getInt("LoginTryBeforeBan", 10);
LOGIN_BLOCK_AFTER_BAN = serverSettings.getInt("LoginBlockAfterBan", 600);
INTERNAL_HOSTNAME = serverSettings.getString("InternalHostname", "localhost");
EXTERNAL_HOSTNAME = serverSettings.getString("ExternalHostname", "localhost");
DATABASE_DRIVER = serverSettings.getString("Driver", "org.mariadb.jdbc.Driver");
DATABASE_URL = serverSettings.getString("URL", "jdbc:mariadb://localhost/l2jdb");
DATABASE_LOGIN = serverSettings.getString("Login", "root");
DATABASE_PASSWORD = serverSettings.getString("Password", "");
DATABASE_MAX_CONNECTIONS = serverSettings.getInt("MaximumDbConnections", 10);
BACKUP_DATABASE = serverSettings.getBoolean("BackupDatabase", false);
MYSQL_BIN_PATH = serverSettings.getString("MySqlBinLocation", "C:/xampp/mysql/bin/");
BACKUP_PATH = serverSettings.getString("BackupPath", "../backup/");
BACKUP_DAYS = serverSettings.getInt("BackupDays", 30);
BRUT_AVG_TIME = serverSettings.getInt("BrutAvgTime", 30); // in Seconds
BRUT_LOGON_ATTEMPTS = serverSettings.getInt("BrutLogonAttempts", 15);
BRUT_BAN_IP_TIME = serverSettings.getInt("BrutBanIpTime", 900); // in Seconds
SHOW_LICENCE = serverSettings.getBoolean("ShowLicence", false);
IP_UPDATE_TIME = serverSettings.getInt("IpUpdateTime", 15);
FORCE_GGAUTH = serverSettings.getBoolean("ForceGGAuth", false);
AUTO_CREATE_ACCOUNTS = serverSettings.getBoolean("AutoCreateAccounts", true);
FLOOD_PROTECTION = serverSettings.getBoolean("EnableFloodProtection", true);
FAST_CONNECTION_LIMIT = serverSettings.getInt("FastConnectionLimit", 15);
NORMAL_CONNECTION_TIME = serverSettings.getInt("NormalConnectionTime", 700);
FAST_CONNECTION_TIME = serverSettings.getInt("FastConnectionTime", 350);
MAX_CONNECTION_PER_IP = serverSettings.getInt("MaxConnectionPerIP", 50);
NETWORK_IP_LIST = serverSettings.getString("NetworkList", "");
SESSION_TTL = serverSettings.getLong("SessionTTL", 25000);
MAX_LOGINSESSIONS = serverSettings.getInt("MaxSessions", 200);
}
public static void loadBanFile()
{
File file = new File(BANNED_IP_FILE);
if (!file.exists())
{
// old file position
file = new File(LEGACY_BANNED_IP);
}
if (file.exists() && file.isFile())
{
FileInputStream fis = null;
try
{
fis = new FileInputStream(file);
LineNumberReader reader = null;
String line;
String[] parts;
try
{
reader = new LineNumberReader(new InputStreamReader(fis));
while ((line = reader.readLine()) != null)
{
line = line.trim();
// check if this line isnt a comment line
if ((line.length() > 0) && (line.charAt(0) != '#'))
{
// split comments if any
parts = line.split("#", 2);
// discard comments in the line, if any
line = parts[0];
parts = line.split(" ");
final String address = parts[0];
long duration = 0;
if (parts.length > 1)
{
try
{
duration = Long.parseLong(parts[1]);
}
catch (NumberFormatException e)
{
LOGGER.warning("Skipped: Incorrect ban duration (" + parts[1] + ") on (" + file.getName() + "). Line: " + reader.getLineNumber());
continue;
}
}
try
{
LoginController.getInstance().addBanForAddress(address, duration);
}
catch (UnknownHostException e)
{
LOGGER.warning("Skipped: Invalid address (" + parts[0] + ") on (" + file.getName() + "). Line: " + reader.getLineNumber());
}
}
}
}
catch (IOException e)
{
LOGGER.warning("Error while reading the bans file (" + file.getName() + "). Details: " + e);
}
LOGGER.info("Loaded " + LoginController.getInstance().getBannedIps().size() + " IP Bans.");
}
catch (FileNotFoundException e)
{
LOGGER.warning("Failed to load banned IPs file (" + file.getName() + ") for reading. Reason: " + e);
}
finally
{
if (fis != null)
{
try
{
fis.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
}
else
{
LOGGER.info("IP Bans file (" + file.getName() + ") is missing or is a directory, skipped.");
}
}
public static void saveHexid(int serverId, String string)
{
saveHexid(serverId, string, HEXID_FILE);
}
public static void saveHexid(int serverId, String hexId, String fileName)
{
try
{
final Properties hexSetting = new Properties();
final File file = new File(fileName);
// Create a new empty file only if it doesn't exist
if (!file.exists())
{
try (OutputStream out = new FileOutputStream(file))
{
hexSetting.setProperty("ServerID", String.valueOf(serverId));
hexSetting.setProperty("HexID", hexId);
hexSetting.store(out, "The HexId to Auth into LoginServer");
LOGGER.log(Level.INFO, "Gameserver: Generated new HexID file for server id " + serverId + ".");
}
}
}
catch (Exception e)
{
LOGGER.warning(StringUtil.concat("Failed to save hex id to ", fileName, " File."));
LOGGER.warning("Config: " + e.getMessage());
}
}
public static void unallocateFilterBuffer()
{
LOGGER.info("Cleaning Chat Filter..");
FILTER_LIST.clear();
}
/**
* Loads flood protector configurations.
* @param properties
*/
private static void loadFloodProtectorConfigs(PropertiesParser properties)
{
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", 1);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", 42);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", 42);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", 16);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", 100);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GLOBAL_CHAT, "GlobalChat", 5);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", 20);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", 10);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", 5);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", 1);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", 10);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANUFACTURE, "Manufacture", 3);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MANOR, "Manor", 30);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_CHARACTER_SELECT, "CharacterSelect", 30);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_UNKNOWN_PACKETS, "UnknownPackets", 5);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_PARTY_INVITATION, "PartyInvitation", 30);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SAY_ACTION, "SayAction", 100);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MOVE_ACTION, "MoveAction", 30);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_GENERIC_ACTION, "GenericAction", 5);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MACRO, "Macro", 10);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_POTION, "Potion", 4);
}
public static void load(ServerMode serverMode)
{
SERVER_MODE = serverMode;
if (SERVER_MODE == ServerMode.GAME)
{
loadHexId();
// Load network
loadServerConfig();
// Head
loadRatesConfig();
loadCharacterConfig();
loadGeneralConfig();
load7sConfig();
loadCHConfig();
loadElitCHConfig();
loadOlympConfig();
loadEnchantConfig();
loadBossConfig();
// Head functions
loadCustomServerConfig();
loadPhysicsConfig();
loadAccessConfig();
loadPvpConfig();
loadCraftConfig();
// Event config
loadCTFConfig();
loadDMConfig();
loadTVTConfig();
loadTWConfig();
// Protect
loadFloodConfig();
loadProtectedOtherConfig();
// Geoengine
loadgeodataConfig();
// Custom
loadChampionConfig();
loadMerchantZeroPriceConfig();
loadWeddingConfig();
loadL2jServerConfig();
loadRebirthConfig();
loadBankingConfig();
loadBufferConfig();
loadPCBPointConfig();
loadOfflineConfig();
// Other
loadDaemonsConf();
if (USE_SAY_FILTER)
{
loadFilter();
}
loadTelnetConfig();
}
else if (SERVER_MODE == ServerMode.LOGIN)
{
loadLoginStartConfig();
loadTelnetConfig();
}
else
{
LOGGER.severe("Could not Load Config: server mode was not set.");
}
}
}
| Hl4p3x/L2JServer_C6_Interlude | java/org/l2jserver/Config.java |
248,938 | package pruebas;
import static org.junit.Assert.*;
import java.util.Calendar;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import puresound.Discografica;
import puresound.FestivalPasado;
import puresound.Grupo;
import puresound.ListaMusicos;
import puresound.Musico;
import puresound.Puntuacion;
import puresound.Rol;
import puresound.Solista;
public class FestivalPasadoTest {
FestivalPasado fp1;
Calendar fecha;
Solista s1;
Grupo g1;
Musico m1;
ListaMusicos lm1;
Discografica d1;
Puntuacion p1;
@Before
public void setUp() throws Exception {
fecha= Calendar.getInstance();
fecha.set(1990, 3, 10);
m1= new Musico("Musico", fecha, "Somalia", Rol.CANTANTE);
lm1= new ListaMusicos();
d1 = new Discografica("Disco", 2003);
fp1 = new FestivalPasado("Festival", fecha, "Alli", "Resumen", 1230);
s1 = new Solista("Solista", fecha, m1, d1);
g1= new Grupo("Frupo", fecha, d1);
p1= new Puntuacion(10, "Sobresaliente");
fp1.addArtista(g1);
fp1.addArtista(s1);
}
@After
public void tearDown() throws Exception {
fp1=null;
fecha=null;
m1=null;
lm1=null;
d1=null;
s1=null;
g1=null;
fp1.addPuntuacion(p1);
}
@Test
public void testCompareTo() {
FestivalPasado fp2 = new FestivalPasado("Festival", fecha, "Alli", "Resumen", 1230);
assertEquals(fp1.compareTo(fp2),0);
}
/*@Test
public void testAddArtista() {
assertEquals(fp1.getListaArtistas().getLista().size(),2);
}
@Test
public void testRemoveArtista() {
fp1.removeArtista(s1.getNombre());
assertEquals(fp1.getListaArtistas().getLista().size(),1);
}*/
@Test
public void testVerResumenYFinal() {
assertEquals(fp1.verResumen(),"Resumen");
assertEquals(fp1.verAsistenciaFinal(),1230);
}
@Test
public void testAddPuntuacion() {
assertEquals(fp1.getPuntuacion(),p1);
}
@Test
public void testRemovePuntuacion() {
fp1.removePuntuacion();
assertNull(fp1.getPuntuacion());
}
}
| 0xJCG/is-java-pure-sound | src/pruebas/FestivalPasadoTest.java |
248,939 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.bjw.pantechgetupdate;
public final class R {
public static final class attr {
}
public static final class color {
public static final int black=0x7f040007;
public static final int blue=0x7f040004;
public static final int brown=0x7f040001;
public static final int festival_gongzuo=0x7f040013;
public static final int festival_jinianri=0x7f040011;
public static final int festival_shenghuo=0x7f040014;
public static final int festival_shengri=0x7f040012;
public static final int festival_xitong=0x7f040010;
public static final int green=0x7f040003;
public static final int grey=0x7f04000b;
public static final int huangli_line=0x7f04000e;
public static final int light_brown=0x7f040008;
public static final int light_grey=0x7f04000c;
public static final int light_grey_bg=0x7f04000d;
public static final int orange=0x7f040002;
public static final int red=0x7f040005;
public static final int trans=0x7f040000;
public static final int trans_black=0x7f04000a;
public static final int trans_white=0x7f040009;
public static final int weathertext=0x7f04000f;
public static final int white=0x7f040006;
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
*/
public static final int activity_horizontal_margin=0x7f050000;
public static final int activity_vertical_margin=0x7f050001;
}
public static final class drawable {
public static final int blank=0x7f020000;
public static final int button_bg=0x7f020001;
public static final int button_bg_sel=0x7f020002;
public static final int ic_launcher=0x7f020003;
public static final int list_bg_sel=0x7f020004;
public static final int selector_btn=0x7f020005;
public static final int selector_list_bg=0x7f020006;
}
public static final class id {
public static final int action_about=0x7f09001c;
public static final int action_quit=0x7f09001d;
public static final int btnCheck=0x7f090018;
public static final int btnCopy=0x7f090003;
public static final int btnGetAllModel=0x7f090004;
public static final int editText=0x7f090002;
public static final int editTextModel=0x7f090016;
public static final int editTextVersion=0x7f090017;
public static final int gridViewAllModel=0x7f090006;
public static final int gridViewUpdate=0x7f09001a;
public static final int imageView1=0x7f090015;
public static final int pager=0x7f090001;
public static final int progressBarCheck=0x7f090019;
public static final int progressBarDLInf=0x7f090005;
public static final int selector_address=0x7f09001b;
public static final int text1Model=0x7f09000a;
public static final int text3FileName=0x7f09000c;
public static final int text4FSVersion=0x7f09000e;
public static final int text5NVVersion=0x7f090010;
public static final int text6Size=0x7f090014;
public static final int text7CRC=0x7f090012;
public static final int textTagName=0x7f090007;
public static final int textValue=0x7f090009;
public static final int textView1=0x7f090008;
public static final int textView2=0x7f09000b;
public static final int textView3=0x7f09000d;
public static final int textView4=0x7f09000f;
public static final int textView5=0x7f090013;
public static final int textView6=0x7f090011;
public static final int txtVersion=0x7f090000;
}
public static final class layout {
public static final int about=0x7f030000;
public static final int activity_main=0x7f030001;
public static final int address_activity=0x7f030002;
public static final int binx_fragment=0x7f030003;
public static final int info_item=0x7f030004;
public static final int model_item=0x7f030005;
public static final int ota_fragment=0x7f030006;
}
public static final class menu {
public static final int main=0x7f080000;
}
public static final class string {
public static final int Title_download_address=0x7f060010;
public static final int aboutUs_etouch_email=0x7f060015;
public static final int about_1=0x7f060016;
public static final int about_2=0x7f060017;
public static final int about_3=0x7f060018;
public static final int about_4=0x7f060019;
public static final int about_app=0x7f060012;
public static final int about_author=0x7f060013;
public static final int about_blog=0x7f060014;
public static final int action_about=0x7f060005;
public static final int action_quit=0x7f060006;
public static final int app_name=0x7f060000;
public static final int btn_text_copy=0x7f060011;
public static final int check_update=0x7f060004;
public static final int get_phone_model=0x7f060003;
public static final int item_CRC=0x7f06000d;
public static final int item_FSVersion=0x7f06000a;
public static final int item_FileName=0x7f060009;
public static final int item_Model=0x7f060007;
public static final int item_NVVersion=0x7f06000b;
public static final int item_Size=0x7f06000c;
public static final int item_Version=0x7f060008;
public static final int title_section1=0x7f060001;
public static final int title_section2=0x7f060002;
public static final int txt_Model=0x7f06000e;
public static final int txt_Version=0x7f06000f;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f070000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f070001;
public static final int Translucent=0x7f070003;
public static final int button_style=0x7f070002;
}
}
| benjaminwan/PantechGetUpdate | gen/com/bjw/pantechgetupdate/R.java |
248,940 | public class Genero {
String tipo;
String ritmo;
int anio;
String pais;
String artista;
String festival;
public Genero(String tipo, String ritmo, int anio, String pais, String artista, String festival) {
this.tipo = tipo;
this.ritmo = ritmo;
this.anio = anio;
this.pais = pais;
this.artista = artista;
this.festival = festival;
}
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
public String getRitmo() {
return ritmo;
}
public void setRitmo(String ritmo) {
this.ritmo = ritmo;
}
public int getAnio() {
return anio;
}
public void setAnio(int anio) {
this.anio = anio;
}
public String getPais() {
return pais;
}
public void setPais(String pais) {
this.pais = pais;
}
public String getArtista() {
return artista;
}
public void setArtista(String artista) {
this.artista = artista;
}
public String getFestival() {
return festival;
}
public void setFestival(String festival) {
this.festival = festival;
}
public void imprimirDatos(){
System.out.println(this.tipo);
System.out.println(this.ritmo);
System.out.println(this.anio);
System.out.println(this.pais);
System.out.println(this.artista);
System.out.println(this.festival);
}
}
| 4lanPz/CLASESETTERS | src/Genero.java |
248,941 | import java.sql.SQLOutput;
public class genero {
String tipo;
String ritmo;
int anio;
String pais;
String artista;
public genero(String tipo, String ritmo, int anio, String pais, String artista, String festival) {
this.tipo = tipo;
this.ritmo = ritmo;
this.anio = anio;
this.pais = pais;
this.artista = artista;
this.festival = festival;
}
//clic derechop general y elegir geter and setter
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
public String getRitmo() {
return ritmo;
}
public void setRitmo(String ritmo) {
this.ritmo = ritmo;
}
public int getAnio() {
return anio;
}
public void setAnio(int anio) {
this.anio = anio;
}
public String getPais() {
return pais;
}
public void setPais(String pais) {
this.pais = pais;
}
public String getArtista() {
return artista;
}
public void setArtista(String artista) {
this.artista = artista;
}
public String getFestival() {
return festival;
}
public void setFestival(String festival) {
this.festival = festival;
}
public void imprimirDatos(){
// hola a todos
System.out.println("IMPRIMIR DATOS ");
System.out.println(this.tipo);
System.out.println(this.ritmo);
System.out.println(this.anio);
System.out.println(this.pais);
System.out.println(this.artista);
System.out.println(this.festival);
}
String festival;
}
| natycasillas/clase4nataly | src/genero.java |
248,942 | public class Genero {
String tipo;
String ritmo;
int anio;
String pais;
String artista;
String festival;
public Genero(String tipo, String ritmo, int anio, String pais, String artista, String festival) {
this.tipo = tipo;
this.ritmo = ritmo;
this.anio = anio;
this.pais = pais;
this.artista = artista;
this.festival = festival;
}
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
public String getRitmo() {
return ritmo;
}
public void setRitmo(String ritmo) {
this.ritmo = ritmo;
}
public int getAnio() {
return anio;
}
public void setAnio(int anio) {
this.anio = anio;
}
public String getPais() {
return pais;
}
public void setPais(String pais) {
this.pais = pais;
}
public String getArtista() {
return artista;
}
public void setArtista(String artista) {
this.artista = artista;
}
public String getFestival() {
return festival;
}
public void setFestival(String festival) {
this.festival = festival;
}
public void imprimirDatos(){
System.out.println(this.tipo);
System.out.println(this.ritmo);
System.out.println(this.anio);
System.out.println(this.pais);
System.out.println(this.artista);
System.out.println(this.festival);
}
}
| Miguel-Paredes/Musica | src/Genero.java |
248,943 | public class Genero {
String tipo;
int year;
String pais;
String artista;
String festival;
public Genero(String tipo, int year, String pais, String artista, String festival) {
this.tipo = tipo;
this.year = year;
this.pais = pais;
this.artista = artista;
this.festival = festival;
}
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
public String getPais() {
return pais;
}
public void setPais(String pais) {
this.pais = pais;
}
public String getArtista() {
return artista;
}
public void setArtista(String artista) {
this.artista = artista;
}
public String getFestival() {
return festival;
}
public void setFestival(String festival) {
this.festival = festival;
}
public void imprimirdatos(){
System.out.println(this.tipo);
System.out.println(this.year);
System.out.println(this.pais);
System.out.println(this.artista);
System.out.println(this.festival);
//nuevos cambios para agregar con commit y push
}
}
| risthian-P/genero | src/Genero.java |
248,944 | package com.xworkz.collection.app.boot;
import java.util.Collection;
import java.util.LinkedList;
import java.util.stream.Collectors;
public class FestivalRunner {
public static void main(String[] args) {
System.out.println("invoking main in Festival Runner...");
Collection<String> festival = new LinkedList<String>();
festival.add("Holi");
festival.add("Deepavali");
festival.add("Navaratri");
festival.add("Christmas");
festival.add("Makar Sankranti");
festival.add("Ugadi");
festival.add("Ram Navami");
festival.add("Raksha Bandhan");
festival.add("Ganesha Chaturthi");
festival.add("Christmas");
festival.add("Valmiki Jayanti");
festival.add("Durga pooja");
festival.add("Id E Milad");
festival.add("Onam");
festival.add("Buddha Purnima");
festival.add("New Year");
System.out.println("total number of festival:" + festival.size());
System.out.println("=======================");
System.out.println("Festivals with more than 6 character:");
festival.stream().filter(fest->fest.length()>6).forEach(fest-> System.out.println(fest));
System.out.println("+++++++++++++++++++++++++++++++++");
festival.stream().filter(fest->fest.length()<6).forEach(fest-> System.out.println(fest));
System.out.println("+++++++++++++++++++++++++++++++++");
festival.stream().filter(fest->fest.contains("O")|| fest.contains("o")).collect(Collectors.toList()).forEach(fest->System.out.println(fest));
System.out.println("-----------------------------------------");
festival.stream().filter(fest->!fest.contains("g")).collect(Collectors.toList()).forEach(fest->System.out.println(fest));
System.out.println("============================================");
festival.stream().filter(fest->fest.endsWith("S")|| fest.endsWith("s")).collect(Collectors.toList()).forEach(fest->System.out.println(fest));
System.out.println("-----------------------------------------");
festival.stream().filter(fest->fest.contains("Z")|| fest.contains("R")).collect(Collectors.toList()).forEach(fest->System.out.println(fest));
System.out.println("-----------------------------------------");
festival.stream().filter(fest-> fest.contains("Ram")).collect(Collectors.toList()).forEach(fest->System.out.println(fest));
}
}
| sushmamb123/javaxworkz | boot/FestivalRunner.java |
248,945 | package models;
import org.mongodb.morphia.annotations.Entity;
import play.data.validation.Constraints;
import java.util.ArrayList;
import java.util.List;
/**
* Created by harshitjain on 10/08/17.
*/
@Entity(noClassnameStored = true)
public class FestivalList extends BaseModel {
@Constraints.Required
private String year;
@Constraints.Required
private List<Festival> festivals = new ArrayList<>();
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public List<Festival> getFestivals() {
return festivals;
}
public void setFestivals(List<Festival> festivals) {
this.festivals = festivals;
}
}
| krhitesh/bodh-internship | soulbackend/app/models/FestivalList.java |
248,947 | package gamecontrollers;
import gamecontrollers.commandcreator.*;
import gamecontrollers.palacefestival.FestivalController;
import gamecontrollers.palacefestival.FestivalTurnController;
import gamecontrollers.turn.*;
import models.Pair;
import models.board.Direction;
import models.board.JavaGame;
import models.board.Space;
import models.board.TileComponent;
import models.board.TileComponentContents.Palace;
import models.palacefestival.FestivalModel;
import models.palacefestival.JavaPlayer;
import models.palacefestival.PalaceCard;
import java.util.Arrays;
import java.util.List;
public class Facade {
private static Facade FacadeInstance = new Facade();
private JavaGame game;
private TilePlacementCommandCreator tilePlacementCommandCreator;
private BoardLogicController boardLogicController;
private FestivalController festivalController;
private FestivalTurnController festivalTurnController;
private HistoryChannelController historyChannelController;
private DeveloperMovementCommandCreator developerMovementCommandCreator;
private TurnController turnController;
private ReplayController replayController;
private PlanningModeCommandHandler planningModeCommandHandler;
private PlayModeCommandHandler playModeCommandHandler;
private PalaceCommandCreator palaceCommandCreator;
public static Facade getInstance() {
return FacadeInstance;
}
private Facade() {
}
// start
public void startGame(List<Pair<String,String>> playersData, String boardFile){
game = new JavaGame(playersData, boardFile);
historyChannelController = new HistoryChannelController(game.getPlayers().length + 1);
boardLogicController = new BoardLogicController(game.getBoard());
festivalController = new FestivalController(historyChannelController);
festivalTurnController = festivalController.getTurnController();
developerMovementCommandCreator = new DeveloperMovementCommandCreator(turnController, boardLogicController);
tilePlacementCommandCreator = new TilePlacementCommandCreator(turnController, game.getSharedResources());
palaceCommandCreator = new MaskPalaceCommandCreator(turnController, game.getSharedResources());
//this new creator for turn controller is weird
//gotta give him an arbitrary turnstate?
planningModeCommandHandler = new PlanningModeCommandHandler(historyChannelController);
playModeCommandHandler = new PlayModeCommandHandler(historyChannelController);
turnController = new TurnController(tilePlacementCommandCreator, Arrays.asList(game.getPlayers()), game.getSharedResources(), game.getDeck(), playModeCommandHandler, boardLogicController);
//lol oops
developerMovementCommandCreator.setTurnController(turnController);
tilePlacementCommandCreator.setTurnController(turnController);
palaceCommandCreator.setTurnController(turnController);
replayController = new ReplayController();
}
/*
========================================================================
GETTERS, pretty much for updating the views
========================================================================
*/
public JavaGame getGame() {
return game;
}
public FestivalModel getFestivalModel() {
return festivalTurnController.getFestivalModel();
}
public JavaPlayer getCurrentPlayer(){
return turnController.getCurrentPlayer();
}
public int getCurrentPlayerActionPoints(){
return turnController.getCurrentActionPoints();
}
/*
========================================================================
Setup for command builders methods
========================================================================
*/
public Response setupForMovingDeveloper(){
Response response = developerMovementCommandCreator.setCurrentDeveloper();
if ( !response.hasErrors() ) {
turnController.setCommandBuilder(developerMovementCommandCreator);
}
return response;
}
public void startPlacingTile(TileComponent tileComponent) {
//TODO throws an index out of bounds exception, run and press I, V, R, P, 2 and you'll see
System.out.println("Facade - beginning tile placement methods");
System.out.println("Setting the root");
tilePlacementCommandCreator.setCurrentSpace(game.getBoard().getRoot());
System.out.println("Setting the tile component to place");
tilePlacementCommandCreator.setCurrentTileComponent(tileComponent);
System.out.println("setting the command builder");
turnController.setCommandBuilder(tilePlacementCommandCreator);
System.out.println("completed placing tile");
}
/*
========================================================================
Turn Handlers
========================================================================
*/
public Response endTurn() {
return turnController.attemptToEndTurn();
}
/*
========================================================================
Board Communication Methods
========================================================================
*/
public List<Direction> getTilePlacementPath(){
return tilePlacementCommandCreator.getPath();
}
public TileComponent getCurrentTileComponent(){
return tilePlacementCommandCreator.getCurrentTile();
}
public void tabThroughDevelopers() {
developerMovementCommandCreator.iterateThroughBoardDevelopers();
}
public void moveTile(Direction direction){
tilePlacementCommandCreator.move(direction);
}
public void movePalace(Direction direction){
palaceCommandCreator.move(direction);
}
public void moveDeveloper(Direction direction){
developerMovementCommandCreator.move(direction);
}
public void tabThroughPalace() {
palaceCommandCreator.tabThroughPalacesRemaining();
}
public boolean validPlacement(TileComponent tile, Space space){
System.out.println("Facade.findShortestPath is not implemented yet");
return false;
}
public void rotateCurrentTileComponent() {
tilePlacementCommandCreator.rotateCurrentTileComponent();
}
/*
========================================================================
Shared Resources communication
========================================================================
*/
public Response playExtraActionToken() {
return turnController.attemptToActionToken();
}
public Response drawCardFromDeck() {
return turnController.attemptToDrawFromDeck();
}
public Response drawTheFestivalCard() {
return turnController.attemptToDrawFestivalCard();
}
/*
========================================================================
Festival Communication Methods
========================================================================
*/
public void startFestival(JavaPlayer[] players, PalaceCard festivalCard, Palace palaceAssociated){
festivalController.startFestival(players, festivalCard, palaceAssociated);
}
public void tabPalaceCard(){
festivalTurnController.tabThroughPalaceCards();
}
public void playPalaceCard(){
festivalTurnController.playPalaceCard();
}
public void dropOutOfFestival() {
festivalTurnController.dropOutCommandCreator();
}
public Response endFestivalTurn(){
return festivalTurnController.attemptToEndTurn();
}
public void askForPalaceFestivalTie() {
festivalTurnController.endFestival();
}
public void endFestival(List<PalaceCard> discardedCards, List<JavaPlayer> playersFromFestival, int pointsEarned) {
//need to go to the viewController, and go back to the board view
//then apply this to the game
game.endFestival(discardedCards, playersFromFestival, pointsEarned);
}
public void undoEndFestival(List<PalaceCard> discardedCards, List<JavaPlayer> playersFromFestival, int pointsEarned) {
game.undoFestival(discardedCards, playersFromFestival, pointsEarned);
}
/*
========================================================================
Perform actions methods
========================================================================
*/
// Actually execute the action being built
// It returns a response that has messages for rules violation if any
// if the action is executed successfully the response.hasErrors is set to true
public Response commitMove(){
return turnController.commitMove();
}
public void startPlanningMode(){
turnController.setCommandHandler(planningModeCommandHandler);
}
public void startPlayMode(){
turnController.setCommandHandler(playModeCommandHandler);
}
public void undoCommand(){
planningModeCommandHandler.cancelCommand();
}
public void cancelCurrentCommand(){
throw new UnsupportedOperationException();
}
}
| nwcaldwell/Java | src/gamecontrollers/Facade.java |
248,949 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.StringTokenizer;
public class Main_9205 { // 9205. 맥주 마시면서 걸어가기
static boolean[] visited; // 편의점 방문체크
static int[][] convenience; // 편의점 좌표
static int n; // 편의점 개수
static int[] home = new int[2]; // 상근이집
static int[] festival = new int[2]; // 락페
static Queue<Integer> queue;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
StringTokenizer st = null;
int testCase = Integer.parseInt(br.readLine());
for (int tc = 0; tc < testCase; tc++) {
n = Integer.parseInt(br.readLine()); // 편의점 개수
visited = new boolean[n]; // 편의점 방문체크
convenience = new int[n][2]; // 편의점 좌표
st = new StringTokenizer(br.readLine(), " ");
home[0] = Integer.parseInt(st.nextToken());
home[1] = Integer.parseInt(st.nextToken());
for (int i = 0; i < n; i++) {
st = new StringTokenizer(br.readLine(), " ");
convenience[i][0] = Integer.parseInt(st.nextToken());
convenience[i][1] = Integer.parseInt(st.nextToken());
}
st = new StringTokenizer(br.readLine(), " ");
festival[0] = Integer.parseInt(st.nextToken());
festival[1] = Integer.parseInt(st.nextToken());
queue = new ArrayDeque<Integer>();
if(bfs()) {
sb.append("happy\n");
} else {
sb.append("sad\n");
}
}
System.out.println(sb.toString());
}
private static boolean bfs() {
if (Math.abs(home[0] - festival[0]) + Math.abs(home[1] - festival[1]) <= 1000) { // 집에서 페스티벌 이동 가능
return true;
}
int startflag = 0;
for (int i = 0; i < n; i++) {
if (visitCheck(home[0], home[1], i)) { // 집에서 이동 가능한 편의점이 있는 경우
queue.offer(i); // 큐에 넣기
visited[i] = true; // 방문체크
startflag = 1;
}
}
if (startflag == 0) { return false; } // 집에서 이동 가능한 편의점이 없는 경우
while(!queue.isEmpty()) { // 더 이상 갈 수 있는 편의점이 없을 때까지
int cur = queue.poll(); // 현재 위치
// 현재 위치에서 페스티벌 갈 수 있는지 확인
if (Math.abs(convenience[cur][0] - festival[0]) + Math.abs(convenience[cur][1] - festival[1]) <= 1000) {
return true;
}
for (int i = 0; i < n; i++) {
if (visitCheck(convenience[cur][0], convenience[cur][1], i)) { // 갈 수 있는 편의점이 있으면
queue.offer(i);
visited[i] = true;
}
}
}
return false;
}
private static boolean visitCheck(int curR, int curC, int i) { // 현재위치에서 i번째 편의점에 방문 가능한지 체크
if (Math.abs(curR - convenience[i][0]) + Math.abs(curC - convenience[i][1]) <= 1000 && !visited[i]) {
return true;
}
return false;
}
}
| chogoal/PS | java/Main_9205.java |
248,950 | import java.util.Arrays;
import java.util.Scanner;
/**
*
* @author ThePoisoned1
*/
public class E534_TrasElFestival {
Scanner sc;
boolean caso() {
int numCubos = sc.nextInt();
if (numCubos == 0) {
return false;
}
int[] basuras = new int[numCubos];
for (int i = 0; i < numCubos; i++) {
basuras[i] = sc.nextInt();
}
Arrays.sort(basuras);
int distancia = 0;
for (int i = numCubos - 1; i > 0; i = i - 2) {
if (distancia < Math.abs(basuras[i] - basuras[i - 1])) {
distancia = Math.abs(basuras[i] - basuras[i - 1]);
}
}
System.out.println(distancia);
return true;
}
void run() {
sc = new Scanner(System.in);
while (caso()) {
}
}
public static void main(String[] args) {
new E534_TrasElFestival().run();
}
}
| ThePoisoned1/AceptaElReto_Nikolas | E534_TrasElFestival.java |
248,951 | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package net.sf.l2j;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigInteger;
import java.util.List;
import java.util.Properties;
import java.util.logging.Logger;
import javolution.util.FastList;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
/**
* This class contains global server configuration.<br>
* It has static final fields initialized from configuration files.<br>
* It's initialized at the very begin of startup, and later JIT will optimize away debug/unused code.
* @author mkizub
*/
public final class Config
{
protected static final Logger _log = Logger.getLogger(Config.class.getName());
/** Debug/release mode */
public static boolean DEBUG;
/** Enable/disable assertions */
public static boolean ASSERT;
/** Enable/disable code 'in progress' */
public static boolean DEVELOPER;
/** Set if this server is a test server used for development */
public static boolean TEST_SERVER;
/** Game Server ports */
public static int PORT_GAME;
/** Login Server port */
public static int PORT_LOGIN;
/** Login Server bind ip */
public static String LOGIN_BIND_ADDRESS;
/** Number of login tries before IP ban gets activated, default 10 */
public static int LOGIN_TRY_BEFORE_BAN;
/** Number of seconds the IP ban will last, default 10 minutes */
public static int LOGIN_BLOCK_AFTER_BAN;
/** Hostname of the Game Server */
public static String GAMESERVER_HOSTNAME;
// Access to database
/** Driver to access to database */
public static String DATABASE_DRIVER;
/** Path to access to database */
public static String DATABASE_URL;
/** Database login */
public static String DATABASE_LOGIN;
/** Database password */
public static String DATABASE_PASSWORD;
/** Maximum number of connections to the database */
public static int DATABASE_MAX_CONNECTIONS;
/** Maximum number of players allowed to play simultaneously on server */
public static int MAXIMUM_ONLINE_USERS;
// Setting for serverList
/** Displays [] in front of server name ? */
public static boolean SERVER_LIST_BRACKET;
/** Displays a clock next to the server name ? */
public static boolean SERVER_LIST_CLOCK;
/** Display test server in the list of servers ? */
public static boolean SERVER_LIST_TESTSERVER;
/** Set the server as gm only at startup ? */
public static boolean SERVER_GMONLY;
// Thread pools size
/** Thread pool size effect */
public static int THREAD_P_EFFECTS;
/** Thread pool size general */
public static int THREAD_P_GENERAL;
/** Packet max thread */
public static int GENERAL_PACKET_THREAD_CORE_SIZE;
public static int IO_PACKET_THREAD_CORE_SIZE;
/** General max thread */
public static int GENERAL_THREAD_CORE_SIZE;
/** AI max thread */
public static int AI_MAX_THREAD;
/** Accept auto-loot ? */
public static boolean AUTO_LOOT;
public static boolean AUTO_LOOT_HERBS;
/** Character name template */
public static String CNAME_TEMPLATE;
/** Pet name template */
public static String PET_NAME_TEMPLATE;
/** Maximum number of characters per account */
public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
/** Global chat state */
public static String DEFAULT_GLOBAL_CHAT;
/** Trade chat state */
public static String DEFAULT_TRADE_CHAT;
/** For test servers - everybody has admin rights */
public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
/** Alternative game crafting */
public static boolean ALT_GAME_CREATION;
/** Alternative game crafting speed mutiplier - default 0 (fastest but still not instant) */
public static double ALT_GAME_CREATION_SPEED;
/** Alternative game crafting XP rate multiplier - default 1 */
public static double ALT_GAME_CREATION_XP_RATE;
/** Alternative game crafting SP rate multiplier - default 1 */
public static double ALT_GAME_CREATION_SP_RATE;
/** Alternative setting to blacksmith use of recipes to craft - default true */
public static boolean ALT_BLACKSMITH_USE_RECIPES;
/** Remove Castle circlets after clan lose his castle? - default true */
public static boolean REMOVE_CASTLE_CIRCLETS;
/** Alternative game weight limit multiplier - default 1 */
public static double ALT_WEIGHT_LIMIT;
/** Alternative game skill learning */
public static boolean ALT_GAME_SKILL_LEARN;
/** Alternative auto skill learning */
public static boolean AUTO_LEARN_SKILLS;
/** Cancel attack bow by hit */
public static boolean ALT_GAME_CANCEL_BOW;
/** Cancel cast by hit */
public static boolean ALT_GAME_CANCEL_CAST;
/** Alternative game - use tiredness, instead of CP */
public static boolean ALT_GAME_TIREDNESS;
public static int ALT_PARTY_RANGE;
public static int ALT_PARTY_RANGE2;
/** Alternative shield defence */
public static boolean ALT_GAME_SHIELD_BLOCKS;
/** Alternative Perfect shield defence rate */
public static int ALT_PERFECT_SHLD_BLOCK;
/** Alternative game mob ATTACK AI */
public static boolean ALT_GAME_MOB_ATTACK_AI;
public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
/** Alternative freight modes - Freights can be withdrawed from any village */
public static boolean ALT_GAME_FREIGHTS;
/** Alternative freight modes - Sets the price value for each freightened item */
public static int ALT_GAME_FREIGHT_PRICE;
/** Fast or slow multiply coefficient for skill hit time */
public static float ALT_GAME_SKILL_HIT_RATE;
/** Alternative gameing - loss of XP on death */
public static boolean ALT_GAME_DELEVEL;
/** Alternative gameing - magic dmg failures */
public static boolean ALT_GAME_MAGICFAILURES;
/** Alternative gaming - player must be in a castle-owning clan or ally to sign up for Dawn. */
public static boolean ALT_GAME_REQUIRE_CASTLE_DAWN;
/** Alternative gaming - allow clan-based castle ownage check rather than ally-based. */
public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
/** Alternative gaming - allow free teleporting around the world. */
public static boolean ALT_GAME_FREE_TELEPORT;
/** Disallow recommend character twice or more a day ? */
public static boolean ALT_RECOMMEND;
/** Alternative gaming - allow sub-class addition without quest completion. */
public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
/** View npc stats/drop by shift-cliking it for nongm-players */
public static boolean ALT_GAME_VIEWNPC;
/** Minimum number of player to participate in SevenSigns Festival */
public static int ALT_FESTIVAL_MIN_PLAYER;
/** Maximum of player contrib during Festival */
public static int ALT_MAXIMUM_PLAYER_CONTRIB;
/** Festival Manager start time. */
public static long ALT_FESTIVAL_MANAGER_START;
/** Festival Length */
public static long ALT_FESTIVAL_LENGTH;
/** Festival Cycle Length */
public static long ALT_FESTIVAL_CYCLE_LENGTH;
/** Festival First Spawn */
public static long ALT_FESTIVAL_FIRST_SPAWN;
/** Festival First Swarm */
public static long ALT_FESTIVAL_FIRST_SWARM;
/** Festival Second Spawn */
public static long ALT_FESTIVAL_SECOND_SPAWN;
/** Festival Second Swarm */
public static long ALT_FESTIVAL_SECOND_SWARM;
/** Festival Chest Spawn */
public static long ALT_FESTIVAL_CHEST_SPAWN;
/** Number of members needed to request a clan war */
public static int ALT_CLAN_MEMBERS_FOR_WAR;
/** Number of days before joining a new clan */
public static int ALT_CLAN_JOIN_DAYS;
/** Number of days before creating a new clan */
public static int ALT_CLAN_CREATE_DAYS;
/** Number of days it takes to dissolve a clan */
public static int ALT_CLAN_DISSOLVE_DAYS;
/** Number of days before joining a new alliance when clan voluntarily leave an alliance */
public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
/** Number of days before joining a new alliance when clan was dismissed from an alliance */
public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
/** Number of days before accepting a new clan for alliance when clan was dismissed from an alliance */
public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
/** Number of days before creating a new alliance when dissolved an alliance */
public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
/** Alternative gaming - all new characters always are newbies. */
public static boolean ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE;
/** Alternative gaming - clan members with see privilege can also withdraw from clan warehouse. */
public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
/** Maximum number of clans in ally */
public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
/** Life Crystal needed to learn clan skill */
public static boolean LIFE_CRYSTAL_NEEDED;
/** Spell Book needed to learn skill */
public static boolean SP_BOOK_NEEDED;
/** Spell Book needet to enchant skill */
public static boolean ES_SP_BOOK_NEEDED;
/** Logging Chat Window */
public static boolean LOG_CHAT;
/** Logging Item Window */
public static boolean LOG_ITEMS;
/** Alternative privileges for admin */
public static boolean ALT_PRIVILEGES_ADMIN;
/** Alternative secure check privileges */
public static boolean ALT_PRIVILEGES_SECURE_CHECK;
/** Alternative default level for privileges */
public static int ALT_PRIVILEGES_DEFAULT_LEVEL;
/** Olympiad Competition Starting time */
public static int ALT_OLY_START_TIME;
/** Olympiad Minutes */
public static int ALT_OLY_MIN;
/** Olympiad Competition Period */
public static long ALT_OLY_CPERIOD;
/** Olympiad Battle Period */
public static long ALT_OLY_BATTLE;
/** Olympiad Battle Wait */
public static long ALT_OLY_BWAIT;
/** Olympiad Inital Wait */
public static long ALT_OLY_IWAIT;
/** Olympaid Weekly Period */
public static long ALT_OLY_WPERIOD;
/** Olympaid Validation Period */
public static long ALT_OLY_VPERIOD;
/** Manor Refresh Starting time */
public static int ALT_MANOR_REFRESH_TIME;
/** Manor Refresh Min */
public static int ALT_MANOR_REFRESH_MIN;
/** Manor Next Period Approve Starting time */
public static int ALT_MANOR_APPROVE_TIME;
/** Manor Next Period Approve Min */
public static int ALT_MANOR_APPROVE_MIN;
/** Manor Maintenance Time */
public static int ALT_MANOR_MAINTENANCE_PERIOD;
/** Manor Save All Actions */
public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
/** Manor Save Period Rate */
public static int ALT_MANOR_SAVE_PERIOD_RATE;
/** Initial Lottery prize */
public static int ALT_LOTTERY_PRIZE;
/** Lottery Ticket Price */
public static int ALT_LOTTERY_TICKET_PRICE;
/** What part of jackpot amount should receive characters who pick 5 wining numbers */
public static float ALT_LOTTERY_5_NUMBER_RATE;
/** What part of jackpot amount should receive characters who pick 4 wining numbers */
public static float ALT_LOTTERY_4_NUMBER_RATE;
/** What part of jackpot amount should receive characters who pick 3 wining numbers */
public static float ALT_LOTTERY_3_NUMBER_RATE;
/** How much adena receive characters who pick two or less of the winning number */
public static int ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
/** Minimum siz e of a party that may enter dimensional rift */
public static int RIFT_MIN_PARTY_SIZE;
/** Time in ms the party has to wait until the mobs spawn when entering a room */
public static int RIFT_SPAWN_DELAY;
/** Amount of random rift jumps before party is ported back */
public static int RIFT_MAX_JUMPS;
/** Random time between two jumps in dimensional rift - in seconds */
public static int RIFT_AUTO_JUMPS_TIME_MIN;
public static int RIFT_AUTO_JUMPS_TIME_MAX;
/** Dimensional Fragment cost for entering rift */
public static int RIFT_ENTER_COST_RECRUIT;
public static int RIFT_ENTER_COST_SOLDIER;
public static int RIFT_ENTER_COST_OFFICER;
public static int RIFT_ENTER_COST_CAPTAIN;
public static int RIFT_ENTER_COST_COMMANDER;
public static int RIFT_ENTER_COST_HERO;
/** time multiplier for boss room */
public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
/* **************************************************************************
* GM CONFIG General GM AccessLevel *************************************************************************
*/
/** General GM access level */
public static int GM_ACCESSLEVEL;
/** General GM Minimal AccessLevel */
public static int GM_MIN;
/** Minimum privileges level for a GM to do Alt+G */
public static int GM_ALTG_MIN_LEVEL;
/** General GM AccessLevel to change announcements */
public static int GM_ANNOUNCE;
/** General GM AccessLevel can /ban /unban */
public static int GM_BAN;
/** General GM AccessLevel can /ban /unban for chat */
public static int GM_BAN_CHAT;
/** General GM AccessLevel can /create_item and /gmshop */
public static int GM_CREATE_ITEM;
/** General GM AccessLevel can /delete */
public static int GM_DELETE;
/** General GM AccessLevel can /kick /disconnect */
public static int GM_KICK;
/** General GM AccessLevel for access to GMMenu */
public static int GM_MENU;
/** General GM AccessLevel to use god mode command */
public static int GM_GODMODE;
/** General GM AccessLevel with character edit rights */
public static int GM_CHAR_EDIT;
/** General GM AccessLevel with edit rights for other characters */
public static int GM_CHAR_EDIT_OTHER;
/** General GM AccessLevel with character view rights */
public static int GM_CHAR_VIEW;
/** General GM AccessLevel with NPC edit rights */
public static int GM_NPC_EDIT;
public static int GM_NPC_VIEW;
/** General GM AccessLevel to teleport to any location */
public static int GM_TELEPORT;
/** General GM AccessLevel to teleport character to any location */
public static int GM_TELEPORT_OTHER;
/** General GM AccessLevel to restart server */
public static int GM_RESTART;
/** General GM AccessLevel for MonsterRace */
public static int GM_MONSTERRACE;
/** General GM AccessLevel to ride Wyvern */
public static int GM_RIDER;
/** General GM AccessLevel to unstuck without 5min delay */
public static int GM_ESCAPE;
/** General GM AccessLevel to resurect fixed after death */
public static int GM_FIXED;
/** General GM AccessLevel to create Path Nodes */
public static int GM_CREATE_NODES;
/** General GM AccessLevel with Enchant rights */
public static int GM_ENCHANT;
/** General GM AccessLevel to close/open Doors */
public static int GM_DOOR;
/** General GM AccessLevel with Resurrection rights */
public static int GM_RES;
/** General GM AccessLevel to attack in the peace zone */
public static int GM_PEACEATTACK;
/** General GM AccessLevel to heal */
public static int GM_HEAL;
/** General GM AccessLevel to unblock IPs detected as hack IPs */
public static int GM_UNBLOCK;
/** General GM AccessLevel to use Cache commands */
public static int GM_CACHE;
/** General GM AccessLevel to use test&st commands */
public static int GM_TALK_BLOCK;
public static int GM_TEST;
/** Disable transaction on AccessLevel **/
public static boolean GM_DISABLE_TRANSACTION;
/** GM transactions disabled from this range */
public static int GM_TRANSACTION_MIN;
/** GM transactions disabled to this range */
public static int GM_TRANSACTION_MAX;
/** Minimum level to allow a GM giving damage */
public static int GM_CAN_GIVE_DAMAGE;
/** Minimum level to don't give Exp/Sp in party */
public static int GM_DONT_TAKE_EXPSP;
/** Minimum level to don't take aggro */
public static int GM_DONT_TAKE_AGGRO;
public static int GM_REPAIR = 75;
/* Rate control */
/** Rate for eXperience Point rewards */
public static float RATE_XP;
/** Rate for Skill Point rewards */
public static float RATE_SP;
/** Rate for party eXperience Point rewards */
public static float RATE_PARTY_XP;
/** Rate for party Skill Point rewards */
public static float RATE_PARTY_SP;
/** Rate for Quest rewards (XP and SP) */
public static float RATE_QUESTS_REWARD;
/** Rate for drop adena */
public static float RATE_DROP_ADENA;
/** Rate for cost of consumable */
public static float RATE_CONSUMABLE_COST;
/** Rate for dropped items */
public static float RATE_DROP_ITEMS;
/** Rate for spoiled items */
public static float RATE_DROP_SPOIL;
/** Rate for manored items */
public static int RATE_DROP_MANOR;
/** Rate for quest items */
public static float RATE_DROP_QUEST;
/** Rate for karma and experience lose */
public static float RATE_KARMA_EXP_LOST;
/** Rate siege guards prices */
public static float RATE_SIEGE_GUARDS_PRICE;
/*
* Alternative Xp/Sp rewards, if not 0, then calculated as 2^((mob.level-player.level) / coef), A few examples for "AltGameExponentXp = 5." and "AltGameExponentSp = 3." diff = 0 (player and mob has the same level), XP bonus rate = 1, SP bonus rate = 1 diff = 3 (mob is 3 levels above), XP bonus
* rate = 1.52, SP bonus rate = 2 diff = 5 (mob is 5 levels above), XP bonus rate = 2, SP bonus rate = 3.17 diff = -8 (mob is 8 levels below), XP bonus rate = 0.4, SP bonus rate = 0.16
*/
/** Alternative eXperience Point rewards */
public static float ALT_GAME_EXPONENT_XP;
/** Alternative Spirit Point rewards */
public static float ALT_GAME_EXPONENT_SP;
/** Rate Common herbs */
public static float RATE_DROP_COMMON_HERBS;
/** Rate MP/HP herbs */
public static float RATE_DROP_MP_HP_HERBS;
/** Rate Common herbs */
public static float RATE_DROP_GREATER_HERBS;
/** Rate Common herbs */
public static float RATE_DROP_SUPERIOR_HERBS;
/** Rate Common herbs */
public static float RATE_DROP_SPECIAL_HERBS;
// Player Drop Rate control
/** Limit for player drop */
public static int PLAYER_DROP_LIMIT;
/** Rate for drop */
public static int PLAYER_RATE_DROP;
/** Rate for player's item drop */
public static int PLAYER_RATE_DROP_ITEM;
/** Rate for player's equipment drop */
public static int PLAYER_RATE_DROP_EQUIP;
/** Rate for player's equipment and weapon drop */
public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
// Pet Rates (Multipliers)
/** Rate for experience rewards of the pet */
public static float PET_XP_RATE;
/** Rate for food consumption of the pet */
public static int PET_FOOD_RATE;
/** Rate for experience rewards of the Sin Eater */
public static float SINEATER_XP_RATE;
// Karma Drop Rate control
/** Karma drop limit */
public static int KARMA_DROP_LIMIT;
/** Karma drop rate */
public static int KARMA_RATE_DROP;
/** Karma drop rate for item */
public static int KARMA_RATE_DROP_ITEM;
/** Karma drop rate for equipment */
public static int KARMA_RATE_DROP_EQUIP;
/** Karma drop rate for equipment and weapon */
public static int KARMA_RATE_DROP_EQUIP_WEAPON;
/** Time after which item will auto-destroy */
public static int AUTODESTROY_ITEM_AFTER;
/** Auto destroy herb time */
public static int HERB_AUTO_DESTROY_TIME;
/** List of items that will not be destroyed (separated by ",") */
public static String PROTECTED_ITEMS;
/** List of items that will not be destroyed */
public static List<Integer> LIST_PROTECTED_ITEMS = new FastList<>();
/** Auto destroy nonequipable items dropped by players */
public static boolean DESTROY_DROPPED_PLAYER_ITEM;
/** Auto destroy equipable items dropped by players */
public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
/** Save items on ground for restoration on server restart */
public static boolean SAVE_DROPPED_ITEM;
/** Empty table ItemsOnGround after load all items */
public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
/** Time interval to save into db items on ground */
public static int SAVE_DROPPED_ITEM_INTERVAL;
/** Clear all items stored in ItemsOnGround table */
public static boolean CLEAR_DROPPED_ITEM_TABLE;
/** Accept precise drop calculation ? */
public static boolean PRECISE_DROP_CALCULATION;
/** Accept multi-items drop ? */
public static boolean MULTIPLE_ITEM_DROP;
/**
* This is setting of experimental Client <--> Server Player coordinates synchronization<br>
* <b><u>Valeurs :</u></b> <li>0 - no synchronization at all</li> <li>1 - parcial synchronization Client --> Server only * using this option it is difficult for players to bypass obstacles</li> <li>2 - parcial synchronization Server --> Client only</li> <li>3 - full synchronization Client <-->
* Server</li> <li>-1 - Old system: will synchronize Z only</li>
*/
public static int COORD_SYNCHRONIZE;
/** Period in days after which character is deleted */
public static int DELETE_DAYS;
/** Datapack root directory */
public static File DATAPACK_ROOT;
/** Maximum range mobs can randomly go from spawn point */
public static int MAX_DRIFT_RANGE;
/** Allow fishing ? */
public static boolean ALLOWFISHING;
/** Allow Manor system */
public static boolean ALLOW_MANOR;
/** Jail config **/
public static boolean JAIL_IS_PVP;
public static boolean JAIL_DISABLE_CHAT;
/** Enumeration describing values for Allowing the use of L2Walker client */
public static enum L2WalkerAllowed
{
True,
False,
GM
}
/** Allow the use of L2Walker client ? */
public static L2WalkerAllowed ALLOW_L2WALKER_CLIENT;
/** Auto-ban client that use L2Walker ? */
public static boolean AUTOBAN_L2WALKER_ACC;
/** Revision of L2Walker */
public static int L2WALKER_REVISION;
/** FloodProtector initial capacity */
public static int FLOODPROTECTOR_INITIALSIZE;
/** Allow Discard item ? */
public static boolean ALLOW_DISCARDITEM;
/** Allow freight ? */
public static boolean ALLOW_FREIGHT;
/** Allow warehouse ? */
public static boolean ALLOW_WAREHOUSE;
/** Allow warehouse cache? */
public static boolean WAREHOUSE_CACHE;
/** How long store WH datas */
public static int WAREHOUSE_CACHE_TIME;
/** Allow wear ? (try on in shop) */
public static boolean ALLOW_WEAR;
/** Duration of the try on after which items are taken back */
public static int WEAR_DELAY;
/** Price of the try on of one item */
public static int WEAR_PRICE;
/** Allow lottery ? */
public static boolean ALLOW_LOTTERY;
/** Allow race ? */
public static boolean ALLOW_RACE;
/** Allow water ? */
public static boolean ALLOW_WATER;
/** Allow rent pet ? */
public static boolean ALLOW_RENTPET;
/** Allow boat ? */
public static boolean ALLOW_BOAT;
/** Allow cursed weapons ? */
public static boolean ALLOW_CURSED_WEAPONS;
// WALKER NPC
public static boolean ALLOW_NPC_WALKERS;
/** Time after which a packet is considered as lost */
public static int PACKET_LIFETIME;
// Pets
/** Speed of Weverns */
public static int WYVERN_SPEED;
/** Speed of Striders */
public static int STRIDER_SPEED;
/** Allow Wyvern Upgrader ? */
public static boolean ALLOW_WYVERN_UPGRADER;
// protocol revision
/** Minimal protocol revision */
public static int MIN_PROTOCOL_REVISION;
/** Maximal protocol revision */
public static int MAX_PROTOCOL_REVISION;
// random animation interval
/** Minimal time between 2 animations of a NPC */
public static int MIN_NPC_ANIMATION;
/** Maximal time between 2 animations of a NPC */
public static int MAX_NPC_ANIMATION;
/** Minimal time between animations of a MONSTER */
public static int MIN_MONSTER_ANIMATION;
/** Maximal time between animations of a MONSTER */
public static int MAX_MONSTER_ANIMATION;
/** Activate position recorder ? */
public static boolean ACTIVATE_POSITION_RECORDER;
/** Use 3D Map ? */
public static boolean USE_3D_MAP;
// Community Board
/** Type of community */
public static String COMMUNITY_TYPE;
public static String BBS_DEFAULT;
/** Show level of the community board ? */
public static boolean SHOW_LEVEL_COMMUNITYBOARD;
/** Show status of the community board ? */
public static boolean SHOW_STATUS_COMMUNITYBOARD;
/** Size of the name page on the community board */
public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
/** Name per row on community board */
public static int NAME_PER_ROW_COMMUNITYBOARD;
// Configuration files
/**
* Properties file that allows selection of new Classes for storage of World Objects. <br>
* This may help servers with large amounts of players recieving error messages related to the <i>L2ObjectHashMap</i> and <i>L2ObejctHashSet</i> classes.
*/
/** Properties file for game server (connection and ingame) configurations */
public static final String CONFIGURATION_FILE = "./config/server.properties";
/** Properties file for game server options */
public static final String OPTIONS_FILE = "./config/options.properties";
/** Properties file for login server configurations */
public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
/** Properties file for the ID factory */
public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
/** Properties file for other configurations */
public static final String OTHER_CONFIG_FILE = "./config/other.properties";
/** Properties file for rates configurations */
public static final String RATES_CONFIG_FILE = "./config/rates.properties";
/** Properties file for alternative configuration */
public static final String ALT_SETTINGS_FILE = "./config/altsettings.properties";
/** Properties file for PVP configurations */
public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
/** Properties file for GM access configurations */
public static final String GM_ACCESS_FILE = "./config/GMAccess.properties";
/** Properties file for telnet configuration */
public static final String TELNET_FILE = "./config/telnet.properties";
/** Properties file for l2j server version configurations */
public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
/** Properties file for l2j datapack version configurations */
public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
/** Properties file for siege configuration */
public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
/** XML file for banned IP */
public static final String BANNED_IP_XML = "./config/banned.xml";
/** Text file containing hexadecimal value of server ID */
public static final String HEXID_FILE = "./config/hexid.txt";
/**
* Properties file for alternative configure GM commands access level.<br>
* Note that this file only read if "AltPrivilegesAdmin = True"
*/
public static final String COMMAND_PRIVILEGES_FILE = "./config/command-privileges.properties";
/** Properties file for AI configurations */
public static final String AI_FILE = "./config/ai.properties";
/** Properties file for 7 Signs Festival */
public static final String SEVENSIGNS_FILE = "./config/sevensigns.properties";
public static final String CLANHALL_CONFIG_FILE = "./config/clanhall.properties";
public static final String L2JMOD_CONFIG_FILE = "./config/l2jmods.properties";
public static int MAX_ITEM_IN_PACKET;
public static boolean CHECK_KNOWN;
/** Game Server login port */
public static int GAME_SERVER_LOGIN_PORT;
/** Game Server login Host */
public static String GAME_SERVER_LOGIN_HOST;
/** Internal Hostname */
public static String INTERNAL_HOSTNAME;
/** External Hostname */
public static String EXTERNAL_HOSTNAME;
public static int PATH_NODE_RADIUS;
public static int NEW_NODE_ID;
public static int SELECTED_NODE_ID;
public static int LINKED_NODE_ID;
public static String NEW_NODE_TYPE;
/** Show "data/html/servnews.htm" whenever a character enters world. */
public static boolean SERVER_NEWS;
/** Show L2Monster level and aggro ? */
public static boolean SHOW_NPC_LVL;
/**
* Force full item inventory packet to be sent for any item change ?<br>
* <u><i>Note:</i></u> This can increase network traffic
*/
public static boolean FORCE_INVENTORY_UPDATE;
/** Disable the use of guards against agressive monsters ? */
public static boolean ALLOW_GUARDS;
/** Allow use Event Managers for change occupation ? */
public static boolean ALLOW_CLASS_MASTERS;
/** Time between 2 updates of IP */
public static int IP_UPDATE_TIME;
// Server version
/** Server version */
public static String SERVER_VERSION;
/** Date of server build */
public static String SERVER_BUILD_DATE;
// Datapack version
/** Datapack version */
public static String DATAPACK_VERSION;
/** Zone Setting */
public static int ZONE_TOWN;
/** Crafting Enabled? */
public static boolean IS_CRAFTING_ENABLED;
// Inventory slots limit
/** Maximum inventory slots limits for non dwarf characters */
public static int INVENTORY_MAXIMUM_NO_DWARF;
/** Maximum inventory slots limits for dwarf characters */
public static int INVENTORY_MAXIMUM_DWARF;
/** Maximum inventory slots limits for GM */
public static int INVENTORY_MAXIMUM_GM;
// Warehouse slots limits
/** Maximum inventory slots limits for non dwarf warehouse */
public static int WAREHOUSE_SLOTS_NO_DWARF;
/** Maximum inventory slots limits for dwarf warehouse */
public static int WAREHOUSE_SLOTS_DWARF;
/** Maximum inventory slots limits for clan warehouse */
public static int WAREHOUSE_SLOTS_CLAN;
/** Maximum inventory slots limits for freight */
public static int FREIGHT_SLOTS;
// Karma System Variables
/** Minimum karma gain/loss */
public static int KARMA_MIN_KARMA;
/** Maximum karma gain/loss */
public static int KARMA_MAX_KARMA;
/** Number to divide the xp recieved by, to calculate karma lost on xp gain/lost */
public static int KARMA_XP_DIVIDER;
/** The Minimum Karma lost if 0 karma is to be removed */
public static int KARMA_LOST_BASE;
/** Can a GM drop item ? */
public static boolean KARMA_DROP_GM;
/** Should award a pvp point for killing a player with karma ? */
public static boolean KARMA_AWARD_PK_KILL;
/** Minimum PK required to drop */
public static int KARMA_PK_LIMIT;
/** List of pet items that cannot be dropped (seperated by ",") when PVP */
public static String KARMA_NONDROPPABLE_PET_ITEMS;
/** List of items that cannot be dropped (seperated by ",") when PVP */
public static String KARMA_NONDROPPABLE_ITEMS;
/** List of pet items that cannot be dropped when PVP */
public static List<Integer> KARMA_LIST_NONDROPPABLE_PET_ITEMS = new FastList<>();
/** List of items that cannot be dropped when PVP */
public static List<Integer> KARMA_LIST_NONDROPPABLE_ITEMS = new FastList<>();
/** List of items that cannot be dropped (seperated by ",") */
public static String NONDROPPABLE_ITEMS;
/** List of items that cannot be dropped */
public static List<Integer> LIST_NONDROPPABLE_ITEMS = new FastList<>();
/** List of NPCs that rent pets (seperated by ",") */
public static String PET_RENT_NPC;
/** List of NPCs that rent pets */
public static List<Integer> LIST_PET_RENT_NPC = new FastList<>();
/** Duration (in ms) while a player stay in PVP mode after hitting an innocent */
public static int PVP_NORMAL_TIME;
/** Duration (in ms) while a player stay in PVP mode after hitting a purple player */
public static int PVP_PVP_TIME;
// Karma Punishment
/** Allow player with karma to be killed in peace zone ? */
public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
/** Allow player with karma to shop ? */
public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
/** Allow player with karma to use gatekeepers ? */
public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
/** Allow player with karma to use SOE or Return skill ? */
public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
/** Allow player with karma to trade ? */
public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
/** Allow player with karma to use warehouse ? */
public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
/** define L2JMODS */
/** Champion Mod */
public static boolean L2JMOD_CHAMPION_ENABLE;
public static int L2JMOD_CHAMPION_FREQUENCY;
public static int L2JMOD_CHAMP_MIN_LVL;
public static int L2JMOD_CHAMP_MAX_LVL;
public static int L2JMOD_CHAMPION_HP;
public static int L2JMOD_CHAMPION_REWARDS;
public static int L2JMOD_CHAMPION_ADENAS_REWARDS;
public static float L2JMOD_CHAMPION_HP_REGEN;
public static float L2JMOD_CHAMPION_ATK;
public static float L2JMOD_CHAMPION_SPD_ATK;
public static int L2JMOD_CHAMPION_REWARD;
public static int L2JMOD_CHAMPION_REWARD_ID;
public static int L2JMOD_CHAMPION_REWARD_QTY;
/** Team vs. Team Event Engine */
public static boolean TVT_EVENT_ENABLED;
public static int TVT_EVENT_INTERVAL;
public static int TVT_EVENT_PARTICIPATION_TIME;
public static int TVT_EVENT_RUNNING_TIME;
public static int TVT_EVENT_PARTICIPATION_NPC_ID;
public static int[] TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[3];
public static int TVT_EVENT_MIN_PLAYERS_IN_TEAMS;
public static int TVT_EVENT_MAX_PLAYERS_IN_TEAMS;
public static int TVT_EVENT_RESPAWN_TELEPORT_DELAY;
public static int TVT_EVENT_START_LEAVE_TELEPORT_DELAY;
public static String TVT_EVENT_TEAM_1_NAME;
public static int[] TVT_EVENT_TEAM_1_COORDINATES = new int[3];
public static String TVT_EVENT_TEAM_2_NAME;
public static int[] TVT_EVENT_TEAM_2_COORDINATES = new int[3];
public static List<int[]> TVT_EVENT_REWARDS = new FastList<>();
public static boolean TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
public static boolean TVT_EVENT_POTIONS_ALLOWED;
public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
public static List<Integer> TVT_EVENT_DOOR_IDS = new FastList<>();
public static byte TVT_EVENT_MIN_LVL;
public static byte TVT_EVENT_MAX_LVL;
/** L2JMOD Wedding system */
public static boolean L2JMOD_ALLOW_WEDDING;
public static int L2JMOD_WEDDING_PRICE;
public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
public static boolean L2JMOD_WEDDING_TELEPORT;
public static int L2JMOD_WEDDING_TELEPORT_PRICE;
public static int L2JMOD_WEDDING_TELEPORT_DURATION;
public static boolean L2JMOD_WEDDING_SAMESEX;
public static boolean L2JMOD_WEDDING_FORMALWEAR;
public static int L2JMOD_WEDDING_DIVORCE_COSTS;
// Packet information
/** Count the amount of packets per minute ? */
public static boolean COUNT_PACKETS = false;
/** Dump packet count ? */
public static boolean DUMP_PACKET_COUNTS = false;
/** Time interval between 2 dumps */
public static int DUMP_INTERVAL_SECONDS = 60;
/** Enumeration for type of ID Factory */
public static enum IdFactoryType
{
Compaction,
BitSet,
Stack
}
/** ID Factory type */
public static IdFactoryType IDFACTORY_TYPE;
/** Check for bad ID ? */
public static boolean BAD_ID_CHECKING;
/** Enumeration for type of maps object */
public static enum ObjectMapType
{
L2ObjectHashMap,
WorldObjectMap
}
/** Enumeration for type of set object */
public static enum ObjectSetType
{
L2ObjectHashSet,
WorldObjectSet
}
/** Type of map object */
public static ObjectMapType MAP_TYPE;
/** Type of set object */
public static ObjectSetType SET_TYPE;
/**
* Allow lesser effects to be canceled if stronger effects are used when effects of the same stack group are used.<br>
* New effects that are added will be canceled if they are of lesser priority to the old one.
*/
public static boolean EFFECT_CANCELING;
/** Auto-delete invalid quest data ? */
public static boolean AUTODELETE_INVALID_QUEST_DATA;
/** Chance that an item will succesfully be enchanted */
public static int ENCHANT_CHANCE_WEAPON;
public static int ENCHANT_CHANCE_ARMOR;
public static int ENCHANT_CHANCE_JEWELRY;
/** Maximum level of enchantment */
public static int ENCHANT_MAX_WEAPON;
public static int ENCHANT_MAX_ARMOR;
public static int ENCHANT_MAX_JEWELRY;
/** maximum level of safe enchantment for normal items */
public static int ENCHANT_SAFE_MAX;
/** maximum level of safe enchantment for full body armor */
public static int ENCHANT_SAFE_MAX_FULL;
// Character multipliers
/** Multiplier for character HP regeneration */
public static double HP_REGEN_MULTIPLIER;
/** Mutilplier for character MP regeneration */
public static double MP_REGEN_MULTIPLIER;
/** Multiplier for character CP regeneration */
public static double CP_REGEN_MULTIPLIER;
// Raid Boss multipliers
/** Multiplier for Raid boss HP regeneration */
public static double RAID_HP_REGEN_MULTIPLIER;
/** Mulitplier for Raid boss MP regeneration */
public static double RAID_MP_REGEN_MULTIPLIER;
/** Multiplier for Raid boss defense multiplier */
public static double RAID_DEFENCE_MULTIPLIER;
/** Raid Boss Minin Spawn Timer */
public static double RAID_MINION_RESPAWN_TIMER;
/** Mulitplier for Raid boss minimum time respawn */
public static float RAID_MIN_RESPAWN_MULTIPLIER;
/** Mulitplier for Raid boss maximum time respawn */
public static float RAID_MAX_RESPAWN_MULTIPLIER;
/** Amount of adenas when starting a new character */
public static int STARTING_ADENA;
/** Deep Blue Mobs' Drop Rules Enabled */
public static boolean DEEPBLUE_DROP_RULES;
public static int UNSTUCK_INTERVAL;
/** Is telnet enabled ? */
public static boolean IS_TELNET_ENABLED;
/** Death Penalty chance */
public static int DEATH_PENALTY_CHANCE;
/** Player Protection control */
public static int PLAYER_SPAWN_PROTECTION;
public static int PLAYER_FAKEDEATH_UP_PROTECTION;
/** Define Party XP cutoff point method - Possible values: level and percentage */
public static String PARTY_XP_CUTOFF_METHOD;
/** Define the cutoff point value for the "level" method */
public static int PARTY_XP_CUTOFF_LEVEL;
/** Define the cutoff point value for the "percentage" method */
public static double PARTY_XP_CUTOFF_PERCENT;
/** Percent CP is restore on respawn */
public static double RESPAWN_RESTORE_CP;
/** Percent HP is restore on respawn */
public static double RESPAWN_RESTORE_HP;
/** Percent MP is restore on respawn */
public static double RESPAWN_RESTORE_MP;
/** Allow randomizing of the respawn point in towns. */
public static boolean RESPAWN_RANDOM_ENABLED;
/** The maximum offset from the base respawn point to allow. */
public static int RESPAWN_RANDOM_MAX_OFFSET;
/** Maximum number of available slots for pvt stores (sell/buy) - Dwarves */
public static int MAX_PVTSTORE_SLOTS_DWARF;
/** Maximum number of available slots for pvt stores (sell/buy) - Others */
public static int MAX_PVTSTORE_SLOTS_OTHER;
/** Store skills cooltime on char exit/relogin */
public static boolean STORE_SKILL_COOLTIME;
/** Show licence or not just after login (if false, will directly go to the Server List */
public static boolean SHOW_LICENCE;
/** Force GameGuard authorization in loginserver */
public static boolean FORCE_GGAUTH;
/** Default punishment for illegal actions */
public static int DEFAULT_PUNISH;
/** Parameter for default punishment */
public static int DEFAULT_PUNISH_PARAM;
/** Accept new game server ? */
public static boolean ACCEPT_NEW_GAMESERVER;
/** Server ID used with the HexID */
public static int SERVER_ID;
/** Hexadecimal ID of the game server */
public static byte[] HEX_ID;
/** Accept alternate ID for server ? */
public static boolean ACCEPT_ALTERNATE_ID;
/** ID for request to the server */
public static int REQUEST_ID;
public static boolean RESERVE_HOST_ON_LOGIN = false;
public static int MINIMUM_UPDATE_DISTANCE;
public static int KNOWNLIST_FORGET_DELAY;
public static int MINIMUN_UPDATE_TIME;
public static boolean ANNOUNCE_MAMMON_SPAWN;
public static boolean LAZY_CACHE;
/** Enable colored name for GM ? */
public static boolean GM_NAME_COLOR_ENABLED;
/** Color of GM name */
public static int GM_NAME_COLOR;
/** Color of admin name */
public static int ADMIN_NAME_COLOR;
/** Place an aura around the GM ? */
public static boolean GM_HERO_AURA;
/** Set the GM invulnerable at startup ? */
public static boolean GM_STARTUP_INVULNERABLE;
/** Set the GM invisible at startup ? */
public static boolean GM_STARTUP_INVISIBLE;
/** Set silence to GM at startup ? */
public static boolean GM_STARTUP_SILENCE;
/** Add GM in the GM list at startup ? */
public static boolean GM_STARTUP_AUTO_LIST;
/** Change the way admin panel is shown */
public static String GM_ADMIN_MENU_STYLE;
/** Allow petition ? */
public static boolean PETITIONING_ALLOWED;
/** Maximum number of petitions per player */
public static int MAX_PETITIONS_PER_PLAYER;
/** Maximum number of petitions pending */
public static int MAX_PETITIONS_PENDING;
/** Bypass exploit protection ? */
public static boolean BYPASS_VALIDATION;
/** Only GM buy items for free **/
public static boolean ONLY_GM_ITEMS_FREE;
/** GM Audit ? */
public static boolean GMAUDIT;
/** Allow auto-create account ? */
public static boolean AUTO_CREATE_ACCOUNTS;
public static boolean FLOOD_PROTECTION;
public static int FAST_CONNECTION_LIMIT;
public static int NORMAL_CONNECTION_TIME;
public static int FAST_CONNECTION_TIME;
public static int MAX_CONNECTION_PER_IP;
/** Enforce gameguard query on character login ? */
public static boolean GAMEGUARD_ENFORCE;
/** Don't allow player to perform trade,talk with npc and move until gameguard reply received ? */
public static boolean GAMEGUARD_PROHIBITACTION;
/** Recipebook limits */
public static int DWARF_RECIPE_LIMIT;
public static int COMMON_RECIPE_LIMIT;
/** Grid Options */
public static boolean GRIDS_ALWAYS_ON;
public static int GRID_NEIGHBOR_TURNON_TIME;
public static int GRID_NEIGHBOR_TURNOFF_TIME;
/** Clan Hall function related configs */
public static long CH_TELE_FEE_RATIO;
public static int CH_TELE1_FEE;
public static int CH_TELE2_FEE;
public static long CH_ITEM_FEE_RATIO;
public static int CH_ITEM1_FEE;
public static int CH_ITEM2_FEE;
public static int CH_ITEM3_FEE;
public static long CH_MPREG_FEE_RATIO;
public static int CH_MPREG1_FEE;
public static int CH_MPREG2_FEE;
public static int CH_MPREG3_FEE;
public static int CH_MPREG4_FEE;
public static int CH_MPREG5_FEE;
public static long CH_HPREG_FEE_RATIO;
public static int CH_HPREG1_FEE;
public static int CH_HPREG2_FEE;
public static int CH_HPREG3_FEE;
public static int CH_HPREG4_FEE;
public static int CH_HPREG5_FEE;
public static int CH_HPREG6_FEE;
public static int CH_HPREG7_FEE;
public static int CH_HPREG8_FEE;
public static int CH_HPREG9_FEE;
public static int CH_HPREG10_FEE;
public static int CH_HPREG11_FEE;
public static int CH_HPREG12_FEE;
public static int CH_HPREG13_FEE;
public static long CH_EXPREG_FEE_RATIO;
public static int CH_EXPREG1_FEE;
public static int CH_EXPREG2_FEE;
public static int CH_EXPREG3_FEE;
public static int CH_EXPREG4_FEE;
public static int CH_EXPREG5_FEE;
public static int CH_EXPREG6_FEE;
public static int CH_EXPREG7_FEE;
public static long CH_SUPPORT_FEE_RATIO;
public static int CH_SUPPORT1_FEE;
public static int CH_SUPPORT2_FEE;
public static int CH_SUPPORT3_FEE;
public static int CH_SUPPORT4_FEE;
public static int CH_SUPPORT5_FEE;
public static int CH_SUPPORT6_FEE;
public static int CH_SUPPORT7_FEE;
public static int CH_SUPPORT8_FEE;
public static long CH_CURTAIN_FEE_RATIO;
public static int CH_CURTAIN1_FEE;
public static int CH_CURTAIN2_FEE;
public static long CH_FRONT_FEE_RATIO;
public static int CH_FRONT1_FEE;
public static int CH_FRONT2_FEE;
/** GeoData 0/1/2 */
public static int GEODATA;
/** Force loading GeoData to psychical memory */
public static boolean FORCE_GEODATA;
public static boolean ACCEPT_GEOEDITOR_CONN;
/** Max amount of buffs */
public static byte BUFFS_MAX_AMOUNT;
/** Alt Settings for devs */
public static boolean ALT_DEV_NO_QUESTS;
public static boolean ALT_DEV_NO_SPAWNS;
/**
* This class initializes all global variables for configuration.<br>
* If key doesn't appear in properties file, a default value is setting on by this class.
* @see #CONFIGURATION_FILE for configuring your server.
*/
public static void load()
{
if (Server.serverMode == Server.MODE_GAMESERVER)
{
_log.info("loading gameserver config");
try
{
Properties serverSettings = new Properties();
InputStream is = new FileInputStream(new File(CONFIGURATION_FILE));
serverSettings.load(is);
is.close();
GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "*");
INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "*");
GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort", "9014"));
GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost", "127.0.0.1");
REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID", "0"));
ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID", "True"));
DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "0"));
MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
MIN_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MinProtocolRevision", "660"));
MAX_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MaxProtocolRevision", "665"));
if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
{
throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
}
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + CONFIGURATION_FILE + " File.");
}
try
{
Properties optionsSettings = new Properties();
InputStream is = new FileInputStream(new File(OPTIONS_FILE));
optionsSettings.load(is);
is.close();
EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(optionsSettings.getProperty("EverybodyHasAdminRights", "false"));
DEBUG = Boolean.parseBoolean(optionsSettings.getProperty("Debug", "false"));
ASSERT = Boolean.parseBoolean(optionsSettings.getProperty("Assert", "false"));
DEVELOPER = Boolean.parseBoolean(optionsSettings.getProperty("Developer", "false"));
TEST_SERVER = Boolean.parseBoolean(optionsSettings.getProperty("TestServer", "false"));
SERVER_LIST_TESTSERVER = Boolean.parseBoolean(optionsSettings.getProperty("TestServer", "false"));
SERVER_LIST_BRACKET = Boolean.valueOf(optionsSettings.getProperty("ServerListBrackets", "false"));
SERVER_LIST_CLOCK = Boolean.valueOf(optionsSettings.getProperty("ServerListClock", "false"));
SERVER_GMONLY = Boolean.valueOf(optionsSettings.getProperty("ServerGMOnly", "false"));
AUTODESTROY_ITEM_AFTER = Integer.parseInt(optionsSettings.getProperty("AutoDestroyDroppedItemAfter", "0"));
HERB_AUTO_DESTROY_TIME = Integer.parseInt(optionsSettings.getProperty("AutoDestroyHerbTime", "15")) * 1000;
PROTECTED_ITEMS = optionsSettings.getProperty("ListOfProtectedItems");
LIST_PROTECTED_ITEMS = new FastList<>();
for (String id : PROTECTED_ITEMS.split(","))
{
LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
}
DESTROY_DROPPED_PLAYER_ITEM = Boolean.valueOf(optionsSettings.getProperty("DestroyPlayerDroppedItem", "false"));
DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.valueOf(optionsSettings.getProperty("DestroyEquipableItem", "false"));
SAVE_DROPPED_ITEM = Boolean.valueOf(optionsSettings.getProperty("SaveDroppedItem", "false"));
EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.valueOf(optionsSettings.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(optionsSettings.getProperty("SaveDroppedItemInterval", "0")) * 60000;
CLEAR_DROPPED_ITEM_TABLE = Boolean.valueOf(optionsSettings.getProperty("ClearDroppedItemTable", "false"));
PRECISE_DROP_CALCULATION = Boolean.valueOf(optionsSettings.getProperty("PreciseDropCalculation", "True"));
MULTIPLE_ITEM_DROP = Boolean.valueOf(optionsSettings.getProperty("MultipleItemDrop", "True"));
COORD_SYNCHRONIZE = Integer.parseInt(optionsSettings.getProperty("CoordSynchronize", "-1"));
ONLY_GM_ITEMS_FREE = Boolean.valueOf(optionsSettings.getProperty("OnlyGMItemsFree", "True"));
ALLOW_WAREHOUSE = Boolean.valueOf(optionsSettings.getProperty("AllowWarehouse", "True"));
WAREHOUSE_CACHE = Boolean.valueOf(optionsSettings.getProperty("WarehouseCache", "False"));
WAREHOUSE_CACHE_TIME = Integer.parseInt(optionsSettings.getProperty("WarehouseCacheTime", "15"));
ALLOW_FREIGHT = Boolean.valueOf(optionsSettings.getProperty("AllowFreight", "True"));
ALLOW_WEAR = Boolean.valueOf(optionsSettings.getProperty("AllowWear", "False"));
WEAR_DELAY = Integer.parseInt(optionsSettings.getProperty("WearDelay", "5"));
WEAR_PRICE = Integer.parseInt(optionsSettings.getProperty("WearPrice", "10"));
ALLOW_LOTTERY = Boolean.valueOf(optionsSettings.getProperty("AllowLottery", "False"));
ALLOW_RACE = Boolean.valueOf(optionsSettings.getProperty("AllowRace", "False"));
ALLOW_WATER = Boolean.valueOf(optionsSettings.getProperty("AllowWater", "False"));
ALLOW_RENTPET = Boolean.valueOf(optionsSettings.getProperty("AllowRentPet", "False"));
FLOODPROTECTOR_INITIALSIZE = Integer.parseInt(optionsSettings.getProperty("FloodProtectorInitialSize", "50"));
ALLOW_DISCARDITEM = Boolean.valueOf(optionsSettings.getProperty("AllowDiscardItem", "True"));
ALLOWFISHING = Boolean.valueOf(optionsSettings.getProperty("AllowFishing", "False"));
ALLOW_MANOR = Boolean.parseBoolean(optionsSettings.getProperty("AllowManor", "False"));
ALLOW_BOAT = Boolean.valueOf(optionsSettings.getProperty("AllowBoat", "False"));
ALLOW_NPC_WALKERS = Boolean.valueOf(optionsSettings.getProperty("AllowNpcWalkers", "true"));
ALLOW_CURSED_WEAPONS = Boolean.valueOf(optionsSettings.getProperty("AllowCursedWeapons", "False"));
ALLOW_L2WALKER_CLIENT = L2WalkerAllowed.valueOf(optionsSettings.getProperty("AllowL2Walker", "False"));
L2WALKER_REVISION = Integer.parseInt(optionsSettings.getProperty("L2WalkerRevision", "537"));
AUTOBAN_L2WALKER_ACC = Boolean.valueOf(optionsSettings.getProperty("AutobanL2WalkerAcc", "False"));
ACTIVATE_POSITION_RECORDER = Boolean.valueOf(optionsSettings.getProperty("ActivatePositionRecorder", "False"));
DEFAULT_GLOBAL_CHAT = optionsSettings.getProperty("GlobalChat", "ON");
DEFAULT_TRADE_CHAT = optionsSettings.getProperty("TradeChat", "ON");
LOG_CHAT = Boolean.valueOf(optionsSettings.getProperty("LogChat", "false"));
LOG_ITEMS = Boolean.valueOf(optionsSettings.getProperty("LogItems", "false"));
GMAUDIT = Boolean.valueOf(optionsSettings.getProperty("GMAudit", "False"));
COMMUNITY_TYPE = optionsSettings.getProperty("CommunityType", "old").toLowerCase();
BBS_DEFAULT = optionsSettings.getProperty("BBSDefault", "_bbshome");
SHOW_LEVEL_COMMUNITYBOARD = Boolean.valueOf(optionsSettings.getProperty("ShowLevelOnCommunityBoard", "False"));
SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(optionsSettings.getProperty("ShowStatusOnCommunityBoard", "True"));
NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePageSizeOnCommunityBoard", "50"));
NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePerRowOnCommunityBoard", "5"));
ZONE_TOWN = Integer.parseInt(optionsSettings.getProperty("ZoneTown", "0"));
MAX_DRIFT_RANGE = Integer.parseInt(optionsSettings.getProperty("MaxDriftRange", "300"));
MIN_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinNPCAnimation", "10"));
MAX_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxNPCAnimation", "20"));
MIN_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinMonsterAnimation", "5"));
MAX_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxMonsterAnimation", "20"));
SERVER_NEWS = Boolean.valueOf(optionsSettings.getProperty("ShowServerNews", "False"));
SHOW_NPC_LVL = Boolean.valueOf(optionsSettings.getProperty("ShowNpcLevel", "False"));
FORCE_INVENTORY_UPDATE = Boolean.valueOf(optionsSettings.getProperty("ForceInventoryUpdate", "False"));
AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(optionsSettings.getProperty("AutoDeleteInvalidQuestData", "False"));
THREAD_P_EFFECTS = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeEffects", "6"));
THREAD_P_GENERAL = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeGeneral", "15"));
GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralPacketThreadCoreSize", "4"));
IO_PACKET_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("UrgentPacketThreadCoreSize", "2"));
AI_MAX_THREAD = Integer.parseInt(optionsSettings.getProperty("AiMaxThread", "10"));
GENERAL_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralThreadCoreSize", "4"));
DELETE_DAYS = Integer.parseInt(optionsSettings.getProperty("DeleteCharAfterDays", "7"));
DEFAULT_PUNISH = Integer.parseInt(optionsSettings.getProperty("DefaultPunish", "2"));
DEFAULT_PUNISH_PARAM = Integer.parseInt(optionsSettings.getProperty("DefaultPunishParam", "0"));
LAZY_CACHE = Boolean.valueOf(optionsSettings.getProperty("LazyCache", "False"));
PACKET_LIFETIME = Integer.parseInt(optionsSettings.getProperty("PacketLifeTime", "0"));
BYPASS_VALIDATION = Boolean.valueOf(optionsSettings.getProperty("BypassValidation", "True"));
GAMEGUARD_ENFORCE = Boolean.valueOf(optionsSettings.getProperty("GameGuardEnforce", "False"));
GAMEGUARD_PROHIBITACTION = Boolean.valueOf(optionsSettings.getProperty("GameGuardProhibitAction", "False"));
GRIDS_ALWAYS_ON = Boolean.parseBoolean(optionsSettings.getProperty("GridsAlwaysOn", "False"));
GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOnTime", "30"));
GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOffTime", "300"));
GEODATA = Integer.parseInt(optionsSettings.getProperty("GeoData", "0"));
FORCE_GEODATA = Boolean.parseBoolean(optionsSettings.getProperty("ForceGeoData", "True"));
ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(optionsSettings.getProperty("AcceptGeoeditorConn", "False"));
// ---------------------------------------------------
// Configuration values not found in config files
// ---------------------------------------------------
USE_3D_MAP = Boolean.valueOf(optionsSettings.getProperty("Use3DMap", "False"));
PATH_NODE_RADIUS = Integer.parseInt(optionsSettings.getProperty("PathNodeRadius", "50"));
NEW_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
SELECTED_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
LINKED_NODE_ID = Integer.parseInt(optionsSettings.getProperty("NewNodeId", "7952"));
NEW_NODE_TYPE = optionsSettings.getProperty("NewNodeType", "npc");
COUNT_PACKETS = Boolean.valueOf(optionsSettings.getProperty("CountPacket", "false"));
DUMP_PACKET_COUNTS = Boolean.valueOf(optionsSettings.getProperty("DumpPacketCounts", "false"));
DUMP_INTERVAL_SECONDS = Integer.parseInt(optionsSettings.getProperty("PacketDumpInterval", "60"));
MINIMUM_UPDATE_DISTANCE = Integer.parseInt(optionsSettings.getProperty("MaximumUpdateDistance", "50"));
MINIMUN_UPDATE_TIME = Integer.parseInt(optionsSettings.getProperty("MinimumUpdateTime", "500"));
CHECK_KNOWN = Boolean.valueOf(optionsSettings.getProperty("CheckKnownList", "false"));
KNOWNLIST_FORGET_DELAY = Integer.parseInt(optionsSettings.getProperty("KnownListForgetDelay", "10000"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + OPTIONS_FILE + " File.");
}
/*
* Load L2J Server Version Properties file (if exists)
*/
try
{
Properties serverVersion = new Properties();
InputStream is = new FileInputStream(new File(SERVER_VERSION_FILE));
serverVersion.load(is);
is.close();
SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
}
catch (Exception e)
{
// Ignore Properties file if it doesnt exist
SERVER_VERSION = "Unsupported Custom Version.";
SERVER_BUILD_DATE = "Undefined Date.";
}
/*
* Load L2J Datapack Version Properties file (if exists)
*/
try
{
Properties serverVersion = new Properties();
InputStream is = new FileInputStream(new File(DATAPACK_VERSION_FILE));
serverVersion.load(is);
is.close();
DATAPACK_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
}
catch (Exception e)
{
// Ignore Properties file if it doesnt exist
DATAPACK_VERSION = "Unsupported Custom Version.";
}
// telnet
try
{
Properties telnetSettings = new Properties();
InputStream is = new FileInputStream(new File(TELNET_FILE));
telnetSettings.load(is);
is.close();
IS_TELNET_ENABLED = Boolean.valueOf(telnetSettings.getProperty("EnableTelnet", "false"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + TELNET_FILE + " File.");
}
// id factory
try
{
Properties idSettings = new Properties();
InputStream is = new FileInputStream(new File(ID_CONFIG_FILE));
idSettings.load(is);
is.close();
MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
BAD_ID_CHECKING = Boolean.valueOf(idSettings.getProperty("BadIdChecking", "True"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + ID_CONFIG_FILE + " File.");
}
// other
try
{
Properties otherSettings = new Properties();
InputStream is = new FileInputStream(new File(OTHER_CONFIG_FILE));
otherSettings.load(is);
is.close();
DEEPBLUE_DROP_RULES = Boolean.parseBoolean(otherSettings.getProperty("UseDeepBlueDropRules", "True"));
ALLOW_GUARDS = Boolean.valueOf(otherSettings.getProperty("AllowGuards", "False"));
EFFECT_CANCELING = Boolean.valueOf(otherSettings.getProperty("CancelLesserEffect", "True"));
WYVERN_SPEED = Integer.parseInt(otherSettings.getProperty("WyvernSpeed", "100"));
STRIDER_SPEED = Integer.parseInt(otherSettings.getProperty("StriderSpeed", "80"));
ALLOW_WYVERN_UPGRADER = Boolean.valueOf(otherSettings.getProperty("AllowWyvernUpgrader", "False"));
/* Inventory slots limits */
INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForNoDwarf", "80"));
INVENTORY_MAXIMUM_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForDwarf", "100"));
INVENTORY_MAXIMUM_GM = Integer.parseInt(otherSettings.getProperty("MaximumSlotsForGMPlayer", "250"));
MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
/* Inventory slots limits */
WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
WAREHOUSE_SLOTS_DWARF = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
WAREHOUSE_SLOTS_CLAN = Integer.parseInt(otherSettings.getProperty("MaximumWarehouseSlotsForClan", "150"));
FREIGHT_SLOTS = Integer.parseInt(otherSettings.getProperty("MaximumFreightSlots", "20"));
/* chance to enchant an item over +3 */
ENCHANT_CHANCE_WEAPON = Integer.parseInt(otherSettings.getProperty("EnchantChanceWeapon", "68"));
ENCHANT_CHANCE_ARMOR = Integer.parseInt(otherSettings.getProperty("EnchantChanceArmor", "52"));
ENCHANT_CHANCE_JEWELRY = Integer.parseInt(otherSettings.getProperty("EnchantChanceJewelry", "54"));
/* limit on enchant */
ENCHANT_MAX_WEAPON = Integer.parseInt(otherSettings.getProperty("EnchantMaxWeapon", "255"));
ENCHANT_MAX_ARMOR = Integer.parseInt(otherSettings.getProperty("EnchantMaxArmor", "255"));
ENCHANT_MAX_JEWELRY = Integer.parseInt(otherSettings.getProperty("EnchantMaxJewelry", "255"));
/* limit of safe enchant normal */
ENCHANT_SAFE_MAX = Integer.parseInt(otherSettings.getProperty("EnchantSafeMax", "3"));
/* limit of safe enchant full */
ENCHANT_SAFE_MAX_FULL = Integer.parseInt(otherSettings.getProperty("EnchantSafeMaxFull", "4"));
/* if different from 100 (ie 100%) heal rate is modified acordingly */
HP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("HpRegenMultiplier", "100")) / 100;
MP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("MpRegenMultiplier", "100")) / 100;
CP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("CpRegenMultiplier", "100")) / 100;
RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidHpRegenMultiplier", "100")) / 100;
RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidMpRegenMultiplier", "100")) / 100;
RAID_DEFENCE_MULTIPLIER = Double.parseDouble(otherSettings.getProperty("RaidDefenceMultiplier", "100")) / 100;
RAID_MINION_RESPAWN_TIMER = Integer.parseInt(otherSettings.getProperty("RaidMinionRespawnTime", "300000"));
RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMinRespawnMultiplier", "1.0"));
RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMaxRespawnMultiplier", "1.0"));
STARTING_ADENA = Integer.parseInt(otherSettings.getProperty("StartingAdena", "100"));
UNSTUCK_INTERVAL = Integer.parseInt(otherSettings.getProperty("UnstuckInterval", "300"));
/* Player protection after teleport or login */
PLAYER_SPAWN_PROTECTION = Integer.parseInt(otherSettings.getProperty("PlayerSpawnProtection", "0"));
/* Player protection after recovering from fake death (works against mobs only) */
PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(otherSettings.getProperty("PlayerFakeDeathUpProtection", "0"));
/* Defines some Party XP related values */
PARTY_XP_CUTOFF_METHOD = otherSettings.getProperty("PartyXpCutoffMethod", "percentage");
PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(otherSettings.getProperty("PartyXpCutoffPercent", "3."));
PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(otherSettings.getProperty("PartyXpCutoffLevel", "30"));
/* Amount of HP, MP, and CP is restored */
RESPAWN_RESTORE_CP = Double.parseDouble(otherSettings.getProperty("RespawnRestoreCP", "0")) / 100;
RESPAWN_RESTORE_HP = Double.parseDouble(otherSettings.getProperty("RespawnRestoreHP", "70")) / 100;
RESPAWN_RESTORE_MP = Double.parseDouble(otherSettings.getProperty("RespawnRestoreMP", "70")) / 100;
RESPAWN_RANDOM_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("RespawnRandomInTown", "False"));
RESPAWN_RANDOM_MAX_OFFSET = Integer.parseInt(otherSettings.getProperty("RespawnRandomMaxOffset", "50"));
/* Maximum number of available slots for pvt stores */
MAX_PVTSTORE_SLOTS_DWARF = Integer.parseInt(otherSettings.getProperty("MaxPvtStoreSlotsDwarf", "5"));
MAX_PVTSTORE_SLOTS_OTHER = Integer.parseInt(otherSettings.getProperty("MaxPvtStoreSlotsOther", "4"));
STORE_SKILL_COOLTIME = Boolean.parseBoolean(otherSettings.getProperty("StoreSkillCooltime", "true"));
PET_RENT_NPC = otherSettings.getProperty("ListPetRentNpc", "30827");
LIST_PET_RENT_NPC = new FastList<>();
for (String id : PET_RENT_NPC.split(","))
{
LIST_PET_RENT_NPC.add(Integer.parseInt(id));
}
NONDROPPABLE_ITEMS = otherSettings.getProperty("ListOfNonDroppableItems", "1147,425,1146,461,10,2368,7,6,2370,2369,5598");
LIST_NONDROPPABLE_ITEMS = new FastList<>();
for (String id : NONDROPPABLE_ITEMS.split(","))
{
LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
}
ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(otherSettings.getProperty("AnnounceMammonSpawn", "True"));
ALT_PRIVILEGES_ADMIN = Boolean.parseBoolean(otherSettings.getProperty("AltPrivilegesAdmin", "False"));
ALT_PRIVILEGES_SECURE_CHECK = Boolean.parseBoolean(otherSettings.getProperty("AltPrivilegesSecureCheck", "True"));
ALT_PRIVILEGES_DEFAULT_LEVEL = Integer.parseInt(otherSettings.getProperty("AltPrivilegesDefaultLevel", "100"));
GM_NAME_COLOR_ENABLED = Boolean.parseBoolean(otherSettings.getProperty("GMNameColorEnabled", "False"));
GM_NAME_COLOR = Integer.decode("0x" + otherSettings.getProperty("GMNameColor", "FFFF00"));
ADMIN_NAME_COLOR = Integer.decode("0x" + otherSettings.getProperty("AdminNameColor", "00FF00"));
GM_HERO_AURA = Boolean.parseBoolean(otherSettings.getProperty("GMHeroAura", "True"));
GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupInvulnerable", "True"));
GM_STARTUP_INVISIBLE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupInvisible", "True"));
GM_STARTUP_SILENCE = Boolean.parseBoolean(otherSettings.getProperty("GMStartupSilence", "True"));
GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(otherSettings.getProperty("GMStartupAutoList", "True"));
GM_ADMIN_MENU_STYLE = otherSettings.getProperty("GMAdminMenuStyle", "modern");
PETITIONING_ALLOWED = Boolean.parseBoolean(otherSettings.getProperty("PetitioningAllowed", "True"));
MAX_PETITIONS_PER_PLAYER = Integer.parseInt(otherSettings.getProperty("MaxPetitionsPerPlayer", "5"));
MAX_PETITIONS_PENDING = Integer.parseInt(otherSettings.getProperty("MaxPetitionsPending", "25"));
JAIL_IS_PVP = Boolean.valueOf(otherSettings.getProperty("JailIsPvp", "True"));
JAIL_DISABLE_CHAT = Boolean.valueOf(otherSettings.getProperty("JailDisableChat", "True"));
DEATH_PENALTY_CHANCE = Integer.parseInt(otherSettings.getProperty("DeathPenaltyChance", "20"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + OTHER_CONFIG_FILE + " File.");
}
// rates
try
{
Properties ratesSettings = new Properties();
InputStream is = new FileInputStream(new File(RATES_CONFIG_FILE));
ratesSettings.load(is);
is.close();
RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
RATE_QUESTS_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestsReward", "1."));
RATE_DROP_ADENA = Float.parseFloat(ratesSettings.getProperty("RateDropAdena", "1."));
RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
RATE_DROP_QUEST = Float.parseFloat(ratesSettings.getProperty("RateDropQuest", "1."));
RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
RATE_DROP_COMMON_HERBS = Float.parseFloat(ratesSettings.getProperty("RateCommonHerbs", "15."));
RATE_DROP_MP_HP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateHpMpHerbs", "10."));
RATE_DROP_GREATER_HERBS = Float.parseFloat(ratesSettings.getProperty("RateGreaterHerbs", "4."));
RATE_DROP_SUPERIOR_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSuperiorHerbs", "0.8")) * 10;
RATE_DROP_SPECIAL_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSpecialHerbs", "0.2")) * 10;
PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + RATES_CONFIG_FILE + " File.");
}
// alternative settings
try
{
Properties altSettings = new Properties();
InputStream is = new FileInputStream(new File(ALT_SETTINGS_FILE));
altSettings.load(is);
is.close();
ALT_GAME_TIREDNESS = Boolean.parseBoolean(altSettings.getProperty("AltGameTiredness", "false"));
ALT_GAME_CREATION = Boolean.parseBoolean(altSettings.getProperty("AltGameCreation", "false"));
ALT_GAME_CREATION_SPEED = Double.parseDouble(altSettings.getProperty("AltGameCreationSpeed", "1"));
ALT_GAME_CREATION_XP_RATE = Double.parseDouble(altSettings.getProperty("AltGameCreationRateXp", "1"));
ALT_GAME_CREATION_SP_RATE = Double.parseDouble(altSettings.getProperty("AltGameCreationRateSp", "1"));
ALT_WEIGHT_LIMIT = Double.parseDouble(altSettings.getProperty("AltWeightLimit", "1"));
ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(altSettings.getProperty("AltBlacksmithUseRecipes", "true"));
ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(altSettings.getProperty("AltGameSkillLearn", "false"));
AUTO_LEARN_SKILLS = Boolean.parseBoolean(altSettings.getProperty("AutoLearnSkills", "false"));
ALT_GAME_CANCEL_BOW = altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
ALT_GAME_CANCEL_CAST = altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || altSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(altSettings.getProperty("AltShieldBlocks", "false"));
ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(altSettings.getProperty("AltPerfectShieldBlockRate", "10"));
ALT_GAME_DELEVEL = Boolean.parseBoolean(altSettings.getProperty("Delevel", "true"));
ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(altSettings.getProperty("MagicFailures", "false"));
ALT_GAME_MOB_ATTACK_AI = Boolean.parseBoolean(altSettings.getProperty("AltGameMobAttackAI", "false"));
ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(altSettings.getProperty("AltMobAgroInPeaceZone", "true"));
ALT_GAME_EXPONENT_XP = Float.parseFloat(altSettings.getProperty("AltGameExponentXp", "0."));
ALT_GAME_EXPONENT_SP = Float.parseFloat(altSettings.getProperty("AltGameExponentSp", "0."));
ALLOW_CLASS_MASTERS = Boolean.valueOf(altSettings.getProperty("AllowClassMasters", "False"));
ALT_GAME_FREIGHTS = Boolean.parseBoolean(altSettings.getProperty("AltGameFreights", "false"));
ALT_GAME_FREIGHT_PRICE = Integer.parseInt(altSettings.getProperty("AltGameFreightPrice", "1000"));
ALT_PARTY_RANGE = Integer.parseInt(altSettings.getProperty("AltPartyRange", "1600"));
ALT_PARTY_RANGE2 = Integer.parseInt(altSettings.getProperty("AltPartyRange2", "1400"));
REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(altSettings.getProperty("RemoveCastleCirclets", "true"));
IS_CRAFTING_ENABLED = Boolean.parseBoolean(altSettings.getProperty("CraftingEnabled", "true"));
LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(altSettings.getProperty("LifeCrystalNeeded", "true"));
SP_BOOK_NEEDED = Boolean.parseBoolean(altSettings.getProperty("SpBookNeeded", "true"));
ES_SP_BOOK_NEEDED = Boolean.parseBoolean(altSettings.getProperty("EnchantSkillSpBookNeeded", "true"));
AUTO_LOOT = altSettings.getProperty("AutoLoot").equalsIgnoreCase("True");
AUTO_LOOT_HERBS = altSettings.getProperty("AutoLootHerbs").equalsIgnoreCase("True");
ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanShop", "true"));
ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseGK", "false"));
ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTeleport", "true"));
ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanTrade", "true"));
ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.valueOf(altSettings.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(altSettings.getProperty("AltFreeTeleporting", "False"));
ALT_RECOMMEND = Boolean.parseBoolean(altSettings.getProperty("AltRecommend", "False"));
ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltSubClassWithoutQuests", "False"));
ALT_GAME_VIEWNPC = Boolean.parseBoolean(altSettings.getProperty("AltGameViewNpc", "False"));
ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.parseBoolean(altSettings.getProperty("AltNewCharAlwaysIsNewbie", "False"));
ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(altSettings.getProperty("AltMembersCanWithdrawFromClanWH", "False"));
ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(altSettings.getProperty("AltMaxNumOfClansInAlly", "3"));
DWARF_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("DwarfRecipeLimit", "50"));
COMMON_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("CommonRecipeLimit", "50"));
ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(altSettings.getProperty("AltClanMembersForWar", "15"));
ALT_CLAN_JOIN_DAYS = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAClan", "5"));
ALT_CLAN_CREATE_DAYS = Integer.parseInt(altSettings.getProperty("DaysBeforeCreateAClan", "10"));
ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(altSettings.getProperty("DaysToPassToDissolveAClan", "7"));
ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(altSettings.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(altSettings.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(altSettings.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "10"));
ALT_OLY_START_TIME = Integer.parseInt(altSettings.getProperty("AltOlyStartTime", "18"));
ALT_OLY_MIN = Integer.parseInt(altSettings.getProperty("AltOlyMin", "00"));
ALT_OLY_CPERIOD = Long.parseLong(altSettings.getProperty("AltOlyCPeriod", "21600000"));
ALT_OLY_BATTLE = Long.parseLong(altSettings.getProperty("AltOlyBattle", "360000"));
ALT_OLY_BWAIT = Long.parseLong(altSettings.getProperty("AltOlyBWait", "600000"));
ALT_OLY_IWAIT = Long.parseLong(altSettings.getProperty("AltOlyIWait", "300000"));
ALT_OLY_WPERIOD = Long.parseLong(altSettings.getProperty("AltOlyWPeriod", "604800000"));
ALT_OLY_VPERIOD = Long.parseLong(altSettings.getProperty("AltOlyVPeriod", "86400000"));
ALT_MANOR_REFRESH_TIME = Integer.parseInt(altSettings.getProperty("AltManorRefreshTime", "20"));
ALT_MANOR_REFRESH_MIN = Integer.parseInt(altSettings.getProperty("AltManorRefreshMin", "00"));
ALT_MANOR_APPROVE_TIME = Integer.parseInt(altSettings.getProperty("AltManorApproveTime", "6"));
ALT_MANOR_APPROVE_MIN = Integer.parseInt(altSettings.getProperty("AltManorApproveMin", "00"));
ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(altSettings.getProperty("AltManorMaintenancePeriod", "360000"));
ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(altSettings.getProperty("AltManorSaveAllActions", "false"));
ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(altSettings.getProperty("AltManorSavePeriodRate", "2"));
ALT_LOTTERY_PRIZE = Integer.parseInt(altSettings.getProperty("AltLotteryPrize", "50000"));
ALT_LOTTERY_TICKET_PRICE = Integer.parseInt(altSettings.getProperty("AltLotteryTicketPrice", "2000"));
ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery5NumberRate", "0.6"));
ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery4NumberRate", "0.2"));
ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(altSettings.getProperty("AltLottery3NumberRate", "0.2"));
ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Integer.parseInt(altSettings.getProperty("AltLottery2and1NumberPrize", "200"));
BUFFS_MAX_AMOUNT = Byte.parseByte(altSettings.getProperty("maxbuffamount", "24"));
ALT_DEV_NO_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltDevNoQuests", "False"));
ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(altSettings.getProperty("AltDevNoSpawns", "False"));
// Dimensional Rift Config
RIFT_MIN_PARTY_SIZE = Integer.parseInt(altSettings.getProperty("RiftMinPartySize", "5"));
RIFT_MAX_JUMPS = Integer.parseInt(altSettings.getProperty("MaxRiftJumps", "4"));
RIFT_SPAWN_DELAY = Integer.parseInt(altSettings.getProperty("RiftSpawnDelay", "10000"));
RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(altSettings.getProperty("AutoJumpsDelayMin", "480"));
RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(altSettings.getProperty("AutoJumpsDelayMax", "600"));
RIFT_ENTER_COST_RECRUIT = Integer.parseInt(altSettings.getProperty("RecruitCost", "18"));
RIFT_ENTER_COST_SOLDIER = Integer.parseInt(altSettings.getProperty("SoldierCost", "21"));
RIFT_ENTER_COST_OFFICER = Integer.parseInt(altSettings.getProperty("OfficerCost", "24"));
RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(altSettings.getProperty("CaptainCost", "27"));
RIFT_ENTER_COST_COMMANDER = Integer.parseInt(altSettings.getProperty("CommanderCost", "30"));
RIFT_ENTER_COST_HERO = Integer.parseInt(altSettings.getProperty("HeroCost", "33"));
RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(altSettings.getProperty("BossRoomTimeMultiply", "1.5"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + ALT_SETTINGS_FILE + " File.");
}
// Seven Signs Config
try
{
Properties SevenSettings = new Properties();
InputStream is = new FileInputStream(new File(SEVENSIGNS_FILE));
SevenSettings.load(is);
is.close();
ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.parseBoolean(SevenSettings.getProperty("AltRequireCastleForDawn", "False"));
ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(SevenSettings.getProperty("AltRequireClanCastle", "False"));
ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(SevenSettings.getProperty("AltFestivalMinPlayer", "5"));
ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(SevenSettings.getProperty("AltMaxPlayerContrib", "1000000"));
ALT_FESTIVAL_MANAGER_START = Long.parseLong(SevenSettings.getProperty("AltFestivalManagerStart", "120000"));
ALT_FESTIVAL_LENGTH = Long.parseLong(SevenSettings.getProperty("AltFestivalLength", "1080000"));
ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(SevenSettings.getProperty("AltFestivalCycleLength", "2280000"));
ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(SevenSettings.getProperty("AltFestivalFirstSpawn", "120000"));
ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(SevenSettings.getProperty("AltFestivalFirstSwarm", "300000"));
ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(SevenSettings.getProperty("AltFestivalSecondSpawn", "540000"));
ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(SevenSettings.getProperty("AltFestivalSecondSwarm", "720000"));
ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(SevenSettings.getProperty("AltFestivalChestSpawn", "900000"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + SEVENSIGNS_FILE + " File.");
}
// clanhall settings
try
{
Properties clanhallSettings = new Properties();
InputStream is = new FileInputStream(new File(CLANHALL_CONFIG_FILE));
clanhallSettings.load(is);
is.close();
CH_TELE_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallTeleportFunctionFeeRation", "86400000"));
CH_TELE1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallTeleportFunctionFeeLvl1", "86400000"));
CH_TELE2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallTeleportFunctionFeeLvl2", "86400000"));
CH_SUPPORT_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallSupportFunctionFeeRation", "86400000"));
CH_SUPPORT1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl1", "86400000"));
CH_SUPPORT2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl2", "86400000"));
CH_SUPPORT3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl3", "86400000"));
CH_SUPPORT4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl4", "86400000"));
CH_SUPPORT5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl5", "86400000"));
CH_SUPPORT6_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl6", "86400000"));
CH_SUPPORT7_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl7", "86400000"));
CH_SUPPORT8_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallSupportFeeLvl8", "86400000"));
CH_MPREG_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFunctionFeeRation", "86400000"));
CH_MPREG1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl1", "86400000"));
CH_MPREG2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl2", "86400000"));
CH_MPREG3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl3", "86400000"));
CH_MPREG4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl4", "86400000"));
CH_MPREG5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallMpRegenerationFeeLvl5", "86400000"));
CH_HPREG_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFunctionFeeRation", "86400000"));
CH_HPREG1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl1", "86400000"));
CH_HPREG2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl2", "86400000"));
CH_HPREG3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl3", "86400000"));
CH_HPREG4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl4", "86400000"));
CH_HPREG5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl5", "86400000"));
CH_HPREG6_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl6", "86400000"));
CH_HPREG7_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl7", "86400000"));
CH_HPREG8_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl8", "86400000"));
CH_HPREG9_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl9", "86400000"));
CH_HPREG10_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl10", "86400000"));
CH_HPREG11_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl11", "86400000"));
CH_HPREG12_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl12", "86400000"));
CH_HPREG13_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallHpRegenerationFeeLvl13", "86400000"));
CH_EXPREG_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFunctionFeeRation", "86400000"));
CH_EXPREG1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl1", "86400000"));
CH_EXPREG2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl2", "86400000"));
CH_EXPREG3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl3", "86400000"));
CH_EXPREG4_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl4", "86400000"));
CH_EXPREG5_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl5", "86400000"));
CH_EXPREG6_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl6", "86400000"));
CH_EXPREG7_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallExpRegenerationFeeLvl7", "86400000"));
CH_ITEM_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeRation", "86400000"));
CH_ITEM1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeLvl1", "86400000"));
CH_ITEM2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeLvl2", "86400000"));
CH_ITEM3_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallItemCreationFunctionFeeLvl3", "86400000"));
CH_CURTAIN_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallCurtainFunctionFeeRation", "86400000"));
CH_CURTAIN1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallCurtainFunctionFeeLvl1", "86400000"));
CH_CURTAIN2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallCurtainFunctionFeeLvl2", "86400000"));
CH_FRONT_FEE_RATIO = Long.valueOf(clanhallSettings.getProperty("ClanHallFrontPlatformFunctionFeeRation", "86400000"));
CH_FRONT1_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "86400000"));
CH_FRONT2_FEE = Integer.valueOf(clanhallSettings.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "86400000"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + CLANHALL_CONFIG_FILE + " File.");
}
try
{
Properties L2JModSettings = new Properties();
InputStream is = new FileInputStream(new File(L2JMOD_CONFIG_FILE));
L2JModSettings.load(is);
is.close();
L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
L2JMOD_CHAMPION_HP = Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
L2JMOD_CHAMPION_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
L2JMOD_CHAMPION_ADENAS_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
L2JMOD_CHAMPION_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
L2JMOD_CHAMPION_REWARD = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItem", "0"));
L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
TVT_EVENT_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventEnabled", "false"));
TVT_EVENT_INTERVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventInterval", "18000"));
TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationTime", "3600"));
TVT_EVENT_RUNNING_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventRunningTime", "1800"));
TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationNpcId", "0"));
/** L2JMOD Wedding system */
L2JMOD_ALLOW_WEDDING = Boolean.valueOf(L2JModSettings.getProperty("AllowWedding", "False"));
L2JMOD_WEDDING_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingPrice", "250000000"));
L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingPunishInfidelity", "True"));
L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingTeleport", "True"));
L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportPrice", "50000"));
L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportDuration", "60"));
L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
{
TVT_EVENT_ENABLED = false;
System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
}
else
{
String[] propertySplit = L2JModSettings.getProperty("TvTEventParticipationNpcCoordinates", "0,0,0").split(",");
if (propertySplit.length < 3)
{
TVT_EVENT_ENABLED = false;
System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcCoordinates");
}
else
{
TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
TVT_EVENT_MIN_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayersInTeams", "1"));
TVT_EVENT_MAX_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayersInTeams", "20"));
TVT_EVENT_MIN_LVL = (byte) Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayerLevel", "1"));
TVT_EVENT_MAX_LVL = (byte) Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayerLevel", "80"));
TVT_EVENT_RESPAWN_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventRespawnTeleportDelay", "20"));
TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20"));
TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1");
propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(",");
if (propertySplit.length < 3)
{
TVT_EVENT_ENABLED = false;
System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam1Coordinates");
}
else
{
TVT_EVENT_TEAM_1_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
TVT_EVENT_TEAM_1_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
TVT_EVENT_TEAM_1_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
TVT_EVENT_TEAM_2_NAME = L2JModSettings.getProperty("TvTEventTeam2Name", "Team2");
propertySplit = L2JModSettings.getProperty("TvTEventTeam2Coordinates", "0,0,0").split(",");
if (propertySplit.length < 3)
{
TVT_EVENT_ENABLED = false;
System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam2Coordinates");
}
else
{
TVT_EVENT_TEAM_2_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
TVT_EVENT_TEAM_2_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
TVT_EVENT_TEAM_2_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
propertySplit = L2JModSettings.getProperty("TvTEventReward", "57,100000").split(";");
for (String reward : propertySplit)
{
String[] rewardSplit = reward.split(",");
if (rewardSplit.length != 2)
{
System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"" + reward + "\"");
}
else
{
try
{
TVT_EVENT_REWARDS.add(new int[]
{
Integer.valueOf(rewardSplit[0]),
Integer.valueOf(rewardSplit[1])
});
}
catch (NumberFormatException nfe)
{
if (!reward.equals(""))
{
System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"" + reward + "\"");
}
}
}
}
TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventTargetTeamMembersAllowed", "true"));
TVT_EVENT_POTIONS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventPotionsAllowed", "false"));
TVT_EVENT_SUMMON_BY_ITEM_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventSummonByItemAllowed", "false"));
propertySplit = L2JModSettings.getProperty("TvTEventDoorsCloseOpenOnStartEnd", "").split(";");
for (String door : propertySplit)
{
try
{
TVT_EVENT_DOOR_IDS.add(Integer.valueOf(door));
}
catch (NumberFormatException nfe)
{
if (!door.equals(""))
{
System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventDoorsCloseOpenOnStartEnd \"" + door + "\"");
}
}
}
}
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + L2JMOD_CONFIG_FILE + " File.");
}
// pvp config
try
{
Properties pvpSettings = new Properties();
InputStream is = new FileInputStream(new File(PVP_CONFIG_FILE));
pvpSettings.load(is);
is.close();
/* KARMA SYSTEM */
KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650");
KARMA_NONDROPPABLE_ITEMS = pvpSettings.getProperty("ListOfNonDroppableItems", "57,1147,425,1146,461,10,2368,7,6,2370,2369,6842,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621");
KARMA_LIST_NONDROPPABLE_PET_ITEMS = new FastList<>();
for (String id : KARMA_NONDROPPABLE_PET_ITEMS.split(","))
{
KARMA_LIST_NONDROPPABLE_PET_ITEMS.add(Integer.parseInt(id));
}
KARMA_LIST_NONDROPPABLE_ITEMS = new FastList<>();
for (String id : KARMA_NONDROPPABLE_ITEMS.split(","))
{
KARMA_LIST_NONDROPPABLE_ITEMS.add(Integer.parseInt(id));
}
PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "15000"));
PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "30000"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + PVP_CONFIG_FILE + " File.");
}
// access levels
try
{
Properties gmSettings = new Properties();
InputStream is = new FileInputStream(new File(GM_ACCESS_FILE));
gmSettings.load(is);
is.close();
GM_ACCESSLEVEL = Integer.parseInt(gmSettings.getProperty("GMAccessLevel", "100"));
GM_MIN = Integer.parseInt(gmSettings.getProperty("GMMinLevel", "100"));
GM_ALTG_MIN_LEVEL = Integer.parseInt(gmSettings.getProperty("GMCanAltG", "100"));
GM_ANNOUNCE = Integer.parseInt(gmSettings.getProperty("GMCanAnnounce", "100"));
GM_BAN = Integer.parseInt(gmSettings.getProperty("GMCanBan", "100"));
GM_BAN_CHAT = Integer.parseInt(gmSettings.getProperty("GMCanBanChat", "100"));
GM_CREATE_ITEM = Integer.parseInt(gmSettings.getProperty("GMCanShop", "100"));
GM_DELETE = Integer.parseInt(gmSettings.getProperty("GMCanDelete", "100"));
GM_KICK = Integer.parseInt(gmSettings.getProperty("GMCanKick", "100"));
GM_MENU = Integer.parseInt(gmSettings.getProperty("GMMenu", "100"));
GM_GODMODE = Integer.parseInt(gmSettings.getProperty("GMGodMode", "100"));
GM_CHAR_EDIT = Integer.parseInt(gmSettings.getProperty("GMCanEditChar", "100"));
GM_CHAR_EDIT_OTHER = Integer.parseInt(gmSettings.getProperty("GMCanEditCharOther", "100"));
GM_CHAR_VIEW = Integer.parseInt(gmSettings.getProperty("GMCanViewChar", "100"));
GM_NPC_EDIT = Integer.parseInt(gmSettings.getProperty("GMCanEditNPC", "100"));
GM_NPC_VIEW = Integer.parseInt(gmSettings.getProperty("GMCanViewNPC", "100"));
GM_TELEPORT = Integer.parseInt(gmSettings.getProperty("GMCanTeleport", "100"));
GM_TELEPORT_OTHER = Integer.parseInt(gmSettings.getProperty("GMCanTeleportOther", "100"));
GM_RESTART = Integer.parseInt(gmSettings.getProperty("GMCanRestart", "100"));
GM_MONSTERRACE = Integer.parseInt(gmSettings.getProperty("GMMonsterRace", "100"));
GM_RIDER = Integer.parseInt(gmSettings.getProperty("GMRider", "100"));
GM_ESCAPE = Integer.parseInt(gmSettings.getProperty("GMFastUnstuck", "100"));
GM_FIXED = Integer.parseInt(gmSettings.getProperty("GMResurectFixed", "100"));
GM_CREATE_NODES = Integer.parseInt(gmSettings.getProperty("GMCreateNodes", "100"));
GM_ENCHANT = Integer.parseInt(gmSettings.getProperty("GMEnchant", "100"));
GM_DOOR = Integer.parseInt(gmSettings.getProperty("GMDoor", "100"));
GM_RES = Integer.parseInt(gmSettings.getProperty("GMRes", "100"));
GM_PEACEATTACK = Integer.parseInt(gmSettings.getProperty("GMPeaceAttack", "100"));
GM_HEAL = Integer.parseInt(gmSettings.getProperty("GMHeal", "100"));
GM_UNBLOCK = Integer.parseInt(gmSettings.getProperty("GMUnblock", "100"));
GM_CACHE = Integer.parseInt(gmSettings.getProperty("GMCache", "100"));
GM_TALK_BLOCK = Integer.parseInt(gmSettings.getProperty("GMTalkBlock", "100"));
GM_TEST = Integer.parseInt(gmSettings.getProperty("GMTest", "100"));
String gmTrans = gmSettings.getProperty("GMDisableTransaction", "False");
if (!gmTrans.equalsIgnoreCase("false"))
{
String[] params = gmTrans.split(",");
GM_DISABLE_TRANSACTION = true;
GM_TRANSACTION_MIN = Integer.parseInt(params[0]);
GM_TRANSACTION_MAX = Integer.parseInt(params[1]);
}
else
{
GM_DISABLE_TRANSACTION = false;
}
GM_CAN_GIVE_DAMAGE = Integer.parseInt(gmSettings.getProperty("GMCanGiveDamage", "90"));
GM_DONT_TAKE_AGGRO = Integer.parseInt(gmSettings.getProperty("GMDontTakeAggro", "90"));
GM_DONT_TAKE_EXPSP = Integer.parseInt(gmSettings.getProperty("GMDontGiveExpSp", "90"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + GM_ACCESS_FILE + " File.");
}
try
{
Properties Settings = new Properties();
InputStream is = new FileInputStream(HEXID_FILE);
Settings.load(is);
is.close();
SERVER_ID = Integer.parseInt(Settings.getProperty("ServerID"));
HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
}
catch (Exception e)
{
_log.warning("Could not load HexID file (" + HEXID_FILE + "). Hopefully login will give us one.");
}
}
else if (Server.serverMode == Server.MODE_LOGINSERVER)
{
_log.info("loading login config");
try
{
Properties serverSettings = new Properties();
InputStream is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));
serverSettings.load(is);
is.close();
GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname", "*");
GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort", "9013"));
LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
DEVELOPER = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));
ASSERT = Boolean.parseBoolean(serverSettings.getProperty("Assert", "false"));
ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer", "True"));
REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID", "0"));
ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID", "True"));
LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
GM_MIN = Integer.parseInt(serverSettings.getProperty("GMMinLevel", "100"));
DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile(); // FIXME: in login?
INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "localhost");
EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");
DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
IP_UPDATE_TIME = Integer.parseInt(serverSettings.getProperty("IpUpdateTime", "15"));
FORCE_GGAUTH = Boolean.parseBoolean(serverSettings.getProperty("ForceGGAuth", "false"));
AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts", "True"));
FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection", "True"));
FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit", "15"));
NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime", "700"));
FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime", "350"));
MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP", "50"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + CONFIGURATION_FILE + " File.");
}
// telnet
try
{
Properties telnetSettings = new Properties();
InputStream is = new FileInputStream(new File(TELNET_FILE));
telnetSettings.load(is);
is.close();
IS_TELNET_ENABLED = Boolean.valueOf(telnetSettings.getProperty("EnableTelnet", "false"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + TELNET_FILE + " File.");
}
}
else
{
_log.severe("Could not Load Config: server mode was not set");
}
}
/**
* Set a new value to a game parameter from the admin console.
* @param pName (String) : name of the parameter to change
* @param pValue (String) : new value of the parameter
* @return boolean : true if modification has been made
*/
public static boolean setParameterValue(String pName, String pValue)
{
// Server settings
if (pName.equalsIgnoreCase("RateXp"))
{
RATE_XP = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("RateSp"))
{
RATE_SP = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("RatePartyXp"))
{
RATE_PARTY_XP = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("RatePartySp"))
{
RATE_PARTY_SP = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("RateQuestsReward"))
{
RATE_QUESTS_REWARD = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("RateDropAdena"))
{
RATE_DROP_ADENA = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("RateConsumableCost"))
{
RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("RateDropItems"))
{
RATE_DROP_ITEMS = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("RateDropSpoil"))
{
RATE_DROP_SPOIL = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("RateDropManor"))
{
RATE_DROP_MANOR = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("RateDropQuest"))
{
RATE_DROP_QUEST = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("RateKarmaExpLost"))
{
RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice"))
{
RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("PlayerDropLimit"))
{
PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("PlayerRateDrop"))
{
PLAYER_RATE_DROP = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("PlayerRateDropItem"))
{
PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("PlayerRateDropEquip"))
{
PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon"))
{
PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("KarmaDropLimit"))
{
KARMA_DROP_LIMIT = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("KarmaRateDrop"))
{
KARMA_RATE_DROP = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("KarmaRateDropItem"))
{
KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("KarmaRateDropEquip"))
{
KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon"))
{
KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter"))
{
AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem"))
{
DESTROY_DROPPED_PLAYER_ITEM = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("DestroyEquipableItem"))
{
DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("SaveDroppedItem"))
{
SAVE_DROPPED_ITEM = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad"))
{
EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("SaveDroppedItemInterval"))
{
SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ClearDroppedItemTable"))
{
CLEAR_DROPPED_ITEM_TABLE = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("PreciseDropCalculation"))
{
PRECISE_DROP_CALCULATION = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("MultipleItemDrop"))
{
MULTIPLE_ITEM_DROP = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("CoordSynchronize"))
{
COORD_SYNCHRONIZE = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("DeleteCharAfterDays"))
{
DELETE_DAYS = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("AllowDiscardItem"))
{
ALLOW_DISCARDITEM = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AllowFreight"))
{
ALLOW_FREIGHT = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AllowWarehouse"))
{
ALLOW_WAREHOUSE = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AllowWear"))
{
ALLOW_WEAR = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("WearDelay"))
{
WEAR_DELAY = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("WearPrice"))
{
WEAR_PRICE = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("AllowWater"))
{
ALLOW_WATER = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AllowRentPet"))
{
ALLOW_RENTPET = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AllowBoat"))
{
ALLOW_BOAT = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AllowCursedWeapons"))
{
ALLOW_CURSED_WEAPONS = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AllowManor"))
{
ALLOW_MANOR = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("BypassValidation"))
{
BYPASS_VALIDATION = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("CommunityType"))
{
COMMUNITY_TYPE = pValue.toLowerCase();
}
else if (pName.equalsIgnoreCase("BBSDefault"))
{
BBS_DEFAULT = pValue;
}
else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard"))
{
SHOW_LEVEL_COMMUNITYBOARD = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard"))
{
SHOW_STATUS_COMMUNITYBOARD = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard"))
{
NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard"))
{
NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ShowServerNews"))
{
SERVER_NEWS = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("ShowNpcLevel"))
{
SHOW_NPC_LVL = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("ForceInventoryUpdate"))
{
FORCE_INVENTORY_UPDATE = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData"))
{
AUTODELETE_INVALID_QUEST_DATA = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("MaximumOnlineUsers"))
{
MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ZoneTown"))
{
ZONE_TOWN = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MaximumUpdateDistance"))
{
MINIMUM_UPDATE_DISTANCE = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MinimumUpdateTime"))
{
MINIMUN_UPDATE_TIME = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("CheckKnownList"))
{
CHECK_KNOWN = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("KnownListForgetDelay"))
{
KNOWNLIST_FORGET_DELAY = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("UseDeepBlueDropRules"))
{
DEEPBLUE_DROP_RULES = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AllowGuards"))
{
ALLOW_GUARDS = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("CancelLesserEffect"))
{
EFFECT_CANCELING = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("WyvernSpeed"))
{
WYVERN_SPEED = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("StriderSpeed"))
{
STRIDER_SPEED = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf"))
{
INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf"))
{
INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer"))
{
INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf"))
{
WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf"))
{
WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan"))
{
WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MaximumFreightSlots"))
{
FREIGHT_SLOTS = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("EnchantChanceWeapon"))
{
ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("EnchantChanceArmor"))
{
ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("EnchantChanceJewelry"))
{
ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("EnchantMaxWeapon"))
{
ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("EnchantMaxArmor"))
{
ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("EnchantMaxJewelry"))
{
ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("EnchantSafeMax"))
{
ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("EnchantSafeMaxFull"))
{
ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("HpRegenMultiplier"))
{
HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
}
else if (pName.equalsIgnoreCase("MpRegenMultiplier"))
{
MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
}
else if (pName.equalsIgnoreCase("CpRegenMultiplier"))
{
CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
}
else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier"))
{
RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
}
else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier"))
{
RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
}
else if (pName.equalsIgnoreCase("RaidDefenceMultiplier"))
{
RAID_DEFENCE_MULTIPLIER = Double.parseDouble(pValue) / 100;
}
else if (pName.equalsIgnoreCase("RaidMinionRespawnTime"))
{
RAID_MINION_RESPAWN_TIMER = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("StartingAdena"))
{
STARTING_ADENA = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("UnstuckInterval"))
{
UNSTUCK_INTERVAL = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("PlayerSpawnProtection"))
{
PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection"))
{
PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("PartyXpCutoffMethod"))
{
PARTY_XP_CUTOFF_METHOD = pValue;
}
else if (pName.equalsIgnoreCase("PartyXpCutoffPercent"))
{
PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
}
else if (pName.equalsIgnoreCase("PartyXpCutoffLevel"))
{
PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("RespawnRestoreCP"))
{
RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
}
else if (pName.equalsIgnoreCase("RespawnRestoreHP"))
{
RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
}
else if (pName.equalsIgnoreCase("RespawnRestoreMP"))
{
RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;
}
else if (pName.equalsIgnoreCase("MaxPvtStoreSlotsDwarf"))
{
MAX_PVTSTORE_SLOTS_DWARF = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MaxPvtStoreSlotsOther"))
{
MAX_PVTSTORE_SLOTS_OTHER = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("StoreSkillCooltime"))
{
STORE_SKILL_COOLTIME = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AnnounceMammonSpawn"))
{
ANNOUNCE_MAMMON_SPAWN = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltGameTiredness"))
{
ALT_GAME_TIREDNESS = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltGameCreation"))
{
ALT_GAME_CREATION = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltGameCreationSpeed"))
{
ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
}
else if (pName.equalsIgnoreCase("AltGameCreationXpRate"))
{
ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
}
else if (pName.equalsIgnoreCase("AltGameCreationSpRate"))
{
ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
}
else if (pName.equalsIgnoreCase("AltWeightLimit"))
{
ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
}
else if (pName.equalsIgnoreCase("AltBlacksmithUseRecipes"))
{
ALT_BLACKSMITH_USE_RECIPES = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltGameSkillLearn"))
{
ALT_GAME_SKILL_LEARN = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("RemoveCastleCirclets"))
{
REMOVE_CASTLE_CIRCLETS = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
{
ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
}
else if (pName.equalsIgnoreCase("AltShieldBlocks"))
{
ALT_GAME_SHIELD_BLOCKS = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate"))
{
ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("Delevel"))
{
ALT_GAME_DELEVEL = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("MagicFailures"))
{
ALT_GAME_MAGICFAILURES = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltGameMobAttackAI"))
{
ALT_GAME_MOB_ATTACK_AI = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltMobAgroInPeaceZone"))
{
ALT_MOB_AGRO_IN_PEACEZONE = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltGameExponentXp"))
{
ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("AltGameExponentSp"))
{
ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("AllowClassMasters"))
{
ALLOW_CLASS_MASTERS = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltGameFreights"))
{
ALT_GAME_FREIGHTS = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltGameFreightPrice"))
{
ALT_GAME_FREIGHT_PRICE = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("AltPartyRange"))
{
ALT_PARTY_RANGE = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("AltPartyRange2"))
{
ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("CraftingEnabled"))
{
IS_CRAFTING_ENABLED = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("LifeCrystalNeeded"))
{
LIFE_CRYSTAL_NEEDED = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("SpBookNeeded"))
{
SP_BOOK_NEEDED = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AutoLoot"))
{
AUTO_LOOT = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AutoLootHerbs"))
{
AUTO_LOOT_HERBS = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone"))
{
ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop"))
{
ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK"))
{
ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport"))
{
ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade"))
{
ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse"))
{
ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltRequireCastleForDawn"))
{
ALT_GAME_REQUIRE_CASTLE_DAWN = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltRequireClanCastle"))
{
ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltFreeTeleporting"))
{
ALT_GAME_FREE_TELEPORT = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests"))
{
ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltNewCharAlwaysIsNewbie"))
{
ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH"))
{
ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("DwarfRecipeLimit"))
{
DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("CommonRecipeLimit"))
{
COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ChampionEnable"))
{
L2JMOD_CHAMPION_ENABLE = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("ChampionFrequency"))
{
L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ChampionMinLevel"))
{
L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ChampionMaxLevel"))
{
L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ChampionHp"))
{
L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ChampionHpRegen"))
{
L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("ChampionRewards"))
{
L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ChampionAdenasRewards"))
{
L2JMOD_CHAMPION_ADENAS_REWARDS = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ChampionAtk"))
{
L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("ChampionSpdAtk"))
{
L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
}
else if (pName.equalsIgnoreCase("ChampionRewardItem"))
{
L2JMOD_CHAMPION_REWARD = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ChampionRewardItemID"))
{
L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("ChampionRewardItemQty"))
{
L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("AllowWedding"))
{
L2JMOD_ALLOW_WEDDING = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("WeddingPrice"))
{
L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("WeddingPunishInfidelity"))
{
L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
}
else if (pName.equalsIgnoreCase("WeddingTeleport"))
{
L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
}
else if (pName.equalsIgnoreCase("WeddingTeleportPrice"))
{
L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("WeddingTeleportDuration"))
{
L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("WeddingAllowSameSex"))
{
L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
}
else if (pName.equalsIgnoreCase("WeddingFormalWear"))
{
L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
}
else if (pName.equalsIgnoreCase("WeddingDivorceCosts"))
{
L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("TvTEventEnabled"))
{
TVT_EVENT_ENABLED = Boolean.parseBoolean(pValue);
}
else if (pName.equalsIgnoreCase("TvTEventInterval"))
{
TVT_EVENT_INTERVAL = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("TvTEventParticipationTime"))
{
TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("TvTEventRunningTime"))
{
TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("TvTEventParticipationNpcId"))
{
TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MinKarma"))
{
KARMA_MIN_KARMA = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("MaxKarma"))
{
KARMA_MAX_KARMA = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("XPDivider"))
{
KARMA_XP_DIVIDER = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("BaseKarmaLost"))
{
KARMA_LOST_BASE = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("CanGMDropEquipment"))
{
KARMA_DROP_GM = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint"))
{
KARMA_AWARD_PK_KILL = Boolean.valueOf(pValue);
}
else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop"))
{
KARMA_PK_LIMIT = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("PvPVsNormalTime"))
{
PVP_NORMAL_TIME = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("PvPVsPvPTime"))
{
PVP_PVP_TIME = Integer.parseInt(pValue);
}
else if (pName.equalsIgnoreCase("GlobalChat"))
{
DEFAULT_GLOBAL_CHAT = pValue;
}
else if (pName.equalsIgnoreCase("TradeChat"))
{
DEFAULT_TRADE_CHAT = pValue;
}
else if (pName.equalsIgnoreCase("MenuStyle"))
{
GM_ADMIN_MENU_STYLE = pValue;
}
else
{
return false;
}
return true;
}
/**
* Allow the player to use L2Walker ?
* @param player (L2PcInstance) : Player trying to use L2Walker
* @return boolean : true if (L2Walker allowed as a general rule) or (L2Walker client allowed for GM and player is a GM)
*/
public static boolean allowL2Walker(L2PcInstance player)
{
return ((ALLOW_L2WALKER_CLIENT == L2WalkerAllowed.True) || ((ALLOW_L2WALKER_CLIENT == L2WalkerAllowed.GM) && (player != null) && player.isGM()));
}
// it has no instances
private Config()
{
}
/**
* Save hexadecimal ID of the server in the properties file.
* @param serverId
* @param string (String) : hexadecimal ID of the server to store
* @see #HEXID_FILE
* @see #saveHexid(int, String, String)
*/
public static void saveHexid(int serverId, String string)
{
Config.saveHexid(serverId, string, HEXID_FILE);
}
/**
* Save hexadecimal ID of the server in the properties file.
* @param serverId
* @param hexId (String) : hexadecimal ID of the server to store
* @param fileName (String) : name of the properties file
*/
public static void saveHexid(int serverId, String hexId, String fileName)
{
try
{
Properties hexSetting = new Properties();
File file = new File(fileName);
// Create a new empty file only if it doesn't exist
file.createNewFile();
OutputStream out = new FileOutputStream(file);
hexSetting.setProperty("ServerID", String.valueOf(serverId));
hexSetting.setProperty("HexID", hexId);
hexSetting.store(out, "the hexID to auth into login");
out.close();
}
catch (Exception e)
{
_log.warning("Failed to save hex id to " + fileName + " File.");
e.printStackTrace();
}
}
}
| oonym/l2InterludeServer | L2J_Server/java/net/sf/l2j/Config.java |
248,952 | package c3.e1;
/**
* Se construya a partir de la cantidad máxima de asistentes que pueden asistir,
* y la cantidad de espectáculos que se brindarán. Agregue un asistente,
* indicando su nombre y la cantidad de espectáculos a los que concurrirá.
* Devuelva la cantidad de espectáculos a los que concurrirá un asistente,
* buscándolo por su nombre. Cuente la cantidad de asistentes. Calcule el dinero
* total que ingresará, asumiendo que se cobra $2 por espectáculo al que se
* asistirá.
*/
public class FestivalDeCirco {
private int capacidad;
private int espectaculos;
private int cantidadAsistentes;
private Asistente[] asistentes;
private int ingresos;
/*
* @pre:
*
* @post:
*/
public FestivalDeCirco(int capacidad, int espectaculos) {
if (capacidad < 1) {
throw new Error("Debe haber cierta capacidad");
}
if (espectaculos < 1) {
throw new Error("Debe brindarse al menos un espectaculo");
}
this.capacidad = capacidad;
this.espectaculos = espectaculos;
this.asistentes = new Asistente[capacidad];
}
/*
* @pre:
*
* @post:
*/
public void agregarAsistente(String nombre, int entradas) {
if (entradas < 1) {
throw new Error("Al menos debe asistir a un espectaculo");
}
if (entradas > this.espectaculos) {
throw new Error("No puede asistir a mas espectaculos que los disponibles");
}
if (this.cantidadAsistentes == this.capacidad) {
throw new Error("No pueden admitirse mas asistentes");
}
this.asistentes[cantidadAsistentes++] = new Asistente(nombre, entradas);
this.ingresos += entradas * 2;
}
/*
* @pre:
*
* @post:
*/
public int obtenerEspectaculos(String nombre) {
boolean encontrado = false;
int indiceAsistente = 0;
while (indiceAsistente < this.cantidadAsistentes && !encontrado) {
if (asistentes[indiceAsistente].getNombre().equals(nombre)) {
encontrado = true;
}
indiceAsistente++;
}
if (!encontrado) {
throw new Error("No se encontro el asistente");
}
return asistentes[indiceAsistente - 1].getEntradas();
}
/*
* @pre:
*
* @post:
*/
public int cantidadDeAsistentes() {
return this.cantidadAsistentes;
}
/*
* @pre:
*
* @post:
*/
public int dineroRecaudado() {
return this.ingresos;
}
}
| untref-ayp1/2022C2-parcial | src/c3/e1/FestivalDeCirco.java |
248,953 | import gui.Root;
import static javafx.application.Application.launch;
public class FestivalPlanner {
public static void main(String[] args) {
launch(Root.class);
}
}
| 23tivt1b2/project | src/FestivalPlanner.java |
248,955 | package dominion.card;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import dominion.ClientTurn;
import dominion.DominionGUI;
import dominion.ServerTurn;
import dominion.Turn;
import dominion.DominionGUI.SelectionType;
import dominion.card.Decision.CardListDecision;
import dominion.card.Decision.DecisionAndPlayerDecision;
import dominion.card.Decision.EnumDecision;
import dominion.card.Decision.ListAndOptionsDecision;
import dominion.card.Decision.NumberDecision;
import dominion.card.Decision.SingleCardDecision;
import dominion.card.Decision.TrashThenGainDecision;
import dominion.card.Decision.firstSecond;
import dominion.card.Decision.keepDiscard;
import dominion.card.Decision.minionDecision;
import dominion.card.Decision.stewardDecision;
import dominion.card.Decision.yesNo;
import dominion.card.Decision.TrashThenGainDecision.WhichDecision;
public interface Card extends Serializable, Comparable<Card> {
public static final TreasureCard[] treasureCards = {new Copper(), new Silver(), new Gold()};
public static final VictoryCard[] victoryCards = {new Estate(), new Duchy(), new Province()};
public static final Card curse = new Curse();
public static final Card[] mustUse = {
};
public static final Card[] baseRandomizerDeck = {
new Chapel(), new Cellar(), new Moat(),
new Chancellor(), new Village(), new Woodcutter(), new Workshop(),
new Bureaucrat(), new Feast(), new Gardens(), new Militia(),
new Moneylender(), new Remodel(), new Smithy(), new Spy(),
new CouncilRoom(), new Festival(), new Laboratory(), new Library(),
new Market(), new Mine(), new Witch(),
new Adventurer()
};
public static final Card[] intrigueRandomizerDeck = {
new Courtyard(), new GreatHall(), new ShantyTown(), new Steward(),
new Baron(), new Conspirator(), new Coppersmith(), new Ironworks(),
new MiningVillage(), new SeaHag(),
new Duke(), new Minion(), new Tribute(), new Upgrade(),
new Harem()
};
public static final Card[] seasideRandomizerDeck= {
new Bazaar()
};
// public static final Card[] alchemyRandomizerDeck= {
// };
public static final Card[] startingHand = new Card[10];
public int getCost();
@SuppressWarnings("serial")
public abstract static class DefaultCard implements Card {
@Override public String toString() { return this.getClass().getSimpleName(); }
@Override public boolean equals(Object other) { return (other.getClass() == this.getClass()); }
@Override
public int compareTo(Card other) {
if(getCost() == other.getCost()) {
return toString().compareTo(other.toString());
}
return getCost() - other.getCost();
}
}
@SuppressWarnings("serial")
public abstract static class SwitchByType extends DefaultCard {
// used by both Tribute and Ironworks when you get bonuses based on type
public void switchHelper(Turn turn, Decision decision, int numCards, int numGain) {
System.out.println("doing continueProcessing for a tribute");
List<Card> list = ((CardListDecision) decision).list;
if(list.size()!=numCards) return;//TODO do something smarter here? not sure what
for(int i = 0; i < numCards; i++) {
Card c = list.get(i);
//if both the same, only do it once, only applicable for Tribute
if(i == 1 && c.equals(list.get(0))) break;
//note, not else if -- if multiple it gets all of the bonuses!
if(c instanceof ActionCard) turn.addActions(numGain);
if(c instanceof VictoryCard) turn.drawCards(numGain);
if(c instanceof TreasureCard) turn.addBuyingPower(numGain);
//curses get nothing, as do nulls (i.e. if no cards were left in deck)
}
}
}
@SuppressWarnings("serial")
public abstract static class VictorySelectionCard extends DefaultCard implements SelectionCard {
@Override public boolean isSelectable(Card c) { return c instanceof VictoryCard; }
}
@SuppressWarnings("serial")
public abstract static class TreasureSelectionCard extends DefaultCard implements SelectionCard {
@Override public boolean isSelectable(Card c) { return c instanceof TreasureCard; }
}
public static class Copper extends DefaultCard implements TreasureCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 0; }
@Override public int getValue() { return 1; }
}
public static class Silver extends DefaultCard implements TreasureCard{
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 3; }
@Override public int getValue() { return 2; }
}
public static class Gold extends DefaultCard implements TreasureCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 6; }
@Override public int getValue() { return 3; }
}
public static class Estate extends DefaultCard implements VictoryCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 2; }
@Override public int getVictoryPoints() { return 1; }
}
public static class Duchy extends DefaultCard implements VictoryCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
@Override public int getVictoryPoints() { return 3; }
}
public static class Province extends DefaultCard implements VictoryCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 8; }
@Override public int getVictoryPoints() { return 6; }
}
//TODO maybe should implement its own "CurseCard" type?
public static class Curse extends DefaultCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 0; }
public int getVictoryPoints() { return -1; }
}
//Base set
//twos
public class Chapel extends DefaultCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public void playCard(Turn turn) {
if(turn instanceof ServerTurn) {
CardListDecision decision;
do {
//request decision
decision = (CardListDecision) ((ServerTurn)turn).getDecision(this, null);
//try using this decision, if it doesn't work, ask again
} while(decision.list.size() > 4 || !((ServerTurn)turn).trashCardsFromHand(decision, this));
}
//on the client side, just wait for the decision request
}
@Override public int getCost() { return 2; }
@Override
public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
//sets the GUI in motion
gui.setupCardSelection(4, false, SelectionType.trash, null);
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
gui.trashCardSelection(playerNum, (CardListDecision)decision);
}
}
public class Cellar extends DefaultCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public void playCard(Turn turn) {
turn.addActions(1);
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn)turn;
CardListDecision decision;
// request cards to discard and attempt to discard them til you get a list that's valid
while(!st.discardCardsFromHand(decision = (CardListDecision) st.getDecision(this, null), this));
// now draw as many cards as you discarded
st.drawCards(decision.list.size());
}
// on the client side, just wait for the decision request
}
@Override public int getCost() { return 2; }
@Override
public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
// sets the GUI in motion
gui.setupCardSelection(-1, false, SelectionType.discard, null);
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
// TODO: should this be discard, not trash? look into this.
gui.trashCardSelection(playerNum, (CardListDecision)decision);
}
}
public class Moat extends DefaultCard implements ReactionCard {
private static final long serialVersionUID = 1L;
@Override public boolean reaction(Turn turn) { return false; }
@Override public void playCard(Turn turn) { turn.drawCards(2); }
@Override public int getCost() { return 2; }
}
//threes
public class Chancellor extends DefaultCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 3; }
// TODO: give error if not the right kind of decision?
@SuppressWarnings("unchecked")
@Override
public void playCard(Turn turn) {
turn.addBuyingPower(2);
if(turn instanceof ServerTurn) {
Decision d = ((ServerTurn) turn).getDecision(this, null);
if(((EnumDecision<yesNo>)d).enumValue == yesNo.yes)
((ServerTurn) turn).discardDeck();
}
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum,
Decision decision, ClientTurn turn) {
// Note: nothing to do here unless we add visuals for size of deck/discard
}
@Override
public void createAndSendDecisionObject(DominionGUI gui,
Decision decision) {
gui.makeMultipleChoiceDecision("Do you want to put your deck into your discard pile?", yesNo.class, null);
}
}
public class Village extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 3; }
@Override
public void playCard(Turn turn) {
turn.drawCards(1);
turn.addActions(2);
}
}
public class Woodcutter extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 3; }
@Override
public void playCard(Turn turn) {
turn.addBuys(1);
turn.addBuyingPower(2);
}
}
public class Workshop extends DefaultCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 3; }
@Override
public void playCard(Turn turn) {
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn)turn;
CardListDecision decision;
do {
decision = (CardListDecision) st.getDecision(this, null);
// if you tried to gain some number other than 1, it costs more than 4, or the one you wanted
// isn't in the supply, request a new one, otherwise we're done
} while(decision.list.size() != 1 || decision.list.get(0).getCost() > 4
|| !st.gainCard(decision.list.get(0)));
}
}
@Override
public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
gui.setupGainCard(4, false, null);
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
/* server handles sending gain message */
}
}
//fours
public class Bureaucrat extends VictorySelectionCard implements AttackCard, DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@Override
public Decision reactToCard(ServerTurn turn) {
// The turn here is the turn of the reacting player, not the one who played the card
int numVictory = 0;
Card firstVictory = null;
for(Card c : turn.inHand)
if(c instanceof VictoryCard) {
if(numVictory == 0) firstVictory = c;
numVictory++;
}
if(numVictory == 0) turn.revealHand();
else if(numVictory == 1) turn.putOnDeckFromHand(firstVictory);
else {
CardListDecision decision;
// there'd better be exactly 1, keep prompting till it is, also must be a victory card,
// and in the player's hand
while(((decision = (CardListDecision)turn.getDecision(this, null))).list.size() != 1 ||
!(decision.list.get(0) instanceof VictoryCard) || !turn.inHand.contains(decision.list.get(0)));
turn.putOnDeckFromHand(decision.list.get(0));
}
// don't need to communicate anything back to the caller directly
return null;
}
@Override public void playCard(Turn turn) {
if(turn instanceof ServerTurn) {
// Card.treasureCards[1] is the single instance of Card.Silver
((ServerTurn) turn).putCardOnTopOfDeck(Card.treasureCards[1]);
((ServerTurn) turn).doInteraction(this);
}
//reaction code takes care of the rest
}
//this will be called on the gui of any opponent with multiple victory cards
@Override public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
gui.setupCardSelection(1, true, SelectionType.undraw, this);
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
// server will send message to remove
}
}
public class Feast extends DefaultCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@Override
public void playCard(Turn turn) {
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn)turn;
CardListDecision decision;
do {
decision = (CardListDecision) st.getDecision(this, null);
// if you tried to gain some number other than 1, it costs more than 5, or the one you wanted
// isn't in the supply, request a new one, otherwise we're done and we trash the feast
} while(decision.list.size() != 1 || decision.list.get(0).getCost() > 5
|| !st.gainCard(decision.list.get(0)));
st.trashCardFromPlay(this);
}
}
@Override
public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
gui.setupGainCard(5, false, null);
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
/* server handles sending gain message */
}
}
public static class Gardens extends DefaultCard implements ConditionalVictoryCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@Override public int getVictoryPoints() { return 0; }
@Override public int getVictoryPoints(Stack<Card> deck) { return deck.size()/10; }
}
public class Militia extends DefaultCard implements AttackCard, DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@Override
public Decision reactToCard(ServerTurn turn) {
// The turn here is the turn of the reacting player, not the one who played the card
// if you're already at or below 3 cards, no effect
if(turn.inHand.size() <= 3) return null;
CardListDecision decision;
int numToDiscard = turn.inHand.size() - 3;
// there'd better be exactly enough to get you down to 3, and you must actually have the cards you sent in your hand
while(((decision = (CardListDecision)turn.getDecision(this, new NumberDecision(numToDiscard)))).list.size()
!= numToDiscard
|| !turn.discardCardsFromHand(decision, this));
return null;
}
@Override public void playCard(Turn turn) {
turn.addBuyingPower(2);
if(turn instanceof ServerTurn) ((ServerTurn) turn).doInteraction(this);
}
//this will be called on the gui of any opponent with multiple victory cards
@Override public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
gui.setupCardSelection(((NumberDecision)decision).num, true, SelectionType.discard, null);
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
// TODO: should this be discard, not trash? look into this.
gui.trashCardSelection(playerNum, (CardListDecision)decision);
}
}
public class Moneylender extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@Override
public void playCard(Turn turn) {
//TODO maybe each card should be a singleton with a getInstance() method?
//TODO should you be allowed to play Moneylender if no copper in hand?
// I think it should be ok from card text, do rules check
if(turn.containsCard(Card.treasureCards[0])) {
turn.trashCardFromHand(Card.treasureCards[0]);
turn.addBuyingPower(3);
}
}
}
public class Remodel extends TreasureSelectionCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@Override
public void playCard(Turn turn) {
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn)turn;
TrashThenGainDecision ttgd = new TrashThenGainDecision();
CardListDecision decision;
do {
decision = (CardListDecision) st.getDecision(this, ttgd);
// prompt til you get 1 card that is in the player's hand
} while(decision.list.size() != 1 || !turn.inHand.contains(decision.list.get(0)));
Card toTrash = decision.list.get(0);
st.trashCardFromHand(toTrash);
st.sendDecisionToPlayer(this, new ListAndOptionsDecision(ttgd, decision));
ttgd = new TrashThenGainDecision(toTrash);
do {
decision = (CardListDecision) st.getDecision(this, ttgd);
// prompt til you get 1 card that's still available and not too expensive
} while(decision.list.size() != 1 || decision.list.get(0).getCost() > toTrash.getCost() + 2
|| !st.gainCard(decision.list.get(0)));
// the gain happens in the while condition
}
}
@Override
public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
TrashThenGainDecision dec = (TrashThenGainDecision) decision;
if(dec.whichDecision == WhichDecision.chooseTrash) {
gui.setupCardSelection(1, true, SelectionType.trash, null);
} else {
gui.setupGainCard(dec.toTrash.getCost() + 2, false, this);
}
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
ListAndOptionsDecision lod = (ListAndOptionsDecision) decision;
TrashThenGainDecision dec = lod.ttgd;
if(dec.whichDecision == WhichDecision.chooseTrash) {
gui.trashCardFromHand(playerNum, lod.cld.list.get(0));
} else {
// should never actually get here, no confirmation sent for
// this part since it's just a normal gain
}
}
}
public class Smithy extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@Override
public void playCard(Turn turn) {
turn.drawCards(3);
}
}
public class Spy extends DefaultCard implements AttackCard, DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@SuppressWarnings("unchecked")
@Override
public void playCard(Turn turn) {
turn.drawCards(1);
turn.addActions(1);
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn) turn;
List<Decision> decisions = ((ServerTurn) turn).doInteraction(this);
//Add in my own card!
decisions.add(new SingleCardDecision(st.revealTopCard()));
for(int i = 0; i < st.numPlayers(); i++) {
int playerNum = (st.playerNum() + i + 1)%st.numPlayers();
if(decisions.get(i) == null) continue; //this means they blocked the attack
Decision d = st.getDecision(this, new DecisionAndPlayerDecision(decisions.get(i), playerNum));
if(((EnumDecision<keepDiscard>)d).enumValue == keepDiscard.keep)
st.getTurn(playerNum).putCardOnTopOfDeck(((SingleCardDecision)decisions.get(i)).card);
else st.getTurn(playerNum).discardCardPublically(((SingleCardDecision)decisions.get(i)).card);
}
}
}
@Override
public Decision reactToCard(ServerTurn turn) {
// this is called on the opponents, but the opponent doesn't need to make any decisions
return new SingleCardDecision(turn.revealTopCard());
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum,
Decision decision, ClientTurn turn) {
// TODO Auto-generated method stub
}
@Override
public void createAndSendDecisionObject(DominionGUI gui,
Decision decision) {
DecisionAndPlayerDecision dapd = (DecisionAndPlayerDecision) decision;
String name = gui.getPlayerName(dapd.playerNum);
String pronoun = "his/her";
if(gui.getLocalPlayer() == dapd.playerNum) {
name = "You";
pronoun = "your";
}
gui.makeMultipleChoiceDecision("" + name + " revealed the following card. " +
"Do you want to put it back on " + pronoun + " deck (keep) or discard it (discard)?",
keepDiscard.class, ((SingleCardDecision)dapd.decision).card);
}
}
//fives
public class CouncilRoom extends DefaultCard implements InteractingCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
@Override
public void playCard(Turn turn) {
turn.drawCards(4);
turn.addBuys(1);
if(turn instanceof ServerTurn) ((ServerTurn) turn).doInteraction(this);
}
@Override
public Decision reactToCard(ServerTurn turn) {
turn.drawCards(1);
return null;
}
}
public class Festival extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
@Override
public void playCard(Turn turn) {
turn.addActions(2);
turn.addBuys(1);
turn.addBuyingPower(2);
}
}
public class Laboratory extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
@Override
public void playCard(Turn turn) {
turn.drawCards(2);
turn.addActions(1);
}
}
public class Library extends DefaultCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
// TODO: give error if not the right kind of decision?
@SuppressWarnings("unchecked")
@Override
public void playCard(Turn turn) {
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn) turn;
List<Card> setAside = new ArrayList<Card>();
while(st.inHand.size() < 7) {
Card c = st.lookAtTopCard(); // pops top card off deck
if(c == null) break; // all cards are in hand or set-aside list, no more to draw
if(c instanceof ActionCard) {
Decision d = ((ServerTurn) turn).getDecision(this, new SingleCardDecision(c));
if(((EnumDecision<keepDiscard>)d).enumValue == keepDiscard.discard) {
setAside.add(c);
continue;
}
}
st.putCardInHand(c);
}
for(Card c : setAside) st.discardCard(c);
}
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum,
Decision decision, ClientTurn turn) {
// Note: nothing to do here unless we add visuals for "set aside"
}
@Override
public void createAndSendDecisionObject(DominionGUI gui,
Decision decision) {
gui.makeMultipleChoiceDecision("Do you want to set aside this action (discard) or draw it into your hand (keep)?",
keepDiscard.class, ((SingleCardDecision)decision).card);
}
}
public class Market extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
@Override
public void playCard(Turn turn) {
turn.drawCards(1);
turn.addActions(1);
turn.addBuys(1);
turn.addBuyingPower(1);
}
}
public class Mine extends TreasureSelectionCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
@Override
public void playCard(Turn turn) {
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn)turn;
TrashThenGainDecision ttgd = new TrashThenGainDecision();
CardListDecision decision;
do {
decision = (CardListDecision) st.getDecision(this, ttgd);
// if you tried to trash some number other than 1, or it's not a treasure,
// request a new one, otherwise we move on to the gaining bit
} while(decision.list.size() != 1 || !(decision.list.get(0) instanceof TreasureCard)
|| !turn.inHand.contains(decision.list.get(0)));
TreasureCard toTrash = (TreasureCard) decision.list.get(0);
st.trashCardFromHand(toTrash);
st.sendDecisionToPlayer(this, new ListAndOptionsDecision(ttgd, decision));
ttgd = new TrashThenGainDecision(toTrash);
do {
decision = (CardListDecision) st.getDecision(this, ttgd);
// if you tried to gain some number other than 1, or it's not a treasure, or none are left
// request a new one, otherwise go ahead and gain it!
} while(decision.list.size() != 1 || !(decision.list.get(0) instanceof TreasureCard)
|| decision.list.get(0).getCost() > 3 + toTrash.getCost()
|| !st.gainCardToHand(decision.list.get(0)));
st.sendDecisionToPlayer(this, new ListAndOptionsDecision(ttgd, decision));
}
}
@Override
public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
TrashThenGainDecision dec = (TrashThenGainDecision) decision;
if(dec.whichDecision == WhichDecision.chooseTrash) {
gui.setupCardSelection(1, false, SelectionType.trash, this);
} else {
gui.setupGainCard(dec.toTrash.getCost() + 3, false, this);
}
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
ListAndOptionsDecision lod = (ListAndOptionsDecision) decision;
TrashThenGainDecision dec = lod.ttgd;
if(dec.whichDecision == WhichDecision.chooseTrash) {
gui.trashCardFromHand(playerNum, lod.cld.list.get(0));
} else {
gui.addCardToHand(playerNum, lod.cld.list.get(0));
}
}
}
public class Witch extends DefaultCard implements AttackCard {
private static final long serialVersionUID = 1L;
@Override
public Decision reactToCard(ServerTurn turn) {
turn.gainCurse();
return null;
}
@Override public void playCard(Turn turn) {
turn.drawCards(2);
if(turn instanceof ServerTurn) ((ServerTurn) turn).doInteraction(this);
}
@Override public int getCost() { return 5; }
}
public class Adventurer extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 6; }
@Override
public void playCard(Turn turn) {
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn)turn;
List<Card> revealedCards = new ArrayList<Card>();
List<Card> treasureToPickUp = new ArrayList<Card>();
// reveal cards one at a time until you get 2 treasures
while(treasureToPickUp.size()<2) {
Card c = st.revealTopCard();
if(c instanceof TreasureCard) {
treasureToPickUp.add(c);
// this sends a message to all the players
st.putCardInHand(c);
} else
revealedCards.add(c);
}
// now discard all the revealed cards
for(Card c : revealedCards)
st.discardCard(c);
}
}
}
//Intrigue
public class Courtyard extends DefaultCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 2; }
@Override
public void playCard(Turn turn) {
turn.drawCards(3);
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn)turn;
CardListDecision decision;
do {
decision = (CardListDecision) st.getDecision(this, null);
// if you tried to put back some number other than 1, or it's not in your hand
// request a new one, otherwise we're done
} while(decision.list.size() != 1 || !st.putOnDeckFromHand(decision.list.get(0)));
}
//wait for processing code to ask for discard
}
@Override
public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
gui.setupCardSelection(1, true, SelectionType.undraw, null);
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
//server will send message to make it happen
}
}
public class GreatHall extends DefaultCard implements ActionCard, VictoryCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 3; }
@Override
public void playCard(Turn turn) {
turn.drawCards(1);
turn.addActions(1);
}
@Override public int getVictoryPoints() { return 1; }
}
public class ShantyTown extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 3; }
@Override
public void playCard(Turn turn) {
turn.addActions(2);
if(!turn.actionsInHand()) {
turn.revealHand();
turn.drawCards(2);
}
}
}
public class Steward extends DefaultCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 3; }
// TODO: give error if not the right kind of decision?
@SuppressWarnings("unchecked")
@Override
public void playCard(Turn turn) {
if(turn instanceof ServerTurn) {
Decision d = ((ServerTurn) turn).getDecision(this, new EnumDecision<firstSecond>(firstSecond.first));
if(((EnumDecision<stewardDecision>)d).enumValue == stewardDecision.draw)
turn.drawCards(2);
else if(((EnumDecision<stewardDecision>)d).enumValue == stewardDecision.money)
turn.addBuyingPower(2);
else if(((EnumDecision<stewardDecision>)d).enumValue == stewardDecision.trash) {
CardListDecision decision;
do {
//request decision
decision = (CardListDecision) ((ServerTurn)turn).getDecision(this, new EnumDecision<firstSecond>(firstSecond.second));
//try using this decision, if it doesn't work, ask again
} while(decision.list.size() != 2 || !((ServerTurn)turn).trashCardsFromHand(decision, this));
// trashCardsFromHands sends a confirmation to the client
}
((ServerTurn)turn).sendDecisionToPlayer(this, d);
}
}
@SuppressWarnings("unchecked")
@Override
public void carryOutDecision(DominionGUI gui, int playerNum,
Decision decision, ClientTurn turn) {
if(decision instanceof CardListDecision)
gui.trashCardSelection(playerNum, (CardListDecision)decision);
else if(decision instanceof EnumDecision<?> && ((EnumDecision<?>)decision).enumValue instanceof stewardDecision){
if(((EnumDecision<stewardDecision>)decision).enumValue == stewardDecision.draw)
turn.drawCards(2);
else if(((EnumDecision<stewardDecision>)decision).enumValue == stewardDecision.money)
turn.addBuyingPower(2);
}
}
@SuppressWarnings("unchecked")
@Override
public void createAndSendDecisionObject(DominionGUI gui,
Decision decision) {
if(((EnumDecision<firstSecond>)decision).enumValue == firstSecond.first)
gui.makeMultipleChoiceDecision("Do you want to trash 2 cards, draw two cards, or gain 2 coin?", stewardDecision.class, null);
else
gui.setupCardSelection(2, true, SelectionType.trash, null);
}
}
public class Baron extends DefaultCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@SuppressWarnings("unchecked")
@Override
// TODO: perhaps make a setting that allows you to always discard the estate if you
// have one? Going strictly by the rules I have to ask, but as a player it's super
// annoying and I'd never play it to gain an estate when I have one I could discard.
public void playCard(Turn turn) {
turn.addBuys(1);
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn)turn;
if(st.containsCard(Card.victoryCards[0])) {
Decision d = null;
while(d == null || !(d instanceof EnumDecision<?>))
d = (EnumDecision<yesNo>) ((ServerTurn) turn).getDecision(this, null);
st.sendDecisionToPlayer(this, d); //auto
if(((EnumDecision<yesNo>)d).enumValue == yesNo.yes) {
st.discardCardFromHand(Card.victoryCards[0]);
st.addBuyingPower(4);
return;
}
}
st.gainCard(Card.victoryCards[0]);
}
}
@SuppressWarnings("unchecked")
@Override
public void carryOutDecision(DominionGUI gui, int playerNum,
Decision decision, ClientTurn turn) {
if(((EnumDecision<yesNo>)decision).enumValue == yesNo.yes) {
turn.discardCardFromHand(Card.victoryCards[0]);
turn.addBuyingPower(4);
}
// Note: if the answer was no, the server deals with gaining the estate
}
@Override
public void createAndSendDecisionObject(DominionGUI gui,
Decision decision) {
gui.makeMultipleChoiceDecision("Do you want to discard an Estate?", yesNo.class, null);
}
}
public class Conspirator extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@Override
public void playCard(Turn turn) {
turn.addBuyingPower(2);
if(turn.inPlay.size() > 2) {
turn.drawCards(1);
turn.addActions(1);
}
}
}
public class Coppersmith extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@Override
public void playCard(Turn turn) {
if(turn instanceof ServerTurn)
((ServerTurn) turn).addCoppersmith();
}
}
public class Ironworks extends SwitchByType implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@Override
public void playCard(Turn turn) {
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn)turn;
CardListDecision decision;
do {
decision = (CardListDecision) st.getDecision(this, null);
// if you tried to gain some number other than 1, it costs more than 4, or the one you wanted
// isn't in the supply, request a new one, otherwise we're done and we reap the benefits
} while(decision.list.size() != 1 || decision.list.get(0).getCost() > 4
|| !st.gainCard(decision.list.get(0)));
switchHelper(turn, decision, 1, 1);
st.sendDecisionToPlayer(this, decision);
}
}
@Override
public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
gui.setupGainCard(4, false, null);
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
/* server handles sending gain message, so don't worry about that bit here */
switchHelper(turn, decision, 1, 1);
}
}
public class MiningVillage extends DefaultCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@SuppressWarnings("unchecked")
@Override
public void playCard(Turn turn) {
turn.drawCards(1);
turn.addActions(2);
Decision d = null;
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn) turn;
while(d == null || !(d instanceof EnumDecision<?>))
d = (EnumDecision<yesNo>) ((ServerTurn) turn).getDecision(this, null);
st.sendDecisionToPlayer(this, d);
if(((EnumDecision<yesNo>)d).enumValue == yesNo.yes) {
st.trashCardFromPlay(this);
st.addBuyingPower(2);
}
}
}
@SuppressWarnings("unchecked")
@Override
public void carryOutDecision(DominionGUI gui, int playerNum,
Decision decision, ClientTurn turn) {
if(((EnumDecision<yesNo>)decision).enumValue == yesNo.yes) {
turn.trashCardFromPlay(this);
turn.addBuyingPower(2);
}
}
@Override
public void createAndSendDecisionObject(DominionGUI gui,
Decision decision) {
gui.makeMultipleChoiceDecision("Do you want to trash this card for 2 coin?", yesNo.class, null);
}
}
public class SeaHag extends DefaultCard implements AttackCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 4; }
@Override
public Decision reactToCard(ServerTurn turn) {
turn.discardCard(turn.revealTopCard());
turn.putCardOnTopOfDeck(Card.curse);
return null;
}
@Override public void playCard(Turn turn) {
if(turn instanceof ServerTurn) ((ServerTurn) turn).doInteraction(this);
}
}
public static class Duke extends DefaultCard implements ConditionalVictoryCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
@Override public int getVictoryPoints() { return 0; }
@Override
public int getVictoryPoints(Stack<Card> deck) {
int count = 0;
for(Card c : deck) {
if(c instanceof Duchy) count++;
}
return count;
}
}
public class Minion extends DefaultCard implements DecisionCard, AttackCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
@SuppressWarnings("unchecked")
@Override
public void playCard(Turn turn) {
turn.addActions(1);
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn) turn;
Decision d = st.getDecision(this, null);
if(((EnumDecision<minionDecision>)d).enumValue == minionDecision.money)
turn.addBuyingPower(2);
else if(((EnumDecision<minionDecision>)d).enumValue == minionDecision.redraw) {
st.discardHand();
st.drawCards(4);
st.doInteraction(this);
}
// note: not strictly necessary, since the buyingPower calculated
// on the client side is never used...
st.sendDecisionToPlayer(this, d);
}
}
@SuppressWarnings("unchecked")
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
if(((EnumDecision<minionDecision>)decision).enumValue == minionDecision.money)
turn.addBuyingPower(2);
}
@Override
public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
gui.makeMultipleChoiceDecision("Do you want 2 coin, or do you want to discard your hand and draw 4 new cards, attacking the other players?", minionDecision.class, null);
}
@Override
public Decision reactToCard(ServerTurn turn) {
if(turn.inHand.size() >= 5) {
turn.discardHand();
turn.drawCards(4);
}
return null;
}
}
public class Tribute extends SwitchByType implements InteractingCard, DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
@Override
public void playCard(Turn turn) {
if(turn instanceof ServerTurn) ((ServerTurn) turn).doInteraction(this);
}
@Override
public Decision reactToCard(ServerTurn turn) {
//if you are player to the left, send your top two cards
if((turn.currentPlayer() + 1)%turn.numPlayers() == turn.playerNum()) {
ArrayList<Card> list = new ArrayList<Card>();
for(int i = 0; i < 2; i++) list.add(turn.revealTopCard());
for(int i = 0; i < 2; i++) turn.discardCard(list.get(i));
CardListDecision cld = new CardListDecision(list);
//just do do it directly here, and send a decision confirmation to the current player
switchHelper(turn.currentTurn(), cld, 2, 2);
turn.currentTurn().sendDecisionToPlayer(this, cld);
}
//everyone else just ignores it
return null;
}
@Override
public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
// no decision needed from the GUI for this card
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
switchHelper(turn, decision, 2, 2);
}
}
public class Upgrade extends TreasureSelectionCard implements DecisionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
@Override
public void playCard(Turn turn) {
turn.drawCards(1);
turn.addActions(1);
if(turn instanceof ServerTurn) {
ServerTurn st = (ServerTurn)turn;
TrashThenGainDecision ttgd = new TrashThenGainDecision();
CardListDecision decision;
do {
decision = (CardListDecision) st.getDecision(this, ttgd);
// prompt til you get 1 card that is in the player's hand
} while(decision.list.size() != 1 || !turn.inHand.contains(decision.list.get(0)));
Card toTrash = decision.list.get(0);
st.trashCardFromHand(toTrash);
st.sendDecisionToPlayer(this, new ListAndOptionsDecision(ttgd, decision));
// if there are no cards costing exactly one more, we're done, nothing left to do
// TODO: maybe send a message telling the user there were no cards with that price
// to gain so they don't get anything?
if(!st.supplyContainsExactCost(toTrash.getCost() + 1)) return;
// otherwise, gain one!
ttgd = new TrashThenGainDecision(toTrash);
do {
decision = (CardListDecision) st.getDecision(this, ttgd);
// prompt til you get 1 card that's not too expensive and still available
} while(decision.list.size() != 1 || decision.list.get(0).getCost() != toTrash.getCost() + 1
|| !st.gainCard(decision.list.get(0)));
// the gain happens in the while condition
}
}
@Override
public void createAndSendDecisionObject(DominionGUI gui, Decision decision) {
TrashThenGainDecision dec = (TrashThenGainDecision) decision;
if(dec.whichDecision == WhichDecision.chooseTrash) {
gui.setupCardSelection(1, true, SelectionType.trash, null);
} else {
gui.setupGainCard(dec.toTrash.getCost() + 1, true, this);
}
}
@Override
public void carryOutDecision(DominionGUI gui, int playerNum, Decision decision, ClientTurn turn) {
ListAndOptionsDecision lod = (ListAndOptionsDecision) decision;
TrashThenGainDecision dec = lod.ttgd;
if(dec.whichDecision == WhichDecision.chooseTrash) {
gui.trashCardFromHand(playerNum, lod.cld.list.get(0));
} else {
// we don't actually get a message for this
}
}
}
public class Harem extends DefaultCard implements VictoryCard, TreasureCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 6; }
@Override public int getVictoryPoints() { return 2; }
@Override public int getValue() { return 2; }
}
//Seaside
public class Bazaar extends DefaultCard implements ActionCard {
private static final long serialVersionUID = 1L;
@Override public int getCost() { return 5; }
@Override
public void playCard(Turn turn) {
turn.drawCards(1);
turn.addActions(2);
turn.addBuyingPower(1);
}
}
}
| barakmich/Dominion | src/dominion/card/Card.java |
248,956 | package festival;
import java.util.Scanner;
public class Menu {
static Scanner in = null;
public static void main(String[] args) {
try {
App.initFestival();
App.initGrupos();
} catch (Exception e) {
System.out.print(e.getMessage());
}
showFestival();
in = new Scanner(System.in);
int opcion = -1;
do {
printMenu();
opcion = in.nextInt();
in.nextLine();
switch (opcion) {
case 1:
imprimirGruposFiltrados("Pop", 6000, 10000);
break;
case 2:
imprimirGrupoMasCaro("Electronica");
break;
case 3:
borrarGrupo(in);
break;
case 4:
actualizarCache(in);
break;
default:
break;
}
} while (opcion != 0);
}
public static void showFestival() {
System.out.println(App.getFestival());
}
public static void printMenu() {
System.out.println("-----------------Menu----------------");
System.out.println("1. Imprimir grupos de pop con un presupuesto entre 6000€ y 10,000€");
System.out.println("2. Imprimir el grupo más caro de electrónica");
System.out.println("3. Eliminar un grupo");
System.out.println("4. Actualizar el caché de un grupo");
System.out.println("0. Salir");
System.out.println("-------------------------------------");
System.out.println("Elige una opción:");
}
public static void actualizarCache(Scanner in) {
System.out.println("--------------Grupos-----------------");
App.getGrupos().forEach(g -> {
System.out.println(g);
});
System.out.println("-------------------------------------");
System.out.println("Elige un grupo escribiendo su nombre:");
String nombre = in.nextLine();
try {
if (!App.hasGrupo(nombre)) {
System.out.println("El grupo no existe");
return;
}
} catch (Exception e) {
System.out.println("Error al buscar el grupo");
return;
}
System.out.println("Cual es el nuevo caché?");
int cache = in.nextInt();
in.nextLine();
try {
App.actualizarCache(nombre, cache);
} catch (Exception e) {
System.out.println("Error al actualizar el caché");
return;
}
System.out.println("Caché actualizado");
}
public static void borrarGrupo(Scanner in) {
System.out.println("--------------Grupos-----------------");
App.getGrupos().forEach(g -> {
System.out.println(g);
});
System.out.println("-------------------------------------");
System.out.println("Elige un grupo escribiendo su nombre:");
String nombre = in.nextLine();
try {
if (!App.hasGrupo(nombre)) {
System.out.println("El grupo no existe");
return;
}
} catch (Exception e) {
System.out.println("Error al buscar el grupo");
return;
}
try {
App.deleteGrupo(nombre);
} catch (Exception e) {
System.out.println("Error al eliminar el grupo" + e.getMessage());
return;
}
System.out.println("Grupo eliminado");
}
public static void imprimirGrupoMasCaro(String tipo) {
System.out.println("-----------Grupo más caro------------");
System.out.println(App.getGrupoMasCaro(tipo));
System.out.println("-------------------------------------");
}
public static void imprimirGruposFiltrados(String tipo, int minPresupuesto, int maxPresupuesto) {
System.out.println("----------Grupos Filtrados-----------");
App.getGruposFiltered(tipo, minPresupuesto, maxPresupuesto).forEach(System.out::println);
System.out.println("-------------------------------------");
}
}
| OscarCarPu/PROG_Daw1 | Examenes/Ev3/festival/Menu.java |
248,957 | package us.lsi.pd.festival;
public class Grupo{
private Integer codigo;
private String nombre;
private Integer votos;
private Double precio;
private String dia;
private String hora;
private boolean cerca;
private boolean nuevo;
private Grupo(Integer codigo, String nombre, Integer votos, Double precio,
String dia, String hora, boolean cerca, boolean nuevo) {
super();
this.codigo = codigo;
this.nombre = nombre;
this.votos = votos;
this.precio = precio;
this.dia = dia;
this.hora = hora;
this.cerca = cerca;
this.nuevo = nuevo;
}
private Grupo(int codigo, String[] fm) {
super();
this.codigo = codigo;
this.nombre = fm[0];
this.votos = new Integer(fm[1]);
this.precio = new Double(fm[2]);
this.dia = fm[3];
this.hora = fm[4];
this.cerca = new Boolean(fm[5]);
this.nuevo = new Boolean(fm[6]);
}
public static Grupo create(Integer codigo, String nombre, Integer votos, Double precio,
String dia, String hora, boolean cerca, boolean nuevo) {
return new Grupo(codigo, nombre, votos, precio, dia, hora, cerca, nuevo);
}
public static Grupo create(int codigo, String[] fm) {
return new Grupo(codigo, fm);
}
public Integer getCodigo() {
return codigo;
}
public String getNombre() {
return nombre;
}
public Integer getVotos() {
return votos;
}
public Double getPrecio() {
return precio;
}
public String getDia() {
return dia;
}
public String getHora() {
return hora;
}
public boolean esCerca() {
return cerca;
}
public boolean esNuevo() {
return nuevo;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((codigo == null) ? 0 : codigo.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Grupo other = (Grupo) obj;
if (codigo == null) {
if (other.codigo != null)
return false;
} else if (!codigo.equals(other.codigo))
return false;
return true;
}
@Override
public String toString() {
return nombre;
}
}
| migueltoro/apuntesjava | SoftwareDelLibro/src/us/lsi/pd/festival/Grupo.java |
248,958 | 404: Not Found | naguilar12/FestivAndes | src/vos/Cliente.java |
248,959 | package cn.damai.trade;
/* compiled from: Taobao */
/* loaded from: classes16.dex */
public final class R$raw {
public static final int aes = 2131755008;
public static final int anim_first_like = 2131755009;
public static final int artist_city_want = 2131755010;
public static final int artist_city_want_cancel = 2131755011;
public static final int artist_component_config = 2131755012;
public static final int beep = 2131755013;
public static final int bottom_tip_heart_pop = 2131755014;
public static final int bricks_circle_allround = 2131755015;
public static final int bricks_uikit_loading_color = 2131755016;
public static final int components = 2131755017;
public static final int damai = 2131755018;
public static final int damaicn = 2131755020;
public static final int default_tab_category_normal2selected = 2131755024;
public static final int default_tab_category_selected2normal = 2131755025;
public static final int default_tab_find_normal2selected = 2131755026;
public static final int default_tab_find_selected2normal = 2131755027;
public static final int default_tab_home_normal2selected = 2131755028;
public static final int default_tab_home_selected2normal = 2131755029;
public static final int default_tab_home_selected2top = 2131755030;
public static final int default_tab_home_top2normal = 2131755031;
public static final int default_tab_home_top2selected = 2131755032;
public static final int default_tab_mine_normal2selected = 2131755033;
public static final int default_tab_mine_selected2normal = 2131755034;
public static final int default_tab_ticklet_normal2selected = 2131755035;
public static final int default_tab_ticklet_selected2normal = 2131755036;
public static final int dicovery_cid_home_head_banner = 2131755037;
public static final int dicovery_cid_home_head_pic = 2131755038;
public static final int dm_artist_fans_ranking = 2131755039;
public static final int dm_artist_group_relate = 2131755040;
public static final int dm_artist_main_official_content = 2131755041;
public static final int dm_artist_main_yuehua_content = 2131755042;
public static final int dm_artist_shop_item = 2131755043;
public static final int dm_artist_tour_info = 2131755044;
public static final int dm_artist_vip_buy_show = 2131755045;
public static final int dm_artists_head_default = 2131755046;
public static final int dm_artists_head_special = 2131755047;
public static final int dm_artists_head_update = 2131755048;
public static final int dm_banner_row1_girl = 2131755049;
public static final int dm_banner_videoheader_ip = 2131755050;
public static final int dm_banner_with_title = 2131755051;
public static final int dm_base_content_free = 2131755052;
public static final int dm_base_content_free_test = 2131755053;
public static final int dm_base_content_vip = 2131755054;
public static final int dm_base_tab = 2131755055;
public static final int dm_brand_head_video = 2131755056;
public static final int dm_brand_ip_artist = 2131755057;
public static final int dm_brand_new_content = 2131755058;
public static final int dm_card_actoralbum = 2131755059;
public static final int dm_card_category_title = 2131755060;
public static final int dm_card_common_title = 2131755061;
public static final int dm_card_drama_calendar_horizontal = 2131755062;
public static final int dm_card_expandtext = 2131755063;
public static final int dm_card_ip_bottombar = 2131755064;
public static final int dm_card_ip_brand = 2131755065;
public static final int dm_card_ip_info = 2131755066;
public static final int dm_card_ip_videoalbum = 2131755067;
public static final int dm_card_productcell = 2131755068;
public static final int dm_card_project_horizontal = 2131755069;
public static final int dm_card_ranklist_horizontal = 2131755070;
public static final int dm_clique_head = 2131755071;
public static final int dm_common_loop_banner = 2131755072;
public static final int dm_common_loop_banner_with_size = 2131755073;
public static final int dm_discover_head_banner = 2131755074;
public static final int dm_discover_head_fixed_3 = 2131755075;
public static final int dm_discover_hot_clique = 2131755076;
public static final int dm_discover_hot_theme = 2131755077;
public static final int dm_drama_calendar_vertical = 2131755078;
public static final int dm_drama_list_worth_to_see = 2131755079;
public static final int dm_feed_big_note = 2131755080;
public static final int dm_feed_big_theme = 2131755081;
public static final int dm_feed_big_vote = 2131755082;
public static final int dm_feed_discuss = 2131755083;
public static final int dm_feed_note = 2131755084;
public static final int dm_feed_project = 2131755085;
public static final int dm_feed_theme = 2131755086;
public static final int dm_feed_vote = 2131755087;
public static final int dm_floating_anchor_point_bar = 2131755088;
public static final int dm_header_video = 2131755089;
public static final int dm_home_banner = 2131755090;
public static final int dm_home_mustseerank3 = 2131755091;
public static final int dm_home_recentproject = 2131755092;
public static final int dm_home_tour = 2131755093;
public static final int dm_home_video = 2131755094;
public static final int dm_home_wantsee = 2131755095;
public static final int dm_home_warningmessage = 2131755096;
public static final int dm_home_weinituijian_title = 2131755097;
public static final int dm_list_card_ranking = 2131755098;
public static final int dm_livehouse_artist_list = 2131755099;
public static final int dm_music_festival_map_view = 2131755100;
public static final int dm_music_ip_tour_info = 2131755101;
public static final int dm_no_tour_project = 2131755102;
public static final int dm_official_content_feed = 2131755103;
public static final int dm_player_plugins_small = 2131755104;
public static final int dm_productcard_row2column3_girl = 2131755105;
public static final int dm_project_broadcast_horizontal_list = 2131755106;
public static final int dm_project_filter_option = 2131755107;
public static final int dm_project_filter_panel = 2131755108;
public static final int dm_rank_square_empty_view = 2131755109;
public static final int dm_rank_square_filter_view = 2131755110;
public static final int dm_rank_square_project_vertical_list_item = 2131755111;
public static final int dm_rank_square_rank_header_list = 2131755112;
public static final int dm_red_book_water_fall_feed_plugin = 2131755113;
public static final int dm_tour_project_more = 2131755115;
public static final int dm_view_commonerror = 2131755116;
public static final int for_shaders = 2131755117;
public static final int keep = 2131755121;
public static final int live_perform_announce = 2131755122;
public static final int live_perform_online_star = 2131755123;
public static final int lottie_artist_header = 2131755124;
public static final int lottie_dian_zan = 2131755125;
public static final int lottie_dian_zan_dismiss = 2131755126;
public static final int lottie_favorite_cancel = 2131755127;
public static final int lottie_favorite_guide = 2131755128;
public static final int lottie_favourite_click = 2131755129;
public static final int lottie_homepage_issue_star = 2131755130;
public static final int lottie_issue_star = 2131755131;
public static final int lottie_live_sound_wave = 2131755132;
public static final int lottie_live_sound_wave_grey = 2131755133;
public static final int lottie_liwu = 2131755134;
public static final int lottie_red_sound_wave = 2131755135;
public static final int lottie_yinlang = 2131755136;
public static final int lucky = 2131755137;
public static final int new_channel_component_config = 2131755140;
public static final int qrcode_completed = 2131755141;
public static final int rp_face_blink = 2131755142;
public static final int rp_face_ding = 2131755143;
public static final int rp_face_open_mouth = 2131755144;
public static final int rp_face_pitch_up = 2131755145;
public static final int rp_face_yaw_left_right = 2131755146;
public static final int script_murder_coupon_detail_component_config = 2131755147;
public static final int script_murder_script_detail_component_config = 2131755148;
public static final int script_murder_shop_detail_component_config = 2131755149;
public static final int script_murder_venue_detail_component_config = 2131755150;
public static final int shaders = 2131755153;
public static final int shortvideo_black_loading = 2131755154;
public static final int toast_lottie_peach_heart = 2131755168;
public static final int toast_success = 2131755169;
public static final int token = 2131755170;
public static final int trade_normal_strategy = 2131755172;
public static final int trade_prompt_strategy = 2131755173;
public static final int trade_prompt_strategy_add = 2131755174;
public static final int uikit_loading_color = 2131755175;
public static final int uikit_loading_white = 2131755176;
public static final int universally_component_config = 2131755177;
public static final int want_see_bottom_tip_heart_pop = 2131755178;
public static final int want_see_bottom_tips_big_heart_pop = 2131755179;
private R$raw() {
}
}
| F11st/damai_decompiled | sources/cn/damai/trade/R$raw.java |
248,960 | package cn.damai.ultron;
/* compiled from: Taobao */
/* loaded from: classes17.dex */
public final class R$raw {
public static final int aes = 2131755008;
public static final int anim_first_like = 2131755009;
public static final int artist_city_want = 2131755010;
public static final int artist_city_want_cancel = 2131755011;
public static final int artist_component_config = 2131755012;
public static final int beep = 2131755013;
public static final int bottom_tip_heart_pop = 2131755014;
public static final int bricks_circle_allround = 2131755015;
public static final int bricks_uikit_loading_color = 2131755016;
public static final int components = 2131755017;
public static final int default_tab_category_normal2selected = 2131755024;
public static final int default_tab_category_selected2normal = 2131755025;
public static final int default_tab_find_normal2selected = 2131755026;
public static final int default_tab_find_selected2normal = 2131755027;
public static final int default_tab_home_normal2selected = 2131755028;
public static final int default_tab_home_selected2normal = 2131755029;
public static final int default_tab_home_selected2top = 2131755030;
public static final int default_tab_home_top2normal = 2131755031;
public static final int default_tab_home_top2selected = 2131755032;
public static final int default_tab_mine_normal2selected = 2131755033;
public static final int default_tab_mine_selected2normal = 2131755034;
public static final int default_tab_ticklet_normal2selected = 2131755035;
public static final int default_tab_ticklet_selected2normal = 2131755036;
public static final int dicovery_cid_home_head_banner = 2131755037;
public static final int dicovery_cid_home_head_pic = 2131755038;
public static final int dm_artist_fans_ranking = 2131755039;
public static final int dm_artist_group_relate = 2131755040;
public static final int dm_artist_main_official_content = 2131755041;
public static final int dm_artist_main_yuehua_content = 2131755042;
public static final int dm_artist_shop_item = 2131755043;
public static final int dm_artist_tour_info = 2131755044;
public static final int dm_artist_vip_buy_show = 2131755045;
public static final int dm_artists_head_default = 2131755046;
public static final int dm_artists_head_special = 2131755047;
public static final int dm_artists_head_update = 2131755048;
public static final int dm_banner_row1_girl = 2131755049;
public static final int dm_banner_videoheader_ip = 2131755050;
public static final int dm_banner_with_title = 2131755051;
public static final int dm_base_content_free = 2131755052;
public static final int dm_base_content_free_test = 2131755053;
public static final int dm_base_content_vip = 2131755054;
public static final int dm_base_tab = 2131755055;
public static final int dm_brand_head_video = 2131755056;
public static final int dm_brand_ip_artist = 2131755057;
public static final int dm_brand_new_content = 2131755058;
public static final int dm_card_actoralbum = 2131755059;
public static final int dm_card_category_title = 2131755060;
public static final int dm_card_common_title = 2131755061;
public static final int dm_card_drama_calendar_horizontal = 2131755062;
public static final int dm_card_expandtext = 2131755063;
public static final int dm_card_ip_bottombar = 2131755064;
public static final int dm_card_ip_brand = 2131755065;
public static final int dm_card_ip_info = 2131755066;
public static final int dm_card_ip_videoalbum = 2131755067;
public static final int dm_card_productcell = 2131755068;
public static final int dm_card_project_horizontal = 2131755069;
public static final int dm_card_ranklist_horizontal = 2131755070;
public static final int dm_clique_head = 2131755071;
public static final int dm_common_loop_banner = 2131755072;
public static final int dm_common_loop_banner_with_size = 2131755073;
public static final int dm_discover_head_banner = 2131755074;
public static final int dm_discover_head_fixed_3 = 2131755075;
public static final int dm_discover_hot_clique = 2131755076;
public static final int dm_discover_hot_theme = 2131755077;
public static final int dm_drama_calendar_vertical = 2131755078;
public static final int dm_drama_list_worth_to_see = 2131755079;
public static final int dm_feed_big_note = 2131755080;
public static final int dm_feed_big_theme = 2131755081;
public static final int dm_feed_big_vote = 2131755082;
public static final int dm_feed_discuss = 2131755083;
public static final int dm_feed_note = 2131755084;
public static final int dm_feed_project = 2131755085;
public static final int dm_feed_theme = 2131755086;
public static final int dm_feed_vote = 2131755087;
public static final int dm_floating_anchor_point_bar = 2131755088;
public static final int dm_header_video = 2131755089;
public static final int dm_home_banner = 2131755090;
public static final int dm_home_mustseerank3 = 2131755091;
public static final int dm_home_recentproject = 2131755092;
public static final int dm_home_tour = 2131755093;
public static final int dm_home_video = 2131755094;
public static final int dm_home_wantsee = 2131755095;
public static final int dm_home_warningmessage = 2131755096;
public static final int dm_home_weinituijian_title = 2131755097;
public static final int dm_list_card_ranking = 2131755098;
public static final int dm_livehouse_artist_list = 2131755099;
public static final int dm_music_festival_map_view = 2131755100;
public static final int dm_music_ip_tour_info = 2131755101;
public static final int dm_no_tour_project = 2131755102;
public static final int dm_official_content_feed = 2131755103;
public static final int dm_player_plugins_small = 2131755104;
public static final int dm_productcard_row2column3_girl = 2131755105;
public static final int dm_project_broadcast_horizontal_list = 2131755106;
public static final int dm_project_filter_option = 2131755107;
public static final int dm_project_filter_panel = 2131755108;
public static final int dm_rank_square_empty_view = 2131755109;
public static final int dm_rank_square_filter_view = 2131755110;
public static final int dm_rank_square_project_vertical_list_item = 2131755111;
public static final int dm_rank_square_rank_header_list = 2131755112;
public static final int dm_red_book_water_fall_feed_plugin = 2131755113;
public static final int dm_tour_project_more = 2131755115;
public static final int dm_view_commonerror = 2131755116;
public static final int for_shaders = 2131755117;
public static final int keep = 2131755121;
public static final int live_perform_announce = 2131755122;
public static final int live_perform_online_star = 2131755123;
public static final int lottie_artist_header = 2131755124;
public static final int lottie_dian_zan = 2131755125;
public static final int lottie_dian_zan_dismiss = 2131755126;
public static final int lottie_favorite_cancel = 2131755127;
public static final int lottie_favorite_guide = 2131755128;
public static final int lottie_favourite_click = 2131755129;
public static final int lottie_homepage_issue_star = 2131755130;
public static final int lottie_issue_star = 2131755131;
public static final int lottie_live_sound_wave = 2131755132;
public static final int lottie_live_sound_wave_grey = 2131755133;
public static final int lottie_liwu = 2131755134;
public static final int lottie_red_sound_wave = 2131755135;
public static final int lottie_yinlang = 2131755136;
public static final int lucky = 2131755137;
public static final int new_channel_component_config = 2131755140;
public static final int qrcode_completed = 2131755141;
public static final int rp_face_blink = 2131755142;
public static final int rp_face_ding = 2131755143;
public static final int rp_face_open_mouth = 2131755144;
public static final int rp_face_pitch_up = 2131755145;
public static final int rp_face_yaw_left_right = 2131755146;
public static final int script_murder_coupon_detail_component_config = 2131755147;
public static final int script_murder_script_detail_component_config = 2131755148;
public static final int script_murder_shop_detail_component_config = 2131755149;
public static final int script_murder_venue_detail_component_config = 2131755150;
public static final int shaders = 2131755153;
public static final int shortvideo_black_loading = 2131755154;
public static final int toast_lottie_peach_heart = 2131755168;
public static final int toast_success = 2131755169;
public static final int token = 2131755170;
public static final int uikit_loading_color = 2131755175;
public static final int uikit_loading_white = 2131755176;
public static final int universally_component_config = 2131755177;
public static final int want_see_bottom_tip_heart_pop = 2131755178;
public static final int want_see_bottom_tips_big_heart_pop = 2131755179;
private R$raw() {
}
}
| F11st/damai_decompiled | sources/cn/damai/ultron/R$raw.java |
248,961 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
public class P6_LanternFestival {
public static int[] lanternFestival(int n, int[][] prefs) {
Lantern[] lanterns = new Lantern[n];
for (int i = 0; i < n; i++) {
lanterns[i] = new Lantern(i, null);
}
for (int i = 0; i < prefs.length; i++) {
int top = prefs[i][0];
int bottom = prefs[i][1];
boolean successfulChild = lanterns[top].addChild(lanterns[bottom]);
if(!successfulChild) {
return new int[] {-1};
}
boolean successfulParent = lanterns[bottom].addParent(lanterns[top]);
if(!successfulParent) {
return new int[] {-1};
}
}
PriorityQueue<IndependentLantern> independentLanterns = new PriorityQueue<>();
for (int i = 0; i < n; i++) {
Lantern current = lanterns[i];
if(current.parent == null) {
//is independent
IndependentLantern newInd = new IndependentLantern(current);
newInd.createNeedyChildren();
independentLanterns.add(newInd);
}
}
IndependentLantern first = independentLanterns.poll();
Lantern head = first.head;
if (!first.fillNeedy(independentLanterns)) return new int[] {-1};
return head.output(n);
}
static class IndependentLantern implements Comparable<IndependentLantern> {
public Lantern head;
public List<Lantern> needyChildren;
public IndependentLantern(Lantern h) {
head = h;
needyChildren = new ArrayList<>();
}
public void createNeedyChildren() {
recurChildren(head, needyChildren);
}
private static void recurChildren(Lantern head, List<Lantern> needy) {
if(!head.isValid()) {
needy.add(head);
}
for (Lantern child : head.children) {
recurChildren(child, needy);
}
}
public boolean fillNeedy(PriorityQueue<IndependentLantern> availableLanterns) {
for (Lantern l : needyChildren) {
if(availableLanterns.isEmpty()) {
return false;
}
IndependentLantern next = availableLanterns.poll();
l.addChild(next.head);
if(!next.fillNeedy(availableLanterns)) return false;
}
return true;
}
@Override
public int compareTo(IndependentLantern o) {
return o.needyChildren.size() - needyChildren.size();
}
}
static class Lantern implements Comparable<Lantern>{
public int number;
public Lantern parent;
public TreeSet<Lantern> children;
public Lantern(int n, Lantern p) {
number = n;
parent = p;
children = new TreeSet<>();
}
public int[] output(int n){
Queue<Lantern> q = new LinkedList<>();
q.add(this);
int[] out = new int[n];
int i = 0;
while(!q.isEmpty()) {
Lantern cur = q.poll();
out[i] = cur.number;
i++;
q.addAll(cur.children);
}
return out;
}
public boolean addChild(Lantern child) {
if(children.size() == 2) return false;
//check all children
if (!checkParentForChild(child)) return false;
children.add(child);
return true;
}
public boolean checkParentForChild(Lantern c) {
if(parent == null) return true;
if(parent.equals(c)) return false;
return parent.checkParentForChild(c);
}
public boolean addParent(Lantern p) {
if(parent != null) return false;
//check all children
if (!checkChildrenForParent(p)) return false;
parent = p;
return true;
}
public boolean checkChildrenForParent(Lantern p) {
for(Lantern child : children) {
if(child.equals(p)) return false;
if(child.checkChildrenForParent(p)) return false;
}
return true;
}
public boolean isValid() {
return children.size() == 2 || children.size() == 0;
}
@Override
public int compareTo(Lantern o) {
return number - o.number;
}
public boolean equals(Lantern o) {
return compareTo(o) == 0;
}
}
// Do not modify below this line
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.valueOf(reader.readLine());
for (int i = 0; i < t; i++) {
String inputNodes = reader.readLine();
int n = Integer.valueOf(inputNodes);
String edgeNum = reader.readLine();
int k = Integer.valueOf(edgeNum);
int[][] prefs = new int[k][2];
for (int z = 0; z < k; z++) {
String inputEdges = reader.readLine();
String[] inputE = inputEdges.split(" ");
prefs[z][0] = Integer.valueOf(inputE[0]);
prefs[z][1] = Integer.valueOf(inputE[1]);
}
int [] output = lanternFestival(n, prefs);
for (Integer e: output) {
System.out.println(e);
}
}
}
} | skiwee45/AlgorithmicProgramming | src/P6_LanternFestival.java |
248,962 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
/**
* acmicpc.BJ_9205_맥주 마시면서 걸어가기
* 1sec, 128MB
* author djunnni
*
* 풀이법 : BFS
*/
public class Main2 {
static boolean success;
static short home[], festival[], PER_BEER_IN_BOX = 20, n;
static short[][] combinis;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// 테스트케이스
int TC = Integer.parseInt(br.readLine());
for (int tc = 1; tc <= TC; tc++) {
// 편의점의 개수 n (0<= n <= 100)
n = Short.parseShort(br.readLine());
StringTokenizer st = null;
// 편의점 리스트
combinis = new short[n][];
// 상근이네
st = new StringTokenizer(br.readLine(), " ");
home = new short[] {
Short.parseShort(st.nextToken()),
Short.parseShort(st.nextToken())
};
// 편의점
for (int i = 0; i < n; i++) {
st = new StringTokenizer(br.readLine(), " ");
combinis[i] = (new short[] {
Short.parseShort(st.nextToken()),
Short.parseShort(st.nextToken())
});
}
st = new StringTokenizer(br.readLine(), " ");
festival = new short[] {
Short.parseShort(st.nextToken()),
Short.parseShort(st.nextToken())
};
success = false; // 현재: 도착 못한 상태
/**
* 문제 풀이방식
* 중간에 어디를 들리든지간 락페스티벌에 도착할 수 있는지 <= 목표
* 상근이집 거리 ~ (편의점: 맥주리필) ~ 페스티벌
*/
goToFestival();
System.out.println(success ? "happy" : "sad");
}
}
static void goToFestival() {
Queue<int[]> queue = new ArrayDeque<>();
queue.add(new int[] { home[0], home[1] });
boolean visited[] = new boolean[n];
while (!queue.isEmpty()) {
int[] point = queue.poll();
int festivalDistance = getDistance(point[0], point[1], festival[0], festival[1]);
// 현재갈수있는 거리로 fesitval까지 충분히 도달할 수 있다면 break;
if (1000 >= festivalDistance) {
success = true;
break;
} else {
for (int i = 0; i < n; i++) {
if (visited[i])
continue;
short[] combini = combinis[i];
int meToFestivalDis = getDistance(point[0], point[1], combini[0], combini[1]);
if (1000 >= meToFestivalDis) {
visited[i] = true;
queue.add(new int[] { combini[0], combini[1] });
}
}
}
}
}
static int getDistance(int r, int c, int r2, int c2) {
return Math.abs(r2 - r) + Math.abs(c2 - c);
}
}
| Djunnni/Algorithm | 백준/9205/Main2.java |
248,963 | package app;
public class EpasseFestival {
private double SaldoPagamento;
private String NomeEvento;
//getters and seters
public double getSaldoPagamento() {
return SaldoPagamento;
}
public void setSaldoPagamento(double saldoPagamento) {
SaldoPagamento = saldoPagamento;
}
public String getNomeEvento() {
return NomeEvento;
}
public void setNomeEvento(String nomeEvento) {
NomeEvento = nomeEvento;
}
public EpasseFestival(double saldoPagamento, String nomeEvento) {
SaldoPagamento = saldoPagamento;
NomeEvento = nomeEvento;
}
public EpasseFestival(String nomeEvento) {
NomeEvento = nomeEvento;
}
public EpasseFestival(EpasseFestival outro)
{
this.NomeEvento=outro.NomeEvento;
this.SaldoPagamento=outro.SaldoPagamento;
}
}
| JoelsonSpinola/TP2 | src/app/EpasseFestival.java |
248,964 | package net.sf.l2j;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigInteger;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import javolution.util.FastList;
import javolution.util.FastMap;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.events.AutomatedTvT;
import net.sf.l2j.gameserver.util.FloodProtectorConfig;
import net.sf.l2j.gameserver.util.StringUtil;
import net.sf.l2j.util.L2Properties;
public final class Config
{
protected static final Logger _log = Logger.getLogger(Config.class.getName());
// --------------------------------------------------
// L2J Property File Definitions
// --------------------------------------------------
public static final String CHARACTER_CONFIG_FILE = "./config/Character.properties";
public static final String EXTENSIONS_CONFIG_FILE = "./config/extensions.properties";
public static final String FEATURE_CONFIG_FILE = "./config/Feature.properties";
public static final String FORTSIEGE_CONFIGURATION_FILE = "./config/fortsiege.properties";
public static final String GENERAL_CONFIG_FILE = "./config/General.properties";
public static final String HEXID_FILE = "./config/hexid.txt";
public static final String ID_CONFIG_FILE = "./config/idfactory.properties";
public static final String SERVER_VERSION_FILE = "./config/l2j-version.properties";
public static final String DATAPACK_VERSION_FILE = "./config/l2jdp-version.properties";
public static final String L2JMOD_CONFIG_FILE = "./config/l2jmods.properties";
public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
public static final String NPC_CONFIG_FILE = "./config/NPC.properties";
public static final String PVP_CONFIG_FILE = "./config/pvp.properties";
public static final String RATES_CONFIG_FILE = "./config/rates.properties";
public static final String CONFIGURATION_FILE = "./config/server.properties";
public static final String SIEGE_CONFIGURATION_FILE = "./config/siege.properties";
public static final String TELNET_FILE = "./config/telnet.properties";
public static final String FLOOD_PROTECTOR_FILE = "./config/floodprotector.properties";
public static final String MMO_CONFIG_FILE = "./config/mmo.properties";
public static final String EVENTS_CONFIG_FILE = "./config/events.properties";
public static final String AUTO_EVENTS_CONFIG_FILE = "./config/events_auto.properties";
public static final String RAIDBOSS_DROP_CHANCES_FILE = "./config/raids.properties";
public static final String LUNA = "./config/Luna.properties";
private static final String DONATION_CONFIG_FILE = "./config/Donation.ini";
public static final String SMART_CB = "./config/SmartCB.properties";
public static final String CHILL_FILE = "./config/chill.properties";
public static final String NPCBUFFER_CONFIG_FILE = "./config/npcbuffer.ini";
public static final String INSTANCES_FILE = "./config/instances.ini";
// --------------------------------------------------
// Chill settings
// --------------------------------------------------
/** Auto Chill */
public static int CHILL_SLEEP_TICKS;
public static int DAILY_CREDIT;
public static int EVENT_CREDIT;
public static int INERTIA_RT;
public static int LAG_NEW_TARGET;
public static int LAG_DIE_TARGET;
public static int LAG_KIL_TARGET;
public static int LAG_ASI_TARGET;
public static int FOLLOW_INIT_RANGE;
public static int RANGE_CLOSE;
public static int RANGE_NEAR;
public static int RANGE_FAR;
public static String DAILY_CREDIT_TIME;
// Smart Community Board Definitions
// --------------------------------------------------
public static int TOP_PLAYER_ROW_HEIGHT;
public static int TOP_PLAYER_RESULTS;
public static int RAID_LIST_ROW_HEIGHT;
public static int RAID_LIST_RESULTS;
public static boolean RAID_LIST_SORT_ASC;
public static boolean ALLOW_REAL_ONLINE_STATS;
// --------------------------------------------------
public static final int AURAFANG = 81101;
public static final int RAYBLADE = 81102;
public static final int WAVEBRAND = 81108;
// --------------------------------------------------
// L2J Variable Definitions
// --------------------------------------------------
public static int MASTERACCESS_LEVEL;
public static int MASTERACCESS_NAME_COLOR;
public static int MASTERACCESS_TITLE_COLOR;
public static boolean ALT_GAME_DELEVEL;
public static double ALT_WEIGHT_LIMIT;
public static int RUN_SPD_BOOST;
public static int DEATH_PENALTY_CHANCE;
public static double RESPAWN_RESTORE_CP;
public static double RESPAWN_RESTORE_HP;
public static double RESPAWN_RESTORE_MP;
public static boolean ALT_GAME_TIREDNESS;
public static boolean ENABLE_MODIFY_SKILL_DURATION;
public static Map<Integer, Integer> SKILL_DURATION_LIST;
public static boolean ENABLE_MODIFY_SKILL_REUSE;
public static Map<Integer, Integer> SKILL_REUSE_LIST;
public static boolean AUTO_LEARN_SKILLS;
public static boolean AUTO_LOOT_HERBS;
public static byte BUFFS_MAX_AMOUNT;
public static boolean AUTO_LEARN_DIVINE_INSPIRATION;
public static boolean ALT_GAME_CANCEL_BOW;
public static boolean ALT_GAME_CANCEL_CAST;
public static boolean EFFECT_CANCELING;
public static boolean ALT_GAME_MAGICFAILURES;
public static int PLAYER_FAKEDEATH_UP_PROTECTION;
public static boolean STORE_SKILL_COOLTIME;
public static boolean SUBCLASS_STORE_SKILL_COOLTIME;
public static boolean ALT_GAME_SHIELD_BLOCKS;
public static int ALT_PERFECT_SHLD_BLOCK;
public static boolean ALLOW_CLASS_MASTERS;
public static boolean LIFE_CRYSTAL_NEEDED;
public static boolean SP_BOOK_NEEDED;
public static boolean ES_SP_BOOK_NEEDED;
public static boolean DIVINE_SP_BOOK_NEEDED;
public static boolean ALT_GAME_SKILL_LEARN;
public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
public static int MAX_RUN_SPEED;
public static int MAX_PCRIT_RATE;
public static int MAX_MCRIT_RATE;
public static int MAX_PATK_SPEED;
public static int MAX_MATK_SPEED;
public static int MAX_EVASION;
public static byte MAX_SUBCLASS;
public static byte MAX_SUBCLASS_LEVEL;
public static int MAX_PVTSTORESELL_SLOTS_DWARF;
public static int MAX_PVTSTORESELL_SLOTS_OTHER;
public static int MAX_PVTSTOREBUY_SLOTS_DWARF;
public static int MAX_PVTSTOREBUY_SLOTS_OTHER;
public static int INVENTORY_MAXIMUM_NO_DWARF;
public static int INVENTORY_MAXIMUM_DWARF;
public static int INVENTORY_MAXIMUM_GM;
public static int WAREHOUSE_SLOTS_DWARF;
public static int WAREHOUSE_SLOTS_NO_DWARF;
public static int WAREHOUSE_SLOTS_CLAN;
public static int FREIGHT_SLOTS;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
public static int MAX_PERSONAL_FAME_POINTS;
public static int FORTRESS_ZONE_FAME_TASK_FREQUENCY;
public static int FORTRESS_ZONE_FAME_AQUIRE_POINTS;
public static int CASTLE_ZONE_FAME_TASK_FREQUENCY;
public static int CASTLE_ZONE_FAME_AQUIRE_POINTS;
public static boolean IS_CRAFTING_ENABLED;
public static boolean CRAFT_MASTERWORK;
public static int DWARF_RECIPE_LIMIT;
public static int COMMON_RECIPE_LIMIT;
public static boolean ALT_GAME_CREATION;
public static double ALT_GAME_CREATION_SPEED;
public static double ALT_GAME_CREATION_XP_RATE;
public static double ALT_GAME_CREATION_RARE_XPSP_RATE;
public static double ALT_GAME_CREATION_SP_RATE;
public static boolean ALT_BLACKSMITH_USE_RECIPES;
public static int ALT_CLAN_JOIN_DAYS;
public static int ALT_CLAN_CREATE_DAYS;
public static int ALT_CLAN_DISSOLVE_DAYS;
public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
public static int ALT_CLAN_MEMBERS_FOR_WAR;
public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
public static boolean REMOVE_CASTLE_CIRCLETS;
public static int ALT_PARTY_RANGE;
public static int ALT_PARTY_RANGE2;
public static long STARTING_ADENA;
public static byte STARTING_LEVEL;
public static int STARTING_SP;
public static boolean AUTO_LOOT;
public static boolean AUTO_LOOT_RAIDS;
public static int UNSTUCK_INTERVAL;
public static int PLAYER_SPAWN_PROTECTION;
public static boolean RESPAWN_RANDOM_ENABLED;
public static int RESPAWN_RANDOM_MAX_OFFSET;
public static boolean RESTORE_PLAYER_INSTANCE;
public static boolean ALLOW_SUMMON_TO_INSTANCE;
public static boolean PETITIONING_ALLOWED;
public static int MAX_PETITIONS_PER_PLAYER;
public static int MAX_PETITIONS_PENDING;
public static boolean ALT_GAME_FREIGHTS;
public static int ALT_GAME_FREIGHT_PRICE;
public static boolean ALT_GAME_FREE_TELEPORT;
public static boolean ALT_RECOMMEND;
public static int DELETE_DAYS;
public static float ALT_GAME_EXPONENT_XP;
public static float ALT_GAME_EXPONENT_SP;
public static String PARTY_XP_CUTOFF_METHOD;
public static double PARTY_XP_CUTOFF_PERCENT;
public static int PARTY_XP_CUTOFF_LEVEL;
/*
* public static float ALT_DAGGER_DMG_VS_HEAVY; // Alternative damage for dagger skills VS heavy
* public static float ALT_DAGGER_DMG_VS_ROBE; // Alternative damage for dagger skills VS robe
* public static float ALT_DAGGER_DMG_VS_LIGHT; // Alternative damage for dagger skills VS light
*/
// --------------------------------------------------
// ClanHall Settings
// --------------------------------------------------
public static long CH_TELE_FEE_RATIO;
public static int CH_TELE1_FEE;
public static int CH_TELE2_FEE;
public static long CH_ITEM_FEE_RATIO;
public static int CH_ITEM1_FEE;
public static int CH_ITEM2_FEE;
public static int CH_ITEM3_FEE;
public static long CH_MPREG_FEE_RATIO;
public static int CH_MPREG1_FEE;
public static int CH_MPREG2_FEE;
public static int CH_MPREG3_FEE;
public static int CH_MPREG4_FEE;
public static int CH_MPREG5_FEE;
public static long CH_HPREG_FEE_RATIO;
public static int CH_HPREG1_FEE;
public static int CH_HPREG2_FEE;
public static int CH_HPREG3_FEE;
public static int CH_HPREG4_FEE;
public static int CH_HPREG5_FEE;
public static int CH_HPREG6_FEE;
public static int CH_HPREG7_FEE;
public static int CH_HPREG8_FEE;
public static int CH_HPREG9_FEE;
public static int CH_HPREG10_FEE;
public static int CH_HPREG11_FEE;
public static int CH_HPREG12_FEE;
public static int CH_HPREG13_FEE;
public static long CH_EXPREG_FEE_RATIO;
public static int CH_EXPREG1_FEE;
public static int CH_EXPREG2_FEE;
public static int CH_EXPREG3_FEE;
public static int CH_EXPREG4_FEE;
public static int CH_EXPREG5_FEE;
public static int CH_EXPREG6_FEE;
public static int CH_EXPREG7_FEE;
public static long CH_SUPPORT_FEE_RATIO;
public static int CH_SUPPORT1_FEE;
public static int CH_SUPPORT2_FEE;
public static int CH_SUPPORT3_FEE;
public static int CH_SUPPORT4_FEE;
public static int CH_SUPPORT5_FEE;
public static int CH_SUPPORT6_FEE;
public static int CH_SUPPORT7_FEE;
public static int CH_SUPPORT8_FEE;
public static long CH_CURTAIN_FEE_RATIO;
public static int CH_CURTAIN1_FEE;
public static int CH_CURTAIN2_FEE;
public static long CH_FRONT_FEE_RATIO;
public static int CH_FRONT1_FEE;
public static int CH_FRONT2_FEE;
// --------------------------------------------------
// Castle Settings
// --------------------------------------------------
public static long CS_TELE_FEE_RATIO;
public static int CS_TELE1_FEE;
public static int CS_TELE2_FEE;
public static long CS_MPREG_FEE_RATIO;
public static int CS_MPREG1_FEE;
public static int CS_MPREG2_FEE;
public static int CS_MPREG3_FEE;
public static int CS_MPREG4_FEE;
public static long CS_HPREG_FEE_RATIO;
public static int CS_HPREG1_FEE;
public static int CS_HPREG2_FEE;
public static int CS_HPREG3_FEE;
public static int CS_HPREG4_FEE;
public static int CS_HPREG5_FEE;
public static long CS_EXPREG_FEE_RATIO;
public static int CS_EXPREG1_FEE;
public static int CS_EXPREG2_FEE;
public static int CS_EXPREG3_FEE;
public static int CS_EXPREG4_FEE;
public static long CS_SUPPORT_FEE_RATIO;
public static int CS_SUPPORT1_FEE;
public static int CS_SUPPORT2_FEE;
public static int CS_SUPPORT3_FEE;
public static int CS_SUPPORT4_FEE;
public static List<String> CL_SET_SIEGE_TIME_LIST;
public static List<Integer> SIEGE_HOUR_LIST_MORNING;
public static List<Integer> SIEGE_HOUR_LIST_AFTERNOON;
// --------------------------------------------------
// Fortress Settings
// --------------------------------------------------
public static long FS_TELE_FEE_RATIO;
public static int FS_TELE1_FEE;
public static int FS_TELE2_FEE;
public static long FS_MPREG_FEE_RATIO;
public static int FS_MPREG1_FEE;
public static int FS_MPREG2_FEE;
public static long FS_HPREG_FEE_RATIO;
public static int FS_HPREG1_FEE;
public static int FS_HPREG2_FEE;
public static long FS_EXPREG_FEE_RATIO;
public static int FS_EXPREG1_FEE;
public static int FS_EXPREG2_FEE;
public static long FS_SUPPORT_FEE_RATIO;
public static int FS_SUPPORT1_FEE;
public static int FS_SUPPORT2_FEE;
public static int FS_BLOOD_OATH_COUNT;
public static int FS_BLOOD_OATH_FRQ;
// --------------------------------------------------
// Feature Settings
// --------------------------------------------------
public static int TAKE_FORT_POINTS;
public static int LOOSE_FORT_POINTS;
public static int TAKE_CASTLE_POINTS;
public static int LOOSE_CASTLE_POINTS;
public static int CASTLE_DEFENDED_POINTS;
public static int FESTIVAL_WIN_POINTS;
public static int HERO_POINTS;
public static int ROYAL_GUARD_COST;
public static int KNIGHT_UNIT_COST;
public static int KNIGHT_REINFORCE_COST;
public static int BALLISTA_POINTS;
public static int BLOODALLIANCE_POINTS;
public static int BLOODOATH_POINTS;
public static int KNIGHTSEPAULETTE_POINTS;
public static int REPUTATION_SCORE_PER_KILL;
public static int JOIN_ACADEMY_MIN_REP_SCORE;
public static int JOIN_ACADEMY_MAX_REP_SCORE;
public static int RAID_RANKING_1ST;
public static int RAID_RANKING_2ND;
public static int RAID_RANKING_3RD;
public static int RAID_RANKING_4TH;
public static int RAID_RANKING_5TH;
public static int RAID_RANKING_6TH;
public static int RAID_RANKING_7TH;
public static int RAID_RANKING_8TH;
public static int RAID_RANKING_9TH;
public static int RAID_RANKING_10TH;
public static int RAID_RANKING_UP_TO_50TH;
public static int RAID_RANKING_UP_TO_100TH;
public static int CLAN_LEVEL_6_COST;
public static int CLAN_LEVEL_7_COST;
public static int CLAN_LEVEL_8_COST;
public static int CLAN_LEVEL_9_COST;
public static int CLAN_LEVEL_10_COST;
// --------------------------------------------------
// General Settings
// --------------------------------------------------
public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
public static boolean DISPLAY_SERVER_VERSION;
public static boolean SERVER_LIST_BRACKET;
public static boolean SERVER_LIST_CLOCK;
public static boolean SERVER_GMONLY;
public static boolean GM_HERO_AURA;
public static boolean GM_STARTUP_INVULNERABLE;
public static boolean GM_STARTUP_INVISIBLE;
public static boolean GM_STARTUP_SILENCE;
public static boolean GM_STARTUP_AUTO_LIST;
public static boolean GM_STARTUP_DIET_MODE;
public static String GM_ADMIN_MENU_STYLE;
public static boolean GM_ITEM_RESTRICTION;
public static boolean GM_SKILL_RESTRICTION;
public static boolean GM_TRADE_RESTRICTED_ITEMS;
public static boolean BYPASS_VALIDATION;
public static boolean GAMEGUARD_ENFORCE;
public static boolean GAMEGUARD_PROHIBITACTION;
public static boolean LOG_CHAT;
public static boolean LOG_ITEMS;
public static boolean LOG_ITEM_ENCHANTS;
public static boolean LOG_SKILL_ENCHANTS;
public static boolean GMAUDIT;
public static boolean LOG_GAME_DAMAGE;
public static boolean DEBUG;
public static boolean PACKET_HANDLER_DEBUG;
public static boolean ASSERT;
public static boolean DEVELOPER;
public static boolean ACCEPT_GEOEDITOR_CONN;
public static boolean TEST_SERVER;
public static boolean ALT_DEV_NO_QUESTS;
public static boolean ALT_DEV_NO_SPAWNS;
public static boolean SERVER_LIST_TESTSERVER;
public static int THREAD_P_EFFECTS;
public static int THREAD_P_GENERAL;
public static int GENERAL_PACKET_THREAD_CORE_SIZE;
public static int IO_PACKET_THREAD_CORE_SIZE;
public static int GENERAL_THREAD_CORE_SIZE;
public static int AI_MAX_THREAD;
public static boolean DEADLOCK_DETECTOR;
public static int DEADLOCK_CHECK_INTERVAL;
public static boolean RESTART_ON_DEADLOCK;
public static final FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM = new FloodProtectorConfig("UseItemFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE = new FloodProtectorConfig("RollDiceFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK = new FloodProtectorConfig("FireworkFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON = new FloodProtectorConfig("ItemPetSummonFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE = new FloodProtectorConfig("HeroVoiceFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_SHOUT = new FloodProtectorConfig("ShoutFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_TRADE_CHAT = new FloodProtectorConfig("TradeChatFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_PARTY_ROOM = new FloodProtectorConfig("PartyRoomFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_PARTY_ROOM_COMMANDER = new FloodProtectorConfig("PartyRoomCommanderFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS = new FloodProtectorConfig("SubclassFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM = new FloodProtectorConfig("DropItemFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS = new FloodProtectorConfig("ServerBypassFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL = new FloodProtectorConfig("MultiSellFloodProtector");
public static final FloodProtectorConfig FLOOD_PROTECTOR_TRANSACTION = new FloodProtectorConfig("TransactionFloodProtector");
public static File SCRIPT_ROOT;
public static boolean SERVER_LOCAL = false;
public static boolean ALLOW_DISCARDITEM;
public static int AUTODESTROY_ITEM_AFTER;
public static int HERB_AUTO_DESTROY_TIME;
public static String PROTECTED_ITEMS;
public static List<Integer> LIST_PROTECTED_ITEMS = new FastList<Integer>();
public static int CHAR_STORE_INTERVAL;
public static boolean LAZY_ITEMS_UPDATE;
public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
public static boolean DESTROY_DROPPED_PLAYER_ITEM;
public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
public static boolean SAVE_DROPPED_ITEM;
public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
public static int SAVE_DROPPED_ITEM_INTERVAL;
public static boolean CLEAR_DROPPED_ITEM_TABLE;
public static boolean AUTODELETE_INVALID_QUEST_DATA;
public static boolean PRECISE_DROP_CALCULATION;
public static boolean MULTIPLE_ITEM_DROP;
public static boolean FORCE_INVENTORY_UPDATE;
public static boolean LAZY_CACHE;
public static int MIN_NPC_ANIMATION;
public static int MAX_NPC_ANIMATION;
public static int MIN_MONSTER_ANIMATION;
public static int MAX_MONSTER_ANIMATION;
public static int COORD_SYNCHRONIZE;
public static boolean GRIDS_ALWAYS_ON;
public static int GRID_NEIGHBOR_TURNON_TIME;
public static int GRID_NEIGHBOR_TURNOFF_TIME;
public static Path GEODATA_PATH;
public static boolean TRY_LOAD_UNSPECIFIED_REGIONS;
public static Map<String, Boolean> GEODATA_REGIONS;
public static int GEODATA;
public static boolean GEODATA_CELLFINDING;
public static boolean FORCE_GEODATA;
public static boolean MOVE_BASED_KNOWNLIST;
public static long KNOWNLIST_UPDATE_INTERVAL;
public static int ZONE_TOWN;
public static boolean ACTIVATE_POSITION_RECORDER;
public static String DEFAULT_GLOBAL_CHAT;
public static String DEFAULT_TRADE_CHAT;
public static boolean ALLOW_WAREHOUSE;
public static boolean WAREHOUSE_CACHE;
public static int WAREHOUSE_CACHE_TIME;
public static boolean ALLOW_FREIGHT;
public static boolean ALLOW_WEAR;
public static int WEAR_DELAY;
public static int WEAR_PRICE;
public static boolean ALLOW_LOTTERY;
public static boolean ALLOW_RACE;
public static boolean ALLOW_WATER;
public static boolean ALLOW_RENTPET;
public static boolean ALLOWFISHING;
public static boolean ALLOW_BOAT;
public static boolean ALLOW_CURSED_WEAPONS;
public static boolean ALLOW_MANOR;
public static boolean ALLOW_NPC_WALKERS;
public static boolean ALLOW_PET_WALKERS;
public static boolean SERVER_NEWS;
public static int COMMUNITY_TYPE;
public static boolean BBS_SHOW_PLAYERLIST;
public static String BBS_DEFAULT;
public static boolean SHOW_LEVEL_COMMUNITYBOARD;
public static boolean SHOW_STATUS_COMMUNITYBOARD;
public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
public static int NAME_PER_ROW_COMMUNITYBOARD;
public static int ALT_OLY_START_TIME;
public static int ALT_OLY_MIN;
public static long ALT_OLY_CPERIOD;
public static long ALT_OLY_BATTLE;
public static long ALT_OLY_WPERIOD;
public static long ALT_OLY_VPERIOD;
public static int ALT_OLY_CLASSED;
public static int ALT_OLY_NONCLASSED;
public static int ALT_OLY_REG_DISPLAY;
public static int ALT_OLY_BATTLE_REWARD_ITEM;
public static int ALT_OLY_CLASSED_RITEM_C;
public static int ALT_OLY_NONCLASSED_RITEM_C;
public static int ALT_OLY_COMP_RITEM;
public static int ALT_OLY_GP_PER_POINT;
public static int ALT_OLY_HERO_POINTS;
public static int ALT_OLY_RANK1_POINTS;
public static int ALT_OLY_RANK2_POINTS;
public static int ALT_OLY_RANK3_POINTS;
public static int ALT_OLY_RANK4_POINTS;
public static int ALT_OLY_RANK5_POINTS;
public static int ALT_OLY_MAX_POINTS;
public static boolean ALT_OLY_LOG_FIGHTS;
public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
public static boolean ALT_OLY_ANNOUNCE_GAMES;
public static List<Integer> LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
public static int ALT_OLY_ENCHANT_LIMIT;
public static int ALT_MANOR_REFRESH_TIME;
public static int ALT_MANOR_REFRESH_MIN;
public static int ALT_MANOR_APPROVE_TIME;
public static int ALT_MANOR_APPROVE_MIN;
public static int ALT_MANOR_MAINTENANCE_PERIOD;
public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
public static int ALT_MANOR_SAVE_PERIOD_RATE;
public static long ALT_LOTTERY_PRIZE;
public static long ALT_LOTTERY_TICKET_PRICE;
public static float ALT_LOTTERY_5_NUMBER_RATE;
public static float ALT_LOTTERY_4_NUMBER_RATE;
public static float ALT_LOTTERY_3_NUMBER_RATE;
public static long ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
public static int FS_TIME_ATTACK;
public static int FS_TIME_COOLDOWN;
public static int FS_TIME_ENTRY;
public static int FS_TIME_WARMUP;
public static int FS_PARTY_MEMBER_COUNT;
public static int RIFT_MIN_PARTY_SIZE;
public static int RIFT_SPAWN_DELAY;
public static int RIFT_MAX_JUMPS;
public static int RIFT_AUTO_JUMPS_TIME_MIN;
public static int RIFT_AUTO_JUMPS_TIME_MAX;
public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
public static int RIFT_ENTER_COST_RECRUIT;
public static int RIFT_ENTER_COST_SOLDIER;
public static int RIFT_ENTER_COST_OFFICER;
public static int RIFT_ENTER_COST_CAPTAIN;
public static int RIFT_ENTER_COST_COMMANDER;
public static int RIFT_ENTER_COST_HERO;
public static int DEFAULT_PUNISH;
public static int DEFAULT_PUNISH_PARAM;
public static boolean ONLY_GM_ITEMS_FREE;
public static boolean JAIL_IS_PVP;
public static boolean JAIL_DISABLE_CHAT;
public static boolean CUSTOM_SPAWNLIST_TABLE;
public static boolean SAVE_GMSPAWN_ON_CUSTOM;
public static boolean DELETE_GMSPAWN_ON_CUSTOM;
public static boolean CUSTOM_NPC_TABLE;
public static boolean CUSTOM_ITEM_TABLES;
public static boolean CUSTOM_ARMORSETS_TABLE;
public static boolean CUSTOM_TELEPORT_TABLE;
public static boolean CUSTOM_DROPLIST_TABLE;
public static boolean CUSTOM_MERCHANT_TABLES;
// --------------------------------------------------
// L2JMods Settings
// --------------------------------------------------
public static boolean L2JMOD_CHAMPION_ENABLE;
public static boolean L2JMOD_CHAMPION_PASSIVE;
public static int L2JMOD_CHAMPION_FREQUENCY;
public static String L2JMOD_CHAMP_TITLE;
public static int L2JMOD_CHAMP_MIN_LVL;
public static int L2JMOD_CHAMP_MAX_LVL;
public static int L2JMOD_CHAMPION_HP;
public static int L2JMOD_CHAMPION_REWARDS;
public static float L2JMOD_CHAMPION_ADENAS_REWARDS;
public static float L2JMOD_CHAMPION_HP_REGEN;
public static float L2JMOD_CHAMPION_ATK;
public static float L2JMOD_CHAMPION_SPD_ATK;
public static int L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE;
public static int L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE;
public static int L2JMOD_CHAMPION_REWARD_ID;
public static int L2JMOD_CHAMPION_REWARD_QTY;
public static boolean L2JMOD_CHAMPION_ENABLE_VITALITY;
public static boolean TVT_EVENT_ENABLED;
public static boolean TVT_EVENT_IN_INSTANCE;
public static String TVT_EVENT_INSTANCE_FILE;
public static String[] TVT_EVENT_INTERVAL;
public static int TVT_EVENT_PARTICIPATION_TIME;
public static int TVT_EVENT_RUNNING_TIME;
public static int TVT_EVENT_PARTICIPATION_NPC_ID;
public static int[] TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[3];
public static int[] TVT_EVENT_PARTICIPATION_FEE = new int[2];
public static int TVT_EVENT_MIN_PLAYERS_IN_TEAMS;
public static int TVT_EVENT_MAX_PLAYERS_IN_TEAMS;
public static int TVT_EVENT_RESPAWN_TELEPORT_DELAY;
public static int TVT_EVENT_START_LEAVE_TELEPORT_DELAY;
public static String TVT_EVENT_TEAM_1_NAME;
public static int[] TVT_EVENT_TEAM_1_COORDINATES = new int[3];
public static String TVT_EVENT_TEAM_2_NAME;
public static int[] TVT_EVENT_TEAM_2_COORDINATES = new int[3];
public static List<int[]> TVT_EVENT_REWARDS = new FastList<int[]>();
public static boolean TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED;
public static boolean TVT_EVENT_SCROLL_ALLOWED;
public static boolean TVT_EVENT_POTIONS_ALLOWED;
public static boolean TVT_EVENT_SUMMON_BY_ITEM_ALLOWED;
public static List<Integer> TVT_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
public static List<Integer> TVT_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
public static boolean TVT_REWARD_TEAM_TIE;
public static byte TVT_EVENT_MIN_LVL;
public static byte TVT_EVENT_MAX_LVL;
public static int TVT_EVENT_EFFECTS_REMOVAL;
public static boolean L2JMOD_ALLOW_WEDDING;
public static int L2JMOD_WEDDING_PRICE;
public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
public static boolean L2JMOD_WEDDING_TELEPORT;
public static int L2JMOD_WEDDING_TELEPORT_PRICE;
public static int L2JMOD_WEDDING_TELEPORT_DURATION;
public static boolean L2JMOD_WEDDING_SAMESEX;
public static boolean L2JMOD_WEDDING_FORMALWEAR;
public static int L2JMOD_WEDDING_DIVORCE_COSTS;
public static boolean BANKING_SYSTEM_ENABLED;
public static int BANKING_SYSTEM_GOLDBARS;
public static int BANKING_SYSTEM_ADENA;
public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT;
public static boolean OFFLINE_TRADE_ENABLE;
public static boolean OFFLINE_CRAFT_ENABLE;
public static boolean OFFLINE_SET_NAME_COLOR;
public static int OFFLINE_NAME_COLOR;
public static boolean L2JMOD_ENABLE_MANA_POTIONS_SUPPORT;
public static boolean L2JMOD_ACHIEVEMENT_SYSTEM;
// --------------------------------------------------
// NPC Settings
// --------------------------------------------------
public static boolean ANNOUNCE_MAMMON_SPAWN;
public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
public static boolean ALT_ATTACKABLE_NPCS;
public static boolean ALT_GAME_VIEWNPC;
public static int MAX_DRIFT_RANGE;
public static boolean DEEPBLUE_DROP_RULES;
public static boolean DEEPBLUE_DROP_RULES_RAID;
public static boolean SHOW_NPC_LVL;
public static boolean GUARD_ATTACK_AGGRO_MOB;
public static boolean ALLOW_WYVERN_UPGRADER;
public static String PET_RENT_NPC;
public static List<Integer> LIST_PET_RENT_NPC = new FastList<Integer>();
public static double RAID_HP_REGEN_MULTIPLIER;
public static double RAID_MP_REGEN_MULTIPLIER;
public static double RAID_PDEFENCE_MULTIPLIER;
public static double RAID_MDEFENCE_MULTIPLIER;
public static double RAID_MINION_RESPAWN_TIMER;
public static float RAID_MIN_RESPAWN_MULTIPLIER;
public static float RAID_MAX_RESPAWN_MULTIPLIER;
public static boolean RAID_DISABLE_CURSE;
public static int INVENTORY_MAXIMUM_PET;
// --------------------------------------------------
// PvP Settings
// --------------------------------------------------
public static int KARMA_MIN_KARMA;
public static int KARMA_MAX_KARMA;
public static int KARMA_XP_DIVIDER;
public static int KARMA_LOST_BASE;
public static boolean KARMA_DROP_GM;
public static boolean KARMA_AWARD_PK_KILL;
public static int KARMA_PK_LIMIT;
public static String KARMA_NONDROPPABLE_PET_ITEMS;
public static String KARMA_NONDROPPABLE_ITEMS;
public static int[] KARMA_LIST_NONDROPPABLE_PET_ITEMS;
public static int[] KARMA_LIST_NONDROPPABLE_ITEMS;
// --------------------------------------------------
// Rate Settings
// --------------------------------------------------
public static float RATE_XP;
public static float RATE_SP;
public static float RATE_PARTY_XP;
public static float RATE_PARTY_SP;
public static float RATE_QUESTS_REWARD;
public static float RATE_DROP_ADENA;
public static float RATE_CONSUMABLE_COST;
public static float RATE_EXTR_FISH;
public static float RATE_DROP_ITEMS;
public static float RATE_DROP_ITEMS_BY_RAID;
public static float RATE_DROP_SPOIL;
public static int RATE_DROP_MANOR;
public static float RATE_DROP_QUEST;
public static float RATE_KARMA_EXP_LOST;
public static float RATE_SIEGE_GUARDS_PRICE;
public static float RATE_DROP_COMMON_HERBS;
public static float RATE_DROP_MP_HP_HERBS;
public static float RATE_DROP_GREATER_HERBS;
public static float RATE_DROP_SUPERIOR_HERBS;
public static float RATE_DROP_SPECIAL_HERBS;
public static int PLAYER_DROP_LIMIT;
public static int PLAYER_RATE_DROP;
public static int PLAYER_RATE_DROP_ITEM;
public static int PLAYER_RATE_DROP_EQUIP;
public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
public static float PET_XP_RATE;
public static int PET_FOOD_RATE;
public static float SINEATER_XP_RATE;
public static int KARMA_DROP_LIMIT;
public static int KARMA_RATE_DROP;
public static int KARMA_RATE_DROP_ITEM;
public static int KARMA_RATE_DROP_EQUIP;
public static int KARMA_RATE_DROP_EQUIP_WEAPON;
public static double[] PLAYER_XP_PERCENT_LOST;
// --------------------------------------------------
// Seven Signs Settings
// --------------------------------------------------
public static boolean ALT_GAME_CASTLE_DAWN;
public static boolean ALT_GAME_CASTLE_DUSK;
public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
public static int ALT_FESTIVAL_MIN_PLAYER;
public static int ALT_MAXIMUM_PLAYER_CONTRIB;
public static long ALT_FESTIVAL_MANAGER_START;
public static long ALT_FESTIVAL_LENGTH;
public static long ALT_FESTIVAL_CYCLE_LENGTH;
public static long ALT_FESTIVAL_FIRST_SPAWN;
public static long ALT_FESTIVAL_FIRST_SWARM;
public static long ALT_FESTIVAL_SECOND_SPAWN;
public static long ALT_FESTIVAL_SECOND_SWARM;
public static long ALT_FESTIVAL_CHEST_SPAWN;
public static double ALT_SIEGE_DAWN_GATES_PDEF_MULT;
public static double ALT_SIEGE_DUSK_GATES_PDEF_MULT;
public static double ALT_SIEGE_DAWN_GATES_MDEF_MULT;
public static double ALT_SIEGE_DUSK_GATES_MDEF_MULT;
// --------------------------------------------------
// Server Settings
// --------------------------------------------------
public static int PORT_GAME;
public static int PORT_LOGIN;
public static String LOGIN_BIND_ADDRESS;
public static int LOGIN_TRY_BEFORE_BAN;
public static int LOGIN_BLOCK_AFTER_BAN;
public static String GAMESERVER_HOSTNAME;
public static String DATABASE_DRIVER;
public static String DATABASE_URL;
public static String DATABASE_LOGIN;
public static String DATABASE_PASSWORD;
public static int DATABASE_MAX_CONNECTIONS;
public static int DATABASE_MAX_IDLE_TIME;
public static int MAXIMUM_ONLINE_USERS;
public static String CNAME_TEMPLATE;
public static String PET_NAME_TEMPLATE;
public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
public static File DATAPACK_ROOT;
public static boolean ACCEPT_ALTERNATE_ID;
public static int REQUEST_ID;
public static boolean RESERVE_HOST_ON_LOGIN = false;
public static int MIN_PROTOCOL_REVISION;
public static int MAX_PROTOCOL_REVISION;
public static boolean LOG_LOGIN_CONTROLLER;
/** ************************************************** **/
/** MMO Settings - Begin **/
public static int MMO_SELECTOR_SLEEP_TIME;
public static int MMO_MAX_SEND_PER_PASS;
public static int MMO_MAX_READ_PER_PASS;
public static int MMO_HELPER_BUFFER_COUNT;
public static int MMO_IO_SELECTOR_THREAD_COUNT;
// --------------------------------------------------
// Vitality Settings
// --------------------------------------------------
public static boolean ENABLE_VITALITY;
public static boolean RECOVER_VITALITY_ON_RECONNECT;
public static boolean ENABLE_DROP_VITALITY_HERBS;
public static float RATE_VITALITY_LEVEL_1;
public static float RATE_VITALITY_LEVEL_2;
public static float RATE_VITALITY_LEVEL_3;
public static float RATE_VITALITY_LEVEL_4;
public static float RATE_DROP_VITALITY_HERBS;
public static float RATE_RECOVERY_VITALITY_PEACE_ZONE;
public static float RATE_VITALITY_LOST;
public static float RATE_VITALITY_GAIN;
public static float RATE_RECOVERY_ON_RECONNECT;
// --------------------------------------------------
// No classification assigned to the following yet
// --------------------------------------------------
public static int MAX_ITEM_IN_PACKET;
public static boolean CHECK_KNOWN;
public static int GAME_SERVER_LOGIN_PORT;
public static String GAME_SERVER_LOGIN_HOST;
public static String INTERNAL_HOSTNAME;
public static String EXTERNAL_HOSTNAME;
public static String ROUTER_HOSTNAME;
public static int PATH_NODE_RADIUS;
public static int NEW_NODE_ID;
public static int SELECTED_NODE_ID;
public static int LINKED_NODE_ID;
public static String NEW_NODE_TYPE;
public static int IP_UPDATE_TIME;
public static String SERVER_VERSION;
public static String SERVER_BUILD_DATE;
public static String DATAPACK_VERSION;
public static String NONDROPPABLE_ITEMS;
public static List<Integer> LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
public static int PVP_NORMAL_TIME;
public static int PVP_PVP_TIME;
public static boolean COUNT_PACKETS = false;
public static boolean DUMP_PACKET_COUNTS = false;
public static int DUMP_INTERVAL_SECONDS = 60;
public static enum IdFactoryType
{
Compaction,
BitSet,
Stack
}
public static IdFactoryType IDFACTORY_TYPE;
public static boolean BAD_ID_CHECKING;
public static enum ObjectMapType
{
L2ObjectHashMap,
WorldObjectMap
}
public static enum ObjectSetType
{
L2ObjectHashSet,
WorldObjectSet
}
public static ObjectMapType MAP_TYPE;
public static ObjectSetType SET_TYPE;
public static int ENCHANT_CHANCE_WEAPON;
public static int ENCHANT_CHANCE_ARMOR;
public static int ENCHANT_CHANCE_JEWELRY;
public static int ENCHANT_CHANCE_ELEMENT;
public static int BLESSED_ENCHANT_CHANCE_WEAPON;
public static int BLESSED_ENCHANT_CHANCE_ARMOR;
public static int BLESSED_ENCHANT_CHANCE_JEWELRY;
public static int CRYSTAL_ENCHANT_CHANCE_WEAPON;
public static int CRYSTAL_ENCHANT_CHANCE_ARMOR;
public static int CRYSTAL_ENCHANT_CHANCE_JEWELRY;
public static int ENCHANT_MAX_WEAPON;
public static int ENCHANT_MAX_ARMOR;
public static int ENCHANT_MAX_JEWELRY;
public static int ENCHANT_SAFE_MAX;
public static int ENCHANT_SAFE_MAX_FULL;
public static int AUGMENTATION_NG_SKILL_CHANCE;
public static int AUGMENTATION_NG_GLOW_CHANCE;
public static int AUGMENTATION_MID_SKILL_CHANCE;
public static int AUGMENTATION_MID_GLOW_CHANCE;
public static int AUGMENTATION_HIGH_SKILL_CHANCE;
public static int AUGMENTATION_HIGH_GLOW_CHANCE;
public static int AUGMENTATION_TOP_SKILL_CHANCE;
public static int AUGMENTATION_TOP_GLOW_CHANCE;
public static int AUGMENTATION_BASESTAT_CHANCE;
public static int AUGMENTATION_ACC_SKILL_CHANCE;
public static int[] AUGMENTATION_BLACKLIST;
public static double HP_REGEN_MULTIPLIER;
public static double MP_REGEN_MULTIPLIER;
public static double CP_REGEN_MULTIPLIER;
public static boolean IS_TELNET_ENABLED;
public static boolean SHOW_LICENCE;
public static boolean FORCE_GGAUTH;
public static boolean ACCEPT_NEW_GAMESERVER;
public static int SERVER_ID;
public static byte[] HEX_ID;
public static boolean AUTO_CREATE_ACCOUNTS;
public static boolean FLOOD_PROTECTION;
public static int FAST_CONNECTION_LIMIT;
public static int NORMAL_CONNECTION_TIME;
public static int FAST_CONNECTION_TIME;
public static int MAX_CONNECTION_PER_IP;
/** ************************************************** **/
/** Automatic events - begin **/
/** ************************************************** **/
public static String CTF_EVEN_TEAMS;
public static boolean CTF_ALLOW_INTERFERENCE;
public static boolean CTF_ALLOW_POTIONS;
public static boolean CTF_ALLOW_SUMMON;
public static boolean CTF_ON_START_REMOVE_ALL_EFFECTS;
public static boolean CTF_ON_START_UNSUMMON_PET;
public static boolean CTF_ANNOUNCE_TEAM_STATS;
public static boolean CTF_ANNOUNCE_REWARD;
public static boolean CTF_JOIN_CURSED;
public static boolean CTF_REVIVE_RECOVERY;
public static long CTF_REVIVE_DELAY;
public static String TVT_EVEN_TEAMS;
public static boolean TVT_ALLOW_INTERFERENCE;
public static boolean TVT_ALLOW_POTIONS;
public static boolean TVT_ALLOW_SUMMON;
public static boolean TVT_ON_START_REMOVE_ALL_EFFECTS;
public static boolean TVT_ON_START_UNSUMMON_PET;
public static boolean TVT_REVIVE_RECOVERY;
public static boolean TVT_ANNOUNCE_TEAM_STATS;
public static boolean TVT_ANNOUNCE_REWARD;
public static boolean TVT_PRICE_NO_KILLS;
public static boolean TVT_JOIN_CURSED;
public static long TVT_REVIVE_DELAY;
public static boolean DM_ALLOW_INTERFERENCE;
public static boolean DM_ALLOW_POTIONS;
public static boolean DM_ALLOW_SUMMON;
public static boolean DM_ON_START_REMOVE_ALL_EFFECTS;
public static boolean DM_ON_START_UNSUMMON_PET;
public static long DM_REVIVE_DELAY;
public static boolean VIP_ALLOW_INTERFERENCE;
public static boolean VIP_ALLOW_POTIONS;
public static boolean VIP_ON_START_REMOVE_ALL_EFFECTS;
public static int VIP_MIN_LEVEL;
public static int VIP_MAX_LEVEL;
public static int VIP_MIN_PARTICIPANTS;
public static boolean FALLDOWNONDEATH;
public static boolean ARENA_ENABLED;
public static int ARENA_INTERVAL;
public static int ARENA_REWARD_ID;
public static int ARENA_REWARD_COUNT;
public static boolean FISHERMAN_ENABLED;
public static int FISHERMAN_INTERVAL;
public static int FISHERMAN_REWARD_ID;
public static int FISHERMAN_REWARD_COUNT;
public static String TVTI_INSTANCE_XML;
public static boolean TVTI_ALLOW_TIE;
public static boolean TVTI_CHECK_WEIGHT_AND_INVENTORY;
public static boolean TVTI_ALLOW_INTERFERENCE;
public static boolean TVTI_ALLOW_POTIONS;
public static boolean TVTI_ALLOW_SUMMON;
public static boolean TVTI_ON_START_REMOVE_ALL_EFFECTS;
public static boolean TVTI_ON_START_UNSUMMON_PET;
public static boolean TVTI_REVIVE_RECOVERY;
public static boolean TVTI_ANNOUNCE_TEAM_STATS;
public static boolean TVTI_ANNOUNCE_REWARD;
public static boolean TVTI_PRICE_NO_KILLS;
public static boolean TVTI_JOIN_CURSED;
public static boolean TVTI_SHOW_STATS_PAGE;
public static int TVTI_SORT_TEAMS;
public static int TVTI_JOIN_NPC_SKILL;
public static long TVTI_REVIVE_DELAY;
public static long TVTI_JOIN_NPC_DO_SKILL_AGAIN;
public static Map<Integer, Double> BALANCE_SKILL_LIST;
public static boolean KAMALOKA_DROPS_TO_FULL_PARTY_ONLY;
public static double PVP_CLASS_BALANCE_DUELIST;
public static double PVP_CLASS_BALANCE_DREADNOUGHT;
public static double PVP_CLASS_BALANCE_PHOENIX_KNIGHT;
public static double PVP_CLASS_BALANCE_HELL_KNIGHT;
public static double PVP_CLASS_BALANCE_SAGITTARIUS;
public static double PVP_CLASS_BALANCE_ADVENTURER;
public static double PVP_CLASS_BALANCE_ARCHMAGE;
public static double PVP_CLASS_BALANCE_SOULTAKER;
public static double PVP_CLASS_BALANCE_ARCANA_LORD;
public static double PVP_CLASS_BALANCE_CARDINAL;
public static double PVP_CLASS_BALANCE_HIEROPHANT;
public static double PVP_CLASS_BALANCE_EVA_TEMPLAR;
public static double PVP_CLASS_BALANCE_SWORD_MUSE;
public static double PVP_CLASS_BALANCE_WIND_RIDER;
public static double PVP_CLASS_BALANCE_MOONLIGHT_SENTINEL;
public static double PVP_CLASS_BALANCE_MYSTIC_MUSE;
public static double PVP_CLASS_BALANCE_ELEMENTAL_MASTER;
public static double PVP_CLASS_BALANCE_EVA_SAINT;
public static double PVP_CLASS_BALANCE_SHILLIEN_TEMPLAR;
public static double PVP_CLASS_BALANCE_SPECTRAL_DANCER;
public static double PVP_CLASS_BALANCE_GHOST_HUNTER;
public static double PVP_CLASS_BALANCE_GHOST_SENTINEL;
public static double PVP_CLASS_BALANCE_STORM_SCREAMER;
public static double PVP_CLASS_BALANCE_SPECTRAL_MASTER;
public static double PVP_CLASS_BALANCE_SHILLIEN_SAINT;
public static double PVP_CLASS_BALANCE_TITAN;
public static double PVP_CLASS_BALANCE_GRAND_KHAUATARI;
public static double PVP_CLASS_BALANCE_DOMINATOR;
public static double PVP_CLASS_BALANCE_DOOMCRYER;
public static double PVP_CLASS_BALANCE_FORTUNE_SEEKER;
public static double PVP_CLASS_BALANCE_MAESTRO;
public static double PVP_CLASS_BALANCE_DOOMBRINGER;
public static double PVP_CLASS_BALANCE_MALE_SOULHOUND;
public static double PVP_CLASS_BALANCE_FEMALE_SOULHOUND;
public static double PVP_CLASS_BALANCE_TRICKSTER;
public static double PVP_CLASS_BALANCE_INSPECTOR;
public static double PVP_CLASS_BALANCE_JUDICATOR;
public static double PVE_CLASS_BALANCE_DUELIST;
public static double PVE_CLASS_BALANCE_DREADNOUGHT;
public static double PVE_CLASS_BALANCE_PHOENIX_KNIGHT;
public static double PVE_CLASS_BALANCE_HELL_KNIGHT;
public static double PVE_CLASS_BALANCE_SAGITTARIUS;
public static double PVE_CLASS_BALANCE_ADVENTURER;
public static double PVE_CLASS_BALANCE_ARCHMAGE;
public static double PVE_CLASS_BALANCE_SOULTAKER;
public static double PVE_CLASS_BALANCE_ARCANA_LORD;
public static double PVE_CLASS_BALANCE_CARDINAL;
public static double PVE_CLASS_BALANCE_HIEROPHANT;
public static double PVE_CLASS_BALANCE_EVA_TEMPLAR;
public static double PVE_CLASS_BALANCE_SWORD_MUSE;
public static double PVE_CLASS_BALANCE_WIND_RIDER;
public static double PVE_CLASS_BALANCE_MOONLIGHT_SENTINEL;
public static double PVE_CLASS_BALANCE_MYSTIC_MUSE;
public static double PVE_CLASS_BALANCE_ELEMENTAL_MASTER;
public static double PVE_CLASS_BALANCE_EVA_SAINT;
public static double PVE_CLASS_BALANCE_SHILLIEN_TEMPLAR;
public static double PVE_CLASS_BALANCE_SPECTRAL_DANCER;
public static double PVE_CLASS_BALANCE_GHOST_HUNTER;
public static double PVE_CLASS_BALANCE_GHOST_SENTINEL;
public static double PVE_CLASS_BALANCE_STORM_SCREAMER;
public static double PVE_CLASS_BALANCE_SPECTRAL_MASTER;
public static double PVE_CLASS_BALANCE_SHILLIEN_SAINT;
public static double PVE_CLASS_BALANCE_TITAN;
public static double PVE_CLASS_BALANCE_GRAND_KHAUATARI;
public static double PVE_CLASS_BALANCE_DOMINATOR;
public static double PVE_CLASS_BALANCE_DOOMCRYER;
public static double PVE_CLASS_BALANCE_FORTUNE_SEEKER;
public static double PVE_CLASS_BALANCE_MAESTRO;
public static double PVE_CLASS_BALANCE_DOOMBRINGER;
public static double PVE_CLASS_BALANCE_MALE_SOULHOUND;
public static double PVE_CLASS_BALANCE_FEMALE_SOULHOUND;
public static double PVE_CLASS_BALANCE_TRICKSTER;
public static double PVE_CLASS_BALANCE_INSPECTOR;
public static double PVE_CLASS_BALANCE_JUDICATOR;
public static double titanium_default_bow_default;
public static double titanium_default_cross_default;
public static double titanium_default_bigb_default;
public static double titanium_default_dual_default;
public static double titanium_default_val;
public static double titanium_over_bow_default;
public static double titanium_over_cross_default;
public static double titanium_over_bigb_default;
public static double titanium_over_dual_default;
public static double titanium_over_default;
public static double titanium_super_bow_default;
public static double titanium_super_cross_default;
public static double titanium_super_bigb_default;
public static double titanium_super_dual_default;
public static double titanium_super_default;
public static double dread_default_bow_default;
public static double dread_default_cross_default;
public static double dread_default_bigb_default;
public static double dread_default_dual_default;
public static double dread_default_val;
public static double dread_over_bow_default;
public static double dread_over_cross_default;
public static double dread_over_bigb_default;
public static double dread_over_dual_default;
public static double dread_over_default;
public static double dread_super_bow_default;
public static double dread_super_cross_default;
public static double dread_super_bigb_default;
public static double dread_super_dual_default;
public static double dread_super_default;
public static double corrupted_default_bow_default;
public static double corrupted_default_cross_default;
public static double corrupted_default_bigb_default;
public static double corrupted_default_dual_default;
public static double corrupted_default_val;
public static double corrupted_over_bow_default;
public static double corrupted_over_cross_default;
public static double corrupted_over_bigb_default;
public static double corrupted_over_dual_default;
public static double corrupted_over_default;
public static double corrupted_super_bow_default;
public static double corrupted_super_cross_default;
public static double corrupted_super_bigb_default;
public static double corrupted_super_dual_default;
public static double corrupted_super_default;
public static int SUMMON_PATK_MODIFIER;
public static int SUMMON_MATK_MODIFIER;
public static boolean DOUBLE_PVP;
public static boolean DOUBLE_PVP_WEEKEND;
public static boolean PVP_PROTECTIONS;
public static boolean ALLOW_CLAN_WAREHOUSE;
public static boolean ALLOW_CASTLE_WAREHOUSE;
public static boolean ALLOW_FREIGHT_WAREHOUSE;
public static boolean ENABLE_SUBCLASS_LOGS;
public static int PVP_TOKEN_CHANCE;
public static int PVP_TOKEN_CHANCE_HOT_ZONES;
public static int PVP_TOKEN_CHANCE_EVENTS;
public static int RARE_PVP_TOKEN_CHANCE;
public static int RARE_PVP_TOKEN_CHANCE_HOT_ZONES;
public static int RARE_PVP_TOKEN_CHANCE_EVENTS;
public static int CLAN_ESSENCE_CHANCE;
public static int CLAN_ESSENCE_CHANCE_HOT_ZONES;
public static int CLAN_ESSENCE_CHANCE_SIEGES;
public static int PVP_CHEST_POOL_SIZE;
/** Captcha */
public static boolean BOTS_PREVENTION;
public static int KILLS_COUNTER;
public static int KILLS_COUNTER_RANDOMIZATION;
public static int VALIDATION_TIME;
public static int PUNISHMENT;
public static int PUNISHMENT_TIME;
public static int PUNISHMENT_TIME_BONUS_1;
public static int PUNISHMENT_TIME_BONUS_2;
public static int PUNISHMENT_TIME_BONUS_3;
public static int PUNISHMENT_TIME_BONUS_4;
public static int PUNISHMENT_TIME_BONUS_5;
public static int PUNISHMENT_TIME_BONUS_6;
public static int PUNISHMENT_REPORTS1;
public static int PUNISHMENT_REPORTS2;
public static int PUNISHMENT_REPORTS3;
public static int PUNISHMENT_REPORTS4;
public static int PUNISHMENT_REPORTS5;
public static int PUNISHMENT_REPORTS6;
public static int ESCAPE_PUNISHMENT_REPORTS_COUNT;
public static int KICK_PUNISHMENT_REPORTS_COUNT;
public static int JAIL_PUNISHMENT_REPORTS_COUNT;
public static int ENCHANT_BONUS_TIER_2;
public static int ENCHANT_BONUS_TIER_2_5;
public static int ENCHANT_BONUS_TIER_3;
public static int ENCHANT_BONUS_TIER_4;
public static int ENCHANT_BONUS_TIER_4_5;
public static int ENCHANT_CLUTCH_TIER_0;
public static int ENCHANT_CLUTCH_TIER_1;
public static int ENCHANT_CLUTCH_TIER_1_5;
public static int ENCHANT_CLUTCH_TIER_2;
public static int ENCHANT_CLUTCH_TIER_2_5;
public static int ENCHANT_CLUTCH_TIER_3_DYNASTY;
public static int ENCHANT_CLUTCH_TIER_3_VESPER;
public static int ENCHANT_CLUTCH_TIER_3_VESPER_JEWS;
public static int ENCHANT_CLUTCH_TIER_3_DEFAULT;
public static int ENCHANT_CLUTCH_TIER_3_5;
public static int ENCHANT_CLUTCH_TIER_4;
public static int ENCHANT_CLUTCH_TIER_4_5;
public static int ENCHANT_CLUTCH_TIER_5;
public static boolean MAIL_ENABLED = false;
public static String MAIL_USER;
public static String MAIL_PASSWORD;
public static String DONATE_MAIL_USER;
public static String DONATE_MAIL_PASSWORD;
public static boolean HWID_FARMZONES_CHECK;
public static boolean HWID_EVENTS_CHECK;
public static boolean HWID_EVENTZONES_CHECK;
public static boolean HWID_FARMWHILEEVENT_CHECK;
public static boolean ENABLE_OLD_NIGHT;
public static boolean ENABLE_OLD_OLY;
public static boolean EVENTS_LIMIT_IPS;
public static int EVENTS_LIMIT_IPS_NUM;
public static int SYNERGY_CHANCE_ON_PVP;
public static int SYNERGY_RADIUS;
public static double SYNERGY_BOOST_2_SUPPORTS;
public static double SYNERGY_BOOST_3_SUPPORTS;
public static double PVP_EXP_MUL;
public static double SUP_PVP_EXP_MUL;
public static double KARMA_EXP_LOST_MUL;
public static boolean MULTISELL_UNTRADEABLE_SOURCE_ITEMS_PVP_SERVER;
public static int CHANCE_EFFECT_DISPLAY;
public static boolean ENABLE_SKILL_ANIMATIONS;
public static boolean ENABLE_BOT_CAPTCHA;
public static boolean ENABLE_BONUS_PVP;
public static boolean ENABLE_CLAN_WAR_BONUS_PVP;
public static int BONUS_PVP_AMMOUNT;
public static int BONUS_PVP_AMMOUNT_2_SIDE;
public static int BONUS_PVP_AMMOUNT_1_SIDE;
public static int BONUS_CLAN_REP_AMMOUNT_2_SIDE;
public static int BONUS_CLAN_REP_AMMOUNT_1_SIDE;
public static double EVENT_HEAL_MUL;
public static double EVENT_MPCONSUME_MUL;
public static boolean AUTO_TVT_ENABLED;
public static int[][] AUTO_TVT_TEAM_LOCATIONS;
public static boolean AUTO_TVT_TEAM_COLORS_RANDOM;
public static int[] AUTO_TVT_TEAM_COLORS;
public static boolean AUTO_TVT_OVERRIDE_TELE_BACK;
public static int[] AUTO_TVT_DEFAULT_TELE_BACK;
public static int AUTO_TVT_REWARD_MIN_POINTS;
public static int[] AUTO_TVT_REWARD_IDS;
public static int[] AUTO_TVT_REWARD_COUNT;
public static int AUTO_TVT_LEVEL_MAX;
public static int AUTO_TVT_LEVEL_MIN;
public static int AUTO_TVT_PARTICIPANTS_MAX;
public static int AUTO_TVT_PARTICIPANTS_MIN;
public static long AUTO_TVT_DELAY_INITIAL_REGISTRATION;
public static long AUTO_TVT_DELAY_BETWEEN_EVENTS;
public static long AUTO_TVT_PERIOD_LENGHT_REGISTRATION;
public static long AUTO_TVT_PERIOD_LENGHT_PREPARATION;
public static long AUTO_TVT_PERIOD_LENGHT_EVENT;
public static long AUTO_TVT_PERIOD_LENGHT_REWARDS;
public static int AUTO_TVT_REGISTRATION_ANNOUNCEMENT_COUNT;
public static boolean AUTO_TVT_REGISTER_CURSED;
public static boolean AUTO_TVT_REGISTER_HERO;
public static boolean AUTO_TVT_REGISTER_CANCEL;
public static boolean AUTO_TVT_REGISTER_AFTER_RELOG;
public static int[] AUTO_TVT_DISALLOWED_ITEMS;
public static boolean AUTO_TVT_START_CANCEL_BUFFS;
public static boolean AUTO_TVT_START_CANCEL_CUBICS;
public static boolean AUTO_TVT_START_CANCEL_SERVITORS;
public static boolean AUTO_TVT_START_CANCEL_TRANSFORMATION;
public static boolean AUTO_TVT_START_CANCEL_PARTY;
public static boolean AUTO_TVT_START_RECOVER;
public static boolean AUTO_TVT_GODLIKE_SYSTEM;
public static boolean AUTO_TVT_GODLIKE_ANNOUNCE;
public static int AUTO_TVT_GODLIKE_MIN_KILLS;
public static int AUTO_TVT_GODLIKE_POINT_MULTIPLIER;
public static String AUTO_TVT_GODLIKE_TITLE;
public static boolean AUTO_TVT_REVIVE_SELF;
public static boolean AUTO_TVT_REVIVE_RECOVER;
public static long AUTO_TVT_REVIVE_DELAY;
public static int AUTO_TVT_SPAWN_PROTECT;
public static String FortressSiege_EVEN_TEAMS;
public static boolean FortressSiege_SAME_IP_PLAYERS_ALLOWED;
public static boolean FortressSiege_ALLOW_INTERFERENCE;
public static boolean FortressSiege_ALLOW_POTIONS;
public static boolean FortressSiege_ALLOW_SUMMON;
public static boolean FortressSiege_ON_START_REMOVE_ALL_EFFECTS;
public static boolean FortressSiege_ON_START_UNSUMMON_PET;
public static boolean FortressSiege_ANNOUNCE_TEAM_STATS;
public static boolean FortressSiege_JOIN_CURSED;
public static boolean FortressSiege_REVIVE_RECOVERY;
public static boolean FortressSiege_PRICE_NO_KILLS;
public static long FortressSiege_REVIVE_DELAY;
public static boolean FortressSiege_HWID_CHECK;
/** ************************************************** **/
/** Automatic events - end **/
/** ************************************************** **/
public static int RAIDBOSS_CHANCE_1;
public static int RAIDBOSS_CHANCE_2;
public static int RAIDBOSS_CHANCE_3;
public static int RAIDBOSS_CHANCE_4;
public static int RAIDBOSS_CHANCE_5;
public static int RAIDBOSS_CHANCE_6;
public static int RAIDBOSS_CHANCE_7;
public static int RAIDBOSS_CHANCE_8;
public static int RAIDBOSS_CHANCE_9;
public static int RAIDBOSS_CHANCE_10;
public static int RAIDBOSS_CHANCE_11;
public static int RAIDBOSS_CHANCE_12;
public static int RAIDBOSS_CHANCE_13;
public static int RAIDBOSS_CHANCE_14;
public static int RAIDBOSS_CHANCE_15;
public static long UNTRADEABLE_GM_ENCHANT;
public static long UNTRADEABLE_GM_TRADE;
public static long UNTRADEABLE_DONATE;
public static long CHANCE_SKILL_DELAY;
public static long CHANCE_SKILL_BOW_DELAY;
public static int SPELL_CANCEL_CHANCE;
public static int ATTACK_CANCEL_CHANCE;
public static int APC_ATTACK_ROW;
public static int APC_ATTACK_ROW_BALANCED;
public static int APC_PATHFIND;
public static boolean NpcBuffer_VIP;
public static int NpcBuffer_VIP_ALV;
public static boolean NpcBuffer_EnableBuff;
public static boolean NpcBuffer_EnableScheme;
public static boolean NpcBuffer_EnableHeal;
public static boolean NpcBuffer_EnableBuffs;
public static boolean NpcBuffer_EnableResist;
public static boolean NpcBuffer_EnableSong;
public static boolean NpcBuffer_EnableDance;
public static boolean NpcBuffer_EnableChant;
public static boolean NpcBuffer_EnableOther;
public static boolean NpcBuffer_EnableSpecial;
public static boolean NpcBuffer_EnableCubic;
public static boolean NpcBuffer_EnableCancel;
public static boolean NpcBuffer_EnableBuffSet;
public static boolean NpcBuffer_EnableBuffPK;
public static boolean NpcBuffer_EnableFreeBuffs;
public static boolean NpcBuffer_EnableTimeOut;
public static int NpcBuffer_TimeOutTime;
public static int NpcBuffer_MinLevel;
public static int NpcBuffer_PriceCancel;
public static int NpcBuffer_PriceHeal;
public static int NpcBuffer_PriceBuffs;
public static int NpcBuffer_PriceResist;
public static int NpcBuffer_PriceSong;
public static int NpcBuffer_PriceDance;
public static int NpcBuffer_PriceChant;
public static int NpcBuffer_PriceOther;
public static int NpcBuffer_PriceSpecial;
public static int NpcBuffer_PriceCubic;
public static int NpcBuffer_PriceSet;
public static int NpcBuffer_PriceScheme;
public static int NpcBuffer_MaxScheme;
public static boolean SCHEME_ALLOW_FLAG;
public static List<int[]> NpcBuffer_BuffSetMage = new ArrayList<int[]>();
public static List<int[]> NpcBuffer_BuffSetFighter = new ArrayList<int[]>();
public static List<int[]> NpcBuffer_BuffSetDagger = new ArrayList<int[]>();
public static List<int[]> NpcBuffer_BuffSetSupport = new ArrayList<int[]>();
public static List<int[]> NpcBuffer_BuffSetTank = new ArrayList<int[]>();
public static List<int[]> NpcBuffer_BuffSetArcher = new ArrayList<int[]>();
public static int KAMALOKA_PVPS;
public static int KAMALOKA_SUPPORT_PVPS;
public static int KAMALOKA_LEVELS;
public static int KAMALOKA_HARD_PVPS;
public static int KAMALOKA_HARD_SUPPORT_PVPS;
public static int KAMALOKA_HARD_LEVELS;
public static int EMBRYO_PVPS;
public static int EMBRYO_SUPPORT_PVPS;
public static int EMBRYO_LEVELS;
public static int SOLO_PVPS;
public static int SOLO_SUPPORT_PVPS;
public static int SOLO_LEVELS;
public static int FAFURION_PVPS;
public static int FAFURION_SUPPORT_PVPS;
public static int FAFURION_LEVELS;
public static int FAFURION_HARD_PVPS;
public static int FAFURION_HARD_SUPPORT_PVPS;
public static int FAFURION_HARD_LEVELS;
public static int ZAKEN_PVPS;
public static int ZAKEN_SUPPORT_PVPS;
public static int ZAKEN_LEVELS;
public static int ZAKEN_HARD_PVPS;
public static int ZAKEN_HARD_SUPPORT_PVPS;
public static int ZAKEN_HARD_LEVELS;
public static int FRINTEZZA_PVPS;
public static int FRINTEZZA_SUPPORT_PVPS;
public static int FRINTEZZA_LEVELS;
public static int FRINTEZZA_HARD_PVPS;
public static int FRINTEZZA_HARD_SUPPORT_PVPS;
public static int FRINTEZZA_HARD_LEVELS;
public static int FREYA_PVPS;
public static int FREYA_SUPPORT_PVPS;
public static int FREYA_LEVELS;
public static int FREYA_HARD_PVPS;
public static int FREYA_HARD_SUPPORT_PVPS;
public static int FREYA_HARD_LEVELS;
public static int ADEN_PVPS;
public static int ADEN_SUPPORT_PVPS;
public static int ADEN_LEVELS;
public static ExProperties load(String filename)
{
return load(new File(filename));
}
public static ExProperties load(File file)
{
ExProperties result = new ExProperties();
try
{
result.load(file);
_log.log(Level.INFO, "Successfully Loaded " + file.getName());
}
catch (IOException e)
{
_log.log(Level.SEVERE, "Error loading config : " + file.getName() + "!", e);
}
return result;
}
public static void loadInstances()
{
ExProperties INSTANCES = load(INSTANCES_FILE);
// ZAKEN_PVPS = INSTANCES.getProperty("zaken_pvps", 1);
// ZAKEN_SUPPORT_PVPS = INSTANCES.getProperty("zaken_support_pvps", 1);
// ZAKEN_LEVELS = INSTANCES.getProperty("zaken_levels", 1);
//
// ZAKEN_HARD_PVPS = INSTANCES.getProperty("zaken_hard_pvps", 1);
// ZAKEN_HARD_SUPPORT_PVPS = INSTANCES.getProperty("zaken_hard_support_pvps", 1);
// ZAKEN_HARD_LEVELS = INSTANCES.getProperty("zaken_hard_levels", 1);
//
//
// FRINTEZZA_PVPS = INSTANCES.getProperty("frintezza_pvps", 1);
// FRINTEZZA_SUPPORT_PVPS = INSTANCES.getProperty("frintezza_support_pvps", 1);
// FRINTEZZA_LEVELS = INSTANCES.getProperty("frintezza_levels", 1);
//
// FRINTEZZA_HARD_PVPS = INSTANCES.getProperty("frintezza_hard_pvps", 1);
// FRINTEZZA_HARD_SUPPORT_PVPS = INSTANCES.getProperty("frintezza_hard_support_pvps", 1);
// FRINTEZZA_HARD_LEVELS = INSTANCES.getProperty("frintezza_hard_levels", 1);
//
//
// FREYA_PVPS = INSTANCES.getProperty("freya_pvps", 1);
// FREYA_SUPPORT_PVPS = INSTANCES.getProperty("freya_support_pvps", 1);
// FREYA_LEVELS = INSTANCES.getProperty("freya_levels", 1);
//
// FREYA_HARD_PVPS = INSTANCES.getProperty("freya_hard_pvps", 1);
// FREYA_HARD_SUPPORT_PVPS = INSTANCES.getProperty("freya_hard_support_pvps", 1);
// FREYA_HARD_LEVELS = INSTANCES.getProperty("freya_hard_levels", 1);
KAMALOKA_PVPS = INSTANCES.getProperty("kamaloka_pvps", 70);
KAMALOKA_SUPPORT_PVPS = INSTANCES.getProperty("kamaloka_support_pvps", 35);
KAMALOKA_LEVELS = INSTANCES.getProperty("kamaloka_level", 87);
KAMALOKA_HARD_PVPS = INSTANCES.getProperty("kamaloka_hard_pvps", 1000);
KAMALOKA_HARD_SUPPORT_PVPS = INSTANCES.getProperty("kamaloka_hard_support_pvps", 600);
KAMALOKA_HARD_LEVELS = INSTANCES.getProperty("kamaloka_hard_level", 91);
EMBRYO_PVPS = INSTANCES.getProperty("embryo_pvps", 500);
EMBRYO_SUPPORT_PVPS = INSTANCES.getProperty("embryo_support_pvps", 250);
EMBRYO_LEVELS = INSTANCES.getProperty("embryo_level", 90);
SOLO_PVPS = INSTANCES.getProperty("solo_pvps", 50);
SOLO_SUPPORT_PVPS = INSTANCES.getProperty("solo_support_pvps", 50);
SOLO_LEVELS = INSTANCES.getProperty("solo_level", 86);
FAFURION_PVPS = INSTANCES.getProperty("fafurion_pvps", 800);
FAFURION_SUPPORT_PVPS = INSTANCES.getProperty("fafurion_support_pvps", 400);
FAFURION_LEVELS = INSTANCES.getProperty("fafurion_level", 90);
FAFURION_HARD_PVPS = INSTANCES.getProperty("fafurion_hard_pvps", 800);
FAFURION_HARD_SUPPORT_PVPS = INSTANCES.getProperty("fafurion_hard_support_pvps", 400);
FAFURION_HARD_LEVELS = INSTANCES.getProperty("fafurion_hard_level", 90);
ADEN_PVPS = INSTANCES.getProperty("aden_pvps", 1000);
ADEN_SUPPORT_PVPS = INSTANCES.getProperty("aden_support_pvps", 500);
ADEN_LEVELS = INSTANCES.getProperty("aden_level", 91);
ZAKEN_PVPS = INSTANCES.getProperty("zaken_pvps", 1);
ZAKEN_SUPPORT_PVPS = INSTANCES.getProperty("zaken_support_pvps", 1);
ZAKEN_LEVELS = INSTANCES.getProperty("zaken_levels", 1);
ZAKEN_HARD_PVPS = INSTANCES.getProperty("zaken_hard_pvps", 1);
ZAKEN_HARD_SUPPORT_PVPS = INSTANCES.getProperty("zaken_hard_support_pvps", 1);
ZAKEN_HARD_LEVELS = INSTANCES.getProperty("zaken_hard_levels", 1);
FRINTEZZA_PVPS = INSTANCES.getProperty("frintezza_pvps", 1);
FRINTEZZA_SUPPORT_PVPS = INSTANCES.getProperty("frintezza_support_pvps", 1);
FRINTEZZA_LEVELS = INSTANCES.getProperty("frintezza_levels", 1);
FRINTEZZA_HARD_PVPS = INSTANCES.getProperty("frintezza_hard_pvps", 1);
FRINTEZZA_HARD_SUPPORT_PVPS = INSTANCES.getProperty("frintezza_hard_support_pvps", 1);
FRINTEZZA_HARD_LEVELS = INSTANCES.getProperty("frintezza_hard_levels", 1);
FREYA_PVPS = INSTANCES.getProperty("freya_pvps", 1);
FREYA_SUPPORT_PVPS = INSTANCES.getProperty("freya_support_pvps", 1);
FREYA_LEVELS = INSTANCES.getProperty("freya_levels", 1);
FREYA_HARD_PVPS = INSTANCES.getProperty("freya_hard_pvps", 1);
FREYA_HARD_SUPPORT_PVPS = INSTANCES.getProperty("freya_hard_support_pvps", 1);
FREYA_HARD_LEVELS = INSTANCES.getProperty("freya_hard_levels", 1);
}
public static void loadSchemeBuffer()
{
ExProperties npcbuffer = load(NPCBUFFER_CONFIG_FILE);
NpcBuffer_VIP = npcbuffer.getProperty("EnableVIP", false);
NpcBuffer_VIP_ALV = npcbuffer.getProperty("VipAccesLevel", 1);
NpcBuffer_EnableBuff = npcbuffer.getProperty("EnableBuffSection", true);
NpcBuffer_EnableScheme = npcbuffer.getProperty("EnableScheme", true);
NpcBuffer_EnableHeal = npcbuffer.getProperty("EnableHeal", true);
NpcBuffer_EnableBuffs = npcbuffer.getProperty("EnableBuffs", true);
NpcBuffer_EnableResist = npcbuffer.getProperty("EnableResist", true);
NpcBuffer_EnableSong = npcbuffer.getProperty("EnableSongs", true);
NpcBuffer_EnableDance = npcbuffer.getProperty("EnableDances", true);
NpcBuffer_EnableChant = npcbuffer.getProperty("EnableChants", true);
NpcBuffer_EnableOther = npcbuffer.getProperty("EnableOther", true);
NpcBuffer_EnableSpecial = npcbuffer.getProperty("EnableSpecial", true);
NpcBuffer_EnableCubic = npcbuffer.getProperty("EnableCubic", false);
NpcBuffer_EnableCancel = npcbuffer.getProperty("EnableRemoveBuffs", true);
NpcBuffer_EnableBuffSet = npcbuffer.getProperty("EnableBuffSet", true);
NpcBuffer_EnableBuffPK = npcbuffer.getProperty("EnableBuffForPK", false);
NpcBuffer_EnableFreeBuffs = npcbuffer.getProperty("EnableFreeBuffs", true);
NpcBuffer_EnableTimeOut = npcbuffer.getProperty("EnableTimeOut", true);
SCHEME_ALLOW_FLAG = npcbuffer.getProperty("EnableBuffforFlag", false);
NpcBuffer_TimeOutTime = npcbuffer.getProperty("TimeoutTime", 10);
NpcBuffer_MinLevel = npcbuffer.getProperty("MinimumLevel", 20);
NpcBuffer_PriceCancel = npcbuffer.getProperty("RemoveBuffsPrice", 100000);
NpcBuffer_PriceHeal = npcbuffer.getProperty("HealPrice", 100000);
NpcBuffer_PriceBuffs = npcbuffer.getProperty("BuffsPrice", 100000);
NpcBuffer_PriceResist = npcbuffer.getProperty("ResistPrice", 100000);
NpcBuffer_PriceSong = npcbuffer.getProperty("SongPrice", 100000);
NpcBuffer_PriceDance = npcbuffer.getProperty("DancePrice", 100000);
NpcBuffer_PriceChant = npcbuffer.getProperty("ChantsPrice", 100000);
NpcBuffer_PriceOther = npcbuffer.getProperty("OtherPrice", 100000);
NpcBuffer_PriceSpecial = npcbuffer.getProperty("SpecialPrice", 100000);
NpcBuffer_PriceCubic = npcbuffer.getProperty("CubicPrice", 100000);
NpcBuffer_PriceSet = npcbuffer.getProperty("SetPrice", 100000);
NpcBuffer_PriceScheme = npcbuffer.getProperty("SchemePrice", 100000);
NpcBuffer_MaxScheme = npcbuffer.getProperty("MaxScheme", 4);
String[] parts;
String[] skills = npcbuffer.getProperty("BuffSetMage", "192,1").split(";");
for (String sk : skills)
{
parts = sk.split(",");
NpcBuffer_BuffSetMage.add(new int[]
{
Integer.parseInt(parts[0]), Integer.parseInt(parts[1])
});
}
skills = npcbuffer.getProperty("BuffSetFighter", "192,1").split(";");
for (String sk : skills)
{
parts = sk.split(",");
NpcBuffer_BuffSetFighter.add(new int[]
{
Integer.parseInt(parts[0]), Integer.parseInt(parts[1])
});
}
skills = npcbuffer.getProperty("BuffSetDagger", "192,1").split(";");
for (String sk : skills)
{
parts = sk.split(",");
NpcBuffer_BuffSetDagger.add(new int[]
{
Integer.parseInt(parts[0]), Integer.parseInt(parts[1])
});
}
skills = npcbuffer.getProperty("BuffSetSupport", "192,1").split(";");
for (String sk : skills)
{
parts = sk.split(",");
NpcBuffer_BuffSetSupport.add(new int[]
{
Integer.parseInt(parts[0]), Integer.parseInt(parts[1])
});
}
skills = npcbuffer.getProperty("BuffSetTank", "192,1").split(";");
for (String sk : skills)
{
parts = sk.split(",");
NpcBuffer_BuffSetTank.add(new int[]
{
Integer.parseInt(parts[0]), Integer.parseInt(parts[1])
});
}
skills = npcbuffer.getProperty("BuffSetArcher", "192,1").split(";");
for (String sk : skills)
{
parts = sk.split(",");
NpcBuffer_BuffSetArcher.add(new int[]
{
Integer.parseInt(parts[0]), Integer.parseInt(parts[1])
});
}
}
/**
* This class initializes all global variables for configuration.<br>
* If the key doesn't appear in properties file, a default value is set by this class.
*
* @see CONFIGURATION_FILE (properties file) for configuring your server.
*/
public static void load()
{
if (Server.serverMode == Server.MODE_GAMESERVER)
{
_log.info("Loading GameServer Configuration Files...");
loadSchemeBuffer();
loadInstances();
InputStream is = null;
try
{
try
{
L2Properties RAID = new L2Properties();
is = new FileInputStream(new File(RAIDBOSS_DROP_CHANCES_FILE));
RAID.load(is);
RAIDBOSS_CHANCE_1 = Integer.parseInt(RAID.getProperty("raid1", "0"));
RAIDBOSS_CHANCE_2 = Integer.parseInt(RAID.getProperty("raid2", "0"));
RAIDBOSS_CHANCE_3 = Integer.parseInt(RAID.getProperty("raid3", "0"));
RAIDBOSS_CHANCE_4 = Integer.parseInt(RAID.getProperty("raid4", "0"));
RAIDBOSS_CHANCE_5 = Integer.parseInt(RAID.getProperty("raid5", "0"));
RAIDBOSS_CHANCE_6 = Integer.parseInt(RAID.getProperty("raid6", "0"));
RAIDBOSS_CHANCE_7 = Integer.parseInt(RAID.getProperty("raid7", "0"));
RAIDBOSS_CHANCE_8 = Integer.parseInt(RAID.getProperty("raid8", "0"));
RAIDBOSS_CHANCE_9 = Integer.parseInt(RAID.getProperty("raid9", "0"));
RAIDBOSS_CHANCE_10 = Integer.parseInt(RAID.getProperty("raid10", "0"));
RAIDBOSS_CHANCE_11 = Integer.parseInt(RAID.getProperty("raid11", "0"));
RAIDBOSS_CHANCE_12 = Integer.parseInt(RAID.getProperty("raid12", "0"));
RAIDBOSS_CHANCE_13 = Integer.parseInt(RAID.getProperty("raid13", "0"));
RAIDBOSS_CHANCE_14 = Integer.parseInt(RAID.getProperty("raid14", "0"));
RAIDBOSS_CHANCE_15 = Integer.parseInt(RAID.getProperty("raid15", "0"));
UNTRADEABLE_GM_ENCHANT = Long.parseLong(RAID.getProperty("untradeGMenchant", "504")); // default in hours - 336 = 2 weeks
UNTRADEABLE_GM_TRADE = Long.parseLong(RAID.getProperty("untradeGMtrade", "504")); // default in hours - 336 = 2 weeks
UNTRADEABLE_DONATE = Long.parseLong(RAID.getProperty("untradeDonate", "504")); // default in hours - 336 = 2 weeks
CHANCE_SKILL_DELAY = Long.parseLong(RAID.getProperty("chanceSkillDelayMili", "5"));
CHANCE_SKILL_BOW_DELAY = Long.parseLong(RAID.getProperty("chanceSkillBowDelayMili", "300"));
SPELL_CANCEL_CHANCE = Integer.parseInt(RAID.getProperty("spellCancelChance", "10"));
ATTACK_CANCEL_CHANCE = Integer.parseInt(RAID.getProperty("attackCancelChance", "5"));
APC_ATTACK_ROW = Integer.parseInt(RAID.getProperty("apcMinAttackRow", "3"));
APC_ATTACK_ROW_BALANCED = Integer.parseInt(RAID.getProperty("apcMinAttackRowBalanced", "3"));
APC_PATHFIND = Integer.parseInt(RAID.getProperty("apcPathfind", "0"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + RAIDBOSS_DROP_CHANCES_FILE + " File.");
}
try
{
L2Properties serverSettings = new L2Properties();
is = new FileInputStream(new File(CONFIGURATION_FILE));
serverSettings.load(is);
GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));
EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "*");
INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "*");
GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort", "9014"));
GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost", "127.0.0.1");
REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID", "0"));
ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID", "True"));
DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();
CNAME_TEMPLATE = serverSettings.getProperty("CnameTemplate", ".*");
PET_NAME_TEMPLATE = serverSettings.getProperty("PetNameTemplate", ".*");
MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(serverSettings.getProperty("CharMaxNumber", "0"));
MAXIMUM_ONLINE_USERS = Integer.parseInt(serverSettings.getProperty("MaximumOnlineUsers", "100"));
MIN_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MinProtocolRevision", "660"));
MAX_PROTOCOL_REVISION = Integer.parseInt(serverSettings.getProperty("MaxProtocolRevision", "665"));
SERVER_LOCAL = Boolean.parseBoolean(serverSettings.getProperty("ServerLocal", "True"));
try
{
SCRIPT_ROOT = new File(serverSettings.getString("ScriptRoot", "./data/scripts").replaceAll("\\\\", "/")).getCanonicalFile();
}
catch (Exception e)
{
_log.warning("Error setting script root!");
SCRIPT_ROOT = new File(".");
}
if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
{
throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
}
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + CONFIGURATION_FILE + " File.");
}
// Load Smart CB Properties file (if exists)
final File smartcb = new File(SMART_CB);
try (InputStream iss = new FileInputStream(smartcb))
{
L2Properties smartCB = new L2Properties();
smartCB.load(iss);
TOP_PLAYER_ROW_HEIGHT = Integer.parseInt(smartCB.getProperty("TopPlayerRowHeight", "19"));
TOP_PLAYER_RESULTS = Integer.parseInt(smartCB.getProperty("TopPlayerResults", "20"));
RAID_LIST_ROW_HEIGHT = Integer.parseInt(smartCB.getProperty("RaidListRowHeight", "18"));
RAID_LIST_RESULTS = Integer.parseInt(smartCB.getProperty("RaidListResults", "20"));
RAID_LIST_SORT_ASC = Boolean.parseBoolean(smartCB.getProperty("RaidListSortAsc", "True"));
ALLOW_REAL_ONLINE_STATS = Boolean.parseBoolean(smartCB.getProperty("AllowRealOnlineStats", "True"));
}
catch (Exception e)
{
_log.warning("Config: " + e.getMessage());
throw new Error("Failed to Load " + SMART_CB + " File.");
}
// Load Feature Properties file (if exists)
try
{
L2Properties Feature = new L2Properties();
is = new FileInputStream(new File(FEATURE_CONFIG_FILE));
Feature.load(is);
CH_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallTeleportFunctionFeeRatio", "604800000"));
CH_TELE1_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl1", "7000"));
CH_TELE2_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl2", "14000"));
CH_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallSupportFunctionFeeRatio", "86400000"));
CH_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl1", "2500"));
CH_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl2", "5000"));
CH_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl3", "7000"));
CH_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl4", "11000"));
CH_SUPPORT5_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl5", "21000"));
CH_SUPPORT6_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl6", "36000"));
CH_SUPPORT7_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl7", "37000"));
CH_SUPPORT8_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl8", "52000"));
CH_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallMpRegenerationFunctionFeeRatio", "86400000"));
CH_MPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl1", "2000"));
CH_MPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl2", "3750"));
CH_MPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl3", "6500"));
CH_MPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl4", "13750"));
CH_MPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl5", "20000"));
CH_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallHpRegenerationFunctionFeeRatio", "86400000"));
CH_HPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl1", "700"));
CH_HPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl2", "800"));
CH_HPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl3", "1000"));
CH_HPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl4", "1166"));
CH_HPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl5", "1500"));
CH_HPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl6", "1750"));
CH_HPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl7", "2000"));
CH_HPREG8_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl8", "2250"));
CH_HPREG9_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl9", "2500"));
CH_HPREG10_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl10", "3250"));
CH_HPREG11_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl11", "3270"));
CH_HPREG12_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl12", "4250"));
CH_HPREG13_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl13", "5166"));
CH_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallExpRegenerationFunctionFeeRatio", "86400000"));
CH_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl1", "3000"));
CH_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl2", "6000"));
CH_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl3", "9000"));
CH_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl4", "15000"));
CH_EXPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl5", "21000"));
CH_EXPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl6", "23330"));
CH_EXPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl7", "30000"));
CH_ITEM_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallItemCreationFunctionFeeRatio", "86400000"));
CH_ITEM1_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl1", "30000"));
CH_ITEM2_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl2", "70000"));
CH_ITEM3_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl3", "140000"));
CH_CURTAIN_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallCurtainFunctionFeeRatio", "604800000"));
CH_CURTAIN1_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl1", "2000"));
CH_CURTAIN2_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl2", "2500"));
CH_FRONT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallFrontPlatformFunctionFeeRatio", "259200000"));
CH_FRONT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "1300"));
CH_FRONT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "4000"));
CL_SET_SIEGE_TIME_LIST = new FastList<String>();
SIEGE_HOUR_LIST_MORNING = new FastList<Integer>();
SIEGE_HOUR_LIST_AFTERNOON = new FastList<Integer>();
String[] sstl = Feature.getProperty("CLSetSiegeTimeList", "").split(",");
if (sstl.length != 0)
{
boolean isHour = false;
for (String st : sstl)
{
if (st.equalsIgnoreCase("day") || st.equalsIgnoreCase("hour") || st.equalsIgnoreCase("minute"))
{
if (st.equalsIgnoreCase("hour"))
isHour = true;
CL_SET_SIEGE_TIME_LIST.add(st.toLowerCase());
}
else
{
_log.warning(StringUtil.concat("[CLSetSiegeTimeList]: invalid config property -> CLSetSiegeTimeList \"", st, "\""));
}
}
if (isHour)
{
String[] shl = Feature.getProperty("SiegeHourList", "").split(",");
for (String st : shl)
{
if (!st.equalsIgnoreCase(""))
{
int val = Integer.parseInt(st);
if (val > 23 || val < 0)
_log.warning(StringUtil.concat("[SiegeHourList]: invalid config property -> SiegeHourList \"", st, "\""));
else if (val < 12)
SIEGE_HOUR_LIST_MORNING.add(val);
else
{
val -= 12;
SIEGE_HOUR_LIST_AFTERNOON.add(val);
}
}
}
if (Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty() && Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty())
{
_log.warning("[SiegeHourList]: invalid config property -> SiegeHourList is empty");
CL_SET_SIEGE_TIME_LIST.remove("hour");
}
}
}
CS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleTeleportFunctionFeeRatio", "604800000"));
CS_TELE1_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl1", "7000"));
CS_TELE2_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl2", "14000"));
CS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleSupportFunctionFeeRatio", "86400000"));
CS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl1", "7000"));
CS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl2", "21000"));
CS_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl3", "37000"));
CS_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl4", "52000"));
CS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleMpRegenerationFunctionFeeRatio", "86400000"));
CS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl1", "2000"));
CS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl2", "6500"));
CS_MPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl3", "13750"));
CS_MPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl4", "20000"));
CS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleHpRegenerationFunctionFeeRatio", "86400000"));
CS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl1", "1000"));
CS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl2", "1500"));
CS_HPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl3", "2250"));
CS_HPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl4", "3270"));
CS_HPREG5_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl5", "5166"));
CS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleExpRegenerationFunctionFeeRatio", "86400000"));
CS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl1", "9000"));
CS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl2", "15000"));
CS_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl3", "21000"));
CS_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl4", "30000"));
FS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressTeleportFunctionFeeRatio", "604800000"));
FS_TELE1_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl1", "1000"));
FS_TELE2_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl2", "10000"));
FS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressSupportFunctionFeeRatio", "86400000"));
FS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl1", "7000"));
FS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl2", "17000"));
FS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressMpRegenerationFunctionFeeRatio", "86400000"));
FS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl1", "6500"));
FS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl2", "9300"));
FS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressHpRegenerationFunctionFeeRatio", "86400000"));
FS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl1", "2000"));
FS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl2", "3500"));
FS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressExpRegenerationFunctionFeeRatio", "86400000"));
FS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl1", "9000"));
FS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl2", "10000"));
FS_BLOOD_OATH_COUNT = Integer.parseInt(Feature.getProperty("FortressBloodOathCount", "1"));
FS_BLOOD_OATH_FRQ = Integer.parseInt(Feature.getProperty("FortressBloodOathFrequency", "360"));
ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(Feature.getProperty("AltCastleForDawn", "True"));
ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(Feature.getProperty("AltCastleForDusk", "True"));
ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(Feature.getProperty("AltRequireClanCastle", "False"));
ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(Feature.getProperty("AltFestivalMinPlayer", "5"));
ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(Feature.getProperty("AltMaxPlayerContrib", "1000000"));
ALT_FESTIVAL_MANAGER_START = Long.parseLong(Feature.getProperty("AltFestivalManagerStart", "120000"));
ALT_FESTIVAL_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalLength", "1080000"));
ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalCycleLength", "2280000"));
ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalFirstSpawn", "120000"));
ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(Feature.getProperty("AltFestivalFirstSwarm", "300000"));
ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalSecondSpawn", "540000"));
ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(Feature.getProperty("AltFestivalSecondSwarm", "720000"));
ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalChestSpawn", "900000"));
ALT_SIEGE_DAWN_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesPdefMult", "1.1"));
ALT_SIEGE_DUSK_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesPdefMult", "0.8"));
ALT_SIEGE_DAWN_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesMdefMult", "1.1"));
ALT_SIEGE_DUSK_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesMdefMult", "0.8"));
TAKE_FORT_POINTS = Integer.parseInt(Feature.getProperty("TakeFortPoints", "200"));
LOOSE_FORT_POINTS = Integer.parseInt(Feature.getProperty("LooseFortPoints", "400"));
TAKE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("TakeCastlePoints", "1500"));
LOOSE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("LooseCastlePoints", "3000"));
CASTLE_DEFENDED_POINTS = Integer.parseInt(Feature.getProperty("CastleDefendedPoints", "750"));
FESTIVAL_WIN_POINTS = Integer.parseInt(Feature.getProperty("FestivalOfDarknessWin", "200"));
HERO_POINTS = Integer.parseInt(Feature.getProperty("HeroPoints", "1000"));
ROYAL_GUARD_COST = Integer.parseInt(Feature.getProperty("CreateRoyalGuardCost", "5000"));
KNIGHT_UNIT_COST = Integer.parseInt(Feature.getProperty("CreateKnightUnitCost", "10000"));
KNIGHT_REINFORCE_COST = Integer.parseInt(Feature.getProperty("ReinforceKnightUnitCost", "5000"));
BALLISTA_POINTS = Integer.parseInt(Feature.getProperty("KillBallistaPoints", "30"));
BLOODALLIANCE_POINTS = Integer.parseInt(Feature.getProperty("BloodAlliancePoints", "500"));
BLOODOATH_POINTS = Integer.parseInt(Feature.getProperty("BloodOathPoints", "200"));
KNIGHTSEPAULETTE_POINTS = Integer.parseInt(Feature.getProperty("KnightsEpaulettePoints", "20"));
REPUTATION_SCORE_PER_KILL = Integer.parseInt(Feature.getProperty("ReputationScorePerKill", "1"));
JOIN_ACADEMY_MIN_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMinPoints", "190"));
JOIN_ACADEMY_MAX_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMaxPoints", "650"));
RAID_RANKING_1ST = Integer.parseInt(Feature.getProperty("1stRaidRankingPoints", "1250"));
RAID_RANKING_2ND = Integer.parseInt(Feature.getProperty("2ndRaidRankingPoints", "900"));
RAID_RANKING_3RD = Integer.parseInt(Feature.getProperty("3rdRaidRankingPoints", "700"));
RAID_RANKING_4TH = Integer.parseInt(Feature.getProperty("4thRaidRankingPoints", "600"));
RAID_RANKING_5TH = Integer.parseInt(Feature.getProperty("5thRaidRankingPoints", "450"));
RAID_RANKING_6TH = Integer.parseInt(Feature.getProperty("6thRaidRankingPoints", "350"));
RAID_RANKING_7TH = Integer.parseInt(Feature.getProperty("7thRaidRankingPoints", "300"));
RAID_RANKING_8TH = Integer.parseInt(Feature.getProperty("8thRaidRankingPoints", "200"));
RAID_RANKING_9TH = Integer.parseInt(Feature.getProperty("9thRaidRankingPoints", "150"));
RAID_RANKING_10TH = Integer.parseInt(Feature.getProperty("10thRaidRankingPoints", "100"));
RAID_RANKING_UP_TO_50TH = Integer.parseInt(Feature.getProperty("UpTo50thRaidRankingPoints", "25"));
RAID_RANKING_UP_TO_100TH = Integer.parseInt(Feature.getProperty("UpTo100thRaidRankingPoints", "12"));
CLAN_LEVEL_6_COST = Integer.parseInt(Feature.getProperty("ClanLevel6Cost", "10000"));
CLAN_LEVEL_7_COST = Integer.parseInt(Feature.getProperty("ClanLevel7Cost", "20000"));
CLAN_LEVEL_8_COST = Integer.parseInt(Feature.getProperty("ClanLevel8Cost", "40000"));
CLAN_LEVEL_9_COST = Integer.parseInt(Feature.getProperty("ClanLevel9Cost", "40000"));
CLAN_LEVEL_10_COST = Integer.parseInt(Feature.getProperty("ClanLevel10Cost", "40000"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + FEATURE_CONFIG_FILE + " File.");
}
// Load Character Properties file (if exists)
try
{
L2Properties Character = new L2Properties();
is = new FileInputStream(new File(CHARACTER_CONFIG_FILE));
Character.load(is);
MASTERACCESS_LEVEL = Integer.parseInt(Character.getProperty("MasterAccessLevel", "127"));
MASTERACCESS_NAME_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterNameColor", "00FF00")));
MASTERACCESS_TITLE_COLOR = Integer.decode(StringUtil.concat("0x", Character.getProperty("MasterTitleColor", "00FF00")));
ALT_GAME_DELEVEL = Boolean.parseBoolean(Character.getProperty("Delevel", "true"));
ALT_WEIGHT_LIMIT = Double.parseDouble(Character.getProperty("AltWeightLimit", "1"));
RUN_SPD_BOOST = Integer.parseInt(Character.getProperty("RunSpeedBoost", "0"));
DEATH_PENALTY_CHANCE = Integer.parseInt(Character.getProperty("DeathPenaltyChance", "20"));
RESPAWN_RESTORE_CP = Double.parseDouble(Character.getProperty("RespawnRestoreCP", "0")) / 100;
RESPAWN_RESTORE_HP = Double.parseDouble(Character.getProperty("RespawnRestoreHP", "70")) / 100;
RESPAWN_RESTORE_MP = Double.parseDouble(Character.getProperty("RespawnRestoreMP", "70")) / 100;
HP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("HpRegenMultiplier", "100")) / 100;
MP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("MpRegenMultiplier", "100")) / 100;
CP_REGEN_MULTIPLIER = Double.parseDouble(Character.getProperty("CpRegenMultiplier", "100")) / 100;
ALT_GAME_TIREDNESS = Boolean.parseBoolean(Character.getProperty("AltGameTiredness", "false"));
/*
* ALT_DAGGER_DMG_VS_HEAVY = Float.parseFloat(Character.getProperty("DaggerVSHeavy", "1"));
* ALT_DAGGER_DMG_VS_ROBE = Float.parseFloat(Character.getProperty("DaggerVSRobe", "1"));
* ALT_DAGGER_DMG_VS_LIGHT = Float.parseFloat(Character.getProperty("DaggerVSLight", "1"));
*/
ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(Character.getProperty("EnableModifySkillDuration", "false"));
// Create Map only if enabled
if (ENABLE_MODIFY_SKILL_DURATION)
{
SKILL_DURATION_LIST = new FastMap<Integer, Integer>();
String[] propertySplit;
propertySplit = Character.getProperty("SkillDurationList", "").split(";");
for (String skill : propertySplit)
{
String[] skillSplit = skill.split(",");
if (skillSplit.length != 2)
_log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillDurationList \"", skill, "\""));
else
{
try
{
SKILL_DURATION_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
}
catch (NumberFormatException nfe)
{
if (!skill.isEmpty())
{
_log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
}
}
}
}
}
ENABLE_MODIFY_SKILL_REUSE = Boolean.parseBoolean(Character.getProperty("EnableModifySkillReuse", "false"));
// Create Map only if enabled
if (ENABLE_MODIFY_SKILL_REUSE)
{
SKILL_REUSE_LIST = new FastMap<Integer, Integer>();
String[] propertySplit;
propertySplit = Character.getProperty("SkillReuseList", "").split(";");
for (String skill : propertySplit)
{
String[] skillSplit = skill.split(",");
if (skillSplit.length != 2)
_log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillReuseList \"", skill, "\""));
else
{
try
{
SKILL_REUSE_LIST.put(Integer.valueOf(skillSplit[0]), Integer.valueOf(skillSplit[1]));
}
catch (NumberFormatException nfe)
{
if (!skill.isEmpty())
_log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
}
}
}
}
AUTO_LEARN_SKILLS = Boolean.parseBoolean(Character.getProperty("AutoLearnSkills", "false"));
AUTO_LOOT_HERBS = Boolean.parseBoolean(Character.getProperty("AutoLootHerbs", "false"));
BUFFS_MAX_AMOUNT = Byte.parseByte(Character.getProperty("maxbuffamount", "20"));
AUTO_LEARN_DIVINE_INSPIRATION = Boolean.parseBoolean(Character.getProperty("AutoLearnDivineInspiration", "false"));
ALT_GAME_CANCEL_BOW = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
ALT_GAME_CANCEL_CAST = Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
EFFECT_CANCELING = Boolean.parseBoolean(Character.getProperty("CancelLesserEffect", "True"));
ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(Character.getProperty("MagicFailures", "true"));
PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(Character.getProperty("PlayerFakeDeathUpProtection", "0"));
STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("StoreSkillCooltime", "true"));
SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(Character.getProperty("SubclassStoreSkillCooltime", "false"));
ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(Character.getProperty("AltShieldBlocks", "false"));
ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(Character.getProperty("AltPerfectShieldBlockRate", "10"));
ALLOW_CLASS_MASTERS = Boolean.parseBoolean(Character.getProperty("AllowClassMasters", "False"));
LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(Character.getProperty("LifeCrystalNeeded", "true"));
SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("SpBookNeeded", "false"));
ES_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("EnchantSkillSpBookNeeded", "true"));
DIVINE_SP_BOOK_NEEDED = Boolean.parseBoolean(Character.getProperty("DivineInspirationSpBookNeeded", "true"));
ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(Character.getProperty("AltGameSkillLearn", "false"));
ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(Character.getProperty("AltSubClassWithoutQuests", "False"));
MAX_RUN_SPEED = Integer.parseInt(Character.getProperty("MaxRunSpeed", "250"));
ENABLE_VITALITY = Boolean.parseBoolean(Character.getProperty("EnableVitality", "False"));
RECOVER_VITALITY_ON_RECONNECT = Boolean.parseBoolean(Character.getProperty("RecoverVitalityOnReconnect", "False"));
MAX_PCRIT_RATE = Integer.parseInt(Character.getProperty("MaxPCritRate", "500"));
MAX_MCRIT_RATE = Integer.parseInt(Character.getProperty("MaxMCritRate", "200"));
MAX_PATK_SPEED = Integer.parseInt(Character.getProperty("MaxPAtkSpeed", "1400"));
MAX_MATK_SPEED = Integer.parseInt(Character.getProperty("MaxMAtkSpeed", "1700"));
MAX_EVASION = Integer.parseInt(Character.getProperty("MaxEvasion", "200"));
MAX_SUBCLASS = Byte.parseByte(Character.getProperty("MaxSubclass", "3"));
MAX_SUBCLASS_LEVEL = Byte.parseByte(Character.getProperty("MaxSubclassLevel", "80"));
MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsDwarf", "4"));
MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreSellSlotsOther", "3"));
MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsDwarf", "5"));
MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(Character.getProperty("MaxPvtStoreBuySlotsOther", "4"));
INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForNoDwarf", "80"));
INVENTORY_MAXIMUM_DWARF = Integer.parseInt(Character.getProperty("MaximumSlotsForDwarf", "100"));
INVENTORY_MAXIMUM_GM = Integer.parseInt(Character.getProperty("MaximumSlotsForGMPlayer", "250"));
MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
WAREHOUSE_SLOTS_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
WAREHOUSE_SLOTS_CLAN = Integer.parseInt(Character.getProperty("MaximumWarehouseSlotsForClan", "150"));
FREIGHT_SLOTS = Integer.parseInt(Character.getProperty("MaximumFreightSlots", "20"));
ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("EnchantChanceWeapon", "50"));
ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("EnchantChanceArmor", "50"));
ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("EnchantChanceJewelry", "50"));
ENCHANT_CHANCE_ELEMENT = Integer.parseInt(Character.getProperty("EnchantChanceElement", "50"));
BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("BlessedEnchantChanceWeapon", "50"));
BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("BlessedEnchantChanceArmor", "50"));
BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("BlessedEnchantChanceJewelry", "50"));
CRYSTAL_ENCHANT_CHANCE_WEAPON = Integer.parseInt(Character.getProperty("CrystalEnchantChanceWeapon", "80"));
CRYSTAL_ENCHANT_CHANCE_ARMOR = Integer.parseInt(Character.getProperty("CrystalEnchantChanceArmor", "80"));
CRYSTAL_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(Character.getProperty("CrystalEnchantChanceJewelry", "80"));
ENCHANT_MAX_WEAPON = Integer.parseInt(Character.getProperty("EnchantMaxWeapon", "0"));
ENCHANT_MAX_ARMOR = Integer.parseInt(Character.getProperty("EnchantMaxArmor", "0"));
ENCHANT_MAX_JEWELRY = Integer.parseInt(Character.getProperty("EnchantMaxJewelry", "0"));
ENCHANT_SAFE_MAX = Integer.parseInt(Character.getProperty("EnchantSafeMax", "3"));
ENCHANT_SAFE_MAX_FULL = Integer.parseInt(Character.getProperty("EnchantSafeMaxFull", "4"));
AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGSkillChance", "15"));
AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationNGGlowChance", "0"));
AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidSkillChance", "30"));
AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationMidGlowChance", "40"));
AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighSkillChance", "45"));
AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationHighGlowChance", "70"));
AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopSkillChance", "60"));
AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(Character.getProperty("AugmentationTopGlowChance", "100"));
AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(Character.getProperty("AugmentationBaseStatChance", "1"));
AUGMENTATION_ACC_SKILL_CHANCE = Integer.parseInt(Character.getProperty("AugmentationAccSkillChance", "0"));
String[] array = Character.getProperty("AugmentationBlackList", "6656,6657,6658,6659,6660,6661,6662,8191,10170,10314").split(",");
AUGMENTATION_BLACKLIST = new int[array.length];
for (int i = 0; i < array.length; i++)
AUGMENTATION_BLACKLIST[i] = Integer.parseInt(array[i]);
Arrays.sort(AUGMENTATION_BLACKLIST);
ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanShop", "true"));
ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTeleport", "true"));
ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseGK", "false"));
ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTrade", "true"));
ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
MAX_PERSONAL_FAME_POINTS = Integer.parseInt(Character.getProperty("MaxPersonalFamePoints", "65535"));
FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("FortressZoneFameTaskFrequency", "300"));
FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("FortressZoneFameAquirePoints", "31"));
CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(Character.getProperty("CastleZoneFameTaskFrequency", "300"));
CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(Character.getProperty("CastleZoneFameAquirePoints", "125"));
IS_CRAFTING_ENABLED = Boolean.parseBoolean(Character.getProperty("CraftingEnabled", "true"));
CRAFT_MASTERWORK = Boolean.parseBoolean(Character.getProperty("CraftMasterwork", "True"));
DWARF_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("DwarfRecipeLimit", "50"));
COMMON_RECIPE_LIMIT = Integer.parseInt(Character.getProperty("CommonRecipeLimit", "50"));
ALT_GAME_CREATION = Boolean.parseBoolean(Character.getProperty("AltGameCreation", "false"));
ALT_GAME_CREATION_SPEED = Double.parseDouble(Character.getProperty("AltGameCreationSpeed", "1"));
ALT_GAME_CREATION_XP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationXpRate", "1"));
ALT_GAME_CREATION_SP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationSpRate", "1"));
ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(Character.getProperty("AltGameCreationRareXpSpRate", "2"));
ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(Character.getProperty("AltBlacksmithUseRecipes", "true"));
ALT_CLAN_JOIN_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeJoinAClan", "1"));
ALT_CLAN_CREATE_DAYS = Integer.parseInt(Character.getProperty("DaysBeforeCreateAClan", "10"));
ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(Character.getProperty("DaysToPassToDissolveAClan", "7"));
ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(Character.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(Character.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "10"));
ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(Character.getProperty("AltMaxNumOfClansInAlly", "3"));
ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(Character.getProperty("AltClanMembersForWar", "15"));
ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(Character.getProperty("AltMembersCanWithdrawFromClanWH", "false"));
REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(Character.getProperty("RemoveCastleCirclets", "true"));
ALT_PARTY_RANGE = Integer.parseInt(Character.getProperty("AltPartyRange", "1600"));
ALT_PARTY_RANGE2 = Integer.parseInt(Character.getProperty("AltPartyRange2", "1400"));
STARTING_ADENA = Long.parseLong(Character.getProperty("StartingAdena", "0"));
STARTING_LEVEL = Byte.parseByte(Character.getProperty("StartingLevel", "1"));
STARTING_SP = Integer.parseInt(Character.getProperty("StartingSP", "0"));
AUTO_LOOT = Boolean.parseBoolean(Character.getProperty("AutoLoot", "false"));
AUTO_LOOT_RAIDS = Boolean.parseBoolean(Character.getProperty("AutoLootRaids", "false"));
UNSTUCK_INTERVAL = Integer.parseInt(Character.getProperty("UnstuckInterval", "300"));
PLAYER_SPAWN_PROTECTION = Integer.parseInt(Character.getProperty("PlayerSpawnProtection", "0"));
RESPAWN_RANDOM_ENABLED = Boolean.parseBoolean(Character.getProperty("RespawnRandomInTown", "True"));
RESPAWN_RANDOM_MAX_OFFSET = Integer.parseInt(Character.getProperty("RespawnRandomMaxOffset", "50"));
RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(Character.getProperty("RestorePlayerInstance", "False"));
ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(Character.getProperty("AllowSummonToInstance", "True"));
PETITIONING_ALLOWED = Boolean.parseBoolean(Character.getProperty("PetitioningAllowed", "True"));
MAX_PETITIONS_PER_PLAYER = Integer.parseInt(Character.getProperty("MaxPetitionsPerPlayer", "5"));
MAX_PETITIONS_PENDING = Integer.parseInt(Character.getProperty("MaxPetitionsPending", "25"));
ALT_GAME_FREIGHTS = Boolean.parseBoolean(Character.getProperty("AltGameFreights", "true"));
ALT_GAME_FREIGHT_PRICE = Integer.parseInt(Character.getProperty("AltGameFreightPrice", "1000"));
ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(Character.getProperty("AltFreeTeleporting", "False"));
ALT_RECOMMEND = Boolean.parseBoolean(Character.getProperty("AltRecommend", "False"));
DELETE_DAYS = Integer.parseInt(Character.getProperty("DeleteCharAfterDays", "7"));
ALT_GAME_EXPONENT_XP = Float.parseFloat(Character.getProperty("AltGameExponentXp", "0."));
ALT_GAME_EXPONENT_SP = Float.parseFloat(Character.getProperty("AltGameExponentSp", "0."));
PARTY_XP_CUTOFF_METHOD = Character.getProperty("PartyXpCutoffMethod", "auto");
PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(Character.getProperty("PartyXpCutoffPercent", "3."));
PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(Character.getProperty("PartyXpCutoffLevel", "30"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + CHARACTER_CONFIG_FILE + " file.");
}
// Load L2J Server Version Properties file (if exists)
try
{
L2Properties serverVersion = new L2Properties();
is = new FileInputStream(new File(SERVER_VERSION_FILE));
serverVersion.load(is);
SERVER_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
SERVER_BUILD_DATE = serverVersion.getProperty("builddate", "Undefined Date.");
}
catch (Exception e)
{
// Ignore Properties file if it doesnt exist
SERVER_VERSION = "Unsupported Custom Version.";
SERVER_BUILD_DATE = "Undefined Date.";
}
// Load L2J Datapack Version Properties file (if exists)
try
{
L2Properties serverVersion = new L2Properties();
is = new FileInputStream(new File(DATAPACK_VERSION_FILE));
serverVersion.load(is);
DATAPACK_VERSION = serverVersion.getProperty("version", "Unsupported Custom Version.");
}
catch (Exception e)
{
// Ignore Properties file if it doesnt exist
DATAPACK_VERSION = "Unsupported Custom Version.";
}
// Load Telnet Properties file (if exists)
try
{
L2Properties telnetSettings = new L2Properties();
is = new FileInputStream(new File(TELNET_FILE));
telnetSettings.load(is);
IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + TELNET_FILE + " File.");
}
// MMO
try
{
_log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
L2Properties mmoSettings = new L2Properties();
is = new FileInputStream(new File(MMO_CONFIG_FILE));
mmoSettings.load(is);
MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
MMO_IO_SELECTOR_THREAD_COUNT = Integer.parseInt(mmoSettings.getProperty("IOSelectorThreadCount", "2"));
MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
}
// Load IdFactory Properties file (if exists)
try
{
L2Properties idSettings = new L2Properties();
is = new FileInputStream(new File(ID_CONFIG_FILE));
idSettings.load(is);
MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
BAD_ID_CHECKING = Boolean.parseBoolean(idSettings.getProperty("BadIdChecking", "True"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + ID_CONFIG_FILE + " file.");
}
// Load General Properties file (if exists)
try
{
L2Properties General = new L2Properties();
is = new FileInputStream(new File(GENERAL_CONFIG_FILE));
General.load(is);
EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(General.getProperty("EverybodyHasAdminRights", "false"));
DISPLAY_SERVER_VERSION = Boolean.parseBoolean(General.getProperty("DisplayServerRevision", "True"));
SERVER_LIST_BRACKET = Boolean.parseBoolean(General.getProperty("ServerListBrackets", "false"));
SERVER_LIST_CLOCK = Boolean.parseBoolean(General.getProperty("ServerListClock", "false"));
SERVER_GMONLY = Boolean.parseBoolean(General.getProperty("ServerGMOnly", "false"));
GM_HERO_AURA = Boolean.parseBoolean(General.getProperty("GMHeroAura", "False"));
GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(General.getProperty("GMStartupInvulnerable", "False"));
GM_STARTUP_INVISIBLE = Boolean.parseBoolean(General.getProperty("GMStartupInvisible", "False"));
GM_STARTUP_SILENCE = Boolean.parseBoolean(General.getProperty("GMStartupSilence", "False"));
GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(General.getProperty("GMStartupAutoList", "False"));
GM_STARTUP_DIET_MODE = Boolean.parseBoolean(General.getProperty("GMStartupDietMode", "False"));
GM_ADMIN_MENU_STYLE = General.getProperty("GMAdminMenuStyle", "modern");
GM_ITEM_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMItemRestriction", "True"));
GM_SKILL_RESTRICTION = Boolean.parseBoolean(General.getProperty("GMSkillRestriction", "True"));
GM_TRADE_RESTRICTED_ITEMS = Boolean.parseBoolean(General.getProperty("GMTradeRestrictedItems", "False"));
BYPASS_VALIDATION = Boolean.parseBoolean(General.getProperty("BypassValidation", "True"));
GAMEGUARD_ENFORCE = Boolean.parseBoolean(General.getProperty("GameGuardEnforce", "False"));
GAMEGUARD_PROHIBITACTION = Boolean.parseBoolean(General.getProperty("GameGuardProhibitAction", "False"));
LOG_CHAT = Boolean.parseBoolean(General.getProperty("LogChat", "false"));
LOG_ITEMS = Boolean.parseBoolean(General.getProperty("LogItems", "false"));
LOG_ITEM_ENCHANTS = Boolean.parseBoolean(General.getProperty("LogItemEnchants", "false"));
LOG_SKILL_ENCHANTS = Boolean.parseBoolean(General.getProperty("LogSkillEnchants", "false"));
GMAUDIT = Boolean.parseBoolean(General.getProperty("GMAudit", "False"));
LOG_GAME_DAMAGE = Boolean.parseBoolean(General.getProperty("LogGameDamage", "False"));
DEBUG = Boolean.parseBoolean(General.getProperty("Debug", "false"));
PACKET_HANDLER_DEBUG = Boolean.parseBoolean(General.getProperty("PacketHandlerDebug", "false"));
ASSERT = Boolean.parseBoolean(General.getProperty("Assert", "false"));
DEVELOPER = Boolean.parseBoolean(General.getProperty("Developer", "false"));
ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(General.getProperty("AcceptGeoeditorConn", "false"));
TEST_SERVER = Boolean.parseBoolean(General.getProperty("TestServer", "false"));
SERVER_LIST_TESTSERVER = Boolean.parseBoolean(General.getProperty("ListTestServers", "false"));
ALT_DEV_NO_QUESTS = Boolean.parseBoolean(General.getProperty("AltDevNoQuests", "False"));
ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(General.getProperty("AltDevNoSpawns", "False"));
THREAD_P_EFFECTS = Integer.parseInt(General.getProperty("ThreadPoolSizeEffects", "10"));
THREAD_P_GENERAL = Integer.parseInt(General.getProperty("ThreadPoolSizeGeneral", "13"));
IO_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("UrgentPacketThreadCoreSize", "2"));
GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralPacketThreadCoreSize", "4"));
GENERAL_THREAD_CORE_SIZE = Integer.parseInt(General.getProperty("GeneralThreadCoreSize", "4"));
AI_MAX_THREAD = Integer.parseInt(General.getProperty("AiMaxThread", "6"));
DEADLOCK_DETECTOR = Boolean.parseBoolean(General.getProperty("DeadLockDetector", "False"));
DEADLOCK_CHECK_INTERVAL = Integer.parseInt(General.getProperty("DeadLockCheckInterval", "20"));
RESTART_ON_DEADLOCK = Boolean.parseBoolean(General.getProperty("RestartOnDeadlock", "False"));
ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));
AUTODESTROY_ITEM_AFTER = Integer.parseInt(General.getProperty("AutoDestroyDroppedItemAfter", "600"));
HERB_AUTO_DESTROY_TIME = Integer.parseInt(General.getProperty("AutoDestroyHerbTime", "15")) * 1000;
PROTECTED_ITEMS = General.getProperty("ListOfProtectedItems", "0");
LIST_PROTECTED_ITEMS = new FastList<Integer>();
for (String id : PROTECTED_ITEMS.split(","))
{
LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
}
CHAR_STORE_INTERVAL = Integer.parseInt(General.getProperty("CharacterDataStoreInterval", "15"));
LAZY_ITEMS_UPDATE = Boolean.parseBoolean(General.getProperty("LazyItemsUpdate", "false"));
UPDATE_ITEMS_ON_CHAR_STORE = Boolean.parseBoolean(General.getProperty("UpdateItemsOnCharStore", "false"));
DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyPlayerDroppedItem", "false"));
DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(General.getProperty("DestroyEquipableItem", "false"));
SAVE_DROPPED_ITEM = Boolean.parseBoolean(General.getProperty("SaveDroppedItem", "false"));
EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(General.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(General.getProperty("SaveDroppedItemInterval", "60")) * 60000;
CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(General.getProperty("ClearDroppedItemTable", "false"));
AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(General.getProperty("AutoDeleteInvalidQuestData", "False"));
PRECISE_DROP_CALCULATION = Boolean.parseBoolean(General.getProperty("PreciseDropCalculation", "True"));
MULTIPLE_ITEM_DROP = Boolean.parseBoolean(General.getProperty("MultipleItemDrop", "True"));
FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(General.getProperty("ForceInventoryUpdate", "False"));
LAZY_CACHE = Boolean.parseBoolean(General.getProperty("LazyCache", "True"));
MIN_NPC_ANIMATION = Integer.parseInt(General.getProperty("MinNPCAnimation", "10"));
MAX_NPC_ANIMATION = Integer.parseInt(General.getProperty("MaxNPCAnimation", "20"));
MIN_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MinMonsterAnimation", "5"));
MAX_MONSTER_ANIMATION = Integer.parseInt(General.getProperty("MaxMonsterAnimation", "20"));
MOVE_BASED_KNOWNLIST = Boolean.parseBoolean(General.getProperty("MoveBasedKnownlist", "False"));
KNOWNLIST_UPDATE_INTERVAL = Long.parseLong(General.getProperty("KnownListUpdateInterval", "1250"));
GRIDS_ALWAYS_ON = Boolean.parseBoolean(General.getProperty("GridsAlwaysOn", "False"));
GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOnTime", "1"));
GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(General.getProperty("GridNeighborTurnOffTime", "90"));
GEODATA_PATH = Paths.get(General.getString("GeoDataPath", "./data/geodata"));
TRY_LOAD_UNSPECIFIED_REGIONS = General.getBoolean("TryLoadUnspecifiedRegions", true);
GEODATA_REGIONS = new HashMap<>();
for (int regionX = L2World.TILE_X_MIN; regionX <= L2World.TILE_X_MAX; regionX++)
{
for (int regionY = L2World.TILE_Y_MIN; regionY <= L2World.TILE_Y_MAX; regionY++)
{
String key = regionX + "_" + regionY;
if (General.containsKey(regionX + "_" + regionY))
{
GEODATA_REGIONS.put(key, General.getBoolean(key, false));
}
}
}
GEODATA = Integer.parseInt(General.getProperty("GeoData", "0"));
GEODATA_CELLFINDING = Boolean.parseBoolean(General.getProperty("CellPathFinding", "False"));
FORCE_GEODATA = Boolean.parseBoolean(General.getProperty("ForceGeodata", "True"));
COORD_SYNCHRONIZE = Integer.parseInt(General.getProperty("CoordSynchronize", "-1"));
ZONE_TOWN = Integer.parseInt(General.getProperty("ZoneTown", "0"));
ACTIVATE_POSITION_RECORDER = Boolean.parseBoolean(General.getProperty("ActivatePositionRecorder", "False"));
DEFAULT_GLOBAL_CHAT = General.getProperty("GlobalChat", "ON");
DEFAULT_TRADE_CHAT = General.getProperty("TradeChat", "LIMITED");
ALLOW_WAREHOUSE = Boolean.parseBoolean(General.getProperty("AllowWarehouse", "True"));
WAREHOUSE_CACHE = Boolean.parseBoolean(General.getProperty("WarehouseCache", "False"));
WAREHOUSE_CACHE_TIME = Integer.parseInt(General.getProperty("WarehouseCacheTime", "15"));
ALLOW_FREIGHT = Boolean.parseBoolean(General.getProperty("AllowFreight", "True"));
ALLOW_WEAR = Boolean.parseBoolean(General.getProperty("AllowWear", "False"));
WEAR_DELAY = Integer.parseInt(General.getProperty("WearDelay", "5"));
WEAR_PRICE = Integer.parseInt(General.getProperty("WearPrice", "10"));
ALLOW_LOTTERY = Boolean.parseBoolean(General.getProperty("AllowLottery", "True"));
ALLOW_RACE = Boolean.parseBoolean(General.getProperty("AllowRace", "True"));
ALLOW_WATER = Boolean.parseBoolean(General.getProperty("AllowWater", "True"));
ALLOW_RENTPET = Boolean.parseBoolean(General.getProperty("AllowRentPet", "False"));
ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));
ALLOWFISHING = Boolean.parseBoolean(General.getProperty("AllowFishing", "True"));
ALLOW_MANOR = Boolean.parseBoolean(General.getProperty("AllowManor", "True"));
ALLOW_BOAT = Boolean.parseBoolean(General.getProperty("AllowBoat", "True"));
ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(General.getProperty("AllowCursedWeapons", "True"));
ALLOW_NPC_WALKERS = Boolean.parseBoolean(General.getProperty("AllowNpcWalkers", "true"));
ALLOW_PET_WALKERS = Boolean.parseBoolean(General.getProperty("AllowPetWalkers", "True"));
SERVER_NEWS = Boolean.parseBoolean(General.getProperty("ShowServerNews", "False"));
COMMUNITY_TYPE = Integer.parseInt(General.getProperty("CommunityType", "1"));
BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(General.getProperty("BBSShowPlayerList", "false"));
BBS_DEFAULT = General.getProperty("BBSDefault", "_bbshome");
SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowLevelOnCommunityBoard", "False"));
SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(General.getProperty("ShowStatusOnCommunityBoard", "True"));
NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePageSizeOnCommunityBoard", "50"));
NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(General.getProperty("NamePerRowOnCommunityBoard", "5"));
ALT_OLY_START_TIME = Integer.parseInt(General.getProperty("AltOlyStartTime", "18"));
ALT_OLY_MIN = Integer.parseInt(General.getProperty("AltOlyMin", "00"));
ALT_OLY_CPERIOD = Long.parseLong(General.getProperty("AltOlyCPeriod", "21600000"));
ALT_OLY_BATTLE = Long.parseLong(General.getProperty("AltOlyBattle", "360000"));
ALT_OLY_WPERIOD = Long.parseLong(General.getProperty("AltOlyWPeriod", "604800000"));
ALT_OLY_VPERIOD = Long.parseLong(General.getProperty("AltOlyVPeriod", "86400000"));
ALT_OLY_CLASSED = Integer.parseInt(General.getProperty("AltOlyClassedParticipants", "5"));
ALT_OLY_NONCLASSED = Integer.parseInt(General.getProperty("AltOlyNonClassedParticipants", "9"));
ALT_OLY_REG_DISPLAY = Integer.parseInt(General.getProperty("AltOlyRegistrationDisplayNumber", "100"));
ALT_OLY_BATTLE_REWARD_ITEM = Integer.parseInt(General.getProperty("AltOlyBattleRewItem", "6651"));
ALT_OLY_CLASSED_RITEM_C = Integer.parseInt(General.getProperty("AltOlyClassedRewItemCount", "50"));
ALT_OLY_NONCLASSED_RITEM_C = Integer.parseInt(General.getProperty("AltOlyNonClassedRewItemCount", "30"));
ALT_OLY_COMP_RITEM = Integer.parseInt(General.getProperty("AltOlyCompRewItem", "13722"));
ALT_OLY_GP_PER_POINT = Integer.parseInt(General.getProperty("AltOlyGPPerPoint", "1000"));
ALT_OLY_HERO_POINTS = Integer.parseInt(General.getProperty("AltOlyHeroPoints", "180"));
ALT_OLY_RANK1_POINTS = Integer.parseInt(General.getProperty("AltOlyRank1Points", "120"));
ALT_OLY_RANK2_POINTS = Integer.parseInt(General.getProperty("AltOlyRank2Points", "80"));
ALT_OLY_RANK3_POINTS = Integer.parseInt(General.getProperty("AltOlyRank3Points", "55"));
ALT_OLY_RANK4_POINTS = Integer.parseInt(General.getProperty("AltOlyRank4Points", "35"));
ALT_OLY_RANK5_POINTS = Integer.parseInt(General.getProperty("AltOlyRank5Points", "20"));
ALT_OLY_MAX_POINTS = Integer.parseInt(General.getProperty("AltOlyMaxPoints", "10"));
ALT_OLY_LOG_FIGHTS = Boolean.parseBoolean(General.getProperty("AlyOlyLogFights", "false"));
ALT_OLY_SHOW_MONTHLY_WINNERS = Boolean.parseBoolean(General.getProperty("AltOlyShowMonthlyWinners", "true"));
ALT_OLY_ANNOUNCE_GAMES = Boolean.parseBoolean(General.getProperty("AltOlyAnnounceGames", "true"));
LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
for (String id : General.getProperty("AltOlyRestrictedItems", "0").split(","))
{
LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
}
ALT_OLY_ENCHANT_LIMIT = Integer.parseInt(General.getProperty("AltOlyEnchantLimit", "-1"));
ALT_MANOR_REFRESH_TIME = Integer.parseInt(General.getProperty("AltManorRefreshTime", "20"));
ALT_MANOR_REFRESH_MIN = Integer.parseInt(General.getProperty("AltManorRefreshMin", "00"));
ALT_MANOR_APPROVE_TIME = Integer.parseInt(General.getProperty("AltManorApproveTime", "6"));
ALT_MANOR_APPROVE_MIN = Integer.parseInt(General.getProperty("AltManorApproveMin", "00"));
ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(General.getProperty("AltManorMaintenancePeriod", "360000"));
ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(General.getProperty("AltManorSaveAllActions", "false"));
ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(General.getProperty("AltManorSavePeriodRate", "2"));
ALT_LOTTERY_PRIZE = Long.parseLong(General.getProperty("AltLotteryPrize", "50000"));
ALT_LOTTERY_TICKET_PRICE = Long.parseLong(General.getProperty("AltLotteryTicketPrice", "2000"));
ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery5NumberRate", "0.6"));
ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery4NumberRate", "0.2"));
ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(General.getProperty("AltLottery3NumberRate", "0.2"));
ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Long.parseLong(General.getProperty("AltLottery2and1NumberPrize", "200"));
FS_TIME_ATTACK = Integer.parseInt(General.getProperty("TimeOfAttack", "50"));
FS_TIME_COOLDOWN = Integer.parseInt(General.getProperty("TimeOfCoolDown", "5"));
FS_TIME_ENTRY = Integer.parseInt(General.getProperty("TimeOfEntry", "3"));
FS_TIME_WARMUP = Integer.parseInt(General.getProperty("TimeOfWarmUp", "2"));
FS_PARTY_MEMBER_COUNT = Integer.parseInt(General.getProperty("NumberOfNecessaryPartyMembers", "4"));
if (FS_TIME_ATTACK <= 0)
FS_TIME_ATTACK = 50;
if (FS_TIME_COOLDOWN <= 0)
FS_TIME_COOLDOWN = 5;
if (FS_TIME_ENTRY <= 0)
FS_TIME_ENTRY = 3;
if (FS_TIME_ENTRY <= 0)
FS_TIME_ENTRY = 3;
if (FS_TIME_ENTRY <= 0)
FS_TIME_ENTRY = 3;
RIFT_MIN_PARTY_SIZE = Integer.parseInt(General.getProperty("RiftMinPartySize", "5"));
RIFT_MAX_JUMPS = Integer.parseInt(General.getProperty("MaxRiftJumps", "4"));
RIFT_SPAWN_DELAY = Integer.parseInt(General.getProperty("RiftSpawnDelay", "10000"));
RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(General.getProperty("AutoJumpsDelayMin", "480"));
RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(General.getProperty("AutoJumpsDelayMax", "600"));
RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(General.getProperty("BossRoomTimeMultiply", "1.5"));
RIFT_ENTER_COST_RECRUIT = Integer.parseInt(General.getProperty("RecruitCost", "18"));
RIFT_ENTER_COST_SOLDIER = Integer.parseInt(General.getProperty("SoldierCost", "21"));
RIFT_ENTER_COST_OFFICER = Integer.parseInt(General.getProperty("OfficerCost", "24"));
RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(General.getProperty("CaptainCost", "27"));
RIFT_ENTER_COST_COMMANDER = Integer.parseInt(General.getProperty("CommanderCost", "30"));
RIFT_ENTER_COST_HERO = Integer.parseInt(General.getProperty("HeroCost", "33"));
DEFAULT_PUNISH = Integer.parseInt(General.getProperty("DefaultPunish", "2"));
DEFAULT_PUNISH_PARAM = Integer.parseInt(General.getProperty("DefaultPunishParam", "0"));
ONLY_GM_ITEMS_FREE = Boolean.parseBoolean(General.getProperty("OnlyGMItemsFree", "True"));
JAIL_IS_PVP = Boolean.parseBoolean(General.getProperty("JailIsPvp", "True"));
JAIL_DISABLE_CHAT = Boolean.parseBoolean(General.getProperty("JailDisableChat", "True"));
CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(General.getProperty("CustomSpawnlistTable", "false"));
SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("SaveGmSpawnOnCustom", "false"));
DELETE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(General.getProperty("DeleteGmSpawnOnCustom", "false"));
CUSTOM_NPC_TABLE = Boolean.valueOf(General.getProperty("CustomNpcTable", "false"));
CUSTOM_ITEM_TABLES = Boolean.valueOf(General.getProperty("CustomItemTables", "false"));
CUSTOM_ARMORSETS_TABLE = Boolean.valueOf(General.getProperty("CustomArmorSetsTable", "false"));
CUSTOM_TELEPORT_TABLE = Boolean.valueOf(General.getProperty("CustomTeleportTable", "false"));
CUSTOM_DROPLIST_TABLE = Boolean.valueOf(General.getProperty("CustomDroplistTable", "false"));
CUSTOM_MERCHANT_TABLES = Boolean.valueOf(General.getProperty("CustomMerchantTables", "false"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + GENERAL_CONFIG_FILE + " File.");
}
// Load FloodProtector Properties file
try
{
L2Properties security = new L2Properties();
is = new FileInputStream(new File(FLOOD_PROTECTOR_FILE));
security.load(is);
loadFloodProtectorConfigs(security);
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + FLOOD_PROTECTOR_FILE);
}
// Load NPC Properties file (if exists)
try
{
L2Properties NPC = new L2Properties();
is = new FileInputStream(new File(NPC_CONFIG_FILE));
NPC.load(is);
ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(NPC.getProperty("AnnounceMammonSpawn", "False"));
ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(NPC.getProperty("AltMobAgroInPeaceZone", "True"));
ALT_ATTACKABLE_NPCS = Boolean.parseBoolean(NPC.getProperty("AltAttackableNpcs", "True"));
ALT_GAME_VIEWNPC = Boolean.parseBoolean(NPC.getProperty("AltGameViewNpc", "False"));
MAX_DRIFT_RANGE = Integer.parseInt(NPC.getProperty("MaxDriftRange", "300"));
DEEPBLUE_DROP_RULES = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRules", "True"));
DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRulesRaid", "True"));
SHOW_NPC_LVL = Boolean.parseBoolean(NPC.getProperty("ShowNpcLevel", "False"));
ENABLE_DROP_VITALITY_HERBS = Boolean.parseBoolean(NPC.getProperty("EnableVitalityHerbs", "False"));
GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
PET_RENT_NPC = NPC.getProperty("ListPetRentNpc", "30827");
LIST_PET_RENT_NPC = new FastList<Integer>();
for (String id : PET_RENT_NPC.split(","))
{
LIST_PET_RENT_NPC.add(Integer.parseInt(id));
}
RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidHpRegenMultiplier", "100")) / 100;
RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMpRegenMultiplier", "100")) / 100;
RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidPDefenceMultiplier", "100")) / 100;
RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMDefenceMultiplier", "100")) / 100;
RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMinRespawnMultiplier", "1.0"));
RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMaxRespawnMultiplier", "1.0"));
RAID_MINION_RESPAWN_TIMER = Integer.parseInt(NPC.getProperty("RaidMinionRespawnTime", "300000"));
RAID_DISABLE_CURSE = Boolean.parseBoolean(NPC.getProperty("DisableRaidCurse", "False"));
INVENTORY_MAXIMUM_PET = Integer.parseInt(NPC.getProperty("MaximumSlotsForPet", "12"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + NPC_CONFIG_FILE + " File.");
}
try
{
L2Properties Luna = new L2Properties();
is = new FileInputStream(new File(LUNA));
Luna.load(is);
BALANCE_SKILL_LIST = new FastMap<Integer, Double>();
String[] propertySplit;
propertySplit = Luna.getProperty("Balance_Skill_List", "").split(";");
for (String skillId : propertySplit)
{
String[] skillSplit = skillId.split(",");
if (skillSplit.length != 2)
_log.warning(StringUtil.concat("[SkillBalanceList]: invalid config property -> SkillBalanceList \"", skillId, "\""));
else
{
try
{
BALANCE_SKILL_LIST.put(Integer.parseInt(skillSplit[0]), Double.parseDouble(skillSplit[1]));
}
catch (NumberFormatException nfe)
{
if (!skillId.isEmpty())
{
_log.warning(StringUtil.concat("[SkillBalanceList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
}
}
}
}
KAMALOKA_DROPS_TO_FULL_PARTY_ONLY = Boolean.parseBoolean(Luna.getProperty("Kamaloka_drop_to_full_party_only", "True"));
PVP_CLASS_BALANCE_DUELIST = Double.parseDouble(Luna.getProperty("pvp_duelist", "1"));
PVP_CLASS_BALANCE_DREADNOUGHT = Double.parseDouble(Luna.getProperty("pvp_dreadnought", "1"));
PVP_CLASS_BALANCE_PHOENIX_KNIGHT = Double.parseDouble(Luna.getProperty("pvp_phoenix_knight", "1"));
PVP_CLASS_BALANCE_HELL_KNIGHT = Double.parseDouble(Luna.getProperty("pvp_hell_knight", "1"));
PVP_CLASS_BALANCE_SAGITTARIUS = Double.parseDouble(Luna.getProperty("pvp_sagittarius", "1"));
PVP_CLASS_BALANCE_ADVENTURER = Double.parseDouble(Luna.getProperty("pvp_adventurer", "1"));
PVP_CLASS_BALANCE_ARCHMAGE = Double.parseDouble(Luna.getProperty("pvp_archmage", "1"));
PVP_CLASS_BALANCE_SOULTAKER = Double.parseDouble(Luna.getProperty("pvp_soultaker", "1"));
PVP_CLASS_BALANCE_ARCANA_LORD = Double.parseDouble(Luna.getProperty("pvp_arcana_lord", "1"));
PVP_CLASS_BALANCE_CARDINAL = Double.parseDouble(Luna.getProperty("pvp_cardinal", "1"));
PVP_CLASS_BALANCE_HIEROPHANT = Double.parseDouble(Luna.getProperty("pvp_hierophant", "1"));
PVP_CLASS_BALANCE_EVA_TEMPLAR = Double.parseDouble(Luna.getProperty("pvp_eva_templar", "1"));
PVP_CLASS_BALANCE_SWORD_MUSE = Double.parseDouble(Luna.getProperty("pvp_sword_muse", "1"));
PVP_CLASS_BALANCE_WIND_RIDER = Double.parseDouble(Luna.getProperty("pvp_wind_rider", "1"));
PVP_CLASS_BALANCE_MOONLIGHT_SENTINEL = Double.parseDouble(Luna.getProperty("pvp_moonlight_sentinel", "1"));
PVP_CLASS_BALANCE_MYSTIC_MUSE = Double.parseDouble(Luna.getProperty("pvp_mystic_muse", "1"));
PVP_CLASS_BALANCE_ELEMENTAL_MASTER = Double.parseDouble(Luna.getProperty("pvp_elemental_master", "1"));
PVP_CLASS_BALANCE_EVA_SAINT = Double.parseDouble(Luna.getProperty("pvp_eva_saint", "1"));
PVP_CLASS_BALANCE_SHILLIEN_TEMPLAR = Double.parseDouble(Luna.getProperty("pvp_shillien_templar", "1"));
PVP_CLASS_BALANCE_SPECTRAL_DANCER = Double.parseDouble(Luna.getProperty("pvp_spectral_dancer", "1"));
PVP_CLASS_BALANCE_GHOST_HUNTER = Double.parseDouble(Luna.getProperty("pvp_ghost_hunter", "1"));
PVP_CLASS_BALANCE_GHOST_SENTINEL = Double.parseDouble(Luna.getProperty("pvp_ghost_sentinel", "1"));
PVP_CLASS_BALANCE_STORM_SCREAMER = Double.parseDouble(Luna.getProperty("pvp_storm_screamer", "1"));
PVP_CLASS_BALANCE_SPECTRAL_MASTER = Double.parseDouble(Luna.getProperty("pvp_spectral_master", "1"));
PVP_CLASS_BALANCE_SHILLIEN_SAINT = Double.parseDouble(Luna.getProperty("pvp_shillien_saint", "1"));
PVP_CLASS_BALANCE_TITAN = Double.parseDouble(Luna.getProperty("pvp_titan", "1"));
PVP_CLASS_BALANCE_GRAND_KHAUATARI = Double.parseDouble(Luna.getProperty("pvp_grand_khauatari", "1"));
PVP_CLASS_BALANCE_DOMINATOR = Double.parseDouble(Luna.getProperty("pvp_dominator", "1"));
PVP_CLASS_BALANCE_DOOMCRYER = Double.parseDouble(Luna.getProperty("pvp_doomcryer", "1"));
PVP_CLASS_BALANCE_FORTUNE_SEEKER = Double.parseDouble(Luna.getProperty("pvp_fortune_seeker", "1"));
PVP_CLASS_BALANCE_MAESTRO = Double.parseDouble(Luna.getProperty("pvp_maestro", "1"));
PVP_CLASS_BALANCE_DOOMBRINGER = Double.parseDouble(Luna.getProperty("pvp_doombringer", "1"));
PVP_CLASS_BALANCE_MALE_SOULHOUND = Double.parseDouble(Luna.getProperty("pvp_male_soulhound", "1"));
PVP_CLASS_BALANCE_FEMALE_SOULHOUND = Double.parseDouble(Luna.getProperty("pvp_female_soulhound", "1"));
PVP_CLASS_BALANCE_TRICKSTER = Double.parseDouble(Luna.getProperty("pvp_trickster", "1"));
PVP_CLASS_BALANCE_INSPECTOR = Double.parseDouble(Luna.getProperty("pvp_inspector", "1"));
PVP_CLASS_BALANCE_JUDICATOR = Double.parseDouble(Luna.getProperty("pvp_judicator", "1"));
PVE_CLASS_BALANCE_DUELIST = Double.parseDouble(Luna.getProperty("pve_duelist", "1"));
PVE_CLASS_BALANCE_DREADNOUGHT = Double.parseDouble(Luna.getProperty("pve_dreadnought", "1"));
PVE_CLASS_BALANCE_PHOENIX_KNIGHT = Double.parseDouble(Luna.getProperty("pve_phoenix_knight", "1"));
PVE_CLASS_BALANCE_HELL_KNIGHT = Double.parseDouble(Luna.getProperty("pve_hell_knight", "1"));
PVE_CLASS_BALANCE_SAGITTARIUS = Double.parseDouble(Luna.getProperty("pve_sagittarius", "1"));
PVE_CLASS_BALANCE_ADVENTURER = Double.parseDouble(Luna.getProperty("pve_adventurer", "1"));
PVE_CLASS_BALANCE_ARCHMAGE = Double.parseDouble(Luna.getProperty("pve_archmage", "1"));
PVE_CLASS_BALANCE_SOULTAKER = Double.parseDouble(Luna.getProperty("pve_soultaker", "1"));
PVE_CLASS_BALANCE_ARCANA_LORD = Double.parseDouble(Luna.getProperty("pve_arcana_lord", "1"));
PVE_CLASS_BALANCE_CARDINAL = Double.parseDouble(Luna.getProperty("pve_cardinal", "1"));
PVE_CLASS_BALANCE_HIEROPHANT = Double.parseDouble(Luna.getProperty("pve_hierophant", "1"));
PVE_CLASS_BALANCE_EVA_TEMPLAR = Double.parseDouble(Luna.getProperty("pve_eva_templar", "1"));
PVE_CLASS_BALANCE_SWORD_MUSE = Double.parseDouble(Luna.getProperty("pve_sword_muse", "1"));
PVE_CLASS_BALANCE_WIND_RIDER = Double.parseDouble(Luna.getProperty("pve_wind_rider", "1"));
PVE_CLASS_BALANCE_MOONLIGHT_SENTINEL = Double.parseDouble(Luna.getProperty("pve_moonlight_sentinel", "1"));
PVE_CLASS_BALANCE_MYSTIC_MUSE = Double.parseDouble(Luna.getProperty("pve_mystic_muse", "1"));
PVE_CLASS_BALANCE_ELEMENTAL_MASTER = Double.parseDouble(Luna.getProperty("pve_elemental_master", "1"));
PVE_CLASS_BALANCE_EVA_SAINT = Double.parseDouble(Luna.getProperty("pve_eva_saint", "1"));
PVE_CLASS_BALANCE_SHILLIEN_TEMPLAR = Double.parseDouble(Luna.getProperty("pve_shillien_templar", "1"));
PVE_CLASS_BALANCE_SPECTRAL_DANCER = Double.parseDouble(Luna.getProperty("pve_spectral_dancer", "1"));
PVE_CLASS_BALANCE_GHOST_HUNTER = Double.parseDouble(Luna.getProperty("pve_ghost_hunter", "1"));
PVE_CLASS_BALANCE_GHOST_SENTINEL = Double.parseDouble(Luna.getProperty("pve_ghost_sentinel", "1"));
PVE_CLASS_BALANCE_STORM_SCREAMER = Double.parseDouble(Luna.getProperty("pve_storm_screamer", "1"));
PVE_CLASS_BALANCE_SPECTRAL_MASTER = Double.parseDouble(Luna.getProperty("pve_spectral_master", "1"));
PVE_CLASS_BALANCE_SHILLIEN_SAINT = Double.parseDouble(Luna.getProperty("pve_shillien_saint", "1"));
PVE_CLASS_BALANCE_TITAN = Double.parseDouble(Luna.getProperty("pve_titan", "1"));
PVE_CLASS_BALANCE_GRAND_KHAUATARI = Double.parseDouble(Luna.getProperty("pve_grand_khauatari", "1"));
PVE_CLASS_BALANCE_DOMINATOR = Double.parseDouble(Luna.getProperty("pve_dominator", "1"));
PVE_CLASS_BALANCE_DOOMCRYER = Double.parseDouble(Luna.getProperty("pve_doomcryer", "1"));
PVE_CLASS_BALANCE_FORTUNE_SEEKER = Double.parseDouble(Luna.getProperty("pve_fortune_seeker", "1"));
PVE_CLASS_BALANCE_MAESTRO = Double.parseDouble(Luna.getProperty("pve_maestro", "1"));
PVE_CLASS_BALANCE_DOOMBRINGER = Double.parseDouble(Luna.getProperty("pve_doombringer", "1"));
PVE_CLASS_BALANCE_MALE_SOULHOUND = Double.parseDouble(Luna.getProperty("pve_male_soulhound", "1"));
PVE_CLASS_BALANCE_FEMALE_SOULHOUND = Double.parseDouble(Luna.getProperty("pve_female_soulhound", "1"));
PVE_CLASS_BALANCE_TRICKSTER = Double.parseDouble(Luna.getProperty("pve_trickster", "1"));
PVE_CLASS_BALANCE_INSPECTOR = Double.parseDouble(Luna.getProperty("pve_inspector", "1"));
PVE_CLASS_BALANCE_JUDICATOR = Double.parseDouble(Luna.getProperty("pve_judicator", "1"));
// CAPTCHA ANTIBOT
BOTS_PREVENTION = Boolean.parseBoolean(Luna.getProperty("EnableBotsPrevention", "false"));
KILLS_COUNTER = Integer.parseInt(Luna.getProperty("KillsCounter", "60"));
KILLS_COUNTER_RANDOMIZATION = Integer.parseInt(Luna.getProperty("KillsCounterRandomization", "50"));
VALIDATION_TIME = Integer.parseInt(Luna.getProperty("ValidationTime", "60"));
PUNISHMENT = Integer.parseInt(Luna.getProperty("Punishment", "0"));
PUNISHMENT_TIME = Integer.parseInt(Luna.getProperty("PunishmentTime", "60"));
PUNISHMENT_TIME_BONUS_1 = Integer.parseInt(Luna.getProperty("PunishmentTimeBonus1", "15"));
PUNISHMENT_TIME_BONUS_2 = Integer.parseInt(Luna.getProperty("PunishmentTimeBonus2", "20"));
PUNISHMENT_TIME_BONUS_3 = Integer.parseInt(Luna.getProperty("PunishmentTimeBonus3", "25"));
PUNISHMENT_TIME_BONUS_4 = Integer.parseInt(Luna.getProperty("PunishmentTimeBonus4", "30"));
PUNISHMENT_TIME_BONUS_5 = Integer.parseInt(Luna.getProperty("PunishmentTimeBonus5", "45"));
PUNISHMENT_TIME_BONUS_6 = Integer.parseInt(Luna.getProperty("PunishmentTimeBonus6", "125"));
PUNISHMENT_REPORTS1 = Integer.parseInt(Luna.getProperty("PunishmentReports1", "3"));
PUNISHMENT_REPORTS2 = Integer.parseInt(Luna.getProperty("PunishmentReports2", "5"));
PUNISHMENT_REPORTS3 = Integer.parseInt(Luna.getProperty("PunishmentReports3", "7"));
PUNISHMENT_REPORTS4 = Integer.parseInt(Luna.getProperty("PunishmentReports4", "9"));
PUNISHMENT_REPORTS5 = Integer.parseInt(Luna.getProperty("PunishmentReports5", "10"));
PUNISHMENT_REPORTS6 = Integer.parseInt(Luna.getProperty("PunishmentReports6", "15"));
ESCAPE_PUNISHMENT_REPORTS_COUNT = Integer.parseInt(Luna.getProperty("EscapeReports", "1"));
KICK_PUNISHMENT_REPORTS_COUNT = Integer.parseInt(Luna.getProperty("KickReports", "2"));
JAIL_PUNISHMENT_REPORTS_COUNT = Integer.parseInt(Luna.getProperty("JailReports", "3"));
titanium_default_bow_default = Double.parseDouble(Luna.getProperty("titanium_default_bow_default", "0.0"));
titanium_default_cross_default = Double.parseDouble(Luna.getProperty("titanium_default_cross_default", "0.0"));
titanium_default_bigb_default = Double.parseDouble(Luna.getProperty("titanium_default_bigb_default", "0.0"));
titanium_default_dual_default = Double.parseDouble(Luna.getProperty("titanium_default_dual_default", "0.0"));
titanium_default_val = Double.parseDouble(Luna.getProperty("titanium_default_val", "0.0"));
titanium_over_bow_default = Double.parseDouble(Luna.getProperty("titanium_over_bow_default", "0.0"));
titanium_over_cross_default = Double.parseDouble(Luna.getProperty("titanium_over_cross_default", "0.0"));
titanium_over_bigb_default = Double.parseDouble(Luna.getProperty("titanium_over_bigb_default", "0.0"));
titanium_over_dual_default = Double.parseDouble(Luna.getProperty("titanium_over_dual_default", "0.0"));
titanium_over_default = Double.parseDouble(Luna.getProperty("titanium_over_default", "0.0"));
titanium_super_bow_default = Double.parseDouble(Luna.getProperty("titanium_super_bow_default", "0.0"));
titanium_super_cross_default = Double.parseDouble(Luna.getProperty("titanium_super_cross_default", "0.0"));
titanium_super_bigb_default = Double.parseDouble(Luna.getProperty("titanium_super_bigb_default", "0.0"));
titanium_super_dual_default = Double.parseDouble(Luna.getProperty("titanium_super_dual_default", "0.0"));
titanium_super_default = Double.parseDouble(Luna.getProperty("titanium_super_default", "0.0"));
dread_default_bow_default = Double.parseDouble(Luna.getProperty("dread_default_bow_default", "0.0"));
dread_default_cross_default = Double.parseDouble(Luna.getProperty("dread_default_cross_default", "0.0"));
dread_default_bigb_default = Double.parseDouble(Luna.getProperty("dread_default_bigb_default", "0.0"));
dread_default_dual_default = Double.parseDouble(Luna.getProperty("dread_default_dual_default", "0.0"));
dread_default_val = Double.parseDouble(Luna.getProperty("dread_default_val", "0.0"));
dread_over_bow_default = Double.parseDouble(Luna.getProperty("dread_over_bow_default", "0.0"));
dread_over_cross_default = Double.parseDouble(Luna.getProperty("dread_over_cross_default", "0.0"));
dread_over_bigb_default = Double.parseDouble(Luna.getProperty("dread_over_bigb_default", "0.0"));
dread_over_dual_default = Double.parseDouble(Luna.getProperty("dread_over_dual_default", "0.0"));
dread_over_default = Double.parseDouble(Luna.getProperty("dread_over_default", "0.0"));
dread_super_bow_default = Double.parseDouble(Luna.getProperty("dread_super_bow_default", "0.0"));
dread_super_cross_default = Double.parseDouble(Luna.getProperty("dread_super_cross_default", "0.0"));
dread_super_bigb_default = Double.parseDouble(Luna.getProperty("dread_super_bigb_default", "0.0"));
dread_super_dual_default = Double.parseDouble(Luna.getProperty("dread_super_dual_default", "0.0"));
dread_super_default = Double.parseDouble(Luna.getProperty("dread_super_default", "0.0"));
corrupted_default_bow_default = Double.parseDouble(Luna.getProperty("corrupted_default_bow_default", "0.0"));
corrupted_default_cross_default = Double.parseDouble(Luna.getProperty("corrupted_default_cross_default", "0.0"));
corrupted_default_bigb_default = Double.parseDouble(Luna.getProperty("corrupted_default_bigb_default", "0.0"));
corrupted_default_dual_default = Double.parseDouble(Luna.getProperty("corrupted_default_dual_default", "0.0"));
corrupted_default_val = Double.parseDouble(Luna.getProperty("corrupted_default_val", "0.0"));
corrupted_over_bow_default = Double.parseDouble(Luna.getProperty("corrupted_over_bow_default", "0.0"));
corrupted_over_cross_default = Double.parseDouble(Luna.getProperty("corrupted_over_cross_default", "0.0"));
corrupted_over_bigb_default = Double.parseDouble(Luna.getProperty("corrupted_over_bigb_default", "0.0"));
corrupted_over_dual_default = Double.parseDouble(Luna.getProperty("corrupted_over_dual_default", "0.0"));
corrupted_over_default = Double.parseDouble(Luna.getProperty("corrupted_over_default", "0.0"));
corrupted_super_bow_default = Double.parseDouble(Luna.getProperty("corrupted_super_bow_default", "0.0"));
corrupted_super_cross_default = Double.parseDouble(Luna.getProperty("corrupted_super_cross_default", "0.0"));
corrupted_super_bigb_default = Double.parseDouble(Luna.getProperty("corrupted_super_bigb_default", "0.0"));
corrupted_super_dual_default = Double.parseDouble(Luna.getProperty("corrupted_super_dual_default", "0.0"));
corrupted_super_default = Double.parseDouble(Luna.getProperty("corrupted_super_default", "0.0"));
ENCHANT_BONUS_TIER_2 = Integer.parseInt(Luna.getProperty("EnchantBonus_Tier_2", "20"));
ENCHANT_BONUS_TIER_2_5 = Integer.parseInt(Luna.getProperty("EnchantBonus_Tier_2_5", "17"));
ENCHANT_BONUS_TIER_3 = Integer.parseInt(Luna.getProperty("EnchantBonus_Tier_3", "16"));
ENCHANT_BONUS_TIER_4 = Integer.parseInt(Luna.getProperty("EnchantBonus_Tier_4", "11"));
ENCHANT_BONUS_TIER_4_5 = Integer.parseInt(Luna.getProperty("EnchantBonus_Tier_4_5", "8"));
ENCHANT_CLUTCH_TIER_0 = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_0", "20"));
ENCHANT_CLUTCH_TIER_1 = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_1", "20"));
ENCHANT_CLUTCH_TIER_1_5 = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_1_5", "20"));
ENCHANT_CLUTCH_TIER_2 = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_2", "20"));
ENCHANT_CLUTCH_TIER_2_5 = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_2_5", "17"));
ENCHANT_CLUTCH_TIER_3_DYNASTY = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_3_Dynasty", "18"));
ENCHANT_CLUTCH_TIER_3_VESPER = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_3_Vesper", "14"));
ENCHANT_CLUTCH_TIER_3_VESPER_JEWS = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_3_Vesper_Jews", "15"));
ENCHANT_CLUTCH_TIER_3_DEFAULT = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_3_Default", "18"));
ENCHANT_CLUTCH_TIER_3_5 = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_3_5", "14"));
ENCHANT_CLUTCH_TIER_4 = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_4", "12"));
ENCHANT_CLUTCH_TIER_4_5 = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_4_5", "8"));
ENCHANT_CLUTCH_TIER_5 = Integer.parseInt(Luna.getProperty("EnchantClutch_Tier_5", "4"));
SUMMON_PATK_MODIFIER = Integer.parseInt(Luna.getProperty("SummonPAtkModifier", "1"));
SUMMON_MATK_MODIFIER = Integer.parseInt(Luna.getProperty("SummonMAtkModifier", "1"));
MAIL_ENABLED = Boolean.parseBoolean(Luna.getProperty("EnableEmail", "false"));
MAIL_USER = Luna.getProperty("MailUsername", "");
MAIL_PASSWORD = Luna.getProperty("MailPassowrd", "");
DONATE_MAIL_USER = Luna.getProperty("DonateMailUsername", "");
DONATE_MAIL_PASSWORD = Luna.getProperty("DonateMailPassowrd", "");
HWID_FARMZONES_CHECK = Boolean.parseBoolean(Luna.getProperty("hwidfarmzone_check", "true"));
HWID_EVENTS_CHECK = Boolean.parseBoolean(Luna.getProperty("hwidevents_check", "true"));
HWID_EVENTZONES_CHECK = Boolean.parseBoolean(Luna.getProperty("hwideventzone_check", "true"));
HWID_FARMWHILEEVENT_CHECK = Boolean.parseBoolean(Luna.getProperty("hwidfarmwhileevent_check", "true"));
EVENTS_LIMIT_IPS = Boolean.parseBoolean(Luna.getProperty("events_limit_ips_enable", "true"));
EVENTS_LIMIT_IPS_NUM = Integer.parseInt(Luna.getProperty("events_max_ips", "3"));
ENABLE_OLD_NIGHT = Boolean.parseBoolean(Luna.getProperty("enable_old_night", "true"));
ENABLE_OLD_OLY = Boolean.parseBoolean(Luna.getProperty("enable_old_oly", "true"));
SYNERGY_CHANCE_ON_PVP = Integer.parseInt(Luna.getProperty("synergy_chance_on_pvp", "35"));
CHANCE_EFFECT_DISPLAY = Integer.parseInt(Luna.getProperty("chance_effect_display_events", "25"));
ENABLE_SKILL_ANIMATIONS = Boolean.parseBoolean(Luna.getProperty("enable_skill_animations", "false"));
ENABLE_BOT_CAPTCHA = Boolean.parseBoolean(Luna.getProperty("enable_captcha", "true"));
ENABLE_BONUS_PVP = Boolean.parseBoolean(Luna.getProperty("enable_bonus_pvp", "false"));
ENABLE_CLAN_WAR_BONUS_PVP = Boolean.parseBoolean(Luna.getProperty("enable_clan_war_bonus_pvp", "false"));
BONUS_PVP_AMMOUNT = Integer.parseInt(Luna.getProperty("bonus_pvp_ammount", "1"));
BONUS_PVP_AMMOUNT_2_SIDE = Integer.parseInt(Luna.getProperty("bonus_pvp_ammount_2_side", "1"));
BONUS_PVP_AMMOUNT_2_SIDE = Integer.parseInt(Luna.getProperty("bonus_pvp_ammount_1_side", "1"));
BONUS_CLAN_REP_AMMOUNT_2_SIDE = Integer.parseInt(Luna.getProperty("bonus_clan_rep_ammount_2_side", "1"));
BONUS_CLAN_REP_AMMOUNT_1_SIDE = Integer.parseInt(Luna.getProperty("bonus_clan_rep_ammount_1_side", "1"));
EVENT_HEAL_MUL = Double.parseDouble(Luna.getProperty("event_heal_mul", "1"));
EVENT_MPCONSUME_MUL = Double.parseDouble(Luna.getProperty("event_heal_mpCons_mul", "3.5"));
DOUBLE_PVP = Boolean.parseBoolean(Luna.getProperty("double_pvp_weekends", "true"));
PVP_PROTECTIONS = Boolean.parseBoolean(Luna.getProperty("pvp_protections", "true"));
// NEW CONFIGS
SYNERGY_RADIUS = Integer.parseInt(Luna.getProperty("synergy_radius", "1200"));
SYNERGY_BOOST_2_SUPPORTS = Double.parseDouble(Luna.getProperty("synergy_mul_2_sup", "1.25"));
SYNERGY_BOOST_3_SUPPORTS = Double.parseDouble(Luna.getProperty("synergy_mul_3_and_more_sup", "1.5"));
KARMA_EXP_LOST_MUL = Double.parseDouble(Luna.getProperty("karma_exp_lost_mul", "1.0"));
PVP_EXP_MUL = Double.parseDouble(Luna.getProperty("pvp_exp_mul", "1.0"));
SUP_PVP_EXP_MUL = Double.parseDouble(Luna.getProperty("sup_pvp_exp_mul", "1.0"));
PVP_TOKEN_CHANCE = Integer.parseInt(Luna.getProperty("chance_pvp_token", "15"));
PVP_TOKEN_CHANCE_HOT_ZONES = Integer.parseInt(Luna.getProperty("chance_pvp_token_hot_zones", "25"));
PVP_TOKEN_CHANCE_EVENTS = Integer.parseInt(Luna.getProperty("chance_pvp_token_events", "35"));
RARE_PVP_TOKEN_CHANCE = Integer.parseInt(Luna.getProperty("chance_rare_pvp_token", "15"));
RARE_PVP_TOKEN_CHANCE_HOT_ZONES = Integer.parseInt(Luna.getProperty("chance_rare_pvp_token_hot_zones", "25"));
RARE_PVP_TOKEN_CHANCE_EVENTS = Integer.parseInt(Luna.getProperty("chance_rare_pvp_token_events", "35"));
CLAN_ESSENCE_CHANCE = Integer.parseInt(Luna.getProperty("chance_clan_essence", "1"));
CLAN_ESSENCE_CHANCE_HOT_ZONES = Integer.parseInt(Luna.getProperty("chance_clan_essence_hot_zones", "15"));
CLAN_ESSENCE_CHANCE_SIEGES = Integer.parseInt(Luna.getProperty("chance_clan_essence_siege", "20"));
PVP_CHEST_POOL_SIZE = Integer.parseInt(Luna.getProperty("size_pool_pvp_chest", "2000"));
MULTISELL_UNTRADEABLE_SOURCE_ITEMS_PVP_SERVER = Boolean.parseBoolean(Luna.getProperty("multisell_untreadeable_source_extra_items", "false"));
ALLOW_CLAN_WAREHOUSE = Boolean.parseBoolean(Luna.getProperty("allow_clan_warehouse", "false"));
ALLOW_CASTLE_WAREHOUSE = Boolean.parseBoolean(Luna.getProperty("allow_castle_warehouse", "true"));
ALLOW_FREIGHT_WAREHOUSE = Boolean.parseBoolean(Luna.getProperty("allow_freight_warehouse", "true"));
// instances
// logger
ENABLE_SUBCLASS_LOGS = Boolean.parseBoolean(Luna.getProperty("enable_subclass_logs", "true"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + LUNA + " File.");
}
// Load events Properties file (if exists)
try
{
L2Properties Events = new L2Properties();
is = new FileInputStream(new File(EVENTS_CONFIG_FILE));
Events.load(is);
CTF_EVEN_TEAMS = Events.getProperty("CTFEvenTeams", "BALANCE");
CTF_ALLOW_INTERFERENCE = Boolean.parseBoolean(Events.getProperty("CTFAllowInterference", "false"));
CTF_ALLOW_POTIONS = Boolean.parseBoolean(Events.getProperty("CTFAllowPotions", "false"));
CTF_ALLOW_SUMMON = Boolean.parseBoolean(Events.getProperty("CTFAllowSummon", "false"));
CTF_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(Events.getProperty("CTFOnStartRemoveAllEffects", "true"));
CTF_ON_START_UNSUMMON_PET = Boolean.parseBoolean(Events.getProperty("CTFOnStartUnsummonPet", "true"));
CTF_ANNOUNCE_TEAM_STATS = Boolean.parseBoolean(Events.getProperty("CTFAnnounceTeamStats", "false"));
CTF_ANNOUNCE_REWARD = Boolean.parseBoolean(Events.getProperty("CTFAnnounceReward", "false"));
CTF_JOIN_CURSED = Boolean.parseBoolean(Events.getProperty("CTFJoinWithCursedWeapon", "true"));
CTF_REVIVE_RECOVERY = Boolean.parseBoolean(Events.getProperty("CTFReviveRecovery", "false"));
CTF_REVIVE_DELAY = Long.parseLong(Events.getProperty("CTFReviveDelay", "20000"));
if (CTF_REVIVE_DELAY < 1000)
CTF_REVIVE_DELAY = 1000; // can't be set less then 1 second
TVT_EVEN_TEAMS = Events.getProperty("TvTEvenTeams", "BALANCE");
TVT_ALLOW_INTERFERENCE = Boolean.parseBoolean(Events.getProperty("TvTAllowInterference", "false"));
TVT_ALLOW_POTIONS = Boolean.parseBoolean(Events.getProperty("TvTAllowPotions", "false"));
TVT_ALLOW_SUMMON = Boolean.parseBoolean(Events.getProperty("TvTAllowSummon", "false"));
TVT_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(Events.getProperty("TvTOnStartRemoveAllEffects", "true"));
TVT_ON_START_UNSUMMON_PET = Boolean.parseBoolean(Events.getProperty("TvTOnStartUnsummonPet", "true"));
TVT_REVIVE_RECOVERY = Boolean.parseBoolean(Events.getProperty("TvTReviveRecovery", "false"));
TVT_ANNOUNCE_TEAM_STATS = Boolean.parseBoolean(Events.getProperty("TvTAnnounceTeamStats", "false"));
TVT_ANNOUNCE_REWARD = Boolean.parseBoolean(Events.getProperty("TvTAnnounceReward", "false"));
TVT_PRICE_NO_KILLS = Boolean.parseBoolean(Events.getProperty("TvTPriceNoKills", "false"));
TVT_JOIN_CURSED = Boolean.parseBoolean(Events.getProperty("TvTJoinWithCursedWeapon", "true"));
TVT_REVIVE_DELAY = Long.parseLong(Events.getProperty("TVTReviveDelay", "20000"));
if (TVT_REVIVE_DELAY < 1000)
TVT_REVIVE_DELAY = 1000; // can't be set less then 1 second
DM_ALLOW_INTERFERENCE = Boolean.parseBoolean(Events.getProperty("DMAllowInterference", "false"));
DM_ALLOW_POTIONS = Boolean.parseBoolean(Events.getProperty("DMAllowPotions", "false"));
DM_ALLOW_SUMMON = Boolean.parseBoolean(Events.getProperty("DMAllowSummon", "false"));
DM_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(Events.getProperty("DMOnStartRemoveAllEffects", "true"));
DM_ON_START_UNSUMMON_PET = Boolean.parseBoolean(Events.getProperty("DMOnStartUnsummonPet", "true"));
DM_REVIVE_DELAY = Long.parseLong(Events.getProperty("DMReviveDelay", "20000"));
if (DM_REVIVE_DELAY < 1000)
DM_REVIVE_DELAY = 1000; // can't be set less then 1 second
VIP_ALLOW_INTERFERENCE = Boolean.parseBoolean(Events.getProperty("VIPAllowInterference", "false"));
VIP_ALLOW_POTIONS = Boolean.parseBoolean(Events.getProperty("VIPAllowPotions", "false"));
VIP_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(Events.getProperty("VIPOnStartRemoveAllEffects", "true"));
VIP_MIN_LEVEL = Integer.parseInt(Events.getProperty("VIPMinLevel", "1"));
if (VIP_MIN_LEVEL < 1)
VIP_MIN_LEVEL = 1; // can't be set less then lvl 1
VIP_MAX_LEVEL = Integer.parseInt(Events.getProperty("VIPMaxLevel", "85"));
if (VIP_MAX_LEVEL < VIP_MIN_LEVEL)
VIP_MAX_LEVEL = VIP_MIN_LEVEL + 1; // can't be set less then Min Level
VIP_MIN_PARTICIPANTS = Integer.parseInt(Events.getProperty("VIPMinParticipants", "10"));
if (VIP_MIN_PARTICIPANTS < 10)
VIP_MIN_PARTICIPANTS = 10; // can't be set less then lvl 10
FALLDOWNONDEATH = Boolean.parseBoolean(Events.getProperty("FallDownOnDeath", "true"));
ARENA_ENABLED = Boolean.parseBoolean(Events.getProperty("ArenaEnabled", "false"));
ARENA_INTERVAL = Integer.parseInt(Events.getProperty("ArenaInterval", "60"));
ARENA_REWARD_ID = Integer.parseInt(Events.getProperty("ArenaRewardId", "57"));
ARENA_REWARD_COUNT = Integer.parseInt(Events.getProperty("ArenaRewardCount", "100"));
FISHERMAN_ENABLED = Boolean.parseBoolean(Events.getProperty("FishermanEnabled", "false"));
FISHERMAN_INTERVAL = Integer.parseInt(Events.getProperty("FishermanInterval", "60"));
FISHERMAN_REWARD_ID = Integer.parseInt(Events.getProperty("FishermanRewardId", "57"));
FISHERMAN_REWARD_COUNT = Integer.parseInt(Events.getProperty("FishermanRewardCount", "100"));
TVTI_INSTANCE_XML = Events.getProperty("TvTIInstanceXML", "TvTI.xml");
TVTI_ALLOW_TIE = Boolean.parseBoolean(Events.getProperty("TvTIAllowTie", "false"));
TVTI_CHECK_WEIGHT_AND_INVENTORY = Boolean.parseBoolean(Events.getProperty("TvTICheckWeightAndInventory", "true"));
TVTI_ALLOW_INTERFERENCE = Boolean.parseBoolean(Events.getProperty("TvTIAllowInterference", "false"));
TVTI_ALLOW_POTIONS = Boolean.parseBoolean(Events.getProperty("TvTIAllowPotions", "false"));
TVTI_ALLOW_SUMMON = Boolean.parseBoolean(Events.getProperty("TvTIAllowSummon", "false"));
TVTI_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(Events.getProperty("TvTIOnStartRemoveAllEffects", "true"));
TVTI_ON_START_UNSUMMON_PET = Boolean.parseBoolean(Events.getProperty("TvTIOnStartUnsummonPet", "true"));
TVTI_REVIVE_RECOVERY = Boolean.parseBoolean(Events.getProperty("TvTIReviveRecovery", "false"));
TVTI_ANNOUNCE_TEAM_STATS = Boolean.parseBoolean(Events.getProperty("TvTIAnnounceTeamStats", "false"));
TVTI_ANNOUNCE_REWARD = Boolean.parseBoolean(Events.getProperty("TvTIAnnounceReward", "false"));
TVTI_PRICE_NO_KILLS = Boolean.parseBoolean(Events.getProperty("TvTIPriceNoKills", "false"));
TVTI_JOIN_CURSED = Boolean.parseBoolean(Events.getProperty("TvTIJoinWithCursedWeapon", "true"));
TVTI_SHOW_STATS_PAGE = Boolean.parseBoolean(Events.getProperty("TvTIShowStatistics", "true"));
TVTI_SORT_TEAMS = Integer.parseInt(Events.getProperty("TvTISortTeams", "0"));
TVTI_JOIN_NPC_SKILL = Integer.parseInt(Events.getProperty("TvTIJoinNpcSkill", "1034"));
TVTI_REVIVE_DELAY = Long.parseLong(Events.getProperty("TvTIReviveDelay", "20000"));
if (TVTI_REVIVE_DELAY < 1000)
TVTI_REVIVE_DELAY = 1000; // can't be set less then 1 second
TVTI_JOIN_NPC_DO_SKILL_AGAIN = Long.parseLong(Events.getProperty("TvTIJoinNpcDoSkillAgain", "0"));
if (TVTI_JOIN_NPC_DO_SKILL_AGAIN < 1000 && TVTI_JOIN_NPC_DO_SKILL_AGAIN != 0)
TVTI_JOIN_NPC_DO_SKILL_AGAIN = 1000; // can't be set less then 1 second
FortressSiege_EVEN_TEAMS = Events.getProperty("FortressSiegeEvenTeams", "BALANCE");
FortressSiege_SAME_IP_PLAYERS_ALLOWED = Boolean.parseBoolean(Events.getProperty("FortressSiegeSameIPPlayersAllowed", "false"));
FortressSiege_ALLOW_INTERFERENCE = Boolean.parseBoolean(Events.getProperty("FortressSiegeAllowInterference", "false"));
FortressSiege_ALLOW_POTIONS = Boolean.parseBoolean(Events.getProperty("FortressSiegeAllowPotions", "false"));
FortressSiege_ALLOW_SUMMON = Boolean.parseBoolean(Events.getProperty("FortressSiegeAllowSummon", "false"));
FortressSiege_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(Events.getProperty("FortressSiegeOnStartRemoveAllEffects", "true"));
FortressSiege_ON_START_UNSUMMON_PET = Boolean.parseBoolean(Events.getProperty("FortressSiegeOnStartUnsummonPet", "true"));
FortressSiege_REVIVE_RECOVERY = Boolean.parseBoolean(Events.getProperty("FortressSiegeReviveRecovery", "false"));
FortressSiege_ANNOUNCE_TEAM_STATS = Boolean.parseBoolean(Events.getProperty("FortressSiegeAnnounceTeamStats", "false"));
FortressSiege_PRICE_NO_KILLS = Boolean.parseBoolean(Events.getProperty("FortressSiegePriceNoKills", "false"));
FortressSiege_JOIN_CURSED = Boolean.parseBoolean(Events.getProperty("FortressSiegeJoinWithCursedWeapon", "true"));
FortressSiege_REVIVE_DELAY = Long.parseLong(Events.getProperty("FortressSiegeReviveDelay", "50000"));
FortressSiege_HWID_CHECK = Boolean.parseBoolean(Events.getProperty("FortressSiegeHwidCheck", "true"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + EVENTS_CONFIG_FILE + " File.");
}
// Load auto events Properties file (if exists)
try
{
L2Properties AutoEvents = new L2Properties();
is = new FileInputStream(new File(AUTO_EVENTS_CONFIG_FILE));
AutoEvents.load(is);
AUTO_TVT_ENABLED = Boolean.parseBoolean(AutoEvents.getProperty("EnableAutoTvT", "false"));
if (AUTO_TVT_ENABLED)
AutomatedTvT.startIfNecessary();
StringTokenizer coords;
StringTokenizer locations = new StringTokenizer(AutoEvents.getProperty("TvTTeamLocations", ""), ";");
AUTO_TVT_TEAM_LOCATIONS = new int[locations.countTokens()][3];
for (int i = 0; i < AUTO_TVT_TEAM_LOCATIONS.length; i++)
{
coords = new StringTokenizer(locations.nextToken(), ",");
if (coords.countTokens() == 3)
{
AUTO_TVT_TEAM_LOCATIONS[i] = new int[3];
AUTO_TVT_TEAM_LOCATIONS[i][0] = Integer.parseInt(coords.nextToken());
AUTO_TVT_TEAM_LOCATIONS[i][1] = Integer.parseInt(coords.nextToken());
AUTO_TVT_TEAM_LOCATIONS[i][2] = Integer.parseInt(coords.nextToken());
}
else
throw new IllegalArgumentException("Cannot parse TvTTeamLocations!");
}
AUTO_TVT_TEAM_COLORS_RANDOM = Boolean.parseBoolean(AutoEvents.getProperty("TvTTeamColorsRandom", "true"));
AUTO_TVT_TEAM_COLORS = new int[AUTO_TVT_TEAM_LOCATIONS.length];
if (!AUTO_TVT_TEAM_COLORS_RANDOM)
{
coords = new StringTokenizer(AutoEvents.getProperty("TvTTeamColors", ""), ",");
if (coords.countTokens() == AUTO_TVT_TEAM_COLORS.length)
{
for (int i = 0; i < AUTO_TVT_TEAM_COLORS.length; i++)
AUTO_TVT_TEAM_COLORS[i] = Integer.decode("0x" + coords.nextToken());
}
else
throw new IllegalArgumentException("Cannot parse TvTTeamColors!");
}
AUTO_TVT_OVERRIDE_TELE_BACK = Boolean.parseBoolean(AutoEvents.getProperty("TvTTeleportAfterEventSpecial", "false"));
coords = new StringTokenizer(AutoEvents.getProperty("TvTTeleportSpecialLocation", ""), ",");
if (coords.countTokens() == 3)
{
AUTO_TVT_DEFAULT_TELE_BACK = new int[3];
AUTO_TVT_DEFAULT_TELE_BACK[0] = Integer.parseInt(coords.nextToken());
AUTO_TVT_DEFAULT_TELE_BACK[1] = Integer.parseInt(coords.nextToken());
AUTO_TVT_DEFAULT_TELE_BACK[2] = Integer.parseInt(coords.nextToken());
}
else
throw new IllegalArgumentException("Cannot parse TvTTeleportSpecialLocation!");
AUTO_TVT_REWARD_MIN_POINTS = Integer.parseInt(AutoEvents.getProperty("TvTRewardedMinScore", "1"));
locations = new StringTokenizer(AutoEvents.getProperty("TvTRewards", ""), ";");
AUTO_TVT_REWARD_IDS = new int[locations.countTokens()];
AUTO_TVT_REWARD_COUNT = new int[locations.countTokens()];
for (int i = 0; i < AUTO_TVT_REWARD_IDS.length; i++)
{
coords = new StringTokenizer(locations.nextToken(), ",");
if (coords.countTokens() == 2)
{
AUTO_TVT_REWARD_IDS[i] = Integer.parseInt(coords.nextToken());
AUTO_TVT_REWARD_COUNT[i] = Integer.parseInt(coords.nextToken());
}
else
throw new IllegalArgumentException("Cannot parse TvTRewards!");
}
AUTO_TVT_LEVEL_MAX = Integer.parseInt(AutoEvents.getProperty("TvTMaxLevel", "85"));
AUTO_TVT_LEVEL_MIN = Integer.parseInt(AutoEvents.getProperty("TvTMinLevel", "1"));
AUTO_TVT_PARTICIPANTS_MAX = Integer.parseInt(AutoEvents.getProperty("TvTMaxParticipants", "25"));
AUTO_TVT_PARTICIPANTS_MIN = Integer.parseInt(AutoEvents.getProperty("TvTMinParticipants", "6"));
AUTO_TVT_DELAY_INITIAL_REGISTRATION = Long.parseLong(AutoEvents.getProperty("TvTDelayInitial", "900000"));
AUTO_TVT_DELAY_BETWEEN_EVENTS = Long.parseLong(AutoEvents.getProperty("TvTDelayBetweenEvents", "900000"));
AUTO_TVT_PERIOD_LENGHT_REGISTRATION = Long.parseLong(AutoEvents.getProperty("TvTLengthRegistration", "300000"));
AUTO_TVT_PERIOD_LENGHT_PREPARATION = Long.parseLong(AutoEvents.getProperty("TvTLengthPreparation", "50000"));
AUTO_TVT_PERIOD_LENGHT_EVENT = Long.parseLong(AutoEvents.getProperty("TvTLengthCombat", "240000"));
AUTO_TVT_PERIOD_LENGHT_REWARDS = Long.parseLong(AutoEvents.getProperty("TvTLengthRewards", "15000"));
AUTO_TVT_REGISTRATION_ANNOUNCEMENT_COUNT = Integer.parseInt(AutoEvents.getProperty("TvTAnnounceRegistration", "3"));
AUTO_TVT_REGISTER_CURSED = Boolean.parseBoolean(AutoEvents.getProperty("TvTRegisterCursedWeaponOwner", "false"));
AUTO_TVT_REGISTER_HERO = Boolean.parseBoolean(AutoEvents.getProperty("TvTRegisterHero", "true"));
AUTO_TVT_REGISTER_CANCEL = Boolean.parseBoolean(AutoEvents.getProperty("TvTCanCancelRegistration", "false"));
AUTO_TVT_REGISTER_AFTER_RELOG = Boolean.parseBoolean(AutoEvents.getProperty("TvTRegisterOnRelogin", "true"));
coords = new StringTokenizer(AutoEvents.getProperty("TvTItemsNotAllowed", ""), ",");
AUTO_TVT_DISALLOWED_ITEMS = new int[coords.countTokens()];
for (int i = 0; i < AUTO_TVT_DISALLOWED_ITEMS.length; i++)
AUTO_TVT_DISALLOWED_ITEMS[i] = Integer.parseInt(coords.nextToken());
AUTO_TVT_START_CANCEL_BUFFS = Boolean.parseBoolean(AutoEvents.getProperty("TvTOnStartCancelBuffs", "false"));
AUTO_TVT_START_CANCEL_CUBICS = Boolean.parseBoolean(AutoEvents.getProperty("TvTOnStartCancelCubics", "false"));
AUTO_TVT_START_CANCEL_SERVITORS = Boolean.parseBoolean(AutoEvents.getProperty("TvTOnStartCancelServitors", "true"));
AUTO_TVT_START_CANCEL_TRANSFORMATION = Boolean.parseBoolean(AutoEvents.getProperty("TvTOnStartCancelTransformation", "true"));
AUTO_TVT_START_CANCEL_PARTY = Boolean.parseBoolean(AutoEvents.getProperty("TvTOnStartDisbandParty", "true"));
AUTO_TVT_START_RECOVER = Boolean.parseBoolean(AutoEvents.getProperty("TvTOnStartRecover", "true"));
AUTO_TVT_GODLIKE_SYSTEM = Boolean.parseBoolean(AutoEvents.getProperty("TvTGodlikeSystem", "true"));
AUTO_TVT_GODLIKE_ANNOUNCE = Boolean.parseBoolean(AutoEvents.getProperty("TvTGodlikeAnnounce", "true"));
AUTO_TVT_GODLIKE_MIN_KILLS = Integer.parseInt(AutoEvents.getProperty("TvTGodlikeMinKills", "5"));
AUTO_TVT_GODLIKE_POINT_MULTIPLIER = Integer.parseInt(AutoEvents.getProperty("TvTGodlikeKillPoints", "3"));
AUTO_TVT_GODLIKE_TITLE = AutoEvents.getProperty("TvTGodlikeTitle", "God-like").trim();
AUTO_TVT_REVIVE_SELF = Boolean.parseBoolean(AutoEvents.getProperty("TvTReviveSelf", "false"));
AUTO_TVT_REVIVE_RECOVER = Boolean.parseBoolean(AutoEvents.getProperty("TvTReviveRecover", "true"));
AUTO_TVT_REVIVE_DELAY = Long.parseLong(AutoEvents.getProperty("TvTReviveDelay", "5000"));
AUTO_TVT_SPAWN_PROTECT = Integer.parseInt(AutoEvents.getProperty("TvTSpawnProtection", "0"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + AUTO_EVENTS_CONFIG_FILE + " File.");
}
// Load Rates Properties file (if exists)
try
{
L2Properties ratesSettings = new L2Properties();
is = new FileInputStream(new File(RATES_CONFIG_FILE));
ratesSettings.load(is);
RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
RATE_QUESTS_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestsReward", "1."));
RATE_DROP_ADENA = Float.parseFloat(ratesSettings.getProperty("RateDropAdena", "1."));
RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
RATE_EXTR_FISH = Float.parseFloat(ratesSettings.getProperty("RateExtractFish", "1."));
RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(ratesSettings.getProperty("RateRaidDropItems", "1."));
RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
RATE_DROP_QUEST = Float.parseFloat(ratesSettings.getProperty("RateDropQuest", "1."));
RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
RATE_DROP_COMMON_HERBS = Float.parseFloat(ratesSettings.getProperty("RateCommonHerbs", "15."));
RATE_DROP_MP_HP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateHpMpHerbs", "10."));
RATE_DROP_GREATER_HERBS = Float.parseFloat(ratesSettings.getProperty("RateGreaterHerbs", "4."));
RATE_DROP_SUPERIOR_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSuperiorHerbs", "0.8")) * 10;
RATE_DROP_SPECIAL_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSpecialHerbs", "0.2")) * 10;
PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
RATE_RECOVERY_ON_RECONNECT = Float.parseFloat(ratesSettings.getProperty("RateRecoveryOnReconnect", "4."));
PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
RATE_DROP_VITALITY_HERBS = Float.parseFloat(ratesSettings.getProperty("RateVitalityHerbs", "2."));
KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
// Initializing table
PLAYER_XP_PERCENT_LOST = new double[Byte.MAX_VALUE + 1];
// Default value
for (int i = 0; i <= Byte.MAX_VALUE; i++)
PLAYER_XP_PERCENT_LOST[i] = 1.;
// Now loading into table parsed values
try
{
String[] values = ratesSettings.getProperty("PlayerXPPercentLost", "0,39-7.0;40,75-4.0;76,76-2.5;77,77-2.0;78,78-1.5").split(";");
for (String s : values)
{
int min;
int max;
double val;
String[] vals = s.split("-");
String[] mM = vals[0].split(",");
min = Integer.parseInt(mM[0]);
max = Integer.parseInt(mM[1]);
val = Double.parseDouble(vals[1]);
for (int i = min; i <= max; i++)
PLAYER_XP_PERCENT_LOST[i] = val;
}
}
catch (Exception e)
{
_log.warning("Error while loading Player XP percent lost");
e.printStackTrace();
}
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + RATES_CONFIG_FILE + " File.");
}
try
{
L2Properties chill = new L2Properties();
is = new FileInputStream(new File(CHILL_FILE));
chill.load(is);
CHILL_SLEEP_TICKS = Integer.parseInt(chill.getProperty("SleepTicks", "333"));
DAILY_CREDIT = Integer.parseInt(chill.getProperty("DailyCredit", "8"));
EVENT_CREDIT = Integer.parseInt(chill.getProperty("EventCredit", "3600000"));
INERTIA_RT = Integer.parseInt(chill.getProperty("InertiaResponsetime", "6"));
LAG_NEW_TARGET = Integer.parseInt(chill.getProperty("LagNewTarget", "2000"));
LAG_DIE_TARGET = Integer.parseInt(chill.getProperty("LagDieTarget", "1000"));
LAG_KIL_TARGET = Integer.parseInt(chill.getProperty("LagKilTarget", "1000"));
LAG_ASI_TARGET = Integer.parseInt(chill.getProperty("LagAsiTarget", "1000"));
FOLLOW_INIT_RANGE = Integer.parseInt(chill.getProperty("FollowInitRange", "400"));
RANGE_CLOSE = Integer.parseInt(chill.getProperty("RangeClose", "400"));
RANGE_NEAR = Integer.parseInt(chill.getProperty("RangeNear", "800"));
RANGE_FAR = Integer.parseInt(chill.getProperty("RangeFar", "1400"));
DAILY_CREDIT_TIME = chill.getProperty("DailyCreditTime", "2:00");
}
catch (Exception e)
{
System.out.println("FIXME: CHILL.PROPERTIES ERROR");
e.printStackTrace();
System.exit(1);
}
// Load L2JMod Properties file (if exists)
try
{
L2Properties L2JModSettings = new L2Properties();
is = new FileInputStream(new File(L2JMOD_CONFIG_FILE));
L2JModSettings.load(is);
L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
L2JMOD_CHAMPION_PASSIVE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionPassive", "false"));
L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));
L2JMOD_CHAMP_TITLE = L2JModSettings.getProperty("ChampionTitle", "Champion");
L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMinLevel", "20"));
L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(L2JModSettings.getProperty("ChampionMaxLevel", "60"));
L2JMOD_CHAMPION_HP = Integer.parseInt(L2JModSettings.getProperty("ChampionHp", "7"));
L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(L2JModSettings.getProperty("ChampionHpRegen", "1."));
L2JMOD_CHAMPION_REWARDS = Integer.parseInt(L2JModSettings.getProperty("ChampionRewards", "8"));
L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(L2JModSettings.getProperty("ChampionAdenasRewards", "1"));
L2JMOD_CHAMPION_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionAtk", "1."));
L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(L2JModSettings.getProperty("ChampionSpdAtk", "1."));
L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardLowerLvlItemChance", "0"));
L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardHigherLvlItemChance", "0"));
L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemID", "6393"));
L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
L2JMOD_CHAMPION_ENABLE_VITALITY = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnableVitality", "False"));
TVT_EVENT_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventEnabled", "false"));
TVT_EVENT_IN_INSTANCE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventInInstance", "false"));
TVT_EVENT_INSTANCE_FILE = L2JModSettings.getProperty("TvTEventInstanceFile", "coliseum.xml");
TVT_EVENT_INTERVAL = L2JModSettings.getProperty("TvTEventInterval", "20:00").split(",");
TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationTime", "3600"));
TVT_EVENT_RUNNING_TIME = Integer.parseInt(L2JModSettings.getProperty("TvTEventRunningTime", "1800"));
TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(L2JModSettings.getProperty("TvTEventParticipationNpcId", "0"));
L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(L2JModSettings.getProperty("AllowWedding", "False"));
L2JMOD_WEDDING_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingPrice", "250000000"));
L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingPunishInfidelity", "True"));
L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingTeleport", "True"));
L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportPrice", "50000"));
L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(L2JModSettings.getProperty("WeddingTeleportDuration", "60"));
L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingClan", "False"));
L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingPrivate", "False"));
L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingFreight", "False"));
if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
{
TVT_EVENT_ENABLED = false;
_log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
}
else
{
String[] propertySplit = L2JModSettings.getProperty("TvTEventParticipationNpcCoordinates", "0,0,0").split(",");
if (propertySplit.length < 3)
{
TVT_EVENT_ENABLED = false;
_log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcCoordinates");
}
else
{
TVT_EVENT_REWARDS = new FastList<int[]>();
TVT_DOORS_IDS_TO_OPEN = new ArrayList<Integer>();
TVT_DOORS_IDS_TO_CLOSE = new ArrayList<Integer>();
TVT_EVENT_PARTICIPATION_NPC_COORDINATES = new int[3];
TVT_EVENT_TEAM_1_COORDINATES = new int[3];
TVT_EVENT_TEAM_2_COORDINATES = new int[3];
TVT_EVENT_PARTICIPATION_NPC_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
TVT_EVENT_PARTICIPATION_NPC_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
TVT_EVENT_PARTICIPATION_NPC_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
TVT_EVENT_MIN_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayersInTeams", "1"));
TVT_EVENT_MAX_PLAYERS_IN_TEAMS = Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayersInTeams", "20"));
TVT_EVENT_MIN_LVL = (byte) Integer.parseInt(L2JModSettings.getProperty("TvTEventMinPlayerLevel", "1"));
TVT_EVENT_MAX_LVL = (byte) Integer.parseInt(L2JModSettings.getProperty("TvTEventMaxPlayerLevel", "80"));
TVT_EVENT_RESPAWN_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventRespawnTeleportDelay", "20"));
TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20"));
TVT_EVENT_EFFECTS_REMOVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventEffectsRemoval", "0"));
TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1");
propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(",");
if (propertySplit.length < 3)
{
TVT_EVENT_ENABLED = false;
_log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam1Coordinates");
}
else
{
TVT_EVENT_TEAM_1_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
TVT_EVENT_TEAM_1_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
TVT_EVENT_TEAM_1_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
TVT_EVENT_TEAM_2_NAME = L2JModSettings.getProperty("TvTEventTeam2Name", "Team2");
propertySplit = L2JModSettings.getProperty("TvTEventTeam2Coordinates", "0,0,0").split(",");
if (propertySplit.length < 3)
{
TVT_EVENT_ENABLED = false;
_log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventTeam2Coordinates");
}
else
{
TVT_EVENT_TEAM_2_COORDINATES[0] = Integer.parseInt(propertySplit[0]);
TVT_EVENT_TEAM_2_COORDINATES[1] = Integer.parseInt(propertySplit[1]);
TVT_EVENT_TEAM_2_COORDINATES[2] = Integer.parseInt(propertySplit[2]);
propertySplit = L2JModSettings.getProperty("TvTEventParticipationFee", "0,0").split(",");
try
{
TVT_EVENT_PARTICIPATION_FEE[0] = Integer.parseInt(propertySplit[0]);
TVT_EVENT_PARTICIPATION_FEE[1] = Integer.parseInt(propertySplit[1]);
}
catch (NumberFormatException nfe)
{
if (propertySplit.length > 0)
_log.warning("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationFee");
}
propertySplit = L2JModSettings.getProperty("TvTEventReward", "57,100000").split(";");
for (String reward : propertySplit)
{
String[] rewardSplit = reward.split(",");
if (rewardSplit.length != 2)
_log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
else
{
try
{
TVT_EVENT_REWARDS.add(new int[]
{
Integer.parseInt(rewardSplit[0]),
Integer.parseInt(rewardSplit[1])
});
}
catch (NumberFormatException nfe)
{
if (!reward.isEmpty())
_log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTEventReward \"", reward, "\""));
}
}
}
TVT_EVENT_TARGET_TEAM_MEMBERS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventTargetTeamMembersAllowed", "true"));
TVT_EVENT_SCROLL_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventScrollsAllowed", "false"));
TVT_EVENT_POTIONS_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventPotionsAllowed", "false"));
TVT_EVENT_SUMMON_BY_ITEM_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEventSummonByItemAllowed", "false"));
TVT_REWARD_TEAM_TIE = Boolean.parseBoolean(L2JModSettings.getProperty("TvTRewardTeamTie", "false"));
propertySplit = L2JModSettings.getProperty("TvTDoorsToOpen", "").split(";");
for (String door : propertySplit)
{
try
{
TVT_DOORS_IDS_TO_OPEN.add(Integer.parseInt(door));
}
catch (NumberFormatException nfe)
{
if (!door.equals(""))
_log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToOpen \"", door, "\""));
}
}
propertySplit = L2JModSettings.getProperty("TvTDoorsToClose", "").split(";");
for (String door : propertySplit)
{
try
{
TVT_DOORS_IDS_TO_CLOSE.add(Integer.parseInt(door));
}
catch (NumberFormatException nfe)
{
if (!door.isEmpty())
_log.warning(StringUtil.concat("TvTEventEngine[Config.load()]: invalid config property -> TvTDoorsToClose \"", door, "\""));
}
}
}
}
}
}
BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false"));
BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineTradeEnable", "false"));
OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineCraftEnable", "false"));
OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(L2JModSettings.getProperty("OfflineSetNameColor", "false"));
OFFLINE_NAME_COLOR = Integer.decode("0x" + L2JModSettings.getProperty("OfflineNameColor", "808080"));
L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(L2JModSettings.getProperty("EnableManaPotionSupport", "false"));
L2JMOD_ACHIEVEMENT_SYSTEM = Boolean.parseBoolean(L2JModSettings.getProperty("AllowAchievementSystem", "false"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + L2JMOD_CONFIG_FILE + " File.");
}
// Load PvP Properties file (if exists)
try
{
L2Properties pvpSettings = new L2Properties();
is = new FileInputStream(new File(PVP_CONFIG_FILE));
pvpSettings.load(is);
KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650,9882");
KARMA_NONDROPPABLE_ITEMS = pvpSettings.getProperty("ListOfNonDroppableItems", "57,1147,425,1146,461,10,2368,7,6,2370,2369,6842,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,7694,8181,5575,7694,9388,9389,9390");
String[] array = KARMA_NONDROPPABLE_PET_ITEMS.split(",");
KARMA_LIST_NONDROPPABLE_PET_ITEMS = new int[array.length];
for (int i = 0; i < array.length; i++)
KARMA_LIST_NONDROPPABLE_PET_ITEMS[i] = Integer.parseInt(array[i]);
array = KARMA_NONDROPPABLE_ITEMS.split(",");
KARMA_LIST_NONDROPPABLE_ITEMS = new int[array.length];
for (int i = 0; i < array.length; i++)
KARMA_LIST_NONDROPPABLE_ITEMS[i] = Integer.parseInt(array[i]);
// sorting so binarySearch can be used later
Arrays.sort(KARMA_LIST_NONDROPPABLE_PET_ITEMS);
Arrays.sort(KARMA_LIST_NONDROPPABLE_ITEMS);
PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "120000"));
PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "60000"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + PVP_CONFIG_FILE + " File.");
}
try
{
L2Properties Settings = new L2Properties();
is = new FileInputStream(HEXID_FILE);
Settings.load(is);
SERVER_ID = Integer.parseInt(Settings.getProperty("ServerID"));
HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
}
catch (Exception e)
{
_log.warning("Could not load HexID file (" + HEXID_FILE + "). Hopefully login will give us one.");
}
loadDonationConfigs(DONATION_CONFIG_FILE);
}
finally
{
try
{
is.close();
}
catch (Exception e)
{}
}
}
else if (Server.serverMode == Server.MODE_LOGINSERVER)
{
_log.info("loading login config");
InputStream is = null;
try
{
try
{
L2Properties serverSettings = new L2Properties();
is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));
serverSettings.load(is);
GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname", "*");
GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort", "9013"));
LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));
DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
PACKET_HANDLER_DEBUG = Boolean.parseBoolean(serverSettings.getProperty("PacketHandlerDebug", "false"));
DEVELOPER = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));
ASSERT = Boolean.parseBoolean(serverSettings.getProperty("Assert", "false"));
ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer", "True"));
REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID", "0"));
ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID", "True"));
LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));
LOG_LOGIN_CONTROLLER = Boolean.parseBoolean(serverSettings.getProperty("LogLoginController", "true"));
DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile(); // FIXME:
INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "localhost");
EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");
ROUTER_HOSTNAME = serverSettings.getProperty("RouterHostname", "");
DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/l2jdb");
DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
IP_UPDATE_TIME = Integer.parseInt(serverSettings.getProperty("IpUpdateTime", "15"));
FORCE_GGAUTH = Boolean.parseBoolean(serverSettings.getProperty("ForceGGAuth", "false"));
AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts", "True"));
FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection", "True"));
FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit", "15"));
NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime", "700"));
FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime", "350"));
MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP", "50"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + LOGIN_CONFIGURATION_FILE + " File.");
}
// MMO
try
{
_log.info("Loading " + MMO_CONFIG_FILE.replaceAll("./config/", ""));
L2Properties mmoSettings = new L2Properties();
is = new FileInputStream(new File(MMO_CONFIG_FILE));
mmoSettings.load(is);
MMO_SELECTOR_SLEEP_TIME = Integer.parseInt(mmoSettings.getProperty("SleepTime", "20"));
MMO_IO_SELECTOR_THREAD_COUNT = Integer.parseInt(mmoSettings.getProperty("IOSelectorThreadCount", "2"));
MMO_MAX_SEND_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxSendPerPass", "12"));
MMO_MAX_READ_PER_PASS = Integer.parseInt(mmoSettings.getProperty("MaxReadPerPass", "12"));
MMO_HELPER_BUFFER_COUNT = Integer.parseInt(mmoSettings.getProperty("HelperBufferCount", "20"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + MMO_CONFIG_FILE + " File.");
}
// Load Telnet Properties file (if exists)
try
{
L2Properties telnetSettings = new L2Properties();
is = new FileInputStream(new File(TELNET_FILE));
telnetSettings.load(is);
IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
}
catch (Exception e)
{
e.printStackTrace();
throw new Error("Failed to Load " + TELNET_FILE + " File.");
}
}
finally
{
try
{
is.close();
}
catch (Exception e)
{}
}
}
else
{
_log.severe("Could not Load Config: server mode was not set");
}
}
/**
* @Donation
*/
public static boolean ENABLE_DONATION_CHECKER;
public static int DONATION_CHECKER_INITIAL_DELAY;
public static int DONATION_CHECKER_INTERVAL;
public static String GMAIL_ADDRESS;
public static String GMAIL_PASSWORD;
private static void loadDonationConfigs(String configFile)
{
L2Properties config = new L2Properties();
FileInputStream is;
try
{
is = new FileInputStream(new File(configFile));
config.load(is);
ENABLE_DONATION_CHECKER = Boolean.parseBoolean(config.getProperty("EnableDonationChecker", "false"));
DONATION_CHECKER_INITIAL_DELAY = Integer.parseInt(config.getProperty("DonationCheckerInitialDelay", "1")) * 60000;
DONATION_CHECKER_INTERVAL = Integer.parseInt(config.getProperty("DonationCheckerInterval", "15")) * 60000;
GMAIL_ADDRESS = config.getProperty("GmailAddress", "");
GMAIL_PASSWORD = config.getProperty("GmailPassword", "");
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* Set a new value to a game parameter from the admin console.
*
* @param pName
* (String) : name of the parameter to change
* @param pValue
* (String) : new value of the parameter
* @return boolean : true if modification has been made
* @link useAdminCommand
*/
public static boolean setParameterValue(String pName, String pValue)
{
if (pName.equalsIgnoreCase("RateXp"))
RATE_XP = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RateSp"))
RATE_SP = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RatePartyXp"))
RATE_PARTY_XP = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RatePartySp"))
RATE_PARTY_SP = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RateQuestsReward"))
RATE_QUESTS_REWARD = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RateDropAdena"))
RATE_DROP_ADENA = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RateConsumableCost"))
RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RateExtractFish"))
RATE_EXTR_FISH = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RateDropItems"))
RATE_DROP_ITEMS = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RateRaidDropItems"))
RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RateDropSpoil"))
RATE_DROP_SPOIL = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RateDropManor"))
RATE_DROP_MANOR = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("RateDropQuest"))
RATE_DROP_QUEST = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RateKarmaExpLost"))
RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice"))
RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("PlayerDropLimit"))
PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("PlayerRateDrop"))
PLAYER_RATE_DROP = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("PlayerRateDropItem"))
PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("PlayerRateDropEquip"))
PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon"))
PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("KarmaDropLimit"))
KARMA_DROP_LIMIT = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("KarmaRateDrop"))
KARMA_RATE_DROP = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("KarmaRateDropItem"))
KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("KarmaRateDropEquip"))
KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon"))
KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter"))
AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem"))
DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("DestroyEquipableItem"))
DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("SaveDroppedItem"))
SAVE_DROPPED_ITEM = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad"))
EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("SaveDroppedItemInterval"))
SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ClearDroppedItemTable"))
CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("PreciseDropCalculation"))
PRECISE_DROP_CALCULATION = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("MultipleItemDrop"))
MULTIPLE_ITEM_DROP = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("CoordSynchronize"))
COORD_SYNCHRONIZE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("DeleteCharAfterDays"))
DELETE_DAYS = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AllowDiscardItem"))
ALLOW_DISCARDITEM = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AllowFreight"))
ALLOW_FREIGHT = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AllowWarehouse"))
ALLOW_WAREHOUSE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AllowWear"))
ALLOW_WEAR = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("WearDelay"))
WEAR_DELAY = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("WearPrice"))
WEAR_PRICE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AllowWater"))
ALLOW_WATER = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AllowRentPet"))
ALLOW_RENTPET = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AllowBoat"))
ALLOW_BOAT = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AllowCursedWeapons"))
ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AllowManor"))
ALLOW_MANOR = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AllowNpcWalkers"))
ALLOW_NPC_WALKERS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AllowPetWalkers"))
ALLOW_PET_WALKERS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("BypassValidation"))
BYPASS_VALIDATION = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("CommunityType"))
COMMUNITY_TYPE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("BBSShowPlayerList"))
BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("BBSDefault"))
BBS_DEFAULT = pValue;
else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard"))
SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard"))
SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard"))
NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard"))
NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ShowServerNews"))
SERVER_NEWS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("ShowNpcLevel"))
SHOW_NPC_LVL = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("ForceInventoryUpdate"))
FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData"))
AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("MaximumOnlineUsers"))
MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ZoneTown"))
ZONE_TOWN = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("CheckKnownList"))
CHECK_KNOWN = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("UseDeepBlueDropRules"))
DEEPBLUE_DROP_RULES = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AllowGuards"))
GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("CancelLesserEffect"))
EFFECT_CANCELING = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf"))
INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf"))
INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer"))
INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf"))
WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf"))
WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan"))
WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("MaximumFreightSlots"))
FREIGHT_SLOTS = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("EnchantChanceWeapon"))
ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("EnchantChanceArmor"))
ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("EnchantChanceJewelry"))
ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("EnchantMaxWeapon"))
ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("EnchantMaxArmor"))
ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("EnchantMaxJewelry"))
ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("EnchantSafeMax"))
ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("EnchantSafeMaxFull"))
ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AugmentationNGSkillChance"))
AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AugmentationNGGlowChance"))
AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AugmentationMidSkillChance"))
AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AugmentationMidGlowChance"))
AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AugmentationHighSkillChance"))
AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AugmentationHighGlowChance"))
AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AugmentationTopSkillChance"))
AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AugmentationTopGlowChance"))
AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AugmentationBaseStatChance"))
AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("HpRegenMultiplier"))
HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
else if (pName.equalsIgnoreCase("MpRegenMultiplier"))
MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
else if (pName.equalsIgnoreCase("CpRegenMultiplier"))
CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier"))
RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier"))
RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
else if (pName.equalsIgnoreCase("RaidPDefenceMultiplier"))
RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(pValue) / 100;
else if (pName.equalsIgnoreCase("RaidMDefenceMultiplier"))
RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(pValue) / 100;
else if (pName.equalsIgnoreCase("RaidMinionRespawnTime"))
RAID_MINION_RESPAWN_TIMER = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("StartingAdena"))
STARTING_ADENA = Long.parseLong(pValue);
else if (pName.equalsIgnoreCase("UnstuckInterval"))
UNSTUCK_INTERVAL = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("PlayerSpawnProtection"))
PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection"))
PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("RestorePlayerInstance"))
RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AllowSummonToInstance"))
ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("PartyXpCutoffMethod"))
PARTY_XP_CUTOFF_METHOD = pValue;
else if (pName.equalsIgnoreCase("PartyXpCutoffPercent"))
PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
else if (pName.equalsIgnoreCase("PartyXpCutoffLevel"))
PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("RespawnRestoreCP"))
RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
else if (pName.equalsIgnoreCase("RespawnRestoreHP"))
RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
else if (pName.equalsIgnoreCase("RespawnRestoreMP"))
RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;
else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsDwarf"))
MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsOther"))
MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsDwarf"))
MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsOther"))
MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("StoreSkillCooltime"))
STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("SubclassStoreSkillCooltime"))
SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AnnounceMammonSpawn"))
ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltGameTiredness"))
ALT_GAME_TIREDNESS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltGameCreation"))
ALT_GAME_CREATION = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltGameCreationSpeed"))
ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
else if (pName.equalsIgnoreCase("AltGameCreationXpRate"))
ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
else if (pName.equalsIgnoreCase("AltGameCreationRareXpSpRate"))
ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(pValue);
else if (pName.equalsIgnoreCase("AltGameCreationSpRate"))
ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
else if (pName.equalsIgnoreCase("AltWeightLimit"))
ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
else if (pName.equalsIgnoreCase("AltBlacksmithUseRecipes"))
ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltGameSkillLearn"))
ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("RemoveCastleCirclets"))
REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("ReputationScorePerKill"))
REPUTATION_SCORE_PER_KILL = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
{
ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
}
else if (pName.equalsIgnoreCase("AltShieldBlocks"))
ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate"))
ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("Delevel"))
ALT_GAME_DELEVEL = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("MagicFailures"))
ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltMobAgroInPeaceZone"))
ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltGameExponentXp"))
ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("AltGameExponentSp"))
ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("AllowClassMasters"))
ALLOW_CLASS_MASTERS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltGameFreights"))
ALT_GAME_FREIGHTS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltGameFreightPrice"))
ALT_GAME_FREIGHT_PRICE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AltPartyRange"))
ALT_PARTY_RANGE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AltPartyRange2"))
ALT_PARTY_RANGE2 = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("CraftingEnabled"))
IS_CRAFTING_ENABLED = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("CraftMasterwork"))
CRAFT_MASTERWORK = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("LifeCrystalNeeded"))
LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("SpBookNeeded"))
SP_BOOK_NEEDED = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AutoLoot"))
AUTO_LOOT = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AutoLootRaids"))
AUTO_LOOT_RAIDS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AutoLootHerbs"))
AUTO_LOOT_HERBS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone"))
ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop"))
ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK"))
ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport"))
ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade"))
ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse"))
ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("MaxPersonalFamePoints"))
MAX_PERSONAL_FAME_POINTS = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("FortressZoneFameTaskFrequency"))
FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("FortressZoneFameAquirePoints"))
FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("CastleZoneFameTaskFrequency"))
CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("CastleZoneFameAquirePoints"))
CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AltCastleForDawn"))
ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltCastleForDusk"))
ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltRequireClanCastle"))
ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltFreeTeleporting"))
ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests"))
ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH"))
ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("DwarfRecipeLimit"))
DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("CommonRecipeLimit"))
COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ChampionEnable"))
L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("ChampionFrequency"))
L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ChampionMinLevel"))
L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ChampionMaxLevel"))
L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ChampionHp"))
L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ChampionHpRegen"))
L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("ChampionRewards"))
L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ChampionAdenasRewards"))
L2JMOD_CHAMPION_ADENAS_REWARDS = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("ChampionAtk"))
L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("ChampionSpdAtk"))
L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
else if (pName.equalsIgnoreCase("ChampionRewardLowerLvlItemChance"))
L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ChampionRewardHigherLvlItemChance"))
L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ChampionRewardItemID"))
L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("ChampionRewardItemQty"))
L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("AllowWedding"))
L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("WeddingPrice"))
L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("WeddingPunishInfidelity"))
L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("WeddingTeleport"))
L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("WeddingTeleportPrice"))
L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("WeddingTeleportDuration"))
L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("WeddingAllowSameSex"))
L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("WeddingFormalWear"))
L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("WeddingDivorceCosts"))
L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("TvTEventEnabled"))
TVT_EVENT_ENABLED = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("TvTEventInterval"))
TVT_EVENT_INTERVAL = pValue.split(",");
else if (pName.equalsIgnoreCase("TvTEventParticipationTime"))
TVT_EVENT_PARTICIPATION_TIME = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("TvTEventRunningTime"))
TVT_EVENT_RUNNING_TIME = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("TvTEventParticipationNpcId"))
TVT_EVENT_PARTICIPATION_NPC_ID = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("EnableWarehouseSortingClan"))
L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("EnableWarehouseSortingPrivate"))
L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("EnableWarehouseSortingFreight"))
L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("EnableManaPotionSupport"))
L2JMOD_ENABLE_MANA_POTIONS_SUPPORT = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("MinKarma"))
KARMA_MIN_KARMA = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("MaxKarma"))
KARMA_MAX_KARMA = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("XPDivider"))
KARMA_XP_DIVIDER = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("BaseKarmaLost"))
KARMA_LOST_BASE = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("CanGMDropEquipment"))
KARMA_DROP_GM = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint"))
KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pValue);
else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop"))
KARMA_PK_LIMIT = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("PvPVsNormalTime"))
PVP_NORMAL_TIME = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("PvPVsPvPTime"))
PVP_PVP_TIME = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("GlobalChat"))
DEFAULT_GLOBAL_CHAT = pValue;
else if (pName.equalsIgnoreCase("TradeChat"))
DEFAULT_TRADE_CHAT = pValue;
else if (pName.equalsIgnoreCase("GMAdminMenuStyle"))
GM_ADMIN_MENU_STYLE = pValue;
else
return false;
return true;
}
private Config()
{}
/**
* Save hexadecimal ID of the server in the L2Properties file.
*
* @param string
* (String) : hexadecimal ID of the server to store
* @see HEXID_FILE
* @see saveHexid(String string, String fileName)
* @link LoginServerThread
*/
public static void saveHexid(int serverId, String string)
{
Config.saveHexid(serverId, string, HEXID_FILE);
}
/**
* Save hexadecimal ID of the server in the properties file.
*
* @param hexId
* (String) : hexadecimal ID of the server to store
* @param fileName
* (String) : name of the L2Properties file
*/
public static void saveHexid(int serverId, String hexId, String fileName)
{
try
{
L2Properties hexSetting = new L2Properties();
File file = new File(fileName);
// Create a new empty file only if it doesn't exist
file.createNewFile();
OutputStream out = new FileOutputStream(file);
hexSetting.setProperty("ServerID", String.valueOf(serverId));
hexSetting.setProperty("HexID", hexId);
hexSetting.store(out, "the hexID to auth into login");
out.close();
}
catch (Exception e)
{
_log.warning(StringUtil.concat("Failed to save hex id to ", fileName, " File."));
e.printStackTrace();
}
}
/**
* Loads flood protector configurations.
*
* @param properties
* properties file reader
*/
private static void loadFloodProtectorConfigs(final L2Properties properties)
{
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", "4");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", "42");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", "16");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", "100");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SHOUT, "Shout", "1000");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRADE_CHAT, "TradeChat", "100000");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_PARTY_ROOM, "PartyRoom", "3000");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_PARTY_ROOM_COMMANDER, "PartyRoomCommander", "300");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", "20");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", "10");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_MULTISELL, "MultiSell", "1");
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_TRANSACTION, "Transaction", "10");
}
/**
* Loads single flood protector configuration.
*
* @param properties
* properties file reader
* @param config
* flood protector configuration instance
* @param configString
* flood protector configuration string that determines for which flood protector
* configuration should be read
* @param defaultInterval
* default flood protector interval
*/
private static void loadFloodProtectorConfig(final L2Properties properties, final FloodProtectorConfig config, final String configString, final String defaultInterval)
{
config.FLOOD_PROTECTION_INTERVAL = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval));
config.LOG_FLOODING = Boolean.parseBoolean(properties.getProperty(StringUtil.concat("FloodProtector", configString, "LogFlooding"), "False"));
config.PUNISHMENT_LIMIT = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), "0"));
config.PUNISHMENT_TYPE = properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
config.PUNISHMENT_TIME = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), "0"));
}
} | sdrak94/trinity | java/net/sf/l2j/Config.java |
248,965 | package application;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.InvalidClassException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.URL;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ExecutionException;
import controller.IntroController;
import controller.LevelController;
import controller.QuizController;
import controller.SceneController;
import controller.StatsController;
import controller.VideoController;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import resources.StoredStats;
/**
* Main entry class (Application) This class is the entry to the JavaFX
* application Acts as the application model
*
* @author Mohan Cao
* @author Ryan MacMillan
*
*/
public class Main extends Application implements MainInterface {
private Map<String, Scene> screens; // maps keys to scenes
private Map<String, FXMLLoader> screenFXMLs; // maps keys to fxmlloaders,
// needed to get controllers
private SceneController currentController; // current controller to
// displayed scene
private StatisticsModel statsModel;
private Game game;
private Queue<Task<Integer>> festivalTasks;
private FestivalService festivalService;
private boolean _firstTimeRun;
Stage _stage;
{
screens = new HashMap<String, Scene>();
screenFXMLs = new HashMap<String, FXMLLoader>();
_firstTimeRun = false;
statsModel = new StatisticsModel(this);
_firstTimeRun = statsModel.isFirstTime();
festivalService = new FestivalService();
festivalTasks = new LinkedList<Task<Integer>>();
}
@Override
public void start(Stage primaryStage) {
this._stage = primaryStage;
buildMainScenes();
setupVideoFile();
try {
primaryStage.setTitle("VoxSpell v1.0.1");
if(_firstTimeRun){
requestSceneChange("firstTime");
}else{
requestSceneChange("mainMenu");
}
primaryStage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void stop() {
currentController.cleanup();
statsModel.sessionEnd();
festivalService.cleanup();
}
@Override
public Object loadObjectFromFile(String path) {
try {
File file = new File(path);
if (!file.exists()) {
return null;
}
FileInputStream fileIn = new FileInputStream(file);
ObjectInputStream instr = new ObjectInputStream(fileIn);
Object obj = instr.readObject();
instr.close();
return obj;
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InvalidClassException ice) {
writeObjectToFile(path, new StoredStats());
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
public boolean writeObjectToFile(String path, Object obj) {
try {
File file = new File(path);
FileOutputStream fileout = new FileOutputStream(file);
ObjectOutputStream outstr = new ObjectOutputStream(fileout);
outstr.writeObject(obj);
outstr.close();
fileout.close();
return true;
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
/**
* Moves video to ~/.user. Uses FFMPEG to speed up video by 4x
* @author Ryan MacMillan
*/
private void setupVideoFile() {
/*InputStream video1 = this.getClass().getClassLoader().getResourceAsStream("resources/big_buck_bunny_1_minute.mp4");
File video = new File(video1);
File destination = new File(System.getProperty("user.home") + "/.user/BigBuckBunny.mp4");*/
try {
exportResource("/resources/big_buck_bunny_1_minute.mp4",System.getProperty("user.home")+"/.user/BigBuckBunny.mp4");
} catch (IOException e1) {
e1.printStackTrace();
}
ProcessBuilder pb = new ProcessBuilder("/bin/bash", "-c",
"ffmpeg -i ~/.user/BigBuckBunny.mp4 -filter_complex \"[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]\" -map \"[v]\" -map \"[a]\" -strict -2 ~/.user/SpedUpReward.mp4");
//copyFile(video, destination);
Task<Integer> ffmpegTask = new Task<Integer>() {
@Override
protected Integer call() throws Exception {
Process process;
try {
process = pb.start(); // probably better to put it
// in the task, which will
// be disposed when method
// ends.
return process.waitFor();
} catch (IOException e) {
// couldn't find BASH
Alert alert = new Alert(AlertType.ERROR);
alert.setContentText("This program does not work on non-Linux systems at this time. Sorry about that.");
alert.showAndWait();
return 1;
}
}
public void succeeded() {
super.succeeded();
try {
if (get() != 0) {
Alert alert = new Alert(AlertType.ERROR);
alert.setContentText("FFMPEG does not work on this system"); // or
// the
// programmer
// did
// something
// wrong
alert.showAndWait();
}
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
}
};
new Thread(ffmpegTask).start();
}
/**
* Exports internal resource to file system
* @param resource path of file in jar
* @param location location of file to export to
* @throws IOException
* @author Mohan Cao
* @author Ryan MacMillan
*/
private void exportResource(String resource, String newFilePath) throws IOException {
InputStream stream = null;
OutputStream resStreamOut = null;
try {
stream = getClass().getResourceAsStream(resource);
if(stream == null)throw new IOException("Failed to get resource " + resource);
int readBytes;
byte[] buffer = new byte[4096];
resStreamOut = new FileOutputStream(newFilePath);
while ((readBytes = stream.read(buffer)) > 0) {
resStreamOut.write(buffer, 0, readBytes);
}
} catch (Exception ex) {
throw ex;
} finally {
if(stream!=null)stream.close();
if(resStreamOut!=null)resStreamOut.close();
}
}
/**
* Builds scenes for the application
*/
private void buildMainScenes() {
BufferedReader br = null;
try {
br = new BufferedReader(
new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("config.cfg")));
String line;
String[] strSplit;
while ((line = br.readLine()) != null) {
strSplit = line.split(",");
try {
URL loc;
FXMLLoader fxml = null;
Parent menu = null;
if ((loc = getClass().getClassLoader().getResource(strSplit[1])) != null) {
fxml = new FXMLLoader(loc);
menu = (Parent) fxml.load();
screens.put(strSplit[0], new Scene(menu));
screenFXMLs.put(strSplit[0], fxml);
}
} catch (IOException ioex) {
System.err.println("Scene loading error");
ioex.printStackTrace();
}
}
} catch (IOException e) {
throw new RuntimeException("Config files corrupted");
} finally {
try {
if (br != null) {
br.close();
}
} catch (IOException e1) {
}
}
}
public Collection<String> getAvailableSceneKeys() {
return screens.keySet();
}
/**
* Request scene change, by default the current stage, with data parameters
*/
public boolean requestSceneChange(String key, String... data) {
boolean success = false;
if (screens.containsKey(key)) {
currentController = screenFXMLs.get(key).getController();
currentController.setApplication(this);
success = requestSceneChange(key, _stage, data);
currentController.init(data);
}
return success;
}
/**
* Request scene change in particular stage with data parameters Does not
* initialise the controller
*
* @param key
* @param stage
* @param data
* @return
*/
public boolean requestSceneChange(String key, Stage stage, String... data) {
if (screens.containsKey(key)) {
stage.hide();
stage.setScene(screens.get(key));
stage.centerOnScreen();
stage.show();
stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
public void handle(WindowEvent event) {
if (game != null && !game.onExit()) {
event.consume();
}
}
});
return true;
}
return false;
}
public void tell(String message, Object... objectParams) {
// propagate + notify currentController (view-controller) of changes
currentController.onModelChange(message, objectParams);
}
/**
* Festival service class.
*
* @author Mohan Cao
*
*/
class FestivalService extends Service<Integer> {
private Process _pb;
private String _voice;
private String[] _words;
private int _speed;
{
try {
Process p = new ProcessBuilder("/bin/bash", "-c", "type -p festival").start();
BufferedReader isr = new BufferedReader(new InputStreamReader(p.getInputStream()));
String output = isr.readLine();
if (output == null || output.isEmpty()) {
Alert alert = new Alert(AlertType.ERROR);
alert.setContentText("Could not find Festival text-to-speech\nsynthesiser. Sorry about that.");
alert.showAndWait();
Platform.exit();
}
_pb = new ProcessBuilder(output).start();
} catch (IOException e) {
System.err.println("IOException");
}
}
public final void setWordsToList(int speed, String... words) {
_words = words;
_speed = speed;
}
public void cleanup() {
_pb.destroy();
}
public final void setVoice(String voice) {
_voice = voice;
}
@Override
protected Task<Integer> createTask() {
final String voice = _voice;
final String[] words = _words;
final int speed = _speed;
return new Task<Integer>() {
protected Integer call() throws Exception {
BufferedWriter bw = new BufferedWriter(new PrintWriter(_pb.getOutputStream()));
for (int i = 0; i < words.length; i++) {
bw.write("(Parameter.set 'Duration_Stretch " + speed + ")");
bw.write("(voice_" + voice + ")");
bw.write("(SayText \"" + words[i] + "\")");
}
bw.flush();
return 0;
}
public void succeeded() {
try {
if (!festivalTasks.isEmpty()&&get()==0) {
Task<Integer> task = festivalTasks.poll();
new Thread(task).start();
}
} catch (InterruptedException | ExecutionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
}
}
/**
* Creates a new process of Festival that says a word
*
* @param speed list of speeds of the words being said
* @param voiceType voice to use (kal_diphone or akl_nz_jdt_diphone)
* @param words list of words to be said
*/
public void sayWord(final int speed, final String voiceType, final String... words) {
festivalService.setVoice(voiceType);
festivalService.setWordsToList(speed, words);
if (!festivalTasks.isEmpty()) {
festivalTasks.add(festivalService.createTask());
}
Task<Integer> festivalTask = festivalService.createTask();
new Thread(festivalTask).start();
}
/**
* Called by scene controller to update the main application
*
* @param mue ModelUpdateEvent
*/
public void update(ModelUpdateEvent mue) {
// Game must be updated
if (mue.getControllerClass().equals(GameUpdater.class)) {
game = mue.getUpdatedGame();
}
mue.setMain(this);
mue.setGame(game);
mue.setStatsModel(statsModel);
if (mue.getControllerClass().equals(QuizController.class)) {
mue.updateFromQuizController(screens, screenFXMLs);
} else if (mue.getControllerClass().equals(StatsController.class)) {
mue.updateFromStatsController();
} else if (mue.getControllerClass().equals(LevelController.class)) {
mue.updateFromLevelController();
} else if (mue.getControllerClass().equals(VideoController.class)) {
mue.updateFromVideoController();
} else if (mue.getControllerClass().equals(IntroController.class)){
mue.updateFromIntroController();
}
}
public static void main(String[] args) {
launch(args);
}
}
| mohan-cao/voxspell | src/application/Main.java |
248,966 | package com.xworkz.things;
public class FestivalRunner {
public static void main(String[] args) {
new Dasara();
new Deepavali();
new Ganesha();
new Hanumajayanthi();
}
}
| karthiknns/virat | FestivalRunner.java |
248,968 | package Shop;
import java.time.LocalDate;
import java.util.List;
public class FestivalDiscount {
public static double calculateDiscountedPrice(List<Commodity> items, LocalDate date) {
double totalPrice = items.stream().mapToDouble(Commodity::getPrice).sum();
double discountRate = getDiscountRateForDate(date);
return totalPrice * discountRate;
}
private static double getDiscountRateForDate(LocalDate date) {
if (date.equals(LocalDate.of(date.getYear(), 11, 11))) {
return 0.7;
} else if (date.equals(LocalDate.of(date.getYear(), 12, 12))) {
return 0.8;
} else if (date.equals(LocalDate.of(date.getYear(), 10, 24))) {
return 0.9;
} else if (date.equals(LocalDate.of(date.getYear(), 1, 1))) {
return 0.8;
} else if (date.getMonthValue() == 10 && date.getDayOfMonth() <= 7) {
return 0.8;
}
return 1.0;
}
} | Rain-ice-k/Simple-shopping-system | src/Shop/FestivalDiscount.java |
248,969 | package model.actions;
import model.GameModel;
import model.actions.serialization.JsonObject;
import model.palacefestival.PalaceFestival;
/**
* Created by idinamenzel on 4/14/14.
*/
public class EndTurn extends Action {
/*
attributes
*/
/*
constructors
*/
GameModel game;
PalaceFestival festival;
public EndTurn(GameModel game, PalaceFestival festival){
this.game = game;
this.festival = festival;
}
@Override
public ActionResult tryAction() {
/*
Check if the action is valid to complete
...
returns true if valid
false if invalid
*/
boolean isSuccess = true;
int famePoints = 0;
int actionPoints = 0;
String message = "";
//Check if the turn can advance
//todo talk to controller about mapping key press for end turn to NOT WORK which forces them to go between planning and play mode
if(!game.canAdvanceJavaTurn()){
isSuccess = false;
message += "Player cannot end their turn";
}
if(message.equalsIgnoreCase("")){
message += "End Turn";
}
return new ActionResult(isSuccess, famePoints, actionPoints, message);
}
@Override
public ActionResult doAction() {
/*
Check if the action is valid
Do the action if is valid to so
...
*/
ActionResult result = tryAction();
if(result.isSuccess()) {
game.advanceJavaTurn();
festival.advanceTurn();
}
return result;
}
@Override
public String serialize() {
/*
Formats the attributes of this object
into a String that can be used
for loading and saving.
Utilizes Json and JsonObject to accomplish this.
*/
return null;
}
@Override
public Action restore(JsonObject actionToRestore) {
/*
Converts the JsonObject used when loading
to restore the states/attributes of this action.
Utilized JsonObject to accomplish this
*/
return null;
}
}
| bbokorney/spups | src/model/actions/EndTurn.java |
248,970 | package B_2024_06;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Queue;
// 거리: 맨해튼 거리(x좌표 차이+y좌표 차이)
// 1000(50*20)거리 이하에서 편의점이 존재해야 한다.
// bfs로 탐색해나가면서 1.방문가능한 편의점이 있는지, 2. 축제에 갈 수 있는지만 탐색해주면 될듯하다.
public class BOJ9205 {
static int n; // 편의점의 개수
static Node home, festival;
static Node[] cons;
static boolean[] visited;
static Queue<Node> queue;
static boolean rst; // 축제에 갈 수 있는지
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
for(int t=0; t<T; t++) {
rst = false;
n = Integer.parseInt(br.readLine());
cons = new Node[n];
visited = new boolean[n]; // 해당 번호 편의점에 방문했는지 여부
String[] line_1 = br.readLine().split(" ");
home = new Node(Integer.parseInt(line_1[0]), Integer.parseInt(line_1[1]));
for(int i=0; i<n; i++) {
String[] line_n = br.readLine().split(" ");
cons[i] = new Node(Integer.parseInt(line_n[0]), Integer.parseInt(line_n[1]));
}
String[] line_last = br.readLine().split(" ");
festival = new Node(Integer.parseInt(line_last[0]), Integer.parseInt(line_last[1]));
bfs();
System.out.println(rst?"happy":"sad");
}
}
private static void bfs() {
queue = new LinkedList<>();
queue.add(home);
while(!queue.isEmpty()) {
Node cur = queue.poll();
if(isReachable(cur, festival)) {
rst = true;
return;
}
for(int i=0; i<n; i++) {
if(!visited[i] && isReachable(cur, cons[i])) {
queue.add(cons[i]);
visited[i] = true;
}
}
}
}
// 맨해튼 거리 1000 이하인 경우 이동 가능
private static boolean isReachable(Node start, Node end) {
return Math.abs(start.x-end.x)+Math.abs(start.y-end.y)<=1000;
}
static class Node {
int x;
int y;
public Node(int x, int y) {
this.x = x;
this.y = y;
}
}
}
| OneDay-OneAlgorithm/Kimyoungbin | src/B_2024_06/BOJ9205.java |
248,971 | import java.time.LocalDate;
import java.util.ArrayList;
public class GestorFestival {
private PantAdmFestival pantalla;
public void nuevoFestival() {
this.pantalla.pedirDatosFestival();
}
public void tomarDatosIdentFestival(int anoEdicion, String nombre, LocalDate fechaInicio) {
// logica para capturar los datos de los campos
this.validarFestival(anoEdicion, nombre, fechaInicio);
}
public boolean validarFestival(int anoEdicion, String nombre, LocalDate fechaInicio) {
// Falsa consulta a BBDD que trae un arreglo de datos
ArrayList<Festival> arrayFestivales = new ArrayList<>(); // arreglo que contendra festivales
Festival festivalUno = new Festival(2022, "Festival peñas 2022", LocalDate.of(2022, 02, 14));
arrayFestivales.add(festivalUno); // agrego al array el festival
Festival festivalDos = new Festival(2022, "Festival peñas 2021", LocalDate.of(2021, 02, 13));
arrayFestivales.add(festivalDos); // agrego al array el festival
// logica existeFestival()
for(Festival festival: arrayFestivales) {
if (festival.existeFestival(anoEdicion, nombre, fechaInicio)) {
return true; // el festival ya existe
}
}
return false;
}
public void setPantalla(PantAdmFestival pantalla) {
this.pantalla = pantalla;
}
}
| Leocappiello/CU-5-Registrar-festival | GestorFestival.java |
248,972 | /* This class stores information of a festival which are name, starting date and list of events that will take place during the festival. */
public class FestivalManager {
private String name;
private String startDate;
private Event[] events;
int eventsAdded = 0;
// Task: Write code for the constructor below to initialize the member variables
// properly
public FestivalManager(String name, String startDate, int maxEventCount) {
// write your code here
this.name = name;
this.startDate = startDate;
this.events = new Event[maxEventCount];
}
// Task: Write code for the function below. This function adds an event to this
// festival. Check for the following case: (i) total event count does not exceed
// the maximum number of events allowed for this festival
public void addEvent(Event e) {
// write your code here
if (eventsAdded >= events.length)
return;
/*
* events[eventsAdded].setEventDate(e.getEventDate());
* events[eventsAdded].setEventName(e.getEventName());
* events[eventsAdded].setEventLocation(e.getEventLocation());
* eventsAdded++;
*/
// write your code here
events[eventsAdded] = new Event(e.getEventName(), e.getEventDate(), e.getEventLocation(),
e.getMaxparticipants()); // Assuming maximumParticipants is available in the scope
eventsAdded++;
}
// Task: Write code for the function below. This function registers a student
// for an event in this festival. Check for the following case: (i) event does
// not exist
public void registerStudent(String eventName, Student s) {
// Write your code here
int index = -1;
for (int i = 0; i < eventsAdded; i++) {
if (events[i].getEventName().equals(eventName))
index = i;
}
if (index == -1)
return;
else {
events[index].addParticipant(s);
return;
}
}
// Task: Write code for the function below. The function shows the details of
// this festival. Make sure the output matches with the supplied sample output.
public void showDetails() {
// Write your code here
System.out.println("Festival Name:" + name);
System.out.println("Festival Starting Date:" + startDate);
System.out.println("Festival Events:");
for (int i = 0; i < eventsAdded; i++) {
events[i].showDetails();
}
}
// Task: Write code for the function below. This function shows details of the
// event in the argument. Check for the following case: (i) event does not exist
public void showEvent(String eventName) {
// Write your code here
int index = -1;
for (int i = 0; i < eventsAdded; i++) {
if (events[i].getEventName().equals(eventName))
index = i;
}
if (index == -1)
return;
else {
events[index].showDetails();
}
}
// Task: Write code for the function below. This function shows details of the
// events that will start on the date passed as its argument. Check for the
// following case: (i) event does not exist
public void showEventsOnDate(String eventDate) {
// Write your code here
int index = -1;
for (int i = 0; i < eventsAdded; i++) {
if (events[i].getEventDate().equals(eventDate)) {
System.out.println(events[i].getEventName());
index = i;
}
}
if (index == -1)
return;
}
// Task: Write code for the function below. This function shows the details of
// the events with maximum number of participants. If there are multiple events,
// show all.
public void eventWithHighestParticipants() {
// Write your code here
int maxParticipants = -1;
for (int i = 0; i < eventsAdded; i++) {
if (maxParticipants < events[i].getParticipantsAddedSoFar())
maxParticipants = events[i].getParticipantsAddedSoFar();
}
for (int i = 0; i < eventsAdded; i++) {
if (maxParticipants == events[i].getParticipantsAddedSoFar())
events[i].showDetails();
}
}
// Task: Write code for the function below. This function takes a student Id as
// input and then lists all the events this particular student has registered
// for. Make sure your output matches the supplied sample output.
public void showEventsForStudent(String studentId) {
// Write your code here
for (int i = 0; i < eventsAdded; i++) {
if (events[i].getStudent(studentId) != null) {
if (events[i].getStudent(studentId).getId().equals(studentId))
System.out.println(events[i].getEventName());
}
}
}
// Task: Write code for the function below. This functions takes an event's name
// and a student's ID as arguments and then removes the student from the
// registered student list of the event. Check for the following cases: (i)
// event does not exist, (ii) student is not registered for the event
public void cancelRegistration(String eventName, String studentId) {
// Write your code here
int index = -1;
for (int i = 0; i < eventsAdded; i++) {
if (events[i].getEventName().equals(eventName)) {
index = i;
break;
}
}
if (index == -1)
return;
events[index].removeParticipant(studentId);
}
}
| ahtasham67/CSE_108_OOP-offlines | offline4/FestivalManager.java |
248,974 |
//----------------------------------------------------
// The following code was generated by CUP v0.11b 20160615 (GIT 4ac7450)
//----------------------------------------------------
package proyectocompi2;
/** CUP generated class containing symbol constants. */
public class sym {
/* terminals */
public static final int le_candycane = 22;
public static final int mod_comet = 31;
public static final int l_string_nicolas = 58;
public static final int and_melchior = 34;
public static final int FINREGALO = 23;
public static final int SEPARAREGALO = 8;
public static final int HADA = 39;
public static final int PERSONA = 48;
public static final int CIERRACUENTO = 7;
public static final int DUENDE = 40;
public static final int t_bool_colacho = 10;
public static final int ENTREGA = 51;
public static final int CIERRAREGALO = 3;
public static final int l_int_dedmoroz = 13;
public static final int g_merryberry = 19;
public static final int or_balthassar = 35;
public static final int ABREEMPAQUE = 4;
public static final int CIERRAEMPAQUE = 5;
public static final int RETORNAREGALO = 52;
public static final int NAVIDAD = 49;
public static final int div_int_vixen = 29;
public static final int pow_cupid = 32;
public static final int NARRA = 61;
public static final int t_float_santa = 9;
public static final int HACE = 42;
public static final int ENVUELVE = 41;
public static final int not_gaspar = 33;
public static final int mul_prancer = 28;
public static final int t_arr_noel = 14;
public static final int l_MINIREGALO = 12;
public static final int FESTIVAL = 54;
public static final int GRINCH = 25;
public static final int EOF = 0;
public static final int TRINEO = 47;
public static final int CORTA = 45;
public static final int REVISA = 43;
public static final int error = 1;
public static final int res_dancer = 27;
public static final int ABRECUENTO = 6;
public static final int sum_dasher = 26;
public static final int l_float_padrenavidad = 16;
public static final int ESCUCHA = 62;
public static final int ABREREGALO = 2;
public static final int ERROR = 60;
public static final int ARBOL = 56;
public static final int l_slinky = 20;
public static final int ENVIA = 44;
public static final int SINREGALO = 53;
public static final int e_jinglebell = 17;
public static final int t_string_nicolas = 11;
public static final int l_tPAPANOEL = 37;
public static final int l_fPAPANOEL = 36;
public static final int NATIVIDAD = 59;
public static final int ge_snowflake = 21;
public static final int t_int_sinterklass = 15;
public static final int ELFO = 38;
public static final int ne_tinseltoes = 18;
public static final int t_char_dedmoroz = 57;
public static final int QUIEN = 24;
public static final int LUCES = 55;
public static final int ESPERARASANTA = 46;
public static final int div_float_blitzen = 30;
public static final int INTEGER_LITERAL = 50;
public static final String[] terminalNames = new String[] {
"EOF",
"error",
"ABREREGALO",
"CIERRAREGALO",
"ABREEMPAQUE",
"CIERRAEMPAQUE",
"ABRECUENTO",
"CIERRACUENTO",
"SEPARAREGALO",
"t_float_santa",
"t_bool_colacho",
"t_string_nicolas",
"l_MINIREGALO",
"l_int_dedmoroz",
"t_arr_noel",
"t_int_sinterklass",
"l_float_padrenavidad",
"e_jinglebell",
"ne_tinseltoes",
"g_merryberry",
"l_slinky",
"ge_snowflake",
"le_candycane",
"FINREGALO",
"QUIEN",
"GRINCH",
"sum_dasher",
"res_dancer",
"mul_prancer",
"div_int_vixen",
"div_float_blitzen",
"mod_comet",
"pow_cupid",
"not_gaspar",
"and_melchior",
"or_balthassar",
"l_fPAPANOEL",
"l_tPAPANOEL",
"ELFO",
"HADA",
"DUENDE",
"ENVUELVE",
"HACE",
"REVISA",
"ENVIA",
"CORTA",
"ESPERARASANTA",
"TRINEO",
"PERSONA",
"NAVIDAD",
"INTEGER_LITERAL",
"ENTREGA",
"RETORNAREGALO",
"SINREGALO",
"FESTIVAL",
"LUCES",
"ARBOL",
"t_char_dedmoroz",
"l_string_nicolas",
"NATIVIDAD",
"ERROR",
"NARRA",
"ESCUCHA"
};
}
| chaldiran527/Compiladores-Proyecto3 | src/proyectocompi2/sym.java |
248,975 | package Paper04B;
public interface IFestival {
void performEvent();
double getBudget();
}
| Bashitha-Weerapperuma/oop-exam-Y2-S1 | 2019 Paper B/Q 04/IFestival.java |
248,976 | import java.util.ArrayList;
import java.util.List;
public class FestivalSchedule {
private List<Stage> stages;
public FestivalSchedule() {
this.stages = new ArrayList<>();
}
public void addStage(Stage stage) {
stages.add(stage);
}
public boolean isEmpty() {
for (Stage stage : stages) {
if (!stage.getPerformanceSlots().isEmpty()) {
return false; // Found a stage with performance slots, so not empty
}
}
return true; // All stages are empty
}
public void printSchedule() {
if (isEmpty()) {
System.out.println("The festival schedule is currently empty.");
} else {
stages.forEach(stage -> {
System.out.println("Stage: " + stage.getStageName());
stage.getPerformanceSlots().forEach(slot -> {
System.out.println(slot);
});
});
}
}
}
| i-nazuma/tutorium190124 | src/FestivalSchedule.java |
248,977 | package Controllers;
import java.awt.Component;
import java.awt.event.KeyEvent;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import javax.swing.JOptionPane;
import ChokingHazard.GameFrame;
import ChokingHazard.GameManager;
import Models.GameModel;
import Models.JavaPlayer;
import Models.GameModel.GameState;
import Models.PalaceCard;
import Models.Actions.Action;
import Models.Actions.HoldFestivalAction;
import Models.Actions.DrawFestivalCardAction;
import Models.Actions.DrawPalaceCardAction;
import Models.Actions.EndTurnAction;
import Models.Actions.IrrigationTileAction;
import Models.Actions.MoveDeveloperAction;
import Models.Actions.PalaceTileAction;
import Models.Actions.PlaceDeveloperOnBoardAction;
import Models.Actions.RiceTileAction;
import Models.Actions.TakeDeveloperOffBoardAction;
import Models.Actions.ThreeTileAction;
import Models.Actions.TwoTileAction;
import Models.Actions.UseActionTokenAction;
import Models.Actions.VillageTileAction;
import Models.Actions.MActions.*;
import Views.GameContainerPanel;
public class GameController {
private GameFrame gameFrame;
private GameManager gameManager;
private GameModel currentGame;
private GameContainerPanel currentGamePanel;
private BoardController board;
private PlayerController players;
private SharedComponentController shared;
public GameController(GameFrame frame) {
// should we just create them here instead of passing it in?
this.gameFrame = frame;
gameFrame.giveGameController(this);
this.gameManager = new GameManager(this);
}
public void createNewGame(int numPlayers, String[] playerNames,
String[] playerColors) {
// create controllers
currentGame = new GameModel(numPlayers, playerNames, playerColors);
board = new BoardController(currentGame.getBoard());
players = new PlayerController(currentGame.getPlayers()); //change player controller to query the model for the player info
shared = new SharedComponentController(currentGame.getShared(), this); //change this to work
//this initializes the dealing of the palace cards
//and then the player sets those dealt cards as the cards
players.dealPalaceCards(shared.dealPalaceCards(numPlayers));
players.setCurrentPlayerinPlayerPanel(currentGame.getPlayerIndex());
currentGamePanel = new GameContainerPanel(board.getBoardPanel(),
players.getPlayerPanels(), shared.getSharedComponentPanel());
gameFrame.setFrameContent(currentGamePanel);
seeIfPlayerCanHoldAFestival();
}
public boolean loadGame(File file) {
// create controllers
currentGame = (new GameModel(0, null, null)).loadObject(gameManager.loadGame(file));
board = new BoardController(currentGame.getBoard());
players = new PlayerController(currentGame.getPlayers());
shared = new SharedComponentController(currentGame.getShared(), this);
currentGamePanel = new GameContainerPanel(board.getBoardPanel(), players.getPlayerPanels(), shared.getSharedComponentPanel());
gameFrame.setFrameContent(currentGamePanel);
loadActions();
return true;
}
public boolean saveGame() {
if (currentGame == null) {
JOptionPane.showMessageDialog(null, "No game to save!");
return false;
}
String filename = currentGamePanel.askUserWhatNameToSaveGameAs();
if (filename == null) {
JOptionPane.showMessageDialog(null, "Invalid Filename");
return false;
}
// everything is okay, save the game
gameManager.saveGame(filename, currentGame.serialize());
return true;
}
public boolean getCurrentGameExists() {
if (currentGame == null) {
return false;
}
return true;
}
public void keyPressed(KeyEvent e) {
// this is used only for when users want to show their festival cards
// when the key is released, then the festival cards will be hidden once
// again
if (currentGame != null) {
userPressedKey(e);
}
}
public void keyReleased(KeyEvent e) {
// key released is when a user lifts their finger from a key
if (currentGame != null) {
userReleasedKey(e);
}
}
public void userPressedKey(KeyEvent e) {
// check if the key that is pressed is the button to show the user's
// festival card.
if (e.getKeyCode() == 70) {
// the user is pressing (and holding) the F button
// TODO this can only be called if in Play Mode
currentGamePanel.playDrawCardSound();
currentGamePanel.displayPalaceCardFrame(this.players.getPlayerAtIndex(this.currentGame.getPlayerIndex()));
}
}
private void userReleasedKey(KeyEvent e) {
switch (e.getKeyCode()) {
case 8:
case 127:
//released delete, delete a developer from the board
//need all the type checks and where they are to delete a developer
System.out.println("GCtrl Delete pressed");
Action deleteAction = currentGame.pressDelete();
if(deleteAction != null){
currentGame.addToActionHistory(deleteAction);
currentGame.setSelectedAction(null);
currentGamePanel.playPlaceTileSound();
board.updateBoardPanel(deleteAction, currentGame);
players.updatePlayerPanel(currentGame.getPlayerIndex());
}
else{
currentGamePanel.playErrorSound();
}
break;
case 9:
//released tab, tab through developers
if (currentGame.pressTab()){
//System.out.println("Gctrl tab for not first time");
updateBoardControllerWithSelectedAction();
}
else if(players.getNumDevelopersOffBoard(currentGame.getPlayerIndex()) < 12) {
//System.out.println("Gctrl tab for first time");
currentGame.setSelectedAction(new SelectTabThroughDevelopersAction("player_" + players.getColorOfPlayer(currentGame.getPlayerIndex()), players.getDevelopersOnBoard(currentGame.getPlayerIndex())));
updateBoardControllerWithSelectedAction();
} else {
//System.out.println("Gctrl not tab blargh");
currentGamePanel.playErrorSound();
}
break;
case 10:
// released enter, place tile/developer onto board.
// System.out.println("(in GameController)Enter was pressed");
Action action = currentGame.pressEnter();
//currentGamePanel.playSelectDeveloperSound(); ?
if(action != null){
currentGame.addToActionHistory(action);
currentGame.setSelectedAction(null);
currentGamePanel.playPlaceTileSound();
updateControllersWithAction(action);
} else {
currentGamePanel.playErrorSound();
}
break;
case 27:
// escapes out of a selected action
// tells the current game about the event so that it makes
// SelectedAction to null
// also updates the board panel so that the image is canceled
currentGame.pressEsc();
board.pressEsc();
break;
case 32:
// released the space bar, rotate
// tells the current game to tell the selectedAction to do
// pressSpace()
// will only tell the board about the change if it was a rotatable
// tile action
if (currentGame.pressSpace()) {
currentGamePanel.playMoveComponentSound();
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
// using these arrow keys for movement of developers and tiles
case 37:
if (currentGame.pressLeft()) {
currentGamePanel.playMoveComponentSound();
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
case 38:
if (currentGame.pressUp()) {
currentGamePanel.playMoveComponentSound();
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
case 39:
if (currentGame.pressRight()) {
currentGamePanel.playMoveComponentSound();
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
case 40:
if (currentGame.pressDown()) {
currentGamePanel.playMoveComponentSound();
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
// --------------------------------------------------------------------
case 50: // released 2, select two space tile
if (players.selectTwoTile(currentGame.getPlayerIndex())) {
currentGamePanel.playMoveComponentSound();
currentGame
.setSelectedAction(new SelectTwoTileAction("twoTile"));
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
case 51: // released 3, select three space tile
// check if player has enough AP and if sharedComponent has any more
// 3 tiles (I could check game state but we could always change how
// the game state works...)
// if(players.checkIfSelectionValid() &&
// shared.checkIfSelectionValid())
if (players.selectThreeTile(currentGame.getPlayerIndex())
&& shared.selectThreeTile()) {
currentGamePanel.playMoveComponentSound();
currentGame.setSelectedAction(new SelectThreeTileAction(
"threeTile"));
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
case 68: // released D, add new developer onto board
// currentGame.setSelectedActionDeveloper(new MAction(""));
// //somehow know the developer hash with the player color
if (players.selectDeveloper(currentGame.getPlayerIndex())) {
currentGamePanel.playSelectDeveloperSound();
currentGame
.setSelectedAction(new SelectPlaceDeveloperOnBoardAction(
"player_"
+ players.getColorOfPlayer(currentGame
.getPlayerIndex())));
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
case 73: // released I, add new Irrigation tile
// check if player has enough AP, and if there is enough in shared
if (players.selectThreeTile(currentGame.getPlayerIndex())
&& shared.selectThreeTile()) {
currentGamePanel.playMoveComponentSound();
currentGame.setSelectedAction(new SelectIrrigationTileAction(
"irrigationTile"));
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
case 77:
if (currentGame.pressM()) {
currentGamePanel.playSelectDeveloperSound();
updateBoardControllerWithSelectedAction();
}
else{
currentGamePanel.playErrorSound();
}
break;
case 80:// released P, new palace tile, need to ask for value of Tile
// is valid due to the view being awesome
int value = currentGamePanel.promptUserForPalaceValue();
// check player to see if they have enough AP and check shared to
// see if there are enough
if (players.selectPalaceTile(currentGame.getPlayerIndex())
&& shared.selectPalaceTile(value)) {
currentGame.setSelectedAction(new SelectPalaceTileAction(
"palace" + value + "Tile", value));
currentGamePanel.playMoveComponentSound();
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
case 82:
// released R, place rice tile
if (players.selectRiceTile(currentGame.getPlayerIndex())) {
currentGame.setSelectedAction(new SelectRiceTileAction(
"riceTile"));
currentGamePanel.playMoveComponentSound();
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
case 84:
// released T, use action token
if (players.selectActionToken(currentGame.getPlayerIndex())) {
UseActionTokenAction actionTokenAction = new UseActionTokenAction(
-1);
currentGamePanel.playMoveComponentSound();
currentGame.addToActionHistory(actionTokenAction);
currentGame.doLastActionInHistory();
updateControllersWithAction(actionTokenAction);
} else {
currentGamePanel.playErrorSound();
}
break;
case 85:
// released U, undo
if (currentGame.getGameState().equals(GameState.PlanningMode)) {
undo();
System.out.println("UNDO");
} else {
currentGamePanel.playErrorSound();
}
break;
case 86:
// released V, place Village
if (players.selectVillageTile(currentGame.getPlayerIndex())) {
currentGame.setSelectedAction(new SelectVillageTileAction(
"villageTile"));
currentGamePanel.playMoveComponentSound();
updateBoardControllerWithSelectedAction();
} else {
currentGamePanel.playErrorSound();
}
break;
case 88:
// check if the player has placed a land tile so they can get out of
// their turn
// released X, end turn
seeIfPlayerCanHoldAFestival();
if (currentGame.getGameState().equals(GameState.NormalMode) && currentGame.endTurn()) {
EndTurnAction endTurn = new EndTurnAction(currentGame.nextActionID());
currentGame.setSelectedAction(null);
currentGame.addToActionHistory(endTurn);
board.pressEsc();
players.setNoCurrentPlayerinPlayerPanels(); // need to tell the
// player panel of
// the current
// player to stop
// outlining their
// panel
players.setCurrentPlayerinPlayerPanel(currentGame
.getPlayerIndex()); // need to tell the new player panel
// that they are the current player
} else {
currentGamePanel.playErrorSound();
currentGamePanel.tellPeopleTheyAintPlacedNoLandTile();
}
break;
}
}
private void updateControllersWithAction(Action action) {
if (action instanceof IrrigationTileAction
|| action instanceof PalaceTileAction
|| action instanceof ThreeTileAction
|| action instanceof DrawPalaceCardAction
|| action instanceof DrawFestivalCardAction)
shared.updateSharedPanel();
if (action instanceof IrrigationTileAction
|| action instanceof PalaceTileAction
|| action instanceof ThreeTileAction
|| action instanceof PlaceDeveloperOnBoardAction
|| action instanceof TakeDeveloperOffBoardAction
|| action instanceof TwoTileAction
|| action instanceof VillageTileAction
|| action instanceof RiceTileAction
|| action instanceof MoveDeveloperAction)
board.updateBoardPanel(action, currentGame);
players.updatePlayerPanel(currentGame.getPlayerIndex());
}
private void updateBoardControllerWithSelectedAction() {
if (currentGame.getSelectedAction() instanceof SelectTwoTileAction
|| currentGame.getSelectedAction() instanceof SelectThreeTileAction) {
board.updateSelectedTileAction(
currentGame.getSelectedActionY() * 50, currentGame
.getSelectedActionX() * 50, currentGame
.getSelectedActionImageKey(),
((SelectRotatableComponentAction) currentGame
.getSelectedAction()).getRotationState());
} else if (currentGame.getSelectedAction() instanceof SelectOneSpaceTileAction) {
board.updateSelectedTileAction(
currentGame.getSelectedActionY() * 50,
currentGame.getSelectedActionX() * 50,
currentGame.getSelectedActionImageKey(), 0);
} else if (currentGame.getSelectedAction() instanceof SelectPlaceDeveloperOnBoardAction
|| currentGame.getSelectedAction() instanceof SelectTabThroughDevelopersAction) {// developer
board.updateSelectedHighlightDeveloperAction(
currentGame.getSelectedActionY() * 50,
currentGame.getSelectedActionX() * 50,
currentGame.getSelectedActionImageKey());
} else if (currentGame.getSelectedAction() instanceof SelectMoveDeveloperAroundBoardAction) {
board.updateSelectedPathDeveloperAction(
currentGame.getSelectedActionImageKey(),
currentGame.getPath());
}
}
private void seeIfPlayerCanHoldAFestival() {
// first make sure that the user can in fact hold a festival
int palaceValue = 10;
int[] palaceXY = {50,50};
boolean fest = false;
if(players.canHoldFestival(currentGame.getPlayerIndex(), shared.getCurrentFestivalCard())){
//ask if they would like to hold a palace festival
if(currentGamePanel.askUserIfWouldLikeToHoldAPalaceFestival()){
fest = true;
//TODO get the palace and palace value that the player wants it to be on
//call the P action yes?
}
}
if (fest){
startFestival(palaceValue, palaceXY);
}
}
private void startFestival(int palaceValue, int[] palaceXY){
currentGamePanel.playFestivalSound();
currentGamePanel.displayHoldFestivalFrame(this, players.getPlayerModels(), currentGame.getPlayerIndex(), shared.getCurrentFestivalCard(), palaceValue, palaceXY);
}
public void updatePlayersAfterFestival(HashMap<JavaPlayer, ArrayList<PalaceCard>> cardsToDiscardPerPerson, HashMap<JavaPlayer, Integer> famePointsWonPerPerson, PalaceCard festCard, int[] palaceXY) {
HoldFestivalAction festAction = new HoldFestivalAction(currentGame.nextActionID(), cardsToDiscardPerPerson, famePointsWonPerPerson, festCard, palaceXY);
currentGame.addToActionHistory(festAction);
currentGame.doLastActionInHistory();
// the player's fame points and festival cards have already been taken care of.
// this updates the views and discards of the cards that were played in the festival
for(int i = 0; i < currentGame.getPlayers().length; i++){
this.players.updatePlayerPanel(i);
}
this.shared.updateSharedPanel();
this.currentGamePanel.closeFestivalFrame();
this.board.updateBoardPanel(festAction, currentGame);
}
public void startPlanningMode() {
currentGame.setGameState(GameState.PlanningMode);
currentGame.setLastPlanningModeActionID();
}
public void startPlayingMode() {
currentGame.setGameState(GameState.NormalMode);
currentGame.flipAllCards();
shared.updateSharedPanel();
}
public void undo() {
currentGame.clearForReplay();
currentGame.undoAction();
board.clearBoard(false);
Action[] actions = currentGame.getActions();
doActions(actions, 0, actions.length-1, false, false);
doActions(actions, actions.length-1, actions.length, false, true);
System.out.println(currentGame.getActionHistory());
}
public void startReplay() {
System.out.println("START OF ROUND ACTION ID: " + currentGame.getStartOfRoundActionID());
Action[] actions = currentGame.getActions();
int startOfRoundIndex = currentGame.getStartOfRoundActionID();
System.out.println("START OF ROUND ACTION ID: " + currentGame.getStartOfRoundActionID());
System.out.println(Arrays.toString(actions));
System.out.println("START OF ROUND " + startOfRoundIndex);
currentGame.clearForReplay();
board.clearBoard(false);
doActions(actions, 0, startOfRoundIndex > 0 ? startOfRoundIndex-1 : 0, false, false);
doActions(actions, startOfRoundIndex > 0 ? startOfRoundIndex-1 : 0, actions.length, true, true);
}
public void undoUntilLastPlayingMode() {
currentGame.clearForReplay();
board.clearBoard(false);
Action[] actions = currentGame.getActions();
int startOfPlanningModeIndex = 0;
for(int x = 0; x < actions.length; ++x)
if(actions[x].getActionID() == currentGame.getLastPlanningModeActionID())
startOfPlanningModeIndex = x;
if(startOfPlanningModeIndex == 0)
return;
System.out.println("Last Planning Mode Index" + startOfPlanningModeIndex);
doActions(actions, 0, startOfPlanningModeIndex, false, false);
doActions(actions, startOfPlanningModeIndex, startOfPlanningModeIndex+1, false, true);
}
private void doActions(Action[] actions, int startIndex, int endIndex, boolean wait, boolean draw) {
for(int x = startIndex; x < endIndex; ++x) {
if(wait) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) { }
}
actions[x].doAction(currentGame);
if(draw) {
shared.updateSharedPanel();
players.updatePlayerPanel(currentGame.getPlayerIndex());
}
else {
board.setRedraw(false);
}
board.updateBoardPanel(actions[x], currentGame);
board.setRedraw(true);
}
}
private void loadActions() {
Action[] actions = currentGame.getActions();
doActions(actions, 0, actions.length-1, false, false);
doActions(actions, actions.length-1, actions.length, false, true);
}
public void pickUpPalaceCard() {
Action action = new DrawPalaceCardAction(currentGame.nextActionID());
action.doAction(currentGame);
currentGame.addToActionHistory(action);
currentGamePanel.playDrawCardSound();
updateControllersWithAction(action);
}
public void pickUpFestivalCard() {
Action action = new DrawFestivalCardAction(currentGame.nextActionID());
action.doAction(currentGame);
currentGame.addToActionHistory(action);
currentGamePanel.playDrawCardSound();
updateControllersWithAction(action);
}
public Component getGameFrame() {
return gameFrame;
}
public boolean askUserIfWouldLikeToSaveChangesFromPlanningMode() {
return currentGamePanel.askUserIfWouldLikeToSaveChangesFromPlanningMode();
}
public boolean askUserIfWouldLikeToEnterReplayMode() {
return currentGamePanel.askUserIfWouldLikeToEnterReplayMode();
}
}
| quadney/ChokingHazard-Iteration2 | src/Controllers/GameController.java |
248,978 | package GraphTraversal;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Queue;
public class Graph_9205 {
static class Node {
int x, y;
public Node(int x, int y) {
this.x = x;
this.y = y;
}
}
static Node home, festival;
static Node[] arr;
static int n;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
int t = Integer.parseInt(br.readLine());
for (int i = 0; i < t; i++) {
n = Integer.parseInt(br.readLine());
arr = new Node[n];
for (int j = 0; j < n + 2; j++) {
String[] str = br.readLine().split(" ");
int x = Integer.parseInt(str[0]);
int y = Integer.parseInt(str[1]);
if (j == 0) {
home = new Node(x, y);
} else if (j == n + 1) {
festival = new Node(x, y);
} else {
arr[j - 1] = new Node(x, y);
}
}
if (bfs(home, festival)) {
sb.append("happy").append("\n");
} else {
sb.append("sad").append("\n");
}
}
System.out.println(sb);
}
static boolean bfs(Node start, Node end) {
Queue<Node> q = new LinkedList<>();
q.add(start);
boolean[] visited = new boolean[n];
while (!q.isEmpty()) {
Node node = q.poll();
if (Math.abs(end.x - node.x) + Math.abs(end.y - node.y) <= 1000) {
return true;
}
for (int i = 0; i < arr.length; i++) {
if (visited[i]) continue;
if (Math.abs(arr[i].x - node.x) + Math.abs(arr[i].y - node.y) <= 1000) {
q.add(new Node(arr[i].x, arr[i].y));
visited[i] = true;
}
}
}
return false;
}
}
| yujin113/prepare-for-coding-test | GraphTraversal/Graph_9205.java |
248,979 | package view;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import java.util.Map;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JTextField;
import controller.keylistener.KeyListener;
import model.GameModel;
import model.actions.ActionResult;
import model.board.Location;
import model.palacefestival.Card;
import model.palacefestival.PalaceFestival;
import model.tiles.TileComponent;
import view.actionpanel.ActionPanel;
import view.gamepanel.GamePanel;
import view.palacefestival.CardsFrame;
import view.palacefestival.CurrentPlayerHandPanel;
import view.palacefestival.FestivalPanel;
/**
* Created by Baker on 4/14/2014.
*/
@SuppressWarnings("serial")
public class GameFrame extends JFrame {
private final static int WIDTH = 1040; // 1300;
private final static int HEIGHT = 820; // 850;
public static final Color[] playerColors = {Color.red, Color.blue, Color.green, Color.orange};
public static final Color defaultBackground = new Color(79, 140, 255);
JavaMenu menu;
GamePanel gamePanel;
controller.keylistener.KeyListener listener;
ActionPanel actionPanel;
FestivalPanel festivalPanel;
public GameFrame(KeyListener keyListener){
this.setTitle("Java Spups");
this.setSize(WIDTH, HEIGHT);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
menu = new JavaMenu(this);
gamePanel = new GamePanel();
actionPanel = new ActionPanel();
festivalPanel = new FestivalPanel();
this.add(gamePanel);
this.setJMenuBar(menu);
this.listener = keyListener;
addKeyListener(listener);
setFocusTraversalKeysEnabled(false);
requestFocusInWindow();
requestFocus();
}
public controller.keylistener.KeyListener getKeyListener() { return listener; }
public void refreshGame( GameModel game, PalaceFestival festival, ActionResult actionResult, Map<Location, TileComponent> potentialComponents, List<Location> highlightedComponents) {
//this gives all the information during the java game
gamePanel.refreshView(festivalPanel, game, festival, actionResult, potentialComponents, highlightedComponents);
// actionPanel.refreshView();
}
@SuppressWarnings("rawtypes")
public void refreshCardView(List<Card> cards){
//shows cards of the current player when it is the players turn in the Java Game
CardsFrame cardsFrame = new CardsFrame(new CurrentPlayerHandPanel());
cardsFrame.setVisible(true);
cardsFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
cardsFrame.refresh(cards);
}
@SuppressWarnings("rawtypes")
public void refreshView(PalaceFestival festival, List<Card> cardsOfCurrentPlayer, List<Integer> cardsSelected){
//picking cards
//sorry they aren't a list of pairs with card and a boolean for selection
//it was implemented this way in the model and I don't feel like working on it
}
@SuppressWarnings("rawtypes")
public void refreshFestivalView(GameModel model, PalaceFestival festival, List<Card> cardsOfCurrentPlayer, List<Integer> cardsSelected){
gamePanel.refreshFestivalView(festivalPanel);
festivalPanel.refreshView(model, festival, cardsOfCurrentPlayer, cardsSelected);
}
}
| bbokorney/spups | src/view/GameFrame.java |
248,980 | package app.fx;
import app.fx.Data.AIRPORT_INFORMATION;
import app.fx.Data.FESTIVALS;
import app.fx.Data.USERS;
import app.fx.HA.Queries;
import app.fx.elements.Festival_item;
import io.github.cdimascio.dotenv.Dotenv;
import java.time.LocalDate;
import java.util.List;
public class _env {
private static final Dotenv dotenv = Dotenv.load();
public static String getEnv(String key) {
return dotenv.get(key);
}
public static List<FESTIVALS> festival_informations;
public static List<USERS> users;
public static USERS selected_user;
private static Festival_item selected_festival;
private static String arrivalCountryCode;
public static AIRPORT_INFORMATION departure_information;
public static AIRPORT_INFORMATION arrival_information;
public static LocalDate departure_date;
public static LocalDate arrival_date;
/**
* 아이템 페이지 속성 초기화
*/
public static void ResetItemProperties()
{
festival_informations = null;
}
public static void main(String[] args) {
System.out.println("DATABASE_URL: " + getEnv("DATABASE_URL"));
System.out.println("DATABASE_ID : " + getEnv("DATABASE_ID"));
System.out.println("DATABASE_PW : " + getEnv("DATABASE_PW"));
System.out.println("API_KEY : " + getEnv("API_KEY"));
}
public static Festival_item getSelected_festival() {
return selected_festival;
}
public static void setSelected_festival(Festival_item selected_festival) {
_env.selected_festival = selected_festival;
arrivalCountryCode = Queries.instance.get_country_code(selected_festival.getFest_info().local_id);
System.out.println(arrivalCountryCode);
}
public static String getArrivalCountryCode() {
return arrivalCountryCode;
}
}
| Project-Travelers2/Travelers_FX | src/main/java/app/fx/_env.java |
248,983 | package gui;
import assets.Artist;
import assets.Festival;
import assets.Performance;
import assets.Stage;
import gui.AgendaForm;
import javax.swing.*;
import java.io.IOException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
/**
* Created by Stijn on 6-2-2017.
*/
public class Main {
public static AgendaForm mp;
public static Festival festival;
public static LocalDateTime currentTime = LocalDateTime.MIN;
public static void main(String[] args) throws IOException {
createTestFest();
//try {
mp = new AgendaForm();
// }catch (Exception e) {
// JOptionPane.showMessageDialog(null, "Velden niet juist ingevoerd");
// }
}
public JFrame getMainPanel(){
return mp;
}
public static void createTestFest(){
festival = new Festival(10000, 10, LocalDate.parse("2017-05-23", DateTimeFormatter.ISO_DATE), LocalTime.parse("06:00"), LocalTime.parse("23:00"), "testfest");
festival.addStage(new Stage("Stage1", "", festival.getStages().size()));
festival.addStage(new Stage("Stage2", "", festival.getStages().size()));
festival.addStage(new Stage("Stage3", "", festival.getStages().size()));
// festival.addPerformance(new Performance(new Artist("example1", "gen1", 2), festival.getStage(0), LocalTime.parse("05:31"), LocalTime.parse("07:15")));
// festival.addPerformance(new Performance(new Artist("example2", "gen1", 4), festival.getStage(1 ), LocalTime.parse("09:17"), LocalTime.parse("12:47")));
// festival.addPerformance(new Performance(new Artist("example3", "gen2", 10000), festival.getStage(2), LocalTime.parse("22:15"), LocalTime.parse("23:55")));
// festival.addPerformance(new Performance(new Artist("example4", "gen3", 1000), festival.getStage(0), LocalTime.parse("00:11"), LocalTime.parse("02:34")));
// festival.addPerformance(new Performance(new Artist("example5", "gen3", 1000), festival.getStage(2), LocalTime.parse("03:23"), LocalTime.parse("05:16")));
// festival.addPerformance(new Performance(new Artist("example6", "gen3", 1000), festival.getStage(1), LocalTime.parse("13:06"), LocalTime.parse("15:00")));
// festival.addPerformance(new Performance(new Artist("example7", "gen3", 1000), festival.getStage(0), LocalTime.parse("17:12"), LocalTime.parse("21:27")));
festival.addPerformance(new Performance(new Artist("example1", "gen1", 2), festival.getStage(0), LocalTime.parse("05:31"), LocalTime.parse("08:15")));
festival.addPerformance(new Performance(new Artist("example2", "gen1", 4), festival.getStage(1 ), LocalTime.parse("07:40"), LocalTime.parse("11:47")));
festival.addPerformance(new Performance(new Artist("example3", "gen2", 10000), festival.getStage(2), LocalTime.parse("18:02"), LocalTime.parse("23:00")));
festival.addPerformance(new Performance(new Artist("example4", "gen3", 1000), festival.getStage(0), LocalTime.parse("00:01"), LocalTime.parse("03:34")));
festival.addPerformance(new Performance(new Artist("example5", "gen3", 1000), festival.getStage(2), LocalTime.parse("04:50"), LocalTime.parse("06:16")));
festival.addPerformance(new Performance(new Artist("example6", "gen3", 1000), festival.getStage(1), LocalTime.parse("13:06"), LocalTime.parse("15:00")));
festival.addPerformance(new Performance(new Artist("example7", "gen3", 1000), festival.getStage(0), LocalTime.parse("14:45"), LocalTime.parse("18:27")));
festival.addPerformance(new Performance(new Artist("example6", "gen3", 1000), festival.getStage(1), LocalTime.parse("01:06"), LocalTime.parse("05:10")));
festival.addPerformance(new Performance(new Artist("example5", "gen3", 1000), festival.getStage(2), LocalTime.parse("10:23"), LocalTime.parse("13:16")));
festival.addPerformance(new Performance(new Artist("example7", "gen3", 1000), festival.getStage(0), LocalTime.parse("22:00"), LocalTime.parse("23:59")));
festival.addPerformance(new Performance(new Artist("example6", "gen3", 1000), festival.getStage(1), LocalTime.parse("22:30"), LocalTime.parse("23:59")));
}
}
| svgils/TIB1-FestivalPlanner | src/gui/Main.java |
248,984 | import java.util.Scanner;
/* This is the driver class for this project. You need to run this class with three command line arguments corresponding to the name, starting date and maxinum number of allowed events of a festival. For exmaple run the below command from the termincal:
java FestivalApp "CSE Fest 2023" "2023-07-15" 10*/
public class FestivalApp {
public static void main(String[] args) {
// Task: The program will be run with three command line arguements related to a
// festival- (i) the festival's name, (ii) its starting date and (iii) the
// maximum number of events allowed in the festival. Create a FestivalManager
// object named 'festivalManager' and initialize it with the values passed from
// the command line as: FestivalManager festivalManager = new
// FestivalManager(...); Generate error if the required parameters are not
// passed from the command line.
if (args.length < 3) {
System.out.println("Error");
System.exit(0);
}
FestivalManager festivalManager = new FestivalManager(args[0], args[1], Integer.parseInt(args[2]));
// Write your code here
// FestivalManager festivalManager = new FestivalManager("CSE Fest 2023" ,
// "2023-07-20", 10);
int choice;
Scanner scanner = new Scanner(System.in);
do {
// the following lines of code show a menu to take user's choice
System.out.println("Menu:");
System.out.println("1. Add an event");
System.out.println("2. Register student in an event");
System.out.println("3. View festival details");
System.out.println("4. View specific event");
System.out.println("5. View Event on Date");
System.out.println("6. View event with maximum participants");
System.out.println("7. View events for students");
System.out.println("8. Cancel registration");
System.out.println("9. Exit");
System.out.print("Enter option: ");
choice = scanner.nextInt();
scanner.nextLine(); // Consume the newline character
switch (choice) {
case 1: // Add an event
/*
* Task: using the scanner object, read the following information for an event:
* (i) name as a string, (ii) starting date as a string in 'YYYY-MM-DD' format,
* (iii) location as astring, and (iv) max number of participants allowed in the
* event as an integer. Invoke the function 'add event' of 'Festival Manager' to
* add the event, i.e., call festivalManager.addEvent(...)
*/
/*
* Enter option: 1
* Enter event name: Hackathon
* Enter event date (YYYY-MM-DD): 2023-07-23 Enter event location: ECE Building
* Enter maximum participants: 30
* Event added successfully!
*/
// Write your code here
System.out.println("Enter event name: ");
String name = scanner.nextLine();
System.out.println("Enter event date (YYYY-MM-DD):");
String date = scanner.nextLine();
System.out.println("Enter event location:");
String location = scanner.nextLine();
System.out.println("Enter maximum participants:");
int participantsNum = scanner.nextInt();
Event event = new Event(name, date, location, participantsNum);
festivalManager.addEvent(event);
System.out.println("Event added successfully!");
break;
case 2:// Register a student in an event
/*
* Task: read the name and id of a student and an event name. Then register the
* student in the event by calling the function:
* festivalManager.registerStudent(...)
*
* Enter option: 2
* Enter student name: Mr. B
* Enter student ID: 2021050061
* Enter event name:
* Hackathon
* Student registration completed.
*
*/
// Write your code here
System.out.println("Enter student name: ");
String StuName = scanner.nextLine();
System.out.println("Enter student ID: ");
String StuID = scanner.nextLine();
System.out.println("Enter event name:");
String eventName = scanner.nextLine();
Student st = new Student(StuName, StuID);
festivalManager.registerStudent(eventName, st);
System.out.println("Student registration completed.");
break;
case 3: // View festival details
festivalManager.showDetails();
break;
case 4: // View event details
/*
* Task: read the name of an event and then show the details for the event by
* calling the function: festivalManager.showEvent(...);
*
* Enter option: 4
* Enter event name: Game Jam
* Name: Game Jam
* Date: 2023-07-22
* Location: ECE Building
* Registered Participants:
* Name: Mr. H, Id: 2021050100 Name: Mr. A, Id: 202105001
*/
// Write your code here
System.out.println("Enter event name:");
String eventname = scanner.nextLine();
festivalManager.showEvent(eventname);
break;
case 5:/*
* Enter event date: 2023-07-23
* Events on 2023-07-23 are: Hackathon
*/
System.out.println("Enter event date:");
String eventDate = scanner.nextLine();
System.out.println("Events on "+eventDate+" are:");
festivalManager.showEventsOnDate(eventDate);
break;
case 6: // View event with maximum participants
System.out.println("Event with highest participants:");
festivalManager.eventWithHighestParticipants();
break;
case 7: // View events for students
/*
* Task: read the id of a student and then show the events the student is
* participating in by calling the function:
* festivalManager.showEventsForStudent(...);
*/
// Write your code here
System.out.println("Enter student id:");
String stNum = scanner.nextLine();
System.out.println("Student " + stNum + " is registered in :");
festivalManager.showEventsForStudent(stNum);
break;
case 8: // Cancel registration
/*
* Task: read the id of a student and an event name. Then remove the student
* from the participant list of the event by calling the function:
* festivalManager.cancelRegistration(...);
*/
// Write your code here
System.out.println("Enter student id:");
String stuNum = scanner.nextLine();
System.out.println("Enter event name:");
String eve = scanner.nextLine();
festivalManager.cancelRegistration(eve, stuNum);
System.out.println("Successfully removed id " + stuNum + " from event " + eve);
break;
case 9:
System.out.println("Exiting the program.");
break;
default:
System.out.println("Invalid option. Please try again.");
}
System.out.println();
} while (choice != 9);
scanner.close();
}
}
| ahtasham67/CSE_108_OOP-offlines | offline4/FestivalApp.java |
248,985 | // https://cses.fi/problemset/task/1629/
import java.io.*;
import java.util.*;
public class MovieFestival {
static class FastIO extends PrintWriter {
private InputStream stream;
private byte[] buf = new byte[1 << 16];
private int curChar, numChars;
// standard input
public FastIO() { this(System.in, System.out); }
public FastIO(InputStream i, OutputStream o) {
super(o);
stream = i;
}
// file input
public FastIO(String i, String o) throws IOException {
super(new FileWriter(o));
stream = new FileInputStream(i);
}
// throws InputMismatchException() if previously detected end of file
private int nextByte() {
if (numChars == -1) throw new InputMismatchException();
if (curChar >= numChars) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) { throw new InputMismatchException(); }
if (numChars == -1) return -1; // end of file
}
return buf[curChar++];
}
// to read in entire lines, replace c <= ' '
// with a function that checks whether c is a line break
public String next() {
int c;
do { c = nextByte(); } while (c <= ' ');
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = nextByte();
} while (c > ' ');
return res.toString();
}
public int nextInt() { // nextLong() would be implemented similarly
int c;
do { c = nextByte(); } while (c <= ' ');
int sgn = 1;
if (c == '-') {
sgn = -1;
c = nextByte();
}
int res = 0;
do {
if (c < '0' || c > '9') throw new InputMismatchException();
res = 10 * res + c - '0';
c = nextByte();
} while (c > ' ');
return res * sgn;
}
public double nextDouble() { return Double.parseDouble(next()); }
}
static class Interval implements Comparable<Interval> {
int start, end;
public Interval(int s, int e) {
start = s;
end = e;
}
@Override
public int compareTo(Interval o) {
if (end != o.end) {
return Integer.compare(end, o.end);
}
return Integer.compare(end - start, o.end - o.start);
}
}
static Interval[] l;
static int N;
public static void main(String[] args) {
FastIO sc = new FastIO();
N = sc.nextInt();
l = new Interval[N];
for (int i = 0; i < N; i++) {
int s = sc.nextInt();
int e = sc.nextInt();
l[i] = (new Interval(s, e));
}
Arrays.sort(l);
// for (Interval i : l) {
// System.out.println(i.start + " " + i.end);
// }
int ans = 0;
long endingOfLastMovie = -1;
for (int i = 0; i < N; i++) {
if (endingOfLastMovie <= l[i].end &&l[i].start >= endingOfLastMovie) {
endingOfLastMovie = l[i].end;
ans++;
}
}
System.out.println(ans);
}
}
| anaconda121/DSA | Problems/CSES/MovieFestival.java |
248,986 | package data;
import java.io.Serializable;
import java.util.ArrayList;
public class FestivalPlan implements Serializable {
private ArrayList<Performance> performances;
private ArrayList<Artist> artists;
private ArrayList<Stage> stages;
public FestivalPlan() {
this.performances = new ArrayList<>();
this.artists = new ArrayList<>();
this.stages = new ArrayList<>();
// addTestData();
}
private void addTestData() {
// Artiesten
String standardArtistInfo = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad\nminim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit\nin voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia\ndeserunt mollit anim id est laborum.";
Artist artist1 = new Artist("Ed Sheeran", 95, "Pop");
artist1.setArtistInfo(standardArtistInfo);
Artist artist2 = new Artist("Gorillaz", 30, "Indie");
artist2.setArtistInfo(standardArtistInfo);
Artist artist3 = new Artist("Suzan en Freek", 70, "Rock");
artist3.setArtistInfo(standardArtistInfo);
Artist artist4 = new Artist("Kraantje Pappie", 10, "Rap");
artist4.setArtistInfo(standardArtistInfo);
Artist artist5 = new Artist("Bizzey", 0, "Country");
artist5.setArtistInfo(standardArtistInfo);
Artist artist6 = new Artist("The Weekend", 65, "Rock");
artist6.setArtistInfo(standardArtistInfo);
Artist artist7 = new Artist("Snelle", 50, "Pop");
artist7.setArtistInfo(standardArtistInfo);
Artist artist8 = new Artist("Armin van Buuren", 100, "Metal");
artist8.setArtistInfo(standardArtistInfo);
artists.add(artist1);
artists.add(artist2);
artists.add(artist3);
artists.add(artist4);
artists.add(artist5);
artists.add(artist6);
artists.add(artist8);
artists.add(artist7);
// Podiums
Stage stage = new Stage("Hoofdpodium", 1);
Stage stage2 = new Stage("Testpodium1", 2);
Stage stage3 = new Stage("Testpodium2", 3);
Stage stage4 = new Stage("Testpodium3", 4);
Stage stage5 = new Stage("Testpodium4", 5);
stages.add(stage);
stages.add(stage2);
stages.add(stage3);
stages.add(stage4);
stages.add(stage5);
// Performances
Performance performance = new Performance(artist1, stage, 12, 0, 13,0);
Performance performance1 = new Performance(artist2, stage2, 12, 30, 15, 0);
Performance performance2 = new Performance(artist3, stage, 13, 30, 16, 30);
Performance performance3 = new Performance(artist4, stage3, 14, 30, 16, 0);
Performance performance4 = new Performance(artist5, stage4, 14, 0, 17, 0);
Performance performance5 = new Performance(artist6, stage5, 12, 0, 14, 30);
Performance performance6 = new Performance(artist7, stage2, 16, 0, 19, 0);
Performance performance7 = new Performance(artist8, stage, 20, 0, 24, 0);
Performance performance8 = new Performance(artist1, stage3, 20, 0, 23, 0);
Performance performance9 = new Performance(artist2, stage4, 22, 0, 2, 0);
performances.add(performance);
performances.add(performance1);
performances.add(performance2);
performances.add(performance3);
performances.add(performance4);
performances.add(performance5);
performances.add(performance6);
performances.add(performance7);
performances.add(performance8);
performances.add(performance9);
}
public ArrayList<Performance> getPerformances() {
return performances;
}
public ArrayList<Artist> getArtists() {
return artists;
}
public ArrayList<Stage> getStages() {
return stages;
}
public void setStages(ArrayList<Stage> stages) {
this.stages = stages;
}
public void addPerformance(Performance performance){
this.performances.add(performance);
}
public void addArtist(Artist artist){
this.artists.add(artist);
}
public void addStage(Stage stage){
this.stages.add(stage);
}
public void deleteStage(Stage stage) {
stages.remove(stage);
}
public void deleteArtist(Artist artist) {
artists.remove(artist);
}
public void deletePerformance(Performance performance) {
performances.remove(performance);
}
}
| 589Hours/FestivalPlanner | src/data/FestivalPlan.java |
248,987 | import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class Laboratory extends JFrame {
static Laboratory frame;
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
frame= new Laboratory();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Laboratory() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
JLabel lblLaboratoryManagement = new JLabel("Chemistry Lab Inventory - Knight Coders");
lblLaboratoryManagement.setFont(new Font("Tahoma", Font.PLAIN, 18));
lblLaboratoryManagement.setForeground(Color.GRAY);
JButton btnAdminLogin = new JButton("Admin Login");
btnAdminLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
AdminLogin.main(new String[]{});
frame.dispose();
}
});
btnAdminLogin.setFont(new Font("Tahoma", Font.PLAIN, 15));
JButton btnAssistanceLogin = new JButton("Assistance Login");
btnAssistanceLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
AssistanceLogin.main(new String[]{});
}
});
btnAssistanceLogin.setFont(new Font("Tahoma", Font.PLAIN, 15));
JButton btnStudentLogin = new JButton("Student Login");
btnStudentLogin.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
View.main(new String[]{});
}
});
btnStudentLogin.setFont(new Font("Dialog", Font.PLAIN, 15));
GroupLayout gl_contentPane = new GroupLayout(contentPane);
gl_contentPane.setHorizontalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(64)
.addComponent(lblLaboratoryManagement))
.addGroup(gl_contentPane.createSequentialGroup()
.addGap(140)
.addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING, false)
.addComponent(btnAssistanceLogin, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnAdminLogin, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE)
.addComponent(btnStudentLogin, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 155, GroupLayout.PREFERRED_SIZE))))
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
gl_contentPane.setVerticalGroup(
gl_contentPane.createParallelGroup(Alignment.LEADING)
.addGroup(gl_contentPane.createSequentialGroup()
.addContainerGap()
.addComponent(lblLaboratoryManagement)
.addGap(32)
.addComponent(btnAdminLogin, GroupLayout.PREFERRED_SIZE, 52, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.UNRELATED)
.addComponent(btnAssistanceLogin, GroupLayout.PREFERRED_SIZE, 53, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
.addComponent(btnStudentLogin, GroupLayout.PREFERRED_SIZE, 53, GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
contentPane.setLayout(gl_contentPane);
}
}
| preamaranjan-dilujan/Chemistry-laboratory-inventory-management-system | src/Laboratory.java |
248,988 | /**
* The type Laboratory.
*/
public class Laboratory {
private String name;
private String surveillance;
/**
* Instantiates a new Laboratory.
*
* @param name the name
* @param surveillance the surveillance
*/
public Laboratory(String name, String surveillance) {
this.name = name;
this.surveillance = surveillance;
}
/**
* Gets name.
*
* @return the name
*/
public String getName() {
return name;
}
/**
* Gets surveillance.
*
* @return the surveillance
*/
public String getSurveillance() {
return surveillance;
}
@Override
public String toString() {
return "Laboratory{" +
"name='" + name + '\'' +
", surveillance='" + surveillance + '\'' +
'}';
}
}
| joaovalterarruda/projeto_pco | Laboratory.java |
248,989 | import java.util.ArrayList;
public class Laboratory {
private String name;
private ArrayList<Student> students;
private ArrayList<Professor> professors;
public Laboratory() {
}
public Laboratory(String name) {
this.name = name;
this.students = new ArrayList<Student>();
this.professors = new ArrayList<Professor>();
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public void addMember(Student s) {
this.students.add(s);
}
public void addMember(Professor p) {
this.professors.add(p);
}
public ArrayList<String> getContactInfos() {
// COMPLETE-ME
// Construa um ArrayList<String> contendo informações de contato (ContactInfo)
// de cada um dos estudantes e professores
ArrayList<String> contactInfos = new ArrayList<String>();
for( int i = 0 ; i < students.size() ; i++){
contactInfos.add(students.get(i).getContactInfo());
}
for( int i = 0 ; i < professors.size() ; i++){
contactInfos.add(professors.get(i).getContactInfo());
}
return contactInfos;
}
public boolean userExists(String userId) {
// COMPLETE-ME
// Verifique se existe o userId na lista de estudantes ou de professores
for(int i = 0; i < professors.size(); i++){
if( professors.get(i).getUserId() == userId ) //verificar utilização do cointans
return true;
}
for(int i = 0; i < students.size(); i++){
if( students.get(i).getUserId() == userId )
return true;
}
return false;
}
public int countMembers() {
// COMPLETE-ME
// Retorne o total de membros do laboratório (estudantes e professores)
return ( students.size() + professors.size() );
}
} | elc117/java04-2022b-Piekala | Laboratory.java |
248,991 | import java.util.ArrayList;
public class Laboratory {
private String name;
private ArrayList<Student> students;
private ArrayList<Professor> professors;
public Laboratory() {
}
public Laboratory(String name) {
this.name = name;
this.students = new ArrayList<Student>();
this.professors = new ArrayList<Professor>();
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public void addMember(Student s) {
this.students.add(s);
}
public void addMember(Professor p) {
this.professors.add(p);
}
public ArrayList<String> getContactInfos() {
ArrayList<String> ContactInfo = new ArrayList<String>();
for (int i = 0; i < students.size(); i++) {
ContactInfo.add(students.get(i).getContactInfo());
}
for (int i = 0; i < professors.size(); i++) {
ContactInfo.add(professors.get(i).getContactInfo());
}
return ContactInfo;
}
public boolean userExists(String userId) {
for (int i = 0; i < professors.size(); i++) {
if (professors.get(i).getUserId() == userId)
return true;
}
for (int i = 0; i < students.size(); i++) {
if (students.get(i).getUserId() == userId)
return true;
}
return false;
}
public int countMembers() {
int grupo1 = students.size();
int grupo2 = professors.size();
int tGrupos = grupo1 + grupo2;
return tGrupos;
}
} | elc117/java04-2022b-JCAlves27 | Laboratory.java |
248,992 |
import jade.core.Agent;
import jade.core.behaviours.CyclicBehaviour;
import jade.domain.DFService;
import jade.domain.FIPAAgentManagement.DFAgentDescription;
import jade.domain.FIPAAgentManagement.ServiceDescription;
import jade.domain.FIPAException;
import jade.lang.acl.ACLMessage;
import jade.core.AID;
import jade.lang.acl.MessageTemplate;
import java.time.format.DateTimeFormatter;
import java.time.LocalDateTime;
import java.time.*;
import java.util.*;
public class LaboratoryAgent extends Agent {
Hashtable<LabTest, String> tests;
protected void setup() {
// Register pharmacy service so portal agent can search and find
DFAgentDescription dfd = new DFAgentDescription();
dfd.setName(getAID());
ServiceDescription sd = new ServiceDescription();
sd.setName(getLocalName());
sd.setType("laboratory");
dfd.addServices(sd);
try {
DFService.register(this, dfd);
} catch (FIPAException fe) {
fe.printStackTrace();
}
// fill the testlist list with some hard-coded data
tests = TestUtils.generateTests();
addBehaviour(new LaboratoryAgent.requestTest());
}
public ArrayList getUserTests(String userEmail) {
ArrayList<LabTest> foundtests = new ArrayList<LabTest>();
//to get the tests of the logined user
for(Map.Entry entry: tests.entrySet()){
if(userEmail.equals(entry.getValue())){
foundtests.add((LabTest) entry.getKey());
}
}
System.out.println("keys : " );
return foundtests;
}
private class requestTest extends CyclicBehaviour {
@Override
public void action() {
MessageTemplate mt = MessageTemplate.MatchPerformative(Messages.TEST_LIST_REQUEST);
ACLMessage msg = myAgent.receive(mt);
if (msg != null) {
String info = msg.getContent();
String[] newInfo = info.split(Messages.DELIMITER);
String content = "";
System.out.println("LABORATORY AGENT: tests list request received");
ACLMessage replyTestList = msg.createReply();
replyTestList.setPerformative(Messages.TEST_LIST_RESPONSE);
ArrayList<LabTest> foundtests = new ArrayList<LabTest>();
System.out.println("INFOOOOO" + newInfo[0]);
//find the tests of the logined user
foundtests = getUserTests(newInfo[0]);
System.out.println(foundtests);
//send the data of those tests
for (LabTest key : foundtests)
{
content = content.concat(key.gettestId().toString());
content = content.concat(Messages.DELIMITER);
content = content.concat(key.getDescription());
content = content.concat(Messages.DELIMITER);
}
System.out.println("LABORATORY: Sending test list back to portal");
replyTestList.setContent(content);
send(replyTestList);
} else {
block();
}
}
}
}
| Melikano/seng-696-final-assignment | LaboratoryAgent.java |
248,993 | import java.util.*;
import java.io.*;
public class Main {
static int max = -1;
static int n;
static int m;
static int[][] laboratory;
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringTokenizer st = new StringTokenizer(bf.readLine());
n = Integer.parseInt(st.nextToken());
m = Integer.parseInt(st.nextToken());
laboratory = new int[n][m];
for(int i = 0; i < n; i++) {
st = new StringTokenizer(bf.readLine());
for(int j = 0; j < m; j++) {
laboratory[i][j] = Integer.parseInt(st.nextToken());
}
}
buildTheWalls(0);
bw.write(String.valueOf(max));
bw.close();
}
public static class Pos {
int x;
int y;
public Pos(int x, int y){
this.x = x;
this.y = y;
}
}
public static void buildTheWalls(int count) {
if(count >= 3) {
int[][] copyLab = new int[n][m];
List<Pos> virus = new ArrayList<>();
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
copyLab[i][j] = laboratory[i][j];
if(copyLab[i][j] == 2) virus.add(new Pos(i, j));
}
}
for(Pos pos : virus) {
spreadVirus(copyLab, pos.x, pos.y);
}
max = Math.max(countSafeZone(copyLab), max);
return;
}
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
if(laboratory[i][j] == 0) {
laboratory[i][j] = 1;
buildTheWalls(count + 1);
laboratory[i][j] = 0;
}
}
}
}
public static void spreadVirus(int[][] copyLab, int x, int y) {
copyLab[x][y] = 2;
if(x - 1 >= 0 && copyLab[x - 1][y] == 0) spreadVirus(copyLab, x - 1, y);
if(x + 1 < n && copyLab[x + 1][y] == 0) spreadVirus(copyLab, x + 1, y);
if(y - 1 >= 0 && copyLab[x][y - 1] == 0) spreadVirus(copyLab, x, y - 1);
if(y + 1 < m && copyLab[x][y + 1] == 0) spreadVirus(copyLab, x, y + 1);
}
public static int countSafeZone(int[][] copyLab) {
int count = 0;
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
if(copyLab[i][j] == 0) count ++;
}
}
return count;
}
}
| suzzingV/Algorithm | b14502/Main.java |
248,994 | package Hospital;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
public class StubDB {
// Map to hold patient ID and their medications
private Map<Integer, List<String>> patientMedications;
private List<FamilyDoctor> familyDoctors;
private Laboratory laboratory;
public StubDB() {
this.patientMedications = new HashMap<>();
initializeStubData();
this.familyDoctors = new ArrayList<>();
this.laboratory = new Laboratory();
initializeFamilyDoctors();
}
private void initializeFamilyDoctors() {
familyDoctors.add(new FamilyDoctor("Anna", "Lee", laboratory, "Anna80.gmail.com", "555-1234"));
familyDoctors.add(new FamilyDoctor("Mark", "Lopez",laboratory, "marklo@gmail.com", "555-5678"));
}
public List<FamilyDoctor> getAllFamilyDoctors() {
return new ArrayList<>(familyDoctors);
}
// Method to initialize the database with some stub data
private void initializeStubData() {
// Example patient IDs
Patient patient = new Patient("John", "Doe", 23, "Male", "12 Bobby Ave.");
int patientId2 = 1002; // Another example patient ID
addMedicationsForPatient(patient.getPatientID(), List.of("Medicine A", "Medicine B"));
addMedicationsForPatient(patientId2, List.of("Medicine C", "Medicine D", "Medicine E"));
// Continue for additional patients as needed
}
// Method to add medications for a specific patient
public void addMedicationsForPatient(int patientId, List<String> medications) {
patientMedications.put(patientId, medications);
}
// Method to retrieve medications for a specific patient
public List<String> getMedicationsForPatient(Patient patient) {
return patientMedications.getOrDefault(patient.getPatientID(), new ArrayList<>());
}
// Method to simulate the getMeds method that might exist in Nurse class
public String getMeds(Patient patient) {
List<String> meds = getMedicationsForPatient(patient);
return String.join(", ", meds);
}
} | MehreganM/EECS-2311- | Hospital/StubDB.java |
248,996 | import java.util.ArrayList;
public class Laboratory {
private String name;
private ArrayList<Student> students;
private ArrayList<Professor> professors;
public Laboratory() {
}
public Laboratory(String name) {
this.name = name;
this.students = new ArrayList<Student>();
this.professors = new ArrayList<Professor>();
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public void addMember(Student s) {
this.students.add(s);
}
public void addMember(Professor p) {
this.professors.add(p);
}
public ArrayList<String> getContactInfos() {
ArrayList<String> ContactInfo = new ArrayList<String>();
for (int i = 0; i < students.size(); i++)
{
ContactInfo.add(students.get(i).getContactInfo());
}
for (int i = 0; i < professors.size(); i++)
{
ContactInfo.add(professors.get(i).getContactInfo());
}
return ContactInfo;
// COMPLETE-ME
// Construa um ArrayList<String> contendo informações de contato (ContactInfo)
// de cada um dos estudantes e professores
}
public boolean userExists(String userId)
{
// COMPLETE-ME
// Verifique se existe o userId na lista de estudantes ou de professores
for (int i = 0; i < professors.size(); i++)
{
if(professors.get(i).getUserId() == userId)
return true;
}
for (int i = 0; i < students.size(); i++)
{
if(students.get(i).getUserId() == userId)
return true;
}
return false;
}
public int countMembers()
{
int membros1 = students.size();
int membros2 = professors.size();
int totalDeMembros = membros1 + membros2;
return totalDeMembros;
// COMPLETE-ME
// Retorne o total de membros do laboratório (estudantes e professores)
}
} | elc117/java04-2022b-AnaMilitz | Laboratory.java |
248,997 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class RadDam extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java Radiation Damage class
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
private static MakeControl home;
private static RadDam job;
private static JTextField tdstart,tdintval,tdefcut,tatom,timpstp,tenergy,tvect1;
private static JTextField tvect2,tvect3,tvarstp,tmindis,tmaxdis,tnstmsdtmp;
private static JTextField timsdtmp,tthick,tptemp;
private static JComboBox<String> pseudtyp;
private static JButton close;
private static JCheckBox bldefects,blvarstp,blmsdtmp,blpseudo;
// Define the Graphical User Interface
public RadDam() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
super();
setTitle("Radiation Damage");
int n=0;
getContentPane().setForeground(art.fore);
getContentPane().setBackground(art.back);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Panel label
fix(new JLabel("Select options:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// Impact description
fix(new JLabel("Impact description:",JLabel.LEFT),grd,gbc,0,n++,3,1);
tatom = new JTextField(8);
tatom.setForeground(art.scrf);
tatom.setBackground(art.scrn);
fix(tatom,grd,gbc,0,n,1,1);
fix(new JLabel("Atom index",JLabel.LEFT),grd,gbc,1,n++,2,1);
timpstp = new JTextField(8);
timpstp.setForeground(art.scrf);
timpstp.setBackground(art.scrn);
fix(timpstp,grd,gbc,0,n,1,1);
fix(new JLabel("Impact time step no.",JLabel.LEFT),grd,gbc,1,n++,2,1);
tenergy = new JTextField(8);
tenergy.setForeground(art.scrf);
tenergy.setBackground(art.scrn);
fix(tenergy,grd,gbc,0,n,1,1);
fix(new JLabel("Impact energy (keV)",JLabel.LEFT),grd,gbc,1,n++,2,1);
fix(new JLabel("Impact vector:",JLabel.LEFT),grd,gbc,0,n++,3,1);
tvect1 = new JTextField(6);
tvect1.setForeground(art.scrf);
tvect1.setBackground(art.scrn);
fix(tvect1,grd,gbc,0,n,1,1);
tvect2 = new JTextField(6);
tvect2.setForeground(art.scrf);
tvect2.setBackground(art.scrn);
fix(tvect2,grd,gbc,1,n,1,1);
tvect3 = new JTextField(6);
tvect3.setForeground(art.scrf);
tvect3.setBackground(art.scrn);
fix(tvect3,grd,gbc,2,n++,1,1);
fix(new JLabel(" "),grd,gbc,0,n++,1,1);
// Variable time step option
blvarstp = new JCheckBox("Use Variable time step");
blvarstp.setForeground(art.fore);
blvarstp.setBackground(art.back);
fix(blvarstp,grd,gbc,0,n++,2,1);
tvarstp = new JTextField(8);
tvarstp.setBackground(art.scrn);
tvarstp.setForeground(art.scrf);
fix(tvarstp,grd,gbc,0,n,1,1);
fix(new JLabel("Start time step value (ps)",JLabel.LEFT),grd,gbc,1,n++,2,1);
tmindis = new JTextField(8);
tmindis.setForeground(art.scrf);
tmindis.setBackground(art.scrn);
fix(tmindis,grd,gbc,0,n,1,1);
fix(new JLabel("Min. allowed distance (A)",JLabel.LEFT),grd,gbc,1,n++,2,1);
tmaxdis = new JTextField(8);
tmaxdis.setForeground(art.scrf);
tmaxdis.setBackground(art.scrn);
fix(tmaxdis,grd,gbc,0,n,1,1);
fix(new JLabel("Max. allowed distance (A)",JLabel.LEFT),grd,gbc,1,n++,2,1);
fix(new JLabel(" "),grd,gbc,0,n++,1,1);
// Defects
bldefects=new JCheckBox("Produce DEFECTS file");
bldefects.setForeground(art.fore);
bldefects.setBackground(art.back);
fix(bldefects,grd,gbc,0,n++,2,1);
tdstart = new JTextField(8);
tdstart.setForeground(art.scrf);
tdstart.setBackground(art.scrn);
fix(tdstart,grd,gbc,0,n,1,1);
fix(new JLabel("Start time step number",JLabel.LEFT),grd,gbc,1,n++,2,1);
tdintval = new JTextField(8);
tdintval.setForeground(art.scrf);
tdintval.setBackground(art.scrn);
fix(tdintval,grd,gbc,0,n,1,1);
fix(new JLabel("Time step interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
tdefcut = new JTextField(8);
tdefcut.setForeground(art.scrf);
tdefcut.setBackground(art.scrn);
fix(tdefcut,grd,gbc,0,n,1,1);
fix(new JLabel("Cut off (A):",JLabel.LEFT),grd,gbc,1,n++,2,1);
fix(new JLabel(" "),grd,gbc,0,n++,1,1);
// MSDTMP file option
blmsdtmp = new JCheckBox("Produce MSDTMP file");
blmsdtmp.setForeground(art.fore);
blmsdtmp.setBackground(art.back);
fix(blmsdtmp,grd,gbc,0,n++,2,1);
tnstmsdtmp = new JTextField(8);
tnstmsdtmp.setBackground(art.scrn);
tnstmsdtmp.setForeground(art.scrf);
fix(tnstmsdtmp,grd,gbc,0,n,1,1);
fix(new JLabel("Start time step number",JLabel.LEFT),grd,gbc,1,n++,2,1);
timsdtmp = new JTextField(8);
timsdtmp.setBackground(art.scrn);
timsdtmp.setForeground(art.scrf);
fix(timsdtmp,grd,gbc,0,n,1,1);
fix(new JLabel("Time step interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
fix(new JLabel(" "),grd,gbc,0,n++,1,1);
// Pseudo thermal bath option
blpseudo = new JCheckBox("Pseudo thermal bath");
blpseudo.setForeground(art.fore);
blpseudo.setBackground(art.back);
fix(blpseudo,grd,gbc,0,n++,2,1);
pseudtyp = new JComboBox<String>();
pseudtyp.setBackground(art.scrn);
pseudtyp.setForeground(art.scrf);
pseudtyp.addItem(" ");
pseudtyp.addItem("Langevin");
pseudtyp.addItem("Direct");
fix(pseudtyp,grd,gbc,0,n,1,1);
fix(new JLabel("Thermal bath type",JLabel.LEFT),grd,gbc,1,n++,2,1);
tthick = new JTextField(8);
tthick.setBackground(art.scrn);
tthick.setForeground(art.scrf);
fix(tthick,grd,gbc,0,n,1,1);
fix(new JLabel("Layer thickness (A)",JLabel.LEFT),grd,gbc,1,n++,2,1);
tptemp = new JTextField(8);
tptemp.setBackground(art.scrn);
tptemp.setForeground(art.scrf);
fix(tptemp,grd,gbc,0,n,1,1);
fix(new JLabel("Thermostat temp. (K)",JLabel.LEFT),grd,gbc,1,n++,2,1);
fix(new JLabel(" "),grd,gbc,0,n++,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,0,n++,1,1);
// Register action buttons
close.addActionListener(this);
}
public RadDam(MakeControl here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
home=here;
job=new RadDam();
job.pack();
job.setVisible(true);
setParams();
}
void setParams() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
// set panel
bldefects.setSelected(ldefects);
tdstart.setText(String.valueOf(dstart));
tdintval.setText(String.valueOf(dintval));
tdefcut.setText(String.valueOf(defcut));
tatom.setText(String.valueOf(atom));
timpstp.setText(String.valueOf(impstp));
tenergy.setText(String.valueOf(energy));
tvect1.setText(String.valueOf(vect1));
tvect2.setText(String.valueOf(vect2));
tvect3.setText(String.valueOf(vect3));
blvarstp.setSelected(lvarstp);
tvarstp.setText(String.valueOf(varstp));
tmindis.setText(String.valueOf(mindis));
tmaxdis.setText(String.valueOf(maxdis));
blmsdtmp.setSelected(lmsdtmp);
tnstmsdtmp.setText(String.valueOf(nstmsdtmp));
timsdtmp.setText(String.valueOf(imsdtmp));
blpseudo.setSelected(lpseudo);
pseudtyp.setSelectedIndex(ipseudtyp);
tthick.setText(String.valueOf(thick));
tptemp.setText(String.valueOf(ptemp));
}
void getParams(){
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
lrdm=true;
ldefects=bldefects.isSelected();
dstart=BML.giveInteger(tdstart.getText(),1);
dintval=BML.giveInteger(tdintval.getText(),1);
defcut=BML.giveDouble(tdefcut.getText(),1);
atom=BML.giveInteger(tatom.getText(),1);
impstp=BML.giveInteger(timpstp.getText(),1);
energy=BML.giveDouble(tenergy.getText(),1);
vect1=BML.giveDouble(tvect1.getText(),1);
vect2=BML.giveDouble(tvect2.getText(),1);
vect3=BML.giveDouble(tvect3.getText(),1);
lvarstp=blvarstp.isSelected();
varstp=BML.giveDouble(tvarstp.getText(),1);
mindis=BML.giveDouble(tmindis.getText(),1);
maxdis=BML.giveDouble(tmaxdis.getText(),1);
lmsdtmp=blmsdtmp.isSelected();
nstmsdtmp=BML.giveInteger(tnstmsdtmp.getText(),1);
imsdtmp=BML.giveInteger(timsdtmp.getText(),1);
lpseudo=blpseudo.isSelected();
ipseudtyp=pseudtyp.getSelectedIndex();
thick=BML.giveDouble(tthick.getText(),1);
ptemp=BML.giveDouble(tptemp.getText(),1);
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Close")) {
byebye();
}
}
void byebye() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
getParams();
home.rdm=null;
job.setVisible(false);
}
}
| ccp5UK/dl-poly | java/RadDam.java |
249,000 | package Soal1;
// Import library for random method
import java.lang.Math;
public class Person {
// Attribute Encapsulation
private String name;
private int age;
private String university;
// Constructor Overloading
// Constructor for class Person without any parameters
public Person() {
this.name = "Anonymous";
this.age = (int) (Math.random() * 100 + 1);
this.university = "Unknown University";
}
// Constructor for class Person with parameters
public Person(String name, int age, String university) {
this.name = name;
this.age = age;
this.university = university;
}
// Setter Method for name attribute
public void setName(String name) {
this.name = name;
}
// Setter Method for age attribute
public void setAge(int age) {
this.age = age;
}
// Setter Method for university attribute
public void setUniversity(String university) {
this.university = university;
}
// Getter Method for name attribute
public String getName() {
return this.name;
}
// Getter Method for age attribute
public int getAge() {
return this.age;
}
// Getter Method for university attribute
public String getUniversity() {
return this.university;
}
// Display Method
public void display() {
System.out.println("Hey there, I'm " + this.getName());
System.out.println("I'm " + this.getAge() + " years old.");
System.out.println("I'm an undergraduate student in " + this.getUniversity());
}
}
// Inheritance
class LaboratoryAssistant extends Person {
// Attribute Encapsulation
private String workPlace;
private int teachingExperience;
private int numberOfClasses;
// Constructor
public LaboratoryAssistant(String name, int age, String university, String workPlace, int teachingExperience, int numberOfClasses) {
super(name, age, university);
this.workPlace = workPlace;
this.teachingExperience = teachingExperience;
this.numberOfClasses = numberOfClasses;
}
// Setter Method for workPlace
public void setWorkPlace(String workPlace) {
this.workPlace = workPlace;
}
// Setter Method for teachingExperience
public void setTeachingExperience(int teachingExperience) {
this.teachingExperience = teachingExperience;
}
// Setter Method for numberOfClasses
public void setNumberOfClasses(int numberOfClasses) {
this.numberOfClasses = numberOfClasses;
}
// Getter Method for workPlace
public String getWorkPlace() {
return this.workPlace;
}
// Getter Method for teachingExperience
public int getTeachingExperience() {
return this.teachingExperience;
}
// Getter Method for numberOfClasses
public int getNumberOfClasses() {
return this.numberOfClasses;
}
// Method Overriding for display method
@Override
public void display() {
System.out.println("Greetings, I am " + this.getName() + ", currently serving as a laboratory assistant at the " + this.getWorkPlace() + ".");
System.out.print("Over the course of " + this.getTeachingExperience() + " semesters, ");
System.out.println("I have undertaken the role of an educator, imparting knowledge to a total of " + this.getNumberOfClasses() + " classes within the institution.");
}
} | FrederickGodiva/UTS_Lab5_OOP | src/Soal1/Person.java |
249,001 | /*
* Java Bittorrent API as its name indicates is a JAVA API that implements the Bittorrent Protocol
* This project contains two packages:
* 1. jBittorrentAPI is the "client" part, i.e. it implements all classes needed to publish
* files, share them and download them.
* This package also contains example classes on how a developer could create new applications.
* 2. trackerBT is the "tracker" part, i.e. it implements a all classes needed to run
* a Bittorrent tracker that coordinates peers exchanges. *
*
* Copyright (C) 2007 Baptiste Dubuis, Artificial Intelligence Laboratory, EPFL
*
* This file is part of jbittorrentapi-v1.0.zip
*
* Java Bittorrent API is free software and a free user study set-up;
* you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Java Bittorrent API is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Java Bittorrent API; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @version 1.0
* @author Baptiste Dubuis
* To contact the author:
* email: baptiste.dubuis@gmail.com
*
* More information about Java Bittorrent API:
* http://sourceforge.net/projects/bitext/
*/
package jBittorrentAPI;
import java.util.LinkedHashMap;
import java.util.EventListener;
public interface PeerUpdateListener extends EventListener{
public void updatePeerList(LinkedHashMap list);
public void updateFailed(int error, String message);
}
| purplexcite/jBitTorrent-API | PeerUpdateListener.java |
249,002 | /**
* @copyright 2012 Computer Science Department, Recursive InterNetworking Architecture (RINA) laboratory, Boston University.
* All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation
* for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all
* copies and that both the copyright notice and this permission notice appear in supporting documentation.
* The RINA laboratory of the Computer Science Department at Boston University makes no
* representations about the suitability of this software for any purpose.
*/
package dap.util;
/**
* @author Flavio Esposito and Yuefeng Wang, Computer Science Department, Boston University
* @version 1.0
*
*/
public class QoS {
public QoS() {
}
}
| flavioesposito/catena | src/dap/util/QoS.java |
249,004 | /*
* Ring.java
*
* Created on Mon May 17 16:46:20 EDT 2004
*
* Copyright (c) 2004 Spallation Neutron Source
* Oak Ridge National Laboratory
* Oak Ridge, TN 37830
*/
package xal.smf;
import xal.tools.data.*;
import java.util.*;
/**
* Ring is a subclass of combo sequence that is intended to support the special needs of a Ring.
* A ring is made up of ring segments.
*
* @author tap
*/
public class Ring extends AcceleratorSeqCombo {
/** node type */
public static final String s_strType = "Ring";
/**
* Primary Constructor
*/
public Ring( final String strID, final List<AcceleratorSeq> segments) {
super( strID, segments );
}
/** Constructor */
public Ring( final String strID, final Accelerator accelerator, final DataAdaptor adaptor ) {
this( strID, getSequences(accelerator, adaptor) );
}
/**
* Identify whether the sequence is within a linear section. This helps
* us to determine whether it is meaningful to identify one node as being
* downstream from another.
* @return false since by definition the ring is not a linear section
*/
public boolean isLinear() {
return false;
}
/**
* Convert the sequence position to a position relative to the specified reference node.
* @param position the position of a location relative to the sequence's start
* @param referenceNode the node relative to which we wish to get the position
*/
public double getRelativePosition( final double position, final AcceleratorNode referenceNode ) {
final double relativePosition = position - getPosition( referenceNode );
return ( relativePosition >= 0 ) ? relativePosition : getLength() + relativePosition;
}
/**
* Get the shortest relative postion of one node with respect to a reference node. This is really useful for ring sequences.
* @param node the node whose relative position is sought
* @param referenceNode the reference node relative to which the node's position is calculated
* @return the distance (positive or negative) of the node with respect to the reference node whose magnitude is shortest
*/
public double getShortestRelativePosition( final AcceleratorNode node, final AcceleratorNode referenceNode ) {
final double distanceTo = Math.abs( getDistanceBetween( node, referenceNode ) );
final double distanceFrom = Math.abs( getDistanceBetween( referenceNode, node ) );
return distanceTo < distanceFrom ? - distanceTo : distanceFrom;
}
}
| openxal/openxal | core/src/xal/smf/Ring.java |
249,006 | // ****************************************************************************
//
// Copyright (c) 2000 - 2015, Lawrence Livermore National Security, LLC
// Produced at the Lawrence Livermore National Laboratory
// LLNL-CODE-442911
// All rights reserved.
//
// This file is part of VisIt. For details, see https://visit.llnl.gov/. The
// full copyright notice is contained in the file COPYRIGHT located at the root
// of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the disclaimer below.
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the disclaimer (as noted below) in the
// documentation and/or other materials provided with the distribution.
// - Neither the name of the LLNS/LLNL nor the names of its contributors may
// be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
// LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// ****************************************************************************
package llnl.visit;
import java.lang.Thread;
// ****************************************************************************
// Class: SyncNotifier
//
// Purpose:
// This class is used to observe SyncAttributes in the ViewerProxy. It
// notifies the thread that called ViewerProxy's Synchronize method that
// is doing a wait().
//
// Notes:
//
// Programmer: Brad Whitlock
// Creation: Thu Aug 8 12:50:24 PDT 2002
//
// Modifications:
//
// ****************************************************************************
class SyncNotifier implements SimpleObserver
{
public SyncNotifier()
{
doUpdate = true;
verbose = true;
thread = null;
syncValue = -1;
}
public synchronized void NotifyThreadOnValue(Thread t, int val)
{
thread = t;
syncValue = val;
}
public void Update(AttributeSubject s)
{
if(s == null || thread == null)
return;
SyncAttributes syncAtts = (SyncAttributes)s;
if(syncAtts.GetSyncTag() == syncValue)
{
synchronized(thread)
{
if(verbose)
System.out.println("Received viewer sync.");
thread.notify();
}
}
}
public void SetVerbose(boolean val) { verbose = val; }
public void SetUpdate(boolean val) { doUpdate = val; }
public boolean GetUpdate() { return doUpdate; }
private boolean doUpdate;
private boolean verbose;
private Thread thread;
private int syncValue;
}
| visit-vis/VisIt | java/SyncNotifier.java |
249,008 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
// Define the Graphical User Interface
public class Slice extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java GUI class to take a slice from a CONFIG/REVCON file
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
public static Slice job;
private static GUI home=null;
private static double slx,sly,slz,top,bot;
private static JButton load,make,close;
private static JTextField dlx,dly,dlz,ubd,lbd;
public Slice() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
setTitle("Slice a CONFIG file");
getContentPane().setBackground(art.back);
getContentPane().setForeground(art.fore);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Define the Load button
load = new JButton("Load");
load.setBackground(art.butn);
load.setForeground(art.butf);
fix(load,grd,gbc,0,0,1,1);
// Define the Make button
make = new JButton("Make");
make.setBackground(art.butn);
make.setForeground(art.butf);
fix(make,grd,gbc,2,0,1,1);
// Slice direction vector
JLabel lab1 = new JLabel("Slice direction vector:",JLabel.LEFT);
fix(lab1,grd,gbc,0,1,3,1);
dlx = new JTextField(8);
dlx.setBackground(art.scrn);
dlx.setForeground(art.scrf);
fix(dlx,grd,gbc,0,2,1,1);
dly = new JTextField(8);
dly.setBackground(art.scrn);
dly.setForeground(art.scrf);
fix(dly,grd,gbc,1,2,1,1);
dlz = new JTextField(8);
dlz.setBackground(art.scrn);
dlz.setForeground(art.scrf);
fix(dlz,grd,gbc,2,2,1,1);
fix(new JLabel(" "),grd,gbc,1,3,1,1);
// Upper bound of slice
JLabel lab2 = new JLabel("Upper bound:",JLabel.RIGHT);
fix(lab2,grd,gbc,0,4,2,1);
ubd = new JTextField(8);
ubd.setBackground(art.scrn);
ubd.setForeground(art.scrf);
fix(ubd,grd,gbc,2,4,1,1);
// Lower bound of slice
JLabel lab3 = new JLabel("Lower bound:",JLabel.RIGHT);
fix(lab3,grd,gbc,0,5,2,1);
lbd = new JTextField(8);
lbd.setBackground(art.scrn);
lbd.setForeground(art.scrf);
fix(lbd,grd,gbc,2,5,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,0,6,1,1);
// Register action buttons
load.addActionListener(this);
make.addActionListener(this);
close.addActionListener(this);
}
// Constructor method
public Slice(GUI here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
println("Activated panel for slicing a CONFIG file");
home=here;
// Set up Graphical User interface
job = new Slice();
job.pack();
job.setVisible(true);
setValues();
}
// Set default values
static void setValues() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
slx=0.0;
sly=0.0;
slz=1.0;
top=3.0;
bot=-3.0;
dlx.setText(String.valueOf(slx));
dly.setText(String.valueOf(sly));
dlz.setText(String.valueOf(slz));
ubd.setText(String.valueOf(top));
lbd.setText(String.valueOf(bot));
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Load")) {
slx=BML.giveDouble(dlx.getText(),1);
sly=BML.giveDouble(dly.getText(),1);
slz=BML.giveDouble(dlz.getText(),1);
top=BML.giveDouble(ubd.getText(),1);
bot=BML.giveDouble(lbd.getText(),1);
config=getConfig(home,"CFG");
sliceFile();
}
if (arg.equals("Make")) {
slx=BML.giveDouble(dlx.getText(),1);
sly=BML.giveDouble(dly.getText(),1);
slz=BML.giveDouble(dlz.getText(),1);
top=BML.giveDouble(ubd.getText(),1);
bot=BML.giveDouble(lbd.getText(),1);
sliceFile();
}
else if (arg.equals("Close")) {
job.dispose();
}
}
void sliceFile() {
/*
**********************************************************************
dl_poly/java utility to cut a slice from a CONFIG file
copyright daresbury laboratory
author w. smith march 2001
**********************************************************************
*/
int n;
double ddd,sss;
if(config==null || config.natms==0)return;
n=0;
sss=Math.sqrt(slx*slx+sly*sly+slz*slz);
for(int i=0;i<config.natms;i++) {
ddd=(slx*config.xyz[0][i]+sly*config.xyz[1][i]+slz*config.xyz[2][i])/sss;
if(ddd > bot && ddd < top) {
config.atoms[n].znum=config.atoms[i].znum;
config.atoms[n].zmas=config.atoms[i].zmas;
config.atoms[n].zchg=config.atoms[i].zchg;
config.atoms[n].zrad=config.atoms[i].zrad;
config.atoms[n].zsym=new String(config.atoms[i].zsym);
config.atoms[n].zcol=new Color(config.atoms[i].zcol.getRGB());
config.atoms[n].covalent=config.atoms[i].covalent;
config.atoms[n].dotify=config.atoms[i].dotify;
config.xyz[0][n]=config.xyz[0][i];
config.xyz[1][n]=config.xyz[1][i];
config.xyz[2][n]=config.xyz[2][i];
n++;
}
}
config.natms=n;
// write new CONFIG file
fname="CFGSLC."+String.valueOf(numslc);
if(config.configWrite(fname)){
println("File "+fname+" created");
println("Number of atoms in "+fname+" : "+config.natms);
numslc++;
}
// Draw sliced structure
config.structure=new Structure(config);
if(!editor.isVisible())
editor.showEditor();
editor.pane.restore();
}
}
| dlpolyquantum/dlpoly_quantum | java/Slice.java |
249,010 | /* ----------------------------------------------------------------------
*
* coNCePTuaL GUI: coNCePTuaL GUI main
*
* By Nick Moss <nickm@lanl.gov>
* Support for specifying an initial file added by Scott Pakin <pakin@lanl.gov>
*
* This class is the main() entry point for the coNCePTual GUI
*
* ----------------------------------------------------------------------
*
*
* Copyright (C) 2015, Los Alamos National Security, LLC
* All rights reserved.
*
* Copyright (2015). Los Alamos National Security, LLC. This software
* was produced under U.S. Government contract DE-AC52-06NA25396
* for Los Alamos National Laboratory (LANL), which is operated by
* Los Alamos National Security, LLC (LANS) for the U.S. Department
* of Energy. The U.S. Government has rights to use, reproduce,
* and distribute this software. NEITHER THE GOVERNMENT NOR LANS
* MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY
* FOR THE USE OF THIS SOFTWARE. If software is modified to produce
* derivative works, such modified software should be clearly marked,
* so as not to confuse it with the version available from LANL.
*
* Additionally, redistribution and use in source and binary forms,
* with or without modification, are permitted provided that the
* following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Los Alamos National Security, LLC, Los Alamos
* National Laboratory, the U.S. Government, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY LANS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LANS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* ----------------------------------------------------------------------
*/
package gov.lanl.c3.ncptl;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.*;
import java.io.*;
public class ncptlGUIMain{
public static void main( String args[] ){
JFrame mainFrame = new JFrame( "coNCePTuaL GUI: <unsaved>" );
mainFrame.setBackground( new Color( 238, 238, 238 ) );
ncptlGUI gui = new ncptlGUI( mainFrame );
//gui.loadParser();
if ( args.length > 0 )
gui.getProgram().open( args[0] );
}
}
| sstsimulator/coNCePTuaL | gui/ncptlGUIMain.java |
249,011 | /* ----------------------------------------------------------------------
*
* coNCePTuaL GUI: source target
*
* By Nick Moss <nickm@lanl.gov>
*
* SourceTarget is a (source,target) pair used in enumerating a TaskGroup
*
* ----------------------------------------------------------------------
*
*
* Copyright (C) 2015, Los Alamos National Security, LLC
* All rights reserved.
*
* Copyright (2015). Los Alamos National Security, LLC. This software
* was produced under U.S. Government contract DE-AC52-06NA25396
* for Los Alamos National Laboratory (LANL), which is operated by
* Los Alamos National Security, LLC (LANS) for the U.S. Department
* of Energy. The U.S. Government has rights to use, reproduce,
* and distribute this software. NEITHER THE GOVERNMENT NOR LANS
* MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY
* FOR THE USE OF THIS SOFTWARE. If software is modified to produce
* derivative works, such modified software should be clearly marked,
* so as not to confuse it with the version available from LANL.
*
* Additionally, redistribution and use in source and binary forms,
* with or without modification, are permitted provided that the
* following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Los Alamos National Security, LLC, Los Alamos
* National Laboratory, the U.S. Government, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY LANS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LANS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* ----------------------------------------------------------------------
*/
package gov.lanl.c3.ncptl;
import java.util.*;
public class SourceTarget {
public int source;
public int target;
public boolean unknown = false;
public SourceTarget( int source, int target ){
this.source = source;
this.target = target;
}
// returns a vector of sources Integers from an
// input Vector or SourceTarget's
public static Vector getSources( Vector sourceTargets ){
Vector sources = new Vector();
for( int i = 0; i < sourceTargets.size(); i++ ){
SourceTarget sourceTarget =
(SourceTarget)sourceTargets.elementAt( i );
Integer source = new Integer( sourceTarget.source );
if( sources.indexOf( source ) < 0 )
sources.add( source );
}
return sources;
}
// returns a vector of target Integers from an
// input Vector of SourceTarget's
public static Vector getTargets( Vector sourceTargets ){
Vector targets = new Vector();
for( int i = 0; i < sourceTargets.size(); i++ ){
SourceTarget sourceTarget =
(SourceTarget)sourceTargets.elementAt( i );
Integer target = new Integer( sourceTarget.target );
if( targets.indexOf( target ) < 0 )
targets.add( target );
}
return targets;
}
}
| sstsimulator/coNCePTuaL | gui/SourceTarget.java |
249,012 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class ProVar extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java Program Controls class
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
private static MakeControl home;
private static ProVar job;
private static JComboBox<String> restopt,algorithm;
private static JTextField tnstrun,tnsteql,tmult,tnstbpo,tnstack,tintsta,tewltol,tshktol,tqtntol;
private static JTextField tjobtim,ttclose;
private static JButton close;
// Define the Graphical User Interface
public ProVar() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
super();
setTitle("Program Variables");
int n=0;
getContentPane().setBackground(art.back);
getContentPane().setForeground(art.fore);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Panel label
fix(new JLabel("Select options:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// Restart option
fix(new JLabel("Algorithm",JLabel.LEFT),grd,gbc,0,n,2,1);
algorithm = new JComboBox<String>();
algorithm.setBackground(art.scrn);
algorithm.setForeground(art.scrf);
algorithm.addItem("Leapfrog Verlet");
algorithm.addItem("Velocity Verlet");
fix(algorithm,grd,gbc,2,n++,1,1);
// Number of steps
tnstrun = new JTextField(8);
tnstrun.setBackground(art.scrn);
tnstrun.setForeground(art.scrf);
fix(tnstrun,grd,gbc,0,n,1,1);
fix(new JLabel("Number of steps",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Equilibration steps
tnsteql = new JTextField(8);
tnsteql.setBackground(art.scrn);
tnsteql.setForeground(art.scrf);
fix(tnsteql,grd,gbc,0,n,1,1);
fix(new JLabel("Equilibration steps",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Multiple time step
tmult = new JTextField(8);
tmult.setBackground(art.scrn);
tmult.setForeground(art.scrf);
fix(tmult,grd,gbc,0,n,1,1);
fix(new JLabel("Multiple time step",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Print interval
tnstbpo = new JTextField(8);
tnstbpo.setBackground(art.scrn);
tnstbpo.setForeground(art.scrf);
fix(tnstbpo,grd,gbc,0,n,1,1);
fix(new JLabel("Print interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Stack interval
tnstack = new JTextField(8);
tnstack.setBackground(art.scrn);
tnstack.setForeground(art.scrf);
fix(tnstack,grd,gbc,0,n,1,1);
fix(new JLabel("Stack interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Stats interval
tintsta = new JTextField(8);
tintsta.setBackground(art.scrn);
tintsta.setForeground(art.scrf);
fix(tintsta,grd,gbc,0,n,1,1);
fix(new JLabel("Stats interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Ewald precision
tewltol = new JTextField(8);
tewltol.setBackground(art.scrn);
tewltol.setForeground(art.scrf);
fix(tewltol,grd,gbc,0,n,1,1);
fix(new JLabel("Ewald precision",JLabel.LEFT),grd,gbc,1,n++,2,1);
// SHAKE tolerance
tshktol = new JTextField(8);
tshktol.setBackground(art.scrn);
tshktol.setForeground(art.scrf);
fix(tshktol,grd,gbc,0,n,1,1);
fix(new JLabel("SHAKE tolerance",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Quaternion tolerance
tqtntol = new JTextField(8);
tqtntol.setBackground(art.scrn);
tqtntol.setForeground(art.scrf);
fix(tqtntol,grd,gbc,0,n,1,1);
fix(new JLabel("Quaternion tolerance",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Job time
tjobtim = new JTextField(8);
tjobtim.setBackground(art.scrn);
tjobtim.setForeground(art.scrf);
fix(tjobtim,grd,gbc,0,n,1,1);
fix(new JLabel("Job time (s)",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Close time
ttclose = new JTextField(8);
ttclose.setBackground(art.scrn);
ttclose.setForeground(art.scrf);
fix(ttclose,grd,gbc,0,n,1,1);
fix(new JLabel("Close time (s)",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Restart option
fix(new JLabel("Restart option",JLabel.LEFT),grd,gbc,0,n,2,1);
restopt = new JComboBox<String>();
restopt.setBackground(art.scrn);
restopt.setForeground(art.scrf);
restopt.addItem("NONE");
restopt.addItem("RESTART");
restopt.addItem("RESTART SCALE");
restopt.addItem("RESTART NOSCALE");
fix(restopt,grd,gbc,2,n++,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,0,n++,1,1);
// Register action buttons
close.addActionListener(this);
}
public ProVar(MakeControl here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
home=here;
job=new ProVar();
job.pack();
job.setVisible(true);
setParams();
}
void setParams() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
// set panel contents
algorithm.setSelectedIndex(keyalg);
tmult.setText(String.valueOf(mult));
tnstrun.setText(String.valueOf(nstrun));
tnsteql.setText(String.valueOf(nsteql));
tnstbpo.setText(String.valueOf(nstbpo));
tnstack.setText(String.valueOf(nstack));
tintsta.setText(String.valueOf(intsta));
tewltol.setText(String.valueOf(ewltol));
tshktol.setText(String.valueOf(shktol));
tqtntol.setText(String.valueOf(qtntol));
tjobtim.setText(String.valueOf(jobtim));
ttclose.setText(String.valueOf(tclose));
restopt.setSelectedIndex(keyres);
}
void getParams(){
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
keyalg=algorithm.getSelectedIndex();
ewltol=BML.giveDouble(tewltol.getText(),1);
qtntol=BML.giveDouble(tqtntol.getText(),1);
shktol=BML.giveDouble(tshktol.getText(),1);
jobtim=BML.giveDouble(tjobtim.getText(),1);
tclose=BML.giveDouble(ttclose.getText(),1);
nstrun=BML.giveInteger(tnstrun.getText(),1);
nsteql=BML.giveInteger(tnsteql.getText(),1);
mult=BML.giveInteger(tmult.getText(),1);
nstbpo=BML.giveInteger(tnstbpo.getText(),1);
nstack=BML.giveInteger(tnstack.getText(),1);
intsta=BML.giveInteger(tintsta.getText(),1);
keyres=restopt.getSelectedIndex();
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Close")) {
byebye();
}
}
void byebye() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
getParams();
home.prv=null;
job.setVisible(false);
}
}
| dlpolyquantum/dlpoly_quantum | java/ProVar.java |
249,013 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class ComVar extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java Common Variables class
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
private static MakeControl home;
private static ComVar job;
private static JTextField tfcap,tistrdf,tnstraj,tistraj,tlevcon,ttscal;
private static JTextField tistzden,tnstbts;
private static JButton close;
private static JCheckBox ballpairs,blcap,blzeql,blvdw,blrdf,blprdf;
private static JCheckBox bltraj,bltscal,blzden,blpzden,blzero;
// Define the Graphical User Interface
public ComVar() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
super();
setTitle("Common Variables");
int n=0;
getContentPane().setForeground(art.fore);
getContentPane().setBackground(art.back);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Panel label
fix(new JLabel("Select options:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// All pairs
ballpairs = new JCheckBox("All pairs");
ballpairs.setForeground(art.fore);
ballpairs.setBackground(art.back);
fix(ballpairs,grd,gbc,0,n++,1,1);
// Cap forces
blcap = new JCheckBox("Cap Forces");
blcap.setForeground(art.fore);
blcap.setBackground(art.back);
fix(blcap,grd,gbc,0,n++,1,1);
// Force cap
tfcap = new JTextField(8);
tfcap.setBackground(art.scrn);
tfcap.setForeground(art.scrf);
fix(tfcap,grd,gbc,0,n,1,1);
fix(new JLabel("Force cap",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Collect stats during equilibration
blzeql = new JCheckBox("Collect");
blzeql.setForeground(art.fore);
blzeql.setBackground(art.back);
fix(blzeql,grd,gbc,0,n++,1,1);
// Disable VDW forces
blvdw = new JCheckBox("Disable VDW forces");
blvdw.setForeground(art.fore);
blvdw.setBackground(art.back);
fix(blvdw,grd,gbc,0,n++,2,1);
// Calculate RDF and optional print
blrdf = new JCheckBox("Calculate RDF");
blrdf.setForeground(art.fore);
blrdf.setBackground(art.back);
fix(blrdf,grd,gbc,0,n,1,1);
blprdf = new JCheckBox("Print RDF");
blprdf.setForeground(art.fore);
blprdf.setBackground(art.back);
fix(blprdf,grd,gbc,2,n++,1,1);
// RDF interval
tistrdf = new JTextField(8);
tistrdf.setBackground(art.scrn);
tistrdf.setForeground(art.scrf);
fix(tistrdf,grd,gbc,0,n,1,1);
fix(new JLabel("RDF interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Produce History file
bltraj = new JCheckBox("Produce History file");
bltraj.setForeground(art.fore);
bltraj.setBackground(art.back);
fix(bltraj,grd,gbc,0,n++,2,1);
// History file start,increment and data level
tnstraj = new JTextField(8);
tnstraj.setBackground(art.scrn);
tnstraj.setForeground(art.scrf);
fix(tnstraj,grd,gbc,0,n,1,1);
fix(new JLabel("Start time step",JLabel.LEFT),grd,gbc,1,n++,2,1);
tistraj = new JTextField(8);
tistraj.setBackground(art.scrn);
tistraj.setForeground(art.scrf);
fix(tistraj,grd,gbc,0,n,1,1);
fix(new JLabel("Time step interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
tlevcon = new JTextField(8);
tlevcon.setBackground(art.scrn);
tlevcon.setForeground(art.scrf);
fix(tlevcon,grd,gbc,0,n,1,1);
fix(new JLabel("Data level key",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Enable Temp scaling
bltscal = new JCheckBox("Enable T scaling");
bltscal.setForeground(art.fore);
bltscal.setBackground(art.back);
fix(bltscal,grd,gbc,0,n++,2,1);
// Temp scaling interval
tnstbts = new JTextField(8);
tnstbts.setBackground(art.scrn);
tnstbts.setForeground(art.scrf);
fix(tnstbts,grd,gbc,0,n,1,1);
fix(new JLabel("T scaling interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Z density calculation
blzden = new JCheckBox("Z density");
blzden.setForeground(art.fore);
blzden.setBackground(art.back);
fix(blzden,grd,gbc,0,n,1,1);
blpzden = new JCheckBox("Print Z-dens");
blpzden.setForeground(art.fore);
blpzden.setBackground(art.back);
fix(blpzden,grd,gbc,2,n++,1,1);
// Z density interval
tistzden = new JTextField(8);
tistzden.setBackground(art.scrn);
tistzden.setForeground(art.scrf);
fix(tistzden,grd,gbc,0,n,1,1);
fix(new JLabel("Zdens interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Zero K MD option
blzero = new JCheckBox("Zero K MD");
blzero.setForeground(art.fore);
blzero.setBackground(art.back);
fix(blzero,grd,gbc,0,n++,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,0,n++,1,1);
// Register action buttons
close.addActionListener(this);
}
public ComVar(MakeControl here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
home=here;
job=new ComVar();
job.pack();
job.setVisible(true);
setParams();
}
void setParams() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
// set panel
ballpairs.setSelected(allpairs);
blcap.setSelected(lcap);
tfcap.setText(String.valueOf(fcap));
blzeql.setSelected(lzeql);
blvdw.setSelected(lvdw);
blprdf.setSelected(lprdf);
blrdf.setSelected(lrdf);
tistrdf.setText(String.valueOf(istrdf));
bltraj.setSelected(ltraj);
tnstraj.setText(String.valueOf(nstraj));
tistraj.setText(String.valueOf(istraj));
tlevcon.setText(String.valueOf(levcon));
bltscal.setSelected(ltscal);
tnstbts.setText(String.valueOf(nstbts));
blzden.setSelected(lzden);
blpzden.setSelected(lpzden);
tistzden.setText(String.valueOf(istzden));
blzero.setSelected(lzero);
}
void getParams() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
istrdf=BML.giveInteger(tistrdf.getText(),1);
istzden=BML.giveInteger(tistzden.getText(),1);
nstbts=BML.giveInteger(tnstbts.getText(),1);
nstraj=BML.giveInteger(tnstraj.getText(),1);
istraj=BML.giveInteger(tistraj.getText(),1);
levcon=BML.giveInteger(tlevcon.getText(),1);
fcap=BML.giveDouble(tfcap.getText(),1);
allpairs=ballpairs.isSelected();
lcap=blcap.isSelected();
lvdw=blvdw.isSelected();
lzeql=blzeql.isSelected();
lrdf=blrdf.isSelected();
lprdf=blprdf.isSelected();
ltraj=bltraj.isSelected();
ltscal=bltscal.isSelected();
lzden=blzden.isSelected();
lpzden=blpzden.isSelected();
lzero=blzero.isSelected();
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Close")) {
byebye();
}
}
void byebye() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
getParams();
home.cmv=null;
job.setVisible(false);
}
}
| dlpolyquantum/dlpoly_quantum | java/ComVar.java |
249,014 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class Solvat extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java Temperature Accelerated Dynamics class
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
private static MakeControl home;
private static Solvat job;
private static JTextField tstart,tintvl,tlambda,tnonlin;
private static JTextField systema,systemb,tswtch;
private static JCheckBox remass;
private static JComboBox<String> solkey,mixkey;
private static JButton close;
// Define the Graphical User Interface
public Solvat() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
super();
setTitle("Solvation Options");
int n=0;
getContentPane().setForeground(art.fore);
getContentPane().setBackground(art.back);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Panel label
fix(new JLabel("Select options:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// Select solvation option
fix(new JLabel("Choose solvation option:",JLabel.LEFT),grd,gbc,0,n,2,1);
solkey = new JComboBox<String>();
solkey.setForeground(art.scrf);
solkey.setBackground(art.scrn);
solkey.addItem("None");
solkey.addItem("Decompose");
solkey.addItem("Free Energy");
solkey.addItem("Excitation");
solkey.addItem("Switch");
fix(solkey,grd,gbc,2,n++,1,1);
// Start of decomposition
fix(new JLabel("Start timestep:",JLabel.LEFT),grd,gbc,0,n,2,1);
tstart = new JTextField(8);
tstart.setForeground(art.scrf);
tstart.setBackground(art.scrn);
fix(tstart,grd,gbc,2,n++,1,1);
// Data sampling interval
fix(new JLabel("Sampling Interval:",JLabel.LEFT),grd,gbc,0,n,2,1);
tintvl = new JTextField(8);
tintvl.setForeground(art.scrf);
tintvl.setBackground(art.scrn);
fix(tintvl,grd,gbc,2,n++,1,1);
// Solvent relaxation switching interval
fix(new JLabel("Switching Interval:",JLabel.LEFT),grd,gbc,0,n,2,1);
tswtch = new JTextField(8);
tswtch.setForeground(art.scrf);
tswtch.setBackground(art.scrn);
fix(tswtch,grd,gbc,2,n++,1,1);
// Free energy mixing parameter
fix(new JLabel("Free Energy Lambda:",JLabel.LEFT),grd,gbc,0,n,2,1);
tlambda = new JTextField(8);
tlambda.setForeground(art.scrf);
tlambda.setBackground(art.scrn);
fix(tlambda,grd,gbc,2,n++,1,1);
// Mixing function selction
fix(new JLabel("Free Energy Mixing Function:",JLabel.LEFT),grd,gbc,0,n,2,1);
mixkey = new JComboBox<String>();
mixkey.setForeground(art.scrf);
mixkey.setBackground(art.scrn);
mixkey.addItem("Linear");
mixkey.addItem("Nonlinear");
mixkey.addItem("Trigonometric");
mixkey.addItem("Error function");
mixkey.addItem("Polynomial");
mixkey.addItem("Spline kernel");
fix(mixkey,grd,gbc,2,n++,1,1);
// Exponent for nonlinear mixing
fix(new JLabel("Free Eng. Nonlinear exponent:",JLabel.LEFT),grd,gbc,0,n,2,1);
tnonlin = new JTextField(8);
tnonlin.setForeground(art.scrf);
tnonlin.setBackground(art.scrn);
fix(tnonlin,grd,gbc,2,n++,1,1);
// Reset mass option
remass = new JCheckBox("Reset mass for Free Energy?");
remass.setForeground(art.fore);
remass.setBackground(art.back);
fix(remass,grd,gbc,0,n++,3,1);
// Define System A
fix(new JLabel("Define System A:",JLabel.LEFT),grd,gbc,0,n,2,1);
systema = new JTextField(8);
systema.setForeground(art.scrf);
systema.setBackground(art.scrn);
fix(systema,grd,gbc,2,n++,1,1);
// Define System B
fix(new JLabel("Define System B:",JLabel.LEFT),grd,gbc,0,n,2,1);
systemb = new JTextField(8);
systemb.setForeground(art.scrf);
systemb.setBackground(art.scrn);
fix(systemb,grd,gbc,2,n++,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,0,n++,1,1);
// Register action buttons
close.addActionListener(this);
}
public Solvat(MakeControl here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
home=here;
job=new Solvat();
job.pack();
job.setVisible(true);
setParams();
}
void setParams() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
// set panel
solkey.setSelectedIndex(sol_key);
tstart.setText(String.valueOf(num_start));
tintvl.setText(String.valueOf(num_intvl));
tswtch.setText(String.valueOf(num_swtch));
tlambda.setText(String.valueOf(lambda));
mixkey.setSelectedIndex(mix_key-1);
tnonlin.setText(String.valueOf(non_lin_exp));
remass.setSelected(lremass);
systema.setText(system_a);
systemb.setText(system_b);
}
void getParams(){
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
lsol=true;
sol_key=solkey.getSelectedIndex();
num_start=BML.giveInteger(tstart.getText(),1);
num_intvl=BML.giveInteger(tintvl.getText(),1);
num_swtch=BML.giveInteger(tswtch.getText(),1);
lambda=BML.giveDouble(tlambda.getText(),1);
mix_key=mixkey.getSelectedIndex()+1;
non_lin_exp=BML.giveInteger(tnonlin.getText(),1);
lremass=remass.isSelected();
system_a=systema.getText();
system_b=systemb.getText();
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Close")) {
byebye();
}
}
void byebye() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
getParams();
home.sol=null;
job.setVisible(false);
}
}
| dlpolyquantum/dlpoly_quantum | java/Solvat.java |
249,015 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class SysVar extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java System Variables class
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
private static MakeControl home=null;
private static SysVar job=null;
private static JComboBox<String> ensemble,electro;
private static JTextField ttemp,tpress,ttstep,trcut,tdelr,trvdw,trprim,tepsq,ttaut,ttaup,tgamt;
private static JButton close;
// Define the Graphical User Interface
public SysVar() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
super();
setTitle("System Variables");
int n=0;
getContentPane().setBackground(art.back);
getContentPane().setForeground(art.fore);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Panel label
fix(new JLabel("Select options:",JLabel.LEFT),grd,gbc,0,n++,2,1);
// Temperature
ttemp = new JTextField(8);
ttemp.setBackground(art.scrn);
ttemp.setForeground(art.scrf);
fix(ttemp,grd,gbc,0,n,1,1);
fix(new JLabel("Temperature (K)",JLabel.LEFT),grd,gbc,1,n++,1,1);
// Pressure
tpress = new JTextField(8);
tpress.setBackground(art.scrn);
tpress.setForeground(art.scrf);
fix(tpress,grd,gbc,0,n,1,1);
fix(new JLabel("Pressure (kBars)",JLabel.LEFT),grd,gbc,1,n++,1,1);
// Time step
ttstep = new JTextField(8);
ttstep.setBackground(art.scrn);
ttstep.setForeground(art.scrf);
fix(ttstep,grd,gbc,0,n,1,1);
fix(new JLabel("Time step (ps)",JLabel.LEFT),grd,gbc,1,n++,1,1);
// Forces cut off
trcut = new JTextField(8);
trcut.setBackground(art.scrn);
trcut.setForeground(art.scrf);
fix(trcut,grd,gbc,0,n,1,1);
fix(new JLabel("Cut off (A)",JLabel.LEFT),grd,gbc,1,n++,1,1);
// Verlet shell width
tdelr = new JTextField(8);
tdelr.setBackground(art.scrn);
tdelr.setForeground(art.scrf);
fix(tdelr,grd,gbc,0,n,1,1);
fix(new JLabel("Verlet shell width (A)",JLabel.LEFT),grd,gbc,1,n++,1,1);
// VDW cut off
trvdw = new JTextField(8);
trvdw.setBackground(art.scrn);
trvdw.setForeground(art.scrf);
fix(trvdw,grd,gbc,0,n,1,1);
fix(new JLabel("VDW cut off (A)",JLabel.LEFT),grd,gbc,1,n++,1,1);
// Primary cut off
trprim = new JTextField(8);
trprim.setBackground(art.scrn);
trprim.setForeground(art.scrf);
fix(trprim,grd,gbc,0,n,1,1);
fix(new JLabel("Primary cut off (A)",JLabel.LEFT),grd,gbc,1,n++,1,1);
// Dielectric Constant
tepsq = new JTextField(8);
tepsq.setBackground(art.scrn);
tepsq.setForeground(art.scrf);
fix(tepsq,grd,gbc,0,n,1,1);
fix(new JLabel("Dielectric constant",JLabel.LEFT),grd,gbc,1,n++,1,1);
// Temperature relaxation constant
ttaut = new JTextField(8);
ttaut.setBackground(art.scrn);
ttaut.setForeground(art.scrf);
fix(ttaut,grd,gbc,0,n,1,1);
fix(new JLabel("Temp. relaxation (ps)",JLabel.LEFT),grd,gbc,1,n++,1,1);
// Pressure relaxation constant
ttaup = new JTextField(8);
ttaup.setBackground(art.scrn);
ttaup.setForeground(art.scrf);
fix(ttaup,grd,gbc,0,n,1,1);
fix(new JLabel("Press. relaxation (ps)",JLabel.LEFT),grd,gbc,1,n++,1,1);
// Surface tension
tgamt = new JTextField(8);
tgamt.setBackground(art.scrn);
tgamt.setForeground(art.scrf);
fix(tgamt,grd,gbc,0,n,1,1);
fix(new JLabel("Surface tension (dyn/cm)",JLabel.LEFT),grd,gbc,1,n++,1,1);
// Choice of ensemble
fix(new JLabel("Ensemble.............",JLabel.LEFT),grd,gbc,0,n,1,1);
ensemble = new JComboBox<String>();
ensemble.setBackground(art.scrn);
ensemble.setForeground(art.scrf);
ensemble.addItem("NVE");
ensemble.addItem("NVT Andersen");
ensemble.addItem("NVT Berendsen");
ensemble.addItem("NVT Evans");
ensemble.addItem("NVT Hoover");
ensemble.addItem("NVT Langevin");
ensemble.addItem("NPT Berendsen");
ensemble.addItem("NPT Hoover");
ensemble.addItem("NPT Langevin");
ensemble.addItem("NPT MTK");
ensemble.addItem("NST Berendsen");
ensemble.addItem("NST Hoover");
ensemble.addItem("NST Langevin");
ensemble.addItem("NST MTK");
ensemble.addItem("NST-Area Berendsen");
ensemble.addItem("NST-Area Hoover");
ensemble.addItem("NST-Area Langevin");
ensemble.addItem("NST-Area MTK");
ensemble.addItem("NST-Tens Berendsen");
ensemble.addItem("NST-Tens Hoover");
ensemble.addItem("NST-Tens Langevin");
ensemble.addItem("NST-Tens MTK");
ensemble.addItem("PMF");
fix(ensemble,grd,gbc,2,n++,1,1);
// Choice of electrostatics
fix(new JLabel("Electrostatics.......",JLabel.LEFT),grd,gbc,0,n,1,1);
electro = new JComboBox<String>();
electro.setBackground(art.scrn);
electro.setForeground(art.scrf);
electro.addItem("NONE");
electro.addItem("EWALD");
electro.addItem("DISTAN");
electro.addItem("T-COUL");
electro.addItem("S-COUL");
electro.addItem("R-FIELD");
electro.addItem("SPME");
electro.addItem("HK-EWALD");
fix(electro,grd,gbc,2,n++,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,0,n++,1,1);
// Register action buttons
close.addActionListener(this);
}
public SysVar(MakeControl here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
home=here;
job=new SysVar();
job.pack();
job.setVisible(true);
setParams();
}
void setParams() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
// set panel
ttemp.setText(String.valueOf(temp));
tpress.setText(String.valueOf(press));
ttstep.setText(String.valueOf(tstep));
trcut.setText(String.valueOf(rcut));
tdelr.setText(String.valueOf(delr));
trvdw.setText(String.valueOf(rvdw));
trprim.setText(String.valueOf(rprim));
tepsq.setText(String.valueOf(epsq));
ttaut.setText(String.valueOf(taut));
ttaup.setText(String.valueOf(taup));
tgamt.setText(String.valueOf(gamt));
ensemble.setSelectedIndex(keyens);
electro.setSelectedIndex(keyfce/2);
}
void getParams(){
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
temp=BML.giveDouble(ttemp.getText(),1);
press=BML.giveDouble(tpress.getText(),1);
tstep=BML.giveDouble(ttstep.getText(),1);
rcut=BML.giveDouble(trcut.getText(),1);
delr=BML.giveDouble(tdelr.getText(),1);
rvdw=BML.giveDouble(trvdw.getText(),1);
rprim=BML.giveDouble(trprim.getText(),1);
epsq=BML.giveDouble(tepsq.getText(),1);
taut=BML.giveDouble(ttaut.getText(),1);
taup=BML.giveDouble(ttaup.getText(),1);
keyens=ensemble.getSelectedIndex();
keyfce=2*electro.getSelectedIndex();
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Close")) {
byebye();
}
}
void byebye() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
getParams();
home.sys=null;
job.setVisible(false);
}
}
| dlpolyquantum/dlpoly_quantum | java/SysVar.java |
249,016 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class EopVar extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java Extra Options class
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
private static MakeControl home;
private static EopVar job;
private static JTextField tbinsize,tdensvar,tdump,tewldev,tmxquat,tmxshak;
private static JTextField tnfold1,tnfold2,tnfold3,tspmeev,tregauss;
private static JButton close;
private static JCheckBox blexclude,blmetdir,blvdwdir,blnoindex,blnostrict,blreplay;
private static JCheckBox blpslab,blvdwshift,blnotopo;
// Define the Graphical User Interface
public EopVar() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
super();
setTitle("Extra Controls");
int n=0;
getContentPane().setForeground(art.fore);
getContentPane().setBackground(art.back);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Panel label
fix(new JLabel("Select options:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// Binsize
tbinsize = new JTextField(8);
tbinsize.setForeground(art.scrf);
tbinsize.setBackground(art.scrn);
fix(tbinsize,grd,gbc,0,n,1,1);
fix(new JLabel("RDF/ZDEN binsize",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Densvar
tdensvar = new JTextField(8);
tdensvar.setForeground(art.scrf);
tdensvar.setBackground(art.scrn);
fix(tdensvar,grd,gbc,0,n,1,1);
fix(new JLabel("DensVar",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Dump Interval
tdump = new JTextField(8);
tdump.setBackground(art.scrn);
tdump.setForeground(art.scrf);
fix(tdump,grd,gbc,0,n,1,1);
fix(new JLabel("Dump Interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Ewald Evaluation Interval
tewldev = new JTextField(8);
tewldev.setForeground(art.scrf);
tewldev.setBackground(art.scrn);
fix(tewldev,grd,gbc,0,n,1,1);
fix(new JLabel("Ewald Interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
// SPME Evaluation Interval
tspmeev = new JTextField(8);
tspmeev.setForeground(art.scrf);
tspmeev.setBackground(art.scrn);
fix(tspmeev,grd,gbc,0,n,1,1);
fix(new JLabel("SPME Interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Extended Coulomb Exclusions
blexclude = new JCheckBox("Extend Coulomb Exclusions");
blexclude.setForeground(art.fore);
blexclude.setBackground(art.back);
fix(blexclude,grd,gbc,0,n++,2,1);
// Maximum Quaternion Iterations
tmxquat = new JTextField(8);
tmxquat.setForeground(art.scrf);
tmxquat.setBackground(art.scrn);
fix(tmxquat,grd,gbc,0,n,1,1);
fix(new JLabel("Max Quatn. Iterations",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Maximum SHAKE Iterations
tmxshak = new JTextField(8);
tmxshak.setForeground(art.scrf);
tmxshak.setBackground(art.scrn);
fix(tmxshak,grd,gbc,0,n,1,1);
fix(new JLabel("Max SHAKE Iterations",JLabel.LEFT),grd,gbc,1,n++,2,1);
// NFold Expand CONFIG and FIELD
fix(new JLabel("Nfold Expand",JLabel.LEFT),grd,gbc,0,n++,2,1);
tnfold1 = new JTextField(6);
tnfold1.setBackground(art.scrn);
tnfold1.setForeground(art.scrf);
fix(tnfold1,grd,gbc,0,n,1,1);
tnfold2 = new JTextField(6);
tnfold2.setBackground(art.scrn);
tnfold2.setForeground(art.scrf);
fix(tnfold2,grd,gbc,1,n,1,1);
tnfold3 = new JTextField(6);
tnfold3.setBackground(art.scrn);
tnfold3.setForeground(art.scrf);
fix(tnfold3,grd,gbc,2,n++,1,1);
// Direct Metal Evaluation
blmetdir = new JCheckBox("Metal Direct");
blmetdir.setForeground(art.fore);
blmetdir.setBackground(art.back);
fix(blmetdir,grd,gbc,0,n++,1,1);
// Direct VDW Evaluation
blvdwdir = new JCheckBox("VDW Direct");
blvdwdir.setForeground(art.fore);
blvdwdir.setBackground(art.back);
fix(blvdwdir,grd,gbc,0,n++,2,1);
// Ignore CONFIG file Indices
blnoindex = new JCheckBox("No Index");
blnoindex.setForeground(art.fore);
blnoindex.setBackground(art.back);
fix(blnoindex,grd,gbc,0,n++,2,1);
// Abort strict data checks
blnostrict = new JCheckBox("No Strict");
blnostrict.setForeground(art.fore);
blnostrict.setBackground(art.back);
fix(blnostrict,grd,gbc,0,n++,2,1);
// No topology print option
blnotopo = new JCheckBox("No Topology");
blnotopo.setForeground(art.fore);
blnotopo.setBackground(art.back);
fix(blnotopo,grd,gbc,0,n++,2,1);
// Regauss interval
tregauss = new JTextField(8);
tregauss.setBackground(art.scrn);
tregauss.setForeground(art.scrf);
fix(tregauss,grd,gbc,0,n,1,1);
fix(new JLabel("Regauss Interval",JLabel.LEFT),grd,gbc,1,n++,2,1);
// Enable replay option
blreplay = new JCheckBox("Enable Replay");
blreplay.setForeground(art.fore);
blreplay.setBackground(art.back);
fix(blreplay,grd,gbc,0,n++,2,1);
// Processor slab option
blpslab = new JCheckBox("Processor Slab");
blpslab.setForeground(art.fore);
blpslab.setBackground(art.back);
fix(blpslab,grd,gbc,0,n++,2,1);
// Shift VDW forces option
blvdwshift = new JCheckBox("VDW Shift");
blvdwshift.setForeground(art.fore);
blvdwshift.setBackground(art.back);
fix(blvdwshift,grd,gbc,0,n++,2,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,0,n++,1,1);
// Register action buttons
close.addActionListener(this);
}
public EopVar(MakeControl here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
home=here;
job=new EopVar();
job.pack();
job.setVisible(true);
setParams();
}
void setParams() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
// set panel
tbinsize.setText(String.valueOf(binsize));
tdensvar.setText(String.valueOf(densvar));
tdump.setText(String.valueOf(ndump));
tewldev.setText(String.valueOf(ewldev));
tspmeev.setText(String.valueOf(spmeev));
blexclude.setSelected(lexclude);
tmxquat.setText(String.valueOf(mxquat));
tmxshak.setText(String.valueOf(mxshak));
tnfold1.setText(String.valueOf(nfold1));
tnfold2.setText(String.valueOf(nfold2));
tnfold3.setText(String.valueOf(nfold3));
blmetdir.setSelected(lmetdir);
blvdwdir.setSelected(lvdwdir);
blnoindex.setSelected(lnoindex);
blnostrict.setSelected(lnostrict);
blnotopo.setSelected(lnotopo);
tregauss.setText(String.valueOf(nregauss));
blreplay.setSelected(lreplay);
blpslab.setSelected(lpslab);
blvdwshift.setSelected(lvdwshift);
}
void getParams(){
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
binsize=BML.giveDouble(tbinsize.getText(),1);
densvar=BML.giveDouble(tdensvar.getText(),1);
ndump=BML.giveInteger(tdump.getText(),1);
ewldev=BML.giveInteger(tewldev.getText(),1);
spmeev=BML.giveInteger(tspmeev.getText(),1);
lexclude=blexclude.isSelected();
mxquat=BML.giveInteger(tmxquat.getText(),1);
mxshak=BML.giveInteger(tmxshak.getText(),1);
nfold1=BML.giveInteger(tnfold1.getText(),1);
nfold2=BML.giveInteger(tnfold2.getText(),1);
nfold3=BML.giveInteger(tnfold3.getText(),1);
lmetdir=blmetdir.isSelected();
lvdwdir=blvdwdir.isSelected();
lnoindex=blnoindex.isSelected();
lnostrict=blnostrict.isSelected();
lnotopo=blnotopo.isSelected();
nregauss=BML.giveInteger(tregauss.getText(),1);
lreplay=blreplay.isSelected();
lpslab=blpslab.isSelected();
lvdwshift=blvdwshift.isSelected();
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Close")) {
byebye();
}
}
void byebye() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
getParams();
home.eop=null;
job.setVisible(false);
}
}
| dlpolyquantum/dlpoly_quantum | java/EopVar.java |
249,017 | /* ----------------------------------------------------------------------
*
* coNCePTuaL GUI: exit dialog
*
* By Nick Moss <nickm@lanl.gov>
*
* This class implements a simple dialog which is shown on exit asking
* the user whether or not to save changes to file. It is only
* displayed on exit after determining that there are unsaved changes
* to the file.
*
* ----------------------------------------------------------------------
*
*
* Copyright (C) 2015, Los Alamos National Security, LLC
* All rights reserved.
*
* Copyright (2015). Los Alamos National Security, LLC. This software
* was produced under U.S. Government contract DE-AC52-06NA25396
* for Los Alamos National Laboratory (LANL), which is operated by
* Los Alamos National Security, LLC (LANS) for the U.S. Department
* of Energy. The U.S. Government has rights to use, reproduce,
* and distribute this software. NEITHER THE GOVERNMENT NOR LANS
* MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY
* FOR THE USE OF THIS SOFTWARE. If software is modified to produce
* derivative works, such modified software should be clearly marked,
* so as not to confuse it with the version available from LANL.
*
* Additionally, redistribution and use in source and binary forms,
* with or without modification, are permitted provided that the
* following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Los Alamos National Security, LLC, Los Alamos
* National Laboratory, the U.S. Government, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY LANS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LANS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* ----------------------------------------------------------------------
*/
package gov.lanl.c3.ncptl;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class ExitDialog implements ActionListener {
private JFrame frame;
private Program program;
private boolean exit;
public ExitDialog( Container container, Program program, boolean exit ){
this.exit = exit;
this.program = program;
frame = new JFrame( "Save Changes?" );
if( container instanceof JFrame )
frame.setLocationRelativeTo( (JFrame)container );
else
if( container instanceof JApplet )
frame.setLocationRelativeTo( (JApplet)container );
Container pane = frame.getContentPane();
pane.setLayout( new FlowLayout( FlowLayout.CENTER ) );
pane.add( new JLabel( "Save changes before exiting?" ) );
JButton yesButton = new JButton( "Yes" );
JButton noButton = new JButton( "No" );
yesButton.addActionListener( this );
noButton.addActionListener( this );
pane.add( yesButton );
pane.add( noButton );
frame.pack();
frame.setVisible( true );
}
public void actionPerformed( ActionEvent event ){
String command = event.getActionCommand();
if( command.equals( "Yes" ) )
exit = program.saveOnExit();
frame.setVisible( false );
frame.dispose();
if( exit )
System.exit( 0 );
}
}
| sstsimulator/coNCePTuaL | gui/ExitDialog.java |
249,019 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class SkwPlot extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java GUI class to plot dynamic structure factors
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
public static SkwPlot job;
private static GUI home;
private static String sname;
private static int npnts,kv1,kv2,kv3;
private static JTextField kvec1,kvec2,kvec3,skwfile;
private static JButton plot,close;
private static double time;
private static double[] xx,yy;
// Define the Graphical User Interface
public SkwPlot() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
setTitle("S(k,w) Plotter");
getContentPane().setBackground(art.back);
getContentPane().setForeground(art.fore);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Define the Plot button
plot = new JButton(" Plot ");
plot.setBackground(art.butn);
plot.setForeground(art.butf);
fix(plot,grd,gbc,0,0,1,1);
fix(new JLabel(" "),grd,gbc,1,0,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,2,0,1,1);
// Name of van Hove data file
JLabel lab0 = new JLabel("Skw/Fkt plot file:",JLabel.LEFT);
fix(lab0,grd,gbc,0,1,2,1);
skwfile = new JTextField(14);
skwfile.setBackground(art.scrn);
skwfile.setForeground(art.scrf);
fix(skwfile,grd,gbc,0,2,3,1);
// K vector X component
JLabel lab1 = new JLabel("K-vector X index:",JLabel.LEFT);
fix(lab1,grd,gbc,0,3,2,1);
kvec1 = new JTextField(5);
kvec1.setBackground(art.scrn);
kvec1.setForeground(art.scrf);
fix(kvec1,grd,gbc,2,3,1,1);
// K vector Y component
JLabel lab2 = new JLabel("K-vector Y index:",JLabel.LEFT);
fix(lab2,grd,gbc,0,4,2,1);
kvec2 = new JTextField(5);
kvec2.setBackground(art.scrn);
kvec2.setForeground(art.scrf);
fix(kvec2,grd,gbc,2,4,1,1);
// K vector Z component
JLabel lab3 = new JLabel("K-vector Z index:",JLabel.LEFT);
fix(lab3,grd,gbc,0,5,2,1);
kvec3 = new JTextField(5);
kvec3.setBackground(art.scrn);
kvec3.setForeground(art.scrf);
fix(kvec3,grd,gbc,2,5,1,1);
// Register action buttons
plot.addActionListener(this);
close.addActionListener(this);
}
public SkwPlot(GUI here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
home=here;
println("Activated panel for plotting S(k,w) functions");
job=new SkwPlot();
job.pack();
job.setVisible(true);
npnts=0;
kv1=1;
kv2=0;
kv3=0;
sname="";
skwfile.setText(null);
kvec1.setText(String.valueOf(kv1));
kvec2.setText(String.valueOf(kv2));
kvec3.setText(String.valueOf(kv3));
}
public SkwPlot(GUI here,String skwname) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
home=here;
println("Activated panel for plotting S(k,w) functions");
job=new SkwPlot();
job.pack();
job.setVisible(true);
npnts=0;
kv1=1;
kv2=0;
kv3=0;
skwfile.setText(skwname);
kvec1.setText(String.valueOf(kv1));
kvec2.setText(String.valueOf(kv2));
kvec3.setText(String.valueOf(kv3));
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals(" Plot ")) {
kv1=BML.giveInteger(kvec1.getText(),1);
kv2=BML.giveInteger(kvec2.getText(),1);
kv3=BML.giveInteger(kvec3.getText(),1);
sname=skwfile.getText();
if(sname == null){
sname=selectFileNameBegins(home,"DEN");
if(sname.toUpperCase().indexOf("DENFKT")>=0)
println("File selected is "+sname+sname.toUpperCase().indexOf("DENFKT"));
if(sname.toUpperCase().indexOf("DENSKW")>=0)
println("File selected is "+sname+sname.toUpperCase().indexOf("DENSKW"));
}
if(sname != null) {
npnts=rdskw(kv1,kv2,kv3);
if(npnts>0) {
skwXY(npnts,kv1,kv2,kv3);
if(graf != null)
graf.job.dispose();
graf=new GraphDraw(home);
if(sname.toUpperCase().indexOf("DENFKT")>=0) {
graf.xlabel.setText("Time (ps)");
graf.ylabel.setText("F(k,t)");
graf.plabel.setText("F(k,t) of ("+
BML.fmt(kv1,2)+","+BML.fmt(kv2,2)+","+
BML.fmt(kv3,2)+")");
graf.extraPlot(npnts,xx,yy);
}
else if(sname.toUpperCase().indexOf("DENSKW")>=0) {
graf.xlabel.setText("Freq (/ps)");
graf.ylabel.setText("S(k,w)");
graf.plabel.setText("S(k,w) of ("+
BML.fmt(kv1,2)+","+BML.fmt(kv2,2)+","+
BML.fmt(kv3,2)+")");
graf.extraPlot(npnts,xx,yy);
}
}
}
}
else if (arg.equals("Close")) {
job.dispose();
}
}
int rdskw(int kk1,int kk2,int kk3) {
/*
*********************************************************************
dl_poly/java routine to read a DL_POLY SKW Data file
copyright - daresbury laboratory
author - w.smith march 2001
*********************************************************************
*/
int nskw,npts,k1,k2,k3;
String record;
boolean found=false;
try {
LineNumberReader lnr = new LineNumberReader(new FileReader(sname));
println("Reading file: "+sname);
record = lnr.readLine();
println("File header "+record);
record = lnr.readLine();
nskw=BML.giveInteger(record,1);
npts=BML.giveInteger(record,2);
xx=new double[npts];
yy=new double[npts];
OUT:
for(int n=0;n<nskw;n++) {
record=lnr.readLine();
k1=BML.giveInteger(record,2);
k2=BML.giveInteger(record,3);
k3=BML.giveInteger(record,4);
for(int i=0;i<npts;i++) {
record=lnr.readLine();
xx[i]=BML.giveDouble(record,1);
yy[i]=BML.giveDouble(record,2);
}
if(k1==kk1 && k2==kk2 && k3==kk3) {
found=true;
break OUT;
}
}
if(!found) {
println("Error - requested function not present in file");
lnr.close();
return -1;
}
lnr.close();
}
catch(FileNotFoundException e) {
println("Error - file not found: " + sname);
return -2;
}
catch(Exception e) {
println("Error reading file: " + sname + " "+e);
return -3;
}
println("Number of points ploted:"+BML.fmt(npts,6));
return npts;
}
void skwXY(int npts,int kk1,int kk2,int kk3) {
/*
*********************************************************************
dl_poly/java GUI routine to create a SKW XY file
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String gname;
String[] header;
int nhead=4,call;
header=new String[nhead];
gname="SKW"+String.valueOf(numsko)+".XY";
numsko++;
header[0]=" Skw Plotting Program";
if(sname.toUpperCase().indexOf("DENSKW")>=0) {
header[2]="Freq (/ps)";
header[3]="S(k,w)";
header[1]="S(k,w) of ("+BML.fmt(kv1,2)+","+BML.fmt(kv2,2)+","+BML.fmt(kv3,2)+")";
}
else {
header[2]="Time (ps)";
header[3]="F(k,t)";
header[1]="F(k,t) of ("+BML.fmt(kv1,2)+","+BML.fmt(kv2,2)+","+BML.fmt(kv3,2)+")";
}
call=putXY(gname,header,nhead,npts,xx,yy);
if(call==0)
println("PLOT file "+gname+" created");
}
}
| dlpolyquantum/dlpoly_quantum | java/SkwPlot.java |
249,020 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class MetaDyn extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java Bias Potential Dynamics class
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
private static MakeControl home;
private static MetaDyn job;
private static JTextField tncolv,tglbscl,tlocscl,tnq4,tnq6;
private static JTextField tntet,metstp,gheight,gwidth,ghkey;
private static JTextField twtdt;
private static JCheckBox tstein,ttet,tglob,tloc;
private static JButton close;
// Define the Graphical User Interface
public MetaDyn() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
super();
setTitle("Metadynamics");
int n=0;
getContentPane().setForeground(art.fore);
getContentPane().setBackground(art.back);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Panel label
fix(new JLabel("Select options:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// Number of order parameters
fix(new JLabel("Number of order params:",JLabel.LEFT),grd,gbc,0,n,2,1);
tncolv = new JTextField(8);
tncolv.setForeground(art.scrf);
tncolv.setBackground(art.scrn);
fix(tncolv,grd,gbc,2,n++,1,1);
// Steinhardt parameters selection
tstein=new JCheckBox("Steinhardt parameters required?");
tstein.setForeground(art.fore);
tstein.setBackground(art.back);
fix(tstein,grd,gbc,0,n++,3,1);
// Number of Steinhardt Q4 parameters required
fix(new JLabel("No. of Steinhardt Q4 params:",JLabel.LEFT),grd,gbc,0,n,2,1);
tnq4 = new JTextField(8);
tnq4.setForeground(art.scrf);
tnq4.setBackground(art.scrn);
fix(tnq4,grd,gbc,2,n++,1,1);
// Number of Steinhardt Q6 parameters required
fix(new JLabel("No. of Steinhardt Q6 params:",JLabel.LEFT),grd,gbc,0,n,2,1);
tnq6 = new JTextField(8);
tnq6.setForeground(art.scrf);
tnq6.setBackground(art.scrn);
fix(tnq6,grd,gbc,2,n++,1,1);
// Tetrahedral parameters selection
ttet=new JCheckBox("Tetrahedral parameters required?");
ttet.setForeground(art.fore);
ttet.setBackground(art.back);
fix(ttet,grd,gbc,0,n++,3,1);
// Number of Tetrahedral parameters required
fix(new JLabel("No. of tetrahedral params:",JLabel.LEFT),grd,gbc,0,n,2,1);
tntet = new JTextField(8);
tntet.setForeground(art.scrf);
tntet.setBackground(art.scrn);
fix(tntet,grd,gbc,2,n++,1,1);
// Global potential energy parameters selection
tglob=new JCheckBox("Gobal PE parameters required?");
tglob.setForeground(art.fore);
tglob.setBackground(art.back);
fix(tglob,grd,gbc,0,n++,3,1);
// Global potential energy scale factor
fix(new JLabel("Global PE scale factor:",JLabel.LEFT),grd,gbc,0,n,2,1);
tglbscl = new JTextField(8);
tglbscl.setForeground(art.scrf);
tglbscl.setBackground(art.scrn);
fix(tglbscl,grd,gbc,2,n++,1,1);
// Local potential energy parameters selection
tloc=new JCheckBox("Local PE parameters required?");
tloc.setForeground(art.fore);
tloc.setBackground(art.back);
fix(tloc,grd,gbc,0,n++,3,1);
// Local potential energy scale factor
fix(new JLabel("Local PE scale factor:",JLabel.LEFT),grd,gbc,0,n,2,1);
tlocscl = new JTextField(8);
tlocscl.setForeground(art.scrf);
tlocscl.setBackground(art.scrn);
fix(tlocscl,grd,gbc,2,n++,1,1);
fix(new JLabel(" ",JLabel.LEFT),grd,gbc,0,n++,1,1);
// Gaussian potential deposition interval
fix(new JLabel("Gaussian deposition interval:",JLabel.LEFT),grd,gbc,0,n,2,1);
metstp = new JTextField(8);
metstp.setForeground(art.scrf);
metstp.setBackground(art.scrn);
fix(metstp,grd,gbc,2,n++,1,1);
// Height of Gaussian potentials
fix(new JLabel("Gaussian height:",JLabel.LEFT),grd,gbc,0,n,2,1);
gheight = new JTextField(8);
gheight.setForeground(art.scrf);
gheight.setBackground(art.scrn);
fix(gheight,grd,gbc,2,n++,1,1);
// Width of Gaussian potentials
fix(new JLabel("Gaussian width",JLabel.LEFT),grd,gbc,0,n,2,1);
gwidth = new JTextField(8);
gwidth.setForeground(art.scrf);
gwidth.setBackground(art.scrn);
fix(gwidth,grd,gbc,2,n++,1,1);
//Gaussian control parameter
fix(new JLabel("Gaussian control key:",JLabel.LEFT),grd,gbc,0,n,2,1);
ghkey = new JTextField(8);
ghkey.setForeground(art.scrf);
ghkey.setBackground(art.scrn);
fix(ghkey,grd,gbc,2,n++,1,1);
// Well tempered dynamics control key
fix(new JLabel("WTD control parameter",JLabel.LEFT),grd,gbc,0,n,2,1);
twtdt = new JTextField();
twtdt.setForeground(art.scrf);
twtdt.setBackground(art.scrn);
fix(twtdt,grd,gbc,2,n++,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,0,n++,1,1);
// Register action buttons
close.addActionListener(this);
}
public MetaDyn(MakeControl here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
home=here;
job=new MetaDyn();
job.pack();
job.setVisible(true);
setParams();
}
void setParams() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
// set panel
tncolv.setText(String.valueOf(ncolvar));
tstein.setSelected(lstein);
tnq4.setText(String.valueOf(nq4));
tnq6.setText(String.valueOf(nq6));
ttet.setSelected(ltet);
tntet.setText(String.valueOf(ntet));
tglob.setSelected(lglobpe);
tglbscl.setText(String.valueOf(globpe_scale));
tloc.setSelected(llocpe);
tlocscl.setText(String.valueOf(locpe_scale));
metstp.setText(String.valueOf(meta_step_int));
gheight.setText(String.valueOf(ref_w_aug));
gwidth.setText(String.valueOf(h_aug));
ghkey.setText(String.valueOf(hkey));
twtdt.setText(String.valueOf(wt_dt));
}
void getParams(){
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
lmetd=true;
ncolvar=BML.giveInteger(tncolv.getText(),1);
lstein=tstein.isSelected();
nq4=BML.giveInteger(tnq4.getText(),1);
nq6=BML.giveInteger(tnq6.getText(),1);
ltet=ttet.isSelected();
ntet=BML.giveInteger(tntet.getText(),1);
lglobpe=tglob.isSelected();
globpe_scale=BML.giveDouble(tglbscl.getText(),1);
llocpe=tloc.isSelected();
locpe_scale=BML.giveDouble(tlocscl.getText(),1);
meta_step_int=BML.giveInteger(metstp.getText(),1);
ref_w_aug=BML.giveDouble(gheight.getText(),1);
h_aug=BML.giveDouble(gwidth.getText(),1);
hkey=BML.giveInteger(ghkey.getText(),1);
wt_dt=BML.giveDouble(twtdt.getText(),1);
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Close")) {
byebye();
}
}
void byebye() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
getParams();
home.metd=null;
job.setVisible(false);
}
}
| dlpolyquantum/dlpoly_quantum | java/MetaDyn.java |
249,021 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class SokPlot extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java GUI class to plot structure factots
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
public static SokPlot job;
private static GUI home;
private static String name1,name2,title;
private static int npnts;
private static double[] xx,yy;
private static JTextField atom1,atom2,rdfdat;
private static JButton plot,close;
// Define the Graphical User Interface
public SokPlot() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
setTitle("S(k) Plotter");
getContentPane().setBackground(art.back);
getContentPane().setForeground(art.fore);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Define the Plot button
plot = new JButton("Plot");
plot.setBackground(art.butn);
plot.setForeground(art.butf);
fix(plot,grd,gbc,0,0,1,1);
fix(new JLabel(" "),grd,gbc,1,0,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,2,0,1,1);
// Instruction label 1
JLabel lab1 = new JLabel("Input file:",JLabel.LEFT);
fix(lab1,grd,gbc,0,1,3,1);
// Name of first atom type
rdfdat = new JTextField(18);
rdfdat.setBackground(art.scrn);
rdfdat.setForeground(art.scrf);
fix(rdfdat,grd,gbc,0,2,3,1);
// Instruction label 2
JLabel lab2 = new JLabel("Atomic names:",JLabel.LEFT);
fix(lab2,grd,gbc,0,3,3,1);
// Name of first atom type
atom1 = new JTextField(8);
atom1.setBackground(art.scrn);
atom1.setForeground(art.scrf);
fix(atom1,grd,gbc,0,4,1,1);
// Name of second atom type
atom2 = new JTextField(8);
atom2.setBackground(art.scrn);
atom2.setForeground(art.scrf);
fix(atom2,grd,gbc,2,4,1,1);
// Register action buttons
plot.addActionListener(this);
close.addActionListener(this);
}
public SokPlot(GUI here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
home=here;
println("Activated panel for plotting S(k)");
job=new SokPlot();
job.pack();
job.setVisible(true);
npnts=0;
name1="Name1";
name2="Name2";
fname="RDFDAT";
atom1.setText(name1);
atom2.setText(name2);
rdfdat.setText(fname);
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Plot")) {
name1=atom1.getText();
name2=atom2.getText();
fname=rdfdat.getText();
npnts=rdsok(fname,name1,name2);
if(npnts>0) {
if(graf != null)
graf.job.dispose();
graf=new GraphDraw(home);
sokXY(npnts,name1,name2);
graf.xlabel.setText("k (1/A)");
graf.ylabel.setText("S(k)");
graf.plabel.setText("S(k) of "+name1.trim()+" - "+name2.trim());
graf.extraPlot(npnts,xx,yy);
}
}
else if (arg.equals("Close")) {
job.dispose();
}
}
int rdsok(String fname,String atnam1,String atnam2) {
/*
*********************************************************************
dl_poly/java routine to read a DL_POLY RDFDAT file
copyright - daresbury laboratory
author - w.smith february 2001
*********************************************************************
*/
int nrdfs,npts;
double delr;
boolean found=false;
String record,anam1,anam2;
try {
LineNumberReader lnr = new LineNumberReader(new FileReader(fname));
println("Reading file: "+fname);
title = lnr.readLine();
println("File header record: "+title);
record = lnr.readLine();
nrdfs=BML.giveInteger(record,1);
npts=BML.giveInteger(record,2);
xx=new double[4*npts];
yy=new double[4*npts];
OUT:
for(int n=0;n<nrdfs;n++) {
record=lnr.readLine();
anam1=BML.giveWord(record,1);
anam2=BML.giveWord(record,2);
for(int i=0;i<npts;i++) {
record=lnr.readLine();
xx[i]=BML.giveDouble(record,1);
yy[i]=BML.giveDouble(record,2);
}
if((atnam1.equals(anam1) && atnam2.equals(anam2)) ||
(atnam1.equals(anam2) && atnam2.equals(anam1))) {
found=true;
break OUT;
}
}
if(!found) {
println("Error - required RDF not found in file "+fname);
lnr.close();
return -1;
}
lnr.close();
}
catch(FileNotFoundException e) {
println("Error - file not found: " + fname);
return -2;
}
catch(Exception e) {
println("Error reading file: " + fname + " "+e);
return -3;
}
println("Number of points loaded:"+BML.fmt(npts,6));
// Calculate radial Fourier transform of RDF
npts--;
for(int i=0;i<npts;i++) {
xx[i]=0.5*(xx[i]+xx[i+1]);
yy[i]=0.5*(yy[i]+yy[i+1])-1.0;
}
yy[npts-1]*=0.5;
for(int i=npts;i<4*npts;i++) {
yy[i]=0.0;
}
delr=(xx[npts-1]-xx[0])/(npts-1);
npts*=4;
radfft(1,npts,delr,xx,yy);
return npts;
}
void sokXY(int npts,String anam1,String anam2) {
/*
*********************************************************************
dl_poly/java GUI routine to create a S(k) XY file
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String fname;
String[] header;
int nhead=4,call;
header=new String[nhead];
fname="SOK"+String.valueOf(numsok)+".XY";
numsok++;
header[0]=" S(k) Plotting Program";
header[1]=" S(k) Plot: "+anam1.trim()+" + "+anam2.trim();
header[2]=" Radius (A)";
header[3]=" S(k)";
call=putXY(fname,header,nhead,npts,xx,yy);
if(call==0)
println("PLOT file "+fname+" created");
}
void radfft(int isw,int nnn,double delr,double aaa[],double bbb[]) {
/*
***********************************************************************
dl_poly/java 3D radial fourier transform routine using lado's method
reference: j. comput. phys. 8 (1971) 417
copyright - daresbury laboratory
author - w.smith february 2001
note: first data point is delr not 0
***********************************************************************
*/
double sw,delk;
// perform fourier transform
sw=isw*Math.PI/nnn;
for(int j=0;j<nnn;j++) {
aaa[j]=0.0;
for(int i=0;i<nnn;i++) {
aaa[j]=(i+1)*bbb[i]*Math.sin(sw*(j+1)*(i+1))+aaa[j];
}
aaa[j]=(4.0*nnn*Math.pow(delr,3)/(j+1))*aaa[j];
}
delk=Math.PI/(delr*nnn);
for(int i=0;i<nnn;i++) {
bbb[i]=aaa[i];
aaa[i]=delk*(i+1);
}
}
}
| dlpolyquantum/dlpoly_quantum | java/SokPlot.java |
249,023 | package avl;
/*
* Range
*
* - Feb 1, 2006
*
* Copyright (c) 2003 Kansas State University, Laboratory for the Specification,
* Analysis, and Transformation of Software
*
* This software is licensed under the SAnToS Laboratory Open Academic License. You
* should have received a copy of the license with the distribution. A copy can be
* found at:
* http://www.cis.ksu.edu/santos/license.shtml
* or you can contact the lab at:
* SAnToS Laboratory
* 234 Nichols Hall
* Manhattan, KS 66506, USA
*/
public class Range {
final int lower;
final int upper;
final boolean isPositiveInfinity;
final boolean isNegativeInfinity;
public Range() {
this(0,0,true,true);
}
private Range(int u,int l, boolean ip, boolean in) {
this.upper = u;
this.lower = l;
this.isPositiveInfinity=ip;
this.isNegativeInfinity=in;
}
public boolean inRange(int value) {
boolean ret=true;
if(!isPositiveInfinity) {
ret = value < upper;
}
if(!isNegativeInfinity) {
ret = ret && (value > lower);
}
return ret;
}
public Range setLower(int l) {
//STUB BEGIN
//commented out because it creates spurious branches
//assert isNegativeInfinity || (l>lower);
//STUB END
return new Range(upper,l,isPositiveInfinity,false);
}
public Range setUpper(int u) {
//STUB BEGIN
//commented out because it creates spurious branches
//assert isPositiveInfinity || (u<upper);
//STUB END
return new Range(u,lower,false,isNegativeInfinity);
}
}
| pietrobraione/sushi-experiments | src/avl/Range.java |
249,026 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class HyperDyn extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java Bias Potential Dynamics class
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
private static MakeControl home;
private static HyperDyn job;
private static JTextField tebias,tvmin,target,block,black,tdelt;
private static JTextField ttlow,track,tcatch,spring,opttol,nnebs;
private static JTextField basin1,basin2;
private static JComboBox<String> hypopt,tunits,optkey;
private static JCheckBox tgoneb,tpath;
private static JButton close;
// Define the Graphical User Interface
public HyperDyn() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
super();
setTitle("Hyperdynamics");
int n=0;
getContentPane().setForeground(art.fore);
getContentPane().setBackground(art.back);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Panel label
fix(new JLabel("Select options:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// Hyperdynamics options
fix(new JLabel("Hyperdynamics options:",JLabel.LEFT),grd,gbc,0,n,2,1);
hypopt = new JComboBox<String>();
hypopt.setForeground(art.scrf);
hypopt.setBackground(art.scrn);
hypopt.addItem("None");
hypopt.addItem("BPD");
hypopt.addItem("TAD");
hypopt.addItem("NEB");
fix(hypopt,grd,gbc,2,n++,1,1);
fix(new JLabel(" ",JLabel.LEFT),grd,gbc,0,n++,3,1);
fix(new JLabel("Controls common to BPD, TAD & NEB:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// Energy units
fix(new JLabel("Energy Units:",JLabel.LEFT),grd,gbc,0,n,2,1);
tunits = new JComboBox<String>();
tunits.setForeground(art.scrf);
tunits.setBackground(art.scrn);
tunits.addItem("DL_POLY");
tunits.addItem("e_volt");
tunits.addItem("k_cal");
tunits.addItem("k_joule");
tunits.addItem("Kelvin");
fix(tunits,grd,gbc,2,n++,1,1);
// NEB spring force constant
fix(new JLabel("Spring force Constant",JLabel.LEFT),grd,gbc,0,n,2,1);
spring = new JTextField(8);
spring.setForeground(art.scrf);
spring.setBackground(art.scrn);
fix(spring,grd,gbc,2,n++,1,1);
// Minimisation control option
fix(new JLabel("Minimise Option:",JLabel.LEFT),grd,gbc,0,n,2,1);
optkey = new JComboBox<String>();
optkey.setForeground(art.scrf);
optkey.setBackground(art.scrn);
optkey.addItem("Force");
optkey.addItem("Energy");
optkey.addItem("Position");
fix(optkey,grd,gbc,2,n++,1,1);
//Minimisation control tolerance
fix(new JLabel("Minimise Tolerance:",JLabel.LEFT),grd,gbc,0,n,2,1);
opttol = new JTextField(8);
opttol.setForeground(art.scrf);
opttol.setBackground(art.scrn);
fix(opttol,grd,gbc,2,n++,1,1);
fix(new JLabel(" ",JLabel.LEFT),grd,gbc,0,n++,3,1);
fix(new JLabel("Controls common to BPD & TAD only:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// Block interval between minimisations
fix(new JLabel("Block Interval:",JLabel.LEFT),grd,gbc,0,n,2,1);
block = new JTextField(8);
block.setForeground(art.scrf);
block.setBackground(art.scrn);
fix(block,grd,gbc,2,n++,1,1);
// Interval between tracking configurations
fix(new JLabel("Tracking Interval:",JLabel.LEFT),grd,gbc,0,n,2,1);
track = new JTextField(8);
track.setForeground(art.scrf);
track.setBackground(art.scrn);
fix(track,grd,gbc,2,n++,1,1);
// Catch radius for transitions
fix(new JLabel("Catch Radius:",JLabel.LEFT),grd,gbc,0,n,2,1);
tcatch = new JTextField(8);
tcatch.setForeground(art.scrf);
tcatch.setBackground(art.scrn);
fix(tcatch,grd,gbc,2,n++,1,1);
fix(new JLabel(" ",JLabel.LEFT),grd,gbc,0,n++,3,1);
fix(new JLabel("Controls specific to BPD only:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// BPD path or just dynamics
tpath=new JCheckBox("BPD Path required?");
tpath.setForeground(art.fore);
tpath.setBackground(art.back);
fix(tpath,grd,gbc,0,n++,3,1);
// Name of target atom type
fix(new JLabel("Target Atom Name:",JLabel.LEFT),grd,gbc,0,n,2,1);
target = new JTextField(8);
target.setForeground(art.scrf);
target.setBackground(art.scrn);
fix(target,grd,gbc,2,n++,1,1);
// Bias potential
fix(new JLabel("Potential Bias:",JLabel.LEFT),grd,gbc,0,n,2,1);
tebias = new JTextField(8);
tebias.setForeground(art.scrf);
tebias.setBackground(art.scrn);
fix(tebias,grd,gbc,2,n++,1,1);
// Bias potential minimum
fix(new JLabel("Minimum Bias:",JLabel.LEFT),grd,gbc,0,n,2,1);
tvmin = new JTextField(8);
tvmin.setForeground(art.scrf);
tvmin.setBackground(art.scrn);
fix(tvmin,grd,gbc,2,n++,1,1);
// NEB calculation selection
tgoneb=new JCheckBox("NEB Calculation required?");
tgoneb.setForeground(art.fore);
tgoneb.setBackground(art.back);
fix(tgoneb,grd,gbc,0,n++,3,1);
fix(new JLabel(" ",JLabel.LEFT),grd,gbc,0,n++,3,1);
fix(new JLabel("Controls specific to TAD only:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// Blackout period
fix(new JLabel("Blackout Period:",JLabel.LEFT),grd,gbc,0,n,2,1);
black = new JTextField(8);
black.setForeground(art.scrf);
black.setBackground(art.scrn);
fix(black,grd,gbc,2,n++,1,1);
// Deltad control parameter
fix(new JLabel("Deltad Parameter:",JLabel.LEFT),grd,gbc,0,n,2,1);
tdelt = new JTextField(8);
tdelt.setForeground(art.scrf);
tdelt.setBackground(art.scrn);
fix(tdelt,grd,gbc,2,n++,1,1);
// Low temperature target
fix(new JLabel("Target Low Temp.:",JLabel.LEFT),grd,gbc,0,n,2,1);
ttlow = new JTextField(8);
ttlow.setForeground(art.scrf);
ttlow.setBackground(art.scrn);
fix(ttlow,grd,gbc,2,n++,1,1);
fix(new JLabel(" ",JLabel.LEFT),grd,gbc,0,n++,3,1);
fix(new JLabel("Controls specific to NEB only:",JLabel.LEFT),grd,gbc,0,n++,3,1);
// Required number of NEB calculations
fix(new JLabel("Number of NEB Calcs.:",JLabel.LEFT),grd,gbc,0,n,2,1);
nnebs = new JTextField(8);
nnebs.setForeground(art.scrf);
nnebs.setBackground(art.scrn);
fix(nnebs,grd,gbc,2,n++,1,1);
// NEB start basins
fix(new JLabel("Basins 1:",JLabel.LEFT),grd,gbc,0,n,2,1);
basin1 = new JTextField(8);
basin1.setForeground(art.scrf);
basin1.setBackground(art.scrn);
fix(basin1,grd,gbc,2,n++,1,1);
// NEB end basins
fix(new JLabel("Basins 2:",JLabel.LEFT),grd,gbc,0,n,2,1);
basin2 = new JTextField(8);
basin2.setForeground(art.scrf);
basin2.setBackground(art.scrn);
fix(basin2,grd,gbc,2,n++,1,1);
fix(new JLabel(" ",JLabel.LEFT),grd,gbc,0,n++,3,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,0,n++,1,1);
// Register action buttons
close.addActionListener(this);
}
public HyperDyn(MakeControl here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
home=here;
job=new HyperDyn();
job.pack();
job.setVisible(true);
setParams();
}
void setParams() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
// set panel
hypopt.setSelectedIndex(hyp_key);
tunits.setSelectedIndex(hyp_units_key);
spring.setText(String.valueOf(neb_spring));
optkey.setSelectedIndex(hyp_opt_key);
opttol.setText(String.valueOf(hyp_opt_tol));
block.setText(String.valueOf(num_block));
track.setText(String.valueOf(num_track));
tcatch.setText(String.valueOf(catch_radius));
tpath.setSelected(bpdpath);
target.setText(String.valueOf(hyp_target));
tebias.setText(String.valueOf(ebias));
tvmin.setText(String.valueOf(vmin));
tgoneb.setSelected(goneb);
black.setText(String.valueOf(num_black));
tdelt.setText(String.valueOf(deltad));
ttlow.setText(String.valueOf(low_temp));
nnebs.setText(String.valueOf(num_neb));
basin1.setText(basin_1);
basin2.setText(basin_2);
}
void getParams(){
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
lhyp=true;
hyp_key=hypopt.getSelectedIndex();
hyp_units_key=tunits.getSelectedIndex();
neb_spring=BML.giveDouble(spring.getText(),1);
hyp_opt_key=optkey.getSelectedIndex();
hyp_opt_tol=BML.giveDouble(opttol.getText(),1);
num_block=BML.giveInteger(block.getText(),1);
num_track=BML.giveInteger(track.getText(),1);
catch_radius=BML.giveDouble(tcatch.getText(),1);
bpdpath=tpath.isSelected();
hyp_target=target.getText();
ebias=BML.giveDouble(tebias.getText(),1);
vmin=BML.giveDouble(tvmin.getText(),1);
goneb=tgoneb.isSelected();
num_black=BML.giveInteger(black.getText(),1);
deltad=BML.giveDouble(tdelt.getText(),1);
low_temp=BML.giveDouble(ttlow.getText(),1);
num_neb=BML.giveInteger(nnebs.getText(),1);
basin_1=basin1.getText();
basin_2=basin2.getText();
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Close")) {
byebye();
}
}
void byebye() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
getParams();
home.hyp=null;
job.setVisible(false);
}
}
| dlpolyquantum/dlpoly_quantum | java/HyperDyn.java |
249,027 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class HovePlot extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java GUI class to plot van Hove correlation functions
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
public static HovePlot job;
private static GUI home;
private static String name1,name2,title,hname;
private static double[] xx,yy;
private static int npnts,nseq;
private static JTextField seqno,hovefile;
private static JCheckBox dens;
private static JButton plot,close;
private static boolean ldens;
private static double time;
// Define the Graphical User Interface
public HovePlot() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
setTitle("van Hove Plotter");
getContentPane().setBackground(art.back);
getContentPane().setForeground(art.fore);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Define the Plot button
plot = new JButton(" Plot ");
plot.setBackground(art.butn);
plot.setForeground(art.butf);
fix(plot,grd,gbc,0,0,1,1);
fix(new JLabel(" "),grd,gbc,1,0,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,2,0,1,1);
// Name of van Hove data file
JLabel lab0 = new JLabel("van Hove plot file:",JLabel.LEFT);
fix(lab0,grd,gbc,0,1,2,1);
hovefile = new JTextField(14);
hovefile.setBackground(art.scrn);
hovefile.setForeground(art.scrf);
fix(hovefile,grd,gbc,0,2,3,1);
// Function sequence number
JLabel lab1 = new JLabel("Plot sequence No.:",JLabel.LEFT);
fix(lab1,grd,gbc,0,3,2,1);
seqno = new JTextField(5);
seqno.setBackground(art.scrn);
seqno.setForeground(art.scrf);
fix(seqno,grd,gbc,2,3,1,1);
// Radial density option
JLabel lab2 = new JLabel("Radial density opt.:",JLabel.LEFT);
fix(lab2,grd,gbc,0,4,2,1);
dens = new JCheckBox(" ");
dens.setBackground(art.back);
dens.setForeground(art.fore);
fix(dens,grd,gbc,2,4,1,1);
// Register action buttons
plot.addActionListener(this);
close.addActionListener(this);
}
public HovePlot(GUI here){
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
home=here;
println("Activated panel for plotting van Hove functions");
job=new HovePlot();
job.pack();
job.setVisible(true);
npnts=0;
nseq=0;
ldens=false;
hovefile.setText(null);
dens.setSelected(ldens);
seqno.setText(String.valueOf(nseq));
}
public HovePlot(GUI here,String hovename) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
home=here;
println("Activated panel for plotting van Hove functions");
job=new HovePlot();
job.pack();
job.setVisible(true);
npnts=0;
nseq=0;
ldens=false;
hovefile.setText(hovename);
dens.setSelected(ldens);
seqno.setText(String.valueOf(nseq));
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals(" Plot ")) {
hname=hovefile.getText();
if(hname.length()==0)hname=null;
nseq=BML.giveInteger(seqno.getText(),1);
ldens=dens.isSelected();
if(hname == null){
hname=selectFileNameBegins(home,"HOVG");
println("File selected is "+hname+hname.toUpperCase().indexOf("HOVGSL"));
}
if(hname != null) {
npnts=rdhove(ldens,nseq);
if(npnts>0) {
hovXY(npnts,name1,name2);
if(graf != null)
graf.job.dispose();
graf=new GraphDraw(home);
graf.xlabel.setText("Radius (A)");
if(hname.toUpperCase().indexOf("HOVGSL")>=0) {
graf.ylabel.setText("Gs(r,t)");
graf.plabel.setText("Gs(r,t) of "+name1.trim()+" - "+name2.trim()+" at"+BML.fmt(time,8)+" ps");
graf.extraPlot(npnts,xx,yy);
}
else if(hname.toUpperCase().indexOf("HOVGDF")>=0) {
graf.ylabel.setText("Gd(r,t)");
graf.plabel.setText("Gd(r,t) of "+name1.trim()+" - "+name2.trim()+" at"+BML.fmt(time,8)+" ps");
graf.extraPlot(npnts,xx,yy);
}
else
println("Error nominated file not van Hove data file");
}
}
}
else if (arg.equals("Close")) {
job.dispose();
}
}
int rdhove(boolean lden,int nseq) {
/*
*********************************************************************
dl_poly/java routine to read a DL_POLY van Hove Data file
copyright - daresbury laboratory
author - w.smith march 2001
*********************************************************************
*/
int nhovs,npts;
String record;
try {
LineNumberReader lnr = new LineNumberReader(new FileReader(hname));
println("Reading file: "+hname);
title = lnr.readLine();
println("File header record: "+title);
record = lnr.readLine();
name1=BML.giveWord(record,1);
name2=BML.giveWord(record,2);
record = lnr.readLine();
nhovs=BML.giveInteger(record,1);
npts=BML.giveInteger(record,2);
xx=new double[npts];
yy=new double[npts];
if(nseq>nhovs) {
println("Error - requested function not present in file");
lnr.close();
return -1;
}
OUT:
for(int n=0;n<nhovs;n++) {
record=lnr.readLine();
time=BML.giveDouble(record,2);
for(int i=0;i<npts;i++) {
record=lnr.readLine();
xx[i]=BML.giveDouble(record,1);
yy[i]=BML.giveDouble(record,2);
}
if(n==nseq) {
break OUT;
}
}
lnr.close();
}
catch(FileNotFoundException e) {
println("Error - file not found: " + hname);
return -2;
}
catch(Exception e) {
println("Error reading file: " + hname + " "+e);
return -3;
}
println("Number of points ploted:"+BML.fmt(npts,6));
// activate radial density option
if(lden) {
for(int i=0;i<npts;i++)
yy[i]*=(4.0*Math.PI*Math.pow(xx[i],2));
}
return npts;
}
void hovXY(int npts,String anam1,String anam2) {
/*
*********************************************************************
dl_poly/java GUI routine to create a van Hove XY file
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String gname;
String[] header;
int nhead=4,call;
header=new String[nhead];
gname="HOV"+String.valueOf(numhov)+".XY";
numhov++;
header[0]=" van Hove Plotting Program";
header[2]=" Radius (A)";
if(hname.toUpperCase().indexOf("HOVGSL")>=0) {
header[1]=" Gs(r,t) Plot: "+anam1.trim()+" at"+BML.fmt(time,8)+" ps";
header[3]=" Gs(r,t)";
}
else {
header[1]=" Gd(r,t) Plot: "+anam1.trim()+"+"+anam2.trim()+" at"+BML.fmt(time,8)+" ps";
header[3]=" Gd(r,t)";
}
call=putXY(gname,header,nhead,npts,xx,yy);
if(call==0)
println("PLOT file "+gname+" created");
}
}
| dlpolyquantum/dlpoly_quantum | java/HovePlot.java |
249,028 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class ZdenPlot extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java GUI class to plot z-densities
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
public static ZdenPlot job;
private static GUI home;
private static String name,title;
private static int npnts;
private static JTextField atom,zdndat;
private static JButton plot,close;
private static double[] xx,yy;
// Define the Graphical User Interface
public ZdenPlot() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
setTitle("Z-Density Plotter");
getContentPane().setBackground(art.back);
getContentPane().setForeground(art.fore);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Define the Plot button
plot = new JButton(" Plot ");
plot.setBackground(art.butn);
plot.setForeground(art.butf);
fix(plot,grd,gbc,0,0,1,1);
fix(new JLabel(" "),grd,gbc,1,0,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,2,0,1,1);
// Name of ZDNDAT file
JLabel lab1 = new JLabel("Required ZDNDAT file:",JLabel.LEFT);
fix(lab1,grd,gbc,0,1,3,1);
zdndat = new JTextField(12);
zdndat.setBackground(art.scrn);
zdndat.setForeground(art.scrf);
fix(zdndat,grd,gbc,0,2,3,1);
// Name of atom
JLabel lab2 = new JLabel("Atom name: ",JLabel.LEFT);
fix(lab2,grd,gbc,0,3,1,1);
atom = new JTextField(8);
atom.setBackground(art.scrn);
atom.setForeground(art.scrf);
fix(atom,grd,gbc,2,3,1,1);
// Register action buttons
plot.addActionListener(this);
close.addActionListener(this);
}
public ZdenPlot(GUI here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
home=here;
println("Activated panel for plotting Z-density");
job=new ZdenPlot();
job.pack();
job.setVisible(true);
npnts=0;
name="Name";
fname="ZDNDAT";
atom.setText(name);
zdndat.setText(fname);
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Plot")) {
name=atom.getText();
fname=zdndat.getText();
npnts=rdzden(fname,name);
if(npnts>0) {
zdenXY(npnts,name);
if(graf != null)
graf.job.dispose();
graf=new GraphDraw(home);
graf.xlabel.setText("Z-Distance (A)");
graf.ylabel.setText("D(z)");
graf.plabel.setText("Z-Density of "+name.trim());
graf.extraPlot(npnts,xx,yy);
}
}
else if (arg.equals("Close")) {
job.dispose();
}
}
int rdzden(String fname,String atnam1) {
/*
*********************************************************************
dl_poly/java routine to read a DL_POLY ZDNDAT file
copyright - daresbury laboratory
author - w.smith march 2001
*********************************************************************
*/
int nzdens,npts;
boolean found=false;
String record,anam1="";
try {
LineNumberReader lnr = new LineNumberReader(new FileReader(fname));
println("Reading file: "+fname);
title = lnr.readLine();
println("File header record: "+title);
record = lnr.readLine();
nzdens=BML.giveInteger(record,1);
npts=BML.giveInteger(record,2);
xx=new double[npts];
yy=new double[npts];
OUT:
for(int n=0;n<nzdens;n++) {
record=lnr.readLine();
anam1=BML.giveWord(record,1);
for(int i=0;i<npts;i++) {
record=lnr.readLine();
xx[i]=BML.giveDouble(record,1);
yy[i]=BML.giveDouble(record,2);
}
if(atnam1.equals(anam1)) {
found=true;
break OUT;
}
}
if(!found) {
println("Error - required Z-Density not found in file "+fname);
lnr.close();
return -1;
}
lnr.close();
}
catch(FileNotFoundException e) {
println("Error - file not found: " + fname);
return -2;
}
catch(Exception e) {
println("Error reading file: " + fname + " "+e);
return -3;
}
println("Number of points loaded:"+BML.fmt(npts,6));
return npts;
}
void zdenXY(int npts,String aname) {
/*
*********************************************************************
dl_poly/java GUI routine to create a Z-Density XY file
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String fname;
String[] header;
int nhead=4,call;
header=new String[nhead];
fname="Zden"+String.valueOf(numzdn)+".XY";
numzdn++;
header[0]=" Z-Density Plotting Program";
header[1]=" Z-Density Plot: "+aname.trim();
header[2]=" Z-Distance (A)";
header[3]=" D(z)";
call=putXY(fname,header,nhead,npts,xx,yy);
if(call==0)
println("PLOT file "+fname+" created");
}
}
| dlpolyquantum/dlpoly_quantum | java/ZdenPlot.java |
249,029 | import java.util.Date;
// via ocw, http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-170-laboratory-in-software-engineering-fall-2005/lecture-notes/lec8.pdf
public class IntervalFixed {
private final Date start, stop;
private final long duration;
public IntervalFixed(Date start, Date stop) {
this.start = new Date(start.getTime());
this.stop = new Date(stop.getTime());
duration = stop.getTime() - start.getTime();
}
public Date getStart() {
return new Date(start.getTime());
}
public Date getStop() {
return new Date(stop.getTime());
}
public long getDuration() {
return duration;
}
}
| mit6005/F12-R05 | IntervalFixed.java |
249,030 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class Execute extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java GUI class to control DL_POLY execution
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
private static GUI home;
private static double time0,time1;
public static Execute job;
private static JTextField task;
private static JButton exec,stat,zapp,updt,dlte,ctrl,fild,cnfg,tabl,close;
private static WarningBox danger=null;
// Define the Graphical User Interface
public Execute() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
super();
setTitle("Run DL_POLY");
getContentPane().setBackground(art.back);
getContentPane().setForeground(art.fore);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
int n=0;
// Run button
exec = new JButton("Run");
exec.setBackground(art.butn);
exec.setForeground(art.butf);
fix(exec,grd,gbc,0,n,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,1,n++,1,1);
// Describe the run command
fix(new JLabel("Current run command:"),grd,gbc,0,n++,2,1);
task=new JTextField();
task.setBackground(art.scrn);
task.setForeground(art.scrf);
fix(task,grd,gbc,0,n,2,1);
// Input file selection
fix(new JLabel("Select required input files:"),grd,gbc,0,n++,2,1);
// Select the CONTROL file
ctrl = new JButton("CONTROL");
ctrl.setBackground(art.butn);
ctrl.setForeground(art.butf);
fix(ctrl,grd,gbc,0,n,1,1);
// Select the CONFIG file
cnfg = new JButton("CONFIG");
cnfg.setBackground(art.butn);
cnfg.setForeground(art.butf);
fix(cnfg,grd,gbc,1,n++,1,1);
// Select the FIELD file
fild = new JButton("FIELD");
fild.setBackground(art.butn);
fild.setForeground(art.butf);
fix(fild,grd,gbc,0,n,1,1);
// Select the TABLE file
tabl = new JButton("TABLE");
tabl.setBackground(art.butn);
tabl.setForeground(art.butf);
fix(tabl,grd,gbc,1,n++,1,1);
// Job monitoring options
fix(new JLabel("Job monitoring options:"),grd,gbc,0,n++,2,1);
// Kill job
zapp = new JButton("Kill");
zapp.setBackground(art.butn);
zapp.setForeground(art.butf);
fix(zapp,grd,gbc,0,n,1,1);
// Job status
stat = new JButton("Status");
stat.setBackground(art.butn);
stat.setForeground(art.butf);
fix(stat,grd,gbc,1,n++,1,1);
// File handling options
fix(new JLabel("File handling options:"),grd,gbc,0,n++,2,1);
// Clear data files
dlte = new JButton("Clear");
dlte.setBackground(art.butn);
dlte.setForeground(art.butf);
fix(dlte,grd,gbc,0,n,1,1);
// Update data files
updt = new JButton("Update");
updt.setBackground(art.butn);
updt.setForeground(art.butf);
fix(updt,grd,gbc,1,n++,1,1);
// Register action buttons
exec.addActionListener(this);
ctrl.addActionListener(this);
cnfg.addActionListener(this);
fild.addActionListener(this);
tabl.addActionListener(this);
updt.addActionListener(this);
zapp.addActionListener(this);
dlte.addActionListener(this);
stat.addActionListener(this);
close.addActionListener(this);
}
public Execute(GUI here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
home=here;
println("Activated DL_POLY Execute panel");
job=new Execute();
job.pack();
if(executable==null)
executable=new String(defaultexecutable);
task.setText(executable);
job.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
String fname;
String arg = (String)e.getActionCommand();
if (arg.equals("Run")) {
try {
if(proc == null) {
executable=task.getText();
if(!(new File(executable)).exists()) {
println("Error - "+executable+" program not available");
}
else {
time0=(double)System.currentTimeMillis();
proc=Runtime.getRuntime().exec(executable+" &");
println(executable+" job submitted: "+String.valueOf(proc));
}
}
else {
println("Error - "+executable+" job already running");
}
}
catch(IOException ee) {
println("Error - "+executable+" job submission failure");
}
}
else if (arg.equals("Close")) {
job.dispose();
}
else if (arg.equals("CONTROL")) {
println("Select required CONTROL file");
if((fname=selectFileNameBegins(home,"CNT"))!=null) {
if(!fname.endsWith("CONTROL")){
if(copyFile(fname,"CONTROL"))
println("Control file selected");
} else {
println("CONTROL file already selected");
}
}
else
println("No file selected");
}
else if (arg.equals("CONFIG")) {
println("Select required CONFIG file");
if((fname=selectFileNameBegins(home,"CFG"))!=null) {
if(!fname.endsWith("CONFIG")){
if(copyFile(fname,"CONFIG"))
println("CONFIG file selected");
} else {
println("CONFIG file already selected");
}
}
else
println("No file selected");
}
else if (arg.equals("FIELD")) {
println("Select required FIELD file");
if((fname=selectFileNameBegins(home,"FLD"))!=null) {
if(!fname.endsWith("FIELD")){
if(copyFile(fname,"FIELD"))
println("FIELD file selected");
} else {
println("FIELD file already selected");
}
}
else
println("No file selected");
}
else if (arg.equals("TABLE")) {
println("Select required TABLE file");
if((fname=selectFileNameBegins(home,"TAB"))!=null) {
if(!fname.endsWith("TABLE")){
if(copyFile(fname,"TABLE"))
println("TABLE file selected");
} else {
println("TABLE file already selected");
}
}
else
println("No file selected");
}
else if (arg.equals("Kill") && proc != null) {
println("Cancelling "+executable+" job: "+String.valueOf(proc));
proc.destroy();
proc=null;
println(executable+" job cancelled");
}
else if (arg.equals("Status") && proc != null) {
try {
int state=proc.exitValue();
if(state==0)
println(executable+" has terminated normally");
else
println(executable+" has terminated abnormally");
proc=null;
}
catch(IllegalThreadStateException ee) {
time1=((double)System.currentTimeMillis()-time0)/1000.;
println(executable+" job is running. Elapsed time (s)= "+BML.fmt(time1,9));
}
}
else if (arg.equals("Clear")) {
println("About to delete all current DL_POLY I/O files");
danger=new WarningBox(home,"Warning!",true);
danger.setVisible(true);
if(alert)
wipeOutFiles();
else
println("Operation cancelled");
}
else if (arg.equals("Update")) {
println("About to overwrite some current DL_POLY I/O files");
danger=new WarningBox(home,"Warning!",true);
danger.setVisible(true);
if(alert)
updateFiles();
else
println("Operation cancelled");
}
}
void wipeOutFiles() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
File f=null;
println("Deleting all current DL_POLY I/O files .....");
if((f=new File("CONTROL")).exists()) {
f.delete();
println("File CONTROL deleted");
}
if((f=new File("CONFIG")).exists()) {
f.delete();
println("File CONFIG deleted");
}
if((f=new File("FIELD")).exists()) {
f.delete();
println("File FIELD deleted");
}
if((f=new File("TABLE")).exists()) {
f.delete();
println("File TABLE deleted");
}
if((f=new File("OUTPUT")).exists()) {
f.delete();
println("File OUTPUT deleted");
}
if((f=new File("REVCON")).exists()) {
f.delete();
println("File REVCON deleted");
}
if((f=new File("REVIVE")).exists()) {
f.delete();
println("File REVIVE deleted");
}
if((f=new File("REVOLD")).exists()) {
f.delete();
println("File REVOLD deleted");
}
if((f=new File("STATIS")).exists()) {
f.delete();
println("File STATIS deleted");
}
if((f=new File("HISTORY")).exists()) {
f.delete();
println("File HISTORY deleted");
}
println("All current DL_POLY I/O files deleted");
}
void updateFiles() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
File f=null;
println("Updating DL_POLY I/O files .....");
if((f=new File("CONFIG")).exists())
if(copyFile("CONFIG","CONFIG.BAK"))
println("CONFIG file backup taken: CONFIG.BAK");
else
println("Error CONFIG file not found");
if((f=new File("REVCON")).exists())
if(copyFile("REVCON","CONFIG"))
println("REVCON file renamed as CONFIG file");
else
println("Error REVCON file not found");
if((f=new File("REVOLD")).exists())
if(copyData("REVOLD","REVOLD.BAK"))
println("REVOLD file backup taken: REVOLD.BAK");
else
println("Error REVOLD file not found");
if((f=new File("REVIVE")).exists())
if(copyData("REVIVE","REVOLD"))
println("REVIVE file renamed as REVOLD file");
else
println("Error REVIVE file not found");
println("DL_POLY I/O files updated.");
}
}
| dlpolyquantum/dlpoly_quantum | java/Execute.java |
249,031 | import javax.swing.JFrame;
import javax.swing.*;
import java.awt.Container;
public class PhysicsLab {
public static void main(String[] args) {
PhysicsLab_GUI lab_gui = new PhysicsLab_GUI();
lab_gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
lab_gui.setVisible(true);
}
}
class PhysicsLab_GUI extends JFrame {
public PhysicsLab_GUI() {
setTitle("My Small and Nice Physics Laboratory");
setSize(MyWorldView.WIDTH+100, MyWorldView.HEIGHT+150); // height+50 to account for menu height
MyWorld world = new MyWorld();
LabMenuListener menuListener = new LabMenuListener(world);
setJMenuBar(createLabMenuBar(menuListener));
MyWorldView worldView = new MyWorldView(world);
world.setView(worldView);
add(worldView);
}
public JMenuBar createLabMenuBar(LabMenuListener menu_l) {
JMenuBar mb = new JMenuBar();
JMenu menu = new JMenu ("Configuration");
mb.add(menu);
JMenu subMenu = new JMenu("Insert");
menu.add(subMenu);
JMenuItem menuItem = new JMenuItem("Ball");
menuItem.addActionListener(menu_l);
subMenu.add(menuItem);
menuItem = new JMenuItem("Spring");
menuItem.addActionListener(menu_l);
subMenu.add(menuItem);
menuItem = new JMenuItem("Fixed Hook");
menuItem.addActionListener(menu_l);
subMenu.add(menuItem);
menuItem = new JMenuItem("Block");
menuItem.addActionListener(menu_l);
subMenu.add(menuItem);
menuItem = new JMenuItem("My scenario");
menuItem.addActionListener(menu_l);
subMenu.add(menuItem);
menu = new JMenu("MyWorld");
mb.add(menu);
menuItem = new JMenuItem("Start");
menuItem.addActionListener(menu_l);
menu.add(menuItem);
menuItem = new JMenuItem("Stop");
menuItem.addActionListener(menu_l);
menu.add(menuItem);
//Submenu Simulator
subMenu = new JMenu("Simulator");
menu.add(subMenu);
menuItem = new JMenuItem("Delta time");
menuItem.addActionListener(menu_l);
subMenu.add(menuItem);
menuItem = new JMenuItem("View Refresh time");
menuItem.addActionListener(menu_l);
subMenu.add(menuItem);
return mb;
}
}
| Lisergishnu/Brave-Disappointed-Burst | src/PhysicsLab.java |
249,033 | import java.util.Scanner;
public class hairetu {
public static void main(String[] args){
//まず、試行回数を入力させる。
Scanner scan = new Scanner(System.in);
int test = scan.nextInt();
System.out.println(test);
}
} | uruzunyaa/ContestProgramming | laboratory/hairetu.java |
249,034 | package technicals;
/*Juan Marquinho is a geologist and he needs to count rock samples in order to send it to a chemical laboratory. He has a problem: The laboratory only accepts rock samples by a range of its size in ppm (parts per million).
Juan Marquinho receives the rock samples one by one and he classifies the rock samples according to the range of the laboratory. This process is very hard because the number of rock samples may be in millions.
Juan Marquinho needs your help, your task is to develop a program to get the number of rocks in each of the ranges accepted by the laboratory.
Input Format
An positive integer S (the number of rock samples) separated by a blank space, and a positive integer R (the number of ranges of the laboratory); A list of the sizes of S samples (in ppm), as positive integers separated by space R lines where the ith line containing two positive integers, space separated, indicating the minimum size and maximum size respectively of the ith range.
Output Format
R lines where the ith line contains a single non-negative integer indicating the number of the samples which lie in the ith range.
Constraints
10 < S < 10000
1 < R < 1000000
1 size of each sample (in ppm) < 1000
Example 1
Input: 10 2
345 604 321 433 704 470 808 718 517 811
300 350
400 700
Output: 2 4
Explanation:
There are 10 samples (S) and 2 ranges ( R ). The samples are 345 604 321 433 704 470 808 718 517 811. The ranges are 300-350 and 400-700. There are 2 samples in the first range (345 and 321) and 4 samples in the second range (604, 433, 470, 517). Hence the two lines of the output are 2 and 4
Example 2
Input: 20 3
921 107 270 631 926 543 589 520 595 93 873 424 759 537 458 614 725 842 575 195
1 100
50 600
1 1000
Output: 1 12 20
Explanation:
There are 20 samples and 3 ranges. The samples are 921, 107 195. The ranges are 1-100, 50-600 and 1-1000. Note that the ranges are overlapping. The number of samples in each of the three ranges are 1, 12 and 20 respectively. Hence the three lines of the output are 1, 12 and 20.*/
import java.util.*;
public class TcsQ5 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the no. of rocks and no. range");
String x=sc.nextLine();
String[]input=x.split(" ");
int samples=Integer.parseInt(input[0]);
int range =Integer.parseInt(input[1]);
int [] ar=new int[samples];
int []c=new int[range];
int j=0;
System.out.println("Enter the size of the samples");
for(int i=0;i<ar.length;i++)
{
ar[i]=sc.nextInt();
}
sc.nextLine();
for(int i=0;i<range;i++)
{
int count=0;
System.out.println("Enter the range");
String s=sc.nextLine();
String[] r=s.split(" ");
int start=Integer.parseInt(r[0]);
int end=Integer.parseInt(r[1]);
for(int k=0;k<ar.length;k++)
{
if(ar[k]>=start && ar[k]<=end)
count++;
}
c[j++]=count;
}
System.out.println(Arrays.toString(c));
}
}
| Aritra-Basak/Java_codes | TCS_NQT_Q5.java |
249,035 | import java.io.*;
public class Structure extends Basic {
/*
*********************************************************************
dl_poly/java class to define the structure of a configuration
in terms of molecules and other components
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
public int nbnds,nunq,nrept,nshl,ntatm,nmols,nmoltp;
public int[] lbnd,msz;
public int[][] join,bond;
public Molecule[] molecules;
public String[] name,unqatm;
public int[] ist,isz;
private double[][] xyz;
private Config cfg;
private int[] idc,mtp,mst;
Structure() {
/*
*********************************************************************
dl_poly/java constructor for Structure class
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
lbnd=new int[MXATMS];
bond=new int[MXCONNECT][MXATMS];
join=new int[2][MXJOIN];
}
Structure(Config home) {
/*
*********************************************************************
dl_poly/java constructor for Structure class
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
super();
cfg=home;
// identify bonds in system
nbnds=getBonds();
// contiguize the structure
contiguize();
// identify unique atoms
nunq=uniqueAtoms();
// atomic repeat pattern in CONFIG file
nrept=numRepeatAtoms();
// number of core-shell units
nshl=numCoreShells();
// number of atoms types
ntatm=numAtomTypes();
if(nbnds > 0) nmols=molFind();
if(nmols > 0) nmoltp=molSame();
if(nmols == 0) nmols=cfg.natms/nrept;
}
int getBonds() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2011
********************g*************************************************
*/
boolean safe=true;
int i,j,k,n,mxcon;
double xd,yd,zd,ff,rsq,radi,radj,bndfac;
double uuu[]=new double[3];
lbnd=new int[cfg.natms];
bond=new int[MXCONNECT][cfg.natms];
nbnds=0;
bndfac=1.0+bondpc/100.0;
for(i=0;i<cfg.natms;i++)
lbnd[i]=0;
OUT:
for(i=0;i<cfg.natms-1;i++) {
if(cfg.atoms[i].covalent) {
radi=cfg.atoms[i].zrad;
for(j=i+1;j<cfg.natms;j++) {
if(cfg.atoms[j].covalent) {
radj=cfg.atoms[j].zrad;
ff=bndfac*(radi+radj);
uuu[0]=cfg.xyz[0][i]-cfg.xyz[0][j];
uuu[1]=cfg.xyz[1][i]-cfg.xyz[1][j];
uuu[2]=cfg.xyz[2][i]-cfg.xyz[2][j];
cfg.pbc.images(uuu);
rsq=uuu[0]*uuu[0]+uuu[1]*uuu[1]+uuu[2]*uuu[2];
if(rsq <= ff*ff) {
if((lbnd[i] < MXCONNECT)&&(lbnd[j] < MXCONNECT)) {
bond[lbnd[i]][i]=j;
bond[lbnd[j]][j]=i;
lbnd[i]+=1;
lbnd[j]+=1;
nbnds++;
}
else{
safe=false;
break OUT;
}
}
}
}
}
}
if(!safe){
println("Warning - too many bonds found in Structure");
nbnds=0;
}
// construct list of bonds
if(nbnds > 0) {
n=0;
join=new int[2][nbnds];
for(i=0;i<cfg.natms;i++) {
for(j=0;j<lbnd[i];j++) {
k=bond[j][i];
if(k > i) {
join[0][n]=i;
join[1][n]=k;
n++;
}
}
}
}
return nbnds;
}
void contiguize() {
/*
*********************************************************************
dl_poly/java GUI routine to make a contiguous version of a Config
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
Element[] atms;
double[][] uuu;
int k,m,n,p,q;
int[] key,lok,kkk,lll;
int[][] bbb;
if(nbnds > 0) {
key=new int[cfg.natms];
lok=new int[cfg.natms];
for (int i=0;i<cfg.natms;i++) {
lok[i]=i;
key[i]=i;
}
//identify clusters
for (int i=0;i<nbnds;i++) {
m=Math.min(join[0][i],join[1][i]);
n=Math.max(join[0][i],join[1][i]);
if(key[n] == n) {
key[n]=key[m];
}
else if (key[n] != key[m]) {
p=Math.min(key[m],key[n]);
q=Math.max(key[m],key[n]);
for (int j=0;j<cfg.natms;j++) {
if(key[j] == q) key[j]=p;
}
}
}
// sort clusters in ascending order
AML.ShellSort0(cfg.natms,lok,key);
// construct contiguous configuration
atms=new Element[cfg.natms];
uuu=new double[3][cfg.natms];
for (int i=0;i<cfg.natms;i++) {
p=lok[i];
atms[i]=cfg.atoms[p];
uuu[0][i]=cfg.xyz[0][p];
uuu[1][i]=cfg.xyz[1][p];
uuu[2][i]=cfg.xyz[2][p];
}
// reconstruct bonding arrays
join=new int[2][nbnds];
kkk=new int[cfg.natms];
lll=new int[cfg.natms];
bbb=new int[MXCONNECT][cfg.natms];
for(int i=0;i<cfg.natms;i++)
kkk[lok[i]]=i;
n=0;
for(int i=0;i<cfg.natms;i++) {
p=lok[i];
lll[i]=lbnd[p];
for (int j=0;j<lll[i];j++){
k=kkk[bond[j][p]];
bbb[j][i]=k;
if(k < i){
join[0][n]=k;
join[1][n]=i;
n++;
}
}
}
cfg.atoms=atms;
cfg.xyz=uuu;
lbnd=lll;
bond=bbb;
}
}
int uniqueAtoms() {
/*
*********************************************************************
dl_poly/java class to determine unique atoms in a configuration
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
int kkk,mxunq=MXUNIQUE;
boolean lnew;
name=new String[cfg.natms];
unqatm=new String[mxunq];
for(int i=0;i<cfg.natms;i++)
name[i]=BML.fmt(cfg.atoms[i].zsym,8);
// determine unique atom types
kkk=1;
unqatm[0]=name[0];
for(int i=1;i<cfg.natms;i++) {
lnew=true;
for(int j=0;j<kkk;j++) {
if(name[i].equals(unqatm[j])) lnew=false;
}
if(lnew) {
if(kkk == mxunq) {
String unqnew[]=new String[2*mxunq];
System.arraycopy(unqatm,0,unqnew,0,mxunq);
unqatm=unqnew;
mxunq*=2;
}
unqatm[kkk]=name[i];
kkk++;
}
}
return kkk;
}
int numRepeatAtoms() {
/*
*********************************************************************
dl_poly/java routine to determine the repeat pattern of atoms in a
CONFIG file
copyright - daresbury laboratory
author - w.smith 2011
**********************************************************************
*/
boolean lnum;
int nnum;
nnum=1;
nrept=cfg.natms;
OUT1:
for(int j=1;j<=cfg.natms/2;j++) {
if(cfg.natms%j == 0) {
lnum=true;
for(int i=0;i<cfg.natms-j;i++) {
if(!name[i].equals(name[i+j]))lnum=false;
}
if(lnum) {
nrept=j;
nnum=cfg.natms/j;
break OUT1;
}
}
}
return nrept;
}
int numCoreShells() {
/*
**********************************************************************
dl_poly/java routine to determine number of core-shell units in a
configuration
copyright - daresbury laboratory
author - w.smith 2011
**********************************************************************
*/
nshl=0;
for(int i=0;i<nrept;i++)
if(name[i].charAt(4)=='_' && name[i].toLowerCase().charAt(5)=='s')nshl++;
return nshl;
}
int numAtomTypes() {
/*
**********************************************************************
dl_poly/java routine to determine number of atom types in a
configuration allowing for core-shell units
copyright - daresbury laboratory
author - w.smith 2011
**********************************************************************
*/
ntatm=0;
for(int i=0;i<nunq;i++) {
if(unqatm[i].substring(4).equals(" ")) {
ntatm++;
}
else if(unqatm[i].toLowerCase().substring(4,6).equals("_s")) {
ntatm++;
}
}
return ntatm;
}
int molFind() {
/*
*********************************************************************
dl_poly/java routine for identifying individual molecules in a
configuration using cluster analysis
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
int nmols,jcl,kcl,iatm,jatm,idm,nmax;
idc=new int[cfg.natms];
// initialise cluster arrays
for (int i=0;i<cfg.natms;i++)
idc[i]=i;
// search for molecules
nmols=cfg.natms;
for(int i=0;i<nbnds;i++) {
iatm=Math.min(join[0][i],join[1][i]);
jatm=Math.max(join[0][i],join[1][i]);
if(idc[jatm] == jatm) {
idc[jatm]=idc[iatm];
nmols--;
}
else if (idc[jatm] != idc[iatm]) {
jcl=Math.min(idc[iatm],idc[jatm]);
kcl=Math.max(idc[iatm],idc[jatm]);
for(int k=0;k<cfg.natms;k++) {
if(idc[k] == kcl) idc[k]=jcl;
}
nmols--;
}
}
//println("Number of molecules found: "+BML.fmt(nmols,6));
if(nmols == 0)return 0;
// define molecule locations in CONFIG arrays
ist=new int[nmols];
isz=new int[nmols];
for(int i=0;i<nmols;i++) {
ist[i]=0;
isz[i]=0;
}
idm=0;
for(int i=1;i<cfg.natms;i++) {
if(idc[i] != idc[i-1]) {
isz[idm]=i-ist[idm];
idm++;
if(idm == nmols) {
println("Error - molecule data not contiguous in CONFIG");
return -1;
}
ist[idm]=i;
}
}
isz[idm]=cfg.natms-ist[idm];
idm++;
nmax=1;
for(int i=0;i<nmols;i++)
nmax=Math.max(nmax,isz[i]);
//println("Largest molecule found: "+BML.fmt(nmax,6));
return nmols;
}
int molSame() {
/*
*********************************************************************
dl_poly/java routine for identifying sequences of identical molecules
in a configuration (NB this operation valid for dl_poly only)
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
Molecule mole;
String molnam;
boolean same,found;
int ia,ib,kk,mm,idm,kkk,ja,jb;
if(nmols == 0) return 0;
mtp=new int[nmols];
mst=new int[nmols];
msz=new int[nmols];
for(int i=0;i<nmols;i++) {
mtp[i]=i;
mst[i]=0;
msz[i]=0;
}
// now identify equivalent molecules
for(int i=1;i<nmols;i++) {
// check molecule size
same=true;
OUT:
if(isz[i] == isz[i-1]) {
ia=ist[i];
ib=ist[i-1];
// compare corresponding atoms
for(int j=0;j<isz[i];j++) {
// check atom types
if(!(cfg.atoms[ia+j].zsym.equals(cfg.atoms[ib+j].zsym))) {
same=false;
break OUT;
}
// check atom valencies
if(lbnd[ia+j] != lbnd[ib+j]) {
same=false;
break OUT;
}
}
// check molecular topology
found=false;
OUT1:
for(int j=0;j<isz[i];j++) {
kk=ia+j;
mm=ib+j;
for(int k=0;k<lbnd[kk];k++) {
kkk=bond[k][kk]-ist[i];
for(int m=0;m<lbnd[mm];m++) {
if(kkk == bond[m][mm]-ist[i-1]) {
found=true;
}
}
if(!found) break OUT1;
}
}
same=found;
if(!same) break OUT;
mtp[i]=mtp[i-1];
}
}
// make list of unique molecules
idm=0;
mst[0]=0;
for(int i=1;i<nmols;i++) {
if(mtp[i] != mtp[i-1]) {
msz[idm]=i-mst[idm];
mst[++idm]=i;
}
}
msz[idm]=nmols-mst[idm];
nmoltp=++idm;
// assign structural details to molecules
molecules=new Molecule[nmoltp];
for(int i=0;i<nmoltp;i++) {
ja=ist[mst[i]];
jb=isz[mst[i]];
molnam="Species "+BML.fmt(i,6);
mole=new Molecule(cfg,ja,jb,molnam);
molecules[i]=mole;
}
return nmoltp;
}
void resizeJoinArray() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
int[][] jjn=new int[2][join[0].length+MXJOIN];
for(int i=0;i<nbnds;i++) {
jjn[0][i]=join[0][i];
jjn[1][i]=join[1][i];
}
join=jjn;
}
void resizeBondArrays() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2011
*********************************************************************
*/
int[] lll=new int[lbnd.length+MXATMS];
int[][] bbb=new int[MXCONNECT][bond[0].length+MXATMS];
for(int i=0;i<config.natms;i++) {
lll[i]=lbnd[i];
for(int j=0;j<MXCONNECT;j++)
bbb[j][i]=bond[j][i];
}
for(int i=config.natms;i<lll.length;i++)
lll[i]=0;
lbnd=lll;
bond=bbb;
}
}
| dlpolyquantum/dlpoly_quantum | java/Structure.java |
249,036 |
public class Q1 {
public static void main(String[] args) {
System.out.println("""
Hello " ITERIAN "
Welcome to Siksha ' O ' Anusandhan Family
Welcome to " Introductionn to Computer Laboratory "
Java is fun for All !!!
""");
}
}
| ankit071105/ICP_1st_semester | Assignment1/Q1.java |
249,038 | import java.awt.*;
import java.awt.event.*;
public class WarningBox extends Dialog implements ActionListener {
/*
**********************************************************************
dl_poly/java class to generate a warning box
copyright - daresbury laboratory
author - w. smith march 2001
**********************************************************************
*/
static GUI home;
static Color back,fore,butn,butf;
static Button pos,neg;
static Font fontMain;
public WarningBox(GUI here,String header,boolean modal) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
super(here,"Warning!",modal);
setSize(400,70);
home=here;
back=new Color(255,0,0);
fore=new Color(0,0,0);
butn=new Color(255,255,0);
butf=new Color(0,0,0);
fontMain=home.fontMain;
setBackground(back);
setForeground(fore);
setFont(fontMain);
setLayout(new FlowLayout());
// Warning label
Label holdit = new Label("Warning - Do you wish to proceed?");
add(holdit);
// define the buttons
pos=new Button("Yes");
pos.setForeground(butf);
pos.setBackground(butn);
neg=new Button(" No ");
neg.setForeground(butf);
neg.setBackground(butn);
add(pos);
add(neg);
// Register action buttons
pos.addActionListener(this);
neg.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Yes")) {
home.alert=true;
}
else if (arg.equals(" No ")) {
home.alert=false;
}
dispose();
}
}
| dlpolyquantum/dlpoly_quantum | java/WarningBox.java |
249,039 | /* ----------------------------------------------------------------------
*
* coNCePTuaL GUI: dialog menu
*
* By Nick Moss <nickm@lanl.gov>
*
* This class extends JComboBox to provide an editable menu that is
* used throughout the various dialogs. It doesn't allow duplicate
* items to be added to the menu and has various presets for recurring
* menu types such as task groups, message size units, etc.
*
* ----------------------------------------------------------------------
*
*
* Copyright (C) 2015, Los Alamos National Security, LLC
* All rights reserved.
*
* Copyright (2015). Los Alamos National Security, LLC. This software
* was produced under U.S. Government contract DE-AC52-06NA25396
* for Los Alamos National Laboratory (LANL), which is operated by
* Los Alamos National Security, LLC (LANS) for the U.S. Department
* of Energy. The U.S. Government has rights to use, reproduce,
* and distribute this software. NEITHER THE GOVERNMENT NOR LANS
* MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY
* FOR THE USE OF THIS SOFTWARE. If software is modified to produce
* derivative works, such modified software should be clearly marked,
* so as not to confuse it with the version available from LANL.
*
* Additionally, redistribution and use in source and binary forms,
* with or without modification, are permitted provided that the
* following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Los Alamos National Security, LLC, Los Alamos
* National Laboratory, the U.S. Government, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY LANS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LANS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* ----------------------------------------------------------------------
*/
package gov.lanl.c3.ncptl;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.*;
public class DialogMenu extends JComboBox {
public DialogMenu(){
}
public DialogMenu( int width ){
// make the menu a fixed width so the layout
// of the dialog is consistent
Dimension dimension = getPreferredSize();
dimension.width = width;
setPreferredSize( dimension );
}
// add the item to the menu if it doesn't already exist
public void addItem( Object item ){
for( int i = 0; i < getItemCount(); i++ ){
if( item.equals( getItemAt( i ) ) )
return;
}
super.addItem( item );
}
// add all items in the vector items
public void addItems( Vector items ){
for( int i = 0; i < items.size(); i++ )
addItem( items.elementAt( i ) );
}
// presets for size units
public void addSizeUnits(){
addItem( "bits" );
addItem( "bytes" );
addItem( "halfwords" );
addItem( "words" );
addItem( "integers" );
addItem( "doublewords" );
addItem( "quadwords" );
addItem( "pages" );
addItem( "kilobytes" );
addItem( "megabytes" );
addItem( "gigabytes" );
}
// presets for source tasks
public void addSourceTaskDescriptions(){
addItem( "all tasks" );
addItem( "tasks t such that t is even" );
addItem( "tasks t such that t is odd" );
}
// presets for target tasks
public void addTargetTaskDescriptions(){
addItem( "all other tasks" );
addItem( "tasks t such that t is even" );
addItem( "tasks t such that t is odd" );
}
}
| sstsimulator/coNCePTuaL | gui/DialogMenu.java |
249,040 | /* ----------------------------------------------------------------------
*
* coNCePTuaL GUI: dialog pane
*
* By Nick Moss <nickm@lanl.gov>
* Modifications for Eclipse by Paul Beinfest <beinfest@lanl.gov>
*
* This class maintains the dialog pane which is a detachable tool bar
* that holds the various dialogs
*
* ----------------------------------------------------------------------
*
*
* Copyright (C) 2015, Los Alamos National Security, LLC
* All rights reserved.
*
* Copyright (2015). Los Alamos National Security, LLC. This software
* was produced under U.S. Government contract DE-AC52-06NA25396
* for Los Alamos National Laboratory (LANL), which is operated by
* Los Alamos National Security, LLC (LANS) for the U.S. Department
* of Energy. The U.S. Government has rights to use, reproduce,
* and distribute this software. NEITHER THE GOVERNMENT NOR LANS
* MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY
* FOR THE USE OF THIS SOFTWARE. If software is modified to produce
* derivative works, such modified software should be clearly marked,
* so as not to confuse it with the version available from LANL.
*
* Additionally, redistribution and use in source and binary forms,
* with or without modification, are permitted provided that the
* following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of Los Alamos National Security, LLC, Los Alamos
* National Laboratory, the U.S. Government, nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY LANS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LANS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* ----------------------------------------------------------------------
*/
package gov.lanl.c3.ncptl;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
public class DialogPane extends JToolBar {
// the pane within the toolbar that actually holds the dialog
private JPanel pane;
// the toolbar is the parent container is used to allow the dialog
// pane to be detached
private JToolBar toolBar;
// flag that determines if the dialog pane is empty and can be
// used to display the help text
private boolean isEmpty;
public DialogPane(){
super( "Dialog Pane" );
pane = new JPanel();
pane.setPreferredSize( new Dimension( 700, 280 ) );
pane.setLayout( new BoxLayout( pane, BoxLayout.PAGE_AXIS ) );
super.add( pane );
isEmpty = true;
}
// remove all Swing components from the pane
public void clear(){
pane.removeAll();
}
// add component to pane and return it
public Component add( Component component ){
pane.add( component );
return component;
}
protected void finalize(){
// add glue at the bottom to force the components upward
add( Box.createVerticalStrut( 280 ) );
// force layout to be validated
validate();
repaint();
}
// calling setEmpty( true ) notifies the DialogPane that it
// is no longer holding a dialog and the help text can be displayed
public void setEmpty( boolean flag ){
isEmpty = flag;
}
public boolean isEmpty(){
return isEmpty;
}
// sets the default button for the pane
// pressing enter causes the default button to be signalled
public void setDefaultButton( JButton button ){
try {
pane.getRootPane().setDefaultButton( button );
}
catch( NullPointerException exception ){
// we're running within Eclipse
}
}
}
| sstsimulator/coNCePTuaL | gui/DialogPane.java |
249,041 | /*
* Copyright (c) 2008, Ueda Laboratory LMNtal Group <lmntal@ueda.info.waseda.ac.jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. Neither the name of the Ueda Laboratory LMNtal Group nor the
* names of its contributors may be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package lavit;
import java.awt.Font;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import lavit.config.ConfigUpdater;
import lavit.localizedtext.Msg;
import lavit.util.FileUtils;
import lavit.util.FontSizeUtils;
import lavit.util.StringUtils;
public final class Env {
public static final String APP_NAME = "LaViT";
public static final String APP_VERSION = "2.9.2";
public static final String APP_DATE = "2021/04/19";
public static final String APP_HREF = "http://www.ueda.info.waseda.ac.jp/lmntal/lavit/";
public static final String LMNTAL_VERSION = "LMNtal : 1.51 (2021/04/19)";
public static final String SLIM_VERSION = "SLIM : 2.5.0 (2021/04/19)";
public static final String UNYO_VERSION = "UNYO UNYO : 1.1.1 (2010/03/07)";
public static final String DIR_NAME_SLIM = "slim-2.5.0";
public static final String DIR_NAME_UNYO = "unyo1_1_1";
public static final String DIR_NAME_GRAPHENE = "graphene";
public static final String DIR_NAME_LTL2BA = "ltl2ba";
public static final String LMNTAL_LIBRARY_DIR = "lmntal";
private static final String ENV_FILE = "env.txt";
private static final String ENV_DEFAULT_FILE = "env_default.txt";
private static final String DIR_NAME_PROPERTIES = "properties";
private static Properties prop = new Properties();
private static String cachedLMNtalVersion = null;
private static String cachedSLIMVersion = null;
private static List<Image> appIcons;
private static Msg msg;
private Env() {
}
public static boolean loadEnvironment() {
File envFile = new File(ENV_FILE);
try {
if (!envFile.exists()) {
System.err.println("creating " + ENV_FILE);
envFile.createNewFile();
}
} catch (IOException e) {
System.err.println("Error: failed to create " + envFile);
return false;
}
try {
InputStream in = getInputStreamOfFile(ENV_FILE);
prop.load(in);
in.close();
} catch (IOException e) {
System.err.println("Error: failed to read file " + ENV_FILE);
return false;
}
loadDefault();
return true;
}
private static void loadDefault() {
// バージョンアップの処理(設定値がない場合はその値を入れる)
Properties default_prop = new Properties();
try {
InputStream in = Env.class.getResourceAsStream("/resources/" + ENV_DEFAULT_FILE);
default_prop.load(in);
in.close();
for (Map.Entry<Object, Object> ent : default_prop.entrySet()) {
String key = (String) ent.getKey();
String value = (String) ent.getValue();
if (!prop.containsKey(key)) {
prop.setProperty(key, value);
System.out.println("auto update " + ENV_FILE + " : " + key + "=" + value);
}
}
} catch (IOException e) {
System.err.println("read error. check " + ENV_DEFAULT_FILE);
}
ConfigUpdater.update(prop);
}
public static void save() {
try {
// 普通に保存
FileOutputStream out = new FileOutputStream(ENV_FILE);
prop.store(out, APP_NAME + " " + APP_VERSION);
out.close();
// ソートで再保存
LineNumberReader reader = new LineNumberReader(new FileReader(ENV_FILE));
ArrayList<String> lines = new ArrayList<String>();
String line = null;
while ((line = reader.readLine()) != null) {
lines.add(line);
}
reader.close();
Collections.sort(lines);
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(ENV_FILE)));
for (String str : lines) {
writer.write(str + "\n");
}
writer.close();
} catch (IOException e) {
System.err.println("save error. check " + ENV_FILE);
}
}
public static void loadMsg() {
msg = new Msg(Env.get("LANG", ""));
}
public static String getMsg(int msgid) {
if (msg == null) {
throw new RuntimeException("Messages are not loaded. Call the method Env.loadMsg().");
}
return msg.get(msgid);
}
public static String getMsg(int msgid, String... args) {
if (msg == null) {
throw new RuntimeException("Messages are not loaded. Call the method Env.loadMsg().");
}
return msg.get(msgid, args);
}
public static Collection<String[]> getEntries() {
List<String[]> entries = new LinkedList<String[]>();
for (Map.Entry<Object, Object> e : prop.entrySet()) {
entries.add(new String[] { (String) e.getKey(), (String) e.getValue() });
}
return entries;
}
/**
* キー値 key に設定されている値を取得する。 キー値 key に対応する項目が存在しない場合は{@code null}を返す。
*/
public static String get(String key) {
return prop.getProperty(key);
}
/**
* キー値 key に設定されている値を取得する。 キー値 key に対応する項目が存在しない場合もしくは値が空文字列の場合は defaultValue
* を返す。
*/
public static String get(String key, String defaultValue) {
String value = prop.getProperty(key);
return StringUtils.nullOrEmpty(value) ? defaultValue : value;
}
/**
* キー値 key に設定されている値を整数値として取得する。 値が有効な整数値でない場合、例外 {@link NumberFormatException}
* を発生させる。
*/
public static int getInt(String key) throws NumberFormatException {
return Integer.valueOf(prop.getProperty(key));
}
/**
* キー値 key に設定されている値を整数値として取得する。 値が有効な整数値でない場合にデフォルト値 defaultValue を返す。
* このメソッドは例外安全である。
*/
public static int getInt(String key, int defaultValue) {
int value = defaultValue;
try {
value = Integer.parseInt(get(key));
} catch (NumberFormatException e) {
}
return value;
}
/**
* 値を文字列リストとして取得する。
*/
public static List<String> getList(String key) {
return new ArrayList<String>(StringUtils.splitToList(get(key, ""), "\\s+"));
}
/**
* 値を文字列集合として取得する。
*/
public static Set<String> getSet(String key) {
return new HashSet<String>(StringUtils.splitToSet(get(key, ""), "\\s+"));
}
public static void setList(String key, Collection<String> values) {
set(key, StringUtils.join(values, " "));
}
public static Font getEditorFont() {
String fontFamily = get("EDITOR_FONT_FAMILY", Font.MONOSPACED);
int fontSize = FontSizeUtils.getActualFontSize(getInt("EDITOR_FONT_SIZE", 12));
return new Font(fontFamily, Font.PLAIN, fontSize);
}
public static boolean is(String key) {
if (!prop.containsKey(key)) {
System.err.println("read error. check " + key + " in " + ENV_FILE);
}
return Boolean.valueOf(prop.getProperty(key));
}
public static boolean isSet(String key) {
return !StringUtils.nullOrEmpty(get(key));
}
public static void setProcessEnvironment(Map<String, String> map) {
map.put("LMNTAL_HOME", getLmntalLinuxPath());
if (isWindows()) {
char sep = File.separatorChar;
char pathSep = File.pathSeparatorChar;
String cygwinDir = get("WINDOWS_CYGWIN_DIR");
String paths = "";
paths += cygwinDir + sep + "bin" + pathSep;
paths += cygwinDir + sep + "usr" + sep + "bin" + pathSep;
paths += cygwinDir + sep + "usr" + sep + "local" + sep + "bin";
boolean put = false;
for (String key : new String[] { "path", "Path", "PATH" }) {
String value = map.get(key);
if (value != null) {
map.put(key, paths + pathSep + value);
put = true;
}
}
if (!put) {
map.put("PATH", paths);
}
}
if (isMac()) {
// MacでFinderからjarをダブルクリックしてLaViTを起動した場合は、
// シェルの環境変数ではなくFinderの環境変数が設定される。
// その場合、PATHに/usr/loca/binや/opt/local/binが含まれていない(Yosemiteから?)。
// SLIMをインストールするときに使用するautotoolsのコマンドは、
// HomebrewやMacPortsでインストールすることが多いので、
// /usr/local/binや/opt/local/binがパスに含まれていないとコマンドが見つからない。
// この問題を回避するため、ここでパスに追加する。
String paths = System.getenv("PATH");
Set<String> pathsSet = new HashSet<String>(Arrays.asList(paths.split(":")));
if (!pathsSet.contains("/usr/local/bin")) {
paths = "/usr/local/bin:" + paths;
}
if (!pathsSet.contains("/opt/local/bin")) {
paths = "/opt/local/bin:" + paths;
}
map.put("PATH", paths);
}
}
public static String getDirNameOfSlim() {
return get("DIR_NAME_SLIM", DIR_NAME_SLIM);
}
public static String getDirNameOfUnyo() {
return get("DIR_NAME_UNYO", DIR_NAME_UNYO);
}
public static String getDirNameOfGraphene() {
return get("DIR_NAME_GRAPHENE", DIR_NAME_GRAPHENE);
}
public static String getDirNameOfLtl2ba() {
return get("DIR_NAME_LTL2BA", DIR_NAME_LTL2BA);
}
/**
* 文字列 {@code path} に半角空白文字 (0x20) が含まれる場合、この文字列を二重引用符で囲んだ文字列を返す。
* 半角空白文字が含まれない場合、{@code path} をそのまま返す。
*/
public static String getSpaceEscape(String path) {
if (path.indexOf(" ") == -1) {
return path;
} else {
return "\"" + path + "\"";
}
}
public static String getSlimInstallPath() {
return get("path.slim.install", LMNTAL_LIBRARY_DIR + File.separator + "installed");
}
public static String getSlimInstallLibraryPath() {
char sep = File.separatorChar;
return getSlimInstallPath() + sep + "share" + sep + "slim" + sep + "lib";
}
public static String getLmntalLinuxPath() {
String path = new File(LMNTAL_LIBRARY_DIR).getAbsolutePath();
path = getLinuxStylePath(path);
return path;
}
public static String getSlimInstallLinuxPath() {
String path = new File(getSlimInstallPath()).getAbsolutePath();
path = getLinuxStylePath(path);
return path;
}
public static String getLinuxStylePath(String path) {
if (File.separatorChar == '\\') {
path = path.replace('\\', '/');
if (path.contains(":")) {
String[] part = path.split(":");
if (1 < part.length && !part[0].equals("")) {
path = "/cygdrive/" + part[0] + part[1];
}
}
}
return path;
}
public static String getLmntalCmd()
{
String compiler_path = Env.get("path.lmntalcompiler");
char sep = File.separatorChar;
String cmd;
if (compiler_path.contains(".jar"))
{
cmd = "java";
cmd += " -cp ";
cmd += LMNTAL_LIBRARY_DIR + sep + "lib" + sep + "std_lib.jar";
cmd += " -DLMNTAL_HOME=" + LMNTAL_LIBRARY_DIR + " -jar ";
cmd += compiler_path;
}
else
{
cmd = compiler_path;
}
return cmd;
}
public static String getBinaryAbsolutePath(String cmd) {
char sep = File.separatorChar;
String cygwinDir = get("WINDOWS_CYGWIN_DIR");
String[] pathes = { sep + "usr" + sep + "local" + sep + "bin" + sep + cmd, sep + "usr" + sep + "bin" + sep + cmd,
sep + "bin" + sep + cmd, };
for (String path : pathes) {
if (isWindows()) {
path = cygwinDir + path + ".exe";
}
if (FileUtils.exists(path)) {
return path;
}
}
return cmd;
}
/**
* Finds a directory whose name starts with "slim" in "./lmntal".
*
* @return If found, returns path string of the directory found first.
* Otherwise, returns empty string.
*/
public static String estimateSlimSourcePath() {
File lmntalDir = new File("lmntal");
if (lmntalDir.exists() && lmntalDir.isDirectory()) {
for (File file : lmntalDir.listFiles()) {
if (file.isDirectory() && file.getName().startsWith("slim")) {
return file.getPath();
}
}
}
return "";
}
public static String getSlimBinaryName() {
return isWindows() ? "slim.exe" : "slim";
}
public static String getLtl2baBinaryName() {
return isWindows() ? "ltl2ba.exe" : "ltl2ba";
}
public static void set(String key, String value) {
prop.setProperty(key, value);
}
public static void set(String key, boolean value) {
prop.setProperty(key, String.valueOf(value));
}
public static void set(String key, int value) {
prop.setProperty(key, String.valueOf(value));
}
// jarファイル化した場合のファイル入力の差を吸収
public static InputStream getInputStreamOfFile(String filename) {
InputStream in = null;
try {
if (FileUtils.exists(filename)) {
in = new FileInputStream(filename);
} else {
in = Env.class.getResourceAsStream("/" + filename);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
return in;
}
// jarファイル化した場合のファイル入力の差を吸収
public static Image getImageOfFile(String filename) {
if (FileUtils.exists(filename)) {
return Toolkit.getDefaultToolkit().getImage(filename);
} else {
URL fileUrl = Env.class.getResource("/" + filename);
return Toolkit.getDefaultToolkit().getImage(fileUrl);
}
}
public static boolean isWindows() {
return File.pathSeparatorChar == ';';
}
public static boolean isMac() {
return System.getProperty("os.name").toLowerCase().contains("mac");
}
public static List<Image> getApplicationIcons() {
if (appIcons == null) {
List<Image> icons = new ArrayList<Image>();
icons.add(Env.getImageOfFile("img/app_icons/app_icon_16.png"));
icons.add(Env.getImageOfFile("img/app_icons/app_icon_32.png"));
icons.add(Env.getImageOfFile("img/app_icons/app_icon_48.png"));
icons.add(Env.getImageOfFile("img/app_icons/app_icon_64.png"));
appIcons = Collections.unmodifiableList(icons);
}
return appIcons;
}
public static File getPropertyFile(String fileName) {
File dir = new File(DIR_NAME_PROPERTIES);
if (!dir.exists()) {
if (!dir.mkdir()) {
System.err.println("Could not create directory '" + dir + "'");
return null;
}
}
return new File(dir.getAbsolutePath() + File.separator + fileName);
}
public static List<File> loadLastFiles() {
List<File> files = new ArrayList<File>();
File propFile = getPropertyFile("lastfiles");
if (propFile == null) {
return files;
}
String charset = "UTF-8";
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(propFile), charset));
String line;
while ((line = reader.readLine()) != null) {
files.add(new File(line));
}
reader.close();
} catch (FileNotFoundException e) {
} catch (IOException e) {
}
return files;
}
public static void saveOpenedFilePathes(List<File> files) {
File propFile = getPropertyFile("lastfiles");
if (propFile == null) {
return;
}
String charset = "UTF-8";
try {
PrintWriter out = new PrintWriter(
new BufferedWriter(new OutputStreamWriter(new FileOutputStream(propFile), charset)));
for (File file : files) {
out.println(file.getAbsolutePath());
}
out.close();
} catch (FileNotFoundException e) {
} catch (UnsupportedEncodingException e) {
}
}
/**
* Gets LMNtal version by executing {@code java -jar lmntal.jar --version}.
*/
public static String getLMNtalVersion() {
if (cachedLMNtalVersion != null) {
return cachedLMNtalVersion;
}
String lmntalPath = LMNTAL_LIBRARY_DIR + File.separator + "bin" + File.separatorChar + "lmntal.jar";
ProcessBuilder pb = new ProcessBuilder("java", "-classpath", lmntalPath, "runtime.FrontEnd", "--version");
pb.redirectErrorStream(true);
String version = "";
try {
Process p = pb.start();
p.getOutputStream().close();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = reader.readLine();
p.getInputStream().close();
p.getErrorStream().close();
p.waitFor();
if (!StringUtils.nullOrEmpty(line)) {
version = line;
}
} catch (IOException e) {
} catch (InterruptedException e) {
}
if (StringUtils.nullOrEmpty(version)) {
version = "1.21 (2011/12/26)"; // previous version of --version implementation
}
cachedLMNtalVersion = version;
return version;
}
/**
* Gets SLIM version by executing {@code slim --version}.
*/
public static String getSlimVersion() {
if (cachedSLIMVersion == null) {
String slimPath = get("SLIM_EXE_PATH");
String version = "";
if (!StringUtils.nullOrEmpty(slimPath)) {
ProcessBuilder pb = new ProcessBuilder(slimPath, "--version");
setProcessEnvironment(pb.environment());
pb.redirectErrorStream(true);
try {
Process p = pb.start();
p.getOutputStream().close();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = reader.readLine();
p.getInputStream().close();
p.getErrorStream().close();
p.waitFor();
if (!StringUtils.nullOrEmpty(line)) {
Pattern pat = Pattern.compile("\\d+\\.\\d+\\.\\d+");
Matcher m = pat.matcher(line);
if (m.find()) {
version = m.group();
}
}
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
cachedSLIMVersion = version;
}
return cachedSLIMVersion;
}
}
| lmntal/lavit | src/lavit/Env.java |
249,042 | // ***************************************************************************
//
// Copyright (c) 2000 - 2014, Lawrence Livermore National Security, LLC
// Produced at the Lawrence Livermore National Laboratory
// LLNL-CODE-442911
// All rights reserved.
//
// This file is part of VisIt. For details, see https://visit.llnl.gov/. The
// full copyright notice is contained in the file COPYRIGHT located at the root
// of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the disclaimer below.
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the disclaimer (as noted below) in the
// documentation and/or other materials provided with the distribution.
// - Neither the name of the LLNS/LLNL nor the names of its contributors may
// be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
// LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// ***************************************************************************
package llnl.visit;
// ****************************************************************************
// Class: MapNodePair
//
// Purpose:
// This class is just for storage inside of MapNode.
//
// Notes:
//
// Programmer: Brad Whitlock
// Creation: Thu Feb 2 11:52:44 PST 2012
//
// Modifications:
//
// ****************************************************************************
public class MapNodePair extends java.lang.Object
{
public MapNodePair()
{
super();
key = new String();
value = new MapNode();
}
public MapNodePair(MapNodePair obj)
{
super();
key = new String(obj.key);
value = new MapNode(obj.value);
}
public String key;
public MapNode value;
}
| ahota/visit_intel | java/MapNodePair.java |
249,044 | import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ChgDefaults extends Basic implements ActionListener {
/*
**********************************************************************
dl_poly/java routine to change the defaults for the GUI
copyright - daresbury laboratory
author - w. smith january 2001
**********************************************************************
*/
public static GUI home;
public static ChgDefaults job;
private static JTextField rotang,tradis,bondtol;
private static JButton set,close;
public ChgDefaults() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
super();
setTitle("Change Defaults");
getContentPane().setForeground(art.fore);
getContentPane().setBackground(art.back);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setFont(fontMain);
getContentPane().setLayout(new GridLayout(4,2));
// define the buttons
set=new JButton("Set");
set.setForeground(art.butf);
set.setBackground(art.butn);
close=new JButton("Close");
close.setForeground(art.butf);
close.setBackground(art.butn);
getContentPane().add(set);
getContentPane().add(close);
// Fixed rotation angle
JLabel l07=new JLabel("Rotation angle (deg)");
getContentPane().add(l07);
rotang=new JTextField(8);
rotang.setBackground(art.scrn);
rotang.setForeground(art.scrf);
getContentPane().add(rotang);
// Fixed translation distance
JLabel l08=new JLabel("Translation dist (A)");
getContentPane().add(l08);
tradis=new JTextField(8);
tradis.setBackground(art.scrn);
tradis.setForeground(art.scrf);
getContentPane().add(tradis);
// Bond acceptance tolerance (percent)
JLabel l09=new JLabel("Bond Tolerance (%)");
getContentPane().add(l09);
bondtol=new JTextField(8);
bondtol.setBackground(art.scrn);
bondtol.setForeground(art.scrf);
getContentPane().add(bondtol);
// Register action buttons
set.addActionListener(this);
close.addActionListener(this);
}
public ChgDefaults(GUI here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
home=here;
println("Activated panel for changing defaults");
job=new ChgDefaults();
job.pack();
job.setVisible(true);
defaultSet();
}
public void defaultSet() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
rotang.setText(String.valueOf(rotdef));
tradis.setText(String.valueOf(tradef));
bondtol.setText(String.valueOf(bondpc));
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Set")) {
rotdef=BML.giveDouble(rotang.getText(),1);
tradef=BML.giveDouble(tradis.getText(),1);
bondpc=BML.giveDouble(bondtol.getText(),1);
rotcos=Math.cos(Math.PI*rotdef/180.0);
rotsin=Math.sin(Math.PI*rotdef/180.0);
incx=tradef;
incy=tradef;
incz=tradef;
println("GUI defaults now changed");
}
else if (arg.equals("Close")) {
job.dispose();
}
}
}
| dlpolyquantum/dlpoly_quantum | java/ChgDefaults.java |
249,045 | /******************************************************************************
* Copyright (C) 2000 by Robert Hubley. *
* All rights reserved. *
* *
* This software is provided ``AS IS'' and any express or implied *
* warranties, including, but not limited to, the implied warranties of *
* merchantability and fitness for a particular purpose, are disclaimed. *
* In no event shall the authors be liable for any direct, indirect, *
* incidental, special, exemplary, or consequential damages (including, but *
* not limited to, procurement of substitute goods or services; loss of use, *
* data, or profits; or business interruption) however caused and on any *
* theory of liability, whether in contract, strict liability, or tort *
* (including negligence or otherwise) arising in any way out of the use of *
* this software, even if advised of the possibility of such damage. *
* *
******************************************************************************
*
* CLASS: MD5
*
* DESCRIPTION:
* This is a class which encapsulates a set of MD5 Message Digest functions.
* MD5 algorithm produces a 128 bit digital fingerprint (signature) from an
* dataset of arbitrary length. For details see RFC 1321 (summarized below).
* This implementation is derived from the RSA Data Security, Inc. MD5 Message-Digest
* algorithm reference implementation (originally written in C)
*
* AUTHOR:
* Robert M. Hubley 1/2000
*
*
* NOTES:
* Network Working Group R. Rivest
* Request for Comments: 1321 MIT Laboratory for Computer Science
* and RSA Data Security, Inc.
* April 1992
*
*
* The MD5 Message-Digest Algorithm
*
* Summary
*
* This document describes the MD5 message-digest algorithm. The
* algorithm takes as input a message of arbitrary length and produces
* as output a 128-bit "fingerprint" or "message digest" of the input.
* It is conjectured that it is computationally infeasible to produce
* two messages having the same message digest, or to produce any
* message having a given prespecified target message digest. The MD5
* algorithm is intended for digital signature applications, where a
* large file must be "compressed" in a secure manner before being
* encrypted with a private (secret) key under a public-key cryptosystem
* such as RSA.
*
* The MD5 algorithm is designed to be quite fast on 32-bit machines. In
* addition, the MD5 algorithm does not require any large substitution
* tables; the algorithm can be coded quite compactly.
*
* The MD5 algorithm is an extension of the MD4 message-digest algorithm
* 1,2]. MD5 is slightly slower than MD4, but is more "conservative" in
* design. MD5 was designed because it was felt that MD4 was perhaps
* being adopted for use more quickly than justified by the existing
* critical review; because MD4 was designed to be exceptionally fast,
* it is "at the edge" in terms of risking successful cryptanalytic
* attack. MD5 backs off a bit, giving up a little in speed for a much
* greater likelihood of ultimate security. It incorporates some
* suggestions made by various reviewers, and contains additional
* optimizations. The MD5 algorithm is being placed in the public domain
* for review and possible adoption as a standard.
*
* RFC Author:
* Ronald L.Rivest
* Massachusetts Institute of Technology
* Laboratory for Computer Science
* NE43 -324545 Technology Square
* Cambridge, MA 02139-1986
* Phone: (617) 253-5880
* EMail: Rivest@ theory.lcs.mit.edu
*
*
*
* CHANGE HISTORY:
*
* 0.1.0 RMH 1999/12/29 Original version
*
*/
//
// Imports
//
import java.io.*;
//
// MD5 Class
//
class MD5
{
private static long S11 = 7L;
private static long S12 = 12L;
private static long S13 = 17L;
private static long S14 = 22L;
private static long S21 = 5L;
private static long S22 = 9L;
private static long S23 = 14L;
private static long S24 = 20L;
private static long S31 = 4L;
private static long S32 = 11L;
private static long S33 = 16L;
private static long S34 = 23L;
private static long S41 = 6L;
private static long S42 = 10L;
private static long S43 = 15L;
private static long S44 = 21L;
private static char pad[] = {128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0};
private char bytBuffer[] = new char[64];
private long lngState[] = new long[4];
private long lngByteCount = 0;
//
// Constructor
//
MD5()
{
this.init();
}
//
// Static Methods
//
private static long[] decode(char bytBlock[])
{
long lngBlock[] = new long[16];
int j = 0;
for(int i = 0; i < bytBlock.length; i += 4)
{
lngBlock[j++] = bytBlock[i] +
bytBlock[i+1] * 256L +
bytBlock[i+2] * 65536L +
bytBlock[i+3] * 16777216L;
}
return(lngBlock);
}
private static void transform(long lngState[], char bytBlock[])
{
long lngA = lngState[0];
long lngB = lngState[1];
long lngC = lngState[2];
long lngD = lngState[3];
long x[] = new long[16];
x = decode (bytBlock);
/* Round 1 */
lngA = ff (lngA, lngB, lngC, lngD, x[ 0], S11, 0xd76aa478L); /* 1 */
lngD = ff (lngD, lngA, lngB, lngC, x[ 1], S12, 0xe8c7b756L); /* 2 */
lngC = ff (lngC, lngD, lngA, lngB, x[ 2], S13, 0x242070dbL); /* 3 */
lngB = ff (lngB, lngC, lngD, lngA, x[ 3], S14, 0xc1bdceeeL); /* 4 */
lngA = ff (lngA, lngB, lngC, lngD, x[ 4], S11, 0xf57c0fafL); /* 5 */
lngD = ff (lngD, lngA, lngB, lngC, x[ 5], S12, 0x4787c62aL); /* 6 */
lngC = ff (lngC, lngD, lngA, lngB, x[ 6], S13, 0xa8304613L); /* 7 */
lngB = ff (lngB, lngC, lngD, lngA, x[ 7], S14, 0xfd469501L); /* 8 */
lngA = ff (lngA, lngB, lngC, lngD, x[ 8], S11, 0x698098d8L); /* 9 */
lngD = ff (lngD, lngA, lngB, lngC, x[ 9], S12, 0x8b44f7afL); /* 10 */
lngC = ff (lngC, lngD, lngA, lngB, x[10], S13, 0xffff5bb1L); /* 11 */
lngB = ff (lngB, lngC, lngD, lngA, x[11], S14, 0x895cd7beL); /* 12 */
lngA = ff (lngA, lngB, lngC, lngD, x[12], S11, 0x6b901122L); /* 13 */
lngD = ff (lngD, lngA, lngB, lngC, x[13], S12, 0xfd987193L); /* 14 */
lngC = ff (lngC, lngD, lngA, lngB, x[14], S13, 0xa679438eL); /* 15 */
lngB = ff (lngB, lngC, lngD, lngA, x[15], S14, 0x49b40821L); /* 16 */
/* Round 2 */
lngA = gg (lngA, lngB, lngC, lngD, x[ 1], S21, 0xf61e2562L); /* 17 */
lngD = gg (lngD, lngA, lngB, lngC, x[ 6], S22, 0xc040b340L); /* 18 */
lngC = gg (lngC, lngD, lngA, lngB, x[11], S23, 0x265e5a51L); /* 19 */
lngB = gg (lngB, lngC, lngD, lngA, x[ 0], S24, 0xe9b6c7aaL); /* 20 */
lngA = gg (lngA, lngB, lngC, lngD, x[ 5], S21, 0xd62f105dL); /* 21 */
lngD = gg (lngD, lngA, lngB, lngC, x[10], S22, 0x2441453L); /* 22 */
lngC = gg (lngC, lngD, lngA, lngB, x[15], S23, 0xd8a1e681L); /* 23 */
lngB = gg (lngB, lngC, lngD, lngA, x[ 4], S24, 0xe7d3fbc8L); /* 24 */
lngA = gg (lngA, lngB, lngC, lngD, x[ 9], S21, 0x21e1cde6L); /* 25 */
lngD = gg (lngD, lngA, lngB, lngC, x[14], S22, 0xc33707d6L); /* 26 */
lngC = gg (lngC, lngD, lngA, lngB, x[ 3], S23, 0xf4d50d87L); /* 27 */
lngB = gg (lngB, lngC, lngD, lngA, x[ 8], S24, 0x455a14edL); /* 28 */
lngA = gg (lngA, lngB, lngC, lngD, x[13], S21, 0xa9e3e905L); /* 29 */
lngD = gg (lngD, lngA, lngB, lngC, x[ 2], S22, 0xfcefa3f8L); /* 30 */
lngC = gg (lngC, lngD, lngA, lngB, x[ 7], S23, 0x676f02d9L); /* 31 */
lngB = gg (lngB, lngC, lngD, lngA, x[12], S24, 0x8d2a4c8aL); /* 32 */
/* Round 3 */
lngA = hh (lngA, lngB, lngC, lngD, x[ 5], S31, 0xfffa3942L); /* 33 */
lngD = hh (lngD, lngA, lngB, lngC, x[ 8], S32, 0x8771f681L); /* 34 */
lngC = hh (lngC, lngD, lngA, lngB, x[11], S33, 0x6d9d6122L); /* 35 */
lngB = hh (lngB, lngC, lngD, lngA, x[14], S34, 0xfde5380cL); /* 36 */
lngA = hh (lngA, lngB, lngC, lngD, x[ 1], S31, 0xa4beea44L); /* 37 */
lngD = hh (lngD, lngA, lngB, lngC, x[ 4], S32, 0x4bdecfa9L); /* 38 */
lngC = hh (lngC, lngD, lngA, lngB, x[ 7], S33, 0xf6bb4b60L); /* 39 */
lngB = hh (lngB, lngC, lngD, lngA, x[10], S34, 0xbebfbc70L); /* 40 */
lngA = hh (lngA, lngB, lngC, lngD, x[13], S31, 0x289b7ec6L); /* 41 */
lngD = hh (lngD, lngA, lngB, lngC, x[ 0], S32, 0xeaa127faL); /* 42 */
lngC = hh (lngC, lngD, lngA, lngB, x[ 3], S33, 0xd4ef3085L); /* 43 */
lngB = hh (lngB, lngC, lngD, lngA, x[ 6], S34, 0x4881d05L); /* 44 */
lngA = hh (lngA, lngB, lngC, lngD, x[ 9], S31, 0xd9d4d039L); /* 45 */
lngD = hh (lngD, lngA, lngB, lngC, x[12], S32, 0xe6db99e5L); /* 46 */
lngC = hh (lngC, lngD, lngA, lngB, x[15], S33, 0x1fa27cf8L); /* 47 */
lngB = hh (lngB, lngC, lngD, lngA, x[ 2], S34, 0xc4ac5665L); /* 48 */
/* Round 4 */
lngA = ii (lngA, lngB, lngC, lngD, x[ 0], S41, 0xf4292244L); /* 49 */
lngD = ii (lngD, lngA, lngB, lngC, x[ 7], S42, 0x432aff97L); /* 50 */
lngC = ii (lngC, lngD, lngA, lngB, x[14], S43, 0xab9423a7L); /* 51 */
lngB = ii (lngB, lngC, lngD, lngA, x[ 5], S44, 0xfc93a039L); /* 52 */
lngA = ii (lngA, lngB, lngC, lngD, x[12], S41, 0x655b59c3L); /* 53 */
lngD = ii (lngD, lngA, lngB, lngC, x[ 3], S42, 0x8f0ccc92L); /* 54 */
lngC = ii (lngC, lngD, lngA, lngB, x[10], S43, 0xffeff47dL); /* 55 */
lngB = ii (lngB, lngC, lngD, lngA, x[ 1], S44, 0x85845dd1L); /* 56 */
lngA = ii (lngA, lngB, lngC, lngD, x[ 8], S41, 0x6fa87e4fL); /* 57 */
lngD = ii (lngD, lngA, lngB, lngC, x[15], S42, 0xfe2ce6e0L); /* 58 */
lngC = ii (lngC, lngD, lngA, lngB, x[ 6], S43, 0xa3014314L); /* 59 */
lngB = ii (lngB, lngC, lngD, lngA, x[13], S44, 0x4e0811a1L); /* 60 */
lngA = ii (lngA, lngB, lngC, lngD, x[ 4], S41, 0xf7537e82L); /* 61 */
lngD = ii (lngD, lngA, lngB, lngC, x[11], S42, 0xbd3af235L); /* 62 */
lngC = ii (lngC, lngD, lngA, lngB, x[ 2], S43, 0x2ad7d2bbL); /* 63 */
lngB = ii (lngB, lngC, lngD, lngA, x[ 9], S44, 0xeb86d391L); /* 64 */
lngState[0] = (lngState[0] + lngA) & 0xFFFFFFFFL;
lngState[1] = (lngState[1] + lngB) & 0xFFFFFFFFL;
lngState[2] = (lngState[2] + lngC) & 0xFFFFFFFFL;
lngState[3] = (lngState[3] + lngD) & 0xFFFFFFFFL;
/* clear senstive information */
x = decode (pad);
}
private static long ff(long lngA,
long lngB,
long lngC,
long lngD,
long lngX,
long lngS,
long lngAC)
{
lngA = (lngA + (lngB & lngC | (~lngB) & lngD) + lngX + lngAC) & 0xFFFFFFFFL;
lngA = ((lngA << lngS) | (lngA >>> (32L-lngS))) & 0xFFFFFFFFL;
lngA = (lngA + lngB) & 0xFFFFFFFFL;
return(lngA);
}
private static long gg(long lngA,
long lngB,
long lngC,
long lngD,
long lngX,
long lngS,
long lngAC)
{
lngA = (lngA + (lngB & lngD | lngC & ~lngD) + lngX + lngAC) & 0xFFFFFFFFL;
lngA = ((lngA << lngS) | (lngA >>> (32L-lngS))) & 0xFFFFFFFFL;
lngA = (lngA + lngB) & 0xFFFFFFFFL;
return(lngA);
}
private static long hh(long lngA,
long lngB,
long lngC,
long lngD,
long lngX,
long lngS,
long lngAC)
{
lngA = (lngA + (lngB ^ lngC ^ lngD) + lngX + lngAC) & 0xFFFFFFFFL;
lngA = ((lngA << lngS) | (lngA >>> (32L-lngS))) & 0xFFFFFFFFL;
lngA = (lngA + lngB) & 0xFFFFFFFFL;
return(lngA);
}
private static long ii(long lngA,
long lngB,
long lngC,
long lngD,
long lngX,
long lngS,
long lngAC)
{
lngA = (lngA + (lngC ^ (lngB | ~lngD)) + lngX + lngAC) & 0xFFFFFFFFL;
lngA = ((lngA << lngS) | (lngA >>> (32L-lngS))) & 0xFFFFFFFFL;
lngA = (lngA + lngB) & 0xFFFFFFFFL;
return(lngA);
}
private void update(char bytInput[], long lngLen)
{
int index = (int)( this.lngByteCount % 64);
int i = 0;
this.lngByteCount += lngLen;
int partLen = 64 - index;
if (lngLen >= partLen)
{
for (int j = 0; j < partLen; ++j)
{
this.bytBuffer[j + index] = bytInput[j];
}
transform (this.lngState, this.bytBuffer);
for (i = partLen; i + 63 < lngLen; i += 64)
{
for (int j = 0; j<64; ++j)
{
this.bytBuffer[j] = bytInput[j+i];
}
transform (this.lngState, this.bytBuffer);
}
index = 0;
}
else
{
i = 0;
}
for (int j = 0; j < lngLen - i; ++j)
{
this.bytBuffer[index + j] = bytInput[i + j];
}
}
public void md5final()
{
char bytBits[] = new char[8];
int index, padLen;
long bits = this.lngByteCount * 8;
bytBits[0] = (char) (bits & 0xffL);
bytBits[1] = (char) ((bits >>> 8) & 0xffL);
bytBits[2] = (char) ((bits >>> 16) & 0xffL);
bytBits[3] = (char)((bits >>> 24) & 0xffL);
bytBits[4] = (char)((bits >>> 32) & 0xffL);
bytBits[5] = (char)((bits >>> 40) & 0xffL);
bytBits[6] = (char)((bits >>> 48) & 0xffL);
bytBits[7] = (char)((bits >>> 56) & 0xffL);
index = (int) this.lngByteCount%64;
if (index < 56 )
{
padLen = 56 - index;
}
else
{
padLen = 120 - index;
}
update(pad, padLen);
update(bytBits, 8);
}
private StringBuffer toHexString()
{
long myByte = 0;
StringBuffer mystring = new StringBuffer();
for (int j = 0; j < 4; ++j)
{
for (int i = 0; i < 32; i += 8)
{
myByte = (this.lngState[j] >>> i) & 0xFFL;
if (myByte < 16)
{
mystring.append("0" + Long.toHexString(myByte));
}
else
{
mystring.append(Long.toHexString(myByte));
}
}
}
return(mystring);
}
public void init()
{
this.lngByteCount = 0;
this.lngState[0] = 0x67452301L;
this.lngState[1] = 0xefcdab89L;
this.lngState[2] = 0x98badcfeL;
this.lngState[3] = 0x10325476L;
}
//
// MAIN routine with test data set
//
public static void main (String args [])
throws IOException
{
String strTestData;
char chrTestData[] = new char[64];
char chrTestBuffer[] = new char[1000];
MD5 md5Test = new MD5();
strTestData = new String("");
chrTestData = strTestData.toCharArray();
md5Test.update(chrTestData,chrTestData.length);
md5Test.md5final();
System.out.println("MD5 (" + strTestData +") = " + md5Test.toHexString() );
md5Test.init();
strTestData = new String("a");
chrTestData = strTestData.toCharArray();
md5Test.update(chrTestData,chrTestData.length);
md5Test.md5final();
System.out.println("MD5 (" + strTestData +") = " + md5Test.toHexString() );
md5Test.init();
strTestData = new String("abc");
chrTestData = strTestData.toCharArray();
md5Test.update(chrTestData,chrTestData.length);
md5Test.md5final();
System.out.println("MD5 (" + strTestData +") = " + md5Test.toHexString() );
md5Test.init();
strTestData = new String("message digest");
chrTestData = strTestData.toCharArray();
md5Test.update(chrTestData,chrTestData.length);
md5Test.md5final();
System.out.println("MD5 (" + strTestData +") = " + md5Test.toHexString() );
md5Test.init();
strTestData = new String("abcdefghijklmnopqrstuvwxyz");
chrTestData = strTestData.toCharArray();
md5Test.update(chrTestData,chrTestData.length);
md5Test.md5final();
System.out.println("MD5 (" + strTestData +") = " + md5Test.toHexString() );
md5Test.init();
strTestData = new String("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
chrTestData = strTestData.toCharArray();
md5Test.update(chrTestData,chrTestData.length);
md5Test.md5final();
System.out.println("MD5 (" + strTestData +") = " + md5Test.toHexString() );
md5Test.init();
strTestData = new String("12345678901234567890123456789012345678901234567890123456789012345678901234567890");
chrTestData = strTestData.toCharArray();
md5Test.update(chrTestData,chrTestData.length);
md5Test.md5final();
System.out.println("MD5 (" + strTestData +") = " + md5Test.toHexString() );
/*
for (int i = 0; i < chrTestBuffer.length; ++i)
{
chrTestBuffer[i] = (char) (i & 0xff);
}
long time1 = System.currentTimeMillis();
md5Test.init();
for (int i = 0; i < 100000; ++i)
{
md5Test.update(chrTestBuffer,chrTestBuffer.length);
}
md5Test.md5final();
long time2 = (System.currentTimeMillis() - time1)/1000;
System.out.println("MD5 Speed Test: " + time2 + "sec = " + md5Test.toHexString() );
*/
}
}
| soywiz-archive/phpJavaVM | sample/src/MD5.java |
249,047 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class RunVAF extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java GUI class to calculate velocity autocorrelation
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
public static RunVAF job;
private static GUI home;
private static String atname;
private static boolean form;
private static double[] xx,yy;
private static int[] imd,msm;
private static String[] name;
private static double[] chge,weight;
private static double[][] xyz,vel,frc,vaf;
private static double[][][] vaf0;
private static int npnts,nconf,nvaf,isampl,iovaf;
private static JTextField atom1,history,configs,length,sample,origin;
private static JCheckBox format;
private static JButton run,close;
// Define the Graphical User Interface
public RunVAF() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
setTitle("VAF Panel");
getContentPane().setBackground(art.back);
getContentPane().setForeground(art.fore);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Define the Run button
run = new JButton("Run");
run.setBackground(art.butn);
run.setForeground(art.butf);
fix(run,grd,gbc,0,0,1,1);
fix(new JLabel(" "),grd,gbc,1,0,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,2,0,1,1);
// Name of HISTORY file
JLabel lab1 = new JLabel("Required HISTORY file:",JLabel.LEFT);
fix(lab1,grd,gbc,0,1,3,1);
history = new JTextField(18);
history.setBackground(art.scrn);
history.setForeground(art.scrf);
fix(history,grd,gbc,0,2,3,1);
// History file format
format=new JCheckBox("Formatted");
format.setBackground(art.back);
format.setForeground(art.fore);
//fix(format,grd,gbc,0,3,1,1);
JLabel lab2 = new JLabel("file?",JLabel.LEFT);
//fix(lab2,grd,gbc,1,3,2,1);
// Name of atomic species
JLabel lab3 = new JLabel("Atom name:",JLabel.LEFT);
fix(lab3,grd,gbc,0,4,2,1);
atom1 = new JTextField(8);
atom1.setBackground(art.scrn);
atom1.setForeground(art.scrf);
fix(atom1,grd,gbc,2,4,1,1);
// Number of configurations
JLabel lab4 = new JLabel("No. configurations:",JLabel.LEFT);
fix(lab4,grd,gbc,0,5,2,1);
configs = new JTextField(8);
configs.setBackground(art.scrn);
configs.setForeground(art.scrf);
fix(configs,grd,gbc,2,5,1,1);
// VAF array length
JLabel lab5 = new JLabel("VAF array length:",JLabel.LEFT);
fix(lab5,grd,gbc,0,6,2,1);
length = new JTextField(8);
length.setBackground(art.scrn);
length.setForeground(art.scrf);
fix(length,grd,gbc,2,6,1,1);
// Sampling interval
JLabel lab6 = new JLabel("Sampling interval:",JLabel.LEFT);
fix(lab6,grd,gbc,0,7,2,1);
sample = new JTextField(8);
sample.setBackground(art.scrn);
sample.setForeground(art.scrf);
fix(sample,grd,gbc,2,7,1,1);
// Origin interval
JLabel lab7 = new JLabel("Origin interval:",JLabel.LEFT);
fix(lab7,grd,gbc,0,8,2,1);
origin = new JTextField(8);
origin.setBackground(art.scrn);
origin.setForeground(art.scrf);
fix(origin,grd,gbc,2,8,1,1);
// Register action buttons
run.addActionListener(this);
close.addActionListener(this);
}
public RunVAF(GUI here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
home=here;
println("Activated VAF panel");
job=new RunVAF();
job.pack();
job.setVisible(true);
npnts=0;
form=true;
atname="ALL";
fname="HISTORY";
nconf=1000;
nvaf=512;
isampl=1;
iovaf=1;
format.setSelected(form);
atom1.setText(atname);
history.setText(fname);
configs.setText(String.valueOf(nconf));
length.setText(String.valueOf(nvaf));
sample.setText(String.valueOf(isampl));
origin.setText(String.valueOf(iovaf));
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Run")) {
form=format.isSelected();
atname=atom1.getText();
fname=history.getText();
nconf=BML.giveInteger(configs.getText(),1);
nvaf=BML.giveInteger(length.getText(),1);
isampl=BML.giveInteger(sample.getText(),1);
iovaf=BML.giveInteger(origin.getText(),1);
println("Started VAF calculation .....");
npnts=calcVAF();
if(npnts>0) {
vafXY(npnts,atname);
if(graf != null)
graf.job.dispose();
graf=new GraphDraw(home);
graf.xlabel.setText("Time (ps)");
graf.ylabel.setText("VAF");
graf.plabel.setText("VAF of "+atname.trim());
graf.extraPlot(npnts,xx,yy);
}
}
else if (arg.equals("Close")) {
job.dispose();
}
}
int calcVAF() {
/*
*********************************************************************
dl_poly/java routine to calculate velocity autocorrelation function
for selected atoms from dl_poly HISTORY file
copyright - daresbury laboratory
author - w.smith march 2001
*********************************************************************
*/
boolean all;
int m,n,nat,natms,novaf,lsr,msr,nsvaf,imcon,iconf;
double rnorm,vsum,tstep;
LineNumberReader lnr=null;
double cell[]=new double[9];
double info[]=new double[10];
nat=0;
npnts=0;
all=false;
tstep=0.0;
if(atname.toUpperCase().equals("ALL"))all=true;
if(nvaf%iovaf != 0) {
nvaf=iovaf*(nvaf/iovaf);
println("Warning - vaf array dimension reset to "+BML.fmt(nvaf,8));
}
novaf=nvaf/iovaf;
imd=new int[nvaf];
msm=new int[nvaf];
xx=new double[nvaf];
yy=new double[nvaf];
// write control variables
println("Name of target HISTORY file : "+fname);
println("Label of atom of interest : "+atname);
println("Length of correlation arrays : "+BML.fmt(nvaf,8));
println("Number of configurations : "+BML.fmt(nconf,8));
println("Sampling interval : "+BML.fmt(isampl,8));
println("Interval between origins : "+BML.fmt(iovaf,8));
// initialise vaf variables
lsr=0;
msr=-1;
nsvaf=0;
// initialise control parameters for HISTORY file reader
info[0]=0.0;
info[1]=999999.;
info[2]=1.0;
info[3]=0.0;
info[4]=0.0;
info[5]=0.0;
if(form) {
lnr=hread(fname,name,lnr,info,cell,chge,weight,xyz,vel,frc);
if(BML.nint(info[3])<0 && BML.nint(info[3])!=-1) {
println("Error - cannot open HISTORY file");
return -1;
}
}
else {
println("Error - unformatted read option not active");
return -2;
}
natms=BML.nint(info[7]);
//initialise vaf arrays
name=new String[natms];
chge=new double[natms];
weight=new double[natms];
xyz=new double[3][natms];
vel=new double[3][natms];
vaf=new double[nvaf][natms];
vaf0=new double[nvaf][natms][3];
for(int j=0;j<nvaf;j++) {
msm[j]=0;
for(int i=0;i<natms;i++) {
vaf[j][i]=0.0;
vaf0[j][i][0]=0.0;
vaf0[j][i][1]=0.0;
vaf0[j][i][2]=0.0;
}
}
OUT:
for(iconf=0;iconf<nconf;iconf++) {
lnr=hread(fname,name,lnr,info,cell,chge,weight,xyz,vel,frc);
if(BML.nint(info[3])<0 && BML.nint(info[3])!=-1) {
println("Error - HISTORY file data error");
info[0]=-1.0;
return -3;
}
if(lnr == null)break OUT;
if(iconf==0)info[9]=info[6];
if(iconf==1)tstep=info[8]*(info[6]-info[9]);
if(BML.nint(info[3])==-1)break OUT;
if(iconf%isampl==0) {
n=0;
for(int i=0;i<natms;i++) {
if(all || name[i].equals(atname)) {
if(n==natms) {
println("Error - too many atoms of specified type");
info[0]=-1.0;
lnr=hread(fname,name,lnr,info,cell,chge,weight,xyz,vel,frc);
return -4;
}
vel[0][n]=vel[0][i];
vel[1][n]=vel[1][i];
vel[2][n]=vel[2][i];
n++;
}
}
nat=n;
if(iconf==0) {
println("Number of atoms of selected type : "+BML.fmt(nat,8));
}
if(nat == 0) {
println("Error - zero atoms of specified type");
info[0]=-1.0;
lnr=hread(fname,name,lnr,info,cell,chge,weight,xyz,vel,frc);
return -5;
}
// calculate velocity autocorrelation
if(nsvaf%iovaf==0) {
lsr=Math.min(lsr+1,novaf);
msr=(msr+1)%novaf;
imd[msr]=0;
for(int i=0;i<nat;i++) {
vaf0[msr][i][0]=vel[0][i];
vaf0[msr][i][1]=vel[1][i];
vaf0[msr][i][2]=vel[2][i];
}
}
nsvaf++;
for(int j=0;j<lsr;j++) {
m=imd[j];
imd[j]=m+1;
msm[m]++;
for(int i=0;i<nat;i++) {
vaf[m][i]+=(vel[0][i]*vaf0[j][i][0]+vel[1][i]*vaf0[j][i][1]+
vel[2][i]*vaf0[j][i][2]);
}
}
}
}
if(iconf==nconf-1) {
info[0]=-1.0;
lnr=hread(fname,name,lnr,info,cell,chge,weight,xyz,vel,frc);
}
if(BML.nint(info[3])==-1) iconf--;
npnts=Math.min(nsvaf,nvaf);
println("Number of configurations read: "+BML.fmt(iconf,8));
// normalise mean square displacement
for(int i=0;i<nat;i++) {
rnorm=((double)msm[0])/vaf[0][i];
for(int j=0;j<npnts;j++)
vaf[j][i]*=(rnorm/msm[j]);
}
// average velocity autocorrelation function
for(int j=0;j<npnts;j++) {
vsum=0.0;
for(int i=0;i<nat;i++)
vsum+=vaf[j][i];
xx[j]=tstep*j*isampl;
yy[j]=vsum/nat;
}
return npnts;
}
void vafXY(int npts,String anam1) {
/*
*********************************************************************
dl_poly/java GUI routine to create a VAF XY file
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String fname;
String[] header;
int nhead=4,call;
header=new String[nhead];
fname="VAF"+String.valueOf(numvaf)+".XY";
numvaf++;
header[0]=" VAF Plotting Program";
header[1]=" VAF Plot: "+anam1.trim();
header[2]=" Time (ps)";
header[3]=" VAF";
call=putXY(fname,header,nhead,npts,xx,yy);
if(call==0)
println("PLOT file "+fname+" created");
}
}
| dlpolyquantum/dlpoly_quantum | java/RunVAF.java |
249,049 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class RunFAF extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java GUI class to calculate force autocorrelation
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
public static RunFAF job;
private static GUI home;
private static String atname;
private static boolean form;
private static double[] xx,yy;
private static int[] imd,msm;
private static String[] name;
private static double[] chge,weight;
private static double[][] faf,xyz,vel,frc;
private static double[][][] faf0;
private static int npnts,nconf,nfaf,isampl,iofaf;
private static JTextField atom1,history,configs,length,sample,origin;
private static JCheckBox format;
private static JButton run,close;
// Define the Graphical User Interface
public RunFAF() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
setTitle("FAF Panel");
getContentPane().setBackground(art.back);
getContentPane().setForeground(art.fore);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Define the Run button
run = new JButton("Run");
run.setBackground(art.butn);
run.setForeground(art.butf);
fix(run,grd,gbc,0,0,1,1);
fix(new JLabel(" "),grd,gbc,1,0,1,1);
// Define the Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,2,0,1,1);
// Name of HISTORY file
JLabel lab1 = new JLabel("Required HISTORY file:",JLabel.LEFT);
fix(lab1,grd,gbc,0,1,3,1);
history = new JTextField(18);
history.setBackground(art.scrn);
history.setForeground(art.scrf);
fix(history,grd,gbc,0,2,3,1);
// History file format
format=new JCheckBox("Formatted");
format.setBackground(art.back);
format.setForeground(art.fore);
//fix(format,grd,gbc,0,3,1,1);
JLabel lab2 = new JLabel("file?",JLabel.LEFT);
//fix(lab2,grd,gbc,1,3,2,1);
// Name of atomic species
JLabel lab3 = new JLabel("Atom name:",JLabel.LEFT);
fix(lab3,grd,gbc,0,4,2,1);
atom1 = new JTextField(8);
atom1.setBackground(art.scrn);
atom1.setForeground(art.scrf);
fix(atom1,grd,gbc,2,4,1,1);
// Number of configurations
JLabel lab4 = new JLabel("No. configurations:",JLabel.LEFT);
fix(lab4,grd,gbc,0,5,2,1);
configs = new JTextField(8);
configs.setBackground(art.scrn);
configs.setForeground(art.scrf);
fix(configs,grd,gbc,2,5,1,1);
// FAF array length
JLabel lab5 = new JLabel("FAF array length:",JLabel.LEFT);
fix(lab5,grd,gbc,0,6,2,1);
length = new JTextField(8);
length.setBackground(art.scrn);
length.setForeground(art.scrf);
fix(length,grd,gbc,2,6,1,1);
// Sampling interval
JLabel lab6 = new JLabel("Sampling interval:",JLabel.LEFT);
fix(lab6,grd,gbc,0,7,2,1);
sample = new JTextField(8);
sample.setBackground(art.scrn);
sample.setForeground(art.scrf);
fix(sample,grd,gbc,2,7,1,1);
// Origin interval
JLabel lab7 = new JLabel("Origin interval:",JLabel.LEFT);
fix(lab7,grd,gbc,0,8,2,1);
origin = new JTextField(8);
origin.setBackground(art.scrn);
origin.setForeground(art.scrf);
fix(origin,grd,gbc,2,8,1,1);
// Register action buttons
run.addActionListener(this);
close.addActionListener(this);
}
public RunFAF(GUI here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
home=here;
println("Activated FAF panel");
job=new RunFAF();
job.pack();
job.setVisible(true);
npnts=0;
form=true;
atname="ALL";
fname="HISTORY";
nconf=1000;
nfaf=512;
isampl=1;
iofaf=1;
format.setSelected(form);
atom1.setText(atname);
history.setText(fname);
configs.setText(String.valueOf(nconf));
length.setText(String.valueOf(nfaf));
sample.setText(String.valueOf(isampl));
origin.setText(String.valueOf(iofaf));
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Run")) {
form=format.isSelected();
atname=atom1.getText();
fname=history.getText();
nconf=BML.giveInteger(configs.getText(),1);
nfaf=BML.giveInteger(length.getText(),1);
isampl=BML.giveInteger(sample.getText(),1);
iofaf=BML.giveInteger(origin.getText(),1);
println("Started FAF calculation .....");
npnts=calcFAF();
if(npnts>0) {
fafXY(npnts,atname);
if(graf != null)
graf.job.dispose();
graf=new GraphDraw(home);
graf.xlabel.setText("Time (ps)");
graf.ylabel.setText("<f(t).f(0)>");
graf.plabel.setText("FAF of "+atname.trim());
graf.extraPlot(npnts,xx,yy);
}
}
else if (arg.equals("Close")) {
job.dispose();
}
}
int calcFAF() {
/*
*********************************************************************
dl_poly/java routine to calculate velocity autocorrelation function
for selected atoms from dl_poly HISTORY file
copyright - daresbury laboratory
author - w.smith march 2001
*********************************************************************
*/
boolean all;
int m,n,nat,natms,nofaf,lsr,msr,nsfaf,imcon,iconf;
double rnorm,fsum,tstep;
LineNumberReader lnr=null;
double cell[]=new double[9];
double info[]=new double[10];
nat=0;
npnts=0;
all=false;
tstep=0.0;
if(atname.toUpperCase().equals("ALL"))all=true;
if(nfaf%iofaf != 0) {
nfaf=iofaf*(nfaf/iofaf);
println("Warning - faf array dimension reset to "+BML.fmt(nfaf,8));
}
nofaf=nfaf/iofaf;
msm=new int[nfaf];
imd=new int[nfaf];
xx=new double[nfaf];
yy=new double[nfaf];
// write control variables
println("Name of target HISTORY file : "+fname);
println("Label of atom of interest : "+atname);
println("Length of correlation arrays : "+BML.fmt(nfaf,8));
println("Number of configurations : "+BML.fmt(nconf,8));
println("Sampling interval : "+BML.fmt(isampl,8));
println("Interval between origins : "+BML.fmt(iofaf,8));
// initialise faf variables
lsr=0;
msr=-1;
nsfaf=0;
// initialise control parameters for HISTORY file reader
info[0]=0.0;
info[1]=999999.;
info[2]=2.0;
info[3]=0.0;
info[4]=0.0;
info[5]=0.0;
if(form) {
lnr=hread(fname,name,lnr,info,cell,chge,weight,xyz,vel,frc);
if(BML.nint(info[3])<0 && BML.nint(info[3])!=-1) {
println("Error - HISTORY file data error");
return -1;
}
}
else {
println("Error - unformatted read option not active");
return -2;
}
natms=BML.nint(info[7]);
// initialise faf arrays
name=new String[natms];
chge=new double[natms];
weight=new double[natms];
faf=new double[nfaf][natms];
xyz=new double[3][natms];
vel=new double[3][natms];
frc=new double[3][natms];
faf0=new double[nfaf][natms][3];
for(int j=0;j<nfaf;j++) {
msm[j]=0;
for(int i=0;i<natms;i++) {
faf[j][i]=0.0;
faf0[j][i][0]=0.0;
faf0[j][i][1]=0.0;
faf0[j][i][2]=0.0;
}
}
OUT:
for(iconf=0;iconf<nconf;iconf++) {
lnr=hread(fname,name,lnr,info,cell,chge,weight,xyz,vel,frc);
if(BML.nint(info[3])<0 && BML.nint(info[3])!=-1) {
println("Error - HISTORY file data error");
info[0]=-1.0;
lnr=hread(fname,name,lnr,info,cell,chge,weight,xyz,vel,frc);
return -3;
}
if(lnr == null)break OUT;
if(iconf==0)info[9]=info[6];
if(iconf==1)tstep=info[8]*(info[6]-info[9]);
if(BML.nint(info[3])==-1)break OUT;
if(iconf%isampl==0) {
n=0;
for(int i=0;i<natms;i++) {
if(all || name[i].equals(atname)) {
if(n==natms) {
println("Error - too many atoms of specified type");
info[0]=-1.0;
lnr=hread(fname,name,lnr,info,cell,chge,weight,xyz,vel,frc);
return -4;
}
frc[0][n]=frc[0][i];
frc[1][n]=frc[1][i];
frc[2][n]=frc[2][i];
n++;
}
}
nat=n;
if(iconf==0) {
println("Number of atoms of selected type : "+BML.fmt(nat,8));
}
if(nat == 0) {
println("Error - zero atoms of specified type");
info[0]=-1.0;
lnr=hread(fname,name,lnr,info,cell,chge,weight,xyz,vel,frc);
return -5;
}
// calculate velocity autocorrelation
if(nsfaf%iofaf==0) {
lsr=Math.min(lsr+1,nofaf);
msr=(msr+1)%nofaf;
imd[msr]=0;
for(int i=0;i<nat;i++) {
faf0[msr][i][0]=frc[0][i];
faf0[msr][i][1]=frc[1][i];
faf0[msr][i][2]=frc[2][i];
}
}
nsfaf++;
for(int j=0;j<lsr;j++) {
m=imd[j];
imd[j]=m+1;
msm[m]++;
for(int i=0;i<nat;i++) {
faf[m][i]+=(frc[0][i]*faf0[j][i][0]+frc[1][i]*faf0[j][i][1]+
frc[2][i]*faf0[j][i][2]);
}
}
}
}
if(iconf==nconf-1) {
info[0]=-1.0;
lnr=hread(fname,name,lnr,info,cell,chge,weight,xyz,vel,frc);
}
if(BML.nint(info[3])==-1) iconf--;
npnts=Math.min(nsfaf,nfaf);
println("Number of configurations read: "+BML.fmt(iconf,8));
// normalise mean square displacement
for(int i=0;i<nat;i++) {
rnorm=((double)msm[0])/faf[0][i];
for(int j=0;j<npnts;j++) {
faf[j][i]*=(rnorm/msm[j]);
}
}
// average velocity autocorrelation function
for(int j=0;j<npnts;j++) {
fsum=0.0;
for(int i=0;i<nat;i++)
fsum+=faf[j][i];
xx[j]=tstep*j*isampl;
yy[j]=fsum/nat;
}
return npnts;
}
void fafXY(int npts,String anam1) {
/*
*********************************************************************
dl_poly/java GUI routine to create a FAF XY file
copyright - daresbury laboratory
author - w.smith 2001
*********************************************************************
*/
String fname;
String[] header;
int nhead=4,call;
header=new String[nhead];
fname="FAF"+String.valueOf(numfaf)+".XY";
numfaf++;
header[0]=" FAF Plotting Program";
header[1]=" FAF Plot: "+anam1.trim();
header[2]=" Time (ps)";
header[3]=" FAF";
call=putXY(fname,header,nhead,npts,xx,yy);
if(call==0)
println("PLOT file "+fname+" created");
}
}
| dlpolyquantum/dlpoly_quantum | java/RunFAF.java |
249,051 | import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
public class DataArchiver extends Basic implements ActionListener {
/*
*********************************************************************
dl_poly/java GUI class for data archive methods
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
private static GUI home;
public static DataArchiver job;
private static JButton select,store,fetch,info,close;
private static JTextField dirold,dirnew;
private static JComboBox<String> test;
private static String dname="DEFAULT";
private static WarningBox danger;
// Define the Graphical User Interface
public DataArchiver() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
super();
setTitle("Data Archive");
getContentPane().setBackground(art.back);
getContentPane().setForeground(art.fore);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setFont(fontMain);
GridBagLayout grd = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
getContentPane().setLayout(grd);
gbc.fill=GridBagConstraints.BOTH;
// Input file selection
JLabel lab1=new JLabel("Select standard test case.....");
fix(lab1,grd,gbc,0,0,3,1);
// Select button
select = new JButton("Select");
select.setBackground(art.butn);
select.setForeground(art.butf);
fix(select,grd,gbc,0,1,1,1);
// Test case choice
test = new JComboBox<String>();
test.setBackground(art.scrn);
test.setForeground(art.scrf);
test.addItem("TEST1");
test.addItem("TEST2");
test.addItem("TEST3");
test.addItem("TEST4");
test.addItem("TEST5");
test.addItem("TEST6");
test.addItem("TEST7");
test.addItem("TEST8");
test.addItem("TEST9");
test.addItem("TEST10");
test.addItem("TEST11");
test.addItem("TEST12");
test.addItem("TEST13");
test.addItem("TEST14");
test.addItem("TEST15");
test.addItem("TEST16");
test.addItem("TEST17");
test.addItem("TEST18");
test.addItem("TEST19");
test.addItem("TEST20");
fix(test,grd,gbc,2,1,1,1);
// Copy files from archive
JLabel lab2=new JLabel("Data retrieval:");
fix(lab2,grd,gbc,0,2,1,1);
JLabel lab4=new JLabel("Directory: ",JLabel.RIGHT);
fix(lab4,grd,gbc,2,2,1,1);
// Fetch files from archive
fetch = new JButton("Fetch");
fetch.setBackground(art.butn);
fetch.setForeground(art.butf);
fix(fetch,grd,gbc,0,3,1,1);
dirold = new JTextField(dname);
dirold.setBackground(art.scrn);
dirold.setForeground(art.scrf);
fix(dirold,grd,gbc,2,3,1,1);
// Move files to archive
JLabel lab3=new JLabel("Data storage:");
fix(lab3,grd,gbc,0,4,1,1);
JLabel lab5=new JLabel("Directory: ",JLabel.RIGHT);
fix(lab5,grd,gbc,2,4,1,1);
store = new JButton("Store");
store.setBackground(art.butn);
store.setForeground(art.butf);
fix(store,grd,gbc,0,5,1,1);
dirnew = new JTextField(dname);
dirnew.setBackground(art.scrn);
dirnew.setForeground(art.scrf);
fix(dirnew,grd,gbc,2,5,1,1);
// pad out
JLabel lab6=new JLabel(" ");
fix(lab6,grd,gbc,1,6,1,1);
// Information button
info = new JButton("Info");
info.setBackground(art.butn);
info.setForeground(art.butf);
fix(info,grd,gbc,0,7,1,1);
// Close button
close = new JButton("Close");
close.setBackground(art.butn);
close.setForeground(art.butf);
fix(close,grd,gbc,2,7,1,1);
// Register action buttons
select.addActionListener(this);
info.addActionListener(this);
fetch.addActionListener(this);
store.addActionListener(this);
close.addActionListener(this);
}
public DataArchiver(GUI here) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
home=here;
println("Activated DL_POLY DataArchiver");
job=new DataArchiver();
job.pack();
job.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
String arg = (String)e.getActionCommand();
if (arg.equals("Select")) {
dname=test.getSelectedItem().toString()+"/LF";
println("About to overwrite current DL_POLY I/O files");
danger=new WarningBox(home,"Warning!",true);
danger.setVisible(true);
if(alert)
fetchFiles();
else
println("Operation cancelled");
}
else if (arg.equals("Fetch")) {
dname=dirold.getText();
println("About to overwrite current DL_POLY I/O files");
danger=new WarningBox(home,"Warning!",true);
danger.setVisible(true);
if(alert)
fetchFiles();
else
println("Operation cancelled");
}
else if (arg.equals("Store")) {
dname=dirnew.getText();
storeFiles();
}
else if (arg.equals("Info")) {
viewResource("TestInfo");
}
else if (arg.equals("Close")) {
job.dispose();
}
}
void fetchFiles() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
File f=null;
String fname="";
println("Fetching DL_POLY files from directory "+dname+".....");
if((f=new File(fname="../data/"+dname.trim()+"/CONTROL")).exists()) {
if(copyFile(fname,"CONTROL"))
println("File CONTROL copied");
}
else {
println("CONTROL file not found");
}
if((f=new File(fname="../data/"+dname.trim()+"/CONFIG")).exists()) {
if(copyFile(fname,"CONFIG"))
println("File CONFIG copied");
}
else {
println("CONFIG file not found");
}
if((f=new File(fname="../data/"+dname.trim()+"/FIELD")).exists()) {
if(copyFile(fname,"FIELD"))
println("File FIELD copied");
}
else {
println("FIELD file not found");
}
if((f=new File(fname="../data/"+dname.trim()+"/TABLE")).exists()) {
if(copyFile(fname,"TABLE"))
println("File TABLE copied");
}
else {
println("TABLE file not found");
}
if((f=new File(fname="../data/"+dname.trim()+"/REVIVE")).exists()) {
if(copyFile(fname,"REVIVE"))
println("File REVIVE copied");
}
else {
println("REVIVE file not found");
}
if((f=new File(fname="../data/"+dname.trim()+"/REVCON")).exists()) {
if(copyFile(fname,"REVCON"))
println("File REVCON copied");
}
else {
println("REVCON file not found");
}
if((f=new File(fname="../data/"+dname.trim()+"/OUTPUT")).exists()) {
if(copyFile(fname,"OUTPUT"))
println("File OUTPUT copied");
}
else {
println("OUTPUT file not found");
}
if((f=new File(fname="../data/"+dname.trim()+"/STATIS")).exists()) {
if(copyFile(fname,"STATIS"))
println("File STATIS copied");
}
else {
println("STATIS file not found");
}
if((f=new File(fname="../data/"+dname.trim()+"/HISTORY")).exists()) {
if(copyFile(fname,"HISTORY"))
println("File HISTORY copied");
}
else {
println("HISTORY file not found");
}
if((f=new File(fname="../data/"+dname.trim()+"/REVOLD")).exists()) {
if(copyFile(fname,"REVOLD"))
println("File REVOLD copied");
}
else {
println("REVOLD file not found");
}
println("DL_POLY file copy completed");
}
void storeFiles() {
/*
*********************************************************************
dl_poly/java GUI routine
copyright - daresbury laboratory
author - w.smith 2000
*********************************************************************
*/
File f=null;
String fname="";
println("Storing DL_POLY files in directory "+dname+".....");
if(!(f=new File("../data/"+dname.trim())).exists()) {
(new File("../data/"+dname.trim())).mkdir();
if((f=new File("CONTROL")).exists()) {
fname="../data/"+dname.trim()+"/CONTROL";
copyFile("CONTROL",fname);
println("File CONTROL stored");
f.delete();
}
if((f=new File("CONFIG")).exists()) {
fname="../data/"+dname.trim()+"/CONFIG";
copyFile("CONFIG",fname);
println("File CONFIG stored");
f.delete();
}
if((f=new File("FIELD")).exists()) {
fname="../data/"+dname.trim()+"/FIELD";
copyFile("FIELD",fname);
println("File FIELD stored");
f.delete();
}
if((f=new File("TABLE")).exists()) {
fname="../data/"+dname.trim()+"/TABLE";
copyFile("TABLE",fname);
println("File TABLE stored");
f.delete();
}
if((f=new File("OUTPUT")).exists()) {
fname="../data/"+dname.trim()+"/OUTPUT";
copyFile("OUTPUT",fname);
println("File OUTPUT stored");
f.delete();
}
if((f=new File("REVIVE")).exists()) {
fname="../data/"+dname.trim()+"/REVIVE";
copyFile("REVIVE",fname);
println("File REVIVE stored");
f.delete();
}
if((f=new File("REVOLD")).exists()) {
fname="../data/"+dname.trim()+"/REVOLD";
copyFile("REVOLD",fname);
println("File REVOLD stored");
f.delete();
}
if((f=new File("REVCON")).exists()) {
fname="../data/"+dname.trim()+"/REVCON";
copyFile("REVCON",fname);
println("File REVCON stored");
f.delete();
}
if((f=new File("STATIS")).exists()) {
fname="../data/"+dname.trim()+"/STATIS";
copyFile("STATIS",fname);
println("File STATIS stored");
f.delete();
}
if((f=new File("HISTORY")).exists()) {
fname="../data/"+dname.trim()+"/HISTORY";
copyFile("HISTORY",fname);
println("File HISTORY stored");
f.delete();
}
println("DL_POLY files stored");
}
else {
println("Error - nominated storage directory already exists");
}
}
}
| dlpolyquantum/dlpoly_quantum | java/DataArchiver.java |
249,052 | // ****************************************************************************
//
// Copyright (c) 2000 - 2014, Lawrence Livermore National Security, LLC
// Produced at the Lawrence Livermore National Laboratory
// LLNL-CODE-442911
// All rights reserved.
//
// This file is part of VisIt. For details, see https://visit.llnl.gov/. The
// full copyright notice is contained in the file COPYRIGHT located at the root
// of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the disclaimer below.
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the disclaimer (as noted below) in the
// documentation and/or other materials provided with the distribution.
// - Neither the name of the LLNS/LLNL nor the names of its contributors may
// be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
// LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// ****************************************************************************
import llnl.visit.ViewerProxy;
import java.util.Vector;
// ****************************************************************************
// Class: OpenGUI
//
// Purpose:
// This class implements an example program that shows how to use the
// ViewerProxy class and control VisIt's viewer from Java.
//
// Notes:
//
// Programmer: Brad Whitlock
// Creation: Mon Aug 17 13:40:40 PDT 2009
//
// Modifications:
//
// ****************************************************************************
public class OpenGUI extends RunViewer
{
public OpenGUI()
{
super();
}
protected void work(String[] args)
{
// Do a plot of the data.
String db = new String("globe.silo");
if(viewer.GetViewerMethods().OpenDatabase(viewer.GetDataPath() + db))
{
viewer.GetViewerMethods().AddPlot("Pseudocolor", "u");
viewer.GetViewerMethods().AddPlot("Mesh", "mesh1");
viewer.GetViewerMethods().DrawPlots();
}
else
{
System.out.println("Could not open the database!");
}
// Open the VisIt GUI.
String clientName = new String("GUI");
String clientProgram = new String("visit");
Vector clientArgs = new Vector();
clientArgs.add(new String("-gui"));
viewer.GetViewerMethods().OpenClient(clientName, clientProgram, clientArgs);
}
public static void main(String args[])
{
OpenGUI r = new OpenGUI();
r.run(args);
}
}
| ahota/visit_intel | java/OpenGUI.java |
249,053 | public class LabRunner{
public static void main(String args[]){
System.out.println("Number of labs: "+Lab.numberOfLabs);
System.out.println("Lab Names "+Lab.labNames);
System.out.println("Equipents in Lab are: "+Lab.labEquipments);
System.out.println("Loaction of lab: "+Lab.labLocation);
System.out.println("Laboratory Assistant Staff are: "+Lab.noOfStaff);
System.out.println("Duration of lab is: "+Lab.noOfStaff+"hrs");
}
}
| Pratiksha-M2907/Java | LabRunner.java |