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
81
Assets/Scripts/MessagePack/Annotations/Attributes.cs
Normal file
81
Assets/Scripts/MessagePack/Annotations/Attributes.cs
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
// Copyright (c) All contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System;
|
||||
|
||||
#pragma warning disable SA1649 // File name should match first type name
|
||||
|
||||
namespace MessagePack
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)]
|
||||
public class MessagePackObjectAttribute : Attribute
|
||||
{
|
||||
public bool KeyAsPropertyName { get; private set; }
|
||||
|
||||
public MessagePackObjectAttribute(bool keyAsPropertyName = false)
|
||||
{
|
||||
this.KeyAsPropertyName = keyAsPropertyName;
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public class KeyAttribute : Attribute
|
||||
{
|
||||
public int? IntKey { get; private set; }
|
||||
|
||||
public string StringKey { get; private set; }
|
||||
|
||||
public KeyAttribute(int x)
|
||||
{
|
||||
this.IntKey = x;
|
||||
}
|
||||
|
||||
public KeyAttribute(string x)
|
||||
{
|
||||
this.StringKey = x;
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public class IgnoreMemberAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
|
||||
public class UnionAttribute : Attribute
|
||||
{
|
||||
public int Key { get; private set; }
|
||||
|
||||
public Type SubType { get; private set; }
|
||||
|
||||
public UnionAttribute(int key, Type subType)
|
||||
{
|
||||
this.Key = key;
|
||||
this.SubType = subType;
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = true)]
|
||||
public class SerializationConstructorAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
|
||||
public class MessagePackFormatterAttribute : Attribute
|
||||
{
|
||||
public Type FormatterType { get; private set; }
|
||||
|
||||
public object[] Arguments { get; private set; }
|
||||
|
||||
public MessagePackFormatterAttribute(Type formatterType)
|
||||
{
|
||||
this.FormatterType = formatterType;
|
||||
}
|
||||
|
||||
public MessagePackFormatterAttribute(Type formatterType, params object[] arguments)
|
||||
{
|
||||
this.FormatterType = formatterType;
|
||||
this.Arguments = arguments;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/MessagePack/Annotations/Attributes.cs.meta
Normal file
11
Assets/Scripts/MessagePack/Annotations/Attributes.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: db21d74c4f54408a9acd69873192155c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c) All contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
namespace MessagePack
|
||||
{
|
||||
public interface IMessagePackSerializationCallbackReceiver
|
||||
{
|
||||
void OnBeforeSerialize();
|
||||
|
||||
void OnAfterDeserialize();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ef32599edd0f43366891b8da5d4aed1e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in a new issue