9. 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.

9.1. Performance Optimization

9.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)

9.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)

9.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)

  • object_slow_query_threshold_time_in_ms: ORM 이 DB 에 요청한 쿼리에 대한 응답 지연이 이 시간보다 크면 서버 로그에 출력합니다. (type=uint64, default=5000)

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)

9.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.

Compression settings

Default compression algorithm is "none". You may specify either "zstd"" or "deflate".

  • tcp_compression: TCP 프로토콜에 적용할 압축 알고리즘 type (type=string, default=”none”), dictionary (type=string, default=””), threshold (type=int32, default=128) 값 설정. (type=object)

    "tcp_compression": {
      "type": "none",   // Compression algorithm for TCP.
      "dictionary": "", // Shared dictionary data. (for zstd only).
      "threshold": 128  // Minimal message size to be compressed.(Byte)
    }
    
  • udp_compression: Similar to TCP, but for UDP.

  • http_compression: For HTTP.

  • websocket_compression: For WebSocket.

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.

  • session_message_logging_excluded: 세션 메시지 로그에서 제외할 메시지 타입들의 리스트.

    메시지 타입은 문자열과 enum MessageType 형의 Protobuf 메시지 타입을 혼용해서 사용할 수 있습니다. 예) [] 또는 ["login", "logout"], [17, 18], ["login", 18]

  • 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=””)

  • tcp_ping: TCP 프로토콜에 적용할 핑의 sampling_interval_in_second (type=uint64, default=0), message_size_in_byte (type=uint64, default=32), timeout_in_second (type=uint64, default=0) 값 설정. (type=object)

    
    
    “tcp_ping”: {

    “sampling_interval_in_second”: 0, // Sets ping sampling intervals for RTT calculations in seconds. Stops at 0. “message_size_in_byte”: 32, // Size of ping message to be transferred. “timeout_in_second”: 0 // Disconnects if there is no ping response in a set period of time.

    }

  • websocket_ping: WebSocket 프로토콜에 적용할 핑 설정. 형식은 TCP 와 동일합니다.

SSL/TLS 관련된 설정들

  • tcp_use_ssl: TCP 통신 시 SSL/TLS 사용 설정. (type=bool, default=false)

  • http_use_ssl: HTTP 통신 시 SSL/TLS 사용 설정. (type=bool, default=false)

  • websocket_use_ssl: Websocket 통신 시 SSL/TLS 사용 설정. (type=bool, default=false)

  • ssl_certification_path: SSL/TLS 인증서 파일의 경로. (type=string, default=””)

  • ssl_passphrase: SSL/TLS 비밀키의 암호. (type=string, default=””)

  • ssl_private_key_path: SSL/TLS 비밀키 파일의 경로. (type=string, default=””)

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)

  • close_session_when_event_timeout: 이벤트 타임아웃 발생 시 연관된 세션을 자동으로 닫고, 세션 닫힘 핸들러가 호출되도록 합니다. 세션 닫힘 핸들러의 이벤트 태그는 Session ID 가 아닌 무작위 값이 할당됩니다. (type=bool, default=false)

  • 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)

  • ssl_ciphers: SSL/TLS 통신에 사용하는 cipher 목록. (type=string, default=”ECDH+AESGCM:ECDH+AES256:ECDH+AES128:RSA+AESGCM:!aNULL:!eNULL:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED”)

Note

유니티 5, 2017, 2018 + .NET3.5 환경에서 SSL/TLS 통신을 하기 위해서는 TLS v1 을 사용해야 하고, 이를 위해 ssl_ciphersAES128-SHA, AES256-SHA 중 하나를 추가해야합니다. 하지만 TLS v1 은 보안 상의 이슈가 있으므로 SSL/TLS 통신을 사용해야 할 경우에는 유니티 2018 + .NET4, 2019 이상 버전을 사용하기를 권장합니다.

9.2. Server Administration

9.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)

9.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)

9.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)

9.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)

9.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=””)

9.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)

9.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)

9.3. Server-side Temporary Storage

9.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=””)

9.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)

9.4. Authentication and Billing

9.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)

9.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

  • use_googleplay_service_account: 구글 플레이 서비스 계정 사용 유무. (type=bool, default=false)

  • googleplay_service_account_json_path: 구글 플레이 서비스 계정 json 파일 경로. (type=string, default=””)

  • 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=””)

  • onestore_client_id: 원스토어의 클라이언트 아이디. (개발자 센터의 Apps - InApp정보 - 인증 및 라이선스 창에서 확인 가능). (type=string, default=””)

  • onestore_client_secret: 원스토어의 클라이언트 시크릿. (개발자 센터의 Apps - InApp정보 - 인증 및 라이선스 창에서 확인 가능). (type=string, default=””)

9.5. In-game Social Features

9.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"
      },
      ...
    }
    

9.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)

9.6. Distributed Processing and Server Scaling

9.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)

9.6.2. MulticastServer

Controls the multicasting feature and the chatting feature.

  • transport_for_multicast_channel: 멀티캐스트 시 사용할 Transport(연결)을 지정 합니다. tcp와 websocket 중 선택할 수 있습니다. (type=string, default=”tcp”)

  • 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)

