Skip to content
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

Mirror 66.0.9 #14

Merged
merged 4 commits into from
Apr 16, 2022
Merged

Mirror 66.0.9 #14

merged 4 commits into from
Apr 16, 2022

Conversation

MrGadget1024
Copy link

No description provided.

MrGadget1024 and others added 4 commits April 16, 2022 10:38
* 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>
@MrGadget1024 MrGadget1024 merged commit 40a7d0c into master Apr 16, 2022
@MrGadget1024 MrGadget1024 deleted the Mirror-66-0-9 branch April 16, 2022 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant