Skip to content
Snippets Groups Projects
Commit a2c2094a authored by Chris Kearney's avatar Chris Kearney
Browse files

cleanup and the start of some logging

parent 4671d1b8
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,11 @@ ...@@ -57,6 +57,11 @@
<artifactId>concurrentlinkedhashmap-lru</artifactId> <artifactId>concurrentlinkedhashmap-lru</artifactId>
<version>1.4</version> <version>1.4</version>
</dependency> </dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies> </dependencies>
......
...@@ -7,17 +7,10 @@ import com.comandante.creeper.managers.SessionManager; ...@@ -7,17 +7,10 @@ import com.comandante.creeper.managers.SessionManager;
import com.comandante.creeper.npc.StreetHustler; import com.comandante.creeper.npc.StreetHustler;
import com.comandante.creeper.player.PlayerManager; import com.comandante.creeper.player.PlayerManager;
import com.comandante.creeper.player.PlayerMetadata; import com.comandante.creeper.player.PlayerMetadata;
import com.comandante.creeper.server.command.FightKillCommand;
import com.comandante.creeper.server.command.admin.BuildCommand;
import com.comandante.creeper.spawner.ItemSpawner;
import com.comandante.creeper.world.Area;
import com.comandante.creeper.world.MapsManager;
import com.comandante.creeper.world.Room;
import com.comandante.creeper.world.RoomManager;
import com.comandante.creeper.world.WorldExporter;
import com.comandante.creeper.server.CreeperCommandRegistry; import com.comandante.creeper.server.CreeperCommandRegistry;
import com.comandante.creeper.server.CreeperServer; import com.comandante.creeper.server.CreeperServer;
import com.comandante.creeper.server.command.DropCommand; import com.comandante.creeper.server.command.DropCommand;
import com.comandante.creeper.server.command.FightKillCommand;
import com.comandante.creeper.server.command.GossipCommand; import com.comandante.creeper.server.command.GossipCommand;
import com.comandante.creeper.server.command.InventoryCommand; import com.comandante.creeper.server.command.InventoryCommand;
import com.comandante.creeper.server.command.LookCommand; import com.comandante.creeper.server.command.LookCommand;
...@@ -29,17 +22,25 @@ import com.comandante.creeper.server.command.UnknownCommand; ...@@ -29,17 +22,25 @@ import com.comandante.creeper.server.command.UnknownCommand;
import com.comandante.creeper.server.command.UseCommand; import com.comandante.creeper.server.command.UseCommand;
import com.comandante.creeper.server.command.WhoCommand; import com.comandante.creeper.server.command.WhoCommand;
import com.comandante.creeper.server.command.WhoamiCommand; import com.comandante.creeper.server.command.WhoamiCommand;
import com.comandante.creeper.server.command.admin.BuildCommand;
import com.comandante.creeper.server.command.admin.DescriptionCommand; import com.comandante.creeper.server.command.admin.DescriptionCommand;
import com.comandante.creeper.server.command.admin.SaveWorldCommand; import com.comandante.creeper.server.command.admin.SaveWorldCommand;
import com.comandante.creeper.server.command.admin.TagRoomCommand; import com.comandante.creeper.server.command.admin.TagRoomCommand;
import com.comandante.creeper.server.command.admin.TitleCommand; import com.comandante.creeper.server.command.admin.TitleCommand;
import com.comandante.creeper.spawner.ItemSpawner;
import com.comandante.creeper.spawner.NpcSpawner; import com.comandante.creeper.spawner.NpcSpawner;
import com.comandante.creeper.spawner.SpawnRule; import com.comandante.creeper.spawner.SpawnRule;
import com.comandante.creeper.stat.Stats; import com.comandante.creeper.stat.Stats;
import com.comandante.creeper.stat.StatsBuilder; import com.comandante.creeper.stat.StatsBuilder;
import com.comandante.creeper.world.Area;
import com.comandante.creeper.world.MapsManager;
import com.comandante.creeper.world.Room;
import com.comandante.creeper.world.RoomManager;
import com.comandante.creeper.world.WorldExporter;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.common.io.Files; import com.google.common.io.Files;
import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger;
import org.mapdb.DB; import org.mapdb.DB;
import org.mapdb.DBMaker; import org.mapdb.DBMaker;
...@@ -51,6 +52,7 @@ import java.util.Map; ...@@ -51,6 +52,7 @@ import java.util.Map;
public class Main { public class Main {
public static CreeperCommandRegistry creeperCommandRegistry; public static CreeperCommandRegistry creeperCommandRegistry;
private static final Logger log = Logger.getLogger(Main.class);
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
...@@ -118,6 +120,7 @@ public class Main { ...@@ -118,6 +120,7 @@ public class Main {
private static void startUpMessage(String message) { private static void startUpMessage(String message) {
System.out.println("[STARTUP] " + message); System.out.println("[STARTUP] " + message);
log.info(message);
} }
private static void checkAndCreateWorld() throws IOException { private static void checkAndCreateWorld() throws IOException {
......
...@@ -94,7 +94,7 @@ public class FightManager { ...@@ -94,7 +94,7 @@ public class FightManager {
private static int getAttack(Stats challenger, Stats victim) { private static int getAttack(Stats challenger, Stats victim) {
int rolls = 0; int rolls = 0;
int totDamage = 0; int totDamage = 0;
while (rolls <= challenger.getNumberweaponOfRolls()) { while (rolls <= challenger.getNumberOfWeaponRolls()) {
rolls++; rolls++;
totDamage = totDamage + randInt(challenger.getWeaponRatingMin(), challenger.getWeaponRatingMax()); totDamage = totDamage + randInt(challenger.getWeaponRatingMin(), challenger.getWeaponRatingMax());
} }
......
...@@ -16,7 +16,7 @@ public class MultiLineInputManager { ...@@ -16,7 +16,7 @@ public class MultiLineInputManager {
} }
public String retrieveMultiLineInput(UUID uuid) { public String retrieveMultiLineInput(UUID uuid) {
return removeTrailingBlankLines(multiLineInputs.remove(uuid).toString()); return removeTrailingBlankLines(multiLineInputs.remove(uuid).toString());
} }
public UUID createNewMultiLineInput() { public UUID createNewMultiLineInput() {
......
...@@ -13,7 +13,7 @@ public class Stats implements Serializable { ...@@ -13,7 +13,7 @@ public class Stats implements Serializable {
private int maxHealth; private int maxHealth;
private int weaponRatingMax; private int weaponRatingMax;
private int weaponRatingMin; private int weaponRatingMin;
private int numberweaponOfRolls; private int numberOfWeaponRolls;
private int experience; private int experience;
public int getExperience() { public int getExperience() {
...@@ -104,12 +104,12 @@ public class Stats implements Serializable { ...@@ -104,12 +104,12 @@ public class Stats implements Serializable {
this.weaponRatingMin = weaponRatingMin; this.weaponRatingMin = weaponRatingMin;
} }
public int getNumberweaponOfRolls() { public int getNumberOfWeaponRolls() {
return numberweaponOfRolls; return numberOfWeaponRolls;
} }
public void setNumberweaponOfRolls(int numberweaponOfRolls) { public void setNumberOfWeaponRolls(int numberOfWeaponRolls) {
this.numberweaponOfRolls = numberweaponOfRolls; this.numberOfWeaponRolls = numberOfWeaponRolls;
} }
public Stats(int strength, public Stats(int strength,
...@@ -122,7 +122,7 @@ public class Stats implements Serializable { ...@@ -122,7 +122,7 @@ public class Stats implements Serializable {
int maxHealth, int maxHealth,
int weaponRatingMax, int weaponRatingMax,
int weaponRatingMin, int weaponRatingMin,
int numberweaponOfRolls, int numberOfWeaponRolls,
int experience) { int experience) {
this.strength = strength; this.strength = strength;
this.willpower = willpower; this.willpower = willpower;
...@@ -134,7 +134,7 @@ public class Stats implements Serializable { ...@@ -134,7 +134,7 @@ public class Stats implements Serializable {
this.maxHealth = maxHealth; this.maxHealth = maxHealth;
this.weaponRatingMax = weaponRatingMax; this.weaponRatingMax = weaponRatingMax;
this.weaponRatingMin = weaponRatingMin; this.weaponRatingMin = weaponRatingMin;
this.numberweaponOfRolls = numberweaponOfRolls; this.numberOfWeaponRolls = numberOfWeaponRolls;
this.experience = experience; this.experience = experience;
} }
...@@ -151,7 +151,7 @@ public class Stats implements Serializable { ...@@ -151,7 +151,7 @@ public class Stats implements Serializable {
", maxHealth=" + maxHealth + ", maxHealth=" + maxHealth +
", weaponRatingMax=" + weaponRatingMax + ", weaponRatingMax=" + weaponRatingMax +
", weaponRatingMin=" + weaponRatingMin + ", weaponRatingMin=" + weaponRatingMin +
", numberweaponOfRolls=" + numberweaponOfRolls + ", numberOfWeaponRolls=" + numberOfWeaponRolls +
'}'; '}';
} }
} }
...@@ -90,7 +90,7 @@ public class StatsTester { ...@@ -90,7 +90,7 @@ public class StatsTester {
private static int getAttack(Stats challenger, Stats victim) { private static int getAttack(Stats challenger, Stats victim) {
int rolls = 0; int rolls = 0;
int totDamage = 0; int totDamage = 0;
while (rolls <= challenger.getNumberweaponOfRolls()) { while (rolls <= challenger.getNumberOfWeaponRolls()) {
rolls++; rolls++;
totDamage = totDamage + randInt(challenger.getWeaponRatingMin(), challenger.getWeaponRatingMax()); totDamage = totDamage + randInt(challenger.getWeaponRatingMin(), challenger.getWeaponRatingMax());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment