Skip to content

Commit 8545ea9

Browse files
committed
Merge branch 'develop' into sam/feature/interpolation-for-network-transform
* develop: feat: NetworkBehaviour.IsSpawned (#1190) feat: added tip to the network manager inspector that directs to install tools (MTT-1211) (#1182) refactor!: remove network dictionary & set, use native container in List, add tests (#1149) fix: Fixed remote disconnects not properly cleaning up (#1184) test: base changes to PR-1114 (#1165) test: verify do not destroy networkobjects on networkmanager shutdown (#1183) chore: removal of EnableNetworkVariable in NetworkConfig. It's always True now (#1179) fix: Fix DontDestroyWithOwner not returning ownership (#1181) test: Giving Android some more room as the connection tests are timing sensitive (#1178) fix: unitytransport connectionmode buttons (#1176) test: added min frames to multi-instance helper (#1170) chore: Add mobile tests to nightly trigger (#1161) feat: snapshot spawn pre-requisite (#1166) feat: Unity Transport + Relay (#887) feat: client scene synchronization mode (#1171) # Conflicts: # testproject/Assets/Scenes/SampleScene.unity
2 parents f5e27b9 + 5114ca8 commit 8545ea9

File tree

119 files changed

+7123
-2111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+7123
-2111
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
Profiling/ @Unity-Technologies/multiplayer-tools
55
/com.unity.netcode.gameobjects/Runtime/Transports/ @Unity-Technologies/server-team
66
/com.unity.netcode.gameobjects/Runtime/SceneManagement/ @NoelStephensUnity
7-
/com.unity.multiplayer.transport.utp/ @Unity-Technologies/server-team
7+
/com.unity.netcode.adapter.utp/ @Unity-Technologies/server-team
88
Documentation~/ @Briancoughlin

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.vs
33
.vscode
44
.idea
5+
.DS_Store

.yamato/_run-all.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ run_all_tests:
55
dependencies:
66
# Pull in package and validate jobs through the badges job
77
- .yamato/_triggers.yml#badges_test_trigger
8+
- .yamato/mobile-build-and-test.yml#2021.2_Run_iOS_Player_With_Tests
9+
- .yamato/mobile-build-and-test.yml#2021.2_Run_Android_Player_With_Tests
810
{% for platform in test_platforms -%}
911
{% for project in projects -%}
1012
{% for editor in project.test_editors -%}

.yamato/disable-burst-if-requested.py

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import argparse
2+
import json
3+
import os
4+
5+
6+
args = None
7+
platform_plugin_definition = None
8+
9+
10+
def resolve_target(platform):
11+
resolved_target = platform
12+
if 'StandaloneWindows' in platform:
13+
resolved_target = 'StandaloneWindows'
14+
elif 'StandaloneLinux' in platform:
15+
resolved_target = 'StandaloneLinux64'
16+
17+
return resolved_target
18+
19+
20+
def create_config(settings_path, platform):
21+
config_name = os.path.join(settings_path, 'BurstAotSettings_{}.json'.format(resolve_target(platform)))
22+
monobehaviour = {
23+
'm_Enabled': True,
24+
'm_EditorHideFlags': 0,
25+
'm_Name': "",
26+
'm_EditorClassIdentifier': 'Unity.Burst.Editor:Unity.Burst.Editor:BurstPlatformAotSettings',
27+
'DisableOptimisations': False,
28+
'DisableSafetyChecks': True,
29+
'DisableBurstCompilation': False
30+
}
31+
32+
data = {'MonoBehaviour': monobehaviour}
33+
with open(config_name, 'w') as f:
34+
json.dump(data, f)
35+
return config_name
36+
37+
38+
def get_or_create_AOT_config(project_path, platform):
39+
settings_path = os.path.join(project_path, 'ProjectSettings')
40+
if not os.path.isdir(settings_path):
41+
os.mkdir(settings_path)
42+
config_names = [os.path.join(settings_path, filename) for filename in os.listdir(settings_path) if filename.startswith("BurstAotSettings_{}".format(resolve_target(platform)))]
43+
if not config_names:
44+
return [create_config(settings_path, platform)]
45+
return config_names
46+
47+
48+
def disable_AOT(project_path, platform):
49+
config_names = get_or_create_AOT_config(project_path, platform)
50+
for config_name in config_names:
51+
set_AOT(config_name, True)
52+
53+
54+
def enable_AOT(project_path, platform):
55+
config_names = get_or_create_AOT_config(project_path, platform)
56+
for config_name in config_names:
57+
set_AOT(config_name, False)
58+
59+
60+
def set_AOT(config_file, status):
61+
config = None
62+
with open(config_file, 'r') as f:
63+
config = json.load(f)
64+
65+
assert config is not None, 'AOT settings not found; did the burst-enabled build finish successfully?'
66+
67+
config['MonoBehaviour']['DisableBurstCompilation'] = status
68+
with open(config_file, 'w') as f:
69+
json.dump(config, f)
70+
71+
72+
def main():
73+
enable_burst = os.environ.get('ENABLE_BURST_COMPILATION', 'true').strip().lower()
74+
if enable_burst == 'true':
75+
print('BURST COMPILATION: ENABLED')
76+
elif enable_burst == 'false':
77+
print('BURST COMPILATION: DISABLED')
78+
disable_AOT(args.project_path, args.platform)
79+
else:
80+
sys.exit('BURST COMPILATION: unexpected value: {}'.format(enable_burst))
81+
82+
83+
def parse_args():
84+
global args
85+
parser = argparse.ArgumentParser(description='This tool disables burst AOT compilation')
86+
parser.add_argument('--project-path', help='Specify the location of the unity project.')
87+
parser.add_argument('--platform', help="Platform to be used to run the build.")
88+
args = parser.parse_args()
89+
90+
91+
if __name__ == '__main__':
92+
parse_args()
93+
main()

.yamato/mobile-build-and-test.yml

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,32 @@
22
name: 2021.2 Build Android player
33
agent:
44
type: Unity::VM
5-
image: package-ci/win10:stable
6-
flavor: b1.large
5+
image: desktop/android-execution-r19:v0.1.1-860408
6+
flavor: b1.xlarge
77
commands:
88
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
99
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr.bat --output utr.bat
10-
- |
11-
mkdir C:\TMP
12-
cd C:\TMP
13-
unity-downloader-cli -u 2021.2 -c editor -c Android -w --fast
10+
- python .yamato/disable-burst-if-requested.py --project-path testproject --platform Android
11+
- unity-downloader-cli -u 2021.2 -c editor -c Android -w --fast
1412
- |
1513
set UTR_VERSION=0.12.0
16-
utr.bat --suite=playmode --platform=Android --editor-location=C:\TMP\.Editor --testproject=testproject --player-save-path=build/players --artifacts_path=build/logs --scripting-backend=il2cpp --build-only --testfilter=Unity.Netcode.RuntimeTests --extra-editor-arg=-nographics --timeout=1800 --extra-editor-arg=-batchmode --reruncount=2
14+
utr.bat --artifacts_path=artifacts --timeout=1800 --testproject=testproject --editor-location=.Editor --suite=playmode --platform=android --build-only --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --testfilter=Unity.Netcode.RuntimeTests
1715
artifacts:
18-
players:
19-
paths:
20-
- "build/players/**"
2116
logs:
22-
paths:
23-
- "build/logs/**"
17+
paths:
18+
- '*.log'
19+
- '*.xml'
20+
- artifacts/**/*
21+
- testproject/Logs/**
22+
- testproject/Library/*.log
23+
- testproject/*.log
24+
- testproject/Builds/*.log
25+
- build/test-results/**
26+
- artifacts/**
27+
- build/players/**
28+
variables:
29+
CI: true
30+
ENABLE_BURST_COMPILATION: False
2431

2532
2021.2_Build_iOS_player:
2633
name: 2021.2 Build iOS player
@@ -34,14 +41,20 @@
3441
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
3542
- chmod +x ./utr
3643
- export UTR_VERSION=0.12.0
37-
- ./utr --suite=playmode --platform=iOS --editor-location=.Editor --testproject=testproject --player-save-path=build/players --artifacts_path=build/logs --build-only --testfilter=Unity.Netcode.RuntimeTests
44+
- ./utr --artifacts_path=artifacts --timeout=1800 --testproject=testproject --editor-location=.Editor --suite=playmode --platform=iOS --build-only --player-save-path=build/players --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --testfilter=Unity.Netcode.RuntimeTests
3845
artifacts:
39-
players:
40-
paths:
41-
- "build/players/**"
4246
logs:
43-
paths:
44-
- "build/logs/**"
47+
paths:
48+
- '*.log'
49+
- '*.xml'
50+
- artifacts/**/*
51+
- testproject/Logs/**
52+
- testproject/Library/*.log
53+
- testproject/*.log
54+
- testproject/Builds/*.log
55+
- build/test-results/**
56+
- artifacts/**
57+
- build/players/**
4558

4659

4760
2021.2_Run_iOS_Player_With_Tests:
@@ -61,11 +74,20 @@
6174
- chmod +x ./utr
6275
# Run the test build on the device
6376
- export UTR_VERSION=0.12.0
64-
- ./utr --suite=playmode --platform=iOS --player-load-path=build/players --artifacts_path=build/test-results --testfilter=Unity.Netcode.RuntimeTests
77+
- ./utr -artifacts_path=artifacts --testproject=testproject --editor-location=.Editor --reruncount=2 --suite=playmode --platform=iOS --player-load-path=build/players --testfilter=Unity.Netcode.RuntimeTests
6578
artifacts:
6679
logs:
67-
paths:
68-
- "build/test-results/**"
80+
paths:
81+
- '*.log'
82+
- '*.xml'
83+
- artifacts/**/*
84+
- testproject/Logs/**
85+
- testproject/Library/*.log
86+
- testproject/*.log
87+
- testproject/Builds/*.log
88+
- build/test-results/**
89+
- artifacts/**
90+
- build/players/**
6991

7092
2021.2_Run_Android_Player_With_Tests:
7193
name: 2021.2 Run Android player with tests
@@ -85,9 +107,18 @@
85107
start %ANDROID_SDK_ROOT%\platform-tools\adb.exe connect %BOKKEN_DEVICE_IP%
86108
start %ANDROID_SDK_ROOT%\platform-tools\adb.exe devices
87109
set UTR_VERSION=0.12.0
88-
./utr --suite=playmode --platform=android --player-load-path=build/players --artifacts_path=build/test-results --testfilter=Unity.Netcode.RuntimeTests
110+
./utr --artifacts_path=artifacts --testproject=testproject --editor-location=.Editor --reruncount=2 --suite=playmode --platform=android --player-connection-ip=%BOKKEN_HOST_IP% --player-load-path=build/players --testfilter=Unity.Netcode.RuntimeTests
89111
# Set uploadable artifact paths
90112
artifacts:
91113
logs:
92114
paths:
93-
- "build/test-results/**"
115+
- '*.log'
116+
- '*.xml'
117+
- artifacts/**/*
118+
- testproject/Logs/**
119+
- testproject/Library/*.log
120+
- testproject/*.log
121+
- testproject/Builds/*.log
122+
- build/test-results/**
123+
- artifacts/**
124+
- build/players/**

.yamato/project.metafile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ projects:
2626
packages:
2727
- name: com.unity.netcode.gameobjects
2828
path: com.unity.netcode.gameobjects
29-
- name: com.unity.multiplayer.transport.utp
30-
path: com.unity.multiplayer.transport.utp
29+
- name: com.unity.netcode.adapter.utp
30+
path: com.unity.netcode.adapter.utp
3131
test_editors:
3232
- 2021.1
3333
- 2021.2

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ We follow the [Gitflow Workflow](https://www.atlassian.com/git/tutorials/compari
3030
This repository is broken into multiple components, each one implemented as a Unity Package.
3131
```
3232
.
33-
├── com.unity.multiplayer.mlapi # The core netcode SDK unity package (source + tests)
34-
├── com.unity.multiplayer.transport.utp # Transport wrapper for com.unity.transport experimental package (not currently supported)
35-
└── testproject # A Unity project with various test implementations & scenes which exercise the features in the above package(s).
33+
├── com.unity.multiplayer.mlapi # The core netcode SDK unity package (source + tests)
34+
├── com.unity.netcode.adapter.utp # Transport wrapper for com.unity.transport experimental package (not currently supported)
35+
└── testproject # A Unity project with various test implementations & scenes which exercise the features in the above package(s).
3636
```
3737

3838
### Contributing

0 commit comments

Comments
 (0)