SentCountAllowance
How do I use Sent Count Allowance
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
917 | get { return networkingPeer.SentCountAllowance; } | 1 |
1062 | newPeer.SentCountAllowance = networkingPeer.SentCountAllowance; | 2 |
File name: PhotonNetwork.cs
Copy
916 {
917 get { return networkingPeer.SentCountAllowance; }
918 set
919 {
920 if (value < 3) value = 3;
921 if (value > 10) value = 10;
922 networkingPeer.SentCountAllowance = value;
923 }
924 }
File name: PhotonNetwork.cs
Copy
1025 /// Connect(serverAddress, 1036 public static void SwitchToProtocol(ConnectionProtocol cp)
1037 {
1038 if (networkingPeer.UsedProtocol == cp)
1039 {
1040 return;
1041 }
1042 try
1043 {
1044 networkingPeer.Disconnect();
1045 networkingPeer.StopThread();
1046 }
1047 catch
1048 {
1049
1050 }
1051
1052 // set up a new NetworkingPeer
1053 NetworkingPeer newPeer = new NetworkingPeer(photonMono, String.Empty, cp);
1054 newPeer.mAppVersion = networkingPeer.mAppVersion;
1055 newPeer.CustomAuthenticationValues = networkingPeer.CustomAuthenticationValues;
1056 newPeer.PlayerName= networkingPeer.PlayerName;
1057 newPeer.mLocalActor = networkingPeer.mLocalActor;
1058 newPeer.DebugOut = networkingPeer.DebugOut;
1059 newPeer.CrcEnabled = networkingPeer.CrcEnabled;
1060 newPeer.lobby = networkingPeer.lobby;
1061 newPeer.LimitOfUnreliableCommands = networkingPeer.LimitOfUnreliableCommands;
1062 newPeer.SentCountAllowance = networkingPeer.SentCountAllowance;
1063 newPeer.TrafficStatsEnabled = networkingPeer.TrafficStatsEnabled;
1064
1065 networkingPeer = newPeer;
1066 Debug.LogWarning("Protocol switched to: " + cp + ".");
1067 }
SentCountAllowance 121 lượt xem
Gõ tìm kiếm nhanh...