Allow bureau clients to report fatal errors if something goes wrong, like oh I don't know... maybe a disconnection perhaps
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5489 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -101,6 +101,9 @@ public class BureauRegistry
|
||||
public void bureauInitialized (ClientObject client, String bureauId) {
|
||||
BureauRegistry.this.bureauInitialized(client, bureauId);
|
||||
}
|
||||
public void bureauError (ClientObject caller, String message) {
|
||||
BureauRegistry.this.bureauError(caller, message);
|
||||
}
|
||||
public void agentCreated (ClientObject client, int agentId) {
|
||||
BureauRegistry.this.agentCreated(client, agentId);
|
||||
}
|
||||
@@ -396,6 +399,22 @@ public class BureauRegistry
|
||||
bureau.summarize();
|
||||
}
|
||||
|
||||
protected void bureauError (ClientObject caller, String message)
|
||||
{
|
||||
for (Bureau bureau : _bureaus.values()) {
|
||||
if (bureau.clientObj == caller) {
|
||||
log.info(
|
||||
"Bureau error occurred", "caller", caller.who(), "message", message,
|
||||
"bureau", bureau.bureauId);
|
||||
bureau.client.endSession();
|
||||
return;
|
||||
}
|
||||
}
|
||||
log.warning(
|
||||
"Bureau error occurred in unregistered bureau", "caller", caller.who(),
|
||||
"message", message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for when the bureau client acknowledges the creation of an agent.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user