Page 1 of 1

SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 7:41 pm
by xone
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:4206
L2JDP Revision Number:7215


ok got this ....

Code: Select all

SQL exception while saving olympiad fight.com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column 'time' at row 1        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3561)        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3495)        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2693)        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2102)        at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1364)         at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:989)        at com.l2jserver.gameserver.model.olympiad.OlympiadGame.saveResults(OlympiadGame.java:999)        at com.l2jserver.gameserver.model.olympiad.OlympiadGame.validateWinner(OlympiadGame.java:835)        at com.l2jserver.gameserver.model.olympiad.OlympiadGameTask.run(OlympiadGame.java:1134)        at java.lang.Thread.run(Unknown Source) 

Re: SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 9:19 pm
by JIV
did you modified olympiad settings?

Re: SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 9:25 pm
by janiii
the table definition is wrong. both columns hold time info, so are they different?

Code: Select all

  `start` decimal(20,0) unsigned NOT NULL default '0',  `time` int(10) unsigned NOT NULL default '0',
maybe start was not initiated correctly? imo time column should be able to hold also current time in millis..

Re: SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 9:26 pm
by JIV
because oly fight on default can take max 5 min or so.

Re: SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 9:30 pm
by janiii
then start was not initiated because no oly fight started - disconnected player before teleport?

Re: SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 9:35 pm
by JIV
yea maybe.

Re: SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 9:37 pm
by janiii
then maybe just a check if start is 0, then also fight is 0, else current - start.

Code: Select all

Index: java/com/l2jserver/gameserver/model/olympiad/OlympiadGame.java===================================================================--- java/com/l2jserver/gameserver/model/olympiad/OlympiadGame.java	(revision 4207)+++ java/com/l2jserver/gameserver/model/olympiad/OlympiadGame.java	(working copy)@@ -735,7 +735,9 @@ 		String winner = "draw";  		// Calculate Fight time-		long _fightTime = (System.currentTimeMillis() - _startTime);+		long _fightTime = 0;+		if (_startTime > 0)+			_fightTime = (System.currentTimeMillis() - _startTime);  		if (_playerOne == null && _playerTwo == null) 		{

Re: SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 9:38 pm
by JIV

Re: SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 9:40 pm
by JIV
^^ commit your version.

Re: SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 9:52 pm
by xone
Thanks! :D

Re: SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 10:07 pm
by janiii
is there a szenario how to reproduce this error?

Re: SQL exception while saving olympiad fight.

Posted: Fri May 21, 2010 10:31 pm
by xone
hmmm don't think so .... when I got home ... my GM was fighting at oly, did alt tab ... error on screen :) ... thats all.

Re: SQL exception while saving olympiad fight.

Posted: Sat May 22, 2010 7:21 am
by Gnacik
just move _startTime = System.currentTimeMillis(); before if (_aborted) return false;, so start time will be set even if fight is aborted.

start time cannot be zero, its timestamp so fights with start=0 in monument will be displayed as 1970-01-01