Commit Graph

1284 Commits

Author SHA1 Message Date
Chris Langsenkamp
fad50818bf Added AddComponentMenu empties and namespace 2019-11-24 14:35:19 -05:00
Chris Langsenkamp
37e5b49f28 Removed extraneous comments 2019-11-24 09:46:41 -05:00
Chris Langsenkamp
210540b669 Fixed Obsolete comment 2019-11-24 08:38:47 -05:00
Paul Pacheco
3b9414f131 perf: spawn with client authority only takes 1 message (#1206)
* perf: spawn with client authority only takes 1 message now

* Fix javadocs and warning

* Rename parameters

* Make sure we spawn players with authority
2019-11-24 10:22:43 +09:00
Paul Pacheco
5b04836bb2 fix: spawnwithauthority works again in host mode 2019-11-24 10:16:15 +09:00
Paul Pacheco
92d0df7b39 feat: SyncToOwner now works with authority (#1204)
* WIP redoing authority

* Local client also handles authority

* Remove unused callback

* Update Assets/Mirror/Runtime/NetworkIdentity.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* Update Assets/Mirror/Runtime/NetworkIdentity.cs

Co-Authored-By: vis2k <info@noobtuts.com>

* Rename pendingOwner

* Update Assets/Mirror/Runtime/NetworkIdentity.cs

Co-Authored-By: vis2k <info@noobtuts.com>

* Update Assets/Mirror/Runtime/NetworkIdentity.cs

Co-Authored-By: vis2k <info@noobtuts.com>

* Update Assets/Mirror/Runtime/NetworkIdentity.cs

Co-Authored-By: vis2k <info@noobtuts.com>

* Update Assets/Mirror/Runtime/NetworkIdentity.cs

Co-Authored-By: vis2k <info@noobtuts.com>
2019-11-23 15:07:00 +09:00
Paul Pacheco
24d8368b38 refactor: reuse connectionToClient for authority (#1200)
* refactor: reuse connectionToClient for authority

* Fix compilation issue

* Make PR easier to read

* Better error message

* Update Assets/Mirror/Runtime/NetworkIdentity.cs

Co-Authored-By: MrGadget <chris@clevertech.net>
2019-11-23 15:00:53 +09:00
Paul Pacheco
876da8bbcd refactor: Simplify spawning 2019-11-23 14:54:37 +09:00
MrGadget
1e96cb7a8a Replaces SpawnWithClientAuthority with Spawn Overloads (#1233)
* Replaces SpawnWithClientAuthority with Spawn Overloads

* Cleaned up comments and log messages
2019-11-23 14:26:27 +09:00
vis2k
e847344bde syntax 2019-11-23 11:59:04 +09:00
vis2k
f0cf4e7e14 Replace 'local client' naming with 'host' to be less confusing. This breaks NetworkProximityChecker.OnSetLocalVisibility because it needs to be renamed to OnSetHostVisibility
* rename parameter

* obsolete

* rename parameter
2019-11-23 11:34:47 +09:00
Paul Pacheco
1d4b1faac2 docs: fix link to spawn custom player 2019-11-23 11:03:27 +09:00
Paul Pacheco
0bc151bb27 Obsolete built in messages 2019-11-23 11:03:18 +09:00
Paul Pacheco
c669ff155d perf: avoid allocation for error messages 2019-11-23 11:03:08 +09:00
vis2k
1c7c54305d add missing meta file 2019-11-23 11:00:49 +09:00
Chris Langsenkamp
638b445744 Update Prefabs After LocalPlayerAuthority Removed 2019-11-23 10:59:52 +09:00
MrGadget
8cf6a0707e feat: Script Templates (#1217)
* Add Script Templates

* Moved serialization section down

* Added comments to Awake & Start

* Capitalization

* meta files

* Added doc links and XML comments
2019-11-23 10:59:38 +09:00
Chris Langsenkamp
477028913a Update Prefabs After LocalPlayerAuthority Removed 2019-11-23 10:59:21 +09:00
Chris Langsenkamp
1699335aaa fixed comment 2019-11-23 10:59:12 +09:00
Paul Pacheco
d741baed78 feat: Pass all information to spawn handler (#1215) 2019-11-23 10:57:52 +09:00
ZacNorthBigBox
701f4f4183 fix: Pass the name of the invoking class and desired command when an object has no authority. (#1216) 2019-11-23 10:57:45 +09:00
Paul Pacheco
2c58902357 Code style 2019-11-23 10:57:40 +09:00
Paul Pacheco
2081a757ea Remove unused connection id cache
Good find by MrGadget
2019-11-23 10:57:32 +09:00
Paul Pacheco
2d4d4109bb Make list cache readonly 2019-11-23 10:57:25 +09:00
Paul Pacheco
c2096d0fb7 Available transport is determined at connection time (#1213)
* Available transport is determined at connection time

* Update MultiplexTransport.cs
2019-11-23 10:57:11 +09:00
Paul Pacheco
ce305d95fc Removed unused code 2019-11-23 10:57:09 +09:00
Paul Pacheco
15e03d9bbf Removed unused code 2019-11-23 10:57:06 +09:00
Paul Pacheco
7ba4bc3590 use C# formatter 2019-11-23 10:56:53 +09:00
Paul Pacheco
09f6892c55 feat: An authenticator that times out other authenticators (#1211)
* feat: An authenticator that times out other authenticators

* Clean up some spaces

* Add tooltip for timeout
Disable timeout with 0

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* Remove space

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* use float for time

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs

* Update Assets/Mirror/Authenticators/TimeoutAuthenticator.cs
2019-11-23 10:56:51 +09:00
Chris Langsenkamp
d821013deb Added HelpURL to NetworkBehaviour 2019-11-23 10:56:22 +09:00
Chris Langsenkamp
e33f2e84cb Updated summary comments 2019-11-23 10:56:04 +09:00
Paul Pacheco
bf9eb610dc feat: NetworkConnection is optional for handlers (#1202)
* feat: NetworkConnection is optional for handlers

* make NetworkConnction optional in handlers
2019-11-23 10:52:24 +09:00
Paul Pacheco
12fd2ae6fc Remove redundant namespace 2019-11-23 10:52:12 +09:00
Paul Pacheco
236dcb6734 remove redundant type parameter 2019-11-23 10:52:02 +09:00
Paul Pacheco
1531281516 Enforce proper type for connectionToClient 2019-11-23 10:51:50 +09:00
vis2k
db99dd7b3d fix: when modifying a prefab, Unity calls OnValidate for all scene objects based on that prefab, which caused Mirror to reset the sceneId because we only checked if a prefab is currently edited, not if THIS prefab is currently edited 2019-11-03 14:33:59 +01:00
vis2k
188b74edd6
Fallback Transport (#1198)
* Fallback Transport

* doc

* doc

* help URL

* exception

* fixed help url
2019-11-03 00:04:59 +01:00
Paul Pacheco
f70a2ac702 refactor: Simplify spawn message (#1195)
* refactor: Simplify spawn message

* Update Assets/Mirror/Runtime/Messages.cs

* fix brainfart

* consolidate spawning logic

* simpler find

* remove unnecesary private keyword

* Remove redundant else
2019-10-31 10:07:37 +01:00
vis2k
6765da2387 Make Transport.Available() abstract (#1194)
* Make Transport.Available() abstract

* better
2019-10-30 13:02:07 -07:00
vis2k
7fe8888df5 perf: MultiplexTransport: avoid Linq allocations that would happen on every packet send because Send calls .ServerActive() each time 2019-10-30 20:18:02 +01:00
Paul Pacheco
40f50ac908 breaking: Remove localPlayerAuthority (#1192)
* breaking: Remove localPlayerAuthority (#1188)

* breaking: Remove localPlayerAuthority

This flag does not do anything useful in anything but NetworkAnimator
so NetworkAnimator can keep it's own flag.

* Add tooltip with explanation

* Editor should no longer access localPlayerAuthority property
2019-10-30 18:13:25 +01:00
Paul Pacheco
7df3ce37d1 fix: Don't throw exception getting address 2019-10-30 09:30:58 -07:00
Paul Pacheco
6cbef06e00 Simplify editor a bit 2019-10-30 05:49:04 -07:00
vis2k
d9afbfe4c9
rename 'owner' to 'isLocalPlayer' to prepare to be less confusing (#1185) 2019-10-27 16:30:06 +01:00
vis2k
27daf3fb0b remove old comment 2019-10-27 15:01:21 +01:00
Paul Pacheco
8931944005 Destroy objects owned by this connection when disconnecting (#1179)
* Destroy objects owned by this connection when disconnecting

* How did this get here?

* Simplify keeping track of owned objects
2019-10-27 14:55:12 +01:00
Paul Pacheco
4d9e5809ee tests: unit test local connections (#1184) 2019-10-27 14:47:06 +01:00
Paul Pacheco
f94adbf09b refactor: local connections maintain their own queue (#1183)
* refactor: local connections maintain their own queue

* pass message to the counterpart connection

* Update LocalConnections.cs

* Update LocalConnections.cs
2019-10-27 14:09:54 +01:00
MrGadget
2d13512642 Remove redundant force authority (#1180) 2019-10-26 10:38:29 +02:00
Paul Pacheco
8d886ecf69 Remove leftover xmldoc parameter 2019-10-25 23:38:33 -05:00
Paul Pacheco
2ae5f0ddfc Make sure we use a connection to client for clientAuthorityOwner 2019-10-25 23:09:19 -05:00
Paul Pacheco
24a7968cc2
refactor: Split NC for clients and servers (#1175)
NetworkConnection has been broken down into:

NetworkConnection

NetworkConnectionToClient
NetworkConnectionToServer
This way each class does one thing only, instead of trying to accommodate client and server functionality in the same class.

I can't go any further than this without breaking a lot of code. Ideally we would move the connectionId down to NetworkConnectionToClient, but that will result in a lot of breaking changes.
2019-10-25 23:01:54 -05:00
MrGadget
51653ed811 Remove Authority Set (#1178) 2019-10-25 13:13:57 +02:00
Paul Pacheco
1ec8910575
perf: allocation free syncdict foreach, fix #1172 (#1174) 2019-10-23 08:40:55 -05:00
Paul Pacheco
13e4e6fe3a refactor: make it clearer that connection id is 0 or possitive 2019-10-23 07:21:20 -05:00
Paul Pacheco
035e6307f9 perf: allocation free enumerator for syncsets, fixes #1171 (#1173) 2019-10-23 11:36:52 +02:00
Paul Pacheco
ade7e76f45 This method should never be used by users 2019-10-22 20:23:48 -05:00
Paul Pacheco
745ef89e8c make it clearer that connection id can't be -1
It was already impossible for he connection id to be -1
So make it clear.
Also make sure the connection id cannot change
2019-10-22 19:48:51 -05:00
Paul Pacheco
c0a7c8a6db Users should never be creating NetworkConnections directly 2019-10-22 19:44:54 -05:00
Paul Pacheco
9dea4856ac obsolete: Players should not really use connectionId 2019-10-22 18:46:36 -05:00
MichalPetryka
4ffd5a2e06 perf: Custom IEnumerator for SyncLists to avoid allocations on foreach (#904)
* Custom IEnumerator for SyncLists to avoid allocations on foreach

* add comments and benchmark

* remove unnecessary 'private'

* syntax
2019-10-22 17:41:09 +02:00
Paul Pacheco
60b2dcb94b
refactor:use ToString() to display connections (#1170) 2019-10-22 08:34:19 -05:00
vis2k
0a22e61787 add comment 2019-10-22 15:10:25 +02:00
Paul Pacheco
94eda38803 feat: Remove Command shortcut for host mode (#1168) 2019-10-22 10:13:27 +02:00
Paul Pacheco
22b45f7a11 perf: Use RemoveAt to remove elements from lists 2019-10-21 02:20:51 -05:00
vis2k
12c5a8fdc3 Revert "feat: Add Timeout to NetworkAuthenticator (#1091)"
This reverts commit e8cc9ba27b.
2019-10-20 20:12:14 +02:00
MrGadget
e8fac8aba5 fix: Suspend server transport while changing scenes (#1169)
* Suspend transport

* fixed typo
2019-10-20 11:54:43 -05:00
MrGadget
e8cc9ba27b feat: Add Timeout to NetworkAuthenticator (#1091)
* Add timeout to NetworkAuthenticator

* Added back the using Vis removed

* updated doc

* Typo
2019-10-20 11:23:34 -05:00
MrGadget
1fc1ed2708 fix: Don't give host player authority by default (#1158)
* Don't give host player authority by default

* Same when removing authority
2019-10-20 18:01:00 +02:00
Paul Pacheco
eb51da0b72 simplify tests 2019-10-19 11:29:52 -05:00
Lymdun
8be06fc453 Fix comments (#1167) 2019-10-19 10:06:30 -05:00
Paul Pacheco
2db9520b54 Cleaned up some tests 2019-10-19 10:05:30 -05:00
MichalPetryka
0fde090bf2 SyncList custom Equality Comparer support (#1146) 2019-10-19 16:02:08 +02:00
Paul Pacheco
9cb309e5bc feat: Users may provide custom serializers for any type (#1153)
* feat: Users may provide custom serializers for any type

* Relax rules for rpc parameters to support user provided serializers

* Improve error messages

* Fixed component types

* Adjusted tests
2019-10-19 16:00:27 +02:00
MrGadget
ae5c92b40c Rename includeSelf to includeOwner (#1163)
* Rename includeSelf to includeOwner

* Renamed isSelf too
2019-10-19 09:47:17 +02:00
MrGadget
11b3cce123 Refresh Data For Preview Window (#1161) 2019-10-19 09:41:06 +02:00
MrGadget
0295522d5a Prevent NRE (#1162) 2019-10-19 09:39:46 +02:00
MrGadget
039abfcc81 Remove unnecessary virtuals (#1156) 2019-10-18 08:09:27 -05:00
MrGadget
c3fcf9117c
Update NetworkClient.cs
updated comment
2019-10-18 00:27:34 -04:00
Paul Pacheco
d8ce80fe0e fix: don't call hook in host if no change, fixes #1142 (#1143)
* fix: don't call hook in host if no change,  fixes #1142

* Update Assets/Mirror/Editor/Weaver/Processors/SyncVarProcessor.cs

Co-Authored-By: MrGadget <chris@clevertech.net>

* avoid hook calls for GO and NI in host

* Update Assets/Mirror/Editor/Weaver/Processors/SyncVarProcessor.cs

* Remove check from SetSyncVarGameObject
2019-10-17 09:31:31 +02:00
Paul Pacheco
34c419ee07 Update NI and GO fields for ease of use (#1154) 2019-10-17 09:30:29 +02:00
MrGadget
61428382f4 Make playerData public to get rid of Unity's warning (#1152) 2019-10-16 21:16:46 +02:00
MichalPetryka
0f951858c5 feat: SyncSet custom Equality Comparer support (#1147) 2019-10-15 09:07:15 -05:00
MichalPetryka
84555bc9d0 Fix invalid exception usage (#1148) 2019-10-14 19:39:00 +02:00
MrGadget
fd43c67d68 fix: Prevent Compiler Paradox (#1145)
* Prevent Compiler Paradox

* Change platform to Editor Only

* added new line at EOF
2019-10-14 07:32:24 -05:00
Paul Pacheco
ae2f5cb7d8 Make field readonly 2019-10-14 07:23:40 -05:00
Paul Pacheco
85faddfdd0 Remove unused, obsolete private method 2019-10-14 07:20:47 -05:00
Paul Pacheco
ec5434b087 Method should be static 2019-10-13 16:20:56 -05:00
Paul Pacheco
95138427f3
perf: avoid boxing for getting message id (#1144)
* perf: avoid boxing for getting message id

* Update Assets/Mirror/Runtime/MessagePacker.cs

Co-Authored-By: MichalPetryka <35800402+MichalPetryka@users.noreply.github.com>

* Update Assets/Mirror/Runtime/NetworkConnection.cs

Co-Authored-By: MichalPetryka <35800402+MichalPetryka@users.noreply.github.com>
2019-10-13 15:57:39 -05:00
Chris Langsenkamp
d5e3e56c78 Fixed HelpURL 2019-10-09 01:41:54 -04:00
MrGadget
bcc6af8527 Simplify Jump and reset player prefabs (#1140) 2019-10-08 09:35:08 +02:00
Chris Langsenkamp
98b6328f76 Merge branch 'master' of https://github.com/vis2k/Mirror 2019-10-07 06:41:35 -04:00
Chris Langsenkamp
86b5f565d0 updated comments 2019-10-07 06:41:12 -04:00
vis2k
231a384881 Telepathy updated to latest version 2019-10-07 10:43:47 +02:00
Chris Langsenkamp
1f2ff6b2c9 Code formatting 2019-10-05 10:13:13 -04:00
Chris Langsenkamp
d177df8f35 Changed to OnStartServer 2019-10-04 04:42:48 -04:00
Chris Langsenkamp
24052428e0 Removed unused Players object from scene 2019-10-04 04:25:18 -04:00
Paul Pacheco
c85d0df533
fix: webgl build fix #1136 (#1137) 2019-10-03 01:05:28 -05:00
MrGadget
5dfc85931f Obsoletes OnServerAddPlayer (#1134)
* Obsoletes OnServerAddPlayer(NetworkConnection conn, AddPlayerMessage extraMessage)

* Fixed NetworkManager

* Fixed Pong

* Fixed Room

* Wrapped call in warning suppressors

* Improved comments
2019-10-02 10:26:19 +02:00
MrGadget
e73185932a Updated Basic Example (#1135)
* Updated Basic Example

* Added more comments

* addes more comments
2019-10-01 21:52:36 -05:00