Fidget (Jump'n'Run)

The case of loading each resource from the server will result in a new network connection per resource. A new connection could take 100ms just to get established because of latency even on fast network (10 resources == 1 second just for establishing connection.). It is advisable to break your resources into multiple different jars (you’ll have to play with size/count ratio a bit).

Dmitri

as a side note you can get ride of the latency problem at connection initialisation by using a connection with kee-alive on and load severals ressource from it at once.

also I am pretty lazy and found that modifying/updating or even adding ressource (in case of dynamic world/level) is painfull when it is in a jar while it is just a copy/paste/replace when you let them on the server, but this one is off-topic.

thanks, but i need readLong, readShort, readDouble, readFloat, readBoolean and so on too. any ideas? i found no suitable reader with all the types i need except DataInputStream. but the readline method is deprecated. any workaround?

read char/byte and add them to string until you got \n (but dont read or add to the string \r and inded neither \n), should work for unix & window end line

It’s probably not the best way, or even a good way, but it’s easy.
Have a line consist of just the variable type you want and parse it with the static object method.


long someLong = Long.parseLong( reader.readLine() );

good gameplay!