Initial Client/Server Communication
#1 Followed the MagicOnion quickstart guide, borrowing code from the chat sample app to get something working
This commit is contained in:
parent
52b0d4d8ff
commit
a0c8dbee72
493 changed files with 57790 additions and 3 deletions
25
Assets/Scripts/ServerShared/Hubs/IChatHub.cs
Normal file
25
Assets/Scripts/ServerShared/Hubs/IChatHub.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using ChatApp.Shared.MessagePackObjects;
|
||||
using MagicOnion;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ChatApp.Shared.Hubs
|
||||
{
|
||||
/// <summary>
|
||||
/// Client -> Server API (Streaming)
|
||||
/// </summary>
|
||||
public interface IChatHub : IStreamingHub<IChatHub, IChatHubReceiver>
|
||||
{
|
||||
Task JoinAsync(JoinRequest request);
|
||||
|
||||
Task LeaveAsync();
|
||||
|
||||
Task SendMessageAsync(string message);
|
||||
|
||||
Task GenerateException(string message);
|
||||
|
||||
// It is not called because it is a method as a sample of arguments.
|
||||
Task SampleMethod(List<int> sampleList, Dictionary<int, string> sampleDictionary);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/ServerShared/Hubs/IChatHub.cs.meta
Normal file
11
Assets/Scripts/ServerShared/Hubs/IChatHub.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2080c15c13ba0c14aa0682bec9550f33
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
Assets/Scripts/ServerShared/Hubs/IChatHubReceiver.cs
Normal file
16
Assets/Scripts/ServerShared/Hubs/IChatHubReceiver.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using ChatApp.Shared.MessagePackObjects;
|
||||
|
||||
namespace ChatApp.Shared.Hubs
|
||||
{
|
||||
/// <summary>
|
||||
/// Server -> Client API
|
||||
/// </summary>
|
||||
public interface IChatHubReceiver
|
||||
{
|
||||
void OnJoin(string name);
|
||||
|
||||
void OnLeave(string name);
|
||||
|
||||
void OnSendMessage(MessageResponse message);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/ServerShared/Hubs/IChatHubReceiver.cs.meta
Normal file
11
Assets/Scripts/ServerShared/Hubs/IChatHubReceiver.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4857e2640847cd94f90257e00ec6854f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in a new issue