Revamped chat handling a bit:
- the ChatProvider is now a proper singleton rather than providing static methods for everything (it is accessed through CrowdServer.chatprov) - it can now be extended to create a custom UserMessage for tells (which can contain avatar information on systems that want to show an avatar on the receipt of a tell) - the ChatProvider API was tidied up a bit as some methods had been addded over time that were not sufficiently general purpose so their callers will be changed to use the general purpose APIs. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4251 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -46,6 +46,9 @@ public class CrowdServer extends PresentsServer
|
||||
/** The place registry. */
|
||||
public static PlaceRegistry plreg;
|
||||
|
||||
/** Our chat provider. */
|
||||
public static ChatProvider chatprov;
|
||||
|
||||
/**
|
||||
* Initializes all of the server services and prepares for operation.
|
||||
*/
|
||||
@@ -78,7 +81,8 @@ public class CrowdServer extends PresentsServer
|
||||
BodyProvider.init(invmgr);
|
||||
|
||||
// initialize the chat services
|
||||
ChatProvider.init(invmgr, omgr);
|
||||
chatprov = createChatProvider();
|
||||
chatprov.init(invmgr, omgr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,6 +94,15 @@ public class CrowdServer extends PresentsServer
|
||||
return new PlaceRegistry(invmgr, omgr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the {@link ChatProvider} we'll use to handle chat (or a
|
||||
* derivation).
|
||||
*/
|
||||
protected ChatProvider createChatProvider ()
|
||||
{
|
||||
return new ChatProvider();
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow derived instances to create a custom {@link BodyLocator}. If the
|
||||
* system opts not to use {@link BodyObject#username} as a user's visible
|
||||
|
||||
Reference in New Issue
Block a user