Response from Game Server to Gadget Server

Screen Transitions

All links used in screen transitions within the content must pass through the Gadget server.

The Gadget server URL is as follows.

  • Sandbox environment
    http://g[Application ID].sb.sp.pf.mbga.jp/
  • Production environment
    http://g[Application ID].sp.pf.mbga.jp/

GET:

  • Setting using an absolute path (http://...) (Example: When the application ID is "100001" in the Sandbox environment)

POST:

  • Setting using an absolute path (http://...) (Example: When the application ID is "100001" in the Sandbox environment)

or

  • Setting using an absolute path (http://...) (Example: When the application ID is "100001" in the Sandbox environment)
  • The url parameter must be URI-escaped.
  • All other links are converted through an intermediate page by the Gadget server.

Displaying Images

Images can be displayed in the content by writing ordinary HTML. When an image is displayed on the user's mobile device, it is automatically changed to a Gadget server URL by the Gadget server.

Normally, an Authorization header is not appended to a request for an image file from the Gadget server to the game server. If you want to append an Authorization header to evaluate the validity of the request, include signed=1 in the query parameters.

Image files are cached as much as possible in the production and sandbox environment. If this causes problems, include nocache=1 in the query parameters. To update an image file that has been cached, either change the filename in the URL or assign a query parameter.

If you want to use a 1dot transparent image, you can use following image on our platform.

Displaying Flash Content

Flash content can be displayed by writing ordinary HTML, in a similar manner just like when displaying an image. Similarly, when flash content is displayed on the user's mobile device, it is automatically changed to a Gadget server URL by the Gadget server, and will be distributed to the user as a Gadget Server domain.

1. Interactive playback

2. Inline playback

If a Flash player is not installed on the mobile device, ExGame can be used.
 

Service Tag

Social features provided by the platform can be accessed by including special links within the HTML. For example, for the diary writing feature, if the reserved word diary:self is entered for the href attribute of the anchor tag, the Gadget server will replace it with a link to the platform's diary feature to implement the feature.

Notes Concerning JavaScript

  • When using onclick in the body tag
    • When sharing Shell App Framework and a game server on a smartphone, this might be viewed in WebView, or it may not work at all so make sure that it is specified in a div tag as follows.
  • To generate or send the URL using JavaScript, make sure to always pass through the Gadget Server as follows.

Sandbox environment

http://g[Application ID].sb.sp.pf.mbga.jp/?url=[URI-escaped URL to be sent]

Production environment

http://g[Application ID].sp.pf.mbga.jp/?url=[URI-escaped URL to be sent]
  • URL to be sent using XMLHttpRequest, etc.
  • When the URL is dynamically embedded in src with an img tag or iframe tag, etc.
  • URL that changes due to an <a> tag or because a user caused some action to occur

HTTP Response header that can be set

Following HTTP response headers are available. Response header other than below, can be removed by the Gadget server.

Redirect

  • Location
    Example)
    Location: http://example.com/path/to/redirect
    Specify the URL directly to the game server in Location header.
     

    Cross-Origin Resource Sharing

  • Access-Control-Allow-Origin
  • Access-Control-Allow-Credentials
  • Access-Control-Expose-Headers
  • Access-Control-Max-Age
  • Access-Control-Allow-Methods
  • Access-Control-Allow-Headers
  • Origin
  • Access-Control-Request-Method
  • Access-Control-Request-Headers
     
    Refernce)
  • http://www.w3.org/TR/cors/

Revision History

  • 04/25/2013
    • Added "HTTP Response header that can be set"
  • 03/15/2013
    • Document migrated

PREVIOUS

Response from API Server to Game Server

NEXT

Response from Gadget Server to User