9.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: RPC 서비스에 이용할 TCP 포트 번호를 설정합니다.

    하나의 호스트에 여러 서버를 실행하는 경우 중복되지 않도록 설정해야 합니다. (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: 호스트가 가상 IP 를 사용하는 NAT 환경에서 외부 네트워크의 서버와 RPC 그룹으로 연결해야 하는 경우 이 항목을 true 로 설정하면 RPC 연결 시 Public IP 를 사용하도록 동작합니다. (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)

  • 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)

  • rpc_backend: RPC 기능의 백엔드로 사용할 코디네이션 서비스를 선택합니다. (type=string, default=””)

    • Redis (권장): 이어서 설명하는 rpc_redis_hosts 및 관련 설정들에 따라 동작합니다.

    • Zookeeper: ZookeeperClient 항목의 설정에 따라 동작합니다.

  • rpc_backend_zookeeper: (주의) ‘rpc_backend’ 를 사용하시기 바랍니다.

    RPC 기능의 백엔드로 Zookeeper 를 사용하도록 설정합니다.

    true 일 경우, 이어서 설명하는 ZookeeperClient 항목이 올바르게 설정되어 있어야 정상 동작합니다.

    false 일 경우 Redis 를 사용하며 다음 설정 항목들을 설정해야 합니다. (type=bool, default=true)

    Warning

    아이펀 엔진 1.0.0-4953 Experimental 부터 프로젝트 생성 시에 MANIFEST.json 내용에서 rpc_backend_zookeeper 설정이 삭제되고, rpc_backend 항목으로 변경됩니다. 기존에 생성한 프로젝트에서는 rpc_backend_zookeeper 항목을 계속해서 사용하실 수 있지만 향 후 삭제될 수 있기 때문에 rpc_backend 항목으로 변경 해 주시기 바랍니다. rpc_backend 설정이 “” 일 때만 rpc_backend_zookeeper 설정이 유효하며, 두 항목이 동시에 설정되어 있는 경우 rpc_backend 설정이 적용됩니다.

아래 설정들은 rpc_backend 항목이 Redis 이거나 rpc_backend_zookeeper 설정이 false 일 때에만 유효합니다.

  • rpc_redis_hosts: RPC 정보를 저장할 Redis 서버 주소들을 설정합니다. Redis 서버Sentinel 구성 일 경우는 rpc_redis_sentinels 설정을 사용합니다.

    Important

    하나의 RPC 그룹으로 묶이는 서버들은 RPC 백엔드 호스트 주소를 포함하여 동일한 설정을 가지고 있어야 합니다.

    예시: RPC 백엔드 서버를 여러 개 설정하면 데이터를 분산시킬 수 있습니다.

    "rpc_redis_hosts": [
      {
        "host": "127.0.0.1:6379",
        "database": 0,  // 생략하면 기본값인 0으로 동작합니다.
        "auth": ""      // 생략하거나 빈 문자열을 입력하면 인증을 생략합니다.
      },
      {
        "host": "127.0.0.1:6379",
        "database": 1,
        "auth": ""
      }
    ]
    

    에시: RPC 백엔드 서버가 Sentinel 구성일 때는 다음과 같이 설정합니다.

    "rpc_redis_sentinels": [
      {"master_name": "...", "addresses": "...", "database": index, "auth": ""},
      {"master_name": "...", "addresses": "...", "database": index, "auth": ""},
    ]
    
  • rpc_redis_connection_count: RPC 백엔드 서버 하나 당 연결 개수를 설정합니다. (type=uint64, default=16)

  • rpc_redis_master_update_interval_in_seconds: RPC 기능으로 묶이는 서버들 끼리 마스터 서버를 선정하기 위한 주기를 설정합니다. 각 서버들은 이 주기마다 한 번씩 마스터 선정을 위해서 레디스 서버와 통신합니다. (type=uint64, default=5)

  • rpc_redis_session_timeout_in_seconds: 레디스 서버와 연결을 유지하는 제한시간입니다. 이 설정보다 긴 시간동안 레디스 서버와 연결이 되지 않을 경우 서버가 종료될 수 있습니다. (type=uint64, default=10)

  • rpc_redis_recovery_windows_size_in_sec: 레디스 서버가 크래시하는 등의 이유로 연결이 끊기게 되면 서버가 요청한 레디스 명령이 반영되어 있지 않는 경우가 있습니다. 이 때, 복원에 사용하기 위한 데이터를 보관하는 시간을 설정합니다. 예를 들어 기본값인 경우 최근 6초 동안의 레디스 명령을 보관했다가 레디스 서버와 연결이 다시 맺어지는 상황이 발생하면 보관했던 데이터들이 서버에 반영되어 있는지 확인합니다. 단, 설정한 시간보다 긴 시간동안 연결이 끊긴 상태가 유지될 경우 데이터 유실이 발생 할 수 있습니다. (type=uint64, default=6)

    Important

    RPC Backend 로 사용되는 Redis Server 는 전용으로 사용하고 Persistence 기능을 끄는 것을 권장합니다.

9.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)

9.7. Client supports

9.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=””)

9.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)

9.8. Game Contents Implementation

9.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)

9.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.

9.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)

9.9.2. HttpClientPool

대량의 HTTP 요청을 보내기 위한 기능입니다.

  • http_client_pool_max_recycle_interval_in_sec: 희망하는 최대 재사용 대기시간입니다. HttpClient 가 사용된 후 다시 사용되기까지의 시간이 이 시간 보다 길면 HttpClient 를 줄여 효율을 높입니다.(type=uint64, default=3)

9.9.3. RandomGenerator

This component generates random numbers.

9.9.4. 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.

9.9.5. 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.