LYN-7655 Fix Race Condition When Launching at Editor-Server (#4946)

* Fix a race condition where the editor tries to connect to the editor-server before the editor-server is ready (originally discovered on lower-spec Jenkin machines).  Change editor-server so that editor waits to receive a EditorServerReadyForInit before trying to send all the level data.

* The editor might not be the connector so make sure to connect to the actual MP simulation even if the editor isn't the editor-server connect (if editorsv_launch=true then the editor-server will connect to the editor)

* Adding warnings if MPEditorConnection cannot find certain cvars

Signed-off-by: Gene Walters <genewalt@amazon.com>
This commit is contained in:
Gene Walters
2021-10-27 10:38:09 -07:00
committed by GitHub
parent c5c043ecc5
commit e6650f1ff4
7 changed files with 205 additions and 100 deletions
@@ -0,0 +1,27 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
namespace Multiplayer
{
class MultiplayerEditorServerRequests : public AZ::EBusTraits
{
public:
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
//! Sends a packet that initializes a local server launched from the editor.
//! The editor will package the data required for loading the current editor level on the editor-server; data includes entities and asset data.
//! @param connection The connection to the editor-server
virtual void SendEditorServerLevelDataPacket(AzNetworking::IConnection* connection) = 0;
};
using MultiplayerEditorServerRequestBus = AZ::EBus<MultiplayerEditorServerRequests>;
} // namespace Multiplayer