Fundamentals of CCU API

API Communication Method

    • CCU API provides XML data communication by using HTTP protocol.
    • Make sure to send XML after encoding to base64.
    • Sending method is two ways: sending XML texts by using the value parameter as POST type, and sending the texts to body without any parameter.
      • PHP cURL is suitable for the method sending XML texts by using value parameter.
      • C++ or wininet is suitable for the method sending XML texts by setting post data as body without value parameter.
    • The result returns to the XML encoded to Base64. If failed to check the result, make sure to re-send it.
    • Prior to service open, test the connection on the test server. After starting the service, deliver to common server.
    • Test server should be connected while in service.
    • Send the XML by implementing API every two minutes hourly (KST). (e.g., 13:00, 13:02, 13:04 … )
    • CCU has different standard by game server.
      • Web server sends the unique number of requesting users for last two minutes.
      • Socket server sends the number of users connected with the server.

API Test

    • Open the following URL to send the encoded text and check the result.
      • XML: http://sandbox-api-index.withhive.com/modules/apitest/test/

PIC

    • Com2uS: Platform Dept. Data Tech Team Jaeho Mun (munjaeho@com2us.com)
    • Reference: Platform Dept.2 Data Tech Team (DT@com2us.com)
    • Request to issue a CCU key: Solution Archintect Team (PP_SA@com2us.com)

Sending CCU

  • Request URL
    Common URL http://api-index.qpyou.cn/modules/gameuser/currentuser/
    Sandbox URL http://sandbox-api-index.withhive.com/modules/gameuser/currentuser/
    HTTP Method Post
    Data Format XML
    Parameter value
    (Not used when sending post data to body e.g., C++, wininet)
  • post data
    Field Name Description
    game The key which distinguishes game
    Make sure to request registration to PIC
    e.g., Issue as tinyfarm_KR, derbydays_SEA
    server Server identifier when sending user data by server
    Maximum 20 characters available as a combination of alphabet and digits (set 0 if it disregards server type)
    e.g.,
    <server>0<<server> → Possible
    <server>1</server> → Possible
    <server>tinyfarm01</server> → Possible
    reqkey Unique key of CCU
    Unique key of CCU data generated by the server, which sends CCU data
    Recommended encoding to MD5
    reqkey guarantees the duplicate process
    date The time generating CCU data
    Format: yyyy-mm-dd hh:mm:ss (Second displays as ‘00’)
    On a basis of KST, process at every two minutes, the interval of API implementation
    e.g., 2016-06-23 16:24:00
    user The number of CCU
  • Response
    Field Name Description
    result Result code. 100=Success to save See more
  • Call (Origin XMLbase64 encoding → URL encoding)
  • Request
  • Response
  • Result Code
    Code Description
    100 Success to save CCU data
    101 Not processed due to duplicate request (duplicate reqkey)
    200 Parameter error (No input data)
    201 Parameter error (No required data)
    202 Parameter error (Input data with wrong format)
    203 Base64 Encoding Error (base64 not encoded)
    204 Different format from Xml
    300 DB error
    301 CCU data and the sum of data are the same
    e.g., server01 CCU = 100, server02 CCU = 0
    Occurred when the result of (server01 CCU)+(server02 CCU) is the same as the number of server01 CCU
    302 No game key