mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-01 02:16:15 -04:00
Fixed list update issues with friend and ignore list, /findfriend now destroys existing wp's, fixed string bug on updating wps
This commit is contained in:
@@ -5,7 +5,12 @@ def setup():
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
actorGhost = actor.getSlottedObject("ghost")
|
||||
|
||||
chatSrvc = core.chatService
|
||||
if chatSrvc and actorGhost and commandString:
|
||||
chatSrvc.addFriend(actorGhost, commandString, 1)
|
||||
if actorGhost.getFriendList().contains(commandString.split(" ")[0].lower()):
|
||||
actor.sendSystemMessage(commandString.split(" ")[0].lower() + ' is already in your friend list.', 0)
|
||||
return
|
||||
else:
|
||||
chatSrvc.addFriend(actorGhost, commandString)
|
||||
return
|
||||
@@ -6,5 +6,14 @@ def setup():
|
||||
def run(core, actor, target, commandString):
|
||||
actorGhost = actor.getSlottedObject("ghost")
|
||||
chatSrvc = core.chatService
|
||||
|
||||
if not actorGhost and chatSrvc and commandString:
|
||||
return
|
||||
|
||||
if actorGhost.getIgnoreList().contains(commandString.split(" ")[0].lower()):
|
||||
actor.sendSystemMessage(commandString.split(' ')[0].lower() + ' is already in your ignore list.', 0)
|
||||
return
|
||||
|
||||
chatSrvc.addToIgnoreList(actor, commandString)
|
||||
|
||||
return
|
||||
@@ -1,3 +1,5 @@
|
||||
from resources.objects.waypoint import WaypointObject
|
||||
from engine.resources.common import CRC
|
||||
import sys
|
||||
|
||||
def setup():
|
||||
@@ -11,8 +13,29 @@ def run(core, actor, target, commandString):
|
||||
friendObj = core.chatService.getObjectByFirstName(friend)
|
||||
if friendObj is not None:
|
||||
if friendObj.getSlottedObject('ghost').getFriendList().contains(actor.getCustomName().lower().split(' ')[0]):
|
||||
fPos = friendObj.getPosition()
|
||||
core.commandService.callCommand(actor, 'waypoint', None, friendObj.getPlanet().name + ' ' + str(fPos.x) + ' ' + str(fPos.z) + ' ' + str(fPos.y) + ' blue ' + friendObj.getCustomName())
|
||||
createWaypoint(core, actor, friendObj)
|
||||
return
|
||||
return
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
def createWaypoint(core, actor, friendObj):
|
||||
ghost = actor.getSlottedObject('ghost')
|
||||
friendName = friendObj.getCustomName().split(' ')[0]
|
||||
wp = WaypointObject()
|
||||
|
||||
for wp in ghost.getWaypoints():
|
||||
if wp.getName() == friendName and wp.getPlanet() == friendObj.getPlanet():
|
||||
core.commandService.callCommand(actor, 'serverdestroyobject', wp, '')
|
||||
break
|
||||
|
||||
waypoint = core.objectService.createObject('object/waypoint/shared_waypoint.iff', friendObj.getPlanet(), friendObj.getWorldPosition().x, friendObj.getWorldPosition().z, friendObj.getWorldPosition().y)
|
||||
waypoint.setName(friendName)
|
||||
waypoint.setActive(True)
|
||||
waypoint.setColor(WaypointObject.YELLOW)
|
||||
waypoint.setName(friendName)
|
||||
waypoint.setPlanetCRC(CRC.StringtoCRC(friendObj.getPlanet().name))
|
||||
waypoint.setStringAttribute('', '')
|
||||
ghost.waypointAdd(waypoint)
|
||||
actor.sendSystemMessage('A waypoint has been created in your datapad at the location.', 0)
|
||||
return
|
||||
|
||||
@@ -5,7 +5,7 @@ def setup():
|
||||
return
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
ghost = actor.getSlottedObject('ghost')
|
||||
friendsListMessage = ChatOnGetFriendsList(ghost)
|
||||
actor.getClient().getSession().write(friendsListMessage.serialize())
|
||||
#ghost = actor.getSlottedObject('ghost')
|
||||
#friendsListMessage = ChatOnGetFriendsList(ghost)
|
||||
#actor.getClient().getSession().write(friendsListMessage.serialize())
|
||||
return
|
||||
@@ -6,6 +6,5 @@ def setup():
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
ghost = actor.getSlottedObject('ghost')
|
||||
print ('Command recieved!')
|
||||
ghost.toggleFlag(PlayerFlags.LFG)
|
||||
return
|
||||
@@ -22,7 +22,7 @@ def run(core, actor, target, commandString):
|
||||
planet = core.terrainService.getPlanetByName(commandArgs[0])
|
||||
waypoint = core.objectService.createObject('object/waypoint/shared_waypoint.iff', planet, float(commandArgs[1]), float(commandArgs[2]), float(commandArgs[3]))
|
||||
waypoint.setActive(True)
|
||||
waypoint.setColor(colorCheck(core, actor, target, commandString, commandArgs[4]))
|
||||
waypoint.setColor(colorCheck(commandArgs[4]))
|
||||
name = commandString.split(" ", 5)
|
||||
waypoint.setName(name[5])
|
||||
waypoint.setPlanetCRC(crc.StringtoCRC(planet.getName()))
|
||||
@@ -89,7 +89,10 @@ def run(core, actor, target, commandString):
|
||||
waypoint = core.objectService.createObject('object/waypoint/shared_waypoint.iff', actor.getPlanet(), actor.getWorldPosition().x, actor.getWorldPosition().z, actor.getWorldPosition().y)
|
||||
waypoint.setActive(True)
|
||||
waypoint.setColor(WaypointObject.BLUE)
|
||||
waypoint.setName(commandString)
|
||||
if commandString == '':
|
||||
waypoint.setName(actor.getPlanet().name.capitalize())
|
||||
else:
|
||||
waypoint.setName(commandString)
|
||||
waypoint.setPlanetCRC(crc.StringtoCRC(actor.getPlanet().getName()))
|
||||
waypoint.setStringAttribute('', '') # This simply allows the attributes to display (nothing else has to be done)
|
||||
actorPlayer.waypointAdd(waypoint)
|
||||
@@ -98,7 +101,7 @@ def run(core, actor, target, commandString):
|
||||
|
||||
return
|
||||
|
||||
def colorCheck(core, actor, target, commandString, validcolors):
|
||||
def colorCheck(validcolors):
|
||||
if validcolors == "blue":
|
||||
return WaypointObject.BLUE
|
||||
if validcolors == "green":
|
||||
|
||||
Reference in New Issue
Block a user