浏览代码
Adding a fix for players sometimes getting booted from the minigame even when successfully connected (I was mismanaging the ClientRPC call that starts the game so that the last client to connect would sometimes receive the begin game message for another player (and then not initialize since it hadn't gotten its connection confirmation yet) and then try to start the game without being in the connected state, even though it was actually connected.)
Adding a fix for players sometimes getting booted from the minigame even when successfully connected (I was mismanaging the ClientRPC call that starts the game so that the last client to connect would sometimes receive the begin game message for another player (and then not initialize since it hadn't gotten its connection confirmation yet) and then try to start the game without being in the connected state, even though it was actually connected.)
Fixing an issue I introduced a few changes ago that made the back button from in-game go to the lobby UI even though it quits the lobby. There are some minor cleanup changes here as well: icon_bg prefab is consolidated into SymbolObject since that's its only usage. Clearing out some TODOs which have been investigated and addressed or obsolesced./main/staging/ngo_minigame_cleanup
nathaniel.buck@unity3d.com
3 年前
当前提交
d2ab33ea
共有 13 个文件被更改,包括 1057 次插入 和 1072 次删除
-
999Assets/Prefabs/NGO/SymbolObject.prefab
-
27Assets/Scripts/Netcode/InGameRunner.cs
-
20Assets/Scripts/Netcode/NetworkedDataStore.cs
-
6Assets/Scripts/Netcode/PlayerCursor.cs
-
3Assets/Scripts/Netcode/ResultsUserUI.cs
-
2Assets/Scripts/Netcode/Scorer.cs
-
2Assets/Scripts/Netcode/SetupInGame.cs
-
14Assets/Scripts/Netcode/SymbolObject.cs
-
24Assets/Scripts/Netcode/PlayerData.cs
-
1001Assets/Prefabs/Runes/icon_bg.prefab
-
7Assets/Prefabs/Runes/icon_bg.prefab.meta
-
24Assets/Scripts/Netcode/LobbyUserData.cs
-
0/Assets/Scripts/Netcode/PlayerData.cs.meta
999
Assets/Prefabs/NGO/SymbolObject.prefab
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using Unity.Netcode; |
|||
|
|||
namespace LobbyRelaySample.ngo |
|||
{ |
|||
/// <summary>
|
|||
/// An example of a custom type serialized for use in RPC calls. This represents the state of a player as far as NGO is concerned,
|
|||
/// with relevant fields copied in or modified directly.
|
|||
/// </summary>
|
|||
public class PlayerData : INetworkSerializable |
|||
{ |
|||
public string name; |
|||
public ulong id; |
|||
public int score; |
|||
public PlayerData() { } // A default constructor is explicitly required for serialization.
|
|||
public PlayerData(string name, ulong id, int score = 0) { this.name = name; this.id = id; this.score = score; } |
|||
|
|||
public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter |
|||
{ |
|||
serializer.SerializeValue(ref name); |
|||
serializer.SerializeValue(ref id); |
|||
serializer.SerializeValue(ref score); |
|||
} |
|||
} |
|||
} |
1001
Assets/Prefabs/Runes/icon_bg.prefab
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: b3e57d1c65c0fc746a2a46a3d227990b |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using Unity.Netcode; |
|||
|
|||
namespace LobbyRelaySample.ngo |
|||
{ |
|||
/// <summary>
|
|||
/// An example of a custom type serialized for use in RPC calls. This represents the state of a player as far as NGO is concerned,
|
|||
/// with relevant fields copied in or modified directly.
|
|||
/// </summary>
|
|||
public class LobbyUserData : INetworkSerializable // TODO: Name isn't clear.
|
|||
{ |
|||
public string name; |
|||
public ulong id; |
|||
public int score; |
|||
public LobbyUserData() { } // A default constructor is explicitly required for serialization.
|
|||
public LobbyUserData(string name, ulong id, int score = 0) { this.name = name; this.id = id; this.score = score; } |
|||
|
|||
public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter |
|||
{ |
|||
serializer.SerializeValue(ref name); |
|||
serializer.SerializeValue(ref id); |
|||
serializer.SerializeValue(ref score); |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue