Update of /cvsroot/neuclear/neuclear-bet/src/java/org/neuclear/bet/games/hipodream
In directory sc8-pr-cvs1:/tmp/cvs-serv10206/src/java/org/neuclear/bet/games/hipodream
Modified Files:
HipoApp.java HipoDream.java HipoDreamHorse.java
HipoDreamRace.java HipoDreamRaceFactory.java
Log Message:
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Index: HipoApp.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-bet/src/java/org/neuclear/bet/games/hipodream/HipoApp.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** HipoApp.java 20 Sep 2003 23:19:21 -0000 1.1.1.1
--- HipoApp.java 21 Nov 2003 04:42:45 -0000 1.2
***************
*** 15,22 ****
* Time: 4:50:16 PM
*/
! public class HipoApp implements ResultListener, NewEventListener {
! public static void main(String args[]) {
! HipoApp hipo = new HipoApp();
}
--- 15,22 ----
* Time: 4:50:16 PM
*/
! public final class HipoApp implements ResultListener, NewEventListener {
! public static void main(final String[] args) {
! final HipoApp hipo = new HipoApp();
}
***************
*** 24,28 ****
public HipoApp() {
System.out.println("Starting HipoDream");
! HipoDream game = new HipoDream();
game.addNewEventListener(this);
--- 24,28 ----
public HipoApp() {
System.out.println("Starting HipoDream");
! final HipoDream game = new HipoDream();
game.addNewEventListener(this);
***************
*** 34,38 ****
* @param outcome
*/
! public void win(EventOutcome outcome) throws LowlevelLedgerException {
System.out.println(outcome.getEvent().getTitle() + " was won by: " + outcome.getTitle());
}
--- 34,38 ----
* @param outcome
*/
! public final void win(final EventOutcome outcome) throws LowlevelLedgerException {
System.out.println(outcome.getEvent().getTitle() + " was won by: " + outcome.getTitle());
}
***************
*** 42,46 ****
* @param outcome
*/
! public void scratch(EventOutcome outcome) throws LowlevelLedgerException {
}
--- 42,46 ----
* @param outcome
*/
! public final void scratch(final EventOutcome outcome) throws LowlevelLedgerException {
}
***************
*** 50,58 ****
* @param event
*/
! public void cancelEvent(BettingEvent event) throws LowlevelLedgerException {
}
! public void addEvent(BettingEvent event) {
System.out.println("Added: " + event.getTitle() + " at: " + new Date());
}
--- 50,58 ----
* @param event
*/
! public final void cancelEvent(final BettingEvent event) throws LowlevelLedgerException {
}
! public final void addEvent(final BettingEvent event) {
System.out.println("Added: " + event.getTitle() + " at: " + new Date());
}
Index: HipoDream.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-bet/src/java/org/neuclear/bet/games/hipodream/HipoDream.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** HipoDream.java 20 Sep 2003 23:19:21 -0000 1.1.1.1
--- HipoDream.java 21 Nov 2003 04:42:45 -0000 1.2
***************
*** 9,13 ****
* Time: 11:52:21 AM
*/
! public class HipoDream extends AbstractGame implements Runnable {
public HipoDream() {
super(new HipoDreamRaceFactory());
--- 9,13 ----
* Time: 11:52:21 AM
*/
! public final class HipoDream extends AbstractGame implements Runnable {
public HipoDream() {
super(new HipoDreamRaceFactory());
***************
*** 15,19 ****
}
! public void run() {
this.buildEvents();
}
--- 15,19 ----
}
! public final void run() {
this.buildEvents();
}
Index: HipoDreamHorse.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-bet/src/java/org/neuclear/bet/games/hipodream/HipoDreamHorse.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** HipoDreamHorse.java 20 Sep 2003 23:19:21 -0000 1.1.1.1
--- HipoDreamHorse.java 21 Nov 2003 04:42:45 -0000 1.2
***************
*** 10,15 ****
* Time: 11:54:45 AM
*/
! public class HipoDreamHorse extends AbstractGameOutcome {
! public HipoDreamHorse(BettingEvent event, String id, String title) {
super(event, id, title);
}
--- 10,15 ----
* Time: 11:54:45 AM
*/
! public final class HipoDreamHorse extends AbstractGameOutcome {
! public HipoDreamHorse(final BettingEvent event, final String id, final String title) {
super(event, id, title);
}
Index: HipoDreamRace.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-bet/src/java/org/neuclear/bet/games/hipodream/HipoDreamRace.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** HipoDreamRace.java 20 Sep 2003 23:19:21 -0000 1.1.1.1
--- HipoDreamRace.java 21 Nov 2003 04:42:45 -0000 1.2
***************
*** 12,17 ****
* Time: 11:53:52 AM
*/
! public class HipoDreamRace extends AbstractGameEvent {
! public HipoDreamRace(ResultListener result, String id, String title, Date close) {
super(result, id, title, close);
}
--- 12,17 ----
* Time: 11:53:52 AM
*/
! public final class HipoDreamRace extends AbstractGameEvent {
! public HipoDreamRace(final ResultListener result, final String id, final String title, final Date close) {
super(result, id, title, close);
}
Index: HipoDreamRaceFactory.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-bet/src/java/org/neuclear/bet/games/hipodream/HipoDreamRaceFactory.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** HipoDreamRaceFactory.java 20 Sep 2003 23:19:21 -0000 1.1.1.1
--- HipoDreamRaceFactory.java 21 Nov 2003 04:42:45 -0000 1.2
***************
*** 16,20 ****
* Time: 11:55:24 AM
*/
! public class HipoDreamRaceFactory implements EventFactory {
public HipoDreamRaceFactory() {
format = DateFormat.getDateTimeInstance();
--- 16,20 ----
* Time: 11:55:24 AM
*/
! public final class HipoDreamRaceFactory implements EventFactory {
public HipoDreamRaceFactory() {
format = DateFormat.getDateTimeInstance();
***************
*** 22,31 ****
}
! public BettingEvent createEvent(ResultListener listener) {
! Date close = new Date(new Date().getTime() + TIMETILRACE);
! String id = TRACKID + terse.format(close);
! String title = "The " + format.format(close) + " at HipoDream";
! HipoDreamRace race = new HipoDreamRace(listener, id, title, close);
for (int i = 0; i < HORSES.length; i++) {
race.addOutcome(Integer.toString(i + 1), HORSES[i]);
--- 22,31 ----
}
! public final BettingEvent createEvent(final ResultListener listener) {
! final Date close = new Date(new Date().getTime() + TIMETILRACE);
! final String id = TRACKID + terse.format(close);
! final String title = "The " + format.format(close) + " at HipoDream";
! final HipoDreamRace race = new HipoDreamRace(listener, id, title, close);
for (int i = 0; i < HORSES.length; i++) {
race.addOutcome(Integer.toString(i + 1), HORSES[i]);
***************
*** 35,40 ****
}
! private DateFormat format;
! private DateFormat terse;
public final static int TIMETILRACE = 10000;
static final String TRACKID = "neu://hipodream/races/";
--- 35,40 ----
}
! private final DateFormat format;
! private final DateFormat terse;
public final static int TIMETILRACE = 10000;
static final String TRACKID = "neu://hipodream/races/";
|