Commit Graph

180 Commits

Author SHA1 Message Date
vis2k
2148351799 UNetBehaviourProcessor WriteMessage comments added to make this more obvious in the future. 2018-07-26 12:51:36 +02:00
vis2k
4b339931c5 UNetBehaviourProcessor: WriteCreateWriter Ldloc_0 call moved to WriteMessageSize. All kinds of WriteMessageX functions always load the writer, push the variable on the stack and then write it. Except WriteCreateWriter which didn't load the writer, they decided to do this in WriteCreateWriter right after it was created. This was terrible code because removing WriteMessageSize calls anywhere would break all following calls, since WriteCreateWriter already called Ldloc_0 and the next call like WriteMessageId would call Ldloc_0 again. 2018-07-26 12:36:44 +02:00
vis2k
74b830a696 NetworkTransform uses readyConnection.SendByChannel(msg) instead of manually constructing and finishing the message and sending raw bytes. 2018-07-25 18:26:35 +02:00
vis2k
b27da84e81 NetworkTransformChild uses readyConnection.SendByChannel(msg) instead of manually constructing and finishing the message and sending raw bytes. 2018-07-25 18:23:30 +02:00
vis2k
d7cf9dc95c AddPlayerMessage, RemovePlayerMessage read and write playerControllerId via packet int to save bandwidth and for consistency with OwnerMessage, which does it too. This is the best way to save playerControllerId bandwidth. The type should have been 'byte' everywhere, but changing it now would break compatibility with the original HLAPI. 2018-07-24 10:19:09 +02:00
vis2k
97af671924 Removed LobbyReadyToBeginMessage because it wasn't used anymore 2018-07-24 10:03:39 +02:00
vis2k
22729edf6e
Merge pull request #5 from paulpach/isdirty
Separate dirtiness and network channel
2018-07-23 22:11:07 +02:00
Paul Pacheco
ec92854058 Separate dirtiness and network channel. These are independent of each other 2018-07-23 09:46:32 -05:00
vis2k
9e4f074bca NetworkIdentity.OnSerializeAll/OnDeserializeAll uses a dirtyComponents bitmask so only the dirty ones are serialized and send over the network. NetworkIdentity.UNetUpdate uses new OnSerializeAll function. Previously UNetUpdate would serialize all components for all channels if any of the components for a given channelId was dirty. For 2 channels, UNetUpdate would serialize all components twice, for 3 channels it would serialize all components three times, etc. And instead of only serializing the dirty components, any one dirty component would cause serialization of all components in that channel. So for example, NetworkTime synchronization would trigger OnSerialize to be called for movement, health, etc. too. Not serializing everything for each channel should cut Bandwidth in half for most projects that use the regular Reliable/Unreliable channels. Only serializing the actual dirty components should reduce bandwidth even further. 2018-07-22 12:52:42 +02:00
vis2k
53bf414ff7 NetworkIdentity.UNetSerializeAllVars removed. NetworkServer.SendSpawnMessage uses OnSerializeAllSafely instead. 2018-07-22 12:52:42 +02:00
vis2k
2b06bcf5c0 NetworkIdentity: OnSerializeAllSafely/OnSerializeSafely/OnDeserializeAllSafely/OnDeserializeSafely (split into 'all' and 'one' components functions) 2018-07-22 12:52:42 +02:00
Paul Pacheco
910f01f837 Deploy artifacts to github releases 2018-07-21 11:56:44 -05:00
vis2k
9227eacbbf NetworkIdentity.UNetUpdate: component serialization size check moved to OnSerializeSafely so that it happens for both calling functions (UNetSerializeAllVars and UNetUpdate). Also simplifies UNetUpdate code and removes dependency on NetworkWriter.Position. 2018-07-21 15:38:53 +02:00
vis2k
b76680dfda NetworkIdentity.UNetUpdate: 'is any component with this channel dirty' code simplified 2018-07-21 15:38:53 +02:00
Paul Pacheco
9a3cb91ff9
Update appveyor link for github project 2018-07-21 08:27:04 -05:00
Paul Pacheco
250ea5c1f4
Merge pull request #2 from paulpach/artifacts
Zip up the output folder
2018-07-20 15:30:19 -05:00
Paul Pacheco
567b048a24 Zip up the output folder 2018-07-20 15:22:09 -05:00
Paul Pacheco
6c15378f90 Link branches to github instead of bitbucket 2018-07-20 14:13:54 -05:00
vis2k
2dd907fb28 MsgType.ObjectSpawn renamed to SpawnPrefab, ObjectSpawnScene renamed to SpawnSceneObject. Messages.ObjectSpawnMessage renamed to SpawnPrefabMessage, etc. to make it perfectly clear what the messages do in order to avoid any confusion. 2018-07-20 16:37:05 +02:00
vis2k
e0a2a373ed Syntax 2018-07-20 16:06:37 +02:00
vis2k
93309d563a NetworkServer.SendSpawnMessage: fixed a bug where the server would send the spawn packet with the wrong MsgType (ObjectSpawn instead of ObjectSpawnScene) for cases where NetworkManager.OnServerAddPlayer was overwritten to spawn a player object from the scene, instead of from a prefab, resulting in Client deserializaton NetworkReader bugs (failed to read past end of stream, etc.). Also added more comments to explain the control flow of the function. 2018-07-20 15:25:49 +02:00
vis2k
7c4eefa5f9 NetworkServer.SendSpawnMessage: removed unnecessary writer.Position > 0 check 2018-07-20 12:57:15 +02:00
vis2k
0f2b4db3aa Added unit test for NetworkWriter.ToArray() behaviour, because it's different from BinaryWriter.ToArray() behaviour. 2018-07-20 12:49:44 +02:00
vis2k
fc4080535b SendWriter functions removed to avoid redundancy with SendBytes. Simply call SendBytes(writer.ToArray()) instead. 2018-07-20 12:42:39 +02:00
vis2k
2e9dc82e0e Removed numBytes parameter from all Send/SendBytes functions. Uses bytes.Length instead. 2018-07-20 12:29:51 +02:00
vis2k
e804fd71b0 NetworkTransform: removed NetworkWriter caching to simplify code and reduce state. 2018-07-20 11:50:30 +02:00
vis2k
38ca71ffde NetworkTransformChild: removed NetworkWriter caching to simplify code and reduce state. 2018-07-20 11:48:33 +02:00
vis2k
9852923982 LocalConnection.Send/SendUnreliable reuse SendByChannel function 2018-07-20 11:35:20 +02:00
vis2k
daaa9f6d17 NetworkDiscovery.OnGUI improved. Uses GUILayout now instead of manually spacing y. 2018-07-20 11:16:00 +02:00
vis2k
565e5560f9 NetworkManagerHUD improved: OnGUI uses GUILayout instead of manually spacing y. Update hotkeys removed because they didn't really offer anything of value. [SerializeField] removed from public fields because it's redundant. 2018-07-20 11:09:24 +02:00
vis2k
aac0652a5f Accidentally removed NetworkManagerEditor before 2018-07-20 10:51:12 +02:00
vis2k
06f0967eda MsgType: removed unused messages 2018-07-20 00:57:32 +02:00
vis2k
ee2d0373eb UNetwork.MsgType converted to Enum. Easier + faster string conversion and more flexible code. 2018-07-19 21:03:00 +02:00
vis2k
7cea90460f NetworkMessageHandlers class removed because it was just a wrapper around a Dictionary with the added bonus of not allowing us to overwrite internal message handlers from the outside, which sucks. NetworkClient, NetworkServer, NetworkConnection all use a simple Dictionary now. 2018-07-19 20:48:37 +02:00
vis2k
00b1bc119d NetworkConnection: removed m_MessageInfo caching to simplify code and reduce state 2018-07-19 20:29:41 +02:00
vis2k
0e4f905a72 NetworkConnection.InvokeHandler error messages are now shown if handler not found for msgType instead of failing silently 2018-07-19 20:28:29 +02:00
vis2k
c01b48f582 Removed NetworkServiceInitialize analytics code. 2018-07-19 18:38:26 +02:00
Paul Pacheco
c5263ed7ac Merged in paulpach/hlapi-community-edition/norandombytes (pull request #38)
Don't allow end user to send random bytes
2018-07-19 16:14:16 +00:00
Paul Pacheco
2fb9c71414 Don't allow end user to send random bytes 2018-07-19 11:09:05 -05:00
vis2k
ea3634b1e4 Relay feature removed because Unity pretty much abandoned it and hosting games on people's home computers never ends well anyway. People that need it might as well use the 'fixes-only' version. 2018-07-19 17:46:47 +02:00
vis2k
27f5717b70 Matchmaking feature removed because Unity pretty much abandoned it and plans to replace it with a solution on Google Cloud. People that need it might as well use the 'fixes-only' version. 2018-07-19 17:46:42 +02:00
vis2k
0425e896aa Removed NetworkLobbyManager because there's no reason why this should be in here. Unity has a NetworkLobby asset for lobby functionality, and that's how it should be. Hard coding all kinds of different classes that inherit from NetworkManager is not good for anyone. People that need it might as well use the 'fixes-only' version. 2018-07-19 17:20:09 +02:00
vis2k
db4c19e3e6 PlayerController.kMaxLocalPlayers removed because it wasn't used anywhere 2018-07-19 15:20:15 +02:00
vis2k
551a8928d6 NetworkManagerHUD: UnityEngine.Application.X changed to Application.X 2018-07-19 15:20:15 +02:00
vis2k
498433e124 Network Simulator support removed because the feature was confirmed to be broken by UNET Developers, it never worked 2018-07-19 11:48:48 +02:00
vis2k
fff714e1ec NetworkBehaviour.GetInvokerForHash parameter syntax simplified 2018-07-19 11:38:39 +02:00
vis2k
5c0cc5b99c Messages: removed OverrideTransformMessages because it wasn't used anywhere 2018-07-19 11:36:57 +02:00
vis2k
5ce07ac0a4 LogFilter.Fatal level removed because it wasn't used anywhere and Debug/Warn/Error are more than enough anyway. 2018-07-19 11:34:49 +02:00
vis2k
56278f5a84 Removed ConnectionArray class because it wasn't used anywhere. 2018-07-19 11:31:44 +02:00
vis2k
bdbafacbcb ClientScene: removed GetPlayerController function because it wasn't used anywhere and it was internal, hence couldn't be used in any project either. 2018-07-19 11:31:44 +02:00