Commit Graph

5250 Commits

Author SHA1 Message Date
Paul Pacheco
e6f8cec658 Initialize objects in the same order as they were initialized on the server. (#144)
This avoid heisenbugs because for a user they might initialize in a different order than the developer
2018-12-09 10:21:42 +01:00
Paul Pacheco
853d797dfe Connections can no longer be null 2018-12-08 21:34:38 -06:00
Paul Pacheco
3af459a107 Reuse ReadMessage from reader (#143) 2018-12-08 10:55:21 +01:00
Paul Pacheco
56007f3c8b RemovePlayerMessage is empty (#142) 2018-12-08 10:55:00 +01:00
Paul Pacheco
8ce2489df0 Display message name in ConnectionRecv log (#141) 2018-12-08 10:54:20 +01:00
Paul Pacheco
413d7cf474 Use functional method to read messages (#140) 2018-12-07 09:52:03 +01:00
vis2k
04af6c9015 Removed unused OnDeserializeAllSafely version 2018-12-06 23:08:19 +01:00
Paul Pacheco
c10a5fc999 Simplify components serialization (#139)
* Performance optimizations in NetworkIdentity.uNetUpdate

* Don't copy array twice

* write to one NetworkWriter for gameobject instead of one per component

* Simplify component serialization and improve performance

* Small style cleanup

* Fix compilation error

* Revert this change for now

* Revert for now

* Remove this for now

* No need for 2 versions of OnSerializeAllsafely

* Removed bad comment

* simplify using foreach
2018-12-06 22:17:04 +01:00
Chris Langsenkamp
6d33fae44f Added link to migration tool 2018-12-04 07:48:15 -06:00
Paul Pacheco
3515aff816 Check if any component is dirty before serializing stuff (#135) 2018-12-04 11:11:55 +01:00
Paul Pacheco
15a5271553 Fix #133, destroy all objects when server shutdowns (#134)
When the server shut down,  all clients are disconnected,  but we were not calling OnDisconnect for the in the server
so we did not clean up their objects
2018-12-03 21:21:08 +01:00
Tim Pickup
b08646dae6 Network server stale connections (#129)
* Fixes 2 bugs:
NetworkServer.cs was not clearing connections on stopping. This meant when then starting again it was trying to communicate with old connections. Simply clear the list in DisconnectAllConnections. Also put in InternalListen for just in case as there should never be any connections at that point.
NetworkClient.cs was unable to load the scene on connect under certain circumstances. This was because NetworkClient.pauseMessageHandling had been set to false on a previous failed connection attempt. On a subsequent connect it would then never accept messages after it connected successfully so didnt know to load the scene. Simple fix to set NetworkClient.pauseMessageHandling to false when connecting. It should never be true at this point.

* split 2 fixed into 2 branches
NetworkServer.cs was not clearing connections on stopping. This meant when then starting again it was trying to communicate with old connections. Simply clear the list in DisconnectAllConnections. Also put in InternalListen for just in case as there should never be any connections at that point.

* moved into Initialize() for neatness
2018-11-30 10:19:28 +01:00
Tim Pickup
525600b56d Network client stale pause message handling (#130)
* Fixes 2 bugs:
NetworkServer.cs was not clearing connections on stopping. This meant when then starting again it was trying to communicate with old connections. Simply clear the list in DisconnectAllConnections. Also put in InternalListen for just in case as there should never be any connections at that point.
NetworkClient.cs was unable to load the scene on connect under certain circumstances. This was because NetworkClient.pauseMessageHandling had been set to false on a previous failed connection attempt. On a subsequent connect it would then never accept messages after it connected successfully so didnt know to load the scene. Simple fix to set NetworkClient.pauseMessageHandling to false when connecting. It should never be true at this point.

* split 2 fixes into 2 branches
NetworkClient.cs was unable to load the scene on connect under certain circumstances. This was because NetworkClient.pauseMessageHandling had been set to false on a previous failed connection attempt. On a subsequent connect it would then never accept messages after it connected successfully so didnt know to load the scene. Simple fix to set NetworkClient.pauseMessageHandling to false when connecting. It should never be true at this point.
2018-11-30 10:17:00 +01:00
Tim Pickup
0b6479727b Added int channelId to GetMaxPacketSize so different channels can have different max packet sizes. (#125)
Useful for transports where you have an unreliable channel thats limited differently
2018-11-29 18:05:36 +01:00
Paul Pacheco
590630fcb2 Don't require Cmd, Rpc and Target prefixes (#127)
The restriction is arbitrary.  Let the user use any name they want.
2018-11-29 16:48:13 +01:00
Paul Pacheco
229250d726 Document callback changes 2018-11-28 11:19:18 -06:00
Paul Pacheco
f22f4a2c8e Remove and RemoveAt now get the item that was removed 2018-11-28 11:19:18 -06:00
vis2k
1e55a28f67 Removed NetworkManagerPreview because it offer nothing of value and no one even knew that it existed 2018-11-28 11:37:26 +01:00
Paul Pacheco
e8a5cfae65 Start server if headless mode (#126)
* Start the server automatically if headless mode

* spaces
2018-11-28 09:50:03 +01:00
vis2k
283725c71c Updated Telepathy to latest version 2018-11-22 10:57:28 +01:00
Paul Pacheco
bcef255b99 varint synclist indexes, fixes #120 (#122) 2018-11-19 15:42:06 +01:00
Paul Pacheco
befd3fa36c pass index of element during add. Fix #118 (#121)
* Reproduce the issue in a unit test

* Pass the index of the element with add

fix issue #118
2018-11-19 15:41:53 +01:00
vis2k
5427bf292c NetworkWriter.WriteBytesAndSize doesn't depend on Transport.layer.GetMaxPacketSize anymore. Mirror checks that in NetworkConnection etc. anyway. Writer should just write to the stream, no magic. 2018-11-15 09:38:25 +01:00
vis2k
1289dee8b3 Transport.MaxPacketSize moved to TransportLayer.GetMaxPacketSize because it depends on the layer 2018-11-15 09:22:13 +01:00
vis2k
7056ccd428
Update README.md 2018-11-13 21:15:39 +01:00
Paul Pacheco
e0c857e240
Put donations first 2018-11-13 13:56:35 -06:00
Paul Pacheco
27f67c449e
Added forum badge 2018-11-13 13:55:15 -06:00
Paul Pacheco
f3f8e3ed3c
Add download badge
Add badge with link to asset store page
2018-11-13 13:50:28 -06:00
Paul Pacheco
06eae9e1bf
Patreon badge
Added a patreon badge
2018-11-13 13:47:27 -06:00
Paul Pacheco
060fd2ce46
Add badge for the latest release
Add badge with link to the latest release
2018-11-13 13:35:20 -06:00
vis2k
ef76703c3d
Update README.md 2018-11-13 20:21:28 +01:00
vis2k
f7e3af7efc
Update README.md 2018-11-13 20:15:54 +01:00
vis2k
b7dc43cc5d
Update README.md 2018-11-13 20:15:31 +01:00
vis2k
5c8fdea4ab
Update README.md 2018-11-13 20:11:46 +01:00
Chris Langsenkamp
f8492ef980 Fix typo: NetworkHash128 2018-11-12 11:43:45 -06:00
Zac North
2f2c595f41 Added additional information about OnServerAddPlayer override 2018-11-12 09:43:52 -06:00
Zac North
facbbf13c5 Added new section for extended components 2018-11-12 09:43:52 -06:00
Paul Pacheco
ed5f00d165 Add warning if we can't find scene object (#113) 2018-11-11 22:13:14 +01:00
Paul Pacheco
f7fb8edc4e Derived classes should have access to telepathy 2018-11-11 07:20:36 -06:00
Paul Pacheco
2fe6d789d4 made transport methods virtual so they can be overriden and extended 2018-11-11 06:43:59 -06:00
Paul Pacheco
00e144567c Don't override transport if user already initialized it somewhere else (#112) 2018-11-11 10:35:36 +01:00
Paul Pacheco
5ba54dfe3a
Merge pull request #110 from MrGadget1024/patch-1
Replace NetworkHas128 and NetworkInstanceId
2018-11-10 15:55:45 -06:00
Chris Langsenkamp
e884fc0ea6
Replace NetworkHas128 and NetworkInstanceId
Added instructions to replace NetworkHas128 and NetworkInstanceId
2018-11-10 14:30:24 -05:00
Paul Pacheco
29bff45555 Remove unused meta 2018-11-10 09:58:36 -06:00
vis2k
91a54f4652
Update README.md 2018-11-09 15:50:35 +01:00
vis2k
5ef2c4660c Telepathy updated to latest version 2018-11-09 08:45:15 +01:00
TimPickup
670a650bbd Fixes a bug: When you have NetworkManager unticked for server bind to ip and have the server bind address blank, it in fact passes "127.0.0.1" to ServerStart. The fix passes null if nothing is specified in which case the server should not bind to a IP. (#107)
This has not been an issue before as TelepathyTransport.cs ignores the passed value.

Should consider adding the functionality to Telepathy.
2018-11-07 22:15:32 +01:00
vis2k
ff70acc24c NetworkBehaviour: removed unused EventDelegate 2018-11-03 10:43:25 +01:00
vis2k
8140821ba7 Removed whitespaces 2018-11-03 10:43:12 +01:00
vis2k
28d930313b LogFilter: removed unused imports 2018-11-03 10:29:02 +01:00