These are chat archives for MylesIsCool/ViaVersion

8th
Apr 2016
Troctor
@Troctor
Apr 08 2016 16:45
@MylesIsCool finally got the crash
Florian
@sinnlosername
Apr 08 2016 17:56
very active chat
Florian
@sinnlosername
Apr 08 2016 18:07
What's excactly mean with that todo " // TODO: Uninject from players currently online to prevent protocol lib issues."?
Mats
@Matsv
Apr 08 2016 18:08
Well, now we have to kick all online players to keep 1_9 working
fillefilip8
@fillefilip8
Apr 08 2016 18:08
@MylesIsCool what do u mean? allowing just 1.8? or just 1.9?
Myles
@MylesIsCool
Apr 08 2016 18:44
@Troctor please post more <3
@fillefilip8 yeah, or not allowing 1.9.2 etc, custom msg's
@sinnlosername Uninject from the NetworkManager as otherwise if players aren't kicked then protocol lib implodes because of casting over reloads ;) (it's very funky)
fillefilip8
@fillefilip8
Apr 08 2016 18:52
@MylesIsCool i can try do that if u want
Florian
@sinnlosername
Apr 08 2016 18:57
@MylesIsCool But, when you will uninject only players? On Reload?
http://hastebin.com/bunolufegu.coffee Why iterate a List and break if the first entry isn't a ChannelFuture? o.O
Myles
@MylesIsCool
Apr 08 2016 19:52
because it's the wrong list?
There is a list for NetworkManagers and a list for ChannelFutures, it does that to work out which is which, @sinnlosername
Florian
@sinnlosername
Apr 08 2016 19:55
hate java ._.
Iterate a Field Array, it only iterate public fields, but private fields are in the array. -.-'
@MylesIsCool Ever heard about ParameterizedType? ^^
Myles
@MylesIsCool
Apr 08 2016 19:59
you mean generics? @sinnlosername
Florian
@sinnlosername
Apr 08 2016 20:00
yea
Myles
@MylesIsCool
Apr 08 2016 20:00
they are erased at compile time most of the time
there are cases when they aren't
Florian
@sinnlosername
Apr 08 2016 20:01
O.o
Myles
@MylesIsCool
Apr 08 2016 20:01
if you're new to it, check out
But essentially it says that, methods keep them
but objects don't
meaning fields won't have the data ;)
Florian
@sinnlosername
Apr 08 2016 20:09
I try to test it, but my for loop only iterate public objects but private objects are in the array. -.-'
Myles
@MylesIsCool
Apr 08 2016 20:14
are you using
getDeclaredFields
and not getFields
Florian
@sinnlosername
Apr 08 2016 20:15
I do. The fields are in the list/array
                int i = 0;
                for (Field field: list) {
                    i++;
                    System.out.println(list.size()+":"+i+field.getName());
                    field.setAccessible(true);
                    System.out.println(field.getName());
                    if (!filter.filter(field, searchin)) continue;
                    result = field.get(searchinObj);
                }
And now the output of the debug message
7:1d
7:2a
7:3b
7:4e
So length is 7, but iterate 4 ._.
Florian
@sinnlosername
Apr 08 2016 20:30
Ok. Found what you mean java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
Florian
@sinnlosername
Apr 08 2016 20:55
If there are two lists you inject one list which doesn't require to get injected? O.o
Myles
@MylesIsCool
Apr 08 2016 22:09
yolo right ;)
it's more failsafe against it being on late bind