mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 18:32:45 +00:00
update mirror weaver
This commit is contained in:
parent
3b493361fb
commit
f1cf09c85a
@ -18,7 +18,6 @@ namespace Mirror.FizzySteam
|
||||
DISCONNECT
|
||||
}
|
||||
|
||||
// CHANGED
|
||||
private Steamworks.Callback<P2PSessionRequest_t> callback_OnNewConnection = null;
|
||||
private Steamworks.Callback<P2PSessionConnectFail_t> callback_OnConnectFail = null;
|
||||
|
||||
@ -28,7 +27,6 @@ namespace Mirror.FizzySteam
|
||||
{
|
||||
channels = transport.Channels;
|
||||
|
||||
// CHANGED
|
||||
callback_OnNewConnection = Steamworks.Callback<P2PSessionRequest_t>.Create(OnNewConnection);
|
||||
callback_OnConnectFail = Steamworks.Callback<P2PSessionConnectFail_t>.Create(OnConnectFail);
|
||||
|
||||
|
@ -18,7 +18,6 @@ namespace Mirror.FizzySteam
|
||||
private event Action<byte[], int> OnReceivedData;
|
||||
private event Action OnConnected;
|
||||
private event Action OnDisconnected;
|
||||
// CHANGED
|
||||
private Steamworks.Callback<SteamNetConnectionStatusChangedCallback_t> c_onConnectionChange = null;
|
||||
|
||||
private CancellationTokenSource cancelToken;
|
||||
@ -62,7 +61,6 @@ namespace Mirror.FizzySteam
|
||||
private async void Connect(string host)
|
||||
{
|
||||
cancelToken = new CancellationTokenSource();
|
||||
// CHANGED
|
||||
c_onConnectionChange = Steamworks.Callback<SteamNetConnectionStatusChangedCallback_t>.Create(OnConnectionStatusChanged);
|
||||
|
||||
try
|
||||
|
@ -20,7 +20,6 @@ namespace Mirror.FizzySteam
|
||||
|
||||
private HSteamListenSocket listenSocket;
|
||||
|
||||
// CHANGED
|
||||
private Steamworks.Callback<SteamNetConnectionStatusChangedCallback_t> c_onConnectionChange = null;
|
||||
|
||||
private NextServer(int maxConnections)
|
||||
@ -29,7 +28,6 @@ namespace Mirror.FizzySteam
|
||||
connToMirrorID = new BidirectionalDictionary<HSteamNetConnection, int>();
|
||||
steamIDToMirrorID = new BidirectionalDictionary<CSteamID, int>();
|
||||
nextConnectionID = 1;
|
||||
// CHANGED
|
||||
c_onConnectionChange = Steamworks.Callback<SteamNetConnectionStatusChangedCallback_t>.Create(OnConnectionStatusChanged);
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,16 @@ namespace Mirror.Weaver
|
||||
{
|
||||
foreach (FieldDefinition field in typeDefinition.Fields)
|
||||
{
|
||||
if (field.IsStatic || field.IsPrivate)
|
||||
// ignore static, private, protected fields
|
||||
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3485
|
||||
// credit: James Frowen
|
||||
if (field.IsStatic || field.IsPrivate || field.IsFamily)
|
||||
continue;
|
||||
|
||||
// also ignore internal fields
|
||||
// we dont want to create different writers for this type if they are in current dll or another dll
|
||||
// so we have to ignore internal in all cases
|
||||
if (field.IsAssembly)
|
||||
continue;
|
||||
|
||||
if (field.IsNotSerialized)
|
||||
|
@ -123,7 +123,16 @@ namespace Mirror.Weaver
|
||||
ParameterDefinition param = md.Parameters[index];
|
||||
if (param.IsOut)
|
||||
{
|
||||
TypeReference elementType = param.ParameterType.GetElementType();
|
||||
// this causes IL2CPP build issues with generic out parameters:
|
||||
// https://github.com/MirrorNetworking/Mirror/issues/3482
|
||||
// TypeReference elementType = param.ParameterType.GetElementType();
|
||||
//
|
||||
// instead we need to use ElementType not GetElementType()
|
||||
// GetElementType() will get the element type of the inner elementType
|
||||
// which will return wrong type for arrays and generic
|
||||
// credit: JamesFrowen
|
||||
ByReferenceType byRefType = (ByReferenceType)param.ParameterType;
|
||||
TypeReference elementType = byRefType.ElementType;
|
||||
|
||||
md.Body.Variables.Add(new VariableDefinition(elementType));
|
||||
md.Body.InitLocals = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user