Commit Graph

1377 Commits

Author SHA1 Message Date
vis2k
70ecdd8f3a NetworkClient.UpdateClients renamed to UpdateClient 2019-02-26 16:28:45 +01:00
vis2k
db32754100 NetworkClient: move Shutdown next to ShutdownAll 2019-02-26 16:26:33 +01:00
vis2k
9957cbc3b5 NetworkServer.OnConnected: call AddConnection in here too, instead of manually doing it from AddLocalClient and OnConnected 2019-02-26 16:07:40 +01:00
vis2k
fd561db9c2 NetworkServer.AddLocalClient: reused OnConnected 2019-02-26 16:07:40 +01:00
vis2k
81ecf61eed LocalClient: move connect above disconnect 2019-02-26 16:07:40 +01:00
vis2k
7ac3749274 NetworkServer.RemoveLocalClient: remove unnecessary parameter 2019-02-26 16:07:40 +01:00
vis2k
9c58cb5c80 syntax 2019-02-26 16:07:40 +01:00
vis2k
a724503f6e LocalClient.Disconnect: modify syntax to be more similar to NetworkClient.Disconnect 2019-02-26 16:07:39 +01:00
vis2k
6fa3aacea2 LocalClient: removed unnecessary m_Connected variable 2019-02-26 16:07:39 +01:00
vis2k
3967a7c089 LocalClient.InternalConnectLocalServer: always generate connect message 2019-02-26 16:07:39 +01:00
vis2k
903ca76c65 Remove NetworkServer.InvokeBytes. LocalConnection uses TransportReceive instead. 2019-02-26 16:07:39 +01:00
vis2k
c2dcf69e15 improve comments 2019-02-26 16:07:39 +01:00
vis2k
1c999df5de syntax 2019-02-26 16:07:39 +01:00
vis2k
312ef309ae NetworkConnection.TransportReceive: reuse InvokeHandler 2019-02-26 16:07:39 +01:00
vis2k
b15ad7dbc0 syntax 2019-02-26 16:07:39 +01:00
vis2k
17c343d28d NetworkConnection.InvokeHandler: improve error message 2019-02-26 16:07:39 +01:00
vis2k
2f322c37fe NetworkConnection: move InvokeHandler functions down to TransportReceive for better overview 2019-02-26 16:07:39 +01:00
vis2k
038f09de3f NetworkConnection: remove unused InvokeHandler(NetworkMessage) function 2019-02-26 16:07:39 +01:00
vis2k
06a334e6dd NetworkConnection.HandleBytes moved into TransportReceive 2019-02-26 16:07:39 +01:00
vis2k
f68119d614 LocalClient.Update uses OnDataReceived 2019-02-26 16:07:39 +01:00
vis2k
e605ec7251 NetworkClient.OnDataReceived made protected so it can be called from LocalClient 2019-02-26 16:07:39 +01:00
vis2k
cbc3c724c9 ClientScene.RegisterSystemHandlers: sort and add empty handlers to local client's handlers to avoid 'messageid not found' errors. This way we can reuse NetworkConnection.HandleBytes for local client without errors. 2019-02-26 16:07:39 +01:00
vis2k
29a95b33a1 NetworkConnection: move InvokeHandlers next to HandleBytes for a better overview 2019-02-26 16:07:39 +01:00
vis2k
2fcd0cac64 LocalClient packetQueue stores byte arrays and unpacks them in Update 2019-02-26 16:07:39 +01:00
vis2k
d86d9e3e87 m_internalmsgs renamed to packetqueue 2019-02-26 16:07:39 +01:00
vis2k
93e7da9b88 syntax 2019-02-26 16:07:39 +01:00
rodolphito
c931d03ae0 Simplified code a bit, and also removed allocation. (#453) 2019-02-26 08:21:43 -06:00
Paul Pacheco
58b7126f0b Use Length instead of position for getting the written data (#449)
* Use Length instead of position for getting the written data

* Update NetworkBehaviour.cs
2019-02-26 14:54:41 +01:00
vis2k
7109be3c1c move ProcessInternalMessages to Update 2019-02-26 09:09:55 +01:00
vis2k
b0da7f8b0f syntax 2019-02-26 09:03:00 +01:00
vis2k
48e08bdd05 no need for extra variable 2019-02-26 09:02:37 +01:00
vis2k
f1e3c6f8fd syntax 2019-02-26 09:02:12 +01:00
vis2k
0cdaaecd3a avoid shadowing member 2019-02-26 09:02:02 +01:00
vis2k
c7524cb7f1 NetworkClient.Update: remove unnecessary checks 2019-02-26 09:01:09 +01:00
vis2k
d42c13ad15 comment out unused function 2019-02-26 09:00:16 +01:00
vis2k
2c54ab3722 NetworkClient.connection via property 2019-02-26 08:59:43 +01:00
vis2k
605c4d471c rename m_ClientId to clientId 2019-02-26 08:57:12 +01:00
vis2k
4634f0632e comment out unused GenerateConnectError 2019-02-26 08:55:04 +01:00
vis2k
f87f00effa remove unused ctor 2019-02-26 08:54:20 +01:00
vis2k
c3b6fc5f4e syntax 2019-02-26 08:53:44 +01:00
vis2k
bb3bf0635b
Networkclient active (#448)
* use NetworkClient.active directly

* add comment
2019-02-26 08:50:59 +01:00
vis2k
24b3b0d0fb
Networkclient singleton (#447)
* NetworkClient.allClients replaced with singleton because there is only ever one client.

* use this()

* remove redundant log
2019-02-25 22:01:42 +01:00
vis2k
c84ea361f1 2018.3 ProjectSettings detected too late 2019-02-25 20:42:58 +01:00
vis2k
6c229c8c58 LocalClient: add internalmsgs comment 2019-02-25 20:27:12 +01:00
vis2k
39ec1fd256
0gc recv (#445)
* Protocol.UnpackMessage returns reader instead of content to avoid manually extracting content, just to create a reader from it in all callers

* Create NetworkReader outside of Protocol.Unpack
2019-02-25 20:15:47 +01:00
vis2k
c80a971126 2018.3 UnityConnectSettings detected too late 2019-02-25 20:15:16 +01:00
vis2k
647ff39d3f remove trailing whitespaces 2019-02-25 16:59:21 +01:00
vis2k
745519982e
Merge pull request #443 from vis2k/0gc
0gc
2019-02-25 13:57:31 +01:00
MrGadget
3735b3bd72 Update NetworkLobbyManager.cs (#442)
Removed two unused methods
2019-02-25 06:27:27 -06:00
vis2k
086de4bf88 NetworkServer.SendToReady/All/Observers: only pack message once instead of repacking it for each one again. This should avoid giant amounts of allocations (PackMessage->Writer.ToArray()) and computations 2019-02-24 22:52:42 +01:00