Commit Graph

6783 Commits

Author SHA1 Message Date
MrGadget
c65eed8ea8 Merge branch 'master' of https://github.com/vis2k/Mirror 2022-05-06 12:20:34 -04:00
MrGadget
efa2b3d4ca Syntax 2022-05-06 12:20:23 -04:00
MrGadget
876d6d86dc removed private 2022-05-06 12:19:50 -04:00
vis2k
5c23ac69bc
Update README.md 2022-04-30 12:03:07 +08:00
vis2k
818e0ca9fd NetworkServer.SendToObservers: use explicit NetworkConnectionToClient type 2022-04-29 19:01:26 +08:00
vis2k
298435001a fix: #3144 Reader/Writer Sprite null support & test to guarantee it never happens again 2022-04-29 10:08:33 +08:00
vis2k
f413c91cde Test: Reader/Writer Sprite 2022-04-29 10:05:23 +08:00
vis2k
ae1c7c5fe4 fix: #3144 Reader/Writer Texture2D null support & test to guarantee it never happens again 2022-04-29 09:59:52 +08:00
vis2k
b709453057 fix: NetworkReader/Writer Texture2D now sends dimensions too. fixes "Texture2D.SetPixels32: size of data to be filled was larger than the size of data available in the source array. (Texture '')" 2022-04-29 09:55:19 +08:00
vis2k
d235037954 fix: NetworkReader.ReadTexture2D fixed 'reader not found for Color32[]' error when using it from tests 2022-04-29 09:44:58 +08:00
vis2k
3a742bb7da Tests: NetworkReader/Writer Texture2D tests added 2022-04-29 09:44:54 +08:00
vis2k
728e6e2fdf syntax 2022-04-28 18:53:37 +08:00
vis2k
2db24b3761 gitignore 2021 Rider file 2022-04-28 12:59:53 +08:00
vis2k
6c1dc5255e remove unused import 2022-04-20 10:33:53 +08:00
vis2k
1aaa4ce2a4
perf: Cmd/Rpc bandwidth hash size reduced from 4 => 2 bytes (#3148) 2022-04-20 11:33:14 +08:00
vis2k
98d7a9d7d1 NetworkReader/Extensions: inlining ReadBlittable is enough. Don't inline ReadInt etc. too, we don't want ReadBlittable to be copied in place everywhere. 2022-04-20 10:28:30 +08:00
vis2k
4ffb9dfafc NetworkWriter/Extensions: inlining WriteBlittable is enough. Don't inline WriteInt etc. too, we don't want WriteBlittable to be copied in place everywhere. 2022-04-20 10:26:43 +08:00
vis2k
cebfab010f fix: Benchmark movement destinations set around start, not around position. prevents them from stopping to move because of the wander off protection. 2022-04-19 13:29:38 +08:00
MrGadget
99d3a91f17 Fixed Authenticator Comments
- Fixes #3146
2022-04-18 22:58:16 -04:00
MrGadget
2db726df2e fix: TeamInterestManagement OnDestroyed logic 2022-04-18 09:07:15 -04:00
MrGadget
0e9d86f563
breaking: Removed Obsoletes (#3142)
* Removed Experimental NetworkTransform

* NetworkRoomManager: Removed Obsoletes

* NetworkTransformBase: Removed Obsoletes

* NetworkBehaviour: Removed Obsoletes

* NetworkManager: Removed Obsoletes

* NetworkServer: Removed Obsoletes

* SyncObject: Removed Obsoletes

* fixed comment

* fixed XML comment
2022-04-18 08:05:53 +07:00
MrGadget
8d07be97ed fixed XML comment 2022-04-17 12:40:17 -04:00
MrGadget
63fdd53903 fixed comment 2022-04-17 12:23:44 -04:00
vis2k
3839fafade remove unused import 2022-04-17 14:16:36 +08:00
vis2k
bec8e01c69 MIRROR_66_0_OR_NEWER 2022-04-17 14:01:24 +08:00
MrGadget
9c47d87bce XML Comments 2022-04-16 12:46:33 -04:00
MrGadget
c86deedbd9 Updated NetworkStatistics
- Reorganized to method call order
- Added component attributes
- XML comments for docs
2022-04-16 12:24:15 -04:00
vis2k
4d0cd1054a
fix: #3138, 3135 revert Cmd/Rpc from 2 byte indices back to 4 byte function hashes for stability (#3139)
* Revert "fix: Weaved static constructors need to always run (#3135)"

This reverts commit b0624b2f64.

* Revert "perf: Rpcs/Cmds functionHash bandwidth reduced from 4 => 2 bytes (with the potential for 1 byte VarInt) (#3119)"

This reverts commit a868368eca.

* comment
2022-04-16 19:53:55 +07:00
MrGadget
3dba6a3833 NetworkRoomManager log update 2022-04-15 11:25:14 -04:00
vis2k
aa6ff514cb
Update README.md 2022-04-12 22:14:29 +08:00
Robin Rolf
b0624b2f64
fix: Weaved static constructors need to always run (#3135)
Static constructors are lazily called when the class is first "used"
 https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-constructors
 > It is called automatically before the first instance is created or any static members are referenced.
 This means, in particular circumstances, client and server may diverge on which classes they have "loaded"
 and thus the rpc index will be desynced
 One such example would be on-demand-loading of prefabs via custom spawn handlers:
   A game might not want to preload all its monster prefabs since there's quite many of them
   and it is practically impossible to encounter them all (or even a majority of them) in a single play
   session.
   So a custom spawn handler is used to load the monster prefabs on demand.
   All monsters would have the "Monster" NetworkBehaviour class, which would have a few RPCs on it.
   Since the monster prefabs are loaded ONLY when needed via a custom spawn handler and the Monster class
   itself isn't referenced or "loaded" by anything else other than the prefab, the monster classes static
   constructor will not have been called when a client first joins a game, while it may have been called
   on the server/host. This will in turn cause Rpc indexes to not match up between client/server
 By just forcing the static constructors to run via the [RuntimeInitializeOnLoadMethod] attribute
 this is not a problem anymore, since all static constructors are always run and all RPCs will
 always be registered by the time they are used
2022-04-12 12:00:15 +08:00
MrGadget
3188472f74 Syntax: same method grouping as NetworkReaderExtenstions 2022-04-11 09:42:23 -04:00
MrGadget
2f76c73c41 fix: NetworkWriterExtensions:WriteTexture2D call WriteArray instead of Write 2022-04-11 09:12:35 -04:00
vis2k
92c5b54034 add comment 2022-04-04 20:36:42 +08:00
vis2k
eded0a2b15 fix: #2705 NetworkClient.SpawnPrefab looks for spawn handlers before looking for registered prefabs, instead of the other way around 2022-04-04 19:21:26 +08:00
vis2k
7d4a9c46e4 NetworkClient: RegisterPrefabIdentity double registration warning improved with explanation (related to #2705) 2022-04-04 19:13:46 +08:00
vis2k
1a256b5060 Tanks Example: destroy projectile after 2 seconds instead of 5 seconds 2022-04-04 11:51:57 +08:00
vis2k
1a09f0dc58 Tanks Example: reuse DestroySelf() 2022-04-04 11:39:44 +08:00
vis2k
1a6c5de8ac
fix: #2060 serializing GameObjects / NetworkIdentities now throws an obvious exception for prefabs / unspawned objects (#3132)
* fix: #2060 serializing GameObjects / NetworkIdentities now throws an obvious exception for prefabs / unspawned objects

* NetworkWriter: WriteGameObject reuses WriteNetworkIdentity

* warning instead of exception
2022-04-04 01:24:35 +08:00
vis2k
3ec5ca758e comment 2022-04-03 11:39:30 +08:00
vis2k
243821f5b1 fix: #2972 ReadNetworkBehaviour now reads the correct amount of data even if the NetworkIdentity has disappeared on the client.
added test to guarantee it never happens again.
2022-04-03 10:50:04 +08:00
vis2k
a92189b272 ReadNetworkIdentity: reuse Utils.GetSpawnedInServerOrClient 2022-04-03 10:47:54 +08:00
MrGadget
c81a4374b2 fixed comment 2022-04-01 17:29:23 -04:00
MrGadget
c79c6d1e70 fix: Correct version for Queue.TryDequeue
- fixes #3131
2022-04-01 17:19:37 -04:00
vis2k
3d471db938 fix: added Queue.TryDequeue extension for Unity 2019 2022-04-01 17:18:12 +08:00
vis2k
6c2559a73e
perf: Build batches directly instead of queuing serializations (#3130)
* rename

* so far

* better

* fixx

* old

* error

* typo

* comment
2022-04-01 13:46:38 +08:00
Robin Rolf
1631402bd7
fix: Byte format test uses current culture (#3126)
Since some may use , instead of . as their decimal place seperator

Error:
String lengths are both 7. Strings differ at index 1.
  Expected: "1.00 KB"
  But was:  "1,00 KB"
2022-03-26 13:06:30 +08:00
vis2k
d8774ecd47 fix: #2954 calling StopClient in host mode does not destroy other client's objects anymore 2022-03-23 23:58:47 +08:00
vis2k
6f981224a9 fix: #2954 calling StopClient in host mode does not reset nextNetId anymore 2022-03-23 23:55:35 +08:00
vis2k
3d6c41a595
fix: #3122 DestroyAllClientObjects now also resets after unspawn handler was called (#3124) 2022-03-23 23:54:58 +08:00