{"id":29572634,"url":"https://github.com/accelbyte/session-dsm-grpc-plugin-java","last_synced_at":"2025-07-19T05:10:39.252Z","repository":{"id":275857536,"uuid":"926902276","full_name":"AccelByte/session-dsm-grpc-plugin-java","owner":"AccelByte","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-04T22:54:46.000Z","size":15963,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-04T23:30:37.226Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AccelByte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-04T03:50:17.000Z","updated_at":"2025-07-04T22:54:49.000Z","dependencies_parsed_at":"2025-07-04T23:26:21.448Z","dependency_job_id":"10bde86a-b2c7-4fd1-993e-1a78dbe7f83f","html_url":"https://github.com/AccelByte/session-dsm-grpc-plugin-java","commit_stats":null,"previous_names":["accelbyte/session-dsm-grpc-plugin-java"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AccelByte/session-dsm-grpc-plugin-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Fsession-dsm-grpc-plugin-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Fsession-dsm-grpc-plugin-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Fsession-dsm-grpc-plugin-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Fsession-dsm-grpc-plugin-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AccelByte","download_url":"https://codeload.github.com/AccelByte/session-dsm-grpc-plugin-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Fsession-dsm-grpc-plugin-java/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265892493,"owners_count":23845029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-19T05:10:38.530Z","updated_at":"2025-07-19T05:10:39.239Z","avatar_url":"https://github.com/AccelByte.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# session-dsm-grpc-plugin-server-java\n\n```mermaid\nflowchart LR\n   subgraph AccelByte Gaming Services\n   CL[gRPC Client]\n   end\n   subgraph Extend Override App\n   SV[\"gRPC Server\"]\n   end\n   CL --- SV\n```\n\n`AccelByte Gaming Services` (AGS) features can be customized using \n`Extend Override` apps. An `Extend Override` app is basically a `gRPC server` which \ncontains one or more custom functions which can be called by AGS instead of the \ndefault functions.\n\n## Overview\n\nThis repository provides a project template to create an `Extend Override` \napp for `session dsm grpc plugin server` written in `Java`. It includes an example of how the\ncustom functions can be implemented. It also includes the essential \n`gRPC server` authentication and authorization to ensure security. Additionally, \nit comes with built-in instrumentation for observability, ensuring that metrics, \ntraces, and logs are available upon deployment.\n\nYou can clone this repository to begin developing your own `Extend Override` \napp for `session dsm grpc plugin server`. Simply modify this project by implementing\nyour own logic for the custom functions.\n\n## Prerequisites\n\n1. Windows 11 WSL2 or Linux Ubuntu 22.04 or macOS 14+ with the following tools installed:\n\n   a. Bash\n\n   - On Windows WSL2 or Linux Ubuntu:\n\n      ```\n      bash --version\n\n      GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)\n      ...\n      ```\n\n   - On macOS:\n\n      ```\n      bash --version\n\n      GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23)\n      ...\n      ```\n\n   b. Make\n\n   - On Windows WSL2 or Linux Ubuntu:\n\n     To install from the Ubuntu repository, run `sudo apt update \u0026\u0026 sudo apt install make`.\n\n      ```\n      make --version\n\n      GNU Make 4.3\n      ...\n      ```\n\n   - On macOS:\n\n      ```\n      make --version\n\n      GNU Make 3.81\n      ...\n      ```\n\n   c. Docker (Docker Desktop 4.30+/Docker Engine v23.0+)\n\n   - On Linux Ubuntu:\n\n      1. To install from the Ubuntu repository, run `sudo apt update \u0026\u0026 sudo apt install docker.io docker-buildx docker-compose-v2`.\n      2. Add your user to the `docker` group: `sudo usermod -aG docker $USER`.\n      3. Log out and log back in to allow the changes to take effect.\n\n   - On Windows or macOS:\n\n     Follow Docker's documentation on installing the Docker Desktop on [Windows](https://docs.docker.com/desktop/install/windows-install/) or [macOS](https://docs.docker.com/desktop/install/mac-install/).\n\n      ```\n      docker version\n\n      ...\n      Server: Docker Desktop\n         Engine:\n         Version:          24.0.5\n      ...\n      ```\n\n   d. JDK 17\n\n   - On Linux Ubuntu:\n\n     To install from the Ubuntu repository, run: `sudo apt update \u0026\u0026 sudo apt install openjdk-17-jdk`.\n\n   - On Windows or macOS:\n\n     Follow Microsoft's documentation on [installing the Microsoft Build of OpenJDK](https://learn.microsoft.com/en-us/java/openjdk/install).\n\n      ```\n      java --version\n\n      openjdk 17.0.10 2024-01-16\n      ...\n      ```\n\n   e. [Postman](https://www.postman.com/)\n\n   - Use the available binary from [Postman](https://www.postman.com/downloads/).\n\n   f. [extend-helper-cli](https://github.com/AccelByte/extend-helper-cli)\n\n   - Use the available binary from [extend-helper-cli](https://github.com/AccelByte/extend-helper-cli/releases).\n\n   g. Local tunnel service that has TCP forwarding capability, such as:\n\n   - [Ngrok](https://ngrok.com/)\n         \n      Need registration for free tier. Please refer to [ngrok documentation](https://ngrok.com/docs/getting-started/) for a quick start.\n\n   - [Pinggy](https://pinggy.io/)\n\n      Free to try without registration. Please refer to [pinggy documentation](https://pinggy.io/docs/) for a quick start.\n\n   \u003e :exclamation: In macOS, you may use [Homebrew](https://brew.sh/) to easily install some of the tools above.\n\n2. Access to `AccelByte Gaming Services` environment.\n\n   a. Base URL\n\n   - For `Shared Cloud` tier e.g.  https://spaceshooter.prod.gamingservices.accelbyte.io\n   - For `Private Cloud` tier e.g.  https://dev.accelbyte.io\n\n   b. [Create a Game Namespace](https://docs.accelbyte.io/gaming-services/services/access/reference/namespaces/manage-your-namespaces/) if you don't have one yet. Keep the `Namespace ID`.\n\n   c. [Create an OAuth Client](https://docs.accelbyte.io/gaming-services/services/access/authorization/manage-access-control-for-applications/#create-an-iam-client) with confidential client type. Keep the `Client ID` and `Client Secret`.\n\n## Setup\n\nTo be able to run this app, you will need to follow these setup steps.\n\n1. Create a docker compose `.env` file by copying the content of \n   [.env.template](.env.template) file.\n\n   \u003e :warning: **The host OS environment variables have higher precedence compared to `.env` file variables**: If the variables in `.env` file do not seem to take \n   effect properly, check if there are host OS environment variables with the \n   same name. See documentation about \n   [docker compose environment variables precedence](https://docs.docker.com/compose/how-tos/environment-variables/envvars-precedence/) \n   for more details.\n\n2. Fill in the required environment variables in `.env` file as shown below.\n\n   ```\n   AB_BASE_URL=https://prod.gamingservices.accelbyte.io        # Base URL of AccelByte Gaming Services prod environment\n   AB_CLIENT_ID='xxxxxxxxxx'                                   # Client ID from the Prerequisites section\n   AB_CLIENT_SECRET='xxxxxxxxxx'                               # Client Secret from the Prerequisites section\n   PLUGIN_GRPC_SERVER_AUTH_ENABLED=false                       # Enable or disable access token and permission verification\n   DS_PROVIDER='DEMO'                                          # Select DS implementation, DEMO, GAMELIFT, or GCP\n   \n   // AWS Gamelift Config\n   AWS_ACCESS_KEY_ID='xxxxxxx'                                 # AWS access key if using gamelift\n   AWS_SECRET_ACCESS_KEY='xxxxxx'                              # AWS secret key if using gamelift\n   AWS_REGION='us-west-2'                                      # AWS region for gamelift\n   GAMELIFT_REGION='us-west-2'                                 # alias of AWS_REGION\n      \n   // GCP Config\n   GCP_SERVICE_ACCOUNT_FILE='./account.json'                   # GCP service account file in json format\n   GCP_PROJECT_ID=xxxxx-xxxx                                   # GCP Project ID\n   GCP_NETWORK=public                                          # GCP Network type\n   GCP_MACHINE_TYPE=e2-micro                                   # GCP intance type\n   GCP_REPOSITORY=asia-southeast1-docker.pkg.dev/xxxx/gcpvm    # GCP Repository\n   GCP_RETRY=3                                                 # GCP Retry to get instance\n   GCP_WAIT_GET_IP=1                                           # GCP wait time to get the instance IP in seconds\n   GCP_IMAGE_OPEN_PORT=8080                                    # Dedicated server open port\n   ```\n\n3. Access to AccelByte Gaming Services environment.\na. Base URL: https://prod.gamingservices.accelbyte.io/admin\n\n## Building\n\nTo build this app, use the following command.\n\n```shell\nmake build\n```\n\nThe build output will be available in `.output` directory.\n\n## Running\n\nTo (build and) run this app in a container, use the following command.\n\n```shell\ndocker compose up --build\n```\n\n## Testing\n\n### Test in Local Development Environment\n\nThe custom functions in this app can be tested locally using [postman](https://www.postman.com/).\n\n1. Run this app by using the command below.\n\n   ```shell\n   docker compose up --build\n   ```\n\n2. Open `postman`, create a new `gRPC request`, and enter `localhost:6565` as server URL.\n\n3. In `postman`, continue by selecting `CreateGameSession` grpc call method and click `Invoke` button, this will start stream connection to the gRPC server.\n\n4. Still in `postman`, continue sending parameters first to specify number of players in a match by copying sample `json` below and click `Send`.\n\n   ```json\n   {\n    \"client_version\": \"test\",\n    \"deployment\": \"test-deployment\",\n    \"game_mode\": \"test-game\",\n    \"maximum_player\": \"10\",\n    \"namespace\": \"testing\",\n    \"requested_region\": [\n        \"us-west-1\",\n        \"us-west-2\"\n    ],\n    \"session_data\": \"testing\",\n    \"session_id\": \"uuidv4\"\n   }\n   ```\n\n### Test with AccelByte Gaming Services\n\nTo test the app, which runs locally with AGS, the `gRPC server` needs to be connected to the internet. To do this without requiring public IP, you can use local tunnel service.\n\n1. Run this app by using command below.\n\n   ```shell\n   docker compose up --build\n   ```\n\n2. Expose `gRPC server` TCP port 6565 in local development environment to the internet. Simplest way to do this is by using local tunnel service provider.\n   - Sign in to [ngrok](https://ngrok.com/) and get your `authtoken` from the ngrok dashboard and set it up in your local environment.\n      And, to expose `gRPC server` use following command:\n      ```bash\n      ngrok tcp 6565\n      ```\n\n   - **Or** alternatively, you can use [pinggy](https://pinggy.io/) and use only `ssh` command line to setup simple tunnel.\n      Then to expose `gRPC server` use following command:\n      ```bash\n      ssh -p 443 -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -R0:127.0.0.1:6565 tcp@a.pinggy.io\n      ```\n\n   Please take note of the tunnel forwarding URL, e.g., `http://0.tcp.ap.ngrok.io:xxxxx` or `tcp://xxxxx-xxx-xxx-xxx-xxx.a.free.pinggy.link:xxxxx`.\n\n   \u003e :exclamation: You may also use other local tunnel service and different method to expose the gRPC server port (TCP) to the internet.\n\n3. In admin portal go to -\u003e Multiplayer \u003e Matchmaking \u003e Session Configuration. Click on the Add Session Template button. Select the Server configuration to be a DS - Custom. Then, select the Custom URL option and provide the tunnel forwarding URL from step 2.\n\n4. create gamesession or do matchmaking\n\n5. in Sessions and Parties - \u003e check in session detail base on session id -\u003e if ds status available check your server in GCPVM or gamelift\n\n## Deploying\n\nAfter completing testing, the next step is to deploy your app to `AccelByte Gaming Services`.\n\n1. **Create an Extend Override app**\n\n   If you do not already have one, create a new [Extend Override App](https://docs.accelbyte.io/gaming-services/services/extend/override/session-dedicated-server/get-started-session-dedicated-server/#create-the-extend-app).\n\n   On the **App Detail** page, take note of the following values.\n   - `Namespace`\n   - `App Name`\n\n2. **Build and Push the Container Image**\n\n   Use [extend-helper-cli](https://github.com/AccelByte/extend-helper-cli) to build and upload the container image.\n\n   ```\n   extend-helper-cli image-upload --login --namespace \u003cnamespace\u003e --app \u003capp-name\u003e --image-tag v0.0.1\n   ```\n\n   \u003e :warning: Run this command from your project directory. If you are in a different directory, add the `--work-dir \u003cproject-dir\u003e` option to specify the correct path.\n\n3. **Deploy the Image**\n   \n   On the **App Detail** page:\n   - Click **Image Version History**\n   - Select the image you just pushed\n   - Click **Deploy Image**\n\n## Next Step\n\nProceed by modifying this `Extend Override` app template to implement your own custom logic. For more details, see [here](https://docs.accelbyte.io/gaming-services/services/extend/override/session-dedicated-server/customize-session-dedicated-server/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccelbyte%2Fsession-dsm-grpc-plugin-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faccelbyte%2Fsession-dsm-grpc-plugin-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccelbyte%2Fsession-dsm-grpc-plugin-java/lists"}