### Blueprint Example: Start Session Source: https://docs.redpoint.games/docs/matchmaking/dedicated_server_configuration This blueprint demonstrates how to start a session after a match is ready. This action marks the server as in-use and removes it from search results. ```blueprint Online Identity Subsystem Subsystem Session Name ManagedDedicatedServerSession On Call Failed On Start Session Complete Session Name Was Successful Condition True False ``` -------------------------------- ### Install K3S Kubernetes Source: https://docs.redpoint.games/docs/dedis/creating_your_cluster Install K3S, a lightweight Kubernetes distribution, on the dedicated server. This command installs K3S and sets up the server as the control node, skipping the automatic start. Ensure you are the root user. ```bash curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true sh - ``` -------------------------------- ### Example K3S Node Output Source: https://docs.redpoint.games/docs/dedis/creating_your_cluster Example output from the 'k3s kubectl get node' command, showing a ready control-plane node. This confirms the successful deployment of K3S. ```text NAME STATUS ROLES AGE VERSION west-europe-01 Ready control-plane,master 11s v1.22.7+k3s1 ``` -------------------------------- ### Install k3s Agent and Configure Node Source: https://docs.redpoint.games/docs/dedis/bursting_into_cloud This startup script installs k3s agent, retrieves instance metadata, and configures the k3s agent service to join the cluster with specific node details. It also sets up a shutdown script to gracefully remove the node from the cluster before uninstalling k3s. ```bash #!/bin/bash # Replace these values for your cluster. export INSTALL_K3S_VERSION=v1.22.7+k3s1 export K3S_URL=https://...:6443 export K3S_TOKEN=K101...00f # Install k3s and join the VM to the cluster. curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true sh - PROJECT_ID=$(curl http://metadata.google.internal/computeMetadata/v1/project/project-id -H "Metadata-Flavor: Google") INSTANCE_NAME=$(curl http://metadata.google.internal/computeMetadata/v1/instance/name -H "Metadata-Flavor: Google") INSTANCE_PRIVATE_IP=$(curl http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip -H "Metadata-Flavor: Google") INSTANCE_PUBLIC_IP=$(curl http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip -H "Metadata-Flavor: Google") INSTANCE_ZONE_FULL=$(curl http://metadata.google.internal/computeMetadata/v1/instance/zone -H "Metadata-Flavor: Google") OLDIFS=$IFS IFS=/ ARR=($INSTANCE_ZONE_FULL) INSTANCE_ZONE=${ARR[3]} IFS=$OLDIFS mkdir /etc/systemd/system/k3s-agent.service.d || true cat >/shutdown-node.sh </etc/systemd/system/k3s-agent.service.d/override.conf <(*LobbyId); // Set up the call options. EOS_Lobby_GetRTCRoomNameOptions GetRTCRoomNameOpts = {}; GetRTCRoomNameOpts.ApiVersion = EOS_LOBBY_GETRTCROOMNAME_API_LATEST; GetRTCRoomNameOpts.LocalUserId = ProductUserId; GetRTCRoomNameOpts.LobbyId = LobbyIdPtr.Get(); // Initialize buffer parameters just enough that we can call the EOS SDK // and get it to tell us how much memory we need to allocate. char* ResultBuffer = nullptr; uint32_t ResultBufferLength = 0; // Call the EOS SDK so that it populates ResultBufferLength. EOS_EResult ResultCode = EOS_Lobby_GetRTCRoomName( LobbyHandle, &GetRTCRoomNameOpts, ResultBuffer, &ResultBufferLength); check(ResultCode == EOS_EResult::EOS_LimitExceeded); // Allocate our memory to receive the output string. ResultBuffer = FMemory::MallocZeroed(ResultBufferLength + 1); // Call the EOS SDK again so it actually populates the output data this time. ResultCode = EOS_Lobby_GetRTCRoomName( LobbyHandle, &GetRTCRoomNameOpts, ResultBuffer, &ResultBufferLength); // If successful, convert our ASCII string data from the buffer that the // EOS SDK just populated back into an Unreal Engine string. FString RTCRoomName; if (ResultCode == EOS_EResult::EOS_Success) { RTCRoomName = ANSI_TO_TCHAR(ResultBuffer); } // Release the temporary memory we allocated for the EOS SDK. FMemory::Free(ResultBuffer); ``` -------------------------------- ### Install Amazon Root Certificates and Launch Game Server Source: https://docs.redpoint.games/docs/dedis/playfab This script installs necessary Amazon root certificates and then launches the game server executable. Ensure all certificate files are in the same directory as this script. ```batch certutil.exe -addstore root .\AmazonRootCA1.cer certutil.exe -addstore root .\AmazonRootCA2.cer certutil.exe -addstore root .\AmazonRootCA3.cer certutil.exe -addstore root .\AmazonRootCA4.cer certutil.exe -addstore root .\SFSRootCAG2.cer .\MyGameServer.exe -log ``` -------------------------------- ### Build Lyra Example Project with UET Source: https://docs.redpoint.games/docs/examples/lyra Use the Unreal Engine Tool (UET) to build the Lyra example project. Ensure you have the correct project directory and engine version specified. ```bash uet build -d Lyra -e 5.6 ``` -------------------------------- ### Sign in a local user Source: https://docs.redpoint.games/docs/systems/identity Use `IIdentitySystem::Login` to sign in a local player. This example uses the default constructor for `FLoginRequest`. ```cpp Identity->Login( FLoginRequest(0 /* user slot / controller index */) IIdentitySystem::FOnLoginComplete::CreateSPLambda(this, [this](FError ErrorCode, FIdentityUserPtr NewUser) { if (ErrorCode.WasSuccessful()) { // NewUser is valid. } })); ``` -------------------------------- ### Run Packaged Game Server Locally Source: https://docs.redpoint.games/docs/dedis/preparing_your_game_server Starts a packaged game server as a container on your local machine. Ensure you replace `` with your actual image ID. ```bash docker run -p 7777:7777/udp ``` -------------------------------- ### Start K3S Service Source: https://docs.redpoint.games/docs/dedis/creating_your_cluster Starts the K3S service on the dedicated server. This command initiates the Kubernetes control plane. ```bash systemctl start k3s.service ``` -------------------------------- ### Install Agones with Helm Source: https://docs.redpoint.games/docs/dedis/creating_your_cluster Install Agones on your Kubernetes cluster using Helm. This command configures specific ports for Agones services. ```bash # This tells other Kubernetes tools like Helm how to connect to the cluster. export KUBECONFIG=/etc/rancher/k3s/k3s.yaml # Install Agones. helm repo add agones https://agones.dev/chart/stable helm install agones agones/agones --version 1.21.0 --set agones.ping.http.port=8001 --set agones.allocator.service.http.port=8002 --set agones.allocator.service.grpc.port=8003 ``` -------------------------------- ### Install hping3 Utility Source: https://docs.redpoint.games/docs/dedis/bursting_into_cloud Installs the hping3 utility on Debian-based systems. This is a prerequisite for testing UDP network connectivity. ```bash apt-get update && apt-get install -y hping3 ``` -------------------------------- ### Verify Game Servers with kubectl get gameservers Source: https://docs.redpoint.games/docs/dedis/setting_up_autoscaling Confirm that your game servers are running and ready. This command displays their state, address, port, node, and age. ```bash NAME STATE ADDRESS PORT NODE AGE eos-dedicated-server-47tpv-cgf6q Ready 10.0.0.1 7181 west-europe-01 2m eos-dedicated-server-47tpv-vpwpq Ready 10.0.0.2 7072 west-europe-02 2m ``` -------------------------------- ### Obtain Presence System Reference Source: https://docs.redpoint.games/docs/systems/presence Get a reference to the IPresenceSystem by calling GetSystem on an FPlatformHandle. Ensure the RedpointEOSPresence module is included and the necessary headers are present. ```csharp #include "RedpointEOSPresence/PresenceSystem.h" // Place at the top of function bodies that use the presence system. using namespace Redpoint::EOS::Presence; FPlatformHandle PlatformHandle; // e.g. obtained from the online subsystem. auto Presence = PlatformHandle->GetSystem(); ``` -------------------------------- ### Redpoint EOS API Wrapper Example Source: https://docs.redpoint.games/docs/systems/api Shows how to call EOS_Lobby_GetRTCRoomName using the RedpointEOSAPI wrapper, which simplifies parameter handling and memory management. ```cpp #include "RedpointEOSAPI/Lobby/GetRTCRoomName.h" using namespace Redpoint::EOS::API::Lobby; // Parameters we need to make the call. FString LobbyId; EOS_ProductUserId ProductUserId; // Result values. EOS_EResult ResultCode; FString RTCRoomName; // Call EOS_Lobby_GetRTCRoomName using the wrapper, with ResultCode and // RTCRoomName being populated by the call. FGetRTCRoomName::Execute( this->PlatformHandle, FGetRTCRoomName::Options{ProductUserId, LobbyId}, ResultCode, RTCRoomName); ``` -------------------------------- ### Setting up FMatchmakingEngineRequest Source: https://docs.redpoint.games/docs/matchmaking/cpp/queue_to_matchmaking Includes necessary headers and initializes the FMatchmakingEngineRequest. Ensure all required interface headers are copied into your project and that the local player is signed in. ```cpp #include "RedpointMatchmaking/MatchmakingEngine.h" #include "Interfaces/OnlineLobbyInterface.h" #include "OnlineSubsystemUtils.h" #include "Engine/Engine.h" // ... FMatchmakingEngineRequest Request = {}; Request.Identity = Online::GetIdentityInterface(this->GetWorld()); Request.Lobby = Online::GetLobbyInterface(Online::GetSubsystem(this->GetWorld())); Request.PartySystem = Online::GetPartyInterface(this->GetWorld()); Request.Stats = Online::GetStatsInterface(this->GetWorld()); Request.Session = Online::GetSessionInterface(this->GetWorld()); Request.WorldContextHandle = GEngine->GetWorldContextFromWorldChecked(this->GetWorld()).ContextHandle; Request.UserId = this->GetWorld() ->GetFirstPlayerController() ->GetLocalPlayer() ->GetPreferredUniqueNetId() .GetUniqueNetId(); Request.PartyId = PartyId.AsShared(); Request.HostConfiguration = nullptr; ``` -------------------------------- ### Dockerfile for Game Server Source: https://docs.redpoint.games/docs/dedis/preparing_your_game_server This Dockerfile sets up an Ubuntu 20.04 environment, creates a non-root user, copies game server binaries, and configures the entrypoint for launching the server. ```dockerfile # Base our Docker image off Ubuntu 20.04. FROM ubuntu:20.04 # Create a user to run our game server binaries as. If we didn't do this, our binaries # would run as root which is less secure. RUN useradd -m ue4 USER ue4:ue4 # Add the game server binaries to the image. Mark the launch script and the main game # server binary as executable. ADD --chown=ue4:ue4 LinuxServer /home/ue4 RUN chmod a+x /home/ue4/MyGameServer.sh /home/ue4/MyGame/Binaries/Linux/MyGameServer # Tell Docker that it should use the launch script when the container is executed. ENTRYPOINT [ "/home/ue4/MyGameServer.sh" ] ``` -------------------------------- ### Install Specific K3S Version Source: https://docs.redpoint.games/docs/dedis/creating_your_cluster Install a specific version of K3S on the dedicated server, skipping the automatic start. This is useful for maintaining version consistency across your cluster. Ensure you are the root user. ```bash curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_START=true INSTALL_K3S_VERSION=v1.22.7+k3s1 sh - ``` -------------------------------- ### Initialize Minute Game Instance Source: https://docs.redpoint.games/docs/examples/minute/player-preferences Sets up player preferences and binds to the login completion event during the game instance initialization. This ensures that player data is ready after login, even if the player is already logged in. ```blueprint Event Init Online Identity Subsystem Target: Event Class: PlayerPreferences_C Outer: Return Value SET Player Preferences Condition: True False Target: Local User Num 0 Return Value: == NotLoggedIn Target: Local User Num 0 Was Successful User ID Error Target: Local User Num 0 Return Value Duration: 0.1 Completed Fullscreen Reset Graph Zoom 1:1 blueprint Show Debug Informations Enable Write Mode Enable Multi Users soon Enable Material Viz soon Enable Annotations soon INIT INTERACTIONS... ``` -------------------------------- ### Blueprint Example: Create Session Source: https://docs.redpoint.games/docs/matchmaking/dedicated_server_configuration This blueprint visualizes the process of creating a session for a dedicated server. Ensure 'Should Advertise' is true and 'Allow Join in Progress' is false. Configure 'Num Public Connections' based on the largest match size. ```blueprint Target Event Online Session Subsystem Subsystem Hosting Player Id Session Name ManagedDedicatedServerSession New Session Settings On Call Failed On Create Session Complete Session Name Was Successful Target Local User Num 0 Return Value Num Public Connections 8 Num Private Connections 0 Should Advertise Allow Join in Progress Is LANMatch Is Dedicated Uses Stats Allow Invites Uses Presence Allow Join Via Presence Allow Join Via Presence Friends Only Anti Cheat Protected Use Lobbies if Available Use Lobbies Voice Chat if Available Build Unique Id 0 Settings Online Session Settings BP Condition True False ``` -------------------------------- ### Get Team and Slot for Player on Server (Listen/Dedicated Server) Source: https://docs.redpoint.games/docs/matchmaking/blueprints/runtime_information Use this blueprint node on the Matchmaker Subsystem to get team and slot information for a player on a listen or dedicated server. Typically used in the 'Choose Player Start' implementation in the game mode. ```blueprint Matchmaker Subsystem Target: Player State Target Player State Found: Team Slot ``` -------------------------------- ### Build Docker Image Source: https://docs.redpoint.games/docs/dedis/preparing_your_game_server Navigate to your workspace folder and execute this command to build the Docker image for your game server. ```bash cd C:\Path\To\Workspace\Folder docker build . ``` -------------------------------- ### Direct EOS SDK Function Call Example Source: https://docs.redpoint.games/docs/systems/api Use this snippet to invoke EOS SDK functions directly when a RedpointEOSAPI wrapper is not yet available. Obtain the interface handle from the FPlatformHandle using the Get<> function. ```cpp FPlatformHandle PlatformHandle = /* ... */; EOS_HConnect Connect = PlatformHandle->Get(); if (Connect != nullptr) { // Invoke EOS_Connect_* SDK functions directly. } ``` -------------------------------- ### Enable GOG Authentication in Project Target Files Source: https://docs.redpoint.games/docs/setup/platforms/gog Add this project definition to your project's `.Target.cs` files to enable GOG authentication. ```csharp ProjectDefinitions.Add("ONLINE_SUBSYSTEM_EOS_ENABLE_GOG=1"); ``` -------------------------------- ### Simple Interactive Authentication Graph Source: https://docs.redpoint.games/docs/auth/write_your_own_authentication_graph This example demonstrates creating an authentication graph that prioritizes interactive authentication using a cross-platform account provider. It includes a check for the provider's validity. ```cpp TSharedRef FAuthenticationGraphCrossPlatformOnly::CreateGraph( TSharedRef InitialState) { if (InitialState->CrossPlatformAccountProvider.IsValid()) { return MakeShared() ->Add(MakeShared()) ->Add(InitialState->CrossPlatformAccountProvider->GetInteractiveAuthenticationSequence()) ->Add(MakeShared()) ->Add(MakeShared()); } else { return MakeShared(TEXT("There is no cross-platform account provider configured.")); } } ``` -------------------------------- ### Verify Game Server Creation Output Source: https://docs.redpoint.games/docs/dedis/testing_deployment This is the expected output after successfully creating a game server container. ```bash gameserver.agones.dev/eos-dedicated-server-x9ddb created ``` -------------------------------- ### Install curl in Ubuntu Pods Source: https://docs.redpoint.games/docs/dedis/bursting_into_cloud Installs the curl utility in Ubuntu containers within Kubernetes pods. Ensure you have kubectl access to your cluster. ```bash kubectl exec -c ubuntu test-dedi -- bash -c 'apt-get update && apt-get install -y curl' ``` ```bash kubectl exec -c ubuntu test-gce -- bash -c 'apt-get update && apt-get install -y curl' ``` -------------------------------- ### Get Channels Source: https://docs.redpoint.games/docs/systems/voice_chat Retrieves a list of all voice chat channels the local user is currently in. It also provides a way to get a specific channel by its name. ```APIDOC ## Get Channels ### Description Retrieves the list of voice chat channels that a local user is currently in. You can also get a specific channel by name. ### Method `IVoiceChatSystem::GetChannels` (to get all channels) `IVoiceChatSystem::GetChannel` (to get a specific channel by name) ### Parameters #### `IVoiceChatSystem::GetChannels` - **LocalUserId** (UserId) - The ID of the local user. #### `IVoiceChatSystem::GetChannel` - **LocalUserId** (UserId) - The ID of the local user. - **ChannelName** (string) - The name of the channel to retrieve. ### Response - **`IVoiceChatSystem::GetChannels`**: Returns a `TArray` containing all channels the user is in. - **`IVoiceChatSystem::GetChannel`**: Returns an `FVoiceChatChannelPtr` which can be checked for validity to determine if the user is in the channel. ``` -------------------------------- ### Nginx Default Welcome Page Source: https://docs.redpoint.games/docs/dedis/bursting_into_cloud This is the expected output when HTTP connectivity is successfully established between pods, indicating a working nginx server. ```html Welcome to nginx!

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

