Commit Graph

2466 Commits

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