7. Configuration file (MANIFEST.json) details

The iFun Engine features and configurable parameters that can be added to dependency in MANIFEST.json are as follows.

Tip

The list of functions is in alphabetical order and the configuration parameters are listed with the most frequently used at the top.

Tip

The functions below are defined in /usr/share/funapi/manifests/*/MANIFEST.json.

7.1. Performance Optimization

7.1.1. EventDispatcher

Event processing is handled by iFun Engine.

  • event_threads_size: Number of main event threads. (type=uint64, default=4)
  • enable_event_profiler: Whether event profiler is enabled (type=bool, default=true)
  • enable_outstanding_event_profiler: Whether to profile currently running events (type=bool, default=true)

Parameters that rarely needs to be changed:

  • slow_event_log_threshold_in_ms: Sets whether to maintain a log of somewhat slow events (type=uint64, default=300)
  • event_timeout_in_ms: Milliseconds until events timeout (type=uint64, default=30000)
  • enable_inheriting_event_tag: Whether to inherit event tags for invoked events if separate event tags are not assigned when Event::Invoke() (type=bool, default=true)
  • enable_random_event_tag: Whether to randomly generate and add event tags when Event::Invoke() is invoked with no event tag and enable_inherit_event_tag is not activated. If false, null event tag added (type=bool, default=true)
  • enable_event_thread_checker: Check once per second whether there has been blocking during event thread processing if true (type=bool, default=true)

7.1.2. IoService

Handles network I/O processing. Responds internally to boost::asio’s io_service.

Parameters that rarely needs to be changed:

  • internal_threads_size: Number of threads handling client-server packet processing. (type=uint64, default=4)

7.1.3. Object

Handles the ORM that manages game objects. This is automatically handled so the complicated code for lock, database, etc. to handle game objects does not need to be manually implemented. For more details, see ORM Part 1: Overview.

  • enable_database: Enables a connection to MySQL database for iFun Engine’s ORM. If false, ORM operation is done within volatile memory. This is useful when running simple tests during development. (type=bool, default=false)
  • db_mysql_server_address: MySQL server address to use (type=string, default=”tcp://127.0.0.1:3306”)
  • db_mysql_id: MySQL user name to use. (type=string, default=””)
  • db_mysql_pw: MySQL password to use. (type=string, default=””)
  • db_mysql_database: MySQL schema name to use. (type=string, default=””)
  • cache_expiration_in_ms: Milliseconds until cached objects from the DB are removed from the cache (type=int64, default=300000)
  • copy_cache_expiration_in_ms: Milliseconds until objects copied from a remote server are removed from the cache (type=int64, default=700)
  • enable_delayed_db_update: Whether to delay DB updates and to process them in a batch manner. (type=bool, default=false)
  • db_update_delay_in_second: Seconds to delay DB updates if enable_delayed_db_update is on. (type=int64, default=10)
  • db_read_connection_count: Number of DB connections for reading (type=int64, default=8)
  • db_write_connection_count: Number of DB connections for writing (type=int64, default=16)
  • db_key_shard_read_connection_count: Number of DB connections for reading from the key database when using object_subsystem_sharding. (type=int64, default=8)
  • db_key_shard_write_connection_count: Number of DB connections for writing to the key database when using object_subsystem_sharding. (type=int64, default=16)
  • db_character_set: DB character set (type=string, default=”utf8”)
  • export_db_schema: Output the DB schema script and exit if true (type=bool, default=false) Please refer to Required DB permissions (type=bool, default=false)

Parameters that rarely needs to be changed:

  • db_string_length: Length of responding SQL VARCHAR for text string properties (type=int32, default=4096)
  • db_key_string_length: Length of responding SQL CHAR for key text string properties (type=int32, default=12)
  • use_db_stored_procedure: Whether to use MySQL stored procedures instead of RAW SQL statements. (type=bool, default=true)
  • use_db_stored_procedure_full_name: 축약된 이름 대신 긴 이름의 stored procedure 를 사용할지 여부 (type=bool, default=true)
  • use_db_char_type_for_object_id: Uses CHAR(32) instead of BINARY(16) in SQL DB to display object ID (type=bool, default=false)
  • enable_assert_no_rollback: Enable AssertNoRollback() check in code. Please see Detecting unwanted rollbacks. (type=bool, default=true)
  • use_db_select_transaction_isolation_level_read_uncommitted: Sets TRANSACTION ISOLATION LEVEL to READ UNCOMMITTED when issuing SELECT queries. Settings to false falls back to the MySQL default value. (type=bool, default=true)

7.1.4. SessionService

Controls iFun Engine networking. Please refer to Networking part 1: Sessions for more on networking.

Port configuration

  • tcp_json_port: Server’s TCP port number for JSON traffic. Disabled if 0. (type=uint64, default=8012)
  • udp_json_port: Server’s UDP port number for JSON traffic. Disabled if 0. (type=uint64, default=0)
  • http_json_port: Server’s HTTP port number for JSON traffic. Disabled if 0. (type=uint64, default=8018)
  • tcp_protobuf_port: Server’s TCP port number for Protobuf traffic. Disabled if 0. (type=uint64, default=0)
  • udp_protobuf_port: Server’s UDP port number for Protobuf traffic. Disabled if 0. (type=uint64, default=0)
  • http_protobuf_port: Server’s HTTP port number for Protobuf traffic. Disabled if 0. (type=uint64, default=0)

Session management settings

  • session_timeout_in_second: Idle time in seconds for session to timeout. (type=uint64, default=300)
  • use_session_reliability: Enables reliability function for sessions. This protects against packet loss even when sessions are reconnected. Please refer to Session Message Transmission Stability for more. (type=bool, default=false)
  • use_sequence_number_validation: Does not process messages if the message sequence number is wrong. This prevents message replay attacks. It only works in TCP and HTTP. For more details, see Blocking message replay attacks (type=bool, default=false)

Encryption settings

For more about encryption, please refer to Message encryption.

  • use_encryption: Enables and disables encryption. (type=bool, default=false)

  • tcp_encryptions: List of encryption methods used in TCP protocol when encryption is enabled.

    You can set to null to disable encryption or use one or all of ife1, ife2, chacha20, aes128. E.g., [], [“ife1”, “ife2”], or [“chacha20”]

  • udp_encryptions: List of encryption methods used in UDP protocol when encryption is enabled.

    You can set to null to disable encryption or use ife2. E.g., [“ife2”]

  • http_encryptions: List of encryption methods used in HTTP protocol when encryption is enabled.

    You can set to null to disable encryption or use ife2. E.g., [“ife2”]

  • encryption_ecdh_key: Server-side secret key used to exchange ChaCha20 and AES session keys when encryption is enabled.

TCP settings

  • disable_tcp_nagle: Turns off Nagle algorithm by setting the TCP_NODELAY socket option when TCP sessions are used (type=bool, default=true)

Debugging and monitoring settings

  • enable_http_message_list: When this option is enabled, makes message types registered by RegisterHandler() visible when using HTTP to GET /v1/messages. For more details, please refer to the HTTP information in (Advanced) iFun Engine Network Stack. It is convenient for development, but is best set as false during the live stage for security reasons. (type=bool, default=true)

  • session_message_logging_level: Session message log level. If 0, no logs are kept. If 1, only packet time and length is logged. If 2, packet contents are also logged. (type=uint64, default=0)

    Tip

    Setting this to 2 is helpful to see messages transferred during the development process. However, it can give server load, so it is not recommended for a live service environment.

  • enable_per_message_metering_in_counter: Provides data on client-server traffic through the iFun Engine Counter using HTTP RESTful. For more details, please see iFun Engine Counter. It is convenient for development, but is best set to false as it can considerably overload the server. (type=bool, default=false)

  • json_protocol_schema_dir: Directory path for schema files to verify the validity of JSON packets when using JSON as a packet format. For more details, please refer to Automatically verifying JSON message using JSON schema. (type=string, default=””)

  • ping_sampling_interval_in_second: Sets ping sampling intervals for RTT calculations in seconds. Stops at 0. Please refer to Session Ping (RTT). (type=uint64, default=0)

  • ping_message_size_in_byte: Size of ping message to be transferred. Please refer to Session Ping (RTT). (type=uint64, default=32)

  • ping_timeout_in_second: Disconnects if there is no ping response in a set period of time. Stops at 0. Please refer to Session Ping (RTT). (type=uint64, default=0)

Parameters that rarely needs to be changed:

  • close_transport_when_session_close: Ends related transport (connections) when a session is closed. (type=bool, default=true)

  • send_session_id_as_string: Decides whether to send session ID as binary or string during client-server communication. (type=bool, default=true)

    Important

    To use this feature, the client plugin versions must be as follows:

    • Unity3D: 190
    • Unreal4: 35
    • Cocos2d-x: 35
  • send_session_id_only_once: Whether to send a session ID only in the first message of TCP/UDP. This reduces client-server traffic. (type=bool, default=false)

  • network_io_threads_size: Number of threads to handle client-server traffic. (type=uint64, default=4)

7.2. Server Administration

7.2.1. ApiService

Responds to the RESTful API server for the management purpose. iFun Engine runs an administrative API service at a separate HTTP port in order to safely manage the server.

  • api_service_port: Local TCP port number to run an administrative RESTful API service. (type=uint64, default=8015)
  • api_service_logging_level: Log level for administrative RESTful API messages. If 0, no logs are kept. If 1, only errors are logged. If 2, all requests are logged (type=uint64, default=2)

Parameters that rarely needs to be changed:

  • api_service_event_tags_size: Number of administrative RESTful API services running simultaneously (type=uint64, default=1)

7.2.2. CounterService

Exposes all internal server status information through HTTP RESTful API. For more details, please see iFun Engine Counter.

  • counter_flush_interval_in_sec: Sets the interval in seconds to periodically renew exposed counter values (type=uint64, default=0)

Parameters that rarely needs to be changed:

  • counter_monitoring_interval_in_sec: Interval in seconds to monitor values. (type=uint64, default=30)
  • warning_threshold_event_queue_length: Outputs a warning message if the event queue surpasses this value during counter monitoring (type=uint64, default=3000)
  • warning_threshold_outstanding_fetch_query: Outputs a warning message if the DB read queue surpasses this value during counter monitoring (type=uint64, default=5000)
  • warning_threshold_outstanding_update_query: Outputs a warning message if the DB write queue surpasses this value during counter monitoring (type=uint64, default=5000)
  • warning_threshold_slow_query_in_sec: Outputs a warning message if the query takes longer than specified seconds during counter monitoring(type=uint64, default=1)
  • warning_threshold_slow_distribution_in_sec: Outputs a warning message if processing time of the load distribution(Redis/ZooKeeper) is longer than specified seconds during counter monitoring (type=uint64, default=3)

7.2.3. HardwareInfo

This feature helps when reading hardware data from game server code.

  • external_ip_resolvers: Lists methods to get public IPs. They must be separated by commas, and are ordered with the first one entered at the top. If the current method fails, the next one is tried.

    Public IPs must be manually configured for NAT configurations, and the port number may also be specified for each protocol used by the game. Available protocol types are tcp+pbuf, tcp+json, udp+pbuf, udp+json, http+pbuf, and http+json. For more information, please see Detecting Server IP Addresses. (type=string, default=”aws,nic:eth0,nat:192.0.2.113:tcp+pbuf=8012:http+json=8018”)

  • discover_public_ip_from_aws_instance: If the game server operates on Amazon Web Service (AWS), this flag gets the AWS http://169.254.169.254/latest/meta-data/public-ipv4 to detect its own public IP address.. (type=bool, default=false)

7.2.4. Logging

Controls the logging feature. For more details on logging, see Game operation part 3: Logging player activity.

  • activity_log_output: Activity log storage path. The following values are available:

    • mongodb://user:passwd@host:port
    • json://path/to/file
    • file://path/to/file
    • syslog://name
    • stdout
    • glog

    For json, file, or glog, the path is generated as a relative path to –log_root_dir.

    Syslog only works on Linux.

    For MongoDB, user, password, and port data are optional, and can be separated by commas to use multiple hosts in order to use a replica set. (E.g., mongodb://user:passwd@host1,host2,user:passwd@host3) (type=string, default=”glog”)

  • activity_log_rotation_interval: Cycle in seconds to rotate activity logs. (type=int32, default=60)

  • activity_log_write_schema: Whether or not schema data is output to activity logs (type=bool, default=true)

Parameters that rarely needs to be changed:

  • glog_flush_interval: Cycle in seconds to flush Google logging. (type=int32, default=1)
  • glog_retention_period_in_days: Period in days to keep old glog files. Stale files older than this period will be erased. (type=int32, default=30)

7.2.5. MaintenanceService

This feature can change the game server’s maintenance mode.

  • under_maintenance: Whether or not to convert to maintenance mode (type=bool, default=false)
  • maintenance_data_path: JSON file containing maintenance data. This file’s contents are sent to the client. (type=string, default=””)

7.2.6. RuntimeConfiguration

This feature allows dynamic overriding of some data from MANIFEST.json during server operation.

  • enable_runtime_configuration: Enables modification of iFun Engine configuration in run-time (type=bool, default=true)

7.2.7. SystemInfo

This feature exports server memory usage, CPU usage, and other OS data through CounterService.

  • systeminfo_refresh_interval_in_sec: Interval in seconds to refresh system info. (type=int32, default=5)

7.3. Server-side Temporary Storage

7.3.1. CrossServerStorage

This feature supports data sharing between servers. For more details, please refer to Distributed processing part 2: Data sharing between servers.

  • enable_cross_server_storage: Whether or not to enable this feature. Need to set enable_redis explained in MANIFEST.json Configuration to true, too.(type=bool, default=false)
  • redis_tag_for_cross_server_storage: Redis server tag value to use as storage to share data between servers. (See Distinguishing Redis Servers with Tags) (type=string, default=””)

7.3.2. Redis

iFun Engine supports easy connection to Redis. This feature controls connections to Redis. For more details, please see Redis Support.

  • enable_redis: Enables Redis. (type=bool, default=false)

  • redis_mode: Redis mode to use. Supports redis or sentinel input (type=string, default=”redis”)

  • redis_servers: Enters Redis servers’ address and authentication password if redis_mode is redis.

    Example

    "redis_servers": {
      "": {
        "address": "127.0.0.1:6379",
        "auth_pass": ""
      }
    }
    
  • redis_sentinel_servers: Enters Redis Sentinel servers’ address and authentication password if redis_mode is sentinel.

    Example

    "redis_sentinel_servers": {
      "": {
        "master_name": "mymaster",
        "addresses": ["127.0.0.1:26379"],
        "auth_pass": ""
      }
    }
    

Parameters that rarely needs to be changed:

  • redis_async_threads_size: Thread number to use to process asynchronous Redis commands. (type=uint64, default=4)

7.4. Authentication and Billing

7.4.1. AuthenticationClient

iFun Engine has a separate agent to handle authentication. (See Deprecated - iFun Authenticator) This feature configures communication with the agent.

  • use_authenticator: Enables communication with iFun Authenticator agent. If false, iFun Engine bypasses all authentication requests and treats as successful. (type=bool, default=false)
  • remote_authenticator_ip_address: IP address for remote host using iFun Authenticator. use_authenticator must be set to true. (type=string, default=”0.0.0.0”)
  • remote_authenticator_port: Port number for remote host using iFun Authenticator. (type=uint64, default=0)

7.4.2. BillingClient

As with authentication, iFun Engine provides a separate billing agent. (See External service part 2: Billing) This feature configures communication with the agent.

  • use_biller: Enables communication with iFun Biller agent. If false, iFun Engine bypasses all billing verification requests and treats as successful. (type=bool, default=false)
  • remote_biller_ip_address: IP address for remote host using iFun Biller. (type=string, default=”0.0.0.0”)
  • remote_biller_port: Port number for remote host using iFun Biller. (type=uint64, default=0)

Additionally required settings for each billing type

  • googleplay_refresh_token: Google Play refresh token. (For more details, consult Google Play developer information.) (type=string, default=””)
  • googleplay_client_id: Google Play client ID. (For more details, consult Google Play developer information.) (type=string, default=””)
  • googleplay_client_secret: Google Play client secret. (For more details, consult Google Play developer information.) (type=string, default=””)

7.5. In-game Social Features

7.5.1. LeaderboardClient

As with authentication, iFun Engine provides a separate leaderboard agent. (See Leaderboard Service) This feature configures communication with the agent.

  • use_leaderboard: Enables communication with iFun Leaderboard agent. If false, iFun Engine returns dummy results for all leaderboard-related requests. (type=bool, default=false)

  • leaderboard_agents: Sets iFun Leaderboard server addresses in the following format.

    "leaderboard_agents": {
      // iFun Leaderboard agent is identified by tag.
      "<tag>": {
        // Enters server_tcp_port configured in the iFun Leaderboard' MANIFEST.json.
        "address": "127.0.0.1:12820"
      },
      ...
    }
    

7.5.2. MatchmakingServer

This handles the matchmaking server feature. Matchmaking servers can exist separately from game servers or can be included in the game server. If this MatchMakingServer feature is included in the game server’s MANIFEST.json the game server itself works as a matchmaking server. If a separate server instance with only this feature is created, it operates as a dedicated matchmaking server. For more details, see Matchmaking.

  • enable_dynamic_match: Enables faster matchmaking by combining incomplete matches (type=bool, default=true)
  • enable_match_progress_callback: Enables status notifications as matchmaking proceeds. If set to true, progress_cb passed to MatchmakingClient::StartMatchmaking() will be invoked (type=bool, default=false)

Parameters that rarely needs to be changed:

  • concurrent_number_of_players_threshold: Sets number of players that can be simultaneously processed by the matchmaking server. Configuration required for internal memory structure allocation. (type=int64, default=3000)

7.6. Distributed Processing and Server Scaling

7.6.1. AccountManager

Handles features including player login, logout, and movement between servers. This feature also operates in distributed environments with multiple servers.

  • redirection_strict_check_server_id: Checks server ID when client moves to connect to a different server. (type=bool, default=true)
  • redirection_secret: Secret key to authenticate when client moves to connect to a different server (type=string)

7.6.2. MulticastServer

Controls the multicasting feature and the chatting feature.

  • max_member_count_per_channel: Sets the limit on the number of players per channel. 0 for no limitation. If not zero, number greater than 1 is required. (type=uint64, default=0)

7.6.3. RpcService

Controls communication between servers.

  • rpc_enabled: Enables RPC functions and other RPC-dependent functions. (type=bool, default=false)

  • rpc_threads_size: Number of threads handling RPC processing (type=uint64, default=4)

  • rpc_port: TCP port number to use for RPC communication. (type=uint64, default=8015)

  • rpc_nic_name: Network interface (NIC) for RPC communication. For security reasons and to reduce external cloud network usage, it is recommended to choose a network card that connects to an internal network. (type=string, default=””)

  • rpc_use_public_address: Enforces to use a public IP address instead of internal one for RPC communication. This is useful if the server is behind a NAT device. (type=bool, default=false)

  • rpc_tags: Tags set on the relevant server. Can import server list with particular tags within code.

    E.g., If set as follows, you can only choose servers with level 1-5 tags or server lists with dungeon_server tags.

    "rpc_tags": [ "dungeon_server", "level:1-5" ]
    
  • rpc_message_logging_level: Log level for RPC messages. If 0, no logs are kept. If 1, transaction ID, partner server ID, and message type and length are logged. If 2, the preceding information and the message body are logged. (type=uint64, default=0)

Parameters that rarely needs to be changed:

  • rpc_backend_zookeeper: Uses Zookeeper for RPC communication (type=bool, default=true)
  • rpc_disable_tcp_nagle: Disables Nagle algorithm for RPC communication. (type=bool, default=true)
  • enable_rpc_reply_checker: When set to true, outputs warning messages if there is no RPC response. (type=bool, default=true)

7.6.4. ZookeeperClient

Controls connection with Zookeeper when iFun Engine uses Zookeeper for connection between servers.

  • zookeeper_nodes: Zookeeper server lists. Listed in the form of “IP:port” and comma-separated. (type=string, default=”localhost:2181”)
  • zookeeper_client_count: Sets parallel connections to Zookeeper at a time. (type=uint64, default=4)
  • zookeeper_session_timeout_in_second: Zookeeper session timeout value. (type=uint64, default=60)
  • zookeeper_log_level: Zookeeper library log level. (type=uint64, default=1)

7.7. Client supports

7.7.1. AppInfo

This can manage the current version or allowed previous versions and can specify the URL to update the client. It can also set how authentication and billing are handled.

Client version configuration

  • client_current_version: Current game client version. (type=string, default=”000”)

  • client_compatible_versions: List of accessible client versions that are not the latest version

    Example

    "client_compatible_versions": ["0.1", "0.2"]
    
  • client_update_info: Client update info. (type=string, default=””)

  • client_update_uri: URI that can receive updated clients. (Usually app store) (type=string, default=””)

Configuration for authentication methods

  • app_auth_service_provider: Sets how to handle client authentication. AuthenticationService operates based on this. (type=string, default=””)
  • app_id: This is an application ID that can be recognized by the side handling authentication. For example, application IDs from the app store. (type=string, default=””)
  • app_password: To handle authentication, application ID as well as the password for it may need to be entered. This setting assigns that password. (type=string, default=””)

7.7.2. ClientResourceService

This feature checks whether client list data is up to date, sends patch URLs, etc. For details, please refer to Client programming part 2: Client resources.

  • use_client_resource_service: Enables the feature (type=bool, default=false)
  • client_resource_service_port: HTTP port to bind for the client resource service. (type=uint64, default=0)
  • client_resource_dir: Path to a directory containing resource files to be transferred to the client. (type=string, default=””)
  • client_resource_url_base: Base URL to receive client resources (e.g. CDN base path). If this is set, the client resource service only sends the files list to the client and redirects it to receive the production files from the relevant base URL. (type=string, default=””)
  • client_resource_list_url: File URL containing client resource list. If this is set, client_resource_dir is ignored. (type=string, default=””)
  • client_resource_max_file_size: Maximum size of a single client resource file. In bytes. (type=uint64, default=10485760)

Parameters that rarely needs to be changed:

  • client_resource_service_threads_size: Number of threads for the client resource service. (type=uint64, default=2)

7.8. Game Contents Implementation

7.8.1. ResourceManager

This feature helps to read game contents data from the game server. For more details, please see Content support part 4: Game design data.

  • game_json_data_dir: Path to a directory containing game data in JSON. (type=string, default=””)
  • enable_game_data_mysql: Enables to read game data from a MySQL database. (type=bool, default=false)
  • game_data_mysql_server: MySQL server address containing game data. (type=string, default=”localhost:3306”)
  • game_data_mysql_username: Username for a MySQL server containing game data. (type=string, default=”funapi”)
  • game_data_mysql_password: Password for a MySQL server containing game data. (type=string, default=”funapi”)
  • game_data_mysql_database: Database name for a MySQL server containing game data. (type=string, default=”game_data”)
  • game_data_mysql_character_set: Character set used to connect to game database (type=string, default=”utf8”)
  • game_data_mysql_tables: Name of MySQL tables pertaining to game data. Comma-separated. (type=string)

7.9. Misc.

The following features are only on/off without set parameters or are very rarely used, so there is normally no need to deal with them.

7.9.1. Curl

This feature responds to the HTTP client installed in iFun Engine.

  • curl_threads_size: Number of threads allocated to CURL (type=int64, default=1)

7.9.2. RandomGenerator

This component generates random numbers.

7.9.3. Timer

This is a timer that game programmers can use. Tasks that must be handled periodically such as ticking within the game are handled inside this timer’s handler.

7.9.4. WallClock

iFun Engine uses a monotonic clock to prevent from turning back time due to time synchronization. However, since a monotonic clock is difficult for people to read, a WallClock is provided for this purpose.