117 Commits

Author SHA1 Message Date
sky..ok
63632afca1 License maintenance in Networking, NiftyGUI, JOGG, and OGRE
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9856 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-10-08 14:36:12 +00:00
sky..ok
28ce76245f Change all source licenses to say 2009-2012
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9838 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-10-05 17:01:57 +00:00
PSp..om
c6bc0bf79b Added a null listener check just to help track down
odd errors.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9689 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-08-26 17:42:36 +00:00
PSp..om
476120616c Modified the Serializer registration of DisconnectMessage
and ClientRegistrationMessage so that they have fixed IDs
and registration-independent implementations.  This means
that no matter how much the internal auto-registration list
changes that a game can still manage the protocol version
in a graceful way.
Prior to this change, removal of a class registration from
Serializers auto-registered list meant that a client->server
version mismatch was impossible to detect and handle gracefully.

Also, now that it was safe to do so, I removed the auto
registration of some odd Java beans classes.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9457 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-06-06 05:31:16 +00:00
PSp..om
516e3065dc Moved the string read/write to static methods to
make it easier to reuse in classes that want to
read/write strings the same way without using
Serializer directly.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9456 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-06-06 04:52:58 +00:00
PSp..om
819407cf79 Starting to reorganize serializer a bit to later add
some features that will make it slightly less fragile.
The code that registers a serializer for an ID has
been centralized.
A method was added to hand out new IDs and it now
skips IDs that are already in use.  This will allow
certain serializers to be fixed against specific IDs
to maintain backwards and forwards compatability even
as the automatically registered list of serializers
changes.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9455 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-06-06 03:26:26 +00:00
nor..67
ea0be5cf9f - fix imports across engine
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9451 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-06-03 13:10:26 +00:00
nor..67
fb68a176b5 - fix DefaultServer initialization, it would place a null in the channels list (tcp/udp channels) if there was no UPD poprt specified.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9114 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-27 14:47:33 +00:00
sky..om
1801f1f336 Brought the number of Javadoc workings down to 391 from 410
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8979 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-03 04:59:16 +00:00
PSp..om
1083cbd5aa Removed the extraneous warning message since you will
get an exception with the same info (and it's not a 
warning anyway, it's fatal).
Also improved the error message to include the field
that failed to write.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8960 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-28 07:05:16 +00:00
PSp..om
5ed66f47e7 Redoing some of the isConnected checking and connection
close logging to be less verbose... and to not print out
logged infos that look like warnings about "connections
already being closed."
While I was at it, I added so FINE logging about the
sizes of the maps when the elements are removed to make
sure everything is being cleaned up properly.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8944 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-19 10:41:38 +00:00
PSp..om
010b9e0670 Until I can hook up proper error handlers, at least close
the connection so the clients don't hang around in an errored
state.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8943 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-17 11:40:24 +00:00
PSp..om
dc46e28eb9 Added a big honking warning after learning something in
hindsight about the removal of RenderingHints. :P
Seemed simple enough... but now I have to watch people
get connection errors to my server instead of getting
a nice kick.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8942 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-17 11:21:13 +00:00
PSp..om
d1576a3580 Added a proper toString() to SerializerRegistration.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8941 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-17 11:14:15 +00:00
PSp..om
e84d8300dd Modified Client/Server to support alternate channels. The
server can configure additional ports that will be sent to
the client upon connection.  These channels can be used to
send messages in parallel to the normal messages.  This is
useful to keeping several separate command pathways flowing
smoothly despite potentially large messages on one channel.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8938 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 10:28:50 +00:00
PSp..om
665a7c8851 A small formatting change.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8937 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 10:27:26 +00:00
PSp..om
c686efc3a7 DefaultClient now also deals with connectors more
generically as channels.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8936 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 09:19:17 +00:00
PSp..om
fe1bd03c51 Unified how UDP and TCP kernels are handled into a
more general "channel" list.  This is to pave the way
for additional channels.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8935 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 08:43:33 +00:00
PSp..om
2d0def329d Made the UDP disconnect events more timely by including
the same bump logic that the NIO kernel has.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8934 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 08:30:42 +00:00
PSp..om
5cb7e21157 Modified KernelAdapter to be a more self-sufficient adapter
to better support having multiple channels.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8933 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 07:14:47 +00:00
PSp..om
48db901b5b Added a method for easily determining if there are active
connections.
Early-return in the broadcast method if there are no connections.
This prevents allocation of a message if it's just going to get
dropped on the floor anyway.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8932 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-16 00:31:40 +00:00
nor..67
3cdaf0e051 jme3:
- fix imports in all classes

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8843 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-03 14:06:48 +00:00
nor..67
c906508e62 - big refactoring of engine build and cleaning of sources, totally breaking SDK build for now
- separate jar files for engine components
- resolve dependencies between code parts
- remove Nifty dependency from Cinematics
- remove Physics dependency from TerrainGrid
- add public accessors to Natives Extraction
- remove RenderHint serialization from networking

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8839 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-12-03 01:22:42 +00:00
PSp..om
7a333dda9f On some platforms the selector will not automatically wake up
when the network connection has been closed.  Forcing the selector
to wake up seems to be safe on tested platforms.
Thanks to @philotomy for the catch and fix.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8669 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-11-14 10:51:25 +00:00
sha..rd
b3f9e87bf1 * package.html files now comply with HTML 4.01 standards
* SimpleApplication now computes FPS by counting frames instead of using Timer.getFrameRate()

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8534 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-10-28 00:49:07 +00:00
PSp..om
c548987709 Removing the deprecated packages and old version of the
networking layer.  Note: because some messages were removed
from Serializer's auto-registration this version is not
binary-compatible with the last.  So you must upgrade your
client and server at the same time.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8286 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-09-24 09:16:54 +00:00
PSp..om
3f6461a4a8 Made the static utility methods static. "D'oh!"
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8257 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-09-16 09:02:13 +00:00
PSp..om
1dbd617d2d Added a method to register classes in bulk.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8069 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-24 09:52:35 +00:00
PSp..om
8f90e62fec A change from a while back that presents a slightly better
error message than an NPE but still isn't very helpful.  This
usually only happens when things are totally confused, ie:
stream corruption or more likely misregistered classes.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8068 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-24 09:38:28 +00:00
PSp..om
d67adb8266 Pulled the ExecutorService stuff out and replaced it with a
plain single thread.  This gives more control over the queuing
behavior as with an ThreadPoolExecutor it is difficult to implement
blocking execute() behavior.  Also, this avoids creating an
extra object per-message.
Anyway, this code now implements a blocking queue instead of
a boundless queue.  It's set to 16,000 messages which should only
bottom out in the worst of cases.  I was seeing it in the throughput
tests where the sockets were backing up and the queues were 
consuming all of the heap until an out of memory error occurred.
Outbound messaging is only throttled this way on the client.
Servers typically wouldn't do this sort of spamming anyway.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7977 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-05 07:55:04 +00:00
PSp..om
d62c1311fb Fixed a long-standing but well hidden bug in message
protocol.  In the wild, I've only seen this crop up in
really really odd circumstances.  As it turns out, the 
throughput tests eventually trigger this when testing
TCP.  I've lost sleep over wondering when this was going
to bite for real so I'm glad to have what is essentially
the last known bug in message transfer fixed.
This change handles the case where so far only one
byte of the two byte message size has been read from
the network.  Rare, but it can happen.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7976 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-05 06:46:56 +00:00
PSp..om
a0dea25ec5 Fixed an event ordering issue. The server now only
first the connection added event after sending the
connect confirmation to the client.  This prevents
a resource deadlock if the connection listener
tries to send a message to the client and the
client tries to send a response back... since the
client won't have been fully initialized yet.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7854 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-07-12 20:07:11 +00:00
PSp..om
68bac95cd5 Added some more information to the logging.
Removed an errant nextId decrement that would occur
even if the class was already registered and already
had an ID.  This makes the teetering tower of glass
shards slightly less fragile... slightly.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7722 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-06-24 10:06:41 +00:00
PSp..om
98267c3d0f Added a check for no-arg constructor during initialize
to avoid having to wait to find this out until a message
is sent.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7694 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-06-23 08:19:06 +00:00
sha..rd
8cbb0f210d * Small javadoc fixes
* Formatting for com.jme3.effect package
 * Formatting for blender importer and networking tests
 * All networking tests ported to new SpiderMonkey
 * Removed all mentions of java.util.Serializable
 * RMI now works under new SpiderMonkey

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7593 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-06-12 05:17:41 +00:00
PSp..om
71df4f9acd Client will log the exception that causes it to disconnect
just in case the caller has not registered any listeners.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7525 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-25 20:33:59 +00:00
PSp..om
e6c9cbac12 Modified the setAttribute() method to remove the attribute
if the value is null instead of throwin an NPE.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7485 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-11 17:12:01 +00:00
PSp..om
8ed2db29a6 Reworked how client connection teardown happens in the face
of the network connection disappearing or any other random errors
on the channel.  Now errors that cause the connection to drop
will be properly reported as client disconnects... there is also
a new error field on the DisconnectInfo that is filled in in these
cases.
Added an ErrorListener that can be used to more tightly control
how errors are handled for the Client.
Fixed the double event dispatch that occurred during Client
closing.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7451 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-05 05:59:52 +00:00
PSp..om
95315cfd0c Fixing a pretty significant typo.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7450 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-05 05:49:18 +00:00
PSp..om
17221395dc The KernelAdapter now keeps a rolling message buffer
for the endpoints when using a reliable connection.
There is no guarantee that the buffers going out from
a client won't be chopped up by the networking stack
in various ways.  It was always the intent to accumulate
them like this (the client side already does after all)
but it was an oversight.  It's a testament to modern
networking that this hasn't come up in practice yet.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7449 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-05-05 05:07:28 +00:00
PSp..om
1b837fe7ea Make client-side background threads daemon.
Reduced the amount of logging from invalid UDP messages
received.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7314 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-26 21:53:49 +00:00
PSp..om
2bc6e27200 Proper fix for the bug where JME's quaternion wasn't
being serialized automatically.
When a class is final and in the field of a class that
is registered, it is safe to register it automatically
because the type can be determined reliably on the
other end of the stream.  So now it allows that.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7276 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-20 17:41:15 +00:00
nor..67
1203073bd9 - make SM Serializer only display warning instead of throwing an Exception when the class has not been registered, internally supported classes like jME math primitives were not accepted anymore
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7267 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-20 13:58:26 +00:00
PSp..om
d0a5ce55b9 Moved some exception handling to terminate connections
that throw low level exceptions.  The specific case I
saw for this was "An existing connection was forcibly
closed by the remote host" IOException.  Without this
new handling, SM continually tried to send the connection
its data.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7260 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-18 17:27:11 +00:00
PSp..om
9073820361 Reuse one big buffer per thread and copy the outbound
smaller buffers.  Way faster and way cheaper overall.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7259 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-18 05:56:52 +00:00
PSp..om
85b4eea8d7 Name the executor threads based on something that might
be useful to someone debugging thread dumps. ;)


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7258 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-18 03:48:41 +00:00
PSp..om
7d6d513fa5 Modified the DefaultClient (really its ConnectionAdapters)
to send their outbound data on a background thread.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7257 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-18 03:17:18 +00:00
PSp..om
e298a4357e Modified the toString() for UdpEndpoint to include
the address instead of the socket... since they all share
the same socket anyway and the datagram sockets don't 
have useful toString()s.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7256 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-17 21:14:41 +00:00
PSp..om
5225599ee2 Fixed a case where an exception would kill the kernel
adapter thread.  Also improved the details of the error
logging.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7255 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-17 21:04:09 +00:00
PSp..om
593d9bf35a UDP-based kernel now does its writes on a background
thread.  Most of the time UDP packets go right out
but not always... depending on the network layer it can
take a couple of milliseconds.  And that's alot when
you're blasting packets out to a dozen users 20 times
a second.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7245 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-04-16 03:51:43 +00:00