Avoid a ClassCastException when we transfer a marshaller from client to server

(as we sometimes do when we transfer a player between peers in Project X).
Technically we probably shouldn't be streaming the marshallers in that case,
but doing this (and clearing the marshaller on the receiving end) is simpler
than clearing, streaming, and restoring; or settings things up so that the
marshaller is specifically excluded from streaming in transfers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6467 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2011-01-24 23:41:29 +00:00
parent fb822af0e9
commit 871cc2eb63
@@ -256,7 +256,9 @@ public class InvocationMarshaller
throws IOException, ClassNotFoundException
{
in.defaultReadObject();
_invdir = ((ClientObjectInputStream)in).client.getInvocationDirector();
if (in instanceof ClientObjectInputStream) {
_invdir = ((ClientObjectInputStream)in).client.getInvocationDirector();
}
}
@Override