Skip to content

Commit

Permalink
Updating AllBinary Services.
Browse files Browse the repository at this point in the history
  • Loading branch information
tberthel committed Sep 30, 2015
1 parent 1d6a00d commit 2000f00
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 46 deletions.
2 changes: 1 addition & 1 deletion README.txt
Expand Up @@ -22,7 +22,7 @@ tyrants of Earth.

What is still needed to obtain the Self Replicating Robot Army?

: MMORTS - For the control of robots using Crowdsourcing. (Expect completion in 2012)
: MMORTS - For the control of robots based on my ZeptoWars RTS game
: Resource Collection API
: 3D Printer API
: Convert existing Open Robots for the 3D printer API
Expand Down
Expand Up @@ -32,8 +32,6 @@ public class RemoteHighScores extends HighScores
private final SoftwareInformation softwareInformation;
private Boolean ascending;

private final String HIGH_SCORES = "HIGH_SCORES";
public final String SOFTWARE_INFORMATION = "SOFTWARE_INFORMATION";
public final String ASCENDING = "ASCENDING";

private RemoteHighScores(
Expand Down Expand Up @@ -84,7 +82,7 @@ public void add(HighScore newHighScore)
public void update(Hashtable hashtable)
{
this.getList().clear();
Vector vector = (Vector) hashtable.get(HIGH_SCORES);
Vector vector = (Vector) hashtable.get(RemoteHighScoresData.getInstance().HIGH_SCORES);
for (int index = 0; index < vector.size(); index++)
{
Vector highScoreVector = (Vector) vector.elementAt(index);
Expand Down
Expand Up @@ -22,6 +22,8 @@ public static final RemoteHighScoresData getInstance()
return SINGLETON;
}

public final String HIGH_SCORES = "HIGH_SCORES";

public String CUSTOMER_USER_NAME = "CUSTOMER_USER_NAME";
public String DISPLAY_NAME = "DISPLAY_NAME";
public String SCORE = "SCORE";
Expand Down
Expand Up @@ -22,15 +22,16 @@
import org.allbinary.logic.system.security.licensing.AbeClientInformationInterface;
import org.allbinary.logic.system.security.licensing.AbeClientInformationInterfaceFactory;
import org.allbinary.game.GameInfo;
import org.allbinary.game.GameInfoData;
import org.allbinary.game.configuration.GameConfigurationCentral;
import org.allbinary.graphics.displayable.DisplayInfoSingleton;
import org.allbinary.logic.java.bool.BooleanFactory;

public class LicensedRemoteHighScoresProcessor
public class RemoteHighScoresProcessor
implements RemoteHighScoresProcessorInterface
{

public LicensedRemoteHighScoresProcessor()
public RemoteHighScoresProcessor()
{
}

Expand All @@ -40,6 +41,8 @@ public synchronized void process(RemoteHighScores remoteHighScores, GameInfo gam
{
LogUtil.put(LogFactory.getInstance("Begin Remote HighScores", this, CommonStrings.getInstance().PROCESS));

final GameInfoData gameInfoData = GameInfoData.getInstance();

// System.out.println(message);
AbeClientInformationInterface abeClientInformation =
AbeClientInformationInterfaceFactory.getInstance();
Expand All @@ -52,7 +55,7 @@ public synchronized void process(RemoteHighScores remoteHighScores, GameInfo gam
//hashtable.put(RemoteHighScoresData.getInstance().GAME_INFO, gameInfo.toString());

hashtable.put(
remoteHighScores.SOFTWARE_INFORMATION,
gameInfoData.SOFTWARE_INFORMATION,
remoteHighScores.getSoftwareInformation().toString());

hashtable.put(
Expand Down
Expand Up @@ -16,7 +16,7 @@
public class RemoteHighScoresProcessorFactory
{
private static final RemoteHighScoresProcessorInterface SINGLETON =
new LicensedRemoteHighScoresProcessor();
new RemoteHighScoresProcessor();

public static final RemoteHighScoresProcessorInterface getInstance()
{
Expand Down
Expand Up @@ -23,12 +23,13 @@
import org.allbinary.game.score.HighScore;
import org.allbinary.graphics.displayable.DisplayInfoSingleton;
import java.util.Hashtable;
import org.allbinary.game.GameInfoData;
import org.allbinary.logic.java.bool.BooleanFactory;

public class LicensedRemoteHighScoresSubmissionProcessor
public class RemoteHighScoresSubmissionProcessor
implements RemoteHighScoresSubmissionProcessorInterface
{
public LicensedRemoteHighScoresSubmissionProcessor()
public RemoteHighScoresSubmissionProcessor()
{
}

Expand All @@ -39,29 +40,31 @@ public synchronized void process(RemoteHighScores remoteHighScores, HighScore hi
{
LogUtil.put(LogFactory.getInstance("Begin Remote HighScores", this, CommonStrings.getInstance().PROCESS));

final GameInfoData gameInfoData = GameInfoData.getInstance();

// System.out.println(message);
AbeClientInformationInterface abeClientInformation =
final AbeClientInformationInterface abeClientInformation =
AbeClientInformationInterfaceFactory.getInstance();

Hashtable hashtable = abeClientInformation.toHashtable();
final Hashtable hashtable = abeClientInformation.toHashtable();

//hashtable.put(RemoteHighScoresData.getInstance().GAME_INFO, highScore.getGameInfo().toString());

//HashtableUtil.putAll(highScore.getGameInfo().toHashtable(), hashtable);
hashtable.putAll(highScore.getGameInfo().toHashtable());

hashtable.put(RemoteHighScoresData.getInstance().CUSTOMER_USER_NAME, "None");
hashtable.put(RemoteHighScoresData.getInstance().DISPLAY_NAME, highScore.getName());

hashtable.put(
remoteHighScores.SOFTWARE_INFORMATION,
gameInfoData.SOFTWARE_INFORMATION,
remoteHighScores.getSoftwareInformation().toString());

hashtable.put(
remoteHighScores.ASCENDING,
remoteHighScores.getAscending().toString());

DisplayInfoSingleton displayInfoSingleton = DisplayInfoSingleton.getInstance();
final DisplayInfoSingleton displayInfoSingleton = DisplayInfoSingleton.getInstance();

hashtable.put(
displayInfoSingleton.ORIENTATION,
Expand All @@ -76,7 +79,7 @@ public synchronized void process(RemoteHighScores remoteHighScores, HighScore hi

if (XmlRpcAbeClient.isOnline)
{
Hashtable resultHashtable = (Hashtable) new XmlRpcRemoteHighScoresClient(
final Hashtable resultHashtable = (Hashtable) new XmlRpcRemoteHighScoresClient(
abeClientInformation, "highscoresubmissionservice.php",
"HighScoreSubmissionService.process").get(hashtable);

Expand Down
Expand Up @@ -16,7 +16,7 @@
public class RemoteHighScoresSubmissionProcessorFactory
{
private static final RemoteHighScoresSubmissionProcessorInterface SINGLETON =
new LicensedRemoteHighScoresSubmissionProcessor();
new RemoteHighScoresSubmissionProcessor();

public static final RemoteHighScoresSubmissionProcessorInterface getInstance()
{
Expand Down
26 changes: 14 additions & 12 deletions j2me/games/PreGameJ2MEJavaLibraryM/pom.xml
@@ -1,15 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.allbinary</groupId>
<artifactId>PreGameJ2MEJavaLibrary</artifactId>
<packaging>jar</packaging>
<!-- AllBinary Platform Version Start -->
<version>1.0.0-SNAPSHOT</version>
<!-- AllBinary Platform Version End -->

<name>PreGameJ2MEJavaLibrary</name>
<url>http://www.allbinary.com/</url>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.allbinary</groupId>
<artifactId>PreGameJ2MEJavaLibrary</artifactId>
<packaging>jar</packaging>
<!-- AllBinary Platform Version Start -->
<version>1.0.0-SNAPSHOT</version>
<!-- AllBinary Platform Version End -->

<name>PreGameJ2MEJavaLibrary</name>
<url>http://www.allbinary.com/</url>
<distributionManagement>
<snapshotRepository>
<id>nexus-snapshots</id>
Expand Down Expand Up @@ -160,7 +160,9 @@
<executions>
<execution>
<phase>package</phase>
<goals><goal>single</goal></goals>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
Expand Down
Expand Up @@ -23,6 +23,8 @@
public class GameInfo
{
public static final String LEVEL_NAME = "LEVEL";

private final GameInfoData gameInfoData = GameInfoData.getInstance();

private final GameType gameType;
private final GameMode gameMode;
Expand Down Expand Up @@ -120,22 +122,16 @@ public boolean isLastLevel()
return false;
}
}

private final String GAME_TYPE = "GAME_TYPE";
private final String GAME_MODE = "GAME_MODE";
private final String PLAYER_TYPE = "PLAYER_TYPE";
private final String HIGHEST_LEVEL = "HIGHEST_LEVEL";
private final String CURRENT_LEVEL = "CURRENT_LEVEL";

public Hashtable toHashtable()
{
Hashtable hashtable = new Hashtable();

hashtable.put(GAME_TYPE, this.getGameType().toString());
hashtable.put(GAME_MODE, this.gameMode.toString());
hashtable.put(PLAYER_TYPE, this.playerType.toString());
hashtable.put(HIGHEST_LEVEL, Integer.toString(this.getHighestLevel()));
hashtable.put(CURRENT_LEVEL, Integer.toString(this.currentLevel));
hashtable.put(this.gameInfoData.GAME_TYPE, this.getGameType().toString());
hashtable.put(this.gameInfoData.GAME_MODE, this.gameMode.toString());
hashtable.put(this.gameInfoData.PLAYER_TYPE, this.playerType.toString());
hashtable.put(this.gameInfoData.HIGHEST_LEVEL, Integer.toString(this.getHighestLevel()));
hashtable.put(this.gameInfoData.CURRENT_LEVEL, Integer.toString(this.currentLevel));

return hashtable;
}
Expand All @@ -146,31 +142,31 @@ public String toString()

CommonSeps commonSeps = CommonSeps.getInstance();

stringBuffer.append(GAME_TYPE);
stringBuffer.append(this.gameInfoData.GAME_TYPE);
stringBuffer.append(commonSeps.EQUALS);
stringBuffer.append(this.getGameType().toString());

stringBuffer.append(commonSeps.COMMA_SEP);

stringBuffer.append(GAME_MODE);
stringBuffer.append(this.gameInfoData.GAME_MODE);
stringBuffer.append(commonSeps.EQUALS);
stringBuffer.append(this.gameMode.toString());

stringBuffer.append(commonSeps.COMMA_SEP);

stringBuffer.append(PLAYER_TYPE);
stringBuffer.append(this.gameInfoData.PLAYER_TYPE);
stringBuffer.append(commonSeps.EQUALS);
stringBuffer.append(this.playerType);

stringBuffer.append(commonSeps.COMMA_SEP);

stringBuffer.append(HIGHEST_LEVEL);
stringBuffer.append(this.gameInfoData.HIGHEST_LEVEL);
stringBuffer.append(commonSeps.EQUALS);
stringBuffer.append(this.getHighestLevel());

stringBuffer.append(commonSeps.COMMA_SEP);

stringBuffer.append(CURRENT_LEVEL);
stringBuffer.append(this.gameInfoData.CURRENT_LEVEL);
stringBuffer.append(commonSeps.EQUALS);
stringBuffer.append(this.currentLevel);

Expand Down
@@ -0,0 +1,35 @@
/*
* AllBinary Open License Version 1
* Copyright (c) 2011 AllBinary
*
* By agreeing to this license you and any business entity you represent are
* legally bound to the AllBinary Open License Version 1 legal agreement.
*
* You may obtain the AllBinary Open License Version 1 legal agreement from
* AllBinary or the root directory of AllBinary's AllBinary Platform repository.
*
* Created By: Travis Berthelot
*
*/
package org.allbinary.game;

public class GameInfoData {

private static final GameInfoData instance =
new GameInfoData();

public static GameInfoData getInstance() {
return instance;
}

private GameInfoData() {
}

public final String GAME_TYPE = "GAME_TYPE";
public final String GAME_MODE = "GAME_MODE";
public final String PLAYER_TYPE = "PLAYER_TYPE";
public final String HIGHEST_LEVEL = "HIGHEST_LEVEL";
public final String CURRENT_LEVEL = "CURRENT_LEVEL";

public final String SOFTWARE_INFORMATION = "SOFTWARE_INFORMATION";
}

0 comments on commit 2000f00

Please sign in to comment.