``` -------------------------------- ### Get Team and Slot (Client/Listen Server) Source: https://docs.redpoint.games/docs/matchmaking/blueprints/runtime_information Use this blueprint node on the Matchmaker Subsystem to get team and slot information for a player on the client or a listen server. ```blueprint Matchmaker Subsystem Target: Local Player Controller Target Player State Found: Team Slot ``` -------------------------------- ### LNK2019 Error Example Source: https://docs.redpoint.games/docs/support/troubleshooting/lnk2019 This is an example of the LNK2019 error message encountered during a build. It indicates an unresolved external symbol, often related to project file locations. ```text LNK2019: unresolved external symbol "public: cdecl TMap,class FString,class FDefaultSetAllocator,struct TDefaultMapHashableKeyFuncs,class FString,0> >::TMap,class FString,class FDefaultSetAllocator,struct TDefaultMapHashableKeyFuncs,class FString,0> >(void)" (??0?$TMap@V?$TOnlineId@UFAccount@OnlineIdHandleTags@Online@UE@@@Online@UE@@VFString@@VFDefaultSetAllocator@@U?$TDefaultMapHashableKeyFuncs@V?$TOnlineId@UFAccount@OnlineIdHandleTags@Online@UE@@@Online@UE@@VFString@@$0A@@@@@QEAA@XZ) referenced in function "public: virtual class File4071280369_Redpoint::EOS::Async::TTask cdecl File1395847802_Redpoint::EOS::VoiceChat::FVoiceChatSystemGameImpl::CreateUnmanagedChannelAuthenticationTokens(class FString,class TArray,class TSizedDefaultAllocator<32> >)" (?CreateUnmanagedChannelAuthenticationTokens@FVoiceChatSystemGameImpl@VoiceChat@EOS@File1395847802_Redpoint@@UEAA?AV?$TTask@UFVoiceChatCreatedAuthenticationTokens@VoiceChat@EOS@File4158978016_Redpoint@@$0A@@Async@3File4071280369_Redpoint@@VFString@@V?$TArray@V?$TOnlineId@UFAccount@OnlineIdHandleTags@Online@UE@@@Online@UE@@V?$TSizedDefaultAllocator@$0CA@@@@@@Z) ``` -------------------------------- ### Connect to Game Server (C++) Source: https://docs.redpoint.games/docs/setup/networking/server_travel Use the GEngine->Browse function to connect to a game server. Ensure the ConnectInfo variable is populated with the connection string. Handles connection failures by logging errors. ```cpp if (GEngine != nullptr) { FURL NewURL(nullptr, *ConnectInfo, ETravelType::TRAVEL_Absolute); FString BrowseError; if (GEngine->Browse(GEngine->GetWorldContextFromWorldChecked(this->GetWorld()), NewURL, BrowseError) == EBrowseReturnVal::Failure) { UE_LOG(LogTemp, Error, TEXT("Failed to start browse: %s"), *BrowseError); } } ``` -------------------------------- ### Get Android Distribution SHA-1 Fingerprint Source: https://docs.redpoint.games/docs/setup/platforms/google Use these PowerShell commands to get the SHA-1 fingerprint from your distribution keystore. Remember to replace placeholder paths and credentials with your actual project details. ```powershell cd C:\Path\To\Your\Project keytool -list -v -keystore "Build\Android\ExampleKey.keystore" -alias MyKey -storepass 123password 2>$null | Where-Object { $_.Trim().StartsWith("SHA1:") } | ForEach-Object { $_.Trim().Substring(6) } ``` -------------------------------- ### Registering an Output Audio Patch Source: https://docs.redpoint.games/docs/systems/voice_chat Example of registering an output audio patch with the voice chat system during game module startup. The priority parameter determines the order of patch execution. ```cpp using namespace ::Redpoint::EOS::VoiceChat; class FMyGameModule : public FDefaultModuleImpl { private: FVoiceChatOutputAudioPatchPtr MyOutputAudioPatch; public: virtual void StartupModule() override { this->MyOutputAudioPatch = MakeShared(); FVoiceChatOutputAudioPatchRegistry::Register(this->MyOutputAudioPatch.ToSharedRef(), 200 /* priority */); } virtual void ShutdownModule() override { if (this->MyOutputAudioPatch.IsValid()) { FVoiceChatOutputAudioPatchRegistry::Unregister(this->MyOutputAudioPatch.ToSharedRef()); this->MyOutputAudioPatch.Reset(); } } }; ``` -------------------------------- ### Get Current Party Blueprint Source: https://docs.redpoint.games/docs/framework/automatic_parties Retrieve the current party the local player is in using the Get Primary Party node. This may temporarily return None if the player was removed from a party and a new one is being created. ```blueprint Redpoint Framework Local Player Subsystem Target Return Value Fullscreen Reset Graph Zoom 1:1 blueprint Show Debug Informations Enable Write Mode Enable Multi Users soon Enable Material Viz soon Enable Annotations soon INIT INTERACTIONS... Blueprint example rendered using the blueprintue.com renderer under an explicit license grant. ``` -------------------------------- ### Configure Project Build Settings Source: https://docs.redpoint.games/docs/support/troubleshooting/redpointeosconfig Sets up the core module rules for your Unreal Engine project. Replace `` with your project's name. ```csharp using UnrealBuildTool; public class : ModuleRules { public (ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PublicDependencyModuleNames.AddRange(new string[] { "Core", }); } } ``` -------------------------------- ### Automatically Start and End Session Source: https://docs.redpoint.games/docs/framework/player_registration Turn on 'Start and End Session Automatically' to have Redpoint Game Session manage the session lifecycle based on player count. This is useful when the game server is full and 'Allow Join in Progress' is disabled. ```blueprint Set Start and End Session Automatically Target: Your RedpointGameSession Blueprint Value: true ``` -------------------------------- ### Enable Meta Quest Support in Target.cs Source: https://docs.redpoint.games/docs/setup/platforms/meta Add this project definition to your `.Target.cs` files located in the `Source` directory to enable Meta Quest support during the build process. ```csharp ProjectDefinitions.Add("ONLINE_SUBSYSTEM_EOS_ENABLE_META=1"); ``` -------------------------------- ### Install Cluster Autoscaler with Helm Source: https://docs.redpoint.games/docs/dedis/bursting_into_cloud Installs the cluster autoscaler using Helm, configuring it for Google Compute Engine. Ensure your Google Cloud project ID, zone, and instance group name are correctly set. This snippet uses a custom patched autoscaler image from `registry.redpoint.games`. ```bash # Add the autoscaler repository to Helm. helm repo add autoscaler https://kubernetes.github.io/autoscaler # Set the Google Cloud project ID. PROJECTID=your-google-cloud-project # Set the zone that you created the instance group in. ZONENAME=australia-southeast2-a # Set the name of the instance group you previously created. GROUPNAME=west-europe-01 # Set the minimum number of nodes that the autoscaler should autoscale to. MINSIZE=0 # Set the maximum number of nodes that the autoscaler should autoscale to. MAXSIZE=10 # Install the autoscaler. helm install gce-autoscaler autoscaler/cluster-autoscaler \ --set autoscalingGroups[0].name=https://content.googleapis.com/compute/v1/projects/$PROJECTID/zones/$ZONENAME/instanceGroups/$GROUPNAME,autoscalingGroups[0].maxSize=$MAXSIZE,autoscalingGroups[0].minSize=$MINSIZE \ --set image.repository=registry.redpoint.games/redpointgames/kubernetes-autoscaler \ --set image.tag=latest \ --set image.pullPolicy=Always \ --set cloudProvider=gce \ --set extraEnv.GOOGLE_APPLICATION_CREDENTIALS=/secret/google-application-credentials.json \ --set extraVolumeSecrets.gce-autoscaler-info.name=gce-autoscaler-info \ --set extraVolumeSecrets.gce-autoscaler-info.mountPath=/secret/ \ --set extraArgs.cloud-config=/secret/gcfg.ini \ --set extraArgs.scale-down-unneeded-time=3m \ --set extraArgs.scale-down-delay-after-add=3m \ --set nodeSelector."node-role.kubernetes.io/control-plane"=true ``` -------------------------------- ### Display Network Interfaces Source: https://docs.redpoint.games/docs/dedis/securing_your_network Use the `ifconfig` command to list all network interfaces and identify private (e.g., eth0) and public (e.g., eth1) interfaces. If `ifconfig` is not found, install `net-tools` first. ```bash ifconfig ``` ```bash apt update && apt install -y net-tools && ifconfig ``` -------------------------------- ### Get All Locally Signed-In Users Source: https://docs.redpoint.games/docs/systems/identity Retrieves all users that are currently signed in to the system. This function returns a TArray of FIdentityUserRef. ```cpp TArray LocalUsers = Identity->GetUsers(); ``` -------------------------------- ### Listen for UDP Packets on Local Provider Source: https://docs.redpoint.games/docs/dedis/bursting_into_cloud Sets up the local provider to listen for incoming UDP packets from the Google Cloud instance. Replace 'eth0' with the correct private interface name. ```bash hping3 --listen hello -I eth0 ``` -------------------------------- ### Get Friend Alias Source: https://docs.redpoint.games/docs/systems/friends Retrieves the locally set alias for a friend. Returns an unset TOptional if no alias is set. ```cpp auto Alias = FriendSystem->GetFriendAlias( LocalUserId, FriendUserId); ``` -------------------------------- ### Get Friend List Source: https://docs.redpoint.games/docs/systems/friends Retrieves the list of unified and non-unified friends for a local player. Ensure the FriendSystem is initialized before calling. ```cpp TAccountIdMap UnifiedFriends; TArray NonUnifiedFriends; auto Error = FriendSystem->GetFriends( LocalUserId, UnifiedFriends, NonUnifiedFriends); if (Error.WasSuccessful()) { // UnifiedFriends and NonUnifiedFriends were populated with the list of friends. } ``` -------------------------------- ### Constructing Host Configuration Source: https://docs.redpoint.games/docs/matchmaking/cpp/queue_to_matchmaking Defines settings for a host initiating a matchmaking request, including request ID, queue name, team capacities, and behavior on no candidates. ```cpp // Construct the host configuration. auto RequestHostConfiguration = MakeShared(); // Set the request ID. This should be a fairly unique int64 value, and is used internally // by the algorithm. If this value isn't unique enough, matchmaking won't work properly. RequestHostConfiguration->RequestId = FDateTime::UtcNow().GetTicks(); // Set the matchmaking queue name. Requests in different queues will never be matched // together. RequestHostConfiguration->QueueName = FName(TEXT("Default")); // Set the player counts on each team. In the example below, we're setting up a 4v4 match. TArray TeamCapacities; TeamCapacities.Add(4); TeamCapacities.Add(4); RequestHostConfiguration->TeamCapacities = TeamCapacities; // When we run out of time, and there's no more players online to bring into our match, // what should the matchmaker do? Available options are: // - EMatchmakingBehaviourOnNoCandidates::WaitUntilFull: Ignore the timeouts and continue // searching indefinitely. If your game doesn't work with partially filled or unbalanced // teams, this is the option to pick. Note however that "estimated time to completion" // will be inaccurate once the timeout has run out, since the players could be waiting // forever if no-one else comes online. // - EMatchmakingBehaviourOnNoCandidates::CompletePartiallyFilled: The match will be completed // with the remaining slots set to "Empty". // - EMatchmakingBehaviourOnNoCandidates::CompleteFillWithAI: The match will be completed // with the remaining slots set to "AI". This is currently the same behaviour as // CompletePartiallyFilled but we might spawn AI controllers for you in future if the the // matchmaking engine is also starting a listen server. RequestHostConfiguration->OnNoCandidates = EMatchmakingBehaviourOnNoCandidates::CompletePartiallyFilled; // When the matchmaker is configured to accept partially filled matches, this specifies the // minimum number of team members on each team that must be met for a partial fill to be accepted. // You can use this to guarantee that, even for partial fills, each team will still have a minimum // number of players on it. If the timeout is reached and one or more teams don't have the minimum // number of players, matchmaking will continue as if the timeout was longer. RequestHostConfiguration->MinimumTeamMemberCountForPartialFill = 0; // The timeout for matchmaking is calculated as: // baseline seconds + (remaining slots * per slot seconds) // Typically that means the more empty the match, the longer we're willing to wait for // more players to be online. // // If you set these settings too low, the matchmaker won't have enough time to find // players and you'll get a large number of partially filled matches. The defaults here // are usually good. RequestHostConfiguration->MinimumWaitSecondsBaseline = 60; RequestHostConfiguration->MinimumWaitSecondsPerEmptySlot = 5; // Specifies how we fill teams in matchmaking. Because of the way the algorithm works, you // have to choose between the following options when there aren't new solo players queuing // up into matchmaking: // - MaximizeTeamFill: You're more likely to get a completely full match, but if there // aren't new players you'll get an unbalanced result (like "4v1" for "4v4"). // - MaximizeBalance: You're more likely to get a balanced result (like "2v2" for "4v4"), // but if there aren't new players you'll get a less full match (only 4 players in // game instead of the 5 in the MaximizeTeamFill example). RequestHostConfiguration->BalanceMode = EMatchmakingBalanceMode::MaximizeTeamFill; // If this is set to something other than an empty string, enables skill-based matchmaking. ``` -------------------------------- ### Await a Deferred Task Source: https://docs.redpoint.games/docs/systems/async Demonstrates how to use `co_await` to wait for a deferred task to complete. This example waits for 1 second. ```cpp co_await Delay(1.0f); // Wait 1 second. ``` -------------------------------- ### Create Game Server Container Source: https://docs.redpoint.games/docs/dedis/testing_deployment Execute this command on the Kubernetes control node to create the game server container using the defined YAML file. ```bash kubectl create -f game-server.yaml ``` -------------------------------- ### Enable Gameplay Debugger Source: https://docs.redpoint.games/docs/tools/gameplay_debugger Type this command in the console to enable the Gameplay Debugger. In the editor, press ` to open the console after starting Play-In-Editor. ```console enablegdt ``` -------------------------------- ### Get Blocked Players Source: https://docs.redpoint.games/docs/systems/friends Retrieves a list of players that the local player has blocked. The map is populated with user info for each blocked player. ```cpp TAccountIdMap BlockedPlayers; auto Error = FriendSystem->GetBlockedPlayers( LocalUserId, BlockedPlayers); if (Error.WasSuccessful()) { // BlockedPlayers were populated with the list of blocked players. } ```