Commit Graph

626 Commits

Author SHA1 Message Date
vis2k
712aecb452 NetworkClient.REgisterHandle made static 2019-03-26 12:16:57 +01:00
vis2k
ba00554e0c NetworkClient.GetRTT made static 2019-03-26 12:16:57 +01:00
vis2k
4abc58b136 NetworkClient.Send(msgId, msg) made static 2019-03-26 12:16:57 +01:00
vis2k
cd56c6a6f7 NetworkTime.UpdateClient doesn't require NetworkClient anymore 2019-03-26 12:16:57 +01:00
vis2k
8c125d2fd3 NetworkClient.Send made static 2019-03-26 12:16:57 +01:00
vis2k
558e1d8754 NetworkClient.SetHandlers made static 2019-03-26 12:16:57 +01:00
vis2k
180d3f8cf4 NetworkClient.isConnected made static 2019-03-26 12:16:57 +01:00
vis2k
604c205025 NetworkClient.serverIp made static 2019-03-26 12:16:57 +01:00
vis2k
882a7d5ba8 NetworkClient.connection made static 2019-03-26 12:16:57 +01:00
vis2k
f351a8a6d4 NetworkClient.connectState made static 2019-03-26 12:16:57 +01:00
vis2k
006d5d3bc8 NetworkClient.handlers made static 2019-03-26 12:16:57 +01:00
rodolphito
3a8fa3f571 Remove internal access modifier. (#658) 2019-03-26 12:09:43 +01:00
rodolphito
a96417112d Use ulong instead of uint to support up to 64 animator parameters. (#655)
* Use ulong instead of uint to support up to 64 animator parameters.

* Split onto new line as Paul asked
2019-03-26 07:57:51 +01:00
uwee
65eaba1fe0 fix: #651 GetSceneAt assumes default scene (#654)
Changed to GetActiveScene
2019-03-26 07:57:31 +01:00
Paul Pacheco
8c93f31b80 refactor: Load parameters right before function call 2019-03-25 23:13:52 -05:00
vis2k
ff909bf830 Telepathy license file included 2019-03-25 20:03:27 +01:00
vis2k
14807f6ef7 add comment 2019-03-25 16:20:17 +01:00
vis2k
13bb748603 fix: Revert "NetworkClient.Shutdown: call ClientScene.Shutdown, otherwise it's never called" - caused client's player to not be removed from scene after disconnecting
This reverts commit e1e7b3132e.
2019-03-25 16:19:22 +01:00
rodolphito
d483901432 Use PackedUInt for dirty bits for bandwidth (#649) 2019-03-25 13:13:14 +01:00
uwee
4c7c97bf70 reset netId counter to 1 on NetworkServer.Shutdown (#645) 2019-03-25 05:37:28 -05:00
rodolphito
6120a8e082 Removed unused parameter from NetworkAnimator. (#648) 2019-03-25 08:07:45 +01:00
Paul Pacheco
e2a6ce9811
feat: Add weaver support for Vector2Int and Vector3Int (#646) 2019-03-24 16:04:13 -05:00
vis2k
7836433b4f Local Connection's connectionId is now set to 0 inside of their constructors, instead of doing it in LocalClient 2019-03-24 21:16:55 +01:00
vis2k
5f7c4d48b4 NetworkServer.AddLocalClient renamed to SetLocalConnection because that's what it does. The connection is created in LocalClient now too, this way NetworkServer doesn't need to depend on LocalClient(!) 2019-03-24 21:15:05 +01:00
vis2k
829da79288 LocalClient.InternalConnectLocalServer sets connectionId to 0 directly instead of getting it from NetworkServer.AddLocalClient (which shows an error message if failed anyway) 2019-03-24 21:07:41 +01:00
vis2k
56c163d9cd NetworkServer.RemoveLocalClient renamed to RemoveLocalConnection because NetworkServer only keeps a local connection, not a local client 2019-03-24 21:07:41 +01:00
uwee
6db11b298b Add the name of the Message back to the debug
The random int representing the Message is less human readable.
2019-03-24 14:50:13 -05:00
vis2k
ca2c72aee8 NetworkServer.s_LocalConnection replaced with .localConnection private setter 2019-03-24 20:46:34 +01:00
Paul Pacheco
48674151f0 perf: don't varint bytes and shorts 2019-03-24 14:45:03 -05:00
vis2k
bdf12c85d0 fix: #640 InternalReplacePlayerForConnection calls SpawnObserversForConnection now too 2019-03-24 19:41:41 +01:00
vis2k
a2d6317642 fix: #573 NullReferenceException because destroyed NetworkIdentities were never removed from sceneIds dict 2019-03-24 19:28:25 +01:00
rodolphito
1e5fc3cde5 Made dirty bits not rely on NetworkWriter position manipulation hackery. (#636)
* Made dirty bits not rely on NetworkWriter position manipulation hackery.

* Renamed GetDirtyBits to NextDirtyBits, as discussed with Paul.

* Expanded one line ifs.
2019-03-24 12:43:39 -05:00
Paul Pacheco
a495f66fc1
refactor: configure frame rate in a virtual method (#638)
Moved frame rate configuration into a virtual method so that people can override it and we reduce StartServer complexity

Fixes #567
2019-03-24 08:58:11 -05:00
vis2k
2d492607c8 pong example: ball is only simulated on server now 2019-03-24 14:38:22 +01:00
vis2k
e521a20052 fix: #573 (part 2) NetworkManager detects additive scene loads and respawns objects on server/client again 2019-03-24 13:24:29 +01:00
vis2k
c1af84e6bf fix: #573 (part 1) NetworkScenePostProcess handles NetworkIdentities of all scenes except DontDestroyOnLoad. this way it works for additively loaded scenes too. 2019-03-24 13:24:29 +01:00
vis2k
603dfa1fe9 don't use continue and improve comments 2019-03-24 13:24:29 +01:00
vis2k
051cd7cf66 add comment 2019-03-24 13:24:29 +01:00
vis2k
bce7c54fa1 NetworkScenePostProcess: only set inactive if this was actually a valid scene object 2019-03-24 13:24:29 +01:00
rodolphito
b3595d3f5d Code simplification and optimization. (#635) 2019-03-24 10:47:14 +01:00
Zac North
7d21bded9a feat(syncvar): Add SyncDictionary (#602)
* Added basic SyncDictionary support, no support for structs yet

* Fixed TryGetValue usage

* Removed extraneous hardcoded SyncDictionary type

* Added a couple basic tests, more coming

* Added 4 more tests

* Added two tests and SyncDictionary now bubbles item to Callback on Remove (both Remove cases)

* Added the remainder of tests

* Added basic documentation about SyncDictionaries on StateSync.md page

* Simplify test syntax

Co-Authored-By: Katori <znorth@gmail.com>

* Simplify test syntax

Co-Authored-By: Katori <znorth@gmail.com>

* Simplify test syntax

Co-Authored-By: Katori <znorth@gmail.com>

* Simplify test syntax

Co-Authored-By: Katori <znorth@gmail.com>

* Remove null-check when setting value directly (and updated expected test behaviour)

* fix: Provide default implementation for SyncDictionary serializers

* feat: Add Weaver support for syncdictionary

* Fix minor issue with Set code and made test use Weaved serialization instead of manual

* Added a new test for bare set (non-overwrite)

* Added another test for BareSetNull and cleaned up some tests

* Updated SyncDictionary documentation on StateSync.md

* Update docs with SyncDictionary info

* Update SyncDictionary docs wording

* docs: document the types and better example

* Add two SyncDictionary constructors

* Removed unnecessary initialization

* Style fixes

* - Merged many operation cases
- Fixed Contains method
- Added new test to test contains (and flag its earlier improper usage)
- Use PackedUInt32 instead of int for Changes and Counts

* - Simplify "default" syntax
- Use Rodol's remove method (faster)
- Don't use var

* Removed unnecessary newline, renamed <B, T> to <K, V> per vis2k, corrected wording of InvalidOperationException on ReadOnly AddOp

* Code simplification, style fixes, docs example style fixes, newly improved implementation for CopyTo that fails gracefully
2019-03-24 10:18:31 +01:00
rodolphito
fea46b801d Remove NetworkAnimatorEditor and animator parameter mask. (#633) 2019-03-24 09:39:51 +01:00
vis2k
67d715fe74 fix: Telepathy updated to latest version: protect against allocation attacks via MaxMessageSize. Can be configured in the TelepathyTransport component now. 2019-03-23 20:34:48 +01:00
Zac North
b0af876221 fix(tests): Added missing SyncListByteValid test file (#634)
* Added missing SyncListByteValid test file (passing)

* Added a missing newline
2019-03-23 18:40:38 +01:00
MichalPetryka
1595fb07b1 PreprocessorDefine rework (#626)
perf: speed up preprocessor define
2019-03-23 06:59:35 -05:00
vis2k
1bf2f9ee56 Update List Server demo text 2019-03-23 12:51:39 +01:00
vis2k
4eb01da0c1 update welcome message 2019-03-22 17:19:05 +01:00
vis2k
fa04185fa8 remove empty line 2019-03-22 14:08:59 +01:00
vis2k
c194771084 ClientScene.DestroyAllClientObjects simplified: use .Values 2019-03-22 14:05:47 +01:00
vis2k
6e11429699 NetworkClient.Shutdown made static too. ShutdownAll made obsolete. 2019-03-22 13:56:43 +01:00
vis2k
1d94464023 NetworkClient.ShutdownAll calls .Shutdown 2019-03-22 13:54:20 +01:00
vis2k
e1e7b3132e NetworkClient.Shutdown: call ClientScene.Shutdown, otherwise it's never called 2019-03-22 13:53:28 +01:00
vis2k
227b0a71d1 tanks example namespaces updated 2019-03-22 13:29:24 +01:00
vis2k
c5b4211ac7 list server examples namespace changed 2019-03-22 13:28:08 +01:00
vis2k
5c00577746
fix: #609 by spawning observers in NetworkServer.AddPlayerForConnection after setting the controller. There is no point in trying to spawn with a null controller in SetReady, because by definition no one can observer something that is null. (#623) 2019-03-22 12:50:35 +01:00
Paul Pacheco
b7e977a7a3
synclist code generator is now reusable (#624)
* refactor: Made serializer generation reusable

* refactor: SyncList code generator is reusable for other structs
2019-03-22 06:44:57 -05:00
vis2k
1d166c699a add comment 2019-03-22 12:24:22 +01:00
vis2k
694185b756 NetworkServer.SpawnObserversForConnection helper function instead of doing it all in SetClientReady 2019-03-22 12:23:33 +01:00
vis2k
009943f368 remove outdated comment 2019-03-22 12:10:13 +01:00
vis2k
c3bd7d6e07 NetworkServer.SetClientReady: get rid of 'continue' 2019-03-22 12:09:22 +01:00
vis2k
400bb91821 NetworkServer.SetClientReady: remove unnecessary null check because we don't have one in the above foreach either, and we don't have them anywhere else for NetworkIdentity.spawned because OnDestroy removes objects from it before they become null. The only way to cause this would be by calling Destroy(GetComponent<NetworkIdentity>()) - which no one does, and if someone does it then it's fine to get an exception here. 2019-03-22 12:08:47 +01:00
vis2k
9567daedba add comments 2019-03-22 12:06:13 +01:00
vis2k
b869e3af99 improve comment 2019-03-22 12:04:25 +01:00
vis2k
c176da7bc3 NetworkServer.SetClientReady: use if+else instead of if + early return 2019-03-22 12:00:16 +01:00
vis2k
0e8b442cad add some ocmments 2019-03-22 11:59:12 +01:00
vis2k
f6a6440294 NetworkServer.SetClientReady: move isReady=true upwards 2019-03-22 11:57:27 +01:00
vis2k
47d5ee976e remove unused variable 2019-03-22 11:53:42 +01:00
Paul Pacheco
6f19489721
feature(synclist): allow SyncList of primitive types (#622)
* feature(synclist): allow SyncList of primitive types

As it turns out this never really worked:
```cs
class SyncListByte : SyncList<byte> {};
```

You had to write your own serializeItem / deserialize item for native types.

This change lifts the restriction, now you can use a synclist of anything that mirror can serialize/deserialize

* fix: fix unit tests error messages
2019-03-22 05:51:20 -05:00
vis2k
aa5e5a104f ClientScene.s_PendingOwnerNetIds converted to HashSet 2019-03-22 10:10:53 +01:00
vis2k
0d6b03989a NetworkServer.InternalAddPlayerForConnection moved into AddPlayerForConnection because there is no reason to keep it in an internal method anymore, since NetworkServer is static now 2019-03-22 10:04:14 +01:00
vis2k
fb2131207c NetworkServer.InternalAddPlayerForConnection: reuse 'identity' for log message 2019-03-22 10:03:00 +01:00
vis2k
4f53f37dc8 NetworkServer.InternalAddPlayerForConnection: rename playerGameObject parameter for consistency 2019-03-22 10:02:30 +01:00
vis2k
75e51513db added the log message again too 2019-03-22 09:58:04 +01:00
vis2k
1a55c3d52d NetworkManager: move OnServerAddPlayerInternal code into OnServerAddPlayer because it was really just the implementation for OnServerAddPlayer moved into another function 2019-03-22 09:53:21 +01:00
vis2k
4b4dd179cc sort regular and obsolete OnServerAddPlayer functions 2019-03-22 09:51:27 +01:00
vis2k
a39954003a NetworkManager.RegisterServerMessages for AddPlayerMessage uses OnServerAddPlayer directly instead of wrapping it with a OnServerAddPlayerMessageInternal function 2019-03-22 09:46:14 +01:00
vis2k
fa4efa6683 syntax 2019-03-21 18:12:34 +01:00
vis2k
155764cea8 simplify NetworkIdentity.RebuildObservers 2019-03-21 17:58:15 +01:00
vis2k
f90cdae3c6 fix #384: duplicating scene objects at runtime is now detected and and error is shown. otherwise the user could instantiate scene objects at runtime, which would then send the sceneId to the client, then the client wouldn't know which of the multiple objects to use for the sceneId, resulting in things getting out of sync. 2019-03-21 11:46:55 +01:00
Zac North
c9eac57ce8 fix: OnClientReady is called and passed the appropriate ready state value in NetworkLobbyPlayer (#618) 2019-03-21 02:27:25 -05:00
Martin Evans
28b067d3cd refactor: Generic IMessageBase to allow struct message types (#619)
* - Added a `IMessageBase` as an interface to `MessageBase`. Existing messages which inherit `MessageBase` (including ones which do not implement Serialize/Deserialize and rely on the weaver) will continue to work in exactly the same way as before!
 - Modified any methods which were generic `T where T : MessageBase` to be `T where T : IMessageBase`. this does not change things at all for all existing usages of the method.

These two changes allow end users to implement IMessageBase as a `struct` instead of `MessageBase` as a `class`, so they are no longer forced to allocate message objects in their own code.

* Update .gitignore

* Update Messages.cs

* Update MessageBaseTests.cs

* Update MessageBaseTests.cs

* Update MessageBaseTests.cs
2019-03-20 19:44:42 -05:00
Paul Pacheco
9d043182bf feature: SyncList now support structs (#614)
Previously, if you wanted a synclist of structures,  you would do:  SyncListSTRUCT<MyStruct>
Now you can use SyncList<MyStruct>
SyncListSTRUCT is left there, but obsolete
2019-03-20 12:45:46 +01:00
vis2k
22640b5e62
Mirror List Server example (#611)
feature: Mirror List Server example
2019-03-20 09:38:53 +01:00
Anthony Eckert
00961ccc9c feature: Add NoRotation to NetworkTransform (#616)
This allows you to leave rotation out of the NetworkTransform if you only need position.
Right now if you don't need sync rotation and set compression to Lots, it can move your object in ways not expected. This forces you to use no compression as a fix. Using more bandwidth for something you don't need. I think this is all that is needed, tested it in my game and it works.
2019-03-19 23:46:33 -05:00
Paul Pacheco
80bce0a626 refactor: rename SyncObjectProcessor -> SyncObjectInitializer
The name SyncObjectProcessor is confusing because it does not process syncobjects.   Instead it initializes syncobjects in a NetworkBehaviour.
this avoids the confusion with SyncListStructProcessor, that does process synclists to add serialization methods
2019-03-19 08:26:03 -05:00
Paul Pacheco
6e51e69e3d refactor: rename SyncListProcessor -> SyncListInitializer
SyncListProcessor is a very confusing name,  it does not process synclists at all,  instead it initializes synclists in the network behaviour.
This is more confusing especially since SyncListStructProcessor  does process the synclists to add serialization methods, and both of them normally work
in tandem in different parts of the code
2019-03-19 08:23:28 -05:00
vis2k
8f8856d320 remove targetrpc first parameter networkconnection test because it's optional now 2019-03-18 13:08:28 +01:00
MichalPetryka
c1707e5917 fix: Don't disconnect host (#608)
* Don't disconnect host

* Update NetworkConnection.cs
2019-03-18 09:38:51 +01:00
vis2k
ed6a93724f tanks: projectiles 2019-03-17 22:23:20 +01:00
vis2k
21327065f2 rename Examples/Movement to Examples/Tank 2019-03-17 21:46:53 +01:00
vis2k
97b4e26d8b movement: add a light to the tank 2019-03-17 21:46:18 +01:00
vis2k
a2165d3278 movement: dirt texture 2019-03-17 21:38:58 +01:00
vis2k
d41c5d0040 movement: adjust camera 2019-03-17 21:31:45 +01:00
vis2k
6a11335050 movement: improve code 2019-03-17 21:30:45 +01:00
vis2k
a773df4905 movement: use animations 2019-03-17 21:30:45 +01:00
vis2k
c0b2d63a8d movement: rename player to tank 2019-03-17 21:18:57 +01:00
vis2k
13717c8b57 movement: rotate camera 2019-03-17 21:17:20 +01:00
vis2k
fbe2895eab movement: delete old model 2019-03-17 21:12:49 +01:00
vis2k
14b63e9d10 movement: add some spawn positions 2019-03-17 21:08:52 +01:00
vis2k
477fe61a14 movement example: fix movement in builds by using navmeshagent; use better model (tank) 2019-03-17 21:05:12 +01:00
MichalPetryka
b67b3e4304 fix: Stop calling ClientDisconnect on host (#597)
* Stop calling ClientDisconnect on host

* Update NetworkConnection.cs

* Update NetworkServer.cs
2019-03-17 19:37:21 +01:00
MrGadget
78504533f3 Fix Scene Handling (#463)
* Fix Scene Handling

Line 361: Passing false prevents the switch to offline scene...pass true instead to forceReload paramater.
Line 588: Never assume Network Manager is in Scene 0 of Build Settings...it often is not.

* Reverted GetActiveScene

Will make separate PR

* Added code to unwind DontDestroyOnLoad

* Fixed typo in comment

* Removed the unwinding of DDOL
2019-03-17 19:32:49 +01:00
vis2k
7efeaa980c not public 2019-03-17 14:35:53 +01:00
vis2k
d72a10b4a9 pong: NetworkManagerPong handles ball spawn and despawn 2019-03-17 14:34:59 +01:00
vis2k
7e9b3efa7d pong: fixed racket spawn position after reconnecting 2019-03-17 14:24:15 +01:00
vis2k
6d8d9f2998 pong: racket uses * Time.fixedDeltaTime 2019-03-17 14:14:22 +01:00
vis2k
a3209add85 pong ball uses continous collision detection and interpolation to fix going through walls 2019-03-17 14:08:08 +01:00
vis2k
f360e5070c pong ball velocity only starts when both players are connected 2019-03-17 14:07:24 +01:00
vis2k
c956148982 pong ball position centered 2019-03-17 14:02:42 +01:00
vis2k
46dd15d4a4 spawn scene object not found message shows sceneID as hex 2019-03-17 09:54:44 +01:00
MrGadget
f64eb8be0b Should be fixedDeltaTime in FixedUpdate (#605) 2019-03-16 13:15:32 -05:00
MrGadget
d09c7cddc0 Fixed typos (#604) 2019-03-16 12:57:17 -05:00
MrGadget
54c964c232 Made Lists available to inheritors (#603)
* Made Lists available to inheritors

* Update NetworkLobbyManager.cs

Made them public
2019-03-16 15:47:33 +01:00
rodolphito
0b83c9feb9 Add scale to spawn payload. (#599) 2019-03-16 11:57:59 +01:00
vis2k
4193574864
[TargetRPC] optional connection parameter for easier usage while still allowing for previous usage (#592)
* [TargetRPC] optional connection parameter for easier usage while still allowing for previous usage

* allow for parameterless targetrpc too

* syntax

* Add Helpers.ReaderParameters change from HLAPI 2019.2 package just to be sure
2019-03-14 14:52:32 +01:00
vis2k
1824e8db80 sceneID buildIndex byte replaced with scenePath hash and sceneID converted to long to fix #571, #577 2019-03-14 11:26:19 +01:00
vis2k
ca69cb9c14 log sceneid as hex 2019-03-14 11:15:51 +01:00
vis2k
de9d31f6b6 syntax 2019-03-14 11:01:42 +01:00
vis2k
e962fd2f35 sceneID random generation excludes 0 because 0 is for random sceneIDs 2019-03-14 11:01:12 +01:00
vis2k
62fc738673 Fix sceneID mismatch bug between build (buildIndex=-1) and editor (buildIndex=0) for projects where the scene was not added to build settings list 2019-03-13 18:36:20 +01:00
vis2k
8642056f21 add comments 2019-03-13 18:27:00 +01:00
MichalPetryka
8c41ee2380 Remove a per packet Encoding allocation (#588)
* Remove a per packet encoding allocation

* Update NetworkReader.cs

* Update NetworkReader.cs

* Update NetworkWriter.cs

* Update NetworkWriter.cs

* Update NetworkReader.cs
2019-03-13 15:53:18 +01:00
MrGadget
ab668962d1 Added Obsoleted Methods (#590) 2019-03-13 15:49:43 +01:00
MrGadget
dc0b8d406a NetworkLobbyManager: Added Obsoleted Method (#591) 2019-03-13 15:49:11 +01:00
vis2k
f17ddfec5f syntax 2019-03-13 14:03:41 +01:00
vis2k
d23facc048 simplify code 2019-03-13 14:01:50 +01:00
vis2k
00a1004b41
Weaver sourcebased hlapi2019.2package (#587)
* move weaver into assets folder

* disable tests for now

* asmdef

* add logs

* Use UNET's WeaverRunner code, slightly modified to find Mirror assembly

* Use UNET's 2019.2 package Weave function changes

* compiler messages error checked moved into separate function

* fix typo

* syntax

* replace 'var'

* rename

* replace var

* fix log

* update comment

* syntax

* rename to assemblyPath. no need for an extra variable.

* remove extra variable

* fix typo

* remove old code

* don't use .Contains to find Mirror dll. that's crazy. would fail for all DLLs in Mirror folder.

* look for 'this' assembly separately

* separate unityEngine assembly search

* add comment

* move null check up

* move null check upwards

* move outputDirectory down

* check process result properly

* use our previous way to find unity engine dll

* rename to unityEngineCoreModuleDLL again

* improve output directory construction

* move unityengine dll finding upwards

* move foundThisAssembly down, where it is used

* add comments

* split dependency code into separate functions

* add TODO

* store this assembly in a variable

* split dependency search depending on if we found assembly or not

* move usesMirror logic into if and out of 'not found' else

* syntax

* improve order

* GetNonDynamicAssemblyDirectories helper function

* check File.Exists instead of exception

* improve comment

* rename HlapiRuntimeAssemblyName to MirrorAssemblyName

* reuse MirrorAssemblyName

* remove telepathy check

* rename to MirrorRuntimeAssemblyName

* add MirrorWeaverAssemblyName

* reuse name consts

* don't use contains to check if assembly depends on Mirror

* add actions for testing again

* make CompilationFinishedHook public so it can be used by tests

* fix typo

* Mirror.Tests.asmdef references weaver asmdef

* reenable tests

* pass error handlers to Weaver Processing for tests to work
2019-03-13 12:17:04 +01:00
Liu
dea7b58792 Fix network animator doesn't sync float value as expected (#589)
Maybe we should do float sync when the Abs of newValue - lastValue > 0.001f
2019-03-13 12:15:34 +01:00
vis2k
b0ef89a0d9 resave scenes because of new sceneIDs 2019-03-12 18:45:42 +01:00
MrGadget
303d0f4b3a Reverted spelling error from #537 (#584) 2019-03-11 18:51:34 -05:00
rodolphito
dd362b18a0 Fixed the NetworkAnimator issue I introduced in the bandwidth fix. This should also further improve bandwidth, too. (#576) 2019-03-11 08:54:46 +01:00
Paul Pacheco
092c5663b6
NetworkReader should enforce read only (#580) 2019-03-10 12:04:45 -05:00
rodolphito
4aa1a4b169 Removed one liner braces from transport files. (#544) 2019-03-10 10:18:11 +01:00
vis2k
98a0e23413
Persistent sceneid (#563)
* add empty line

* persistent scene ids

* never assign scene ids at runtime

* fix warning

* fix 'sceneid is never assigned to' warning in play mode

* simplify bitwise operation

* set dirty even if only scene index byte changed

* improve log message

* assign build index byte in OnPostProcessScene to also work with unopened scenes and build index changes

* add comment

* improve log

* Add sceneid not set check

* Only PostProcess the objects from this scene.

* Interrupt build if there is an unopened scene that still needs sceneId assignments. This makes it 100% fail safe.

* improve comment and error message

* clear build index byte before or-ing into it
2019-03-08 20:24:18 +01:00
vis2k
508ba558fc NetworkManager: headless start moved to Start() because Awake() is for initialization. 2019-03-07 15:30:23 +01:00
vis2k
3a86bd501a headless start doesn't unnecessarily set tick rate anymore. StartServer already takes care of that. 2019-03-07 15:27:15 +01:00
vis2k
8b85e1c846 NetworkIdentityEditor: create GUIContent directly 2019-03-07 13:39:30 +01:00
vis2k
f3738d87d7 NetworkAnimatorEditor: create GUIContent directly 2019-03-07 13:39:30 +01:00
rodolphito
ca7824bbc1 Fixed animator bandwidth problem. (#536)
* Fixed animator bandwidth problem.

* Renamed xShadowCopy to lastXParamters, renamed val to be consistent with the reading value names, renamed newValue to newIntValue to be consistent with newFloatValue and newBoolValue.

* Removed Debug.log which slipped by.
2019-03-06 22:52:26 +01:00
MichalPetryka
9afefbdce7 Adjusted line endings, encoding and trimmed whitespaces at EOL (#561) 2019-03-06 18:08:48 +01:00
rodolphito
896551eb00 Finished replacing comment walls with regions. (#558) 2019-03-06 10:53:35 -06:00
vis2k
17ab8ae30a add empty line 2019-03-06 14:42:22 +01:00
rodolphito
ca57f1180c Removed trailing whitespace (#556) 2019-03-06 09:08:34 +01:00
rodolphito
98284e4253 Removed single line braces from NetworkWriter. (#545)
* Removed single line braces from NetworkWriter.

* Undid alignment.
2019-03-05 18:17:42 -06:00
vis2k
ed64872163 NetworkIdentity.OnValidate: wrap in #if UNITY_EDITOR in case OnValidate is needed at runtime later 2019-03-04 17:43:51 +01:00
vis2k
8eb27ea0af Syntax 2019-03-04 17:42:24 +01:00
rodolphito
f6d89c763f Removed comment divider thingies and used regions where applicable. Reordered a bit of code to make the regions make sense. (#532) 2019-03-04 10:04:54 +01:00
rodolphito
f324c0df94 Removed SetInstanceId by making netId setter internal. (#510)
* Removed SetInstanceId by making netId setter internal.

* Split isServer into multiple lines as per vis' suggestion.
2019-03-04 10:02:00 +01:00
rodolphito
15c3991905 Removed braces from everything else. (#551) 2019-03-04 09:57:27 +01:00
rodolphito
c1179fbd0d Renamed UNetInvokeType to MirrorInvokeType. (#553) 2019-03-04 09:56:59 +01:00