Skip to content

fix: bump to pre.8 and fix compile issues [MTT-3413] #631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Assets/BossRoom/Scripts/Shared/Game/GameEventMessage.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
using System;
using Unity.Collections;
using Unity.Netcode;

namespace Unity.Multiplayer.Samples.BossRoom
{
public struct LifeStateChangedEventMessage
public struct LifeStateChangedEventMessage : INetworkSerializeByMemcpy
{
public LifeState NewLifeState;
public FixedPlayerName CharacterName;
public CharacterTypeEnum CharacterType;
public FixedPlayerName CharacterName;
}

public struct DoorStateChangedEventMessage
public struct DoorStateChangedEventMessage : INetworkSerializeByMemcpy
{
public bool IsDoorOpen;
}

public struct ConnectionEventMessage
public struct ConnectionEventMessage : INetworkSerializeByMemcpy
{
public ConnectStatus ConnectStatus;
public FixedPlayerName PlayerName;
}


#if UNITY_EDITOR || DEVELOPMENT_BUILD
public struct CheatUsedMessage
public struct CheatUsedMessage : INetworkSerializeByMemcpy
{
FixedString32Bytes m_CheatUsed;
FixedPlayerName m_CheaterName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Unity.Netcode;

namespace Unity.Multiplayer.Samples.BossRoom.Shared.Infrastructure
{
Expand All @@ -8,7 +9,7 @@ public static void BindMessageChannelInstance<TMessage>(this DIScope scope)
{
scope.BindInstanceAsSingle<MessageChannel<TMessage>, IPublisher<TMessage>, ISubscriber<TMessage>, IMessageChannel<TMessage>>(new MessageChannel<TMessage>());
}
public static void BindNetworkedMessageChannelInstance<TMessage>(this DIScope scope) where TMessage : unmanaged, IComparable, IConvertible, IComparable<TMessage>, IEquatable<TMessage>
public static void BindNetworkedMessageChannelInstance<TMessage>(this DIScope scope) where TMessage : unmanaged, INetworkSerializeByMemcpy
{
scope.BindInstanceAsSingle<NetworkedMessageChannel<TMessage>, IPublisher<TMessage>, ISubscriber<TMessage>, IMessageChannel<TMessage>>(new NetworkedMessageChannel<TMessage>());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Unity.Multiplayer.Samples.BossRoom.Shared.Infrastructure
/// subscribing will be required each time a new session starts.
/// </summary>
/// <typeparam name="T"></typeparam>
public class NetworkedMessageChannel<T> : MessageChannel<T> where T : unmanaged, IComparable, IConvertible, IComparable<T>, IEquatable<T>
public class NetworkedMessageChannel<T> : MessageChannel<T> where T : unmanaged, INetworkSerializeByMemcpy
{
string m_Name;

Expand Down
2 changes: 1 addition & 1 deletion Assets/BossRoom/Scripts/Shared/NetworkNameState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReade

public override string ToString()
{
return m_Name.ToString();
return m_Name.Value.ToString();
}

public static implicit operator string(FixedPlayerName s) => s.ToString();
Expand Down
2 changes: 1 addition & 1 deletion Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"com.unity.learn.iet-framework": "2.1.1",
"com.unity.memoryprofiler": "0.5.0-preview.1",
"com.unity.multiplayer.tools": "1.0.0-pre.6",
"com.unity.netcode.gameobjects": "1.0.0-pre.7",
"com.unity.netcode.gameobjects": "1.0.0-pre.8",
"com.unity.postprocessing": "3.1.1",
"com.unity.render-pipelines.universal": "10.8.1",
"com.unity.services.authentication": "1.0.0-pre.4",
Expand Down
2 changes: 1 addition & 1 deletion Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"url": "https://packages.unity.com"
},
"com.unity.netcode.gameobjects": {
"version": "1.0.0-pre.7",
"version": "1.0.0-pre.8",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down