1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-05 23:22:47 +00:00

Source code cleanup

This commit is contained in:
2012-03-25 15:57:51 -03:00
parent 10cb453d4a
commit 1084905350
109 changed files with 6961 additions and 7236 deletions

View File

@@ -88,7 +88,7 @@ public class NPCTemplateConverter {
Class.forName("com.mysql.jdbc.Driver");
final File target = new File("generated/template/npc");
System.out.println("Scaning legacy HTML files...");
htmlScannedFiles = FileUtils.listFiles(L2J_HTML_FOLDER, new String[] {
"html", "htm" }, true);
@@ -131,15 +131,15 @@ public class NPCTemplateConverter {
}
System.out.println("Generating template XML files...");
// c.generateSchema(new SchemaOutputResolver() {
// @Override
// public Result createOutput(String namespaceUri,
// String suggestedFileName) throws IOException {
// // System.out.println(new File(target, suggestedFileName));
// // return null;
// return new StreamResult(new File(target, suggestedFileName));
// }
// });
// c.generateSchema(new SchemaOutputResolver() {
// @Override
// public Result createOutput(String namespaceUri,
// String suggestedFileName) throws IOException {
// // System.out.println(new File(target, suggestedFileName));
// // return null;
// return new StreamResult(new File(target, suggestedFileName));
// }
// });
try {
final Marshaller m = c.createMarshaller();
@@ -225,7 +225,7 @@ public class NPCTemplateConverter {
template.getInfo().setName(factory.createNPCTemplateInfoName());
template.getInfo().getName().setValue(rs.getString("name"));
//template.getInfo().getName().setDisplay(rs.getBoolean("show_name"));
// template.getInfo().getName().setDisplay(rs.getBoolean("show_name"));
template.getInfo().getName().setSend(rs.getBoolean("serverSideName"));
template.getInfo().setTitle(factory.createNPCTemplateInfoTitle());
@@ -243,9 +243,9 @@ public class NPCTemplateConverter {
template.getInfo().setSex(
ActorSex.valueOf(rs.getString("sex").toUpperCase()));
// template.info.attackable = rs.getBoolean("attackable");
//template.getInfo().setTargetable(rs.getBoolean("targetable"));
// template.getInfo().setTargetable(rs.getBoolean("targetable"));
template.getInfo().setTargetable(true);
//template.getInfo().setAggressive(rs.getBoolean("aggro"));
// template.getInfo().setAggressive(rs.getBoolean("aggro"));
template.getInfo().setAggressive(true);
template.getInfo().setAttackable(true); // FIXME
@@ -351,9 +351,9 @@ public class NPCTemplateConverter {
final ResultSet rs = st.getResultSet();
while (rs.next()) {
final Droplist.Item item = factory.createNPCTemplateDroplistItem();
item.setId( new ItemTemplateID(rs.getInt("itemId"), null));
item.setId(new ItemTemplateID(rs.getInt("itemId"), null));
item.setMin(rs.getInt("min"));
item.setMax( rs.getInt("max"));
item.setMax(rs.getInt("max"));
item.setChance(rs.getInt("chance"));
item.setCategory(getCategory(rs.getInt("category")));
drops.getItem().add(item);
@@ -363,7 +363,8 @@ public class NPCTemplateConverter {
return drops;
}
private static Talk fillHtmlChat(final ObjectFactory factory, int npcId) throws IOException {
private static Talk fillHtmlChat(final ObjectFactory factory, int npcId)
throws IOException {
final Talk talk = factory.createNPCTemplateTalk();
talk.setDefault("default");
for (final File file : htmlScannedFiles) {
@@ -389,8 +390,8 @@ public class NPCTemplateConverter {
return talk;
}
private static Skills fillSkillList(final ObjectFactory factory, ResultSet npcRs, int npcId)
throws SQLException {
private static Skills fillSkillList(final ObjectFactory factory,
ResultSet npcRs, int npcId) throws SQLException {
final Connection conn = npcRs.getStatement().getConnection();
final Skills skills = factory.createNPCTemplateSkills();

View File

@@ -18,7 +18,6 @@ package com.l2jserver.tool;
import com.l2jserver.model.template.character.CharacterClass;
public class CharacterSQLEnumGenerator {
public static void main(String[] args) {
System.out.println("== 'Character' SQL STATEMENT ==");

View File

@@ -18,8 +18,6 @@ package com.l2jserver.tool;
import com.l2jserver.model.template.character.CharacterClass;
public class PacketSamuraiCharacterClassEnum {
public static void main(String[] args) {
System.out.println(createClassStatement());

View File

@@ -25,7 +25,8 @@ import com.l2jserver.service.network.model.SystemMessage;
public class PacketSamuraiSystemMessageEnumGenerator {
public static void main(String[] args) throws IOException {
System.out.println(createClassStatement());
Files.write(Paths.get("generated", "SystemMessageEnum.txt"), createClassStatement().getBytes());
Files.write(Paths.get("generated", "SystemMessageEnum.txt"),
createClassStatement().getBytes());
}
private static String createClassStatement() {

View File

@@ -18,7 +18,6 @@ package com.l2jserver.tool.conversor.itemtemplate;
import com.l2jserver.model.template.item.ItemMaterial;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*

View File

@@ -18,7 +18,6 @@ package com.l2jserver.tool.conversor.itemtemplate;
import com.l2jserver.model.template.item.ItemType;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*