Paul Pacheco
0e285a5645
style: use simplest function available
2019-04-06 07:05:31 -05:00
Paul Pacheco
87e962b52b
style: 2 lines if
2019-04-06 07:01:48 -05:00
Paul Pacheco
eb1654f26e
style: naming convention
2019-04-06 06:56:16 -05:00
Paul Pacheco
314dde7d40
style: naming convention
2019-04-06 06:53:57 -05:00
Paul Pacheco
e8679a0562
refactor: remove pointless if
2019-04-06 06:51:37 -05:00
vis2k
b202473bcf
syntax
2019-04-06 13:33:38 +02:00
vis2k
9d2682eb2a
NetworkServer.SetupLocalPlayerForConnection: removed unused variable
2019-04-06 13:33:18 +02:00
vis2k
512c7ff521
NetworkManager.OnServerConnectInternal: simplify code
2019-04-06 13:18:21 +02:00
vis2k
c5236f5504
ClientScene.DestroyAllClientObjects is now called from ClientScene.Shutdown so that the NetworkManager doesn't have to worry about it
2019-04-06 13:13:32 +02:00
vis2k
a9a2afd06e
Remove NetworkManager.address because it seems pointless ( #744 )
2019-04-06 13:03:25 +02:00
vis2k
dfd729850e
NetworkIdentity.ClearObservers: simplify code
2019-04-06 12:43:22 +02:00
vis2k
dac128f036
NetworkIdentity.SetLocalPlayer: use foreach
2019-04-06 12:42:30 +02:00
vis2k
1ad3b120b6
NetworkIdentity.OnUpdateVars: reuse NetworkBehaviours which already calls GetComponents if not initialized yet
2019-04-06 12:40:46 +02:00
vis2k
242cf9f1d2
NetworkIdentity.OnStartClient: fix log message
2019-04-06 12:36:44 +02:00
vis2k
9e8dc924de
NetworkClient.RegisterHandler: remove unnecessary ToString
2019-04-06 12:32:11 +02:00
vis2k
c6fffc6505
add empty line
2019-04-06 12:20:58 +02:00
vis2k
54a24d7bda
ClientScene.AddPlayer: use proper variable name
2019-04-06 12:09:52 +02:00
vis2k
ef14026be4
ClientScene.RemovePlayer: shorter code
2019-04-06 12:09:00 +02:00
vis2k
fb716df129
fix: NetworkClient.Shutdown calls ClientScene.Shutdown again to properly clean up client scene. ClientScene only cleans up itself without touching transport or NetworkIdentities (fixes the bug where the player object wouldn't be destroyed after calling StopClient)
2019-04-06 12:03:57 +02:00
MrGadget
c691c07d96
Added EditorBrowsable(EditorBrowsableState.Never) to Obsoletes ( #741 )
2019-04-06 10:43:14 +02:00
rodolphito
333bbb062a
A gift for vis. ( #742 )
2019-04-06 10:42:52 +02:00
rodolphito
9d0cf977f9
Use checked() syntax to throw on overflow ( #740 )
...
* Use checked() syntax to throw on overflow
* Expect exceptions in the tests. Tests pass now.
2019-04-05 19:49:49 -05:00
rodolphito
b995a98743
Fixed NetworkReader tests, everything passes now. Also sneaked in two more tests for 0-length byte arrays because the conventional test didnt apply to them, since they didnt throw when there wasnt any data for them. Also made NetworkReader throw when it can't satisfy a request to read bytes past EOS. ( #739 )
2019-04-05 18:37:13 -05:00
rodolphito
f64e127378
Add tests for buffer overrun, raising the bar on NetworkReader. ( #734 )
2019-04-06 00:20:04 +02:00
vis2k
bd9d7b9fd6
NetworkReader.ReadString throws exception again
2019-04-06 00:18:55 +02:00
vis2k
cc16df72cc
Transport.TransportReceive catches exceptions and disconnects the connection after invalid data was received. ( #737 )
2019-04-06 00:17:45 +02:00
vis2k
7d2c5e5b0e
remove empty whitespace
2019-04-05 23:48:18 +02:00
vis2k
64ed66edbe
NetworkServer.InternalSetClientNotReady moved into SetClientNotReady because it can't be overwritten anymore anyway
2019-04-05 22:00:58 +02:00
vis2k
7b550fdf4b
NetworkServer.SetAllClientsNotReady: simplify code
2019-04-05 22:00:15 +02:00
vis2k
a526c39228
NetworkServer.InternalReplacePlayerForConnection: rename 'playerGameObject' to 'player' for consistency with AddPlayerForConnection
2019-04-05 21:57:36 +02:00
vis2k
e27ebf65bb
NetworkServer.InternalReplacePlayerForConnection: rename 'playerNetworkIdentity' to 'identity' for consistency with AddPlayerForConnection
2019-04-05 21:56:54 +02:00
vis2k
a3e9fbb5bd
NetworkServer.DisconnectAllConnections: simplify code
2019-04-05 21:53:24 +02:00
vis2k
a574b181bb
remove empty line
2019-04-05 21:45:01 +02:00
vis2k
fa64fa077f
NetworkServer: move UpdateServerObjects into Update
2019-04-05 21:43:17 +02:00
vis2k
2048addde4
NetworkClient.RegisterSystemHandlers: add comments
2019-04-05 21:33:02 +02:00
vis2k
a7e0b2c728
Add LocalClient.cs generated meta file
2019-04-05 20:23:39 +02:00
MrGadget
355585f1fc
Fixed Typo
2019-04-05 14:21:50 -04:00
MrGadget
fdb81ca2b2
Add LocalClient.cs Dummy for Asset Store ( #733 )
...
This file should ship with 1.7 to the Asset Store, and can be removed when 1.8 is ready to publish to the store in a May 2019.
2019-04-05 20:14:02 +02:00
rodolphito
95baed5e83
Add tests for strange floats, doubles, and decimals ( #732 )
2019-04-05 20:13:19 +02:00
vis2k
de0b9b5789
NetworkClient.active reads from .connectState so we don't have redundant states.
2019-04-05 20:11:22 +02:00
rodolphito
04370e56c0
Add more test cases to string read/write. ( #731 )
2019-04-05 19:52:39 +02:00
rodolphito
015d0d508e
fix: Potential DOS attack on server by sending packed ulongs when packed uints are expected. ( #730 )
...
* fix: Potential DOS attack on server by sending packed ulongs when packed uints are expected.
* Update NetworkReader.cs
2019-04-05 19:52:00 +02:00
rodolphito
3cee3abc48
fix: Potential DOS attack by sending invalid UTF8 byte sequences ( #727 )
...
* fix: Potential DOS attack by sending invalid UTF8 byte sequences
* Added test case for invalid UTF8 bytes
2019-04-05 19:47:37 +02:00
rodolphito
0d2f64228c
Added Unicode Strings test ( #728 )
2019-04-05 18:12:28 +02:00
vis2k
fdd35bc840
List Server Example: read IP from bytes again after list server IPv6 bug was fixed
2019-04-05 11:26:31 +02:00
rodolphito
4ee787b0eb
What even is m_td? Rename it to something that can actually be read. ( #709 )
2019-04-05 09:59:45 +02:00
rodolphito
5f63256cd1
We can hide this better by using this attribute ( #725 )
2019-04-05 09:59:25 +02:00
vis2k
ee2ace8e42
fix : #652 OnPostProcessScene includes disabled NetworkIdentities in scene
2019-04-04 18:41:42 +02:00
MichalPetryka
8caf299f4a
Whitespace and encoding normalization ( #722 )
2019-04-04 18:20:13 +02:00
rodolphito
7948961e14
Simplified code in NetworkConnection. ( #717 )
2019-04-04 18:17:44 +02:00
vis2k
62e28bdc46
List Server Example: IP as string again for easier IPv6 support
2019-04-04 17:08:44 +02:00
vis2k
11f34ef90f
List Server Example: update comments
2019-04-04 17:08:44 +02:00
vis2k
b329bc4e8a
List Server Example: improve comment log message
2019-04-04 17:08:44 +02:00
vis2k
bfe27ffadf
List Server Example: read/write title as UTF8 encoded bytes with length prefix
2019-04-04 17:08:44 +02:00
vis2k
5226ed64de
List Server Example: warn gameserver if it tries to send a too big message which would be rejected by List Server
2019-04-04 17:08:44 +02:00
vis2k
401455197f
List Server Example: read player, capacity before title
2019-04-04 17:08:44 +02:00
vis2k
33c8d5685f
add comment
2019-04-04 17:08:44 +02:00
vis2k
02fd8d3e8c
List Server Example: parse IP from bytes because the list server sends it as bytes now.
2019-04-04 17:08:44 +02:00
rodolphito
699a261e91
fix: weaver Cmd/Rpc/Target prefix check is no longer trash ( #707 )
...
* fix: weaver Cmd prefix check should not allow methods with names shorter than 3 characters.
* fix: weaver Rpc prefix check should not allow methods with names shorter than 3 characters.
* fix: weaver Target prefix check should not allow methods with names shorter than 6 characters.
* Update Assets/Mirror/Editor/Weaver/Processors/CommandProcessor.cs
Co-Authored-By: rodolphito <rodol@rivalrebels.com>
* Update Assets/Mirror/Editor/Weaver/Processors/TargetRpcProcessor.cs
Co-Authored-By: rodolphito <rodol@rivalrebels.com>
* Update Assets/Mirror/Editor/Weaver/Processors/RpcProcessor.cs
Co-Authored-By: rodolphito <rodol@rivalrebels.com>
2019-04-04 05:45:21 -05:00
vis2k
5994f0f207
List Server Example: show status indicator for client to list server connection
2019-04-04 10:08:58 +02:00
rodolphito
22d237505c
Renamed m_MessageHandlers to messageHandlers ( #708 )
2019-04-04 09:50:02 +02:00
rodolphito
cdeed8b558
Remove prefixes in NetworkAnimator. ( #710 )
2019-04-04 09:48:52 +02:00
rodolphito
77e5de7352
Renamed m_VisUpdateTime lastUpdateTime ( #711 )
2019-04-04 09:48:28 +02:00
rodolphito
a5ead70961
Rename s_NextNetworkId to nextNetworkId ( #712 )
2019-04-04 09:47:51 +02:00
rodolphito
13679887f4
Renamed m_CmdHandlerDelegates to cmdHandlerDelegates ( #713 )
2019-04-04 09:47:37 +02:00
rodolphito
382e125146
Removed s_ prefixes in NetworkManager ( #714 )
2019-04-04 09:47:12 +02:00
rodolphito
46841cdd3f
Remove k_ prefixes in weaver ( #715 )
...
* Rename k_CmdPrefix to CmdPrefix
* Rename k_RpcPrefix to RpcPrefix
* Rename k_TargetRpcPrefix to TargetRpcPrefix
2019-04-04 09:46:49 +02:00
rodolphito
df132b6893
Inlined an internal method call. ( #716 )
2019-04-04 09:46:19 +02:00
vis2k
e9717d87ad
Syntax
2019-04-03 16:05:45 +02:00
vis2k
370f66b9b4
List Server Example: add connected/disconnected log messages
2019-04-03 16:05:16 +02:00
vis2k
c617ffd61c
List Server Example: improve log messages
2019-04-03 16:05:03 +02:00
Paul Pacheco
053949b7d2
fix(weaver): #696 detect .mystruct = new MyStruct() changes with syncvars ( #702 )
...
* clearing struct should set dirty bit
This reproduces issue #696
using .mystruct = default uses initobj instead of stfld, so the weaver misses it
* refactor: use index for so that we can insert instructions
* refactor: rename test
* fix : #696 use generated setter for .mystruct = new MyStruct()
* Update PropertySiteProcessor.cs
* Update PropertySiteProcessor.cs
2019-04-03 13:59:37 +02:00
vis2k
5b30a94923
Merge pull request #705 from vis2k/MrGadget1024-patch-2
...
fix: Lobby Remove button not showing for P1 when Server Only
2019-04-03 13:37:16 +02:00
Paul Pacheco
e7c98af6eb
Obsolete non generic InvokeHandler
2019-04-03 06:27:46 -05:00
MrGadget
377c47ce74
fix: Lobby Remove button not showing for P1 when Server Only
2019-04-03 00:16:23 -04:00
Paul Pacheco
040bcb45ad
feat: SyncList now supports any IList implementation ( #704 )
2019-04-02 21:39:19 -05:00
Paul Pacheco
2683572fb4
feat: SyncDictionary can now be used for any IDictionary ( #703 )
2019-04-02 21:26:24 -05:00
vis2k
0c1d5001ba
Merge pull request #701 from Katori/DontDeletePDB
...
fix(Weaver): Don't delete the PDB after Weaving
2019-04-02 23:51:13 +02:00
Zac North
c78120eca2
Don't delete the PDB, what were they thinking?
2019-04-02 14:28:56 -04:00
vis2k
8dc0c73d77
Merge pull request #695 from MrGadget1024/Additive-Scene-Example
...
Additive Scenes Example
2019-04-02 17:08:28 +02:00
vis2k
e1b4b181c4
NetworkIdentity.RebuildObservers: change "Observer is not ready for: ..." warning to debug log, because it would constantly be spammed if a connection disconnects and we keep the player in the game for a while before disconnecting. E.g. if NetworkManager.OnServerDestroy delays the disconnect to avoid a player from fleeing combat.
2019-04-02 12:24:36 +02:00
vis2k
9c8211e573
NetworkServer.OnDisconnected: remove "Player not destroyed when connection disconnected." warning. This warning would be shown if a NetworkManager's OnServerDisconnect function wouldn't remove the player immediately, which is completely normal in most online games where the server delays a disconnect if the player was recently in combat - which would then show this warning every single time. OnServerDisconnect removes the player controller anyway, so there is no need for this warning at all.
2019-04-02 12:11:26 +02:00
Paul Pacheco
c58cf884d4
test: Test that setting syncvar sets dirty bits
2019-04-02 03:45:29 -05:00
Paul Pacheco
2ca80e1a90
refactor: move property site processor into a separate class
2019-04-02 03:16:50 -05:00
Paul Pacheco
ac697a454b
style: C#7 syntax
2019-04-02 02:32:29 -05:00
Paul Pacheco
312c0fcf5d
style: C# 7 code style
2019-04-02 02:27:11 -05:00
Paul Pacheco
9d54bf7bb1
style: naming convention
2019-04-02 02:26:01 -05:00
Chris Langsenkamp
297b671766
Renamed script to AdditiveNetworkManager
2019-04-01 19:18:15 -04:00
Chris Langsenkamp
2c0fa42568
Made Lobby player controller more similar to Additive player controller, per request.
2019-04-01 13:55:34 -04:00
Chris Langsenkamp
dc8f9b462a
Code changes as requested
2019-04-01 13:54:15 -04:00
vis2k
ab44ac8f8b
fix : #692 by always adding connectionToClient when rebuilding observers
2019-04-01 17:19:47 +02:00
vis2k
8f3c8edd86
RebuildObservers: add comments
2019-04-01 17:09:11 +02:00
vis2k
512e904ec0
RebuildObservers: order hashset syntax more logically
2019-04-01 17:01:44 +02: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
vis2k
9eac983872
. NetworkManager.RegisterClientMessages doesn't require NetworkClient parameter anymore
2019-03-26 12:16:57 +01:00
vis2k
712aecb452
NetworkClient.REgisterHandle made static
2019-03-26 12:16:57 +01:00
vis2k
ba00554e0c
NetworkClient.GetRTT made static
2019-03-26 12:16:57 +01:00
vis2k
4abc58b136
NetworkClient.Send(msgId, msg) made static
2019-03-26 12:16:57 +01:00
vis2k
cd56c6a6f7
NetworkTime.UpdateClient doesn't require NetworkClient anymore
2019-03-26 12:16:57 +01:00
vis2k
8c125d2fd3
NetworkClient.Send made static
2019-03-26 12:16:57 +01:00
vis2k
558e1d8754
NetworkClient.SetHandlers made static
2019-03-26 12:16:57 +01:00
vis2k
180d3f8cf4
NetworkClient.isConnected made static
2019-03-26 12:16:57 +01:00