Commit Graph

2594 Commits

Author SHA1 Message Date
James Frowen
24e3ea099c
adding version define from v18 breaking change (#2214) 2020-09-03 15:46:15 +01:00
James Frowen
e79e340e0d
fixing typo in NetworkIdentity.cs 2020-09-03 11:51:05 +01:00
vis2k
cd3d9c2144 Delete old file 2020-09-03 09:05:47 +02:00
vis2k
fc1096d66c
breaking: Removed [SyncEvent] because ClientRpc/TargetRpc does the same thing, and it's an enormous effort to support the Weaver code. (#2178) 2020-09-03 09:04:29 +02:00
James Frowen
ad8af783dc
Replacing prefabAssetPath with assetPath for PrefabStage to stop warning (#2210) 2020-09-03 08:48:06 +02:00
James Frowen
1ade82d435
feat: making NetworkBehaviour.IsDirty public (#2208) 2020-08-31 12:26:50 +01:00
James Frowen
5701369e84
feat: adding script to help debug list server (#2202)
Script uses OnGui so can be used to check if server has been added to list server
2020-08-27 23:15:43 +01:00
James Frowen
fc530782cc
fix: fixing width and layout group on cloud example (#2201) 2020-08-27 23:10:11 +01:00
vis2k
f6dbf8c19e Fix broken Weaver test 2020-08-27 00:18:01 +02:00
vis2k
594aec45bf Weaver RpcProcessor validation moved to NetworkBeahviourProcessor.ProcessClientRpc 2020-08-26 13:15:23 +02:00
vis2k
25ef6ac36a Weaver TargetRpcProcessor validation moved to NetworkBehaviourProcessor.ProcessTargetRpc 2020-08-26 13:13:56 +02:00
vis2k
820d0daa29 Weaver CommandProcessor validation moved to NetworkBehaviourProcessor.ProcessCommand 2020-08-26 13:12:56 +02:00
vis2k
5e7257d7bc Weaver ValidateRemoteCallAndParameters IsStatic check added so we don't need to check in Command/Rpc/TargetRpcProcessors 2020-08-26 13:11:56 +02:00
vis2k
2e178b7eaf Weaver NetworkBehaviourProcessor: ValidateRemoteCallAndParameters function added to be used from Command/Rpc/TargetRpcProcessors 2020-08-26 13:08:46 +02:00
vis2k
fbad5d2401 Add comment 2020-08-26 13:04:39 +02:00
vis2k
68ebaf1756 Weaver TargetRpcProcessor: ValidateTargetRpc simplified 2020-08-26 13:03:44 +02:00
vis2k
e6ffe6d6bf Weaver: Simplify ValidateParameters 2020-08-26 13:02:25 +02:00
vis2k
ce3dd51d81 Weaver NetworkBehaviourProcessor: ProcessMethodsValidateParameters renamed to ValidateParameters 2020-08-26 13:01:43 +02:00
vis2k
ee8ad1d750 Weaver TargetRpcProcessor: ProcessMethodsValidateTargetRpc renamed to ValidateTargetRpc 2020-08-26 13:01:43 +02:00
vis2k
1b49a21d49 Weaver RpcProcessor: ProcessMethodsValidateRpc renamed to ValidateRpc 2020-08-26 13:01:43 +02:00
vis2k
9131586f5c Weaver NetworkBehaviourProcessor: ProcessMethodsValidateFunction renamed to ValidateFunction 2020-08-26 13:01:43 +02:00
vis2k
3dab0ec7c5 Weaver CommandProcessor: ProcessMethodsValidateCommand renamed to ValidateCommand 2020-08-26 13:01:43 +02:00
James Frowen
a9d21ea9ab
fix: adding error for generated read writer for abstract class (#2191)
* fix adding error for gernated read writer for abstract class

weaver can not initialize class abstract class so cant not create a reader
this gives a helpful error telling the server to make a custom reader

* adding tests for error message

* fixing typo

* renaming

* fixing expected error messages
2020-08-25 17:14:39 +01:00
James Frowen
c9a9f92c7c
commenting out reader error checks (#2196)
Reader code doesn't run on Rpc now if a valid writer can not be found
In future PR write and read functions should be generated together as they share most of the same checks
2020-08-25 01:39:03 +01:00
James Frowen
d73de03eca
renaming variables in Readers to match writers (#2195) 2020-08-24 14:48:15 +01:00
James Frowen
11a8d41464
fixng ArgumentNullException (#2193) 2020-08-24 14:43:51 +01:00
James Frowen
771f1fea13
fixing typo (#2192)
variable should start with lower case
2020-08-23 19:30:20 +01:00
James Frowen
1045b1f2ed
tests using HasError (#2188)
* replacing assert with haserror

* adding IsSuccess and HasWarning functions

* using IsSuccess

* checking weaverWarnings empty in success

* using HasWarning

* replacing asserts missed by regex

* fixing typo

* adding HasNoErrors function to be used when tests only have warnings

* fixing typo

* making fields public to stop warnings

* simplifying more test files
2020-08-22 20:20:16 +01:00
James Frowen
bd7c93674e
Error with message overloads (#2168)
* weaver error with message overloads

* finding method with 1 arg
2020-08-22 21:07:33 +02:00
James Frowen
d5d434cf13
weaver: renaming variables and changing order things happen (#2172)
* renaming variables

* adding todo

* moving order that things happen
2020-08-22 21:05:01 +02:00
James Frowen
ea0b9e1215
returning lists instead of passing them in as args (#2183) 2020-08-22 20:51:47 +02:00
James Frowen
f051c4b911
Simplify weaver tests (#2186)
* Simplifying weaver test files

* updating error messages
2020-08-22 19:00:11 +01:00
James Frowen
c312874bcb
renaming test folder in order to use WeaverTestsBuildFromTestName (#2189) 2020-08-22 18:59:06 +01:00
James Frowen
f1d7f207c3
adding HasError method (#2185)
Makes it easier to write error message within weaver tests because there is mess syntax to worry about
2020-08-22 16:23:56 +01:00
vis2k
9ec5eadd51 Weaver: PropertySiteProcessor.ProcessSitesModule renamed to Process for consistency 2020-08-22 13:59:17 +02:00
vis2k
ed60e592dc Syntax 2020-08-22 13:57:52 +02:00
vis2k
16f8f05abe Weaver: ReaderWriterProcessor.ProcessReadersAndWriters renamed to Process for consistency 2020-08-22 13:56:52 +02:00
vis2k
84602aace6 ServerClientAttributeProcessor: ProcessSiteClass renamed to Process for consistency 2020-08-22 13:55:22 +02:00
vis2k
342ed13f55 Weaver: update ServerClientAttributeProcessor explanation 2020-08-22 13:40:41 +02:00
vis2k
427adf6c8e Weaver: ProcessNetworkBehaviourType code moved into NetworkBehaviourProcessor.Process 2020-08-22 13:40:41 +02:00
James Frowen
4774f83032
moving FindSyncObjectsFields to its own function (#2182) 2020-08-22 12:10:01 +02:00
vis2k
df38c4fb2c Syntax 2020-08-21 20:00:42 +02:00
vis2k
5cc908a18d Weaver PropertySiteProcessor: remove redundant AssemblyDefinition parameter. Weaver passes assembly.MainModule anyway. 2020-08-21 18:25:01 +02:00
vis2k
4258220b26 Weaver PropertySiteProcessor: pass CurrentAssembly to Process function to reduce coupling 2020-08-21 18:22:12 +02:00
vis2k
7b9066832b Syntax 2020-08-21 18:04:32 +02:00
vis2k
fe32557a38 Weaver ProcessSyncVars: remove redundant numSyncVars field, use syncVars.Count instead 2020-08-21 17:33:11 +02:00
vis2k
54c32227bd
[Obsolete] SyncEvent (#2180) 2020-08-21 17:03:06 +02:00
James Frowen
eec49fafce
feat: Use Server Client attribute outside of NetworkBehaviour (#2150)
* adding generated test for other baseclasses

* removing errors when attribute is not in networkbehaviour

* temp weaver tests

* updating weaver tests for monobehaviour

* adding weaver tests for non-networkbehaviour

* moving where serverclient attributes are processed

* removing un-used code

* regenerate tests
2020-08-21 16:02:37 +01:00
James Frowen
c6fa49c72a
fix: adding version define from v17 breaking change 2020-08-21 13:49:54 +01:00
vis2k
35d8e0ed60 Syntax 2020-08-21 12:12:40 +02:00
vis2k
07f5912215 Weaver GenericArgumentResolver: reuse StripGenericParametersFromClassName 2020-08-21 12:07:18 +02:00
vis2k
0e124ff8b2 Weaver Resolvers: remove unused code 2020-08-21 12:02:01 +02:00
vis2k
bfb97e7202 Syntax 2020-08-21 11:54:49 +02:00
vis2k
2ea787f4fc Weaver Extensions: HasCustomAttribute uses Linq to simplify code 2020-08-21 11:38:36 +02:00
vis2k
467d9e834f Weaver Extensions: GetMethod uses Linq to simplify code 2020-08-21 11:38:36 +02:00
vis2k
045b50a929 Weaver Extensions: GetMethods uses Linq to simplify code 2020-08-21 11:31:25 +02:00
vis2k
687c9002dd typo 2020-08-21 11:28:51 +02:00
vis2k
0043288900 typo 2020-08-21 11:28:38 +02:00
vis2k
e8ae2246c0 Weaver Extensions: remove unused functions 2020-08-21 11:27:11 +02:00
vis2k
22486885f1 syntax 2020-08-21 11:21:26 +02:00
vis2k
948b97e30d Weaver Tests: StripGenericParametersFromClassNameTest 2020-08-21 11:20:31 +02:00
vis2k
ad42aa19de internal 2020-08-21 11:18:05 +02:00
vis2k
3b6f98be9f Weaver Extensions: IsDerivedFrom strip generic parameters code moved into separate function 2020-08-21 11:16:05 +02:00
vis2k
461396601f ignore warnings 2020-08-21 11:07:08 +02:00
James Frowen
c39a2d546e
splitting up GetWriteFunc function (#2171) 2020-08-21 10:57:41 +02:00
James Frowen
150b14a2ed
perf: adding check for no connections (#2130)
* adding check for no connections

Dont need to run Server Update if there are no connections

* adding toggle to disable skip

* formatt

* removing skipUpdateIfNoConnections check, and merging if checks

* removing extra line

* adding tests for NoConnections
2020-08-21 10:51:58 +02:00
James Frowen
7c7edb2586
weaver: Moving stuff around in writer (#2170)
* removing TypeDef versions of extension methods

* moving function up

* Renaming function

* fixing comment

* changing comment

* Update Writers.cs

Co-authored-by: vis2k <info@noobtuts.com>
2020-08-20 22:35:57 +02:00
James Frowen
99d4f8c9bd
breaking: replacing isHeadless with isServerBuild (#2093)
* replacing isHeadless with isServerBuild

* renaming startOnHeadless

* fixing isServerBuild bool

* making property a field instead

* replacing isServerBuild for #if UNITY_SERVER

* fixing comment and removing extra lines

* removing system from System.Obsolete

* renaming to autoStartServerBuild
2020-08-20 13:56:46 +02:00
James Frowen
a2124c3522
Renaming tests and namespaces (#2167)
* renaming test

* renaming test file

* removing test suffix from methods

* changing test namesapce
2020-08-19 02:18:20 +01:00
James Frowen
0c790e339d
adding assert to make sure transport is set (#2164)
* adding assert to make sure transport is set

this helps people who want to connect without using networkmanager

* moving Transport.activeTransport to setup

* replacing Substitute.For for addComponent

Can't used Substitute for monobehaviours as they will still be null with unity equals
2020-08-18 18:57:31 +02:00
James Frowen
3a276b4e30
fix: weaver test for abstract methods (#2166)
* weaver test for abstract methods

* doing nothing is method is abstract

* not calling base if it is abstract

* adding tests for message to make sure they work
2020-08-18 18:56:48 +02:00
James Frowen
7294c42798
splitting up ProcessEvents function (#2174) 2020-08-18 18:56:21 +02:00
James Frowen
e4d9304478
moving getwriter to above op code (#2175) 2020-08-18 18:54:35 +02:00
James Frowen
901898e897
removing old tests (#2165)
these are covered by CollectionWriterTests.gen.cs
2020-08-17 12:01:33 +01:00
James Frowen
aa49c54dd0
removing program class (#2161) 2020-08-16 12:22:12 +02:00
James Frowen
381e5a115b
feat: allowing lists to automatically be sent in Commands, Rpc, and Messages (#2151)
* weaver tests for list read write

* generated tests for list read write

* adding method to check for list type

* temp

* weaver functions for creating read write for list

* generating tests for lists
2020-08-15 18:00:55 +02:00
James Frowen
5b179e8917
Generated tests for collection read write (#2158)
* adding generated tests for collection writers

tests for read+write for array and array segment

* changing menu path

* adding tests for collections of classes

* swapping order in class name
2020-08-15 02:57:38 +01:00
James Frowen
2fbd131f61
Test for array segment and writers (#2157)
* tests for array and segment writers

* fix typo
2020-08-14 23:29:07 +01:00
James Frowen
c1410b0924
fix: adding error when Server/Client is used on abstract methods (#1978)
* tests for Server attribute on virtual methods

test for virtual, abstract and override methods

* adding test for client attribute

* adding error when attribute is put on abstract method

* improving error message

* updating error mesages in tests

* updating to use WeaverTypes

* adding check before error
2020-08-14 10:52:06 +02:00
James Frowen
71bf792db5
moving where CallOnClientEnterRoom is called (#1922) 2020-08-14 10:47:44 +02:00
James Frowen
fc48e0ecf9
Adding alternative to NetworkRigidbody (#2123)
Uses Lerp to set position and velocity
2020-08-11 10:27:09 +02:00
James Frowen
2046e8813e
removing Internal functions that do nothing (#2154) 2020-08-10 08:57:47 +02:00
James Frowen
5089546ecd
fixing IL error when using floats (#2147)
* fixing IL error when using floats

* removing speical case for primitive types
2020-08-09 21:11:46 +01:00
James Frowen
e4a5ce795b
fix: Nested messages (#2148)
* test for nested messages

* fixing StackOverflow with nested types
2020-08-09 20:01:14 +02:00
James Frowen
fe3bebcc63
Making EnableDebugMode public (#2152) 2020-08-09 17:29:05 +01:00
James Frowen
ee9a600f66
Generated attribute tests (#2149)
* class to create test functions

* generated test folder

* generated attribute tests

* adding out function and long type

* generated test file

* using OneTimeSetUp to make tests run faster
2020-08-08 15:11:31 +01:00
James Frowen
ec54ee6d8c
fix: fixing unity crash on StackOverflowException (#2146)
StackOverflowException was causing unity to crash while running weaver 
tests, using inner exception seems to fix that issue
2020-08-07 16:30:08 +01:00
James Frowen
ddc6139725
fix: fixing warning message for client attribute (#2144) 2020-08-07 13:03:46 +01:00
James Frowen
d46469a79c
fix: isServer false in OnDestroy (#2101)
* fix isServer false in OnDestroy

* making sure that OnDestroy doesn't call Destroy again
2020-08-06 17:55:35 +02:00
James Frowen
a124f3f439
fix: fixing cloud log not using logger (#2141) 2020-08-06 13:26:14 +01:00
Keir Smith
23b9fb0214
feat: Added Layer Weight to NetworkAnimator (#2134)
* Added Layer Weight to NetworkAnimator

Now NetworkAnimator is aware of each layer weight on it's references
Animator and will sync layer weights across the network.

* NetworkAnimator layers Float equality fix

* Update Assets/Mirror/Components/NetworkAnimator.cs

Co-authored-by: James Frowen <jamesfrowen5@gmail.com>

* Update Assets/Mirror/Components/NetworkAnimator.cs

Co-authored-by: James Frowen <jamesfrowen5@gmail.com>

* Remove GetLayerWeight check every incoming packet as is extern call

Co-authored-by: James Frowen <jamesfrowen5@gmail.com>
2020-08-05 23:54:46 +01:00
James Frowen
87a96d17ca
deleting telepathy tests (#2136) 2020-08-05 20:44:38 +02:00
James Frowen
fee9adfa63
Adding asmdef to telepathy (#2137)
* Adding asmdef to telepathy

mirror has to reference telepathy as it is the default transport
this also means that TelepathyTransport has to be in the mirror asmdef

* references telepathy in tests

* formatting asmdef
2020-08-05 12:40:10 +01:00
James Frowen
2998295e45
adding asmdef to websockets (#2135) 2020-08-05 12:09:00 +02:00
James Frowen
17838c5b52
removing 2nd null check (#2128)
if identity is not null then the game object is also not null
2020-08-05 12:08:20 +02:00
James Frowen
2b6a1bb792
adding test for NetworkServer.Destroy (#2115) 2020-08-05 12:07:40 +02:00
vis2k
0f09702062
Weaver types moved into WeaverTypes, and reduce some global state (#2138) 2020-08-05 12:07:11 +02:00
James Frowen
f1e5878ca1
Test for OnSpawn (#2004) 2020-08-04 11:55:42 +01:00
James Frowen
067c46fd60
fixing doc links (#2139) 2020-08-03 22:11:38 +01:00
James Frowen
4adaac8867
moving 2nd if inside 1st (#2127) 2020-08-03 20:37:32 +02:00
James Frowen
c63811ddc4
correctly error message so they are not misleading (#2124) 2020-08-03 20:36:20 +02:00
James Frowen
03fd6a5526
splitting on spawn into functions (#2113)
* making ApplySpawnPayload internal for tests

* splitting on spawn into functions

* renaming
2020-08-03 20:35:51 +02:00
James Frowen
7604e65c2c
fix: making triggers be called right away instead on owner (#2125)
* making triggers be called right away instead on owner

* only handling on server if it is not the host
2020-08-03 20:34:52 +02:00
James Frowen
da629e5f71
Formatting doc comments (#2131)
* making comments in NetworkServer doc comments

* making comments in NetworkIdentity doc comments
2020-08-03 20:33:42 +02:00
James Frowen
c3765c101d
moving FakeNetworkConnection to its own file (#2132) 2020-08-02 23:11:03 +01:00
James Frowen
3f027e0d0a
using memory transport in test (#2129)
telepathy fails this test sometimes
2020-08-02 23:00:14 +01:00
linjmeyer
3bdfd451cb
SSL/TLS version in Websockets now configurable (#2121) 2020-08-01 09:36:17 -05:00
Paul Pacheco
890ee6b58d
fix: auto fill serialize/deserialize for classes (#2120)
Note this method is being called in 3 places:
one in MessageClassProcessor and 2 in NetworkBehaviorProcessor.

The NetworkBehaviorProcess is really a don't care, this condition cannot happen since it would not be invoked unless the class extends from NetworkBehavior. In this case, it will always resolve.
but even if it does not resolve, they handle the null case gracefully by not calling the base method.

MessageClassProcessor also calls this method, and if it is null it does not call the base method. That is precisely the behavior we want to resolve #2117

so all 3 places are perfectly fine receiving null.

The only way to trigger the error was #2117

I renamed the method to make it clearer that this may not find the method in the parent class.
2020-08-01 08:46:12 -05:00
vis2k
0cb84baf97 Benchmark example missing NetworkManager reference fixed 2020-07-30 19:59:11 +02:00
vis2k
2effa7bc02 Update readme for 2018.4 LTS 2020-07-30 19:36:46 +02:00
vis2k
ce8d540a8f 2k NetworkTransforms renamed to Benchmark 2020-07-30 19:24:05 +02:00
vis2k
7de5400ad5 10k Benchmark removed because it's 2D, outdated and insignificant 2020-07-30 19:23:25 +02:00
vis2k
6f645c870c Benchmark monster mesh changed to cube to reduce polygons 2020-07-30 19:21:50 +02:00
vis2k
0a554f5f6c Remove warning 2020-07-30 19:12:15 +02:00
Anastasios Andronidis
92bc3c3150
Improve Telepathy debug messages (#2106) 2020-07-28 18:45:00 +01:00
James Frowen
70b7211cba
docs: updating cloud readme (#2111) 2020-07-28 00:41:45 +01:00
James Frowen
e136f48101
feat: Adding Custom Data and Custom Address fields to list server (#2110)
* whitespace

* adding doc comment
2020-07-27 17:31:56 +01:00
James Frowen
f913c64610
adding customData and customAddress (#2108) 2020-07-27 01:22:12 +01:00
francescoStrada
049ec99aa7
changing serverBroadcastListenPort variable access permissions to protected (#2103) 2020-07-23 11:12:36 +02:00
uwee
df16a7d3cc
fix: dont allow set of networkSceneName directly (#2100) 2020-07-19 16:58:35 +02:00
James Frowen
9497886ad4
fixing angularVelocity sync (#2098) 2020-07-16 01:29:24 +01:00
James Frowen
8e545ac468
fix: fixing cloud scripts not pinging api (#2097)
* adding logs to api updater

* fixing cloud api
2020-07-15 16:07:39 +01:00
uwee
e4cc85c413
fix: Misc code smells (#2094)
* fix: code smell - condensed if statement

* fix: code smell - dont throw generic Exception
2020-07-14 18:44:52 +02:00
uwee
12827f65a9
fix: add NetworkManager.StartClientUri test (#2095) 2020-07-14 18:44:28 +02:00
James Frowen
984eb73ea4
fix: register prefab error with same guid (#2092)
* tests for when newassetId is same as current

* stopping error if ids are the same

* invert if and adding comment
2020-07-13 19:40:11 +01:00
Paul Pacheco
a219ff2059
encapsulate method substitute naming (#2091)
* encapsulate method substitute naming

* This const is not used anywhere else,  make it private

Co-authored-by: Paul Pacheco <paul.pacheco@aa.com>
2020-07-13 13:25:54 +01:00
James Frowen
18d695744f
fix: renaming call/invoke prefix for SyncEvent (#2089)
* renaming sync event

same reason as #2088

* removing un-used const
2020-07-13 06:29:24 -05:00
James Frowen
64f663fb5e
adding prefix to call command and rpc (#2088)
now that Cmd is not required "Call..." might collide with user functions
2020-07-13 05:49:27 -05:00
James Frowen
f1698e658c
removing code that isnt needed (#2090)
we use the original method name so we do not need to remove the prefix
2020-07-13 04:44:51 -05:00
James Frowen
ef47ee7a57
feat: Rigidbody example (#2076)
* adding example for NetworkRigidbody

* adding hud

* adding empty player so that scene objects spawn

* turning off debug logs
2020-07-13 01:04:51 +01:00
Paul Pacheco
ed40c2d210
feat: Sync Events no longer need Event prefix (#2087)
Instead of doing
```cs
[SyncEvent]
public event MySyncEventDelegate EventOnly;
```

You can now do
```cs
[SyncEvent]
public event MySyncEventDelegate Only;
```

We actually tried to remove them a while ago. The way the weaver worked
back then caused an infinite recursion.

Since the Command rewrite that allows virtuals, this is no longer
a problem.  So we can drop this requirement.

Co-authored-by: Paul Pacheco <paul.pacheco@aa.com>
2020-07-12 17:27:44 -05:00
Paul Pacheco
eb93c34b33
feat: ClientRpc no longer need Rpc prefix (#2086)
Instead of doing
```cs
[ClientRpc]
public void RpcPepe() {}
```

You can now do
```cs
[ClientRpc]
public void Pepe() {}
```

We actually tried to remove them a while ago. The way the weaver worked
back then caused an infinite recursion.

Since the Command rewrite that allows virtuals, this is no longer
a problem.  So we can drop this requirement.

Co-authored-by: Paul Pacheco <paul.pacheco@aa.com>
2020-07-12 16:50:01 -05:00
Paul Pacheco
d89ac9fb05
feat: TargetRpc no longer need Target prefix (#2085)
Instead of doing
```cs
[TargetRpc]
public void TargetPepe() {}
```

You can now do
```cs
[TargetRpc]
public void Pepe() {}
```

We actually tried to remove them a while ago. The way the weaver worked
back then caused an infinite recursion.

Since the Command rewrite that allows virtuals, this is no longer
a problem.  So we can drop this requirement.

Co-authored-by: Paul Pacheco <paul.pacheco@aa.com>
2020-07-12 16:49:45 -05:00
Paul Pacheco
b6d1d09f84
feat: Commands no longer need Cmd prefix (#2084)
Instead of doing
```cs
[Command]
public void CmdPepe() {}
```

You can now do
```cs
[Command]
public void Pepe() {}
```

We actually tried to remove them a while ago. The way the weaver worked
back then caused an infinite recursion.

Since the Command rewrite that allows virtuals, this is no longer
a problem.  So we can drop this requirement.

Co-authored-by: Paul Pacheco <paul.pacheco@aa.com>
2020-07-12 16:49:35 -05:00
James Frowen
110e8f162a
increasing max fails to 15, and ping interval to 20 (#2081)
ping will only stop if can not get success from cloud for 5 mins
2020-07-09 23:30:58 +01:00
James Frowen
f717945525
fix: not removing server if id is empty (#2078)
* logging error message

* not removing server if ID is empty
2020-07-07 21:20:08 +01:00
Walter Geisler
47740f0a46
Refactor TimeoutAuthenticator to pass through client/server start callbacks (#2074)
* Update TimeoutAuthenticator.cs

* Moved listener passthrough back to Awake()

* Remove white space above Awake()

* Remove all white space above awake
2020-07-06 16:06:37 +01:00
James Frowen
0506ad5ea1
fixing cloud tank example (#2069) 2020-07-06 09:37:30 +01:00
James Frowen
e7ca6eb7ef
tests for struct message with empty function (#2067) 2020-07-05 01:04:33 +01:00
James Frowen
3418fa2106
fix: Message base class not being Serialized if processed in the wrong order (#2023)
* finding all fields

* adding test for message with base

* undoing FindAllPublicFields

* adding tests for Inheritance with define order

* making sure that messages are processed in order

do not need to check if message has already been processed becuase
OnSerialize is only added/changed if it is missing or empty

* removing un-needed comments

* using recursion instead of loops

* remove white space
2020-07-05 01:04:14 +01:00
Paul Pacheco
264f9b8f94
perf: Use invokeRepeating instead of Update (#2066)
* perf: Use invokeRepeating instead of Update

If you have low frequency calls, InvokeRepeating is a lot faster than
Update().  Use InvokeRepeating for NetworkProximityChecker

* Fix indentation

Co-authored-by: Paul Pacheco <paul.pacheco@aa.com>
2020-07-04 13:41:16 -05:00
James Frowen
999c8b1c32
fixing doc comment 2020-07-03 22:53:30 +01:00
James Frowen
57bc80c9cd
adding clientAuthority to commands (#2064) 2020-07-03 16:31:42 +01:00
James Frowen
c278c004f6
updating readme for cloud list server (#2058) 2020-07-01 16:20:24 +01:00
James Frowen
b316b35d46
fix: weaver now processes multiple SyncEvent per class (#2055)
* weaver test for mutlitple events

* tests for multiple sync events in 1 class

* removing break so that multiple events will be proccessed

It seems like this break was here because unet used foreach CustomAttributes
but mirror uses GetCustomAttribute
2020-06-30 09:59:18 +02:00
James Frowen
c91308fb04
fix: sync events can not have the same name if they are in different classes (#2054)
* test for sync event with same name

* using full name instead of name

* fix test
2020-06-30 09:58:50 +02:00
James Frowen
d0bb9d57b0
sending if syncInterval is greater or equal to 0 (#2053) 2020-06-30 09:56:13 +02:00
MaZy
4ffff192a6
fix: If socket is undefined it will return false. See #1486 (#2017) 2020-06-28 18:10:17 -05:00
James Frowen
61d44b2d80
fix: Fallback and Multiplex now disable their transports when they are disabled (#2048)
* test to check if fallbacks disables other transport

* using ondisable to disable other transport

* fixing teardown

* adding test for Multiplex

* using ondisable to disable other transport

* fixing NSubstitute for 2019
2020-06-28 23:49:36 +01:00
James Frowen
ab1b92f74b
fix: addingNetwork rigidbody icon and AddComponentMenu attribute (#2051)
* adding icon

* adding attributes

* adding docs

* adding disclaimer at top of doc
2020-06-28 23:47:50 +01:00
James Frowen
0c30d3398a
fix: Network rigidbody fixes (#2050)
* using syncInterval for client auth

* only set sync var if change is greater than Sensitivity

* fixing client auth sync

* using currentVelocity
2020-06-28 23:46:43 +01:00
James Frowen
25285b1574
feat: Experimental NetworkRigidbody (#1822)
* NetworkRigidBody
2020-06-27 00:38:50 +01:00
Kyle
ba29119aa1
Missed one internal call that the NetworkManager uses (#2044) 2020-06-27 00:35:58 +01:00
Eunseop Shim
350ce47db3
Implement IReadOnlyDictionary for SyncDictionaries (#2032) 2020-06-26 13:21:54 +02:00
Kyle
d06ee6a21d
Kr/issue 2039 (#2040)
* Update NetworkClient.cs

* Update NetworkServer.cs

* Missed a call
2020-06-26 13:18:56 +02:00
James Frowen
78bd284b6f
fixing null ref (#2043) 2020-06-26 09:47:49 +01:00
James Frowen
e36449cb22
fix: changing namespace to match folder name (#2037)
* updating namespace

* updating example name spaces
2020-06-25 16:13:47 +01:00
James Frowen
7c9afca7c5
deleting old list server (#2034)
* deleting old list server

* fixing prefab name
2020-06-25 16:23:09 +02:00
James Frowen
18691dabe0
adding game name to api updater (#2036) 2020-06-25 12:14:50 +01:00
James Frowen
7d0e907b73
feat: More examples for Mirror Cloud Service (#2029)
* fixing pong spawn points

* renaming files and asmdef

* More Cloud examples

* Moving pong example to cloud folder
* Moving shared code to GUI folder
* Adding readme for examples
* Adding tank example
2020-06-25 01:58:47 +01:00
James Frowen
54a69bbc83
Fixing warning messages (#2030)
* disabling warning for empty method

* removing null propagation

null propagation in untiy can cause MissingReferenceException
2020-06-24 23:13:12 +02:00
James Frowen
b42c74bc40
adding doc comment for SpawnMessag (#2027) 2020-06-24 23:12:00 +02:00
James Frowen
f1fdc959dc
feat: adding demo for mirror cloud services (#2026)
* adding mirror list services

* fixing code smells

* removing runtime example folders

* removing matchmaking code till feature is ready

* fixing scene path

* updating readme to say where example is
2020-06-23 20:39:38 +02:00
James Frowen
065d320208
calling animator.enabled before calls to animator (#2000)
some functions don't need this check as the check is done before they are called
2020-06-21 12:09:24 +02:00
James Frowen
296f6f9cd8
Only setting last parameters values if they have changed (#1999)
* only setting last values if they have changed

* adding comment
2020-06-21 12:06:37 +02:00
James Frowen
f18f7a5c3d
making sure that trigger is called on the server (#1998) 2020-06-21 12:06:07 +02:00
James Frowen
3bea342257
rethrow error with stack (#2013)
this will help error be more useful
2020-06-21 11:54:11 +02:00
James Frowen
a05df81127
adding if before starting task (#2021) 2020-06-21 11:52:32 +02:00
uwee
36c0b65e8b
fixes broken ui for Tanks example (#2015) 2020-06-20 23:39:36 +01:00
James Frowen
4af72c3a63
fix: calling base method when the first base class did not have the virtual method (#2014)
* adding test for error

* adding test with multiple overrides

* calling methods in base type

* adding test for more than 1 override
2020-06-19 00:23:46 +02:00
Chris Langsenkamp
5032ceb000 fix: Clean up roomSlots on clients in NetworkRoomPlayer 2020-06-18 09:44:50 -04:00
Chris Langsenkamp
37338706f9 Remove redundant .transform 2020-06-17 17:35:32 -04:00
James Frowen
8c1ed40c40
adding check before telling clients (#2010)
* adding check before telling clients

* Update Assets/Mirror/Runtime/NetworkManager.cs

Co-authored-by: MrGadget <chris@clevertech.net>
2020-06-16 12:21:57 -04:00
James Frowen
76d49c1e99
faster write line (#2009) 2020-06-16 16:16:58 +01:00
Chris Langsenkamp
b41fca2d28 Changed to inline token injection 2020-06-16 08:29:59 -04:00
James Frowen
46239783f3
feat: adding log handler that sets console color (#2001)
* adding log handler that sets console color

* fixing stack trace log

* removing empty cases

* removing string.Format
2020-06-15 14:54:35 +02:00
James Frowen
5f0c7ceb52
moving spawn functions next to each other (#2002) 2020-06-14 17:33:32 +01:00
Chris Langsenkamp
fffd462df8 fix: Suppress warning 2020-06-13 13:25:07 -04:00
Chris Langsenkamp
23b545fc8a suppress erroneous warning 2020-06-13 12:34:14 -04:00
James Frowen
5480a583e1
fix: Websockets Transport now handles being disabled for scene changes (#1994)
* fix: Websockets Transport now handles being disabled for scene changes

* Removed unused method

* Removed test warnings

* Changed back to await Task.Run

* adding queue to ClientJs

keeping standalone client without queue
dont need common class for now as that over complicates the fix

Co-authored-by: Chris Langsenkamp <chris@clevertech.net>
2020-06-13 12:21:13 -04:00
MrGadget
7e2b7338a1
feat: Experimental Network Transform (#1990)
* feat: Experimental Network Transform

* Removed lastClientSendTime and lastServerSendTime
2020-06-12 16:48:34 +02:00
MrGadget
b962d71944
breaking: Websocket Transport now requires full path to PFX (#1989)
* breaking: Websocket Transport now requires full path to PFX

* Added HelpURL
2020-06-12 09:38:45 -04:00
Chris Langsenkamp
1dc0d98374 fix: Replaced Icosphere with centered pivot 2020-06-12 09:19:02 -04:00
Chris Langsenkamp
9a42fe3342 fix: WebSockets: Force KeepAliveInterval to Zero 2020-06-12 08:24:13 -04:00
Chris Langsenkamp
285ec968c0 Fix: WebSockets: Force KeepAliveInterval to Zero 2020-06-11 23:07:21 -04:00
James Frowen
781e8070de
fixing using statments (#1983) 2020-06-10 21:56:44 +01:00
Chris Langsenkamp
ae3dc04fb9 fix: Removed unused variable 2020-06-10 12:57:46 -04:00
James Frowen
b92da91d7a
fix: Allowing overrides for virtual commands to call base method (#1944)
* adding override method that calls base

* trying to debug instruction for call to base

* extra tests

* adding tests for client and target Rpc

* adding fix for calls to base class

Since networkbehaviour parents are processed first we can just fix the
method when we see it in SubstituteMethod
2020-06-10 16:11:29 +02:00
James Frowen
2ce5880646
breaking: moving static code from NetworkBehaviour to its own class (#1951)
* moving static code from NetworkBehaviour to its own class

* Replacing calls in tests to use new RemoteCallHelper

* updating references to types in weaver

* adding version 15 defines

* renaming function
2020-06-10 16:10:54 +02:00
James Frowen
7e93030849
feat: adding script that displays ping (#1975)
* adding script that displays ping

* fixing style

* adding mirror icon

* Update Assets/Mirror/Components/NetworkPingDisplay.cs

Co-authored-by: MrGadget <chris@clevertech.net>

* adding DisallowMultipleComponent

* adding docs on NetworkPingDisplay

Co-authored-by: MrGadget <chris@clevertech.net>
2020-06-10 14:31:13 +01:00
James Frowen
3db57e5f61
fix: making weaver include public fields in base classes in auto generated Read/Write (#1977)
* adding test to check if data is sent

* test for generating writer for inherited class

* adding extension method for FindAllPublicFields
2020-06-10 15:12:36 +02:00
James Frowen
dfa2e7aff6
fixing typo (#1976) 2020-06-09 12:26:27 +01:00
James Frowen
e39b91efca
removing extra null check (#1974)
if transform is not null then gameObject will also be not null
2020-06-09 11:32:50 +02:00
Chris Langsenkamp
986975d65e Set Tanks example to Round Robin 2020-06-08 10:02:19 -04:00
James Frowen
69e58cc870
checking this instead of this.gameobject (#1973) 2020-06-08 08:54:34 +02:00
James Frowen
927c4dede5
fix: Replacing ClearDelegates with RemoveDelegates for test (#1971)
* making ClearDelegates Obsolete

* returning hash from Registering function

* fixing tests
2020-06-08 08:54:00 +02:00
Chris Langsenkamp
14a851fde1 Removed unused variable 2020-06-07 20:12:31 -04:00
Chris Langsenkamp
745741e000 Refinements to player controllers in examples 2020-06-07 20:12:11 -04:00
Chris Langsenkamp
198b2bd605 Refined playercontroller in MultipleAdditiveScenes example 2020-06-07 14:27:38 -04:00
James Frowen
55736eba5e
breaking: adding option to receive NetworkConnectionToClient in Comand (#1970)
* moving exists check to its own function

* moving order and adding whitespace

* adding SenderConnection Attribute

* adding weaver tests for SenderConnection Attribute

* tests for sender connection

* updating valid method to work with sender connection

* using RemoteCallType in read write calls

* adding sender connection to CallCmd

* updating CmdDelegate

* adding NetworkConnection to invokeFunction

* updating old tests

* removing SenderConnectionAttribute

* typo

* adding version 14 defines
2020-06-07 11:25:21 +01:00