Commit Graph

517 Commits

Author SHA1 Message Date
Paul Pacheco
37445979da Replace NetworkInstanceId with uint (#70)
* Replace NetworkInstanceId with uint

* Rename variable for clarity

* rename variable for clarity

* Assign 0 instead of new uint()

* Align variables

* Rename variable for clarity

* Renamed variable for clarity

* Fix opcode issue with uint netIdField
2018-10-16 15:30:46 +02:00
vis2k
f2d4fac170 NetworkIdentity.observers returns m_Observers directly without creating a new ReadOnlyCollection every time. This was a performance nightmare because we looped through observers all the time in NetworkServer.SendToObservers/SendToReady via observers[i], observers.Count, etc. Furthermore we don't even worry about ReadOnlyCollections in any other place. The user could clear and break all other collections all the time too. 2018-10-16 14:08:14 +02:00
vis2k
a754eaac4f NetworkIdentity: replaced m_Observers and m_ObserverConnections lists with m_Observers Dictionary. 2018-10-16 13:15:08 +02:00
vis2k
998029fa6e
Update README.md 2018-10-16 10:48:06 +02:00
vis2k
f4f6bc1b16 Removed unused NetworkScene.DumpAllClientObjects function 2018-10-15 20:43:49 +02:00
vis2k
84ce1c5c82 Removed unused NetworkIdentity.AddNetworkId function 2018-10-15 20:39:25 +02:00
vis2k
b2cc89e3eb Removed unused NetworkMessage.MaxMessageSize 2018-10-15 20:31:24 +02:00
vis2k
137b2a153d Removed unused message types 2018-10-15 20:29:49 +02:00
Paul Pacheco
855e724304 Remove redundant null checks. (#74)
* Remove redundant null checks.

Enforce that connections are added in AddConnection and removed with RemoveConnection.
Since connection cannot be null anymore,  remove redundant null checks.

* Add connection after we added connection id
2018-10-15 18:21:30 +02:00
vis2k
e572417fbb NetworkServer.connections list replaced with a Dictionary to remove all this 'fill list with null values until connectionId' magic 2018-10-15 15:53:27 +02:00
vis2k
4c86d8b457 NetworkManagerHUDEditor removed because there is no value in it. NetworkManagerHUD is used for the first 5 minutes in development until people create their own NetworkManager / UI. It doesn't need an Editor script that does all kinds of magic. 2018-10-15 14:22:47 +02:00
vis2k
0123f1dd6f ForceSceneId uses uint instead of int to avoid unnecessary casting 2018-10-14 16:34:03 +02:00
vis2k
7569357f8e Fixed grammar 2018-10-14 16:33:24 +02:00
Paul Pacheco
2d208bcae0 use uint, no need for a special NetworkSceneId (#62) 2018-10-14 16:31:50 +02:00
vis2k
5449c94f21 NetworkScenePostProcess: removed unnecessary 'UnityEditor.' syntax 2018-10-14 16:28:32 +02:00
vis2k
c16564c8fe NetworkHash128: added comment that replacing it would break everything 2018-10-14 16:28:32 +02:00
Paul Pacheco
fc4803df3e Merge branch 'mirror' of github.com:vis2k/Mirror into mirror 2018-10-14 08:28:51 -05:00
Paul Pacheco
0bebc8ce05 Don't assign fail twice 2018-10-14 08:28:41 -05:00
vis2k
80af34ab7a NetworkManager.Awake/LateUpdate/OnApplicationQuit/OnValidate/OnDestroy are now protected so that inheriting classes that also need those functions can call base.Awake() etc. in them to guarantee proper functionality. Fixes #69 2018-10-14 13:04:53 +02:00
Paul Pacheco
162668cce4 reuse packing algorithm for 32 and 64 bits (#68) 2018-10-13 19:58:05 +02:00
Paul Pacheco
f06d3b5881 Remove double empty lines 2018-10-13 12:37:57 -05:00
Paul Pacheco
dcd723accf Simplify conditional 2018-10-13 12:33:08 -05:00
Paul Pacheco
5d28548943 Remove empty lines 2018-10-13 12:32:40 -05:00
Paul Pacheco
6568393e38 Fix spacing 2018-10-13 12:30:17 -05:00
Paul Pacheco
cc4515125c Remove empty lines 2018-10-13 12:28:55 -05:00
Paul Pacheco
1c2ef0bd58 Remove empty lines 2018-10-13 12:27:32 -05:00
Paul Pacheco
a5da7d55d3 Remove empty lines 2018-10-13 12:27:00 -05:00
Paul Pacheco
0cc0fc0447 No reason for synclists to be sealed 2018-10-13 12:21:38 -05:00
Paul Pacheco
425289fd3d remove blank lines 2018-10-13 12:21:15 -05:00
Paul Pacheco
0fc75eb04d spacing issues 2018-10-13 12:17:13 -05:00
vis2k
3e751b3da5 Removed NetworkTransformPreview because no one uses it and it had random errors (#60) 2018-10-13 14:11:21 +02:00
vis2k
a2796c98c6 Removed NetworkTransformVisualizer component. Nobody uses it and what we really need is a decent NetworkTransform component with a simple OnDrawGizmos function instead. 2018-10-13 14:08:52 +02:00
Paul Pacheco
d5c407fa60 Synchronize synclists with onserialize/ondeserialize (callback) (#67)
* Synchronize synclists with onserialize/ondeserialize

* Add test to cover set

* Add tests for remove at and remove

* Simplify tests

* Test SyncListInt

* remove non standard, redundant count attribute

* Refactor tests

* Test the callback

* Test Count and isReadOnly

* Check that dirty bit is working

* removed unused method

* Remove empty line

* Don't track changes if this is not a server object

* We no longer have a registersynclistdelegate

* Fix issue with list not registering

* Explain what InitSyncObject is doing

* Check if field implements SyncObject instead of synclist

* Initialize lists in constructor instead of Awake

* Use Linq to simplify the code

* Remove extra space

* Remove extra line

* remove extra space

* Add brackets to ifs

* Remove exta spaces

* Clean up spacing

* Remove unnecesary method

* Remove unnecesry method

* Reduce cognitive complexity

* Remove space

* Remove extra spacing

* Typo, and make variable local

* Renamed parameter for clarity

* Fix indentation

* callback works on client and server and remove the dependency
2018-10-13 13:33:32 +02:00
Paul Pacheco
ed4060ac9a Remove extra blank line 2018-10-12 16:01:08 -05:00
Paul Pacheco
0772d44761 Nobody should instantiate LogFilter 2018-10-12 15:59:44 -05:00
Paul Pacheco
5879d24cb0 Remove extra semicolons 2018-10-12 15:59:01 -05:00
Paul Pacheco
6356e411be Spacing issues 2018-10-12 14:14:25 -05:00
Paul Pacheco
52ca8b746a Remove extra line 2018-10-12 13:17:53 -05:00
Paul Pacheco
8c9b937091 Remove extra semicolon 2018-10-12 13:16:43 -05:00
Paul Pacheco
1a326d0957 Do not initialize variables to default values, found by SA 2018-10-12 11:30:43 -05:00
Paul Pacheco
f15888dfef Removed unused parameters 2018-10-12 11:25:02 -05:00
Paul Pacheco
c258585cb2
Fix code style issues
Fix code styles issues found by SA
2018-10-12 11:08:16 -05:00
Paul Pacheco
3512903ec3
Fix invalid link
this is not a link
2018-10-11 21:06:34 -05:00
Paul Pacheco
9c874fa6e8
Fix bullet point indentation 2018-10-11 21:04:24 -05:00
Paul Pacheco
7317637682
Fix bullet indentation
Static analysis keeps bitching about this
2018-10-11 21:03:10 -05:00
Paul Pacheco
49b3f2bcaa
Fix bullet indentation
Static analysis keeps bitching about this.
2018-10-11 20:56:21 -05:00
Paul Pacheco
6684851467 Make variable local, keep less state 2018-10-11 20:24:34 -05:00
Paul Pacheco
7750ab664c Make variable local 2018-10-11 20:23:00 -05:00
Paul Pacheco
5a1be98885 initialize these lists only once 2018-10-11 20:19:57 -05:00
Paul Pacheco
a4b642fca6 These fields should never be assigned after creation 2018-10-11 20:16:35 -05:00