diff --git a/README.md b/README.md index 1f2430f66..b756b5314 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/samples/ChatApp/ChatApp.Unity/Assets/Scripts/InitialSettings.cs b/samples/ChatApp/ChatApp.Unity/Assets/Scripts/InitialSettings.cs index a43526bbf..b28c00032 100644 --- a/samples/ChatApp/ChatApp.Unity/Assets/Scripts/InitialSettings.cs +++ b/samples/ChatApp/ChatApp.Unity/Assets/Scripts/InitialSettings.cs @@ -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; @@ -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() @@ -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[] { diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/ChannelExtensions.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/ChannelExtensions.cs index edb4e0e71..cc3c94601 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/ChannelExtensions.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/ChannelExtensions.cs @@ -1,4 +1,4 @@ -#if USE_GRPC_CCORE +#if MAGICONION_USE_GRPC_CCORE using Grpc.Core; using System; using System.Collections.Generic; diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/DefaultGrpcChannelProvider.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/DefaultGrpcChannelProvider.cs index 8a87ffa67..525c31905 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/DefaultGrpcChannelProvider.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/DefaultGrpcChannelProvider.cs @@ -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; @@ -12,7 +12,7 @@ namespace MagicOnion.Unity /// /// Provide and manage gRPC channels for MagicOnion. /// -#if USE_GRPC_CCORE +#if MAGICONION_USE_GRPC_CCORE public class DefaultGrpcChannelProvider : GrpcCCoreGrpcChannelProvider { public DefaultGrpcChannelProvider() : base() { } diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/Editor/GrpcChannelProviderMonitor.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/Editor/GrpcChannelProviderMonitor.cs index 57179a3ce..8bb7a7924 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/Editor/GrpcChannelProviderMonitor.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/Editor/GrpcChannelProviderMonitor.cs @@ -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; @@ -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); diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcCCoreGrpcChannelProvider.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcCCoreGrpcChannelProvider.cs index 1ef749fc4..b57038c8a 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcCCoreGrpcChannelProvider.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcCCoreGrpcChannelProvider.cs @@ -1,4 +1,4 @@ -#if USE_GRPC_CCORE +#if MAGICONION_USE_GRPC_CCORE using System; using System.Collections.Generic; using Grpc.Core; diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelProviderExtensions.CCore.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelProviderExtensions.CCore.cs index 43da9b838..c4eb7d86b 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelProviderExtensions.CCore.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelProviderExtensions.CCore.cs @@ -1,4 +1,4 @@ -#if USE_GRPC_CCORE +#if MAGICONION_USE_GRPC_CCORE using System.Collections.Generic; using Grpc.Core; diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelProviderExtensions.GrpcNet.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelProviderExtensions.GrpcNet.cs index 7597409a7..fa7695b91 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelProviderExtensions.GrpcNet.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelProviderExtensions.GrpcNet.cs @@ -1,4 +1,4 @@ -#if !USE_GRPC_CCORE +#if !MAGICONION_USE_GRPC_CCORE using Grpc.Net.Client; namespace MagicOnion.Unity diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelx.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelx.cs index 089f8098f..6f18e28b4 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelx.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcChannelx.cs @@ -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; @@ -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); diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcNetClientGrpcChannelProvider.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcNetClientGrpcChannelProvider.cs index 2def88797..b5a1a47db 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcNetClientGrpcChannelProvider.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Unity/GrpcNetClientGrpcChannelProvider.cs @@ -1,4 +1,4 @@ -#if !USE_GRPC_CCORE +#if !MAGICONION_USE_GRPC_CCORE using System; using System.Collections.Generic; using Grpc.Net.Client;