From ce4ebc57c9daa85a84351aa3501573ddb34f75ce Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 3 Dec 2021 18:35:12 -0800 Subject: [PATCH] Removes OnlineUtilityThread.h and UserServiceTypes.h from GridMate Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/Online/OnlineUtilityThread.h | 93 -------------- .../GridMate/Online/UserServiceTypes.h | 114 ------------------ .../GridMate/GridMate/gridmate_files.cmake | 2 - 3 files changed, 209 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h delete mode 100644 Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h diff --git a/Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h b/Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h deleted file mode 100644 index fd6ce8edb4..0000000000 --- a/Code/Framework/GridMate/GridMate/Online/OnlineUtilityThread.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 - * - */ -/** - * @file - * Provides EBus definitions for getting the utility thread tick - */ -#ifndef ONLINE_UTILITY_THREAD_H -#define ONLINE_UTILITY_THREAD_H - -#include -#include - -/** - * IMPORTANT NOTE TO SERVICES THAT USE THE UTILITY THREAD: - * The online service will start ticking the utility thread at construction - * time, but you have have to let it know when you need to be ticked. This - * is done two ways: first, send the NotifyOfNewWork event to the - * OnlineUtilityThreadCommandBus; second, return whether you still have - * work to do in OnlineUtilityThreadNotificationBus's event - * IsThereUtilityThreadWork. There, however, caveats the service - * must be aware of. - * - For those that derive from OnlineUtilityNotificationBus::Handler, - * do your BusConnect and BusDisConnect calls in your Init and Shutdown - * calls, instead of at construction and destruction time. You shouldn't - * be trying to use this utility thread outside of the time between these - * calls to your service anyway, so this shouldn't cause any amount of - * headache to conform to. - * - When you call BusConnect and BusDiscconect, the online manager may - * already be ticking that event - you may or may not receive your first - * and/or last tick events the way you might expect, so be careful about - * how you do you initialization and shutdown procedures. - * - Your Init call should do as little work as possible. Set yourself up for - * being ready to do actual initialization the first time you receive the - * OnUtilityThreadTick event instead of doing it all in Init and blocking - * the main thread. - * - Your Shutdown call should abort any pending operations, including ones - * it's already in the middle of. - * - In your OnUtilityThreadTick event response, make sure you haven't already - * been told to shut down. This is because the Shutdown call may have been - * made soon after the OnUtilityThreadTick event was fired, and other - * services took up a fair amount of time before the event got to you (with - * the Shutdown call to your service being made between event-firing and - * when the event reached you). - * - Be VERY careful about Shutdown getting called before you finish - * initializing in the utility thread (or even get a change to)! If you - * use this utility thread, be sure to test whether you can shutdown - * immediately after being initialized without breaking anything. - */ -namespace GridMate -{ - //------------------------------------------------------------------------- - // For ticking services that need a separate thread (outbound) - // - BusConnect to OnlineUtilityThreadNotificationBus::Handler to receive OnUtilityThreadTick - // - Return whether you have work left to do in IsThereWork - //------------------------------------------------------------------------- - class OnlineUtilityThreadNotifications - : public GridMateEBusTraits - { - public: - virtual ~OnlineUtilityThreadNotifications() {} - - // Called on each iteration of the online manager's utility thread loop - virtual void OnUtilityThreadTick() = 0; - - // Return whether there's work left to do here to keep the thread from doing busy waiting - virtual bool IsThereUtilityThreadWork() = 0; - }; - typedef AZ::EBus OnlineUtilityThreadNotificationBus; - //------------------------------------------------------------------------- - - //------------------------------------------------------------------------- - // For services that need a separate thread (inbound) - // - Fire the NotifyOfNewWork event to notify the thread that you have a new - // request you'd like to take care of - //------------------------------------------------------------------------- - class OnlineUtilityThreadCommands - : public GridMateEBusTraits - { - public: - virtual ~OnlineUtilityThreadCommands() {} - - virtual void NotifyOfNewWork() = 0; - }; - typedef AZ::EBus OnlineUtilityThreadCommandBus; - //------------------------------------------------------------------------- -} // namespace GridMate - -#endif // ONLINE_UTILITY_THREAD_H diff --git a/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h b/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h deleted file mode 100644 index c1753b3bb2..0000000000 --- a/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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 - * - */ -#ifndef GM_USER_SERVICE_TYPES_H -#define GM_USER_SERVICE_TYPES_H - -#include - -namespace GridMate -{ - /** - * User signin state - */ - enum OLSSigninState - { - OLS_SigninUnknown, - OLS_NotSignedIn, // There is no user signed in - OLS_SignedInOffline, // User signed in without online capabilities - OLS_SignedInOnline, // User signed in with online capabilities - OLS_SigningOut, // User is in the process of signing out - }; - - /** - * service network state - */ - enum OLSOnlineState - { - OLS_OnlineUnknown, - OLS_NoNetwork, // No NIC or network is unplugged - OLS_Offline, // No online access - OLS_Online, // Has online access - }; - - /** - * Supported privilege types - */ - enum OLSUserPrivilege - { - OLS_UserPrivilegeMP, - OLS_UserPrivilegeRecordDVR, - OLS_UserPrivilegePurchaseContent, - OLS_UserPrivilegeVoiceChat, - OLS_UserPrivilegeLeaderboards - }; - - /** - * Base class for platform dependent player id. - */ - struct PlayerId - { - PlayerId(ServiceType serviceType) - : m_serviceType(serviceType) {} - virtual ~PlayerId() {} - - // Compare 2 PlayerId IDs - virtual bool Compare(const PlayerId& userId) const = 0; - - // Returns a printable string representation of the id. - virtual gridmate_string ToString() const = 0; - - ServiceType GetType() const { return m_serviceType; } - - protected: - ServiceType m_serviceType; - }; - - /** - * Interface class for a local player/member. - */ - class ILocalMember - { - public: - virtual ~ILocalMember() {} - // SignIn - virtual OLSSigninState GetSigninState() const = 0; - - virtual const PlayerId* GetPlayerId() const = 0; - - // Pad number / info ??? - virtual unsigned int GetControllerIndex() const = 0; - virtual const char* GetName() const = 0; - virtual bool IsGuest() const = 0; - - // Friends List - virtual void RefreshFriends() = 0; - virtual bool IsFriendsListRefreshing() const = 0; - virtual unsigned int GetFriendsCount() const = 0; - virtual const char* GetFriendName(unsigned int idx) const = 0; - virtual const PlayerId* GetFriendPlayerId(unsigned int idx) const = 0; - virtual OLSSigninState GetFriendSigninState(unsigned int idx) const = 0; - virtual bool IsFriendPlayingTitle(unsigned int idx) const = 0; - virtual const char* GetFriendPresenceDetails(unsigned int idx) const = 0; - virtual bool IsFriendsWith(const PlayerId* playerId) const = 0; - }; - - /** - * Generic invite structure - * pPlatformSpecific contains the native structure used by each platform - */ - struct InviteInfo - { - InviteInfo() - : m_localMember(nullptr) {} - - ILocalMember* m_localMember; - }; -} // namespace GridMate - -#endif // GM_USER_SERVICE_TYPES_H -#pragma once diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index e38a238baf..758b217112 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -39,8 +39,6 @@ set(FILES Containers/unordered_map.h Containers/unordered_set.h Containers/vector.h - Online/OnlineUtilityThread.h - Online/UserServiceTypes.h Replica/BasicHostChunkDescriptor.h Replica/DeltaCompressedDataSet.h Replica/DataSet.cpp