1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-10 09:22:49 +00:00

Fixed exception in chat logging and fixed issue that caused knowlist

not being updated
This commit is contained in:
2011-08-01 00:20:52 -03:00
parent 6b79db00c2
commit 30477571ef
6 changed files with 18 additions and 6 deletions

View File

@@ -20,6 +20,7 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -332,12 +333,12 @@ public class JDBCDatabaseService extends AbstractService implements
int rows = 0;
while (iterator.hasNext()) {
final T object = iterator.next();
final PreparedStatement st = conn.prepareStatement(query());
final PreparedStatement st = conn.prepareStatement(query(), Statement.RETURN_GENERATED_KEYS);
this.parametize(st, object);
rows += st.executeUpdate();
// update object desire --it has been realized
if (object instanceof Model) {
if (object instanceof Model && rows > 0) {
((Model<?>) object).setObjectDesire(ObjectDesire.NONE);
final Mapper<? extends ID<?>> mapper = keyMapper();

View File

@@ -352,6 +352,7 @@ public class CharacterServiceImpl extends AbstractService implements
return;
final Point3D old = character.getPoint();
character.setPoint(point);
// BroadcastService will catch this event and update the knownlist
eventDispatcher.dispatch(new CharacterMoveEvent(character, old));
if (point.getCoordinate().equals(

View File

@@ -50,7 +50,7 @@ public class RangePointFilter implements WorldObjectFilter<PositionableObject> {
Preconditions.checkNotNull(point, "point");
Preconditions.checkState(range >= 0, "range < 0");
this.point = point;
this.range = Math.pow(range, 2);
this.range = range;
}
@Override