Skip to content

Commit

Permalink
Mirror 66.0.9 (#13)
Browse files Browse the repository at this point in the history
* breaking: NetworkReader/WriterPool API simplified: GetReader/Writer => Get; Recycle => Return; (MirrorNetworking#3112)

* breaking: NetworkReader/WriterPool API simplified: GetReader/Writer => Take; Recycle => Return;

* rename Take() to Get()

* Pool<T> Take() => Get()

* breaking: PooledNetworkReader/Writer renamed to NetworkReader/WriterPooled

* NetworkReaderPooled moved into separate file

* NetworkWriterPooled moved into separate file

* comments

* comments

* perf: NetworkConnection.Send() inlining

* base Transport moved to Runtime folder; Transport folder renamed to Transports

* script icons .meta

* Tests: ShutdownCleanup test cleanup to prepare for Transport events += -= hooking

* feature: allow hooking into Transport events via += -= (prepares for NetworkStatistics) (MirrorNetworking#3116)

* feature: Transport.OnClient/ServerDataSent events += (prepares for NetworkStatistics) (MirrorNetworking#3117)

* feature: Transport.OnClient/ServerDataSent events += (prepares for NetworkStatistics)

* comments

* feature: NetworkStatistics (MirrorNetworking#3118)

* feature: NetworkStatistics

* better UI

* align NetworkStatistics exactly below NetworkManager HUD

* perf: HandleRemoteCall passes componentIndex as byte to avoid extra < 0 check

* perf: Rpcs/Cmds functionHash bandwidth reduced from 4 => 2 bytes (with the potential for 1 byte VarInt) (MirrorNetworking#3119)

* perf: Rpcs/Cmds functionHash bandwidth reduced from 4 => 2 bytes (with the potential for 1 byte VarInt)

* tests

* perf: CompressVarInt uses WriteByte instead of Write<T> to avoid Action call overhead

* perf: inline GetIndexFromFunctionHash because it's called for every RPC

* perf: NetworkTime.localTime inlined

* perf: NetworkTime.time inlined

* perf: NetworkTime ExponentialMovingAverage .Value & .Var as fields instead of properties to avoid call overhead

* fix: NetworkStatistics Unity 2019 support

* fix: NetworkStatistics Unity 2019 support (part two)

* Tests: runtime clientscene tests simplified and they don't rely on host mode anymore

* hasAuthority comment updated

* Fixed comments

* MultipleMatches example fixed

* fix: MirrorNetworking#3122 DestroyAllClientObjects now also resets after unspawn handler was called (MirrorNetworking#3124)

* fix: MirrorNetworking#2954 calling StopClient in host mode does not reset nextNetId anymore

* fix: MirrorNetworking#2954 calling StopClient in host mode does not destroy other client's objects anymore

* fix: Byte format test uses current culture (MirrorNetworking#3126)

Since some may use , instead of . as their decimal place seperator

Error:
String lengths are both 7. Strings differ at index 1.
  Expected: "1.00 KB"
  But was:  "1,00 KB"

* perf: Build batches directly instead of queuing serializations (MirrorNetworking#3130)

* rename

* so far

* better

* fixx

* old

* error

* typo

* comment

* fix: added Queue.TryDequeue extension for Unity 2019

* fix: Correct version for Queue.TryDequeue
- fixes MirrorNetworking#3131

* fixed comment

* ReadNetworkIdentity: reuse Utils.GetSpawnedInServerOrClient

* fix: MirrorNetworking#2972 ReadNetworkBehaviour now reads the correct amount of data even if the NetworkIdentity has disappeared on the client.
added test to guarantee it never happens again.

* comment

* fix: MirrorNetworking#2060 serializing GameObjects / NetworkIdentities now throws an obvious exception for prefabs / unspawned objects (MirrorNetworking#3132)

* fix: MirrorNetworking#2060 serializing GameObjects / NetworkIdentities now throws an obvious exception for prefabs / unspawned objects

* NetworkWriter: WriteGameObject reuses WriteNetworkIdentity

* warning instead of exception

* Tanks Example: reuse DestroySelf()

* Tanks Example: destroy projectile after 2 seconds instead of 5 seconds

* NetworkClient: RegisterPrefabIdentity double registration warning improved with explanation (related to MirrorNetworking#2705)

* fix: MirrorNetworking#2705 NetworkClient.SpawnPrefab looks for spawn handlers before looking for registered prefabs, instead of the other way around

* add comment

* fix: NetworkWriterExtensions:WriteTexture2D call WriteArray instead of Write

* Syntax: same method grouping as NetworkReaderExtenstions

* fix: Weaved static constructors need to always run (MirrorNetworking#3135)

Static constructors are lazily called when the class is first "used"
 https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-constructors
 > It is called automatically before the first instance is created or any static members are referenced.
 This means, in particular circumstances, client and server may diverge on which classes they have "loaded"
 and thus the rpc index will be desynced
 One such example would be on-demand-loading of prefabs via custom spawn handlers:
   A game might not want to preload all its monster prefabs since there's quite many of them
   and it is practically impossible to encounter them all (or even a majority of them) in a single play
   session.
   So a custom spawn handler is used to load the monster prefabs on demand.
   All monsters would have the "Monster" NetworkBehaviour class, which would have a few RPCs on it.
   Since the monster prefabs are loaded ONLY when needed via a custom spawn handler and the Monster class
   itself isn't referenced or "loaded" by anything else other than the prefab, the monster classes static
   constructor will not have been called when a client first joins a game, while it may have been called
   on the server/host. This will in turn cause Rpc indexes to not match up between client/server
 By just forcing the static constructors to run via the [RuntimeInitializeOnLoadMethod] attribute
 this is not a problem anymore, since all static constructors are always run and all RPCs will
 always be registered by the time they are used

* Update README.md

* NetworkRoomManager log update

* fix: MirrorNetworking#3138, 3135 revert Cmd/Rpc from 2 byte indices back to 4 byte function hashes for stability (MirrorNetworking#3139)

* Revert "fix: Weaved static constructors need to always run (MirrorNetworking#3135)"

This reverts commit b0624b2.

* Revert "perf: Rpcs/Cmds functionHash bandwidth reduced from 4 => 2 bytes (with the potential for 1 byte VarInt) (MirrorNetworking#3119)"

This reverts commit a868368.

* comment

Co-authored-by: vis2k <info@noobtuts.com>
Co-authored-by: Robin Rolf <imer@imer.cc>
  • Loading branch information
3 people committed Apr 16, 2022
1 parent ff143de commit 01adb09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Assets/Mirror/Components/NetworkRoomManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public void ReadyStatusChanged()
/// <param name="conn">Connection from client.</param>
public override void OnServerReady(NetworkConnectionToClient conn)
{
Debug.Log("NetworkRoomManager OnServerReady");
Debug.Log($"NetworkRoomManager OnServerReady {conn}");
base.OnServerReady(conn);

if (conn != null && conn.identity != null)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ If you are migrating from UNET, then please check out our [Migration Guide](http
<th><a href="https://inferna.net">Inferna</a></th>
<th><a href="https://nightz.io">NightZ</a></th>
<th><a href="https://store.steampowered.com/app/1547790/Roze_Blud">Roze Blud</a></th>
<th><a href=""></a></th>
<th><a href="https://store.steampowered.com/app/1016030/Wawa_United/">Wawa United</a></th>
</tr>
<tr>
<td><img src="https://user-images.githubusercontent.com/16416509/119760092-f3109e80-bedb-11eb-96cd-8e7f52e483fc.png" height="100"/></td>
<td><img src="https://user-images.githubusercontent.com/16416509/130729336-9c4e95d9-69bc-4410-b894-b2677159a472.jpg" height="100"/></td>
<td><img src="https://user-images.githubusercontent.com/16416509/152281763-87ae700e-9648-4335-9b20-3247e09334b5.png" height="100"/></td>
<td></td>
<td><img src="https://user-images.githubusercontent.com/16416509/162982300-c29d89bc-210a-43ef-8cce-6e5555bb09bc.png" height="100"/></td>
</tr>
</table>

Expand Down

0 comments on commit 01adb09

Please sign in to comment.