### Query Documentation Example Source: https://docs.edgegap.com/docs/tools-and-integrations/container/external-registries/aws-ecr Demonstrates how to query the documentation dynamically using an HTTP GET request with the 'ask' query parameter. Replace '' with your specific query. ```http GET https://docs.edgegap.com/docs/tools-and-integrations/container/external-registries/aws-ecr.md?ask= ``` -------------------------------- ### Run Nuxt.js Development Server Source: https://docs.edgegap.com/docs/sample-projects/nuxt-on-edgegap Verify your Nuxt.js installation by starting the development server. ```bash C:\Users\JohnDoe\Documents\demo-nuxt-edgegap> yarn dev ``` -------------------------------- ### Check Ruby Installation Source: https://docs.edgegap.com/docs/sample-projects/ruby-on-rails Verify that Ruby is installed correctly on your system. ```bash ruby -v ``` -------------------------------- ### Matchmaking Simple Example Source: https://docs.edgegap.com/docs/api/integration A basic example demonstrating matchmaking integration. This snippet is suitable for straightforward matchmaking needs. ```json { "matchmakerId": "your-matchmaker-id", "region": "us-east-1", "players": [ { "playerId": "player1", "skill": 100 }, { "playerId": "player2", "skill": 100 } ] } ``` -------------------------------- ### Check Rails Installation Source: https://docs.edgegap.com/docs/sample-projects/ruby-on-rails Confirm that the Rails framework has been installed successfully. ```bash rails -v ``` -------------------------------- ### Start Rails Server (Windows) Source: https://docs.edgegap.com/docs/sample-projects/ruby-on-rails Start the Ruby on Rails development server on a Windows system. ```sh ruby bin/rails server ``` -------------------------------- ### Server Browser Example Source: https://docs.edgegap.com/docs/api/integration Example for interacting with the server browser. This snippet is used to find available game servers. ```json { "region": "us-east-1", "filter": { "gameMode": "deathmatch", "maxPlayers": 4 } } ``` -------------------------------- ### Start SSH Service in Entrypoint Source: https://docs.edgegap.com/docs/tools-and-integrations/container/ssh Starts the SSH service when the container begins its execution. ```shell service ssh start ``` -------------------------------- ### Start Rails Server (Linux) Source: https://docs.edgegap.com/docs/sample-projects/ruby-on-rails Start the Ruby on Rails development server on a Linux system. ```sh rails server ``` -------------------------------- ### Matchmaking Advanced Example Source: https://docs.edgegap.com/docs/api/integration An advanced example for matchmaking, offering more configuration options. Use this for complex matchmaking requirements. ```json { "matchmakerId": "your-matchmaker-id", "region": "us-east-1", "players": [ { "playerId": "player1", "skill": 100, "attributes": { "ping": 50, "language": "en" } }, { "playerId": "player2", "skill": 100, "attributes": { "ping": 60, "language": "en" } } ], "maxWaitTime": 300, "minPlayers": 2, "maxPlayers": 4 } ``` -------------------------------- ### Example Game Client Ping Measurements Source: https://docs.edgegap.com/learn/matchmaking/matchmaker-in-depth Provides an example of ping measurements in milliseconds from different regions, used for ping optimization in matchmaking. ```json { "Chicago": 224.4, "Frankfurt": 23.2, "Tokyo": 167.4 } ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.edgegap.com/learn Perform an HTTP GET request on a documentation URL with the `ask` query parameter to get direct answers and relevant excerpts. The question should be specific and self-contained. ```HTTP GET https://docs.edgegap.com/learn.md?ask= ``` -------------------------------- ### Backfill Example (Backfill Showcase) Source: https://docs.edgegap.com/learn/matchmaking This JSON snippet shows how to initiate a backfill process by specifying the profile name and providing assignment attributes. The attributes include request details, server IP, and port information, which are crucial for connecting new players to an existing game session. ```json { "profile": "backfill-example", "attributes": { "assignment": { "request_id": "cd28e6c66554", "fqdn": "cd28e6c66554.pr.edgegap.net", "public_ip": "192.168.2.14", "ports": { "game": { "internal": 7777, "external": 56890, "link": "cd28e6c66554.pr.edgegap.net:56890", "protocol": "UDP" }, "web": { "internal": 22, "external": 57440, "link": "cd28e6c66554.pr.edgegap.net:57440", "protocol": "TCP" }, "server": { "internal": 80, "external": 50110, "link": "cd28e6c66554.pr.edgegap.net:50110", "protocol": "TCP" } }, "location": { "city": "Montreal", "country": "Canada", "continent": "North America", "administrative_division": "Quebec" ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.edgegap.com/docs/endpoint-storage/save-container-logs To get more information or clarification, perform an HTTP GET request to the documentation URL with an 'ask' query parameter containing your question. ```http GET https://docs.edgegap.com/docs/endpoint-storage/save-container-logs.md?ask= ``` -------------------------------- ### Agent Instructions: Querying Documentation Source: https://docs.edgegap.com/docs/tools-and-integrations/container/good-practices Demonstrates how to query the documentation dynamically by performing an HTTP GET request to the page URL with an 'ask' query parameter. ```http GET https://docs.edgegap.com/docs/tools-and-integrations/container/good-practices.md?ask= ``` -------------------------------- ### Dockerfile for Mirror Server Source: https://docs.edgegap.com/docs/sample-projects/unity-netcodes/mirror-on-edgegap This Dockerfile sets up an Ubuntu environment for a Unity Mirror game server. It installs necessary dependencies, exposes game ports, copies server files, and defines the entrypoint script. Remember to replace '[GAME PORT]' with your actual game port. ```dockerfile FROM ubuntu:bionic MAINTAINER ARG debian_frontend=noninteractive ARG docker_version=17.06.0-ce RUN apt-get update && \ apt-get install -y libglu1 xvfb libxcursor1 ca-certificates && \ apt-get clean && \ update-ca-certificates EXPOSE 3389/TCP EXPOSE [GAME PORT]/TCP EXPOSE [GAME PORT]/UDP COPY linux_server/ /root/linux_server/ COPY boot.sh /boot.sh WORKDIR /root/ ENTRYPOINT ["/bin/bash", "/boot.sh"] ``` -------------------------------- ### Initialize Edgegap Server Starter Source: https://docs.edgegap.com/docs/sample-projects/unity-netcodes/unity-netcode-on-edgegap This script is added to the MainMenu scene to handle server initialization. It retrieves the port from environment variables and starts the host connection. ```csharp using System; using System.Collections; using System.Collections.Generic; using Unity.BossRoom.ConnectionManagement; using UnityEngine; namespace Unity.Multiplayer.Samples.BossRoom { public class EdgegapServerStarter : MonoBehaviour { public string portMapName = "gameport"; // Start is called before the first frame update void Start() { if (Application.isBatchMode) { ConnectionManager connectionManager = GameObject.Find("ConnectionManager").GetComponent(); string internalPortAsStr = Environment.GetEnvironmentVariable($"ARBITRIUM_PORT_{portMapName.ToUpper()}_INTERNAL"); if (internalPortAsStr == null || !ushort.TryParse(internalPortAsStr, out ushort port)) { throw new Exception($"Could not find port mapping, make sure your app version port name matches with \"{portMapName}\""); } connectionManager.StartHostIp("SERVER", "0.0.0.0", port); } } } } ``` -------------------------------- ### Query Documentation with HTTP GET Source: https://docs.edgegap.com/learn/server-browser Perform an HTTP GET request on the current page URL with the 'ask' query parameter to get dynamic information. The question should be specific and in natural language. ```http GET https://docs.edgegap.com/learn/server-browser.md?ask= ``` -------------------------------- ### Generate Controller and View (Windows) Source: https://docs.edgegap.com/docs/sample-projects/ruby-on-rails Generate a controller and its associated view for the 'HelloWorld' resource on Windows, skipping route generation. ```bash ruby bin/rails generate controller HelloWorld index --skip-routes ``` -------------------------------- ### Query Documentation via HTTP GET Request Source: https://docs.edgegap.com/docs/tools-and-integrations/container/external-registries/gitlab-registry To get more information not explicitly on the page, make an HTTP GET request to the documentation URL with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.edgegap.com/docs/tools-and-integrations/container/external-registries/gitlab-registry.md?ask= ``` -------------------------------- ### Generate Controller and View (Linux) Source: https://docs.edgegap.com/docs/sample-projects/ruby-on-rails Generate a controller and its associated view for the 'HelloWorld' resource, skipping route generation as it's manually defined. ```bash rails generate controller HelloWorld index --skip-routes ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.edgegap.com/docs/tools-and-integrations/container/external-registries/docker-hub To get additional information not present on the page, perform an HTTP GET request to the documentation URL with an 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.edgegap.com/docs/tools-and-integrations/container/external-registries/docker-hub.md?ask= ``` -------------------------------- ### Install Rails Gem Source: https://docs.edgegap.com/docs/sample-projects/ruby-on-rails Install the Rails framework using the RubyGems package manager. ```bash gem install rails ``` -------------------------------- ### boot.sh for Unity Game Server Source: https://docs.edgegap.com/docs/sample-projects/unity-netcodes/mirror-on-edgegap-websocket This script is used as the entry point for the Docker container. It utilizes xvfb to run the Unity game server in headless mode with a virtual framebuffer. ```bash xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' /root/linux_server/[YOUR GAME].x86_64 -batchmode -nographics ``` -------------------------------- ### Query Documentation with ASK parameter Source: https://docs.edgegap.com/docs/tools-and-integrations/container/ssh Demonstrates how to perform an HTTP GET request to a documentation page with an 'ask' query parameter to retrieve specific information. ```http GET https://docs.edgegap.com/docs/tools-and-integrations/container/ssh.md?ask= ``` -------------------------------- ### Docker build, login, tag, and push commands (Windows CMD) Source: https://docs.edgegap.com/docs/sample-projects/unity-netcodes/mirror-on-edgegap These commands are used to build the Docker image, log in to a container registry, tag the image for the registry, and push it. Ensure you replace placeholders like , , '', and '' with your specific details. ```cmd # build the image docker build . -t : # login, a prompt will ask the password docker login -u # add another tag to your image corresponding to the registry docker image tag : //: #push the image docker push //: ``` -------------------------------- ### Nakama values.yaml Configuration Source: https://docs.edgegap.com/learn/advanced-features/managed-clusters Example configuration for Nakama deployment, setting the environment to production. ```yaml isProductionEnvironment: true ``` -------------------------------- ### Install Cert-Manager Helm Chart Source: https://docs.edgegap.com/learn/advanced-features/managed-clusters Install cert-manager to manage TLS certificates for your cluster. This is required for HTTPS. ```bash helm repo add jetstack https://charts.jetstack.io --force-update; helm upgrade --install cert-manager jetstack/cert-manager \ --namespace cert-manager --create-namespace \ --version v1.16.1 --set crds.enabled=true; ``` -------------------------------- ### Install Nuxt.js Dependencies Source: https://docs.edgegap.com/docs/sample-projects/nuxt-on-edgegap Run this command in your application directory to install project dependencies using Yarn. ```bash C:\Users\JohnDoe\Documents\demo-nuxt-edgegap> yarn ``` -------------------------------- ### Example Server Policy Configuration Source: https://docs.edgegap.com/learn/server-browser Defines a standard server policy with essential keys like server name, password, and webhook notifications for ready and error states. ```json { "name": "sb-owner-jnjnc8mid", "filter": "metadata.policy_name eq 'sb-owner-jnjnc8mid'", "deployment_request": { "private_host_ids": [], "application": "my-game-server", "version": "2024.01.30-16.23.00-UTC", "users": [ { "user_type": "geo_coordinates", "user_data": { "latitude": 41.881832, "longitude": -87.623177 } } ], "tags": ["sb-owner-jnjnc8mid"], "environment_variables": [ { "key": "SB_POLICY_NAME", "value": "sb-owner-jnjnc8mid", "is_hidden": false }, { "key": "SB_SERVER_PASSWORD", "value": "password1234", "is_hidden": false } ], "webhook_on_ready": { "url": "https://my-webhook.com" }, "webhook_on_error": { "url": "https://my-webhook.com" }, "webhook_on_terminated": { "url": "https://my-webhook.com" } }, "minimum_active_instances": 1 } ``` -------------------------------- ### Matchmaking Social Games Example Source: https://docs.edgegap.com/docs/api/integration An example for matchmaking in social games. Prioritizes connecting players for a casual experience. ```json { "matchmakerId": "your-matchmaker-id", "region": "us-east-1", "players": [ { "playerId": "player1" }, { "playerId": "player2" } ], "social": true } ```