mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-05 05:07:48 +00:00
GEEKING
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
//// PARTICULAR PURPOSE.
|
||||
////
|
||||
//// Copyright (c) Microsoft Corporation. All rights reserved
|
||||
#include "pch.h"
|
||||
#include "RemoteAudioDevice.h"
|
||||
|
||||
#if TV_API
|
||||
|
||||
namespace Microsoft {
|
||||
namespace Xbox {
|
||||
namespace GameChat {
|
||||
|
||||
|
||||
RemoteAudioDeviceInfo::RemoteAudioDeviceInfo(
|
||||
_In_ Windows::Xbox::System::AudioDeviceCategory deviceCategory,
|
||||
_In_ Windows::Xbox::System::AudioDeviceType deviceType,
|
||||
_In_ Platform::String^ id,
|
||||
_In_ bool isMicrophoneMuted,
|
||||
_In_ Windows::Xbox::System::AudioDeviceSharing sharing
|
||||
) :
|
||||
m_deviceCategory( deviceCategory ),
|
||||
m_deviceType( deviceType ),
|
||||
m_id( id ),
|
||||
m_isMicrophoneMuted( isMicrophoneMuted ),
|
||||
m_sharing( sharing )
|
||||
{
|
||||
}
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,79 @@
|
||||
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
//// PARTICULAR PURPOSE.
|
||||
////
|
||||
//// Copyright (c) Microsoft Corporation. All rights reserved
|
||||
#pragma once
|
||||
|
||||
#if TV_API
|
||||
|
||||
namespace Microsoft {
|
||||
namespace Xbox {
|
||||
namespace GameChat {
|
||||
|
||||
namespace Wxs = Windows::Xbox::System;
|
||||
|
||||
ref class RemoteAudioDeviceInfo sealed : public Wxs::IAudioDeviceInfo
|
||||
{
|
||||
public:
|
||||
RemoteAudioDeviceInfo(
|
||||
_In_ Windows::Xbox::System::AudioDeviceCategory deviceCategory,
|
||||
_In_ Windows::Xbox::System::AudioDeviceType deviceType,
|
||||
_In_ Platform::String^ id,
|
||||
_In_ bool isMicrophoneMuted,
|
||||
_In_ Windows::Xbox::System::AudioDeviceSharing sharing
|
||||
);
|
||||
|
||||
virtual property Windows::Xbox::System::AudioDeviceCategory DeviceCategory
|
||||
{
|
||||
Windows::Xbox::System::AudioDeviceCategory get()
|
||||
{
|
||||
return m_deviceCategory;
|
||||
}
|
||||
}
|
||||
|
||||
virtual property Windows::Xbox::System::AudioDeviceType DeviceType
|
||||
{
|
||||
Windows::Xbox::System::AudioDeviceType get()
|
||||
{
|
||||
return m_deviceType;
|
||||
}
|
||||
}
|
||||
|
||||
virtual property Platform::String^ Id
|
||||
{
|
||||
Platform::String^ get()
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
}
|
||||
|
||||
virtual property bool IsMicrophoneMuted
|
||||
{
|
||||
bool get()
|
||||
{
|
||||
return m_isMicrophoneMuted;
|
||||
}
|
||||
}
|
||||
|
||||
virtual property Windows::Xbox::System::AudioDeviceSharing Sharing
|
||||
{
|
||||
Windows::Xbox::System::AudioDeviceSharing get()
|
||||
{
|
||||
return m_sharing;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
Windows::Xbox::System::AudioDeviceCategory m_deviceCategory;
|
||||
Windows::Xbox::System::AudioDeviceType m_deviceType;
|
||||
Platform::String^ m_id;
|
||||
bool m_isMicrophoneMuted;
|
||||
Windows::Xbox::System::AudioDeviceSharing m_sharing;
|
||||
};
|
||||
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,77 @@
|
||||
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
//// PARTICULAR PURPOSE.
|
||||
////
|
||||
//// Copyright (c) Microsoft Corporation. All rights reserved
|
||||
#include "pch.h"
|
||||
#include "RemoteChatUser.h"
|
||||
|
||||
#if TV_API
|
||||
|
||||
using namespace Concurrency;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
|
||||
namespace Microsoft {
|
||||
namespace Xbox {
|
||||
namespace GameChat {
|
||||
|
||||
const UINT REMOTE_USER_ID_SEED = 0x01001000;
|
||||
|
||||
RemoteChatUser::RemoteChatUser(
|
||||
_In_ Platform::String^ xuid,
|
||||
_In_ bool isGuest,
|
||||
_In_ Wfc::IVectorView< Wxs::IAudioDeviceInfo^ >^ audioDevices
|
||||
) :
|
||||
m_isGuest(isGuest)
|
||||
{
|
||||
Initialize( xuid, audioDevices );
|
||||
}
|
||||
|
||||
RemoteChatUser::RemoteChatUser() :
|
||||
m_xuid( nullptr ),
|
||||
m_isGuest(false)
|
||||
{
|
||||
}
|
||||
|
||||
void RemoteChatUser::Initialize(
|
||||
_In_ Platform::String^ xuid,
|
||||
_In_ Wfc::IVectorView< Wxs::IAudioDeviceInfo^ >^ audioDevices)
|
||||
{
|
||||
m_xuid = xuid;
|
||||
|
||||
for( unsigned int i = 0; i < audioDevices->Size; ++i )
|
||||
{
|
||||
AddAudioDevice( audioDevices->GetAt( i ) );
|
||||
}
|
||||
|
||||
static UINT remoteIdTracker = REMOTE_USER_ID_SEED;
|
||||
m_id = InterlockedIncrement(&remoteIdTracker);
|
||||
}
|
||||
|
||||
void RemoteChatUser::AddAudioDevice( _In_ Wxs::IAudioDeviceInfo^ audioDevice )
|
||||
{
|
||||
m_audioDevices.Append( audioDevice );
|
||||
}
|
||||
|
||||
void RemoteChatUser::ClearAudioDevices()
|
||||
{
|
||||
m_audioDevices.Clear();
|
||||
}
|
||||
|
||||
void RemoteChatUser::ResetAudioDevices(
|
||||
_In_ Wfc::IVectorView< Wxs::IAudioDeviceInfo^ >^ audioDevices
|
||||
)
|
||||
{
|
||||
m_audioDevices.Clear();
|
||||
|
||||
for (auto device : audioDevices)
|
||||
{
|
||||
m_audioDevices.Append( device );
|
||||
}
|
||||
}
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,195 @@
|
||||
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
//// PARTICULAR PURPOSE.
|
||||
////
|
||||
//// Copyright (c) Microsoft Corporation. All rights reserved
|
||||
#pragma once
|
||||
|
||||
#if TV_API
|
||||
|
||||
namespace Wfc = Windows::Foundation::Collections;
|
||||
namespace Wxs = Windows::Xbox::System;
|
||||
namespace Wxi = Windows::Xbox::Input;
|
||||
|
||||
namespace Microsoft {
|
||||
namespace Xbox {
|
||||
namespace GameChat {
|
||||
|
||||
ref class RemoteChatUser sealed : public Wxs::IUser
|
||||
{
|
||||
public:
|
||||
RemoteChatUser(
|
||||
_In_ Platform::String^ xuid,
|
||||
_In_ bool isGuest,
|
||||
_In_ Wfc::IVectorView< Wxs::IAudioDeviceInfo^ >^ audioDevices
|
||||
);
|
||||
|
||||
// IUser interface implementation, these are not implemented
|
||||
virtual Windows::Foundation::IAsyncOperation< Wxs::GetTokenAndSignatureResult^ >^ GetTokenAndSignatureAsync(
|
||||
_In_ Platform::String^ xuid,
|
||||
_In_ Platform::String^ url,
|
||||
_In_ Platform::String^ headers
|
||||
)
|
||||
{
|
||||
throw E_NOTIMPL;
|
||||
}
|
||||
|
||||
virtual Windows::Foundation::IAsyncOperation< Wxs::GetTokenAndSignatureResult^ >^ GetTokenAndSignatureAsync(
|
||||
_In_ Platform::String^ xuid,
|
||||
_In_ Platform::String^ url,
|
||||
_In_ Platform::String^ headers,
|
||||
_In_ const Platform::Array<unsigned char>^ body
|
||||
)
|
||||
{
|
||||
throw E_NOTIMPL;
|
||||
}
|
||||
|
||||
virtual Windows::Foundation::IAsyncOperation< Wxs::GetTokenAndSignatureResult^ >^ GetTokenAndSignatureAsync(
|
||||
_In_ Platform::String^ m_xuid,
|
||||
_In_ Platform::String^ url,
|
||||
_In_ Platform::String^ headers,
|
||||
_In_ Platform::String^ body
|
||||
)
|
||||
{
|
||||
throw E_NOTIMPL;
|
||||
}
|
||||
|
||||
// These properties are not used by the Chat libraries and are left unimplemented
|
||||
virtual property Wfc::IVectorView< Wxs::IAudioDeviceInfo^ >^ AudioDevices
|
||||
{
|
||||
Wfc::IVectorView< Wxs::IAudioDeviceInfo^ >^ get()
|
||||
{
|
||||
return m_audioDevices.GetView();
|
||||
}
|
||||
}
|
||||
|
||||
virtual property Wfc::IVectorView< Wxi::IController^ >^ Controllers
|
||||
{
|
||||
Wfc::IVectorView< Wxi::IController^ >^ get()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
virtual property Wxs::UserDisplayInfo^ DisplayInfo
|
||||
{
|
||||
Wxs::UserDisplayInfo^ get()
|
||||
{
|
||||
throw E_NOTIMPL;
|
||||
}
|
||||
}
|
||||
|
||||
virtual property Wfc::IVectorView< UINT>^ Privileges
|
||||
{
|
||||
Wfc::IVectorView< UINT >^ get()
|
||||
{
|
||||
throw E_NOTIMPL;
|
||||
}
|
||||
}
|
||||
|
||||
virtual property Platform::String^ XboxUserHash
|
||||
{
|
||||
Platform::String^ get()
|
||||
{
|
||||
throw E_NOTIMPL;
|
||||
}
|
||||
}
|
||||
|
||||
virtual property bool IsAdult
|
||||
{
|
||||
bool get()
|
||||
{
|
||||
throw E_NOTIMPL;
|
||||
}
|
||||
}
|
||||
|
||||
virtual property Wxs::User^ Sponsor
|
||||
{
|
||||
Wxs::User^ get()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
virtual property UINT Id
|
||||
{
|
||||
UINT get()
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
}
|
||||
|
||||
// This isn't currently used, but may be used in the future
|
||||
virtual property bool IsGuest
|
||||
{
|
||||
bool get()
|
||||
{
|
||||
return m_isGuest;
|
||||
}
|
||||
}
|
||||
|
||||
// Remote users are never signed in on our console
|
||||
virtual property bool IsSignedIn
|
||||
{
|
||||
bool get()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// By definition, these users are always remote
|
||||
virtual property Wxs::UserLocation Location
|
||||
{
|
||||
Wxs::UserLocation get()
|
||||
{
|
||||
return Wxs::UserLocation::Remote;
|
||||
}
|
||||
}
|
||||
|
||||
// XUID's are always important
|
||||
virtual property Platform::String^ XboxUserId
|
||||
{
|
||||
Platform::String^ get()
|
||||
{
|
||||
return m_xuid;
|
||||
}
|
||||
}
|
||||
|
||||
virtual property Platform::String^ Gamertag
|
||||
{
|
||||
Platform::String^ get()
|
||||
{
|
||||
return m_gamertag;
|
||||
}
|
||||
}
|
||||
|
||||
void AddAudioDevice(
|
||||
_In_ Wxs::IAudioDeviceInfo^ audioDevice
|
||||
);
|
||||
|
||||
void ClearAudioDevices();
|
||||
|
||||
void ResetAudioDevices(
|
||||
_In_ Wfc::IVectorView< Wxs::IAudioDeviceInfo^ >^ audioDevices
|
||||
);
|
||||
|
||||
private:
|
||||
RemoteChatUser();
|
||||
|
||||
void Initialize(
|
||||
_In_ Platform::String^ xuid,
|
||||
_In_ Wfc::IVectorView< Wxs::IAudioDeviceInfo^ >^ audioDevices
|
||||
);
|
||||
|
||||
private:
|
||||
Platform::Collections::Vector< Wxs::IAudioDeviceInfo^ > m_audioDevices;
|
||||
Platform::String^ m_xuid;
|
||||
UINT m_id;
|
||||
bool m_isGuest;
|
||||
Platform::String^ m_gamertag;
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user