mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-09-12 22:45:31 -04:00
Merge branch 'master' of https://github.com/ProjectSWGCore/NGECore2
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import sys
|
||||
import main.NGECore
|
||||
import services.AdminService
|
||||
|
||||
def setup():
|
||||
return
|
||||
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
if target:
|
||||
actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF Command Completed Successfully: Account name for target is ' + core.adminService.getAccountNameFromDB(target.getClient().getAccountId()) + '.', 0)
|
||||
|
||||
|
||||
else:
|
||||
actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF getStationName: Invalid Syntax. Syntax is: /getStationName <Character First Name>', 0)
|
||||
return
|
||||
@@ -154,17 +154,16 @@ public class WaypointObject extends IntangibleObject implements IDelta, Serializ
|
||||
}
|
||||
|
||||
public synchronized byte[] getBytes() {
|
||||
IoBuffer buffer = Baseline.createBuffer(38 + StringUtilities.getUnicodeString(getName()).length);
|
||||
buffer.putInt(getCellNumber());
|
||||
buffer.put(Baseline.toBytes(getBaseline(3).get("position")));
|
||||
buffer.putLong(getTargetId());
|
||||
buffer.putInt(getPlanetCrc());
|
||||
buffer.put(StringUtilities.getUnicodeString(getName()));
|
||||
buffer.putLong(getObjectID());
|
||||
buffer.put(getColor());
|
||||
buffer.put(Baseline.getBoolean(isActive()));
|
||||
return buffer.flip().array();
|
||||
|
||||
IoBuffer buffer = Baseline.createBuffer(38 + StringUtilities.getUnicodeString(getName()).length);
|
||||
buffer.putInt(getCellNumber());
|
||||
buffer.put(Baseline.toBytes(getBaseline(3).get("position")));
|
||||
buffer.putLong(getTargetId());
|
||||
buffer.putInt(getPlanetCrc());
|
||||
buffer.put(StringUtilities.getUnicodeString(getName()));
|
||||
buffer.putLong(getObjectID());
|
||||
buffer.put(getColor());
|
||||
buffer.put(Baseline.getBoolean(isActive()));
|
||||
return buffer.flip().array();
|
||||
}
|
||||
|
||||
@Deprecated public int getCellId() { return getCellNumber(); }
|
||||
|
||||
@@ -55,6 +55,22 @@ public class AdminService implements INetworkDispatch {
|
||||
return accessLevel;
|
||||
}
|
||||
|
||||
public String getAccountNameFromDB(long id) {
|
||||
String accountName = null;
|
||||
PreparedStatement preparedStatement;
|
||||
|
||||
try {
|
||||
preparedStatement = NGECore.getInstance().getDatabase1().preparedStatement("SELECT * FROM accounts WHERE id=" + id + "");
|
||||
ResultSet resultSet = preparedStatement.executeQuery();
|
||||
if(resultSet.next())
|
||||
accountName = resultSet.getString("user");
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return accountName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertOpcodes(Map<Integer, INetworkRemoteEvent> arg0, Map<Integer, INetworkRemoteEvent> arg1) {
|
||||
|
||||
|
||||
@@ -526,7 +526,7 @@ public class PlayerService implements INetworkDispatch {
|
||||
});
|
||||
|
||||
swgOpcodes.put(Opcodes.CmdSceneReady, (session, data) -> {
|
||||
|
||||
session.setAttribute("CmdSceneReady", true);
|
||||
});
|
||||
|
||||
/*swgOpcodes.put(Opcodes.ExpertiseRequestMessage, new INetworkRemoteEvent() {
|
||||
|
||||
@@ -688,7 +688,8 @@ public class CommandService implements INetworkDispatch {
|
||||
|
||||
public void processCommand(CreatureObject actor, SWGObject target, BaseSWGCommand command, int actionCounter, String commandArgs) {
|
||||
|
||||
if (command.getGodLevel() > 0 || command.getCommandName().equals("setgodmode")) {
|
||||
if (command.getGodLevel() > 0 || command.getCommandName().equals("setgodmode") || command.getCommandName().equals("server") || command.getCommandName().equals("teleport")
|
||||
|| command.getCommandName().equals("teleportto") || command.getCommandName().equals("teleporttarget") ) {
|
||||
String accessLevel = core.adminService.getAccessLevelFromDB(actor.getClient().getAccountId());
|
||||
String filePath = "accesslevels/" + accessLevel + ".txt";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user