Commit Graph

246 Commits

Author SHA1 Message Date
vis2k
ee1b1c0b2b Telepath updated to latest version 2019-02-17 09:00:10 +01:00
vis2k
2ec7de32df Fix LLAPI.ToString 2019-02-17 08:55:28 +01:00
Chris Langsenkamp
ea3b48ab87 Replaced vars with explicit types (#411) 2019-02-17 08:45:13 +01:00
vis2k
8c441e8fe9
Transport.ServerGetClientAddress (#412) 2019-02-17 08:44:19 +01:00
Paul Pacheco
82cf23d348 Improve some comments 2019-02-15 06:29:54 -06:00
vis2k
bfe6e6aa28 better comments 2019-02-15 13:12:38 +01:00
vis2k
6a33c2d8bf ClientScene.OnSpawnPrefab and NetworkManager.OnServerAddPlayerInternal: spawn objects with prefab names to avoid unnecessary "(Clone)" suffix from Unity. otherwise we need a name sync component in all games that show the names, e.g. MMOs for all monsters. This way we only need name sync components for objects that actually do change names, e.g. players. 2019-02-15 13:02:18 +01:00
vis2k
871fe9a7f4 syntax 2019-02-15 12:43:49 +01:00
vis2k
bc52ff5e62 TelepathyTransport: remove old comments 2019-02-15 12:41:12 +01:00
vis2k
ab30ac6141 Fix #223: NetworkServer.DestroyPlayerForConnection tries to destroy both player controller and player owned objects if not null. No need to return early. 2019-02-14 13:38:34 +01:00
vis2k
5899cf81b5 refactor the fix for #389 2019-02-14 13:32:07 +01:00
uwee
0187163f70 fix for inactive scene in editor (#389)
* fix for inactive scene in editor

* changed to use #if UNITY_EDITOR
2019-02-14 13:26:53 +01:00
vis2k
9b232b0551 Revert "Source based weaver (#319)"
This reverts commit 8d7613b9b6.
2019-02-13 15:59:32 +01:00
vis2k
d159e9c78b
Configurable Server Tickrate (#390)
* Configurable Server Tickrate

* only  Update
2019-02-11 10:49:44 +01:00
Paul Pacheco
8d7613b9b6 Source based weaver (#319)
* Example for weaver issue

* Fix #314,  weave assemblies built before the weaver

* Don't need the example anymore

* Update CompilationFinishedHook.cs

* Dont try to load assemblies while they are being modified

* Revert "Weave dll again. Plan B for #314 (#323)"

This reverts commit b20cb4280c.
2019-02-09 18:14:26 +01:00
Paul Pacheco
1249ec25ac Fix #371, NetworkAnimator can support more than 6 variables (#387) 2019-02-08 09:32:36 +01:00
Chris Langsenkamp
d1626f7842 Add a virtual method that fires on the client right before scene change so devs can implement client-side work / prep / cleanup / visuals / etc. based on what scene is about to be loaded. (#383)
Documentation updates included.
2019-02-07 13:37:54 +01:00
Chris Langsenkamp
f1bdd8620c Update TelepathyTransport.cs (#382)
Added Help URL
2019-02-07 12:26:45 +01:00
Gabe Brown
a5515b099e BUG: TelepathyTransport delivers messages even when this.enabled == false across scene loads (#379)
* BUG: Fix issue where setting this.enabled = false doesn't get honored when transitioning from Local Offline Host to Connected Server.

* Update TelepathyTransport.cs
2019-02-07 10:13:23 +01:00
Chris Langsenkamp
5e642af577 Update NetworkManager.cs (#376)
Make "Multiple NetworkManagers detected" a full time error not hidden by log filter.
2019-02-06 15:30:16 +01:00
vis2k
548876a9b6 Syntax 2019-02-05 10:07:02 +01:00
Paul Pacheco
fba7b3f826 Add multiplex transport (#358)
* Add multiplex transport

* Simplify Availability method

* Update MultiplexTransport.cs
2019-02-05 10:02:32 +01:00
vis2k
4c749df4fa Telepathy updated to latest version 2019-02-02 14:37:32 +01:00
vis2k
ca4ef1d8b3 LLAPITransport: expose connectionconfig and globalconfig in inspector 2019-02-02 11:08:52 +01:00
vis2k
de4b08d066 LLAPITransport: fix localhost connections 2019-02-02 11:08:20 +01:00
vis2k
1cc125d6c6 LLAPITransport: fix max connections error 2019-02-02 11:05:16 +01:00
vis2k
a210e8ce65 LLAPITransport: fix hostId out of bounds error 2019-02-02 11:02:45 +01:00
vis2k
dbbdcd02c7
Onserialize improvements (#302)
* position magic instead of allocating writers

* premature optimizations here we come

* simplify. less magic.

* better logging

* fix ondeserialize bugs caused by readpacketuint32 instead of readint32
2019-02-01 13:23:21 +01:00
vis2k
e690360f41 Updated Telepathy to latest version: Net 4.x, ConcurrentQueue/Dictionary, Fixed growing thread count bug in #347 2019-02-01 13:00:54 +01:00
vis2k
e6f5511d24 TelepathyTransport.ToString: fix NRE in server-only mode while listener wasn't created yet 2019-02-01 12:02:58 +01:00
Chris Langsenkamp
22e88cd8d4 Superfluous Code (#366)
Immediately after the deleted lines is a call to `OnClientDisconnect(netMsg.conn);` which calls `StopClient();` which has the exact same code on line 344 as what I'm proposing be deleted here.
2019-02-01 09:48:49 +01:00
vis2k
cb6bb75ee1 Use LateUpdate in Transports. Fixes race condition where Mirror would complain about 'Observer not ready for ...' when stress testing uMMORPG after bots machine was shutdown. 2019-01-31 16:19:14 +01:00
Chris Langsenkamp
46befb6682 Add Help URL attributes to components (#359) 2019-01-31 12:16:31 +01:00
Paul Pacheco
ee5befdd6d Body expressions 2019-01-30 19:11:05 -06:00
Paul Pacheco
52887c2292 Body expressions 2019-01-30 19:10:53 -06:00
Paul Pacheco
c98f0c050c Body expressions 2019-01-30 19:10:21 -06:00
Paul Pacheco
c2fbda6755 Body expressions 2019-01-30 19:10:12 -06:00
Paul Pacheco
869ae95138 Body expressions 2019-01-30 19:09:57 -06:00
Paul Pacheco
027dd3f91e Use body expressions 2019-01-30 19:03:57 -06:00
Paul Pacheco
00c0d5a800 Use body expressions 2019-01-30 19:03:09 -06:00
Paul Pacheco
b816045c06 Null-conditional 2019-01-30 18:40:21 -06:00
Paul Pacheco
07e3d48dde null-conditional operator 2019-01-30 18:37:21 -06:00
Paul Pacheco
17eedda836 null-conditional operator 2019-01-30 18:33:01 -06:00
Paul Pacheco
e15d3cdd71 Removed redundant conditional 2019-01-30 18:30:01 -06:00
Paul Pacheco
332416432e .Net 4.x object initialization syntax 2019-01-30 18:25:26 -06:00
Paul Pacheco
d4cd4aef06 Use null-conditional operator 2019-01-30 18:21:12 -06:00
Paul Pacheco
beeef0cb96 Use null-conditional operator 2019-01-30 18:15:09 -06:00
Paul Pacheco
915dbd7af7 4.x syntax 2019-01-30 18:09:41 -06:00
Paul Pacheco
67767cb131 Fix namespace 2019-01-30 18:09:41 -06:00
uwee
0b5d325062 Removed hostPort as its no longer used. (#360) 2019-01-30 22:12:49 +01:00
Paul Pacheco
ed4c577680 This class should never be instantiated 2019-01-30 07:58:22 -06:00
Paul Pacheco
f6af36d74b 4.x syntax 2019-01-30 07:56:55 -06:00
Paul Pacheco
138dfaa6e1 4.x syntax 2019-01-30 07:55:34 -06:00
Paul Pacheco
7d081da541 4.x syntax 2019-01-30 07:53:04 -06:00
Paul Pacheco
306f974e0c 4.x syntax 2019-01-30 07:39:21 -06:00
Paul Pacheco
ca6224d238 4.x syntax 2019-01-30 07:37:53 -06:00
Paul Pacheco
63f6e40289 4.x syntax 2019-01-30 07:32:43 -06:00
Paul Pacheco
272ac79409 4.x syntax 2019-01-30 07:31:40 -06:00
Paul Pacheco
a0b5d15362 4.x object initialization syntax 2019-01-30 07:27:30 -06:00
Paul Pacheco
b67fe66a91 4.x syntax 2019-01-30 07:24:58 -06:00
Paul Pacheco
69f07547c7 4.x object initialization syntax 2019-01-30 07:22:19 -06:00
Paul Pacheco
4bc87f74fd 4.x syntax 2019-01-30 07:20:52 -06:00
Paul Pacheco
39385d15ee Reduce server CPU usage by limiting framerate 2019-01-29 19:23:41 -06:00
Paul Pacheco
1b915fbffb Now we can stop even while connecting.
In some transports (Ignorance),  when the player clicks "Connect",   the transport goes in Connecting state. If the player clicks Disconnect
the transport remains in Connecting state.

This gives the transport a chance to cancel the Connecting process.  This fix has been tested for quite some time in 2018 branch
2019-01-29 19:07:18 -06:00
Paul Pacheco
6c163d1a45 Fix NRE when disconnecting 2019-01-29 19:01:03 -06:00
vis2k
2e0c38aec8 Upgrade to Unity 2018.2.20f1 2019-01-29 22:44:24 +01:00
vis2k
b20cb4280c
Weave dll again. Plan B for #314 (#323)
* weaver as dll again

* add plugins/weaver folder with latest weaver dll

* Remove unnecessary Debug-Editor/Release-Editor configurations

* Remove old comment

* Build into Assets/Mirror/Plugins directly
2019-01-28 18:20:18 +01:00
vis2k
1a5ce38163
Dispatch Messages as Events - via UnityEvent (#350)
* Transport as events - via UnityEvent

* call RemoveTransportHandlers();

* hide event in inspector until we actually need them
2019-01-27 20:58:22 +01:00
Callum Ferguson
f98d3405f5 Fixed bug allowing one more than max connections to join (#349) 2019-01-27 11:12:40 +01:00
Paul Pacheco
ac07ac8941
Renamed class for clarity (#346) 2019-01-26 09:24:22 -06:00
Paul Pacheco
3a6b37c779
Assign transport in inspector (#344)
* Assign transport in inspector

* Update NetworkManager.cs

* Update NetworkManager.cs

* Update NetworkManager.cs

* Update NetworkManager.cs

* Move transport under NetworkInfo

* Updated scene with new properties
2019-01-26 08:20:33 -06:00
vis2k
90e8fabde9 ITransport converted to Transport as MonoBehaviour 2019-01-26 10:32:16 +01:00
vis2k
41a385afd8 NetworkServer HandleConnection: check if connectionId already in use 2019-01-25 15:02:57 +01:00
vis2k
e31a3a3c4d NetworkServer HandleConnection: >0 check added to fix #321 2019-01-25 15:00:26 +01:00
vis2k
fe02dcab4c Syntax 2019-01-24 20:00:09 +01:00
Paul Pacheco
9c990b938f Remove Network Manager Editor (#310)
* Remove Network Manager Editor

* Add reorderable list to prefabs

* Move Start On Headless to more logical place
2019-01-24 16:56:25 +01:00
vis2k
53fc33cce8 TelepathyTransport: added NoDelay option 2019-01-24 12:09:28 +01:00
vis2k
4f61dc9bc5 Updated Telepathy again. Forgot to check SendMessagesBlocking return value before. 2019-01-22 19:35:35 +01:00
vis2k
b3eb092878 NetworkTransformBase: remove unnecessary connectionToServer check 2019-01-22 16:34:12 +01:00
vis2k
98b786514c Telepathy updated to latest version (performance improvements under heavy load) 2019-01-22 15:45:10 +01:00
vis2k
e969fcf26c More #if fixes (again) 2019-01-21 14:38:53 +01:00
petris
15c5926041 Fix #if 2019-01-20 09:28:17 -06:00
vis2k
3396e56133 Telepathy updated to latest version (Stop always returns and .Active is definitely false afterwards) 2019-01-20 14:26:24 +01:00
vis2k
12f0ba6a64 NetworkTransformBase: fix interpolation being applied to a client's object that he had authority over. fixes #273 2019-01-18 17:50:43 +01:00
vis2k
1b90647f72 Pong: only simulate ball physics on server. Fixes #304 2019-01-18 17:34:59 +01:00
vis2k
32ed3cb540 Pong: Use OnStartServer instead of Server and ServerCallback 2019-01-18 17:32:03 +01:00
vis2k
c975d87310 Syntax 2019-01-18 17:30:30 +01:00
vis2k
4e6d44f3f7 Fix typo 2019-01-18 17:30:15 +01:00
vis2k
c0b2a74c11 Move NetworkReader.ReadMessage to the actual ReadMessage function 2019-01-18 13:09:58 +01:00
vis2k
ce8ede3db3
OnServerAddPlayer uses NetworkMessage parameter instead of NetworkReader. Removes last dependency on NetworkReader.ReadMessage (#307) 2019-01-18 13:08:19 +01:00
vis2k
183afac99a
move startOnHeadless to NetworkManager (#309) 2019-01-18 13:04:05 +01:00
vis2k
904535409d Updated Telepathy to latest version (big endian headers) 2019-01-18 13:00:13 +01:00
vis2k
1c83c74da0
Transport components (#308)
* Convert Transport to component; remove websockets property

* Improve warning

* Automatically add default Transport if needed

* Added Transports to scenes

* Move port to Transport

* Detected too late

* Interface

* Virtual transport property just in case

* HUD shows transport.tostring

* LLAPITransport UseWebsockets option

* Remove bindToIp and ServerStart(ip) parameter. let transport handle it if needed.

* TelepathyTransport.ToString

* Remove unused function

* LLAPITransport.ToString

* Don't duplicate ports

remote endpoint already has the port.
If you have ipv6, it will show like this:
```[::]:7777```
[::] is localhost in IPv6

If you have ipv4, it will show like this:
```127.0.0.1:7777```

* Removed unused labels

* Syntax

* Updated Telepathy to latest version

* localendpoint
2019-01-17 18:14:05 +01:00
vis2k
4cf35eb9cd Updated Telepathy to latest version 2019-01-17 18:02:44 +01:00
Paul Pacheco
d8bcbe0c62 Start on Headless is optional 2019-01-16 23:13:05 -06:00
vis2k
0ef7bc2c5a Revert NetworkClient.UpdateClients foreach because it causes an InvalidOperationException when stopping the client. 2019-01-17 01:21:33 +01:00
vis2k
6738d95b28 NetworkConnection: removed unused imports 2019-01-16 22:24:25 +01:00
vis2k
123dbe8cd8 NetworkBehaviour: remove unnecessary 'private' modifiers 2019-01-16 22:23:22 +01:00
vis2k
8844616c33 LocalClient: remove unnecessary 'private' modifiers 2019-01-16 22:17:23 +01:00
vis2k
4ece68d053 OnObjectSpawnFinished message split into OnObjectSpawnStarted + OnObjectSpawnFinished. Saves 2 bytes of bandwidth per client spawn, and makes the code more obvious. 2019-01-16 22:10:08 +01:00