- Joined
- Jul 17, 2008
- Messages
- 51
- Reaction score
- 4
Currently experiencing this, any advice?
Attachments
You must be registered for see attachments list
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!OIDS are? I'm sorry im a bit unfamiliar.
private int runningOid = 100;
server.maps.MapleMap:
Code:private int runningOid = 100;
increase the number to like 100,000 or something
server.maps.MapleMap:
Code:private int runningOid = 100;
increase the number to like 100,000 or something
That's just the starting oid, pretty sure that will do nothing. In fact if you set that too high you might get that exception every time. There's a max oid when an object is set though. I didn't know it was even possible to run out though, since it reuses object ids right? Either way there shouldn't be a cap for OID since it just doens't make sense. It doesn't save memory at all. Still It's very surprising how you even managed to have the max oids at once since when you reach the max oid, it will start over and go back to the runningOid. Then it will loop and try to find a nontaken oid.
public final void addMapObject(final MapleMapObject mapobject) {
runningOidLock.lock();
int newOid;
try {
newOid = ++runningOid;
} finally {
runningOidLock.unlock();
}
mapobject.setObjectId(newOid);
mapobjectlocks.get(mapobject.getType()).writeLock().lock();
try {
mapobjects.get(mapobject.getType()).put(newOid, mapobject);
} finally {
mapobjectlocks.get(mapobject.getType()).writeLock().unlock();
}
}
public void addMapObject(MapleMapObject mapobject) {
objectWLock.lock();
try {
mapobject.setObjectId(runningOid);
this.mapobjects.put(Integer.valueOf(runningOid), mapobject);
incrementRunningOid();
} finally {
objectWLock.unlock();
}
}
private void incrementRunningOid() {
runningOid++;
if (runningOid >= 30000) {
runningOid = 1000;//Lol, like there are monsters with the same oid NO
}
objectRLock.lock();
try {
if (!this.mapobjects.containsKey(Integer.valueOf(runningOid))) {
return;
}
} finally {
objectRLock.unlock();
}
throw new RuntimeException("Out of OIDs on map " + mapid + " (channel: " + channel + ")");
}
" private void incrementRunningOid() {
runningOid++;
if (runningOid >= 3000) {
runningOid = 100000;//Lol, like there are monsters with the same oid NO " ? is that enough?