These Application Program Interfaces (APIs) are the exclusive property of pogo.com Inc. and are protected under U.S. and international copyright and intellectual property law. The APIs may not be used, copied, modified or distributed without the express permission of pogo.com pursuant to a valid license agreement in conjunction with a product distributed on pogo.com's network. Any unauthorized use is strictly prohibited.
POGO.COM CONFIDENTIAL INFORMATION. The APIs constitute confidential
and proprietary information of pogo.com Inc. and are subject to non-disclosure
and confidentiality obligations between pogo.com and the recipient of the
APIs. The contents of the APIs may not be disclosed to any third party
without the express written consent of pogo.com. Unauthorized use or disclosure
of the APIs is strictly prohibited.
Chat functionality is provided by a separate chat applet that is incorporated as part of the pogo.com integration process; it requires no changes to the game applet. Intermission functionality requires incorporating the intermission service into the game applet. This document describes how to use the intermission service.
The game page consists of a frameset that contains three frames.
The top frame contains the banner ad and heading. The left (or right,
it's configurable) frame contains the game applet, and the other frame
contains the chat applet. View a sample
game applet that uses the intermission service. When an intermission
is shown, the game applet page in the frameset is replaced with the intermission
ad. This will cause the game applet page to get unloaded, which will
cause the game applet's stop method to be invoked (and possibly
its destroy method as well, depending on the browser implementation.)
When the intermission has ended, the intermission ad will be replaced with
the web page that contains the game applet. This will cause the game
applet's start method to be invoked (and possibly its init
method as well, depending on the browser implementation.) The intermission
service controls this intermission process.
package com.pogo.external.ad
import java.applet.Applet;
public class IntermissionService
{
public static IntermissionService instance();
public String init(Applet applet);
public void readyToPlay();
public boolean readyForIntermission(String state);
}
The static instance method is used to obtain the singleton instance of the intermission service.
The init method must be invoked by the game applet from its start method. It must be passed a reference to the applet instance. This method reads several parameters that were passed to the game applet from its web page. All of the parameters used by the intermission service have parameter names that begin with the prefix intermission. These parameters allow the intermission service to be used both within the pogo.com chat and intermission server framework, as well as with the provided set of HTML pages and client side Javascript that simulate intermissions (see the Testing section below.)
The init method returns null if the game applet is not returning from an intermission (i.e. this is the first time the game applet has been launched.) When returning from an intermission, the state string that was passed to readyForIntermission is returned (see below) so that the game can resume from where it left off.
The readyToPlay method must be invoked by the game after the game has completed all of its initialization and asset downloading. This method should not be called until the player is able to start playing the game.
The readyForIntermission method should be invoked by the game at any point where an intermission would be acceptable (e.g. between levels.) The intermission service will internally determine whether an intermission should be displayed, based on the timing parameters passed to the applet. If it is time for an intermission to be displayed, the method will return true and the game applet frame will be replaced with the intermission ad and countdown timer. This will cause the game applet to exit as if the player left the game. When the intermission is over, the game applet will be reloaded. When the game applet invokes the intermission service's init method, the state value that was passed to the readyForIntermission method will be returned unaltered. The intermission service does not make use of this parameter in any other way and its value can be any string (e.g. a level number.) When a game is launched for the first time, the init method will return null, so that the applet can distinguish between initial launch and returning from an intermission.
The length of the state parameter string must be less than 1024 characters. It is necessary to limit the length of the state parameter because the state parameter is passed on the URL in the HTTP GET request for the intermission web page. If the state parameter is excessively long, it could cause problems with some web browser or web server implementations, as well as have a negative performance impact.
Game developers may be tempted to use static variables to preserve their game state, instead of using the state parameter mentioned above. However, not all browsers preserve the value of static variables across intermissions. Therefore, the only reliable cross-platform method of maintaining state across intermissions is to use the state parameter provided by the intermission service.
If it is not time for an intermission when readyForIntermission is invoked, it does nothing and returns false.
Please refer to the IntermissionService
Javadoc documentation for more details about the IntermissionService
class.
The applet is passed several parameters that are used by the intermission service. The intermissionDebug parameter, when set to a value of "true", causes debugging messages to be sent to the Java console log. The intermissionStandalone parameter must be set to a value of "true" when testing the intermission service outside of the pogo.com site. The intermissionGamePeriod parameter is the minimum number of seconds between intermissions, and the intermissionIntermissionPeriod parameter is the duration of each intermission in seconds. The sample APPLET tag uses 10 seconds for both parameters, which means that intermissions will occur at least 10 seconds apart, and will last for 10 seconds each, for faster testing. The other intermission parameters that are passed to the game applet must not be altered.
The set of web pages used with the sample applet can be used to test
any game applet that uses the intermission service, simply by modifying
the APPLET tag in the game.html
web page. These pages can either be opened locally on a PC or Macintosh,
or they can be placed on a web server and opened remotely; whichever is
more convenient.