Commit Graph

5579 Commits

Author SHA1 Message Date
Charlie Groves 973ec8faf8 Generate EntryEvent to get things building again. Add EntryUpdatedEvent for completeness.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6282 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-17 02:55:10 +00:00
Michael Bayne e7ffb611cb This changes things to match Ray's Java event hierarchy change. I don't know
whether it's desirable, or breaks things, or what.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6281 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-17 01:09:21 +00:00
Ray Greenwell a9416fd235 Created a new abstract parent class for Entry*Event: EntryEvent.
The big win is that getKey() now exists on each of those event types.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6278 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-17 00:00:49 +00:00
Charlie Groves 890cc0bdc1 Forgot to commit the RegistrationService implementation on Saturday
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6275 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-16 22:53:45 +00:00
Mike Thomas 9153960fce This was excitingly ASCII-centric. If a filter was specified on "foo*" it would match "foobar" but not "foobär" or "foob0r" - now it should match all of those.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6272 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-16 18:12:03 +00:00
Charlie Groves 08c1051809 Java 1.5, bane of my existence
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6271 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-16 04:06:06 +00:00
Charlie Groves 544d41d24d Make ConnectionManager a general-purpose select server and implement a flash Policy server with it.
The presents-specific portions of ConnectionManager like reading Message subclasses and sending
datagrams are now in PresentsConnectionManager.  PresentsServer should behave identically, except
during shutdown.  Before, connections would be accepted and datagrams would be read until the OMgr
thread exited.  Now, both stop as soon as the server begins its shutdown.  This seems like an
improvement to me, but let me know if it causes issues and I can rework it.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6270 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-16 03:33:45 +00:00
Charlie Groves ecb5f96567 Sort the includes for cross-JVM generation consistency
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6269 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-15 20:52:23 +00:00
Charlie Groves 1cb16d4173 Add RegistrationService to allow cpp clients to register receivers even though they're not using DObject
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6268 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-14 01:01:23 +00:00
Charlie Groves 965f2893b8 Use the proper iOS detection define
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6267 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-14 00:30:43 +00:00
Charlie Groves 4e8fdf66f4 Whoops, 1.6ism
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6265 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-13 22:36:55 +00:00
Charlie Groves 1f010f0a4e Add a C++ client for presents.
It provides code generators for streamables, services and receivers, but not DObject.  It uses
Apple's CFNetwork for its sockets and builds with XCode, so it's limited to OS X and iOS. It should
be straightforward to replace both to make it cross-platform.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6264 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-13 21:58:45 +00:00
Michael Bayne 7df0de5389 Keep our resources in src/main/resources per the standard project layout.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6251 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-08 17:31:33 +00:00
Charlie Groves 07706ec61e handleAcceptedSocket can't be called by code outside of ConnectionManager as it
touches the _handlers Map which should only be modified on the
ConnectionManager thread.  Add transferAcceptedSocket for outside socket
acceptors to call.  It sticks new sockets into a queue, which are then passed
to handleAcceptedSocket as part of ConnectionManager's iterate.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6250 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-05 23:07:19 +00:00
Andrzej Kapolka 07b6a3a102 We should probably reset the dropped count each time the connection is
cleared.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6249 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-05 03:08:12 +00:00
Andrzej Kapolka a9fdaee8d5 Addressing a longstanding issue with the chat command aliases/translations.
The help message for /help <command> was using the translated/aliased string,
which meant that you had to have a usage translation for each command alias.
This became unmaintainable in Project X, where we had artists adding emotes
with lots of aliases, and I'm guessing it was booched in the Y!PP translations,
since they seem to lack translations for things like m.usage_escuchar.  Let's
instead use a usage message based on the untranslated command, then compose
the actual command used into that (for aliases).  This should be mostly
backwards-compatible, but I will be updating Yohoho and Bang in addition to
Project X: this involves replacing the command name in the usage translations
with {0} and returning getUsage(command) instead of "m.usage_blabla".


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6248 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-30 00:52:53 +00:00
Charlie Groves 7fd5aee306 Missing @Overrides
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6244 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-27 23:44:31 +00:00
Mike Thomas ff817dbca9 Make the AsString editor notice that things are the same when their string values match. Otherwise when we have a comma-separated array, when we lose focus, even if things match, we believe we don't match because an array's equals just compares pointers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6242 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-26 20:10:02 +00:00
Dave Hoover 0bb3713fe8 We're already using T for other things.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6241 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-25 23:10:08 +00:00
Michael Bayne 0f8fd31f83 Regenerated the test bits with the gen tasks.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6233 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-23 19:38:17 +00:00
Michael Bayne e0dfddb46b Handle parameterized types in invocation services and receivers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6232 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-23 19:37:51 +00:00
Andrzej Kapolka 93aa0b5bf6 Apparently this boolean needs to be set explicitly; also, whitespace fix.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6228 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-23 04:06:47 +00:00
Michael Bayne 3b54853878 This old native code for dispatching signals needs to die die die. It's long
since been replaced by using the secret undocumented JDK APIs for doing the
same thing. AFAIK that works on all of our servers and we're not shipping
libsignal.so with anything.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6225 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-22 21:59:18 +00:00
Michael Bayne 9d2ca42eac Convert Narya (most of the way) over to a Maven Ant task based build. The
ActionScript bits remain belligerent, but the Java stuff is mostly shipshape.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6222 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-22 21:12:29 +00:00
Dave Hoover 0e18ec920e Unused import
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6220 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-22 20:48:54 +00:00
Michael Bayne 4b443fe148 Last night, I read about the Mustache templating library (a derivative of
Google's CTemplate) and got all hot and bothered, because it seemed like it
would be sufficiently powerful to replace Velocity for our Narya templating
needs.

I then sought out a Java implementation and found one, and quickly discovered
that it lacked the right level of awesome for my needs. So I foolishly decided
to write my own, because Mustache seemed simple enough that I could reimplement
it in a few hours.

A few hours later, I had a neat and tidy reimplementation of Mustache and then
set about to converting Narya to using it. Then the fun began.

I discovered that Mustache wants everything in a hash, but sometimes you just
want to iterate over the elements of a list, and print them into the template
whole-hog. So I extended Mustache with the special "this" variable for printing
the whole context instead of pulling values out of it by name.

Then I remembered that Velocity allows you to do a deep dive into objects,
calling methods and calling methods on the return values of those methods.
Velocity even allows you to pass constants as arguments to those methods (true,
strings, integers). Well, I reimplemented the compound keys, so that you can
call foo.bar.baz, but I didn't go so far as to support constant arguments. That
seemed a step too far into complexity land and to be the sort of thing that
Mustache tries to avoid. So with compound keys, I just had to add a few
alternative versions of methods we were already calling, since we only ever
passed true/false as an argument.

Then I realized that Mustache doesn't do any smart trimming of newlines, so if
you have:

{{#stuff}}
blah blah
{{/stuff}}

You get the annoying newline after the open-tag and after the close-tag. So I
modified my implementation to trim newlines in those circumstances, so that
template authors don't have to do a bunch of template-weirding whitespace
jockeying.

Then I discovered that Mustache doesn't support any notion of scope. So when
you're inside a so-called section, the only variables visible are those bound
by that section. The stuff outside the section is totally invisible. Well,
that's not how Velocity works, you can reference things outside your loop
iterations. It seemed no terribly affront to Mustache to make things work that
way as well, so I did that.

Then I discovered a problem with the fact that Mustache implicitly binds the
loop object to the root of the namespace, so if you have {{name}} outside the
loop and then your loop object also contains a {{name}} field, then you can't
see the outside {{name}} anymore because it's shadowed. Tough titties, in this
case, I just changed our code to not shadow the name.

Then I encountered a bunch of uses of $vidx to put a space before all but the
first element of a list. So I added two more special variables -first and -last
which allow you to do just that sort of thing (and more) in a more template
friendly way because you don't need a Turing complete language just to decide
whether or not you need to mind the gap.

Then I encoutered some uses of $vidx directly, where we were using it to assign
constants in invocation service related classes. So I added another special
variable -index which resolves to basically the same thing that $vidx resolves
to (a 1-based counter indicating which element you're on in your list
iteration). I rationalized to myself that if you wanted to automatically number
laundry lists in your templates, having -index would be nice.

Finally, I have Narya's templating stuff producing character-for-character
replicas of what it used to do with Velocity. Well, actually there's one
newline in a place where there didn't used to be one, but I think that newline
makes sense and it was maybe some sort of Velocity bug that caused it not to
exist.

I've tested the gendobj, genservice and genreceiver tasks. I have no tested
whatever uses streamable_as.tmpl, but I'm pretty confident that it will work
exactly as before because I modified hundreds of lines of other templates in
exactly the same ways and they all work just fine.

So the world gets yet another templating library:

http://code.google.com/p/jmustache/


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6218 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-22 06:42:47 +00:00
Charlie Groves c61038277c Go back on looking in the child classpath first; that means the client version of the presents
classes are found before the tools version, and class equality comparisions don't work.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6217 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-22 01:18:48 +00:00
Mark Johnson e96310b43b - Prefer reading from the created classpath instead of the parent classpath
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6216 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-19 23:47:24 +00:00
Charlie Groves 20d97bf26a Mark StreamableArrayList and StreamableHashMap as replaced by their basic Java counterparts. Basic
Map and List types are streamed as fields, which are smaller on the wire.  I'd deprecate them, but
yohoho uses them all over the place.

Handle generating code for StreamableArrayList and StreamableHashMap in actionscript for existing
code.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6215 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-18 21:18:36 +00:00
Dave Hoover 3a25e8a3b9 Update source headers to point to our new home.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6214 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-18 18:01:12 +00:00
Charlie Groves 250e74e339 Move all the fileset and classloading wanging into GenTask
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6213 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-16 23:16:14 +00:00
Charlie Groves 9c945bbacd No need to generate a default constructor; let it be filled in the non-auto section if desired. Don't indent the implements statement if there isn't an extends.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6212 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-16 23:15:44 +00:00
Dave Hoover ce3538c409 Boo, Ray's right; I can't do that.
Not all streamable things are Streamable (e.g. String, Integer)

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6211 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-15 20:53:21 +00:00
Dave Hoover e59135fdd5 Values in StreamableHash[Int]Maps must be Streamable, so let the compiler know.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6208 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-15 20:16:11 +00:00
Dave Hoover ea58e7a7b7 Whitespace
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6207 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-15 20:16:09 +00:00
Dave Hoover d17407cfaf Generics
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6206 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-15 20:16:07 +00:00
Dave Hoover 34dfd3ebd6 Wrong "its"
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6205 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-15 20:16:06 +00:00
Charlie Groves 13f43728ec Generate streaming code for Map
Is there a reason Map isn't Equalable?  java.util.Map requires an equals implementation, and it has
the same lack of guarantee of its values implementing equals.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6201 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-15 08:42:39 +00:00
Charlie Groves bcbeb03345 Only two pieces of debugging code slipped past me in that small commit
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6200 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-15 07:56:13 +00:00
Charlie Groves aad715138c Make writing List fields on Streamables possible from ActionScript again, and fix List reading and
writing in the code generated by GenActionScriptStreamableTask.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6199 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-15 07:53:38 +00:00
Charlie Groves 5d48f7726a Add a generated source updating tool and an actionscript streamable generator built with it.
GeneratedSourceMerger merges the latest version of generated source into a previously generated
version a la GenRecordTask SourceFile.  Unlike them, it doesn't have a hardcoded set of sections to
update.  Instead it finds any sections using the // GENERATED <name> START and // GENERATED <name>
END markers in newly generated version and replaces those same sections in the old version.

GenActionScriptStreamableTask creates actionscript Streamable classes from their Java counterparts
like GenActionScriptTask, but unlike GenActionScriptTask it doesn't attempt to parse Java source to
generate actionscript.  It only generates actionscript code to do streaming and leaves any
custom implementation to the user.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6196 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-14 22:55:44 +00:00
Michael Bayne 1471e82f3a Provide a HistoryList mechanism down here in the basic service.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6194 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-14 16:19:17 +00:00
Michael Bayne 586b29fa09 The ChatDirector requires a MessageManager, so let's promote that to a real
CrowdContext service instead of sneaking it into the ChatDirector's
constructor. That way other CrowdContext users can make use of the
MessageManager as well.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6192 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-14 15:45:06 +00:00
Michael Bayne 3462ee2661 Exception is already Serializable and GWT accepts Serializable in lieu of
IsSerializable. If possible, it would be nice to keep GWT references out of
narya-base (where com.threerings.web ends up).

I'm already dealing with the breakage caused by GWT in narya-distrib, but I'd
rather not have to filter GWT out of narya-base *and* narya-distrib in every
Proguard configuration from here to Gomorrah, if possible.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6187 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-12 18:05:30 +00:00
Michael Bayne f4af1915b0 Build narya-tools with jarjar so as to hide its included dependencies in the
unfortunate event that someone puts it on a real project classpath.

Modified GenTask to totally hide Velocity from derived classes so that external
libraries can make use of it in their own Ant tasks without inheriting a
Velocity dependency and also becoming booched because Velocity was renamed in
jarjar and won't link against an unrenamed Velocity.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6185 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-12 17:35:41 +00:00
Par Winzell bdff124525 Strings have length, Zell.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6183 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-07 20:23:24 +00:00
Par Winzell 72d0016963 I guess I have to actually use a Java5 SDK for Narya. How's that whole 'convert to java 6' thing going, yohoho folks?
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6182 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-07 20:10:34 +00:00
Par Winzell d26267c704 GWT frontend and servlet for editing runtime configuration.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6178 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-07 19:21:48 +00:00
Par Winzell 3069062034 Some basic GWT infrastructure.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6177 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-07 19:21:24 +00:00
Ray Greenwell 1b30ef96cf Quell enthusiastic logging for an inevitable action.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6176 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-10-07 17:28:49 +00:00