mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-03 04:16:19 -04:00
More work on combat, added 2 obj Controller packets, added /setspeed, fixed object permissions
This commit is contained in:
+23
-2
@@ -22,6 +22,8 @@
|
||||
package main;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
@@ -38,6 +40,7 @@ import services.ScriptService;
|
||||
import services.SimulationService;
|
||||
import services.TerrainService;
|
||||
import services.chat.ChatService;
|
||||
import services.combat.CombatService;
|
||||
import services.command.CombatCommand;
|
||||
import services.command.CommandService;
|
||||
import services.gcw.GCWService;
|
||||
@@ -102,6 +105,7 @@ public class NGECore {
|
||||
public GuildService guildService;
|
||||
public GCWService gcwService;
|
||||
public TradeService tradeService;
|
||||
public CombatService combatService;
|
||||
|
||||
// Login Server
|
||||
public NetworkDispatch loginDispatch;
|
||||
@@ -130,7 +134,7 @@ public class NGECore {
|
||||
databaseConnection.connect(config.getString("DB.URL"), config.getString("DB.NAME"), config.getString("DB.USER"), config.getString("DB.PASS"), "postgresql");
|
||||
|
||||
databaseConnection2 = new DatabaseConnection();
|
||||
|
||||
setGalaxyStatus(1);
|
||||
creatureODB = new ObjectDatabase("creature", true, false, true);
|
||||
mailODB = new ObjectDatabase("mails", true, false, true);
|
||||
|
||||
@@ -148,7 +152,7 @@ public class NGECore {
|
||||
chatService = new ChatService(this);
|
||||
attributeService = new AttributeService(this);
|
||||
suiService = new SUIService(this);
|
||||
|
||||
combatService = new CombatService(this);
|
||||
// Ping Server
|
||||
try {
|
||||
PingServer pingServer = new PingServer(config.getInt("PING.PORT"));
|
||||
@@ -197,6 +201,8 @@ public class NGECore {
|
||||
|
||||
didServerCrash = false;
|
||||
System.out.println("Started Server.");
|
||||
setGalaxyStatus(2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -249,6 +255,21 @@ public class NGECore {
|
||||
|
||||
}
|
||||
|
||||
public void setGalaxyStatus(int statusId) {
|
||||
|
||||
int galaxyId = config.getInt("GALAXY_ID");
|
||||
|
||||
try {
|
||||
PreparedStatement ps = databaseConnection.preparedStatement("UPDATE \"connectionServers\" SET \"statusId\"=? WHERE \"galaxyId\"=?");
|
||||
ps.setInt(1, statusId);
|
||||
ps.setInt(2, galaxyId);
|
||||
ps.executeUpdate();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* ---------- Getter methods for NGECore ----------
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user