mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-15 00:07:39 -04:00
Removed getObjectByFirstName from ChatService (deprecated), Changed getting object by names methods to account for all type cases
These changes should fix a lot of issues (mainly chat related like mails, tells, chat channels) for anything that was using the out-dated getObjectByFirstName() in chatservice. Also it'll allow us to not have to go through uppercase and lowercase versions every time we try and pull an object by names.
This commit is contained in:
@@ -52,6 +52,7 @@ import resources.datatables.PlayerFlags;
|
||||
import resources.guild.Guild;
|
||||
import resources.harvest.SurveyTool;
|
||||
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
import org.apache.mina.core.session.IoSession;
|
||||
import org.python.core.Py;
|
||||
@@ -606,7 +607,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
for(SWGObject obj : objectList.values()) {
|
||||
if(obj.getCustomName() == null)
|
||||
continue;
|
||||
if(obj.getCustomName().equals(customName))
|
||||
if(obj.getCustomName().equalsIgnoreCase(customName))
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -621,7 +622,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (object.getCustomName() != null && customName.length() > 0 && object.getCustomName().equals(customName)) {
|
||||
if (object.getCustomName() != null && customName.length() > 0 && object.getCustomName().equalsIgnoreCase(customName)) {
|
||||
return object;
|
||||
}
|
||||
}
|
||||
@@ -640,7 +641,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
continue;
|
||||
if(obj.getCustomName() == null)
|
||||
continue;
|
||||
if(obj.getCustomName().startsWith(customName))
|
||||
if(obj.getCustomName().startsWith(customName) || obj.getCustomName().toUpperCase().startsWith(WordUtils.capitalize(customName)))
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -655,7 +656,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (object.getCustomName() != null && customName.length() > 0 && object.getCustomName().startsWith(customName)) {
|
||||
if (object.getCustomName() != null && customName.length() > 0 && (object.getCustomName().startsWith(customName) || object.getCustomName().toUpperCase().startsWith(WordUtils.capitalize(customName)))) {
|
||||
return object;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user