Commit Graph

6436 Commits

Author SHA1 Message Date
vis2k
181267b99d add explanation to errors 2021-09-02 18:39:29 +08:00
vis2k
bce20b5f46 add comment 2021-09-02 18:36:36 +08:00
vis2k
3e4def126f fix: NetworkServer/NetworkClient batch processing now detects ever growing batches (as caused by #2882) 2021-09-02 18:31:43 +08:00
vis2k
9578deeb55 typo 2021-09-02 17:43:35 +08:00
vis2k
f6399f91db Tanks example: add GUIConsole to camera for easier debugging 2021-09-02 13:50:03 +08:00
MrGadget1024
d559d45031 fixed usings order 2021-08-31 10:45:03 -04:00
vis2k
04c364346e
fix: Weave via ILPostProcessor (Unity 2020+) fixes #2872 #2685 #1491 #2683 #2880 (#2891)
* WeaverTypes: make imported ReaderExtensions public

* WeaverTypes: import WriterExtensions too

* process reader/writer extensions

* rebase squashed previous ilpostprocessor branch

* adjust to weaver preparations changes

* fix: show strack trace

* better

* readability

* fix file not found cecilx exception

* fix rocks nto found exception

* syntax

* pass Mirror.dll to Weave()

* ILPostProcessorAssemblyResolver from paul

* comments, ifdef, syntax

* ILPostProcessorAssemblyResolver: add logging

* ILPostProcessorAssemblyResolver: add warnings on why Resolve() failed

* comments

* better warning

* rename

* use the custom resolver

* fix: ILPostProcessorReflectionImporter to fix System.Private.CoreLib not being found in Resolver

* add TODO

* comment

* fix Mirror.dll Resolve() issues in ReaderWriterProcessor when resolving from the passed Mirror.dll.
DefaultAssemblyResolver doesn't work with ILPostProcessor.

* fix comment

* check mirror assembly resolve result

* pass resolver to weaver

* fix Mirror.dll resolving Mirror.dll types NullReferenceException

* comments

* syntax

* comments

* readability

* syntax

* forgot to save

* rebase

* write

* fix self referencing Mirror.dll assembly

* disable log

* make tests work again

* comment

* comment

* fix rebase

* fix rebase

* comment

* fix: WeaverAssembler: only invoke weaver manually on mac. ILPP is invoked on windows automatically.

* this too

* remove comment

* ifdef out CompilationFinishedHook

* CompiledAssemblyFromFile

* comments

* tests assembly renamed to access compilationpipeline

* wip

* comments

* handle logs

* move file

* use WeaverTests error handling functions

* ILPP hook: don't log weaving failed errors for consistency with old method, and so that tests still work

* ILPPLogger: don't log prefix

* disable weaving succeeded log

* remove comment

* WeaverAssembly: save result to file

* move

* Weaver tests: compilationpipeline dependencies moved into Unity.Mirror.Weaver.CodeGen assembly.
so Tests assembly is actually weaved.

* disable self reference warning

* CompiledAssemblyFromFile simplified

* remove unused

* comments; run ILPP in all cases not just on mac

* ignore compilermessages on 2020+.
fixes windows tests not running.

* comment

* fix: ILPostProcessor ignore define added so WeaverAssembler can tell it not to run after being invoked by Unity after AssemblyBuilder.Build(). fixes SyncVarSyncList test failing on windows because ILPP was ran on it twice.

* typo

* comment

* comment

* static

* ifdef for 2019 support

* ifdef for 2019
2021-08-29 15:43:20 +08:00
ninjakickja
92965731d1
fix: Fix delayed movement in client authority mode (#2856)
* Fix - From !isLocalPlayer to !hasAuthority

Changed !isLocalPlayer to !hasAuthority because object might not be player object.

* Update Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs

* Fix - delayed movement in clients in ClientAuthority mode - NetworkTransformBase.cs

Fixed issue where clients experience delayed movement in client authority mode.
Problem: Clients update the server first, server builds buffer then moves object, and then sends server's current snapshot to all the other clients who then build their buffers first before moving. This results in delayed movement in clients.
Changed the process to pass on the snapshot which the authoritative client updates the server onwards to other clients immediately instead and added checks to ensure server only broadcasts when object is on server authority or on host client authority.

* Update Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs

* Update Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs

* Update Assets/Mirror/Components/NetworkTransform2k/NetworkTransformBase.cs

Co-authored-by: vis2k <info@noobtuts.com>
2021-08-28 23:23:57 +08:00
vis2k
aff6a8a9c9 fix: WeaverTests 'type was declared in both UnityEngine.dll and UnityEngine.CoreModule.dll' 2021-08-27 22:38:18 +08:00
vis2k
851ad16a17
breaking: Weaver: add ReaderWriterProcessor [Runtime/InitializeOnLoad] Attributes without Reflection (#2893)
* breaking: Weaver: [InitializeOnLoad] attribute is now added without using Reflection.
(possibly a breaking change according to the comment, although it's not obvious why it would break)

* breaking: Weaver: [RuntimeInitializeOnLoad] attribute is now added without using Reflection.
(possibly a breaking change according to the comment, although it's not obvious why it would break)

* comments

* fix builds
2021-08-27 21:06:22 +08:00
vis2k
e87f1cb6eb Weaver: IsEditorAssembly moved into Helpers 2021-08-26 15:38:24 +08:00
vis2k
67418620fc Weave: WeaveFromFile simplified 2021-08-26 13:16:05 +08:00
vis2k
bf5b0e36ec Weaver: FindMirrorRuntime changed to FindCompilationPipelineAssembly 2021-08-26 13:08:31 +08:00
vis2k
6d1a13fc27 syntax 2021-08-26 13:06:59 +08:00
vis2k
bb8268dd06 typo 2021-08-26 13:05:02 +08:00
vis2k
391613b244
Update README.md 2021-08-25 13:00:52 +08:00
Shaun He
56910a1f70
* fix: The type or namespace name 'Exception' could not be found (#2889) 2021-08-25 12:17:02 +08:00
vis2k
95b009a126 Weaver WeaveFromFile: remove unused parameter 2021-08-24 23:15:36 +08:00
vis2k
e8cf20847d Weaver: move writing out of Weave() 2021-08-24 12:45:28 +08:00
vis2k
7088938bb7 Weaver: pass AssemblyResolver to Weave() so ReaderWriterProcessor can resolve Mirror.dll from CurrentAssembly's References instead of passing the AssemblyDefinition / using reflection / opening the file from Weaver / etc.
-> prepares for ILPostProcessor which needs to use the resolver to find it
2021-08-23 19:03:50 +08:00
vis2k
5d629b0fb7 syntax 2021-08-22 21:36:28 +08:00
vis2k
41f1c7abb8 syntax 2021-08-22 21:36:04 +08:00
vis2k
ad107e3b84 comments on why reflection is used 2021-08-22 21:33:19 +08:00
vis2k
46368df7fe rename 2021-08-22 21:30:19 +08:00
vis2k
c6b9b33a47 Weaver: ReaderWriterProcessor AddRuntimeInitializeOnLoadAttribute / AddInitializeOnLoadAttribute helper functions 2021-08-22 21:30:00 +08:00
vis2k
057d765656 syntax 2021-08-22 21:08:04 +08:00
vis2k
b7ec1ebfad Weaver: Weave() now requires MirrorAssembly parameter. we resolve it in CompilationFinishedHook instead of ReaderWriterProcessor.
-> all processors can easily access the mirror assembly if necessary
-> CompilationPipeline doesn't have to be referenced anymore, which would break ILPostProcessor
-> Weaver simply weaves given assemblies now, without opening anything
2021-08-22 21:02:24 +08:00
vis2k
38e6cfb893 syntax 2021-08-22 20:56:21 +08:00
vis2k
0c698df4ca rename 2021-08-22 20:55:21 +08:00
vis2k
20be56079c syntax 2021-08-22 20:54:33 +08:00
vis2k
9db804467c syntax 2021-08-22 20:52:58 +08:00
vis2k
08fdffd6ab comments 2021-08-22 20:49:37 +08:00
vis2k
852ef64034 Weaver: syntax 2021-08-22 20:42:11 +08:00
vis2k
16579ea9e8 Weaver CompilationFinishedHook: FindMirrorRuntime returns the assembly so we can use that later 2021-08-22 20:34:54 +08:00
vis2k
98737b8863 rename and clarify 2021-08-22 17:36:07 +08:00
vis2k
8db0f34f2c Weaver: add comment 2021-08-22 17:18:20 +08:00
vis2k
265a6384e1 ReaderWriterProcessor: ProcessMirrorAssemblyReaderWriterExtensions helper function for cleaner code 2021-08-22 17:08:31 +08:00
vis2k
2420a6d18b Weaver: add comments 2021-08-22 00:30:57 +08:00
vis2k
6ba4124724 Weaver: weaverTypes doesn't need to be public anymore 2021-08-21 16:31:44 +08:00
vis2k
59b2d731ea WeaverClientServerAttributeTests: remove dependencies on Weaver.weaverTypes 2021-08-21 16:31:34 +08:00
vis2k
eb04bb4d58 syntax 2021-08-21 16:14:53 +08:00
vis2k
9d43d3c6c6 remove xml comment 2021-08-21 16:14:29 +08:00
vis2k
737a2b1b28 syntax 2021-08-21 14:44:26 +08:00
vis2k
37cfdbbcae comment 2021-08-21 14:43:58 +08:00
vis2k
32d6eb0689 typo 2021-08-21 14:42:11 +08:00
vis2k
3b756ecdc8 WeaverTestsBuildFromTestName split into separate file 2021-08-21 13:56:39 +08:00
vis2k
7d0ac8e992 comment 2021-08-21 13:52:57 +08:00
vis2k
e1f04153b1 syntax 2021-08-21 13:52:08 +08:00
vis2k
de20998dcf syntax 2021-08-21 13:51:07 +08:00
vis2k
8af6e02420 remove unused 2021-08-21 13:50:04 +08:00