Commit Graph

36 Commits

Author SHA1 Message Date
Ray J. Greenwell 3bbe3a6330 Suppress logging of common peer condition.
This has been happening for a while on PX and I've been meaning to track
it down. When a peer shuts down an object that's proxied on other peers,
the other peers receive an ObjectDestroyedEvent, and clear the object
from their omgrs. Other listeners may also receive the event and will need
to clear the proxying information, but that causes an unsubscribe to be
queued up, which when it runs will find the DObject already gone, and log
an error.

At first I considered not queuing up the unsubscribe action if the object
is no longer present in the omgr, but in the case that I'm working with
we have 2 or more objects that will all be destroyed simultaneously.
Even if I test to see if the first object is around or not, this same
test would always pass for the second object even though its death event
is next on the queue. The unsubscribe would be enqueued after THAT, so
there's no test to detect that the two objects are linked.

Instead, just suppress this message if we're a peer client. I didn't
want to suppress it altogether because we might want this message logged for
normal client connections. Maybe not.

Perhaps there is a better way. Maybe the PeerNode should add its own
ObjectDeathListener and clear out the proxy information and ensure that
the proxied object is also destoyed, and clients need not unproxy manually
in that case.

RFC.
2013-10-26 18:33:53 -07:00
Ray J. Greenwell 408cf8aa6e Remove 'TEMP' logging from 2008-2009.
The proxy stuff shows up all the time in the px logs.
2013-10-26 18:27:13 -07:00
Michael Bayne f1f1b3bc7e Complain not about rawtypes here javac7. 2013-09-16 10:45:05 -07:00
Ray J. Greenwell de3ca2b2ef Final tweaks to the reboot manager.
Consolidate warnings and interval scheduling in doWarning().
Don't let the reboot time drift because of delays on the RunQueue.. each
warning is scheduled based on absolute time from _nextReboot.

doWarning() now takes two args so any subclasses that had overridden
it (unlikley beyond PX) will break...

PendingShutdownObservers will now get the actual milliseconds until reboot.

Basically: after all this, things should essentially work the same except
now there is a protected three-arg version of scheduleReboot that lets you
schedule an exact time, bypassing the normal round-up to the next highest warning time.
2013-08-23 16:34:35 -07:00
Ray J. Greenwell 84e074103b Allow scheduling reboots at exact times.
Previously a reboot time was only exact if it was further away than
the first warning. Otherwise, the time was rounded upwards to
the next warning time. This is probably still desired for manually
scheduled reboots, but when trying to coordinate reboots between
nodes we need to be able to schedule them exactly even if we're
already in the warning phase.
2013-08-23 15:25:45 -07:00
Ray J. Greenwell f3e24f5e89 Added cancelReboot(). 2013-08-23 14:26:47 -07:00
Ray J. Greenwell e67b9e224f Tweaks to the way the reboot manager computes scheduled reboots.
- Previously if you scheduled a reboot for 5am every day, but the
server came up at 3am, it would schedule the reboot for 5am the next
day. Subtract a day if the current time is before the rebootHour.
- When skipping weekends always push the time out rather than
pulling it in. Questionable, but so was the previous behavior.
If you set it to reboot daily but skip weekends, it would not
skip weekends.
2013-08-23 13:28:02 -07:00
Michael Bayne c54b158abd Notify client observers directly if we're already on the RunQueue thread.
This avoids a needless wait in the run queue for most notifications. Only
notifications that result directly from something one of the communicator
threads did will need to do a loop de loop.

This should close the hole where ClientObserver could be told that the
ClientObject was available *after* some events have come in on the ClientObject
(which they then miss). Now when the subscription response comes in for the
ClientObject, observers are notified immediately, and will be wired up and
ready for any messages that are themselves already in the queue ready to be
dispatched.
2013-08-23 10:29:48 -07:00
Ray J. Greenwell b89ea9452f Fail with an informative message if there are NO constructors.
Which shouldn't happen.
And re: the last commit, this is only called once for each class
so the deal wasn't so big.
2013-03-20 18:05:26 -07:00
Ray J. Greenwell 09ff91cbdb Let's just reflect once when there's no 0-arg constructor. 2013-03-20 18:02:36 -07:00
Mark Johnson e88ffcce66 Have PresentsServer pass itself to PresentsInvoker when starting the thread instead of being
injected directly into the invoker to prevent potential circular dependency issues.
2013-02-05 15:47:29 -08:00
Mark Johnson d86c851856 Require passing in the DObjectManager for activatePeriodicReport instead of injecting it which was
causing a circular dependency
2013-02-05 13:48:57 -08:00
Ray J. Greenwell 899c976ee7 Whoops: if the stopwords were empty, the pattern matched everything. 2012-12-12 14:17:54 -08:00
Ray J. Greenwell 3ba24a3dc5 Bugfix: cope with an empty stopwords list. 2012-12-12 13:32:49 -08:00
Ray J. Greenwell 776db7fe26 Avoid "if false return false".
But really, these methods should throw an Exception if the key is no good.
Not just return false, which nobody is probably checking.
2012-09-14 11:16:50 -07:00
Ray J. Greenwell 6cfc0890c6 Presumably this should call isAuthenticPeer().
Otherwise nothing calls it.
2012-09-14 11:15:57 -07:00
Ray J. Greenwell ac9083dda5 De-fuckup the /help command handler.
- Put "/help " (with a space after it) in the history so that it's useful.
- Don't return the usage as an error, or the chat entry field
  won't clear. What the fucking fuck? Seriously, there was a 3-fucking-line
  comment in here about doing the right thing and someone ignored it
  and made it do the wrong thing.

