mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-09-27 12:12:51 -04:00
Merge branch 'master' of https://github.com/ProjectSWGCore/NGECore2
This commit is contained in:
@@ -194,21 +194,14 @@ public class SWGMap<K, V> implements Map<K, V>, Serializable {
|
||||
K key = entry.getKey();
|
||||
V value = entry.getValue();
|
||||
|
||||
if (valid(key) && valid(value))
|
||||
{
|
||||
if (map.containsKey(key))
|
||||
{
|
||||
if (map.put(key, value) != null)
|
||||
{
|
||||
buffer.add(item(2, key, Baseline.toBytes(value), true, true));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(map.put(key, value) == null)
|
||||
{
|
||||
buffer.add(item(0, key, Baseline.toBytes(value), true, true));
|
||||
}
|
||||
if (key != null && valid(key) && value != null && valid(value)) {
|
||||
if (map.containsKey(key)) {
|
||||
map.put(key, value);
|
||||
buffer.add(item(2, key, Baseline.toBytes(value), true, true));
|
||||
} else {
|
||||
map.put(key, value);
|
||||
buffer.add(item(0, key, Baseline.toBytes(value), true, true));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ public class SWGMultiMap<K, V> implements Multimap<K, V>, Serializable {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
int size = 1 + ((useIndex) ? (2 + Baseline.toBytes(index).length) : 0) + ((useData) ? data.length : 0);
|
||||
int size = 1 + ((useIndex) ? (Baseline.toBytes(index).length) : 0) + ((useData) ? data.length : 0);
|
||||
|
||||
IoBuffer buffer = Delta.createBuffer(size);
|
||||
buffer.put((byte) type);
|
||||
|
||||
@@ -157,9 +157,9 @@ public class BuildingObject extends TangibleObject implements IPersistent, Seria
|
||||
try {
|
||||
PortalVisitor portal = ClientFileManager.loadFile(portalLayoutFilename, PortalVisitor.class);
|
||||
|
||||
for (int i = 1; i <= portal.cellCount; i++) {
|
||||
for (int i = 0; i <= portal.cellCount; i++) {
|
||||
if (cellName.equals(portal.cells.get(i).name)) {
|
||||
return getCellByCellNumber(i);
|
||||
return getCellByCellNumber(i + 1);
|
||||
}
|
||||
}
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
|
||||
@@ -289,7 +289,13 @@ public class CreatureMessageBuilder extends TangibleMessageBuilder {
|
||||
buffer.putInt(0);
|
||||
buffer.putInt(creature.getEquipmentListUpdateCounter());
|
||||
} else {
|
||||
buffer.putInt(creature.getEquipmentList().size());
|
||||
int size = 0;
|
||||
|
||||
for (Long objId : creature.getEquipmentList().get()) {
|
||||
size += ((NGECore.getInstance().objectService.getObject(objId) == null) ? 0 : 1);
|
||||
}
|
||||
|
||||
buffer.putInt(size);
|
||||
buffer.putInt(creature.getEquipmentListUpdateCounter());
|
||||
|
||||
for(Long objId : creature.getEquipmentList().get()) {
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.Vector;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
@@ -110,7 +111,7 @@ public class PlayerObject extends IntangibleObject implements Serializable {
|
||||
profileFlagsList.add(0);
|
||||
baseline.put("profileFlagsList", profileFlagsList);
|
||||
baseline.put("title", "");
|
||||
baseline.put("bornDate", (int) (System.currentTimeMillis() / 1000L)); //Integer.parseInt(new SimpleDateFormat("yyyymmdd", Locale.ENGLISH).format(Calendar.getInstance().getTime())));
|
||||
baseline.put("bornDate", (int) TimeUnit.DAYS.convert((System.currentTimeMillis() - 978220800000L), TimeUnit.MILLISECONDS));
|
||||
baseline.put("totalPlayTime", 0);
|
||||
baseline.put("professionIcon", 0);
|
||||
baseline.put("profession", "trader_0a");
|
||||
|
||||
Reference in New Issue
Block a user