Skip to content

fix: fixing issue with iOS black screen where message queue constructor would get stripped out [MTT-2663] #592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Assets/BossRoom/Scripts/Shared/ApplicationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ private void Awake()
scope.BindAsSingle<LocalLobby>();

//this message channel is essential and persists for the lifetime of the lobby and relay services
scope.BindMessageChannel<UnityServiceErrorMessage>();
scope.BindMessageChannelInstance<UnityServiceErrorMessage>();

//this message channel is essential and persists for the lifetime of the lobby and relay services
scope.BindMessageChannel<ConnectStatus>();
scope.BindMessageChannelInstance<ConnectStatus>();

//buffered message channels hold the latest received message in buffer and pass to any new subscribers
scope.BindBufferedMessageChannel<LobbyListFetchedMessage>();
scope.BindBufferedMessageChannelInstance<LobbyListFetchedMessage>();

//all the lobby service stuff, bound here so that it persists through scene loads
scope.BindAsSingle<AuthenticationServiceFacade>(); //a manager entity that allows us to do anonymous authentication with unity services
Expand Down
12 changes: 12 additions & 0 deletions Assets/BossRoom/Scripts/Shared/Infrastructure/DIScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ public void BindInstanceAsSingle<TImplementation, TInterface>(TImplementation in
BindInstanceAsSingle(instance);
}

public void BindInstanceAsSingle<TImplementation, TInterface, TInterface2, TInterface3>(TImplementation instance)
where TImplementation : class, TInterface, TInterface2, TInterface3
where TInterface : class
where TInterface2 : class
where TInterface3 : class
{
BindInstanceAsSingle<TInterface>(instance);
BindInstanceAsSingle<TInterface2>(instance);
BindInstanceAsSingle<TInterface3>(instance);
BindInstanceAsSingle(instance);
}

void BindInstanceToType(object instance, Type type)
{
m_TypesToInstances[type] = instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ namespace Unity.Multiplayer.Samples.BossRoom.Shared.Infrastructure
{
public static class MessageChannelDIExtensions
{
public static void BindMessageChannel<TMessage>(this DIScope scope)
public static void BindMessageChannelInstance<TMessage>(this DIScope scope)
{
scope.BindAsSingle< MessageChannel<TMessage>, IPublisher<TMessage>, ISubscriber<TMessage>, IMessageChannel<TMessage>>();
scope.BindInstanceAsSingle<MessageChannel<TMessage>, IPublisher<TMessage>, ISubscriber<TMessage>, IMessageChannel<TMessage>>(new MessageChannel<TMessage>());
}

public static void BindBufferedMessageChannel<TMessage>(this DIScope scope)
public static void BindBufferedMessageChannelInstance<TMessage>(this DIScope scope)
{
scope.BindAsSingle< BufferedMessageChannel<TMessage>, IPublisher<TMessage>, ISubscriber<TMessage>, IBufferedMessageChannel<TMessage>>();
scope.BindInstanceAsSingle<BufferedMessageChannel<TMessage>, IPublisher<TMessage>, ISubscriber<TMessage>, IBufferedMessageChannel<TMessage>>(new BufferedMessageChannel<TMessage>());
}
}
}