Commit Graph

3378 Commits

Author SHA1 Message Date
Michael Bayne 45ec296ba0 Here's a giant performance improvement: the current Presents architecture
flattens messages into a buffer and then passes that bucket to a
SocketChannel.write() method which is part of the NIO business. If said
buffer is a "direct" buffer, the write() method will in theory do
high-performance shit like DMA the data right to the network card. If it's
not a direct buffer, Sun apparently makes a temporary direct buffer,
copies the data into it and passes that on to the underlying socket send()
call. We weren't using direct buffers which means that we were copying
everything one more time than needed (not a huge deal) and that we were
allocating a direct buffer for every message (a much bigger deal). This
should take a serious load off of the I/O thread and fortunately we can
test it on Ice to make sure it doesn't do anything super crazy.

All this said, this whole business is going to change when I rearchitect
Presents to avoid the potential race conditions it suffers from now and we
won't be able to use a single direct buffer to write all of our outgoing
messages, but I believe we will be able to use a pool of direct buffers
with one used by every message in the queue waiting to be written
(hopefully that won't be too many at any given time) which we can keep
around to avoid the expense of allocating and freeing direct buffers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3336 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-08 05:08:47 +00:00
Michael Bayne 53c3435854 Handle cases where one or the other direction does not scroll for lack of need.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3335 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-07 03:53:54 +00:00
Michael Bayne ff4f9d4a9c A helper that makes it easy to wire up scrollbars or a scrollbox to a
virtual media panel.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3334 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-07 03:37:39 +00:00
Michael Bayne 02db6a2b73 Further cross-"platform" jockeying.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3333 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-03 01:59:59 +00:00
Michael Bayne 40b6fc31d7 More jockeying to make things happy with Linux and FreeBSD.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3332 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-03 01:30:33 +00:00
Michael Bayne d49873820d Use names that correspond with System.getProperty("os.name").
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3331 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-03 01:25:21 +00:00
Michael Bayne 279849151c Use names that correspond with System.getProperty("os.name").
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3330 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-03 01:24:57 +00:00
Michael Bayne 924ab5c9e6 We've got crablegs! And a special Makefile for Linux and FreeBSD.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3329 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-03 01:22:28 +00:00
Michael Bayne ecf7c7f415 Fuck me riding a pony; whatever goddamned make that FreeBSD uses is
sufficiently incompatible with GNU make that I'd rather just have two
whole separate goddamned directories with their own Makefile than try
to get everyone to agree on how to do things.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3328 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-03 01:16:12 +00:00
Michael Bayne f26c58ef4d Revamped things to work in multiple flavors of Joonix.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3327 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-03 01:02:58 +00:00
Ted V f7109f64bf Was doing some debugging; opted to leave the log import checked in.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3326 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-01 23:11:42 +00:00
Ted V 66321690e6 Animation now accounts for X acceleration.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3325 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-01 20:42:21 +00:00
Ted V 6206d9f71b Added construction interface for X axis acceleration.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3324 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-01 20:22:09 +00:00
Ted V bf463e46e9 Left logging import.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3323 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-28 22:52:53 +00:00
Ted V 42fb1f095b Needed some debug information from this class; figured I'd leave the
Log import in there.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3322 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-28 21:13:27 +00:00
Michael Bayne 56417cdb0a Indicate whether we rejected an attempt to logon because we're still in
the throes of a previous connection. Also don't spuriously recreate our
ticker because it's very possible for logon() to be called and not
logoff(), logon() might fail, for example.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3321 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-28 05:03:37 +00:00
Ted V 44be1bda18 Fixed bug where action animations and sprites weren't being removed
when all animations and sprites were cleared out.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3320 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-28 03:28:38 +00:00
Ted V 81487748dc Scale animations now report when they've finished.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3319 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-28 00:07:56 +00:00
Ted V d8749a8b41 Bunch of updates to handle actual drawing of the image. Some bug fixes too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3318 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-27 23:59:39 +00:00
Ted V 4033d08113 Most of the class has been rewritten.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3317 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-27 21:17:59 +00:00
Ted V cdb7284ea2 Skeleton of a scaling animation stolen from GleamAnimation. Nothing
has been changed, except the names to protect the innocent.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3316 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-27 20:49:34 +00:00
Michael Bayne aa80b920c8 More documentation updates.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3315 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-27 04:48:00 +00:00
Michael Bayne ae5105185c More progress on our glorious Presents documentation.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3314 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-27 04:16:45 +00:00
Michael Bayne c11e8c4d3c The beginnings of documentation for the Presents distributed object
system. Oh the complexity.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3313 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-27 01:55:48 +00:00
Ray Greenwell dc09c1214d Added getTimeString() which returns more than one element of a duration
(example: 3 hours, 12 minutes and 32 seconds).

Rewrote getTimeOrderString() to be iterative.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3312 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-27 00:46:44 +00:00
Michael Bayne d2ea985abb Regenerated invocation receivers; fixing a javadoc booch in the process.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3311 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-24 23:13:00 +00:00
Michael Bayne afabea71ad Big fat Bernie javadoc cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3310 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-24 23:08:21 +00:00
Michael Bayne dd04679568 Deal with the new Invoker.UnitProfile when reporting profiling statistics,
changed the output format to be the same as the one for DObjectManager
profiling output.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3309 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-24 17:17:27 +00:00
Michael Bayne be93e5eb12 Make sure to catch any error while processing our events, not just when
actually dispatching the event to subscribers. We can't trust anyone.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3308 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-24 07:59:31 +00:00
Ray Greenwell 05d72fb406 In the fix for the macintosh copy area bug, it's pointless to compute the
rectangle of the area that would have been copied, as we know that the
_entire_ visible area is now dirty due to the failed copy. Replace the
list of dirty rectangles with one rectangle encompassing everything, it will
cut down on the iterations in the paint() method and should improve
performance on the JVM that exhibits the copyArea bug.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3307 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-21 23:59:04 +00:00
Michael Bayne 69fd36030f Added support for using a custom classloader when loading message bundles.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3306 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-20 16:32:10 +00:00
Ray Greenwell 8f40cfa2e3 Be sure to mark all the sound playing threads as daemon.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3305 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-20 00:07:27 +00:00
Michael Bayne 64b5b856ca We need to translate mouse wheel events as well.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3304 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-19 16:09:17 +00:00
Ray Greenwell 2b085bd8c2 Finished a weekend project: rewrote the SoundManager.
The SoundManager used to keep the AudioSystem's Line open for up to 30
seconds after a sound was played, maybe because I thought that opening
the line was expensive, or because it makes an audible 'tick' in linux
if no other sounds are playing. Well, it turns out that the sound looping
bug is the result of some internal befuckery of Sun's caused by keeping
the line open. Restructed the sound manager so that lines are opened
every time a sound is to be played and then closed immediately after.

This also allowed me to simplify a thing or two, and sounds should actually
be more responsive, in a tiny way, since previously the dobj thread asked
to play a sound, the sound manager thread would load the clip data and
finally a data spooling thread would play the actual sound. Now there is
no sound manager thread- so the dobj thread adds a sound to the queue and
one of the playing threads wakes up, reads the data and plays the sound.

Factored out all the music stuff into a new MusicManager. There was almost
nothing shared between the two, and it was just annoying to have one
monolithic manager that had all the logic and variables for both of these
distinct functions. The music manager also no longer has a processing
queue, everything takes place on the dobj thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3303 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-17 23:30:38 +00:00
Andrzej Kapolka f2a5845db9 GameManager was calling gameDidEnd for games that never began. Changed to check that the game was actually in play.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3302 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-14 22:49:13 +00:00
Michael Bayne 93ef73095e Make it possible for external entities to add delegates.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3301 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-14 17:06:23 +00:00
Ray Greenwell b295fb2630 Regenerated with non-NPEing code.Regenerated with non-NPEing code.Regenerated with non-NPEing code.Regenerated with non-NPEing code.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3300 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-08 22:05:00 +00:00
Ray Greenwell 8446cf4f78 We can't clone null.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3299 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-08 22:02:27 +00:00
Ray Greenwell 033e3984b6 Added a potentially dangerous temporary hack to deal with people not having compatible CreateAccountCredentials, and being told that our servers are down
when they try to create an account.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3298 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-06 19:28:53 +00:00
Michael Bayne c59290c91f Allow tables of one player which are started immediately.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3297 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-06 07:32:06 +00:00
Ray Greenwell 5ba72dce1a Occam's razor.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3296 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-05 08:07:13 +00:00
Michael Bayne 61c0dde5d5 Regenerated the distributed objects with the new clone happy bits.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3295 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-05 06:46:11 +00:00
Michael Bayne e5acc3e45f More DObject fun! We need to keep a careful separation for container
objects (DSet, arrays) in a DEvent (which should not change as a result of
other events being applied) and those in the object itself (which do
change and evolve as events are applied to the object).

This is important both because the DEvent is passed on to another thread
for delivery to remote clients, thus changes to the values in the event
could take place before they were serialized and sent over the network,
and because compound events are applied to an object before they are sent
to the other thread for delivery and thus, for example, setting a DSet and
then adding a few entries to it in a compound event would result in the
DEvent copy of the DSet becoming corrupted.

Two problems remain (note, neither of these are new, the one issue
introduced when I rewrote the DObject stuff is fixed by these checkins):

1. Object subscription requests are supposed to deliver a snapshot of the
   object at the point in the event stream at which the subscription
   request was processed, but presently we pass only a reference to the
   object off to the networking thread which means that before the object
   is serialized and sent to clients, subsequent events could be applied
   to it and then those events would be sent to the client as well
   resulting in funny business (probably nothing more than duplicate DSet
   entry warnings, but imagination and Chapter 17 tell us that worse
   things could happen).

2. The use of Streamable instances could result in badness. If a field in
   a Streamable is modified and the whole Streamable set() back into the
   object to broadcast the update, then further changes were made to the
   Streamable before the attribute change event was serialized and sent
   over the network, the second modifications would be reflected in the
   event triggered by the first modifications.

The first problem may be solvable (albeit inefficiently) by serializing
the DObject on the event dispatcher thread and sending that serialized
copy off to the network thread for delivery to the client. It would be
much less efficient as we would be unable to make use of the client's
already "primed" ObjectOutputStream which may have already mapped many of
the classes in the object to two byte codes, but object subscription is
fairly uncommon compared to delivery of events, so inefficiency might not
be a big problem in this case.

The second problem might be solved by requiring that all Streamable
implementations implement clone() and then cloning any Streamable
attribute just as we do an array or DSet during an attribute, array
element or DSet entry change. This would be a more significant performance
hit as well as require a review of all of our Streamable classes (to
determine if they need a custom clone() implementation), and it has up to
now not actually manifested as a problem.

In any case I'm not going to tackle either of these remedies at the moment
because I'm on vacation, dammit.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3294 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-05 06:24:11 +00:00
Michael Bayne 7777a14c9c DSet already complains if we add a duplicate; no need to do so twice.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3293 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-05 06:00:37 +00:00
Michael Bayne 920726f9f9 Noticed some other cleanup that could now be done.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3292 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-31 05:31:53 +00:00
Michael Bayne 0127ccba96 Only Yohoho needs the game object registered as an auxiliary source
because it plays games in a special place rather than actually moving the
player into the game room which naturally registers the place object as a
chat source. Fortunately, we can implement the necessary hackery to
support Yohoho in a reasonably generic manner.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3291 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-31 05:30:38 +00:00
Ray Greenwell f9f3d784cf My laptop repeatedly gets the sound looping bug, and I noticed that it goes for about 30 seconds before stopping. We keep the line open for 30 seconds, waiting for another sound, and there must be a bug in the Java libraries that sometimes loops the end of the sound. Expire LineSpoolers after 1 second. If this works I may restructure things so that the threads stay around longer but the lines get closed immediately after the drain delay.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3290 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-29 21:56:58 +00:00
Michael Bayne a6da0baf48 Regenerated in the new DObject world order.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3289 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-28 03:51:47 +00:00
Michael Bayne 55a0ab91f7 Regenerated our DObject derivations in the new world order.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3288 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-28 03:51:29 +00:00
Michael Bayne d27b150365 Comment fixy.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3287 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-28 03:50:07 +00:00