Command fixes, command removing

This commit is contained in:
Treeku
2014-04-13 00:29:30 +01:00
parent eeb1ea54af
commit 03c5201cf4
3 changed files with 121 additions and 26 deletions
+28
View File
@@ -35,6 +35,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executors;
@@ -72,6 +73,7 @@ import protocol.swg.chat.ChatOnConnectAvatar;
import protocol.swg.chat.ChatOnGetFriendsList;
import protocol.swg.chat.ChatRoomList;
import protocol.swg.chat.ChatServerStatus;
import protocol.swg.objectControllerObjects.ShowFlyText;
import protocol.swg.objectControllerObjects.UiPlayEffect;
import engine.clientdata.ClientFileManager;
import engine.clientdata.visitors.CrcStringTableVisitor;
@@ -590,6 +592,32 @@ public class ObjectService implements INetworkDispatch {
}
public SWGObject getObjectByFirstName(String customName) {
synchronized(objectList) {
for(SWGObject obj : objectList.values()) {
if(obj.getCustomName() == null)
continue;
if(obj.getCustomName().startsWith(customName))
return obj;
}
}
EntityCursor<CreatureObject> cursor = core.getCreatureODB().getCursor(Long.class, CreatureObject.class);
Iterator<CreatureObject> it = cursor.iterator();
while(it.hasNext()) {
if(it.next().getCustomName().startsWith(customName))
return it.next();
}
return null;
}
public CreatureObject getCreatureFromDB(long objectId) {
return core.getCreatureODB().get(new Long(objectId), Long.class, CreatureObject.class);
}