Commit 9687c8a
fix: [Backport] NetworkBehaviour and NetworkVariable length safety checks (#3415)
<!-- Replace this block with what this PR does and why. Describe what
you'd like reviewers to know, how you applied the engineering
principles, and any interesting tradeoffs made. Delete bullet points
below that don't apply, and update the changelog section as appropriate.
-->
<!-- Add short version of the JIRA ticket to the PR title (e.g. "feat:
new shiny feature [MTT-123]") -->
[MTTB-1080](https://jira.unity3d.com/browse/MTTB-1080)
1.x for #3335
## Changelog
- Fixed: NetworkBehaviour length safety checks use `int` instead of
`ushort`
- Fixed: NetworkVariable `EnsureNetworkVariableLengthSafety` checks use
`int` instead of `ushort`
## Testing and Documentation
- No tests have been added.
<!-- Uncomment and mark items off with a * if this PR deprecates any
API:
### Deprecated API
- [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter
yyyy-mm-dd)` entry.
- [ ] An [api updater] was added.
- [ ] Deprecation of the API is explained in the CHANGELOG.
- [ ] The users can understand why this API was removed and what they
should use instead.
-->
## Backport
<!-- If this is a backport:
- Add the following to the PR title: "\[Backport\] ..." .
- Link to the original PR.
If this needs a backport - state this here
If a backport is not needed please provide the reason why.
If the "Backports" section is not present it will lead to a CI test
failure.
-->
This is a backport of #3405
---------
Co-authored-by: Michał Chrobot <[email protected]>1 parent f167039 commit 9687c8a
File tree
8 files changed
+111
-148
lines changed- com.unity.netcode.gameobjects
- Runtime
- Core
- Messaging/Messages
- NetworkVariable
- TestHelpers/Runtime
- Tests/Runtime
8 files changed
+111
-148
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
Lines changed: 21 additions & 51 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1112 | 1112 | | |
1113 | 1113 | | |
1114 | 1114 | | |
1115 | | - | |
| 1115 | + | |
1116 | 1116 | | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
| 1117 | + | |
1124 | 1118 | | |
1125 | 1119 | | |
1126 | 1120 | | |
1127 | 1121 | | |
1128 | 1122 | | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
| 1123 | + | |
1134 | 1124 | | |
1135 | 1125 | | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
| 1126 | + | |
1140 | 1127 | | |
1141 | 1128 | | |
1142 | | - | |
| 1129 | + | |
1143 | 1130 | | |
1144 | 1131 | | |
1145 | 1132 | | |
1146 | 1133 | | |
1147 | 1134 | | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | | - | |
| 1135 | + | |
1152 | 1136 | | |
1153 | 1137 | | |
1154 | 1138 | | |
1155 | 1139 | | |
1156 | 1140 | | |
1157 | | - | |
| 1141 | + | |
1158 | 1142 | | |
1159 | 1143 | | |
1160 | 1144 | | |
| |||
1169 | 1153 | | |
1170 | 1154 | | |
1171 | 1155 | | |
1172 | | - | |
| 1156 | + | |
1173 | 1157 | | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
| 1158 | + | |
1180 | 1159 | | |
1181 | 1160 | | |
1182 | 1161 | | |
1183 | | - | |
1184 | | - | |
| 1162 | + | |
| 1163 | + | |
1185 | 1164 | | |
1186 | 1165 | | |
1187 | 1166 | | |
1188 | 1167 | | |
1189 | 1168 | | |
1190 | 1169 | | |
1191 | | - | |
| 1170 | + | |
1192 | 1171 | | |
1193 | 1172 | | |
1194 | 1173 | | |
1195 | 1174 | | |
1196 | | - | |
| 1175 | + | |
1197 | 1176 | | |
1198 | 1177 | | |
1199 | 1178 | | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
1205 | | - | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
| 1179 | + | |
| 1180 | + | |
1210 | 1181 | | |
1211 | | - | |
| 1182 | + | |
1212 | 1183 | | |
1213 | | - | |
| 1184 | + | |
1214 | 1185 | | |
1215 | | - | |
1216 | | - | |
| 1186 | + | |
1217 | 1187 | | |
1218 | 1188 | | |
1219 | 1189 | | |
| |||
1295 | 1265 | | |
1296 | 1266 | | |
1297 | 1267 | | |
1298 | | - | |
| 1268 | + | |
1299 | 1269 | | |
1300 | 1270 | | |
1301 | 1271 | | |
| |||
1333 | 1303 | | |
1334 | 1304 | | |
1335 | 1305 | | |
1336 | | - | |
| 1306 | + | |
1337 | 1307 | | |
1338 | 1308 | | |
1339 | 1309 | | |
| |||
1342 | 1312 | | |
1343 | 1313 | | |
1344 | 1314 | | |
1345 | | - | |
| 1315 | + | |
1346 | 1316 | | |
1347 | 1317 | | |
1348 | 1318 | | |
| |||
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
114 | 118 | | |
115 | | - | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
| |||
Lines changed: 34 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1476 | 1476 | | |
1477 | 1477 | | |
1478 | 1478 | | |
1479 | | - | |
1480 | | - | |
1481 | | - | |
1482 | | - | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | | - | |
1489 | 1479 | | |
1490 | 1480 | | |
1491 | 1481 | | |
| |||
1525 | 1515 | | |
1526 | 1516 | | |
1527 | 1517 | | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
1533 | | - | |
1534 | | - | |
1535 | | - | |
1536 | | - | |
1537 | | - | |
1538 | | - | |
1539 | | - | |
1540 | 1518 | | |
1541 | 1519 | | |
1542 | 1520 | | |
| |||
1744 | 1722 | | |
1745 | 1723 | | |
1746 | 1724 | | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
1755 | 1725 | | |
1756 | 1726 | | |
1757 | 1727 | | |
| |||
1765 | 1735 | | |
1766 | 1736 | | |
1767 | 1737 | | |
1768 | | - | |
| 1738 | + | |
1769 | 1739 | | |
1770 | 1740 | | |
1771 | 1741 | | |
1772 | | - | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
1773 | 1748 | | |
1774 | 1749 | | |
1775 | 1750 | | |
| |||
1791 | 1766 | | |
1792 | 1767 | | |
1793 | 1768 | | |
1794 | | - | |
| 1769 | + | |
1795 | 1770 | | |
1796 | 1771 | | |
1797 | 1772 | | |
| |||
1803 | 1778 | | |
1804 | 1779 | | |
1805 | 1780 | | |
1806 | | - | |
1807 | | - | |
| 1781 | + | |
1808 | 1782 | | |
1809 | | - | |
1810 | | - | |
1811 | | - | |
1812 | | - | |
1813 | | - | |
1814 | 1783 | | |
1815 | | - | |
1816 | | - | |
1817 | | - | |
1818 | | - | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
1819 | 1807 | | |
1820 | | - | |
1821 | | - | |
1822 | | - | |
| 1808 | + | |
1823 | 1809 | | |
1824 | 1810 | | |
1825 | 1811 | | |
| |||
1916 | 1902 | | |
1917 | 1903 | | |
1918 | 1904 | | |
1919 | | - | |
| 1905 | + | |
1920 | 1906 | | |
1921 | 1907 | | |
1922 | 1908 | | |
| |||
0 commit comments