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:
hyperion51 2020-02-26 17:48:40 +00:00
commit a0c8dbee72
493 changed files with 57790 additions and 3 deletions

View 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);
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2080c15c13ba0c14aa0682bec9550f33
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View 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);
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4857e2640847cd94f90257e00ec6854f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: