mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-12 02:13:48 -04:00
Fixed Admin commands part2
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
|
||||
from services.sui import SUIWindow
|
||||
from services.sui.SUIWindow import Trigger
|
||||
from java.util import Vector
|
||||
import sys
|
||||
|
||||
def setup():
|
||||
return
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
core.chatService.broadcastGalaxy(commandString)
|
||||
actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF broadcastGalaxy: Command completed successfully.', 0)
|
||||
return
|
||||
@@ -0,0 +1,12 @@
|
||||
from services.sui import SUIWindow
|
||||
from services.sui.SUIWindow import Trigger
|
||||
from java.util import Vector
|
||||
import sys
|
||||
|
||||
def setup():
|
||||
return
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
core.chatService.broadcastPlanet(commandString, actor.getPlanet())
|
||||
actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF broadcastPlanet: Command completed successfully.', 0)
|
||||
return
|
||||
@@ -0,0 +1,21 @@
|
||||
import sys
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
|
||||
commandArgs = commandString.split(' ')
|
||||
arg1 = commandArgs[0]
|
||||
if len(commandArgs) > 1:
|
||||
arg2 = commandArgs[1]
|
||||
|
||||
if len(commandArgs) > 1:
|
||||
pos = actor.getWorldPosition()
|
||||
core.spawnService.spawnCreature(arg1, actor.getPlanet().getName(), 0, pos.x, pos.y, pos.z, 1, 0, 1, 0, int(arg2))
|
||||
actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF createCreature: Command completed successfully.' , 0)
|
||||
return
|
||||
|
||||
else:
|
||||
actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF createCreature: Invalid Syntax. Syntax is: /createcreature <Mobile Template> <Level>.', 0)
|
||||
return
|
||||
|
||||
|
||||
return
|
||||
@@ -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
|
||||
@@ -0,0 +1,41 @@
|
||||
import sys
|
||||
from resources.datatables import GcwRank
|
||||
from services.gcw import GCWService
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
commandArgs = commandString.split(' ')
|
||||
arg1 = commandArgs[0]
|
||||
if len(commandArgs) > 1:
|
||||
arg2 = commandArgs[1]
|
||||
|
||||
if target is None:
|
||||
target = actor
|
||||
|
||||
if target.getFaction() == 'rebel' or 'imperial' and arg1 == 'up':
|
||||
playerObject = target.getSlottedObject('ghost')
|
||||
playerObject.setCurrentRank(int(arg2))
|
||||
newrank = playerObject.getCurrentRank()
|
||||
core.scriptService.callScript("scripts/collections/", "gcwrank_" + target.getFaction(), "handleRankUp", core, target, newrank)
|
||||
actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF setRank: Command completed successfully.', 0)
|
||||
if target.getFaction() == 'rebel' or 'imperial' and arg1 == 'down':
|
||||
playerObject = target.getSlottedObject('ghost')
|
||||
playerObject.setCurrentRank(int(arg2))
|
||||
newrank = playerObject.getCurrentRank()
|
||||
core.scriptService.callScript("scripts/collections/", "gcwrank_" + target.getFaction(), "handleRankDown", target, newrank)
|
||||
actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF setRank: Command completed successfully.', 0)
|
||||
|
||||
# if target.getFaction() == 'imperial' and arg1 == 'up':
|
||||
# if arg1 == 'up':
|
||||
# playerObject = actor.getSlottedObject('ghost')
|
||||
# playerObject.setCurrentRank(int(arg2))
|
||||
# newrank = playerObject.getCurrentRank()
|
||||
# core.scriptService.callScript("scripts/collections/", "gcwrank_" + target.getFaction(), "handleRankUp", core, target, newrank)
|
||||
# actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF setRank: Command completed successfully.', 0)
|
||||
# if target.getFaction() == 'imperial' and arg1 == 'down':
|
||||
# playerObject = actor.getSlottedObject('ghost')
|
||||
# playerObject.setCurrentRank(int(arg2))
|
||||
# newrank = playerObject.getCurrentRank()
|
||||
# core.scriptService.callScript("scripts/collections/", "gcwrank_" + target.getFaction(), "handleRankDown", target, newrank)
|
||||
# actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF setRank: Command completed successfully.', 0)
|
||||
|
||||
return
|
||||
@@ -689,7 +689,7 @@ 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") || command.getCommandName().equals("server") || command.getCommandName().equals("teleport")
|
||||
|| command.getCommandName().equals("teleportto") || command.getCommandName().equals("teleporttarget") ) {
|
||||
|| command.getCommandName().equals("teleportto") || command.getCommandName().equals("teleporttarget") || command.getCommandName().equals("createcreature") || command.getCommandName().equals("giveitem") ) {
|
||||
String accessLevel = core.adminService.getAccessLevelFromDB(actor.getClient().getAccountId());
|
||||
String filePath = "accesslevels/" + accessLevel + ".txt";
|
||||
System.out.println(command.getCommandName() + " was just used by an admin with accessLevel: " + accessLevel + ".");
|
||||
|
||||
Reference in New Issue
Block a user