Description
Changelog
Reviews (0)

Static Badge

GD-EOS

滚动到下方查看中文说明

Epic Online Services for Godot. Use as C++ SDK or compile as GDScript SDK.

Feature

  1. OOP and Godot Style, all APIs have been typed as far as possible.
  2. Almost APIs are generated from EOS C SDK, you can refer Epic Online Services document directly.
  3. EOSMultiplayerPeer for godot multiplayer.
  4. Support Windows, Linux, macOS, Android, iOS.

Support Me

This project is cost a lot of time and effort, if it can help you, please buy me a coffee.

Valid EOS SDK Version

  • EOS-SDK-36651368-v1.19.0.7
  • EOS-SDK-36651368-v1.16.4
  • EOS-SDK-Android-32303053-v1.16.3
  • EOS-SDK-32303053-v1.16.3

Outdated

  • EOS-SDK-32273396-v1.16.2
  • EOS-SDK-27379709-v1.16.1
  • EOS-SDK-Android-27379709-v1.16.1

How To Start

Video Tutorial: https://youtu.be/7CHBd7MAiu0 (pull this repo, get EOS SDK, compile, run the demo project.)

  1. Get GD-EOS plugin:
    • Download pre-compiled plugin from release page.
    • Compile by yourself.
  2. Install it like regular Godot plugin.
  3. Initialize EOS correctly, then you can use singletons of EOS. Here is a simple example:
     extends Node
    
     # EOS settings, you can get these from your epic developer portal.
     # For publishing, it is better not to store in clear text.
     @export var product_name: String = ""
     @export var product_version: String = ""
     @export var product_id: String = ""
     @export var sandbox_id: String = ""
     @export var deployment_id: String = ""
     @export var client_id: String = ""
     @export var client_secret: String = ""
     @export var encryption_key: String = ""
    
     func _ready() -> void:
         # Initialize EOS
         var init_options := EOSInitializeOptions.new()
         init_options.product_name = product_name
         init_options.product_version = product_version
         var result_code: EOS.Result = EOS.initialize(init_options)
         if result_code != EOS.Success:
             printerr("Initialize EOS failed: ", EOS.result_to_string(result_code))
             return
    
         # Setup Logging.
         EOS.set_logging_callback(_eos_log_callback)
         EOS.set_log_level(EOS.LC_ALL_CATEGORIES, EOS.LOG_Info)
    
         # Create platform
         var create_options := EOSPlatform_Options.new()
         create_options.product_id = product_id
         create_options.sandbox_id = sandbox_id
         create_options.deployment_id = deployment_id
         create_options.client_credentials = EOSPlatform_ClientCredentials.new()
         create_options.client_credentials.client_id = client_id
         create_options.client_credentials.client_secret = client_secret
         create_options.encryption_key = encryption_key
         create_options.flags = EOSPlatform.PF_WINDOWS_ENABLE_OVERLAY_OPENGL
         EOSPlatform.platform_create(create_options)
    
    
     # Log callback.
     static func _eos_log_callback(category: String, message: String, level: EOS.LogLevel) -> void:
         var msg: String = "[%s]: %s" % [category, message]
         if level >= EOS.LOG_Info:
             print(msg)
         elif level >= EOS.LOG_Warning:
             print_rich("[color=yellow]%s[/color]" % msg)
         elif level >= EOS.LOG_Error:
             print_rich("[color=orange]%s[/color]" % msg)
         else:
             printerr(msg)
    
  4. Now, you can use all functions of EOS, please refer Epic Online Services' document for more details.

How To Run Demo

Video Tutorial: https://youtu.be/7CHBd7MAiu0 (pull this repo, get EOS SDK, compile, run the demo project.)

  1. Enable required features for you product in developer portal. For convenience, you can enable all features of your client policy, or use the redefine policy "Peer2Peer".
  2. Set your product parameters to the root node of "main.tscn" scene.
  3. Prepare two Epic accounts; or use one Epic Account and use two login way at the same time which describe below.
  4. Run project with two instances to login:
    1. Set "External Credential Type" to "EPIC":
      1. Set "Login Credential Type" to "AccountPortal":
        • You should ensure your EPIC Account is added to your organization member, and have a appropriate role.
        • The permissions of your application in Epic Account Services should enable "Basic Profile", "Online Presence", "Friend", but "Country" should keep disabled. Keep "Id" and "Token" empty, click "Login" button an jump to external browser to request authentification.
      2. Set "Login Credential Type" to "Developer",you need to login your Epic Accounts with token in DevAuthTool which in the "Tools" folder of EOS SDK.
      • Set "Id" to the address of DevAuthTool,for example: localhost:8081
      • Set "Token" to the token of your account which is defined in DevAuthTool.
    2. Set "External Credential Type" to "DEVICESSID_ACCESS_TOKEN": It will create a token which relate your device.
  5. After login, user "Create" button to create a lobby in one instance, then click "Refresh" button to get lobby list, select a lobby and join it by "Join" button.
  6. Now, the two instances should be able to play together.

Static Badge

GD-EOS

适用于Godot的Epic Online Services。可作为C++ SDK或者编译后作为GDScript SDK

