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

perf: clientrpc in host mode bypasses network #714

Merged
merged 1 commit into from
Mar 20, 2021
Merged

Conversation

paulpach
Copy link
Contributor

@paulpach paulpach commented Mar 19, 2021

client rpcs just bypass the network and get called immediately in host mode

this is the 10K example before in host mode:
Screen Shot 2021-03-19 at 5 21 57 PM

This is the 10K example after in host mode:
Screen Shot 2021-03-19 at 5 19 40 PM

BREAKING CHANGE: ClientRpc get called synchronously in host mode

@sonarcloud
Copy link

sonarcloud bot commented Mar 19, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@paulpach paulpach merged commit edb0705 into master Mar 20, 2021
@paulpach paulpach deleted the clienthostrpc branch March 20, 2021 01:18
github-actions bot pushed a commit that referenced this pull request Mar 20, 2021
## [81.0.1](v81.0.0...v81.0.1) (2021-03-20)

### Performance Improvements

* clientrpc in host mode bypasses network ([#714](#714)) ([edb0705](edb0705))
@github-actions
Copy link
Contributor

🎉 This PR is included in version 81.0.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to James-Frowen/Mirage that referenced this pull request Apr 21, 2021
# [67.0.0](v66.2.1...v67.0.0) (2021-04-21)

### Bug Fixes

* add comments and backing field for time ([MirageNet#618](https://github.com/James-Frowen/Mirage/issues/618)) ([da74e11](da74e11))
* add missing properties to interface ([MirageNet#617](https://github.com/James-Frowen/Mirage/issues/617)) ([e45920e](e45920e))
* add summaries to event classes ([MirageNet#623](https://github.com/James-Frowen/Mirage/issues/623)) ([e6b9354](e6b9354))
* adding FormerlySerializedAs to networkanimator ([39f8fbd](39f8fbd))
* adding ISceneLoader to INetworkPlayer ([e8ab7a4](e8ab7a4))
* better name to stop namespace conflict with Unity ([MirageNet#755](https://github.com/James-Frowen/Mirage/issues/755)) ([69784e7](69784e7))
* bug in tanks sample ([MirageNet#575](https://github.com/James-Frowen/Mirage/issues/575)) ([d82efea](d82efea))
* changed icon to new mirage icons. ([MirageNet#758](https://github.com/James-Frowen/Mirage/issues/758)) ([04edac0](04edac0))
* clientObjectManager was not using its interface ([MirageNet#615](https://github.com/James-Frowen/Mirage/issues/615)) ([d2b07ea](d2b07ea))
* compilation issue on standalone build ([d6bea93](d6bea93))
* compression of 90 degrees angle ([MirageNet#689](https://github.com/James-Frowen/Mirage/issues/689)) ([2c0bac6](2c0bac6))
* correctly catch warning during weaver tests ([1d9df36](1d9df36))
* disabling welcome window before unity 2020.1 ([MirageNet#662](https://github.com/James-Frowen/Mirage/issues/662)) ([a527af4](a527af4))
* drop support for older versions ([5dc12b5](5dc12b5))
* fixing uses of message ([f2a5522](f2a5522))
* invoke client rpc only once in host mode ([MirageNet#744](https://github.com/James-Frowen/Mirage/issues/744)) ([ee6e55e](ee6e55e))
* invoking started event when Listening is false ([MirageNet#675](https://github.com/James-Frowen/Mirage/issues/675)) ([afef2d4](afef2d4))
* keep weaving references ([fab02df](fab02df))
* make sure resolved typedef isn't null ([MirageNet#731](https://github.com/James-Frowen/Mirage/issues/731)) ([2f6414f](2f6414f))
* mirage icon missing in welcome window ([MirageNet#637](https://github.com/James-Frowen/Mirage/issues/637)) ([6c4dc9e](6c4dc9e))
* move interfaces into their own files ([MirageNet#613](https://github.com/James-Frowen/Mirage/issues/613)) ([432005b](432005b))
* multi scene example nre and event errors ([MirageNet#649](https://github.com/James-Frowen/Mirage/issues/649)) ([8c4c352](8c4c352))
* no longer true. spawnableobjects populated by FindObjectsOfTypeAll ([MirageNet#622](https://github.com/James-Frowen/Mirage/issues/622)) ([5692709](5692709))
* only weave direct references ([fed5aea](fed5aea))
* passing NetworkBehaviors in RPC works with IL2PP ([MirageNet#630](https://github.com/James-Frowen/Mirage/issues/630)) ([87becee](87becee)), closes [MirageNet#629](https://github.com/James-Frowen/Mirage/issues/629)
* passing NetworkBehaviors in syncvars work with il2pp ([MirageNet#631](https://github.com/James-Frowen/Mirage/issues/631)) ([cd7317f](cd7317f)), closes [MirageNet#630](https://github.com/James-Frowen/Mirage/issues/630) [MirageNet#629](https://github.com/James-Frowen/Mirage/issues/629)
* removing redundant null checks ([909b668](909b668))
* revert preprocessor change ([b89c454](b89c454))
* show syncvar label ([c32a940](c32a940))
* weaver test assembler shouldn't log compiler errors anymore (2020.2+)) ([af1ceb4](af1ceb4))
* **weaver:** adding missing errors when Attributes are used in monobehaviour ([64b580b](64b580b))
* show selected tab when welcome screen is opened ([MirageNet#628](https://github.com/James-Frowen/Mirage/issues/628)) ([f6cae98](f6cae98))
* simplify checking if client is host ([MirageNet#602](https://github.com/James-Frowen/Mirage/issues/602)) ([dbf5784](dbf5784))
* static not needed ([MirageNet#604](https://github.com/James-Frowen/Mirage/issues/604)) ([879ba01](879ba01))
* stopping `: ` being at the start of all log messages ([MirageNet#606](https://github.com/James-Frowen/Mirage/issues/606)) ([8efe7ce](8efe7ce))
* welcome window icon not being found ([MirageNet#635](https://github.com/James-Frowen/Mirage/issues/635)) ([263a7b2](263a7b2))
* welcome window layout ([MirageNet#634](https://github.com/James-Frowen/Mirage/issues/634)) ([2bceedb](2bceedb))

### Code Refactoring

* changing indexer to try get ([MirageNet#720](https://github.com/James-Frowen/Mirage/issues/720)) ([01ca9bb](01ca9bb))
* move collections to Mirage.Collections ([MirageNet#698](https://github.com/James-Frowen/Mirage/issues/698)) ([e22f765](e22f765))
* move LocalPlayer to ClientObjectManager ([MirageNet#619](https://github.com/James-Frowen/Mirage/issues/619)) ([df1e379](df1e379))
* move logging into a folder and namespace ([MirageNet#697](https://github.com/James-Frowen/Mirage/issues/697)) ([814653f](814653f))
* move serialization into Mirage.Serialization ([MirageNet#700](https://github.com/James-Frowen/Mirage/issues/700)) ([5dc037d](5dc037d))
* moving static send to NetworkServer ([MirageNet#692](https://github.com/James-Frowen/Mirage/issues/692)) ([5b19dc3](5b19dc3))
* moving syncvar sending to its own class ([9699e03](9699e03))
* remove local visibility hacks ([MirageNet#696](https://github.com/James-Frowen/Mirage/issues/696)) ([df499ab](df499ab))
* remove unnecessary assembly definition ([MirageNet#599](https://github.com/James-Frowen/Mirage/issues/599)) ([89ffc7c](89ffc7c))
* removing address property from player ([MirageNet#691](https://github.com/James-Frowen/Mirage/issues/691)) ([d772e53](d772e53))
* removing connection to server ([MirageNet#703](https://github.com/James-Frowen/Mirage/issues/703)) ([ff95634](ff95634))
* removing disconnect method from player ([MirageNet#688](https://github.com/James-Frowen/Mirage/issues/688)) ([e1daf92](e1daf92))
* removing sendasync from networkconnection ([MirageNet#672](https://github.com/James-Frowen/Mirage/issues/672)) ([e79b00e](e79b00e))
* removing un-used INetworkManager interface ([MirageNet#661](https://github.com/James-Frowen/Mirage/issues/661)) ([347bf6c](347bf6c))
* rename connection to player ([MirageNet#706](https://github.com/James-Frowen/Mirage/issues/706)) ([03e8cfa](03e8cfa))
* rename PlayerSpawner to CharacterSpawner ([MirageNet#686](https://github.com/James-Frowen/Mirage/issues/686)) ([1db3498](1db3498))
* renaming NetworkConnection to NetworkPlayer ([MirageNet#684](https://github.com/James-Frowen/Mirage/issues/684)) ([3ecb659](3ecb659))
* replacing version enum with assembly version ([MirageNet#663](https://github.com/James-Frowen/Mirage/issues/663)) ([d8facb7](d8facb7))
* spawnobjects throws exception instead of returning false ([MirageNet#639](https://github.com/James-Frowen/Mirage/issues/639)) ([4cb8afb](4cb8afb))
* using interface instead of network client ([MirageNet#721](https://github.com/James-Frowen/Mirage/issues/721)) ([703596a](703596a))
* using interface instead of network server ([MirageNet#722](https://github.com/James-Frowen/Mirage/issues/722)) ([7312bd8](7312bd8))
* **transports:** removing sendAsync from transports ([MirageNet#673](https://github.com/James-Frowen/Mirage/issues/673)) ([42b165f](42b165f))

### Features

* 0 is not lossy when compressing quaternions ([MirageNet#695](https://github.com/James-Frowen/Mirage/issues/695)) ([c1552c0](c1552c0))
* add events to interfaces ([MirageNet#614](https://github.com/James-Frowen/Mirage/issues/614)) ([4d1a772](4d1a772))
* add more control over player spawning ([MirageNet#626](https://github.com/James-Frowen/Mirage/issues/626)) ([e0dd626](e0dd626))
* adding assert extension method to logger ([MirageNet#642](https://github.com/James-Frowen/Mirage/issues/642)) ([1df6081](1df6081))
* adding class that will invoke late handlers ([631adce](631adce))
* adding Connection property to NetworkPlayer ([MirageNet#687](https://github.com/James-Frowen/Mirage/issues/687)) ([5e1c4ba](5e1c4ba))
* adding logger.Assert that doesn't require a message ([8c213e3](8c213e3))
* configurable wait time for tests ([MirageNet#729](https://github.com/James-Frowen/Mirage/issues/729)) ([b10f3e8](b10f3e8))
* install/uninstall modules from welcome window ([MirageNet#593](https://github.com/James-Frowen/Mirage/issues/593)) ([53ac404](53ac404))
* not listening can now be toggled at runtime. fixes host spawning ([MirageNet#728](https://github.com/James-Frowen/Mirage/issues/728)) ([256b16c](256b16c))
* sample for interest management ([MirageNet#727](https://github.com/James-Frowen/Mirage/issues/727)) ([0f4cdc5](0f4cdc5))
* support generic network behaviors ([MirageNet#574](https://github.com/James-Frowen/Mirage/issues/574)) ([715642c](715642c))
* welcome window shows active tab ([MirageNet#616](https://github.com/James-Frowen/Mirage/issues/616)) ([1411d0a](1411d0a))

### Performance Improvements

* clientrpc in host mode bypasses network ([MirageNet#714](https://github.com/James-Frowen/Mirage/issues/714)) ([edb0705](edb0705))
* serverrpc bypasses network on host mode ([MirageNet#708](https://github.com/James-Frowen/Mirage/issues/708)) ([695eb46](695eb46))

### Styles

* renaming NetworkScenePath to ActiveScenePath ([MirageNet#647](https://github.com/James-Frowen/Mirage/issues/647)) ([7a26360](7a26360))
* renaming NumPlayers to NumberOfPlayers ([MirageNet#646](https://github.com/James-Frowen/Mirage/issues/646)) ([27b99be](27b99be))

### BREAKING CHANGES

* networkManager.SceneManager removed to networkManager.NetworkSceneManager
* Dirty object collection is now inside SyncVarSender
* fields and parameters using NetworkServer are now using INetworkServer Instead
* fields and parameters using NetworkClient are now using INetworkClient Instead
* ObjectLocator now has TryGet method instead of indexer that returns null

* updating uses of objectLocator

* fixing names not being the same
* Removed ConnectionToServer property

* removing uses of ConnectionToServer

* removing use in test

* removing ClientRpc player target

* creating null

* changing tests to expect null

* fixing docs

* using client player for target rpc

Co-authored-by: Paul Pacheco <paulpach@gmail.com>

* fixing tests for rpc target

Co-authored-by: Paul Pacheco <paulpach@gmail.com>
* ServerRpc execute synchronous in host mode
* Connection renamed to player
* NetworkReader and NetworkWriter moved to Mirage.Serialization namespace
* collections moved to Mirage.Collections
* Logging moved into a namespace, use Mirror.Logging
* NetworkVisibility no longer disables renderers in host mode
* moving NetworkPlayer.Send to NetworkServer.SendToMany
* Address replaced with Connection.GetEndPointAddress

* updating uses of Address
* Disconnect replaced with Connection.Disconnect

* fixing uses in Mirage

* updating uses in authenticators
* Renamed PlayerSpawner to CharacterSpawner
* renaming NetworkConnection to NetworkPlayer

* renaming types in weaver tests

* fixing test message

* fixing xref in docs
* **transports:** Removed SendAsync from transport,  use Send instead
* Removed SendAsync from NetworkConnection.  Use Send instead
* Version.Current is no longer an enum and now returns Mirage's assembly version
* removing INetworkManager
* Use NetworkSceneManager.ActiveScenePath instead of NetworkSceneManager.NetworkScenePath

* removing cref till docs are fixed
* SpawnObjects throws Exception instead of returning false
* Use NetworkServer.NumberOfPlayers instead of NetworkServer.NumPlayers
* removed NetworkClient.LocalPlayer,  use ClientObjectManager.LocalPlayer instead
* removed MirageNG.asmdef,  change your assembly to use Mirage.asmdef instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant