Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: What causes this Java error?  (Read 3908 times)

0 Members and 1 Guest are viewing this topic.

hello

  • member
  • Offline Offline
  • Posts: 287
  • aka Aufpassen! aka Alfie!
What causes this Java error?
« on: December 22, 2010, 09:10:03 AM »

Hello all,
Can somebody explain to me the cause of this java error, when replaying tracks?
I am using vanilla UP2.01, nothing else.
Help would be appreciated.
Cheers!

Code: [Select]
java.io.EOFException
[17:04:38] at com.maddox.rts.NetMsgInput.readUnsignedByte(NetMsgInput.java:158)
[17:04:38] at com.maddox.il2.fm.AircraftState.netFirstUpdate(AircraftState.java:2720)
[17:04:38] at com.maddox.il2.objects.air.NetAircraft.netSpawnCommon(NetAircraft.java:2094)
[17:04:38] at com.maddox.il2.objects.air.NetAircraft.access$1700(NetAircraft.java:19)
[17:04:38] at com.maddox.il2.objects.air.NetAircraft$SPAWN._netSpawn(NetAircraft.java:1991)
[17:04:38] at com.maddox.il2.objects.air.NetAircraft$SPAWN.netSpawn(NetAircraft.java:2038)
[17:04:38] at com.maddox.rts.NetChannel$SpawnMessage.msgNet(NetChannel.java:2032)
[17:04:38] at com.maddox.rts.MsgNet.invokeListener(MsgNet.java:56)
[17:04:38] at com.maddox.rts.Message._send(Message.java:1217)
[17:04:38] at com.maddox.rts.Message.sendToObject(Message.java:1191)
[17:04:38] at com.maddox.rts.Message.sendTo(Message.java:1134)
[17:04:38] at com.maddox.rts.Message.trySend(Message.java:1115)
[17:04:38] at com.maddox.rts.Time.loopMessages(Time.java:252)
[17:04:38] at com.maddox.rts.RTSConf.loopMsgs(RTSConf.java:100)
[17:04:38] at com.maddox.il2.game.MainWin3D.loopApp(MainWin3D.java:131)
[17:04:38] at com.maddox.il2.game.Main.exec(Main.java:436)
[17:04:38] at com.maddox.il2.game.GameWin3D.main(GameWin3D.java:235)
Logged

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 23631
  • Taking a timeout
    • STFU
Re: What causes this Java error?
« Reply #1 on: December 28, 2010, 03:02:55 AM »

This is a common error when playing online or playing videos (i.e. replaying tracks) with HSFX / Ultrapack installations.
The reason is that these packs include some mod which alters the AircraftState class.
In the "netFirstUpdate" function of this class, that specific mod adds some additional aircraft state initializers, whose states it has to read from a net stream when playing online or replaying tracks (sidenote: Replaying tracks internally means nearly the same to IL-2 like playing online).
Now that there are additional initializers trying to read values from the net stream, there might be situations where the server version of the AircraftState class doesn't match the client version, or for track playbacks, where the track was recorded without those additional initializer parameters (to make things worse, UP2.01 records tracks without them, but tries to playback with them).

To avoid errors like this, usually one would check whether or not additional init values are available in the net stream before attempting to read them.
The "netFirstUpdate" in UPs AircraftState class does this most of the times, too, but unfortunately it misses this security check on the last two initializers:

Code: [Select]
(...)
setAirShowSmokeType(netmsginput.readUnsignedByte());
setAirShowSmokeEnhanced(netmsginput.readUnsignedByte() == 1);
(...)

To avoid the EOFException, these lines should look as follows:
Code: [Select]
(...)
setAirShowSmokeType(0);
setAirShowSmokeEnhanced(false);
if(netmsginput.available() == 0)
  return;
setAirShowSmokeType(netmsginput.readUnsignedByte());
if(netmsginput.available() == 0)
  return;
setAirShowSmokeEnhanced(netmsginput.readUnsignedByte() == 1);
(...)

Since I don't know who modified the AircraftState class or which mod the UP2.01 version of this class is part of, I unfortunately cannot address this corrections to the right place.
The only thing I can tell atm is that with 4.10 things will change completely, since the "netFirstUpdate" function, together with a set of other functions from AircraftState class, has been completely rewritten.

Best regards - Mike
Logged
Don't split your mentality without thinking twice.

hello

  • member
  • Offline Offline
  • Posts: 287
  • aka Aufpassen! aka Alfie!
Re: What causes this Java error?
« Reply #2 on: January 03, 2011, 02:20:23 AM »

Although it has been a while, thank you, I think I get it.
It will be interesting to see if this can get fixed in 4.10.
Best regards,
Mark (hello)
Logged

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 23631
  • Taking a timeout
    • STFU
Re: What causes this Java error?
« Reply #3 on: January 03, 2011, 08:01:09 AM »

Basically there's nothing to fix here. It was alright with 4.09m and it is alright with 4.10m.
As a matter of fact, mods tend to ignore online compatibility sometimes, as it is the case with these mods causing this java exception.

Best regards - Mike
Logged
Don't split your mentality without thinking twice.
Pages: [1]   Go Up
 

Page created in 0.07 seconds with 20 queries.