Commit Graph

4477 Commits

Author SHA1 Message Date
Emre Bugday
3665a992d5 Fixed OnStopClient not being called on Client Side (#2308)
* Fixed OnStopClient not being called on Client Side

* Moved identity.OnStopClient() two scopes above

Co-authored-by: Emre Bugday <47198270+EmreB99@users.noreply.github.com>
2020-10-06 09:45:36 +02:00
James Frowen
b33e5228a3 Update Extensions.cs (#2310)
- only catching AssemblyResolutionException
- using null propagation instead of null ref
2020-10-06 09:44:35 +02:00
vis2k
b9c0ee144b InterestManagement: NetworkIdentity.forceHidden added again to replace NetworkProximityChecker.forceHidden 2020-10-05 17:35:20 +02:00
vis2k
a9b0254fcc InterestManagement global solution and removed NetworkProximityChecker/RebuildObservers 2020-10-05 15:32:07 +02:00
vis2k
0e324f5198 Remove unused import 2020-10-02 12:32:35 +02:00
vis2k
abe3ce194f fix tests after previous SyncLists commit 2020-10-02 12:24:27 +02:00
Paul Pacheco
df9fe83971 breaking: Use SyncLists directly (delete overrides) (#2307)
* feat: Use SyncLists directly

Previously,  you had to write an intermediary class to use synclists, syncsets and syncdictionaries.
The weaver would populate that intermediary class with a serialization and deserialization method

This PR gets rid of 90% of the weaver code for synclists.
There is no need to generate these methods anymore.
Instead the lists use `writer.Write<T>` and `read.read<T>` to serialize their Data.

Since there is no code generate in synclists, you can now use the synclists directly instead
of subclassing them.

BEFORE:

```cs
public class MyComponent : NetworkBehaviour {
    // nonsense class to make the weaver happy
    class SyncListData : Synclist<Data> {}

    SyncListData mySyncList;
}
```

AFTER:

```cs
public class MyComponent : NetworkBehaviour {
    Synclist<Data> mySyncList;
}
```

* linting

* feat: Use SyncLists directly (no overrides)

Previously,  you had to write an intermediary class to use synclists and syncdictionaries.

The weaver would populate that intermediary class with a serialization and deserialization method

This PR gets rid of 90% of the weaver code for synclists.
There is no need to generate these methods anymore.
Instead the lists use `writer.Write<T>` and `read.read<T>` to serialize their Data.

Since there is no code generate in synclists, you can now use the synclists directly instead
of subclassing them.

Same as #2305 ,but it removes the deprecated Serialize and Deserialize methods from syncobjects,
This way you get a nice compiler error for the code that no longer works, instead of a warning you might accidentally ignore.

BEFORE:

```cs
public class MyComponent : NetworkBehaviour {
    // nonsense class to make the weaver happy
    class SyncListData : Synclist<Data> {}

    SyncListData mySyncList;
}
```

AFTER:

```cs
public class MyComponent : NetworkBehaviour {
    Synclist<Data> mySyncList;
}
```

BREAKING CHANGE: Serialize and Deserialize methods in synclists don't do anything anymore

* Remove old comment

* Fix compilatio error
2020-10-02 09:50:35 +02:00
Paul Pacheco
55f64af196 feat: new generic Read and Write methods for all types (#2301)
Currently in mirror,  there is no way for Mirror itself to invoke
readers and writers for types it does not know about.

This causes us to have to generate code for lists, dictionaries and messages.

This PR makes it so that if there is a reader and writer anywhere in the
code for type X, then the writer can be invoked like this:

```cs
X x = ...;
writer.Write<X>(x);
```

and the reader can be invoked like this:
```cs
X x = reader.Read<X>();
```
2020-10-02 09:18:50 +02:00
vis2k
41f8644d1e Remove NetworkReader/Writer Read/WritePacked completely (note for backporting: requires moving WriteInt/UInt/etc. to extensions, otherwise weaver won't know how to write int/uint/etc.) 2020-10-01 16:12:42 +02:00
vis2k
7ef5b59fad perf: NetworkReader/NetworkWriter use Read/WriteBlittable<T> from DOTSNET (~10x faster) 2020-10-01 16:00:39 +02:00
vis2k
06256fd8d4 codecoverage settings saved 2020-10-01 14:49:55 +02:00
vis2k
56a054ba67 MessagePacker.MessageHandler renamed to WrapHandler because that's what it does 2020-10-01 14:49:48 +02:00
vis2k
99b3d95484 MessagePacker.MessageHandler refactored for consistency with DOTSNET 2020-10-01 14:41:41 +02:00
vis2k
3cb928fb30 Packages: CodeCoverage 0.3.1-preview added 2020-10-01 11:34:22 +02:00
vis2k
c5792ce837 Remove Transport.OnDataReceived channelId parameter 2020-10-01 11:33:05 +02:00
vis2k
1afdfd91d0 Remove unused 2020-09-30 12:12:46 +02:00
vis2k
304b201c6a Revert xml 2020-09-30 12:10:47 +02:00
vis2k
0f47b4bbe2 Remove unused disconnectInactiveTimeout 2020-09-30 12:05:20 +02:00
vis2k
076f9e0627 Add comment 2020-09-30 12:03:44 +02:00
vis2k
7a3ababf03 typo 2020-09-30 12:02:58 +02:00
vis2k
3323eecc1e Remove unused import 2020-09-30 12:00:37 +02:00
vis2k
ba31afba2c Remove unused clientReadyConnection 2020-09-30 11:58:31 +02:00
vis2k
a85446c6da Remove docs 2020-09-30 11:47:20 +02:00
vis2k
4ec6e1fa19 Remove all Scene changes and show error message if changed at runtime instead 2020-09-30 11:44:37 +02:00
vis2k
41af9b2dae Remove NetworkIdentity.Assign/RemoveClientAuthority & Callback 2020-09-30 11:15:25 +02:00
vis2k
ee75a61d8e Syntax 2020-09-30 11:11:49 +02:00
vis2k
ad8537ffd5 Remove Transport.Send(List<connectionId>) 2020-09-30 11:09:30 +02:00
vis2k
aec2a71802 Remove NetworkConnection.lastMessageTime & IsClientAlive 2020-09-30 11:09:30 +02:00
vis2k
de6b63ef2f Remove NetworkClient.ReplaceHandler 2020-09-30 11:09:30 +02:00
vis2k
84cf753f19 Remove Uri support 2020-09-30 11:09:30 +02:00
vis2k
bd0a00fcb9 Remove Obsolete 2020-09-30 11:09:29 +02:00
vis2k
0a2555c700 Fix rebase 2020-09-30 11:09:29 +02:00
vis2k
5e2a968abb Force NetworkMessage as struct everywhere 2020-09-30 11:09:29 +02:00
vis2k
6baaa1d75e IMessageBase renamed to NetworkMessage 2020-09-30 11:09:29 +02:00
vis2k
a565c7c33c Remove NetworkMessage class support 2020-09-30 11:09:29 +02:00
vis2k
4d4e507847 Remove ClientScene.spawn/unspawnHandlers 2020-09-30 11:09:29 +02:00
vis2k
b44481767b Remove ClientScene.Register/UnregisterSpawnHandler 2020-09-30 11:09:29 +02:00
vis2k
6b2cd3aefa Remove ClientScene.RegisterPrefab with assetId, Spawn/UnspawnDelegate 2020-09-30 11:09:29 +02:00
vis2k
c54be229a8 Remove ClientScene.RegisterPrefab with Spawn/UnspawnHandlerDelegate 2020-09-30 11:09:29 +02:00
vis2k
0aeb13a8af Remove ClientScene.RegisterPrefab with spawn/unspawnHandler 2020-09-30 11:09:29 +02:00
vis2k
9682a9a7e5 Remove ClientScene.RegisterPrefab with newAssetId 2020-09-30 11:09:29 +02:00
vis2k
8a190282aa fix rebase 2020-09-30 11:09:29 +02:00
vis2k
73e16f3aeb Remove ClientScene.onLocalPlayerChanged 2020-09-30 11:09:29 +02:00
vis2k
09800e6127 Remove ReplacePlayerForConnection 2020-09-30 11:09:29 +02:00
vis2k
139950ea4e Remove Host Mode 2020-09-30 11:09:29 +02:00
vis2k
f82d7c7abc Remove Transform/GameObject sync to avoid GetComponent calls. Use NetworkIdentity instead. 2020-09-30 11:09:29 +02:00
vis2k
717ad1e39f Forgot to comment out a debug log 2020-09-30 11:09:29 +02:00
vis2k
1d5e4f317c Remove NetworkDiagnostics 2020-09-30 11:09:29 +02:00
vis2k
a2c5e1bf12 Read/WritePacked call the regular functions 2020-09-30 11:09:29 +02:00
vis2k
10b797a8ba Use Write/Read without Packed everywhere 2020-09-30 11:09:29 +02:00