Giter Site home page Giter Site logo

playfab / localmultiplayeragent Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 5.0 15 KB

An executable that mimics PlayFab Multiplayer (Thunderhead) operations to aid in local debugging.

Home Page: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/thunderhead

localmultiplayeragent's Introduction

localmultiplayeragent's People

Contributors

andhesky avatar dgkanatsios avatar nishsinghal20 avatar ravarnamsft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

localmultiplayeragent's Issues

"AssetDetails" required even for Linux containers on Windows

Running Linux containers on Windows does not work if "AssetDetails" is not provided, even though it is not needed for deployment.

Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'source') at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable1 source, Func2 selector) at Microsoft.Azure.Gaming.MockVmAgent.Config.MultiplayerSettings.ToSessionHostsStartInfo() in D:\Repos\PlayFab\Thunderhead\src\VmAgent\MockVmAgent\Config\MultiplayerSettings.cs:lin e 49 at Microsoft.Azure.Gaming.MockVmAgent.Program.Main(String[] args) in D:\Repos\PlayFab\Thunderhead\src\VmAgent\MockVmAgent\Program.cs:line 68 at Microsoft.Azure.Gaming.MockVmAgent.Program.<Main>(String[] args)

These are the settings used MultiplayerSettingsWorking.json.txt

At the moment I'm using the workaround by simply pointing it to a not needed .zip file, see MultiplayerSettingsNotWorking.json.txt

Does not work with Java Jars

My server is written in Java and I want to launch it like so:
"StartGameCommand": "C:/Assets/jre/bin/java.exe -jar C:/Assets/gameserver.jar",

However, the second C:/Assets/ does not get replaced by the proper folder and as such, does not launch the jar file.

Cannot start agent a second time with containers.

The first time I ran the agent with a container it worked correctly and went through the motions. I uploaded to PlayFab but it said my build was unhealthy, so I went back to try it again. Now this shows up:

info: MockPlayFabVmAgent[0]
Event: ContainerStats. Properties: NULL, Metrics: {"containerCreationTimeMs":101.0}
info: MockPlayFabVmAgent[0]
Created a container with session host id: d21d16cca1a0a886c41473ef4466d7e18fc29faf0d409814ea8cacc4770767b9

Unhandled Exception: System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate)
at Microsoft.Azure.Gaming.VmAgent.ContainerEngines.DockerContainerEngine.GetVmAgentIpAddress() in D:\t2\src\VmAgent\VmAgent.Common\Interfaces\DockerContainerEngine.cs:line 108
at Microsoft.Azure.Gaming.VmAgent.ContainerEngines.DockerContainerEngine.CreateAndStart(Int32 instanceNumber, GameResourceDetails gameResourceDetails, ISessionHostManager sessionHostManager) in D:\t2\src\VmAgent\VmAgent.Common\Interfaces\DockerContainerEngine.cs:line 351
at Microsoft.Azure.Gaming.MockVmAgent.MultiplayerServerManager.CreateAndStartContainerWaitForExit(SessionHostsStartInfo startParameters) in D:\t2\src\VmAgent\MockVmAgent\MultiplayerServerManager.cs:line 49
at Microsoft.Azure.Gaming.MockVmAgent.Program.Main(String[] args) in D:\t2\src\VmAgent\MockVmAgent\Program.cs:line 69

I made sure to run the two commands at the end of the guide to end all containers.

"Source Code" link to download source, does not provide source code

Aloha PlayFab team,

My team and I were running the local multiplayer agent executable, and tried changing the port via MultiplayerSettings.json. Upon rerunning the mock agent, the port was still fixed to 3600. So we decided to try and download the source code version of it, to see if we could change this. When downloading both the .zip and .tar (latest and all archives) with the link called "Source Code", it only includes a readme file.

Is this intentional or was the source code accidentally left out?

DNS issues in Windows Container

Hello!

We're having trouble running our game server in the Windows Docker Container. Specifically, our server can't connect to playfabapi

LogHttp: Warning: 000002B73D04E010: invalid HTTP response code received. URL: https://XXXXX.playfabapi.com/Authentication/GetEntityToken?sdk=UE4MKPL-1.48.201014, HTTP code: 0, content length: 0, actual payload size: 0

