Commit Graph

577 Commits

Author SHA1 Message Date
Chris Langsenkamp
dc8f9b462a Code changes as requested 2019-04-01 13:54:15 -04:00
Chris Langsenkamp
32d6c19e5f Initial Publish 2019-03-31 22:07:37 -04:00
Paul Pacheco
ee9c737bda feat: allow users to detect mirror version 3 2019-03-31 13:27:03 -05:00
Paul Pacheco
e75d4b29dd style: remove redundant methods 2019-03-31 11:30:30 -05:00
vis2k
b876e256eb
Merge pull request #689 from paulpach/zigzag
perf: Implement zigzag algorithm so negatives pack efficiently
2019-03-31 14:25:35 +02:00
Paul Pacheco
5f1ef4ab1f perf: Pack small 64 bit negatives efficiently 2019-03-31 07:16:57 -05:00
Paul Pacheco
480af1aa6c perf: Pack small 32 bit negatives efficiently 2019-03-31 07:16:51 -05:00
rodolphito
f5d80175fe Fixed a typo in NetworkServer (#691) 2019-03-30 16:01:12 -05:00
rodolphito
2db7576bbc perf: Use WritePackedUInt32 in SyncList (#688) 2019-03-30 12:33:16 -05:00
Paul Pacheco
3ec7f6c1d0 style: remove redundant field initialization 2019-03-30 12:21:37 -05:00
Paul Pacheco
d12c4b80ca style: constructor of abstract class should be protected 2019-03-30 12:20:02 -05:00
rodolphito
594e8c9d89 Syncdict style (#687)
* Renamed m_Objects to objects

* Renamed Changes to changes
2019-03-30 12:16:35 -05:00
rodolphito
f61b757b8a Synclist style (#686)
* Rename m_Objects to objects

* Rename Changes to changes

* Empty braces

* use default shorthand

* Use expression body getter
2019-03-30 12:09:37 -05:00
Paul Pacheco
bd304ab90b style: follow C# code style conventions 2019-03-30 12:06:39 -05:00
Paul Pacheco
695979e914
feat: Add SyncHashSet and SyncSortedSet (#685)
* feat: Add SyncHashSet and SyncSorted set
2019-03-30 11:51:06 -05:00
Paul Pacheco
a8599c1af2 feat: Show compile time error if overriding unused OnServerAddPlayer (#682)
* remove obsolete OnServerAddPlayer

BREAKING CHANGE: Remove obsolete OnServerAddPlayer

Any person that overrides this method has a broken game.  These methods are never called anywhere.

The user gets a warning because they are overriding an obsolete method,  which might get ignored if they have lots of other warnings.   They would run their game and their game would not work at all.  No errors.

By removing these methods, users that override these methods will get a compile time error instead.  So they cannot ignore this error and they will fix it.

* Method is no longer available in NetworkLobbyManager
2019-03-28 11:36:13 +01:00
Paul Pacheco
8dea50ed18
fix: call Obsoleted OnStartClient (#681) 2019-03-27 18:13:59 -05:00
MichalPetryka
468ec80dbb Remove useless method (#680) 2019-03-27 17:23:37 -05:00
rodolphito
375303297c Removed internal access modifier. (#675)
good catch,  this should be private
2019-03-27 17:22:21 -05:00
rodolphito
40d2ec54e5 This method seems pretty redundant, could just be called directly. (#677) 2019-03-27 13:06:42 -05:00
MrGadget
49f39f9c09 Updated Obsolete comment and code to remove singleton (#661)
* Updated Obsolete comment and code to remove singleton

* Update NetworkClient.cs

* Update NetworkClient.cs

* Update NetworkClient.cs
2019-03-27 15:13:25 +01:00
rodolphito
1feff9d749 Removed useless comment. (#676) 2019-03-27 13:56:59 +01:00
rodolphito
6edfd3ddf1 Removed more internals. (#673) 2019-03-27 13:37:12 +01:00
rodolphito
ba298c74b0 Style guidelines say these are bad. (#672) 2019-03-27 13:20:36 +01:00
rodolphito
57066a6003 These can be private. (#669) 2019-03-27 13:13:27 +01:00
rodolphito
4897edd76a More internal access modifier removals (#671) 2019-03-27 13:13:11 +01:00
rodolphito
9be7426efa Remove s_ prefix because the entire class is static, the prefix doesnt actually specify anything. (#668) 2019-03-27 12:04:07 +01:00
rodolphito
86c1942310 Remove s_ prefix because the entire class is static, the prefix doesnt actually specify anything. (#667) 2019-03-27 12:03:37 +01:00
rodolphito
595039865f Removed duplicated address storage. (#664)
* Removed duplicated address storage.

* Removed the obsoletion as per vis' request.
2019-03-27 10:27:41 +01:00
rodolphito
c289ffb440 Remove proxy methods for setting playerController. (#665)
* Deprecate proxy methods for setting playerController.

* shortened obsoleted methods.

* This isnt actually public facing, its internal. Obsoletion is unnecessary, plain removal is ok.
2019-03-27 10:26:45 +01:00
uwee
f4cdfbf952 Remove IsClientConnected (#663)
* remove IsClientConnected

no longer needed now that NetworkClient is static

* removed in other scripts also

* marked as obsolete
2019-03-27 09:15:03 +01:00
MrGadget
d7306986b6 Updated Lobby Example Scenes Lighting (#662) 2019-03-26 17:49:56 +01:00
MrGadget
d2868646fa SyncVar Updates (#660)
* Change SyncVar hooks to use `nameof`
I intentionally left the test for missing hook as a literal string because it won't compile otherwise.

* Removed unnecessary property value set from hook
2019-03-26 15:40:28 +01:00
uwee
68f63b5f69 bool InActiveScene not referenced in any script? (#656)
* code is not referenced in any script?

* fully remove code
2019-03-26 13:58:05 +01:00
Paul Pacheco
2d63ee1318
fix: Set syncvar variables after calling the hook (#659)
Previously, during deserialize,  Mirror either called the hook for a syncvar or it set the variable, but never both. So users had to set the variable inside the hook.

```cs
class Player : NetworkBehaviour {

	[SyncVar(hook=nameof(OnVarChanged))]
	public int myvar;

	public void OnVarChanged(int newvalue) {

		Debug.Log("Got new value " + newvalue);
		Debug.Log("Old value is " + myvar);

		// with this pull request the following line is no longer needed
		// the weaver will do this after the hook finishes
		// this.myvar = newvalue;
	}
}
```

fix: Hook not working with NetworkIdentity or GameObjects

Deserializing NetworkIdentity or GameObjects was broken, it called the hook only if there was no hook,  and it saved the variable only if there was a hook.
2019-03-26 07:15:25 -05:00
Paul Pacheco
4d74f555b1 Update Assets/Mirror/Runtime/NetworkClient.cs
Co-Authored-By: vis2k <info@noobtuts.com>
2019-03-26 12:16:57 +01:00
vis2k
1879f5ecdc Add [Obsolete] for compatibility 2019-03-26 12:16:57 +01:00
vis2k
9bc1dc1e85 NetworkClient class made static 2019-03-26 12:16:57 +01:00
vis2k
912572d6fe NetworkClient.ConnectLocalServer: use the same order as Connect 2019-03-26 12:16:57 +01:00
vis2k
7bc320d098 LocalClient class moved into NetworkClient 2019-03-26 12:16:57 +01:00
vis2k
31836c16d1 NetworkClient.RemoveTransportHandlers made static 2019-03-26 12:16:57 +01:00
vis2k
4dbaff8ac1 NetworkManager.StartClient/StartHost don't return NetworkClient anymore 2019-03-26 12:16:57 +01:00
vis2k
d1d006e6d7 NetworkClient.Connect made static 2019-03-26 12:16:57 +01:00
vis2k
080bf2eaf0 NetworkClient.InitializeTransportHandlers made static 2019-03-26 12:16:57 +01:00
vis2k
32ed62f82b NetworkClient.OnError made static 2019-03-26 12:16:57 +01:00
vis2k
461ba0b036 NetworkClient.OnDisconnected made static 2019-03-26 12:16:57 +01:00
vis2k
60083ff72d NetworkClient.OnDataReceived made static 2019-03-26 12:16:57 +01:00
vis2k
42bceb25d9 NetworkClient.OnConnected made static 2019-03-26 12:16:57 +01:00
vis2k
493bf7fa5f NetworkClient.RegisterSystemHandlers made static 2019-03-26 12:16:57 +01:00
vis2k
bc6c2542f6 NetworkClient.UnregisterHandler made static 2019-03-26 12:16:57 +01:00