Skip to content
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

Use MAGICONION_ prefix for symbol #713

Merged
merged 1 commit into from
Oct 31, 2023
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ There are two ways to use the gRPC library in Unity:

Since the maintenance of the C-core based library has ended in the gRPC project, we recommend using [YetAnotherHttpHandler](https://github.com/Cysharp/YetAnotherHttpHandler) . Please refer to the [README of YetAnotherHttpHandler](https://github.com/Cysharp/YetAnotherHttpHandler) for installation instructions.

If you are using the C-core gRPC library, please define `USE_GRPC_CCORE` symbol in "Scripting Define Symbols".
If you are using the C-core gRPC library, please define `MAGICONION_USE_GRPC_CCORE` symbol in "Scripting Define Symbols".

### Install MessagePack for C#
MessagePack for C# is not included in MagicOnion package. You need to download and install separately.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.IO;
using MagicOnion.Client;
#if USE_GRPC_CCORE
#if MAGICONION_USE_GRPC_CCORE
using Grpc.Core;
#else
using Grpc.Net.Client;
Expand Down Expand Up @@ -35,7 +35,7 @@ static void RegisterResolvers()
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
public static void OnRuntimeInitialize()
{
#if !USE_GRPC_CCORE
#if !MAGICONION_USE_GRPC_CCORE
// Use Grpc.Net.Client instead of C-core gRPC library.
GrpcChannelProviderHost.Initialize(
new GrpcNetClientGrpcChannelProvider(() => new GrpcChannelOptions()
Expand All @@ -46,7 +46,7 @@ public static void OnRuntimeInitialize()
}
}));
#endif
#if USE_GRPC_CCORE
#if MAGICONION_USE_GRPC_CCORE
// Initialize gRPC channel provider when the application is loaded.
GrpcChannelProviderHost.Initialize(new DefaultGrpcChannelProvider(new GrpcCCoreChannelOptions(new[]
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if USE_GRPC_CCORE
#if MAGICONION_USE_GRPC_CCORE
using Grpc.Core;
using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
#if USE_GRPC_CCORE
#if MAGICONION_USE_GRPC_CCORE
using Grpc.Core;
#else
using Grpc.Net.Client;
Expand All @@ -12,7 +12,7 @@ namespace MagicOnion.Unity
/// <summary>
/// Provide and manage gRPC channels for MagicOnion.
/// </summary>
#if USE_GRPC_CCORE
#if MAGICONION_USE_GRPC_CCORE
public class DefaultGrpcChannelProvider : GrpcCCoreGrpcChannelProvider
{
public DefaultGrpcChannelProvider() : base() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#if MAGICONION_UNITASK_SUPPORT
using Cysharp.Threading.Tasks;
#endif
#if USE_GRPC_CCORE
#if MAGICONION_USE_GRPC_CCORE
using Channel = Grpc.Core.Channel;
#else
using Grpc.Net.Client;
Expand Down Expand Up @@ -73,7 +73,7 @@ public void DrawChannels()
{
using (new EditorGUILayout.HorizontalScope())
{
#if USE_GRPC_CCORE
#if MAGICONION_USE_GRPC_CCORE
if (diagInfo.UnderlyingChannel is Channel grpcCCoreChannel)
{
EditorGUILayout.LabelField($"Channel: {channel.Id} ({channel.Target}; State={grpcCCoreChannel.State})", EditorStyles.boldLabel);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if USE_GRPC_CCORE
#if MAGICONION_USE_GRPC_CCORE
using System;
using System.Collections.Generic;
using Grpc.Core;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if USE_GRPC_CCORE
#if MAGICONION_USE_GRPC_CCORE
using System.Collections.Generic;
using Grpc.Core;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !USE_GRPC_CCORE
#if !MAGICONION_USE_GRPC_CCORE
using Grpc.Net.Client;

namespace MagicOnion.Unity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Cysharp.Threading.Tasks;
#endif
using Grpc.Core;
#if USE_GRPC_CCORE
#if MAGICONION_USE_GRPC_CCORE
using Channel = Grpc.Core.Channel;
#else
using Grpc.Net.Client;
Expand Down Expand Up @@ -152,7 +152,7 @@ public async Task ConnectAsync(DateTime? deadline = null)
#endif
{
ThrowIfDisposed();
#if USE_GRPC_CCORE
#if MAGICONION_USE_GRPC_CCORE
if (_channel is Channel grpcCChannel)
{
await grpcCChannel.ConnectAsync(deadline);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !USE_GRPC_CCORE
#if !MAGICONION_USE_GRPC_CCORE
using System;
using System.Collections.Generic;
using Grpc.Net.Client;
Expand Down
Loading