LogHttp: Warning: 000002B73D04E010: request failed, libcurl error: 6 (Couldn't resolve host name)

LogHttp: Warning: 000002B73D04E010: libcurl info message cache 0 (Could not resolve host: XXXXX.playfabapi.com)

LogHttp: Warning: 000002B73D04E010: libcurl info message cache 1 (Closing connection 0)

LogAsyncServerAuthenticateRequest: Error: Unable to register the server with PlayFab:

If I jump into the container and try to ping playfab, I also get a hostname not found error.

By setting the DNS manually I can get it to find the host

PS C:\Assets> nsLookup XXXXX.playfabapi.com
Server:  UnKnown
Address:  172.19.0.11

*** UnKnown can't find XXXXX.playfabapi.com: Server failed
PS C:\Assets> Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 8.8.8.8
PS C:\Assets> nsLookup XXXXX.playfabapi.com
Server:  dns.google
Address:  8.8.8.8

Non-authoritative answer:
Name:    master-mainserver-1943019976.us-west-2.elb.amazonaws.com
Addresses:  <A bunch of addresses>
Aliases:  XXXXX.playfabapi.com
          master.playfabapi.com

Since this doesn't persist across runs of the container, I'm not sure how to proceed.

Question how do you set up the zip folder for Unreal 4 Projects?

Hello,

I am confused on
"LocalFilePath"" is the path to the zip file i get that
"MountPath": "C:\Assets" (For unreal project there are multiple folders nested in side i am not sure what do I do with this one?
"StartGameCommand": "C:\Assets\" Same question.

MockVmAgent instantly closes

Hello! I'm not sure what I'm doing wrong. I'm following this guide.

I've extracted the files to a folder, set up the output folder, and checked RunContainer is false. I start a powershell window in the folder and Start-Process MockVmAgent.exe, but it just opens and closes. In the settings I'm basically just setting the output folder, so I don't know what I could be doing wrong.

MockVMAgent Cannot find file

Hello!

So I download mockvmagent and setup the directories as such:
"MountPath": "C:\\test", "LocalFilePath": "C:\\test\\Build10.zip" "StartGameCommand": "C:\\test\\ExtantServer.exe" "RunContainer": false,

When running the application I get this error in the cmd:
Creating the configuration file at C:\test\PlayFabVmAgentOutput\2020-07-15T18-00-15\Config\SH0\gsdkConfig.json System.ComponentModel.Win32Exception (2): The system cannot find the file specified. at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at Microsoft.Azure.Gaming.VmAgent.Common.Interfaces.ProcessWrapper.Start(ProcessStartInfo startInfo) in E:\MPBuildHost14-01\_work\98\s\src\VmAgent\VmAgent.Common\Interfaces\ProcessWrapper.cs:line 32 at Microsoft.Azure.Gaming.VmAgent.Common.Interfaces.ProcessRunner.CreateAndStart(Int32 instanceNumber, GameResourceDetails gameResourceDetails, ISessionHostManager sessionHostManager) in E:\MPBuildHost14-01\_work\98\s\src\VmAgent\VmAgent.Common\Interfaces\ProcessRunner.cs:line 60 at Microsoft.Azure.Gaming.MockVmAgent.MultiplayerServerManager.CreateAndStartContainerWaitForExit(SessionHostsStartInfo startParameters) in E:\MPBuildHost14-01\_work\98\s\src\VmAgent\MockVmAgent\MultiplayerServerManager.cs:line 66 at Microsoft.Azure.Gaming.MockVmAgent.Program.Main(String[] args) in E:\MPBuildHost14-01\_work\98\s\src\VmAgent\MockVmAgent\Program.cs:line 73 at Microsoft.Azure.Gaming.MockVmAgent.Program.<Main>(String[]args)``

What's wrong? Thanks!

Docker network 'playfab' not automatically created

Running the MockAgent.exe with -lcow and a Linux container configuration requires the docker network 'playfab' existing, otherwise the following exception will be thrown:

Unhandled exception. Docker.DotNet.DockerContainerNotFoundException: Docker API responded with status code=NotFound, response={"message":"network playfab not found"}

It would be nice if either this is explicitly documented somewhere or if the network gets created automatically

Inconsistent gsdkConfig.json between production and LocalMultiplayerAgent

I'm using LocalMultiplayerAgent for Windows to test my game server before pushing builds into PlayFab production environment and I've found that the gsdkConfig.json isn't produced as I expect.

My MultiplayerSettings.json contains the following at the top level:

    "PortMappingsList": [
        [
            {
                "NodePort": 56100,
                "GamePort": {
                    "Name": "game_port",
                    "Number": 7777,
                    "Protocol": "UDP"
                }
            }
        ]
    ],

When "RunContainer": false, LMA writes out a configuration similar to:

{
  "heartbeatEndpoint": "127.0.0.1:56001",
  "sessionHostId": "xxx",
  "vmId": "xxx",
  "logFolder": "C:\\GameLogs",
  "certificateFolder": "C:\\GameCertificates",
  "sharedContentFolder": "C:\\GameSharedContent",
  "gamePorts": {
    "game_port": "56100"
  },
  "publicIpV4Address": "127.0.0.1",
  "gameServerConnectionInfo": {
    "publicIpV4Adress": "127.0.0.1",
    "gamePortsConfiguration": [
      {
        "name": "game_port",
        "serverListeningPort": 56100
      }
    ]
  },
  "fullyQualifiedDomainName": "localhost"
}

Here its using the public ports in the serverListeningPort field and clientConnectionPort is missing from the configuration completely. This causes GSDK from C++ to report 0 for the client port.

But when "RunContainer": true, LMA writes out a configuration similar to:

{
  "heartbeatEndpoint": "1.1.1.1:56001",
  "sessionHostId": "xxx",
  "vmId": "xxx",
  "logFolder": "C:\\GameLogs\\",
  "certificateFolder": "C:\\GameCertificates",
  "sharedContentFolder": "C:\\GameSharedContent",
  "gamePorts": {
    "game_port": "7777"
  },
  "publicIpV4Address": "127.0.0.1",
  "gameServerConnectionInfo": {
    "publicIpV4Adress": "127.0.0.1",
    "gamePortsConfiguration": [
      {
        "name": "game_port",
        "serverListeningPort": 7777
      }
    ]
  },
  "fullyQualifiedDomainName": "localhost"
}

The serverListeningPort is as I expect here but clientConnectionPort and still missing.

I'm getting configuration that I expect in production that looks something like:

{
  "heartbeatEndpoint": "1.1.1.1:56001",
  "sessionHostId": "xxx",
  "vmId": "xxx",
  "logFolder": "C:\\GameLogs\\",
  "certificateFolder": "C:\\GameCertificates",
  "sharedContentFolder": "C:\\GameSharedContent",
  "buildMetadata": {},
  "gamePorts": {
    "game_port": "7777"
  },
  "publicIpV4Address": "2.2.2.2",
  "gameServerConnectionInfo": {
    "publicIpV4Adress": "2.2.2.2",
    "gamePortsConfiguration": [
      {
        "name": "game_port",
        "serverListeningPort": 7777,
        "clientConnectionPort": 30000
      }
    ]
  },
  "fullyQualifiedDomainName": "xxx-azurebatch-cloudservice.westus.cloudapp.azure.com"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.