特性

  1. Godot风格的面向对象,所有的接口均尽可能的类型化。
  2. 几乎所有的接口都是从 EOS 的 C SDK 生成,你可以直接查看 Epic Online Services 的文档。
  3. 用于Godot多人网络的EOSMultiplayerPeer
  4. 支持 Windows, Linux, macOS, Android, iOS。

赞助

这个项目花费了我大量时间和经历,如果该项目对你有用的话,请考虑为我充电

测试过的 EOS SDK 版本

  • EOS-SDK-36651368-v1.19.0.7
  • EOS-SDK-36651368-v1.16.4
  • EOS-SDK-Android-32303053-v1.16.3
  • EOS-SDK-32303053-v1.16.3

过时的

  • EOS-SDK-32273396-v1.16.2
  • EOS-SDK-27379709-v1.16.1
  • EOS-SDK-Android-27379709-v1.16.1

如何开始

视频教程: https://www.bilibili.com/video/BV1Dz421k7P6/ (仓库拉取,EOS SDK 获取,编译,示例项目的运行)

  1. 获取GD-EOS插件:
    • 在Release页面下载预编译的插件。
    • 克隆该仓库自行编译。
  2. 像通常的Godot插件一样安装即可。
  3. 对EOS进行正确的初始化,只有正确的初始化之后EOS的所有单例才可正常使用,以下是简单的示例脚本:
     extends Node
    
     # EOS参数,从你的Epic开发者门户中获取
     # 用于发布时最好不要明文存储
     @export var product_name: String = ""
     @export var product_version: String = ""
     @export var product_id: String = ""
     @export var sandbox_id: String = ""
     @export var deployment_id: String = ""
     @export var client_id: String = ""
     @export var client_secret: String = ""
     @export var encryption_key: String = ""
    
     func _ready() -> void:
         # 初始化 EOS
         var init_options := EOSInitializeOptions.new()
         init_options.product_name = product_name
         init_options.product_version = product_version
         var result_code: EOS.Result = EOS.initialize(init_options)
         if result_code != EOS.Success:
             printerr("初始化 EOS 失败: ", EOS.result_to_string(result_code))
             return
    
         # 设置日志回调
         EOS.set_logging_callback(_eos_log_callback)
         EOS.set_log_level(EOS.LC_ALL_CATEGORIES, EOS.LOG_Info)
    
         # 创建 platform
         var create_options := EOSPlatform_Options.new()
         create_options.product_id = product_id
         create_options.sandbox_id = sandbox_id
         create_options.deployment_id = deployment_id
         create_options.client_credentials = EOSPlatform_ClientCredentials.new()
         create_options.client_credentials.client_id = client_id
         create_options.client_credentials.client_secret = client_secret
         create_options.encryption_key = encryption_key
         create_options.flags = EOSPlatform.PF_WINDOWS_ENABLE_OVERLAY_OPENGL
         EOSPlatform.platform_create(create_options)
    
    
     # 日志回调
     static func _eos_log_callback(category: String, message: String, level: EOS.LogLevel) -> void:
         var msg: String = "[%s]: %s" % [category, message]
         if level >= EOS.LOG_Info:
             print(msg)
         elif level >= EOS.LOG_Warning:
             print_rich("[color=yellow]%s[/color]" % msg)
         elif level >= EOS.LOG_Error:
             print_rich("[color=orange]%s[/color]" % msg)
         else:
             printerr(msg)
    
  4. 随后即可正常使用EOS的功能,具体使用请参考 Epic在线服务的文档

如何运行demo项目

视频教程: https://www.bilibili.com/video/BV1Dz421k7P6/ (仓库拉取,EOS SDK 获取,编译,示例项目的运行)

  1. 你需要在 Epic 开发者门户对你的产品开启必要的客户端策略特性,为方便起见,你可以开启所有的特性,或者使用预设 Peer2Peer 策略。
  2. 在main场景的根节点中为你的产品设置相应的参数。
  3. 准备两个 Epic 账号;或者使用一个 Epic 账号并同时使用下述的两种登陆方式。
  4. 运行项目,启动两个实例,进行登陆。
    1. External Credential Type 使用 EPIC:
      1. Login Credential Type 使用 AccountPortal 方式进行登陆:
        • 要登陆的epic账号需要添加到你的开发者门户的组织里并赋予了一个合适的角色。
        • EPIC账号服务开启的许可需要有"Basic Profile", "Online Presence", "Friend", 注意"Country"必须保持禁用。 不需要填写 Id 与 Token,直接登陆将跳转网页端请求登陆。
      2. Login Credential Type 使用 Developer 进行登陆,你需要使用 EOS SDK 的 Tools 文件夹中的 DevAuthTool 登陆你的账号并添加Token。
      • Id 为 DevAuthTool 启动时绑定的本地址与端口,如 localhost:8081
      • Token 为你为你的账号设置的 Token。
    2. External Credential Type 使用 DEVICESSID_ACCESS_TOKEN: 将创建基于设备的Token并登陆。
  5. 其中一个实例使用 Create 按钮创建大厅,另一个实例使用 Refresh 按钮刷新大厅列表,并使用 Join 按钮加入大厅。
  6. 此时两个实例已经可以正常联机。

Changelog for version v0.5.2-aoolu

No changelog provided for this version.

Reviews

GD-EOS has no reviews yet.

Login to write a review.

Consider supporting the creators!

If you enjoyed this asset consider supporting its creator. Follow the link below.