SK has been doing the wrong thing in response to chat errors, and now I worry
that games that used to do the right thing have changed to do things
incorrectly because the fucking help command has been fucked up for 2 years.
2012-09-07 11:37:38 -07:00
Ray J. Greenwell 1cafd937b1 Nix null as a nodename: have an explicit adHoc flag.
The hostname being null interfered with peer locks.
Instead let's just allow ourselves to be inited in
"adHoc" mode.

init()'s overloads are becoming overloaded...
populating a properties object might be better...
2012-08-22 19:18:59 -07:00
Ray J. Greenwell 4d8feb215b Nix cruft. 2012-08-13 15:45:27 -07:00
Ray J. Greenwell 7c4a98b3ec Whitespace. 2012-08-08 15:13:45 -07:00
Ray J. Greenwell 24a5800536 More checks for nodes without node objects.
When a NodeAction was queried for which nodes were applicable, it
filtered out nodes that didn't have a nodeObject.
However, when a NodeRequest is similarly queried, null nodeObjects
were not filtered out and I guess it was up to the NodeRequest to
say "no" to null nodeObjects. This is not part of the API specification
for NodeApplicant, and in Spiral Knights we have various requests/actions
that simply return true without regard to the contents of the nodeObject.

So that's fucking retarded. Do the null check just like it's done
for NodeActions. In addition, do an extra check if one of single-node
methods is called for an action or request, to make sure that one
pre-determined node has a nodeObject set up. If not, log a warning,
and return an error response in the NodeRequest case.
2012-08-08 15:04:05 -07:00
Ray J. Greenwell 78515ffcdb Compare node names safely.
And other further fixes to "ad-hoc" nodedness with only one node.
2012-08-08 14:41:51 -07:00
Ray J. Greenwell 829139b1e7 Don't save the NodeRecord if our nodeName is null.
This is to support running in ad-hoc, single-node noded mode.
However, it appears some code in here will choke on a null
node name.

This is for something in Spiral Knights, where we used to run
in non-noded or noded mode, and so we already cope with the
nodeName being null. Now we want to always run noded, so that
we can DRY and not check various local variables before checking
the (other) NodeObjects: now we can just check against all
the node objects.

So I may need to return here and make safe various equality
checks against the nodeName.
2012-08-01 18:44:49 -07:00
Ray J. Greenwell 0686b3f8ee Update comment with new method name. 2012-07-19 13:13:45 -07:00
Ray J. Greenwell 982cfc9a10 Manager caller method names are whitelisted. 2012-07-19 11:49:50 -07:00
Ray J. Greenwell 93517c8e42 Disable "manager calls" by default. **Breaking change**
This closes a giant security hole, but may break existing code.

PlaceObject.ManagerCaller is a poor-man's InvocationService, allowing
one to easily make a call to a method on the PlaceManager. The problem
is that this is turned on by default and any matching method is run.

This change disables it by default, but you may re-enable it by
overriding PlaceManager.handleManagerCalls() and returning true.

I also went ahead and made the ManagerCaller.invoke() method deprecated
so that you'll see a nice warning during compile time. You should
really consider just using a standard InvocationService to communicate with
the server. That way you effectively create a whitelist of client-callable
methods and there will be no surprises.
2012-07-18 17:32:18 -07:00
Ray J. Greenwell 12b9c7199b Make AuthException public.
The Authenticator may delegate to another class that
can't currently access this.
2012-06-20 16:40:30 -07:00
Mark Johnson 83e94c122d - Expose comicChars as a static function 2012-06-11 11:18:43 -07:00
David Hoover 571f4c5f25 Speeling 2012-05-22 15:12:31 -07:00
Ray J. Greenwell a10fc9111c Occam's razor. 2012-03-23 17:23:01 -07:00
Michael Bayne 879f919399 Made config object un/serialization pluggable.
This is much simpler than requiring customizers to extend and override a bunch
of classes just to poke their fingers into the un/serialization process.
2012-03-14 15:24:38 -07:00
Michael Bayne 1c1af8a8e7 Demonstrate parameterizing TestService on TestClientObject. 2012-02-29 17:21:55 -08:00
Dave Hoover e2f86a4f3c Nuke Resulting.ReusableInvocationException.
Premature optimization the fun side effect of rendering the
exception's attached stack trace completely useless.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6794 542714f4-19e9-0310-aa3c-eee0fc999fb1
2012-02-17 19:25:50 +00:00
Mark Johnson 1117025e40 - Added a method to retireve only running nodes from a specific region
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6788 542714f4-19e9-0310-aa3c-eee0fc999fb1
2012-02-16 02:19:04 +00:00
Michael Bayne 1c311431ad Finished the job of splitting Narya into submodules.
The ActionScript code is now under aslib and is built via Maven (and Ant). The
CPP code is under cpplib and is ignored by everything (other than service
generation), but now at least it's not crufting up the Java submodule with its
XCode project.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6783 542714f4-19e9-0310-aa3c-eee0fc999fb1
2012-02-14 19:11:33 +00:00
Michael Bayne a7e0893191 Factored Narya into two Maven modules: core and tools.
This will allow us to properly ship narya-tools.jar to Maven Central which is
necessary for Nenya and Vilya (and any other Narya-using project) to themselves
be built.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6776 542714f4-19e9-0310-aa3c-eee0fc999fb1
2012-02-03 21:25:13 +00:00