Commit Graph

449 Commits

Author SHA1 Message Date
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