This commit is contained in:
Light2
2014-05-03 18:12:47 +02:00
54 changed files with 1156 additions and 98 deletions
+28 -11
View File
@@ -524,6 +524,9 @@ public class ObjectService implements INetworkDispatch {
}
public SWGObject getObjectByCustomName(String customName) {
if (customName == null) {
return null;
}
synchronized(objectList) {
@@ -538,19 +541,27 @@ public class ObjectService implements INetworkDispatch {
ODBCursor cursor = core.getSWGObjectODB().getCursor();
while(cursor.hasNext()) {
if(((SWGObject) cursor.next()).getCustomName().equals(customName))
return (SWGObject) cursor.next();
while (cursor.hasNext()) {
SWGObject object = (SWGObject) cursor.next();
if (object == null) {
continue;
}
if (object.getCustomName() != null && customName.length() > 0 && object.getCustomName().equals(customName)) {
return object;
}
}
return null;
}
public SWGObject getObjectByFirstName(String customName) {
if (customName == null) {
return null;
}
synchronized(objectList) {
for(SWGObject obj : objectList.values()) {
if(obj.getCustomName() == null)
continue;
@@ -562,13 +573,19 @@ public class ObjectService implements INetworkDispatch {
ODBCursor cursor = core.getSWGObjectODB().getCursor();
while(cursor.hasNext()) {
if(((SWGObject) cursor.next()).getCustomName().startsWith(customName))
return (SWGObject) cursor.next();
while (cursor.hasNext()) {
SWGObject object = (SWGObject) cursor.next();
if (object == null) {
continue;
}
if (object.getCustomName() != null && customName.length() > 0 && object.getCustomName().startsWith(customName)) {
return object;
}
}
return null;
}
public CreatureObject getCreatureFromDB(long objectId) {