Commit Graph

1140 Commits

Author SHA1 Message Date
MrGadget
3e92f53a36 Update NetworkRoomPlayer.cs (#1094)
CmdChangeReadyState needs to be public
2019-09-21 09:25:01 -05:00
Paul Pacheco
a351879f91 perf: avoid boxing if there is no profiler 2019-09-21 08:19:07 -05:00
vis2k
4a13773dbc remove old comment 2019-09-21 10:47:34 +02:00
Chris Langsenkamp
760b5284b9 Fixed obsoletes and comments 2019-09-20 20:31:41 -04:00
Paul Pacheco
5985e6d641 GetRpcMethod does not need an instance 2019-09-19 23:31:43 -05:00
Paul Pacheco
bc87649be6 Don't report out messages if there are no recipients 2019-09-19 23:27:34 -05:00
Paul Pacheco
e742ffad4b Messages must be public for profiler 2019-09-19 23:26:50 -05:00
Paul Pacheco
838d4f019f
fix: Fix error scene error message in host mode
When using online scene and starting host mode,  users were getting:

```
Closing connection: 0. Received message Mirror.SceneMessage that required authentication
```
2019-09-18 18:13:26 -05:00
MrGadget
e88316f336 Rename NetworkConnection.playerController to identity (#1092)
* change playerController to identity

* improved obsolete

* Obsolete comment
2019-09-18 10:32:26 +02:00
Chris Langsenkamp
9f09c21680 Revert "Remove add component from deprecated components (#1087)"
This reverts commit 8a99ab16e8.
2019-09-17 23:23:13 -04:00
Chris Langsenkamp
6e4409b786 Fixed double-spaced bullets in docs 2019-09-17 20:34:26 -04:00
MrGadget
958e2ad612 Redefine SceneMessage (#1093)
* Redefine SceneMessage

* Add obsolete method

* Removed SceneLoader
2019-09-17 22:59:16 +02:00
Paul Pacheco
7ac43cd56a feat: Secure messages that require authentication, fixes #720 (#1089)
* feat: Secure messages that require authentication, fixes #720

* Rename the parameter for clarity

* Update Assets/Mirror/Runtime/MessagePacker.cs

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

* Update Assets/Mirror/Runtime/MessagePacker.cs

Co-Authored-By: MrGadget <chris@clevertech.net>
2019-09-17 22:16:37 +02:00
MrGadget
56bcb02c15 feat: Authentication Framework (#1057)
* Component-based Authentication

* Capitalized IsAuthenticated

* Added isAuthenticated to NetworkConnection

* Removed activeAuthenticator as unnecessary

* Removed unnecessary using

* Added more comments

* Documentation

* Added cs to code blocks in doc

* fixed typo in doc

* Doc improvements

* Fixed another typo in doc

* Removed HideInInspector

* Updated doc and image

* Fixed comment

* Added inspector header and tooltips

* Fixed typo

* Add AuthenticationData object

* Add a bullet point in the doc about AuthenticationData

* Updated screenshot image

* Added HelpURL attribute

* Added Initializers for both Server and Client

* Fixed doc grammar and phrasing

* Forgot to add the ClientInitialize in StartHost

* Updated doc with info about the initializers

* Changed initializers from bool to void.

* Eliminated the abstract model and renamed to NetworkAuthenticator and made all methods virtual

* Fixed comment

* Fixed typo

* Doc cleanup

* Doc Cleanup

* authenticator RemoveAllListeners in StopServer and StopClient

* Update Assets/Mirror/Runtime/NetworkManager.cs

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

* Changes requested by Vis

* reverted conflicting change

* Revert "reverted conflicting change"

This reverts commit f65870e073.

* UnityEditor.Undo.RecordObject

* made the name camelCase

* Added internal methods and On prefix to methods

* Reverted this change so it can be done in a separate PR

* Moved authenticator calls to after runInBackground

* Add built-in timeout feature

* Changed UnityEditor.Undo.RecordObject to use gameobject

* Convert to Abstract, add Basic Authenticator, update docs.

* Removed timeout, against my better judgement.

* Removed the rest of timeout, still against my better judgement

* Fixed event listener mappings

* Renamed and consolidated methods

* updated doc and image

* made OnClientAuthenticate and OnServerAuthenticate abstract

* Updated Debug log msgs

* changed to authenticator != null

* Renamed to NetworkAuthenticator
2019-09-17 10:41:04 +02:00
Paul Pacheco
e67035e971 Add profiler hooks (#1086)
* Add profiler hooks

* Polish API a bit

Now if we want to add more fields,  we can do so without
breaking profilers

* Provide documentation for the profiler data

* Use -1 channel until we implement this feature

* Use C# events instead of UnityEvent

* Simplify message info structure

* Renamed class

* Send -> OnSend
Receive -> OnReceive

* Update Assets/Mirror/Runtime/NetworkConnection.cs

* Update Assets/Mirror/Runtime/NetworkDiagnostics.cs

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

* Update NetworkDiagnostics.cs
2019-09-17 08:45:51 +02:00
MrGadget
8a99ab16e8 Remove add component from deprecated components (#1087) 2019-09-16 22:14:02 -05:00
vis2k
229e5e8d6e remove trailing whitespace 2019-09-15 19:04:33 +02:00
vis2k
524abfc5e8 fix: NetworkManager OnValidate wouldn't properly save the automatically added Transport before because Undo.RecordObject is needed for that now. 2019-09-15 19:04:33 +02:00
Paul Pacheco
5a9e14c79e
Expose methods for profiler (#1083) 2019-09-15 09:43:36 -05:00
vis2k
06c3385e7d fix comment 2019-09-14 13:19:17 +02:00
vis2k
dcafadfdba fix #1073 sync components with different intervals and add test (#1077) 2019-09-12 07:56:59 -05:00
vis2k
245dcfd1d9 forgot internal 2019-09-12 14:23:11 +02:00
MrGadget
d5e6bbc552 Clear Handlers on NetworkClient.Shutdown (#1069)
* Clear handlers on Shutdown

* Update NetworkClient.cs

* Update NetworkClient.cs
2019-09-12 13:35:08 +02:00
vis2k
414fa9cfb9 forgot to make internal for test 2019-09-12 11:52:24 +02:00
vis2k
811f3f63c3 Add test for ClearAllComponents and syncInterval 2019-09-12 11:49:43 +02:00
vis2k
aae0a72143 add comment 2019-09-12 11:40:11 +02:00
vis2k
4eedae1d91 rename to ClearAllComponentsDirtyBits 2019-09-12 11:36:49 +02:00
vis2k
ce5484742b remove trailing whitespace 2019-09-12 11:21:12 +02:00
vis2k
f65f9e47db add comment 2019-09-12 11:21:04 +02:00
vis2k
81bb208d1d rename NetworkIdentity.ClearDirtyBits to ClearAllDirtyBits because that's what it does. It doesn't just clear some, it always clear all no matter what. 2019-09-12 11:20:27 +02:00
vis2k
584cda0508 consistent indentation with comment below 2019-09-12 10:45:27 +02:00
MrGadget
1b37a2160e Room Game Player Camera Restore (#1075)
Restore camera when Game Player is destroyed
2019-09-12 10:15:01 +02:00
MrGadget
5b9752558e Put all RoomPlayer's in DDOL (#1074)
* Put all RoomPlayer's in DDOL

* Simplify by using pattern matching
2019-09-12 10:14:44 +02:00
MrGadget
0bd898dc32 doc: Add XML comments to Custom Attributes (#1071)
* Add XML comments to Custom Attributes

* We don't throw errors,  just display them
2019-09-11 23:23:33 -05:00
MrGadget
650f9caa50 Remove privates (#1072) 2019-09-11 23:07:44 -05:00
MrGadget
4ac4c06135 Don't reload offline scene (#1066)
* Don't reload offline scene

Check if we're already in the offline scene before calling ClientChangeScene to the offline scene.

* Update NetworkManager.cs
2019-09-11 10:07:35 +02:00
MrGadget
0e95016e95 Lobby to Room (#1065)
* Change Lobby to Room with Obsoletes

* Changed folder from Lobby to Room

* Updated docs

* reverted leftover debu.log line

* Fixed OfflineGUI

* Changed the obsolete classes to inherit from the new ones.

* Fixed SyncVar hook
2019-09-11 10:06:25 +02:00
MrGadget
b3030aff85 Add check for sceneMode (#1054)
* Add check for sceneMode

* Added comment
2019-09-10 17:36:02 +02:00
vis2k
913d503fda Revert "Inserted blank lines where appropriate"
This reverts commit af84a1730b.
2019-09-05 19:45:25 +02:00
MrGadget
c84c3892bc Reset Start Position Index (#1058) 2019-09-05 10:45:23 -05:00
MrGadget
da8b2f1d59
Updated xml comments 2019-09-05 09:55:08 -04:00
MrGadget
af84a1730b
Inserted blank lines where appropriate 2019-09-05 09:52:49 -04:00
Paul Pacheco
87385628f0
fix: code generation works with il2cpp again (#1056) 2019-09-04 10:26:06 -05:00
Paul Pacheco
c00bb2d81d
No need to read symbols (#1055)
Should speed up build slightly.
If user has old symbols we don't care, so don't give an error.
2019-09-04 10:25:53 -05:00
MrGadget
ddd51e577e Don't call Ready if we're ready already (#1049)
* Fix typo

* Check ClientScene.ready
2019-09-04 10:29:48 +02:00
Paul Pacheco
5aac362f07 Remove unused usings 2019-09-03 20:39:30 -05:00
Paul Pacheco
463bdfa2fa Remove unnecesary usings 2019-09-03 20:37:11 -05:00
Paul Pacheco
4ef680a474 fix: suppress warning on standalone build #1053 2019-09-03 18:09:30 -05:00
Paul Pacheco
13ca6b6542 Remove unnecesary using 2019-09-03 18:01:17 -05:00
Paul Pacheco
34e1f45615 Remove redundant tostring 2019-09-03 18:00:45 -05:00
Paul Pacheco
e939b9734d Remove redundant castings 2019-09-03 18:00:18 -05:00
Paul Pacheco
00eb23aa01
fix: error with missing assemblies (#1052)
* fix: error with missing assemblies

During first import,  the weaver will be called before all assemblies
are built.  No need to look for custom readers and writers if the assemblies
are not built.

fixes #1051

* forgot using
2019-09-02 23:46:27 -05:00
Paul Pacheco
74faf2a95b fix: missed ushort reader/writer 2019-09-02 12:17:56 -05:00
MrGadget
68ce6327bc Updated Pong 2 (#982)
* Turned off Simulated & Set Transform Interval to zero

* Set sync interval to zero

* Removed ballPrefab field

* Cached RigidBody & simplified FixedUpdate

* Cached RigidBody and Moved Start code to OnStartServer

* Scene file updated

* Updated Scene file again

* Moved comments and fixed typos

* Eliminated GetComponent in code

* Assigned Rigidbody2d in inspector of prefabs
2019-09-02 19:06:04 +02:00
Paul Pacheco
b45afad641 feat: custom reader/writer via extension methods (#1047)
* Remove hardcoded writers from weaver

* Remove hardcoded readers from weaver

* Remove unused stuff

* cleanups

* Cleanup some comments

* remove unused import

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

* Improve comments a bit

* small cleanups

* Remove redundant private keyword

* Remove unnecesary blank space

* Remove unused field

* Measure how long it takes to find the readers and writers

* Find all extension methods for readers and writers

* Get rid of debugging log

* Don't comment obvious stuff

* Don't swallow exception

* only scan static classes for extension methods

* Add unit test for custom readers and writers

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

* Update Assets/Mirror/Runtime/NetworkWriterExt.cs

* Update ReaderWriterProcessor.cs

* Renamed to avoid abreviations

* Move the extensions inside the same .cs

* Update NetworkReader.cs

* Update NetworkWriter.cs
2019-09-02 18:57:45 +02:00
Paul Pacheco
e0b66db335 Link to non obsolete methods in xmldocs 2019-08-31 16:12:25 -05:00
Paul Pacheco
a61635424f Remove unncesary casting 2019-08-31 14:48:59 -05:00
Paul Pacheco
4638342168 Remove unnecesary casting 2019-08-31 14:47:19 -05:00
Paul Pacheco
32b72c959d use compound assignment 2019-08-31 14:46:12 -05:00
Paul Pacheco
42b635346a linting 2019-08-31 14:44:53 -05:00
Chris Langsenkamp
438dbfdf03 Fixed typo 2019-08-31 13:12:30 -04:00
Paul Pacheco
ae7fd90f1f use array segment for reading string 2019-08-30 23:16:30 -05:00
Paul Pacheco
7f8840c9b6 refactor to use arraysegment 2019-08-30 23:12:51 -05:00
Paul Pacheco
702b183034 Removed more unused variables 2019-08-30 21:49:26 -05:00
Paul Pacheco
bd44d35bae Use dfault uint64 writer 2019-08-30 21:46:12 -05:00
Paul Pacheco
cab08b1b5a Use default int32 writer 2019-08-30 21:42:53 -05:00
Paul Pacheco
3181b4a5d4 Use default uint64 reader 2019-08-30 21:39:50 -05:00
Paul Pacheco
e389f62c2d Use default reader for uint32 2019-08-30 21:37:19 -05:00
Paul Pacheco
609480208c use default int32 reader 2019-08-30 21:35:00 -05:00
Paul Pacheco
a5d4f46980 test: fix invalid unit test 2019-08-30 17:56:42 -05:00
Chris Langsenkamp
4a78288c92 Updated Comments 2019-08-30 13:48:32 -04:00
vis2k
c6d86b301b
feat: component based SyncToOwner, fixes #39 (#1023)
* adjust comments

* NetworkBehaviour.syncMode

* show in Editor

* feat: component based SyncToOwner, fixes #39

* rename to Observers

* rename writers and comments too

* SendToReady old signature version

* shorter syntax

* fix segment write length

* fix NullReferenceException for local player

* update comment

* support runtime syncMode changes

* add a test

* remove comments

* UL suffix to avoid cast

* UL suffix

* remove empty line

* OnSerializeAllSafely returns how many components were written. MirrorUpdate only sends to owner/observer if anything written.

* fix tests
2019-08-26 15:21:59 +02:00
Chris Langsenkamp
9e1cb624ac Replace <T> with {T} for XML Docs Parser 2019-08-25 22:23:55 -04:00
Chris Langsenkamp
080bcb0a31 Updated HelpURL links 2019-08-25 22:10:00 -04:00
Paul Pacheco
614f4bc875 Fix xmldoc in NetworkTime 2019-08-25 08:30:44 -05:00
Paul Pacheco
4730b137cf Fix issue doc.csproj conflicting with other assemblies 2019-08-24 15:04:40 -05:00
Paul Pacheco
e1561bda02 Add mea for doc project 2019-08-24 12:36:25 -05:00
Paul Pacheco
35fee94d56
docs: switch to docfx for documentation (#1026)
* Moved doc files to docfx folder

* load csproj

* doc generation

* Run docfx

* Add docfx

* Deploy docs to mirror-networking.com

* use deploy phase

* deploy whole generated site

* Fixed the semantic release command

* Is last \ required?

* show debug log

* using lftp for site deploy

* Testing lftp

* Show current folder

* try -e command option

* Show me the files

* use plain ftp

* use choco install instead of cinst

* fix ssl certificate validation

* fix username

* Upload site to xmldocs folder

* no need to archive docs

* No need for debug output

* Fix file permissions

* show me .htaccess

* Show me contents

* Wipe out folder to fix permissions

* Set file permissions

* Fix file permissions

* complete toc list

* Migrated intro page

* Remove old docs

* Update link to docs

* Add link to github

* Only update docs for stuff in master

* This is a powershell command

* Update doc/articles/Concepts/Communications/RemoteActions.md

* Update doc/articles/Concepts/VisibilityCustom.md

* Update doc/articles/Concepts/Authority.md

* Update doc/articles/Concepts/GameObjects/SpawnObjectCustom.md

* Update doc/articles/Concepts/Authority.md

* Update doc/articles/Classes/SyncVars.md

* No need to run semver twice
2019-08-24 10:20:33 -05:00
Paul Pacheco
9e283b1f9b refactor: syntax fixes 2019-08-18 16:30:53 -05:00
Paul Pacheco
1070fee325 refactor: Unused parameter 2019-08-18 16:23:10 -05:00
Paul Pacheco
0bf6453aff refactor: fix warnings 2019-08-18 16:22:40 -05:00
Paul Pacheco
216c0cb65c docs: Document the network time class 2019-08-18 16:20:17 -05:00
Paul Pacheco
4bc4ec86ea docs: proper reference to non obsolete method 2019-08-18 16:05:49 -05:00
Paul Pacheco
12f338e142 docs: proper reference to non obsolete method 2019-08-18 16:05:03 -05:00
Paul Pacheco
325d30f42a docs: proper reference to non obsolete method 2019-08-18 16:04:30 -05:00
Paul Pacheco
d441c2faf9 refactor: unused parameters 2019-08-18 15:54:05 -05:00
Paul Pacheco
f78510a6a9 refactor: unused parameters 2019-08-18 15:53:05 -05:00
Paul Pacheco
5e2914be3c refactor: unused parameter 2019-08-18 15:52:10 -05:00
Paul Pacheco
2bae240534 doc: fix parameter name 2019-08-18 15:50:26 -05:00
Paul Pacheco
d08dd0328e refactor: handlers dictionaries should be readonly 2019-08-18 15:49:46 -05:00
Paul Pacheco
9e3ecc1ced perf: remove network transform allocation 2019-08-17 13:22:11 -05:00
vis2k
812c6434e2 remove empty line 2019-08-12 20:58:49 +02:00
vis2k
48785b594c remove empty line 2019-08-12 20:02:10 +02:00
Paul Pacheco
62d1887e62 feat: #869 support structs in other assemblies (#1022) 2019-08-12 19:25:23 +02:00
Paul Pacheco
bbe4ac8c19 Use explicit type 2019-08-11 12:56:39 -07:00
Paul Pacheco
63e958e8a8 sceneids should be readonly 2019-08-11 12:56:09 -07:00
Paul Pacheco
f79c05c109 Remove redundant field initializer 2019-08-11 12:55:40 -07:00
Paul Pacheco
ab44290ca8 refactor: remove redundant else 2019-08-11 12:54:39 -07:00
Paul Pacheco
9ef34701d9 refactor: cmdDelegate dictionary should be readonly 2019-08-11 12:53:32 -07:00
Paul Pacheco
1869c15173 doc: fix see tag 2019-08-11 12:52:32 -07:00