I was in the Court House Developer meeting yesterday. I asked if there would be any interest in a separate application for users who are not logged into PS to communicate with those in-game, via the Gossip channels. The idea was not slammed (if I understood the responses correctly) so here is my proposal.
Chat applet :: An external program for chatting directly to people in-game using PS Gossip channels.
Architecture- PS MySQL server.
- Apache Tomcat Application Server giving access to Servlets which get and set Gossip channel text on the PS MySQL server,
- A Java applet, the external chat program, embedded on the PS web page.
An example of the applet is here and uses this architecture:
http://78.105.176.34/logFarm/infoPage_227.htmlBased on this example, work required:- Create Servlets for getting and setting Gossip chat text.
To determine when new chat text has arrived the applet uses date time. It's possible the data and time of new Gossip chat text is not recorded on the PS MySQL server. This applet does all the getting and setting of text so dates and times are necessary.
- A MySQL user will need to be set up with limited access to the PS MySQL database, for use by Tomcat.
- An extra port would be opened (8084 or some such) so the applet can access Tomcat.
- Small amount of configuration on Tomcat. Basically unzip Tomcat somewhere (with access to PS MySQL) and adjust some configuration files.
- Java is required for Tomcat to work, either OpenJDK or Oracle Java.
Considerations:- Nothing is sent to my servers. All data transacts via the applet and the PS servers. The applet would reside on the PS Web server.
- The example applet above shows a list of users. I assume a similar list is accessible from the PS MySQL server. For example: who is logged into Gossip channel/s
- Would people be required to log in or like guests on the IRC channel, would they be allocated a temporary guest name.
Currently the applet allocates a temporary user name but the user can register and log in.
It's still possible to moderate temporary user names because the applet uses IP address (in addition to user names) to silence, kick and ban.
The applet retrieves the user's IP address for moderation purposes and writes various IP information to: ips
Field Type Null Key Default Extra
ipStuff varchar(100) NO PRI Unknown
So this table would need to be created.
And a table called: bans
Field Type Null Key Default Extra
userName varchar(50) NO Unknown
channelName varchar(50) NO NULL
banReason varchar(250) NO Channel privacy has been switched on.
invitedUser tinyint(1) NO 0
canObserve tinyint(1) NO 0
userIP varchar(50) NO Unknown
dateBanStarted datetime NO NULL
id int(11) NO PRI NULL auto_increment
- When users start the chat applet their logged-on status is recorded: appletGossipUsers.
Field Type Null Key Default Extra
userName varchar(50) NO PRI NULL
loggedIn tinyint(1) NO 0
pingTime datetime NO NULL
When a user starts to use the applet their user name would be added here. When the user stops using the applet their user name is removed from this list.
The pingTime field is updated periodically by the applet. If that date-time exceeds a certain period, they are considered a Zombie, meaning the applet has not cleaned up properly. On my server I run a separate application: a Zombie manager
- For each user there will be a bandwidth cost of around 0.3kb/second.
- The applet allows /join so temporary channels can be created. Should these temporary channels also be available in game. PS allows other Gossip channels to be created right? The /join command could be limited to creating other PS Gossip channels.