* fix: generic arguments lookup
The weaver was not able to figure out the synclist type in code like this:
```cs
public class SomeList<G, T> : SyncList<T> { }
public class SomeListInt : SomeList<string, int> { }
```
This code fixes that problem, and greatly reduces the complexity
of argument lookup.
* linting
Remove all the recursionCount nonsense.
This was added to prevent infinite recursion with types that reference themselves.
No need to check anymore, the weaver can generate readers and writers for types that reference themselves such as:
```cs
class Tree {
Tree child1;
Tree child2;
}
```
This works by the weaver doing it the way the compiler does: Create a function first, memoize it, then write the body. If the body needs the function, it will get itself and issue a call to itself.
Currently, whenever we want to serialize an enum,
we simply serialize the underlying type (byte, short, int)
This works fine, but in order to get the reader and writer
at runtime I need a function for each type.
With this PR, we generate a reader and writer function for enums too,
the function body simply calls the underlying reader and writer.
* throwing Exception instead of returning null
* re-adding null check until later PR
* removing error from test
* removing extra error
* adding comment
* replacing error with throw for abstact
The plan is to remove WeaverLists at some point so moving the functions
out of weaver to here for now and then move them closer to where they
are actaully used when we start to remove WeaverLists.
# Before
This is hard to read:
```
if (ca.AttributeType.FullName == typeof(Mirror.CommandAttribute).FullName) {
...
}
```
# After
```
if (ca.AttributeType.Is<Mirror.CommandAttribute>()) {
...
}
```
# Before
WeaverTypes declared a static variable like this:
```cs
public static TypeReference int32Type;
```
Weavertypes then loaded the variable in SetupTargetTypes like this:
```cs
int32Type = ImportSystemModuleType(currentAssembly, systemModule, "System.Int32");
```
Note we lookup the type with a string, any typo there won't be detected until the code is executed. It will also not be found by the IDE when you click "find references", or when you refactor.
Then we use it like this:
```cs
var intType = WeaverTypes.int32Type;
```
This is a DRY violation: I have to modify 3 different code sections just to say that I want the int32 type.
# After
Get rid of all the duplication, and use the type instead of a string:
```cs
var intType = WeaverTypes.Import<int>();
```
No need for static variable, or to add it in SetupTargetTypes.
* fixing null ref error when local player is destroyed
* removing null objects
* fixing InvalidOperationException
* moving code to its own function
* Update Assets/Mirror/Runtime/ClientScene.cs
* Update ClientScene.cs
Improving logging
- making sure sceneId is always hex
- only logging "Client spawn for ..." if it was successful
* Update ClientSceneTests_OnSpawn.cs
- Adding handlers in Awake instead of Start to make sure they are added before start on headless
- using GetComponent for NetworkManagerListServer
- Adding asserts to make sure values are set
* moving FakeNetworkConnection to common test folder
* adding test for local player destroy
* adding method to clear local player
* temp move test functions
* adding test for destroying non player
* moving asset to setup
* adding tests for destroy message and host mode
* adding ClearLocalPlayer to reset
* Removing manual invoke for Cmd and RPC
There should be no reason to manaully invoke remote code
they are marked with EditorBrowsableState.Never which implies they should not be called by the user
* removing tests