Commit Graph

2504 Commits

Author SHA1 Message Date
Paul Pacheco
a0aecf11fb Linting 2020-09-22 13:07:03 -05:00
Paul Pacheco
25b2fa9af8 KISS 2020-09-22 13:03:33 -05:00
Paul Pacheco
c868561822 Remove passthrough method 2020-09-22 12:49:38 -05:00
Paul Pacheco
3fec9ec880 Remove static weaver state 2020-09-22 12:33:48 -05:00
Paul Pacheco
116336fbf1 Remmove passthrough method 2020-09-22 12:33:18 -05:00
Paul Pacheco
3d331b4c61 Simplify set initialization 2020-09-22 12:21:58 -05:00
Paul Pacheco
34fa002099 Remove comment that does not apply 2020-09-22 12:20:37 -05:00
Paul Pacheco
a126bfd4dd Simplify method signature 2020-09-22 11:56:54 -05:00
Paul Pacheco
fdc21582db simplify module weaving 2020-09-22 11:45:31 -05:00
Paul Pacheco
e79ffeaa8e Use string interpolation 2020-09-22 11:40:13 -05:00
Paul Pacheco
b113fd4ecf KISS 2020-09-22 11:23:24 -05:00
Paul Pacheco
6c7e578d5a Remove redundant validations 2020-09-22 11:22:36 -05:00
Paul Pacheco
3e8870f791 we only weave one assembly at a time, no need for array 2020-09-22 10:11:07 -05:00
Paul Pacheco
eaf6ac66f0 output directory is always null, no need to pass it around 2020-09-22 10:06:13 -05:00
Paul Pacheco
eadb029393 Rename methods for clarity 2020-09-22 09:53:23 -05:00
Paul Pacheco
9d7c9069d7 Simplify namespace 2020-09-22 08:17:06 -05:00
Paul Pacheco
0fbcefe8df Follow naming convention 2020-09-22 08:16:04 -05:00
Paul Pacheco
85d26ebce6 type safe type comparison 2020-09-21 23:00:30 -05:00
Paul Pacheco
541b516d60 Remove unused parameter 2020-09-21 17:09:13 -05:00
Paul Pacheco
030dc86ea9 Namespace simplifications 2020-09-21 17:08:46 -05:00
Paul Pacheco
12debf1c8c Simplify namespace 2020-09-21 17:05:20 -05:00
Paul Pacheco
f77186e1d1 Simplify namespace 2020-09-21 17:00:57 -05:00
Paul Pacheco
d123e03915 Simplify namespace 2020-09-21 17:00:10 -05:00
Paul Pacheco
8fcbba50c4 Remove unused parameter 2020-09-21 16:59:05 -05:00
Paul Pacheco
7347e5700d Remove unused parameter 2020-09-21 16:58:33 -05:00
Paul Pacheco
76ce3796eb Simplify attribute namespace 2020-09-21 16:58:08 -05:00
Paul Pacheco
ca418457e8 Simplify guard check 2020-09-21 16:57:22 -05:00
Paul Pacheco
65f6e42b53 Simplify namespaces 2020-09-21 16:53:01 -05:00
James Frowen
94419ba003
Update ApiConnector.cs
adding null check for when listserver fails to be created
2020-09-20 00:44:13 +01:00
James Frowen
44401ab3bf
Update NetworkHeadlessLogger.cs 2020-09-19 11:30:41 +01:00
vis2k
d559bcfea7 Icon updated to half M 2020-09-19 10:01:10 +02:00
Paul Pacheco
07d290fd8c
Enhance code readability by using extension method (#2260)
# Before

This is hard to read:
```
if (ca.AttributeType.FullName == typeof(Mirror.CommandAttribute).FullName) {
...
}
```

# After

```
if (ca.AttributeType.Is<Mirror.CommandAttribute>()) {
...
}
```
2020-09-18 14:54:51 -05:00
James Frowen
7919942110
Splitting up test function
* Update NetworkServerTest.cs

splitting up test

* Update NetworkServer.cs

using string interpolation
2020-09-18 20:47:54 +01:00
Paul Pacheco
e50ea6318f
perf(weaver): No need to manually load mirror and unity assemblies (#2261) 2020-09-18 14:32:14 -05:00
James Frowen
a573bccc79
Update ApiUpdater.cs 2020-09-18 20:14:10 +01:00
Paul Pacheco
0b5989f87d Move overloads together 2020-09-18 13:06:34 -05:00
Paul Pacheco
6cfdd6469a
Simplify type lookup in weaver (#2258)
# 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.
2020-09-18 13:05:16 -05:00
James Frowen
8dac53ce3c
making InvokeUserCode use correct type in argument (#2259) 2020-09-17 22:41:37 +01:00
James Frowen
c69d8cca0b
flip equals to return early (#2245)
* flip equals to return early

* flip equals to return early

* removing un-needed comment
2020-09-16 12:05:43 +01:00
James Frowen
23bd9559d3
pref: increasing performance when Send is called on no observers (#2244)
* pref increasing performance when sending to no observers

* pref increasing performance when sending to no observers
2020-09-16 10:32:16 +02:00
James Frowen
5eb5ff6601
fix: fixing NullReferenceException when loading scene (#2240)
* 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
2020-09-16 10:30:10 +02:00
James Frowen
7580e9a6f5
Update ClientScene.cs (#2250)
* Update ClientScene.cs

Improving logging
- making sure sceneId is always hex
- only logging "Client spawn for ..." if it was successful

* Update ClientSceneTests_OnSpawn.cs
2020-09-14 22:35:41 +01:00
James Frowen
833c329ab2
Update ApiUpdater.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
2020-09-14 21:58:33 +01:00
James Frowen
b4fea1bfa3
Update NetworkServer.cs (#2247) 2020-09-13 19:07:59 +01:00
James Frowen
aec9b8a2ec
Update NetworkIdentity.cs
fixing block not being in remarks
2020-09-13 15:44:25 +01:00
James Frowen
d5c2387d1d
Update SyncObject.cs 2020-09-13 14:33:32 +01:00
James Frowen
ae9d2e35a9
docs: adding debug notes on list server (#2246) 2020-09-13 02:47:57 +01:00
James Frowen
844904dae5
adding doc comment (#2243) 2020-09-13 01:54:23 +01:00
James Frowen
94da8aec34
fix: Fixing IndexChanged hook not being called for NetworkRoomPlayer (#2242)
* adding Server to make sure index is only changed on the server

* removing calls to RecalculateRoomPlayerIndices on client
2020-09-13 01:52:32 +01:00
James Frowen
0c78fa0d7a
making sure CallOnClientExitRoom is called when object is disabled/destroyed (#2241) 2020-09-12 23:36:46 +01:00