Skip to content

Commit fb04060

Browse files
committed
Merge branch 'develop' into pdeschain/isubscriber-unsub
2 parents 8baa607 + c6a20c3 commit fb04060

File tree

2,527 files changed

+33820
-48621
lines changed

Some content is hidden

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

2,527 files changed

+33820
-48621
lines changed

.editorconfig

Lines changed: 1 addition & 76 deletions
Large diffs are not rendered by default.

.gitattributes

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*.skp filter=lfs diff=lfs merge=lfs -text
1919
*.stl filter=lfs diff=lfs merge=lfs -text
2020
*.ztl filter=lfs diff=lfs merge=lfs -text
21-
2221
# Audio
2322
*.aif filter=lfs diff=lfs merge=lfs -text
2423
*.aiff filter=lfs diff=lfs merge=lfs -text
@@ -29,11 +28,9 @@
2928
*.s3m filter=lfs diff=lfs merge=lfs -text
3029
*.wav filter=lfs diff=lfs merge=lfs -text
3130
*.xm filter=lfs diff=lfs merge=lfs -text
32-
3331
# Fonts
3432
*.otf filter=lfs diff=lfs merge=lfs -text
3533
*.ttf filter=lfs diff=lfs merge=lfs -text
36-
3734
# Images
3835
*.bmp filter=lfs diff=lfs merge=lfs -text
3936
*.exr filter=lfs diff=lfs merge=lfs -text
@@ -48,9 +45,9 @@
4845
*.[tT][gG][aA] filter=lfs diff=lfs merge=lfs -text
4946
*.tif filter=lfs diff=lfs merge=lfs -text
5047
*.tiff filter=lfs diff=lfs merge=lfs -text
51-
5248
# Unity
5349
*.unity filter=lfs diff=lfs merge=lfs text
5450
*.prefab binary
5551
*.asset filter=lfs diff=lfs merge=lfs -text
5652
*.anim filter=lfs diff=lfs merge=lfs -text
53+
*.tga filter=lfs diff=lfs merge=lfs -text

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
-->
1313

1414
### Contribution checklist
15+
- [ ] Tests have been added for boss room and/or utilities pack
16+
- [ ] Release notes have been added to the [project changelog](../CHANGELOG.md) file and/or [package changelog](../Packages/com.unity.multiplayer.samples.coop/CHANGELOG.md) file
1517
- [ ] Pull request has a meaningful description of its purpose
1618
- [ ] All commits are accompanied by meaningful commit messages
1719
- [ ] JIRA ticket ID is in the PR title or at least one commit message
1820
- [ ] Include the ticket ID number within the body message of the PR to create a hyperlink
21+

.yamato/_triggers.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{% metadata_file .yamato/project.metafile %}
2+
---
3+
4+
# Run all relevant tasks when a pull request targeting specified
5+
# branches is created or updated.
6+
pull_request_trigger:
7+
name: Pull Request Trigger (main, develop, & release branches)
8+
dependencies:
9+
- .yamato/project-standards.yml#standards_{{ projects.first.name }}
10+
{% for project in projects -%}
11+
{% for platform in test_platforms -%}
12+
# desktop platforms
13+
- .yamato/project-tests.yml#test_{{ project.name }}_{{ project.test_editors.first }}_{{ platform.name }}
14+
{% endfor -%}
15+
# iOS
16+
- .yamato/mobile-build-and-run.yml#mobile_test_ios_{{ project.name }}_{{ project.test_editors.first }}
17+
# Android
18+
- .yamato/mobile-build-and-run.yml#mobile_test_android_{{ project.name }}_{{ project.test_editors.first }}
19+
{% endfor -%}
20+
triggers:
21+
cancel_old_ci: true
22+
pull_requests:
23+
- targets:
24+
only:
25+
- "main"
26+
- "develop"
27+
- "/release\/.*/"

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

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

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

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Modeled after Yamato mobile automation example: https://github.cds.internal.unity3d.com/unity/mobile-yamato-example
2+
3+
{% metadata_file .yamato/project.metafile %}
4+
---
5+
6+
{% for project in projects -%}
7+
{% for editor in project.test_editors -%}
8+
Build_Player_With_Tests_iOS_{{ project.name }}_{{ editor }}:
9+
name: build {{ project.name }} - {{ editor }} on iOS
10+
agent:
11+
type: Unity::VM::osx
12+
image: mobile/macos-10.15-testing:stable
13+
flavor: b1.large
14+
15+
commands:
16+
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
17+
- unity-downloader-cli -c Editor -c iOS -u {{ editor }} --fast --wait
18+
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
19+
- chmod +x ./utr
20+
- ./utr --suite=playmode --platform=iOS --editor-location=.Editor --testproject={{ project.path }} --player-save-path=build/players --artifacts_path=build/logs --build-only --testfilter=Unity.Multiplayer.Samples.BossRoom.Tests.Runtime
21+
22+
artifacts:
23+
players:
24+
paths:
25+
- "build/players/**"
26+
logs:
27+
paths:
28+
- "build/logs/**"
29+
{% endfor -%}
30+
{% endfor -%}
31+
32+
{% for project in projects -%}
33+
{% for editor in project.test_editors -%}
34+
Build_Player_With_Tests_Android_{{ project.name }}_{{ editor }}:
35+
name: build {{ project.name }} - {{ editor }} on Android
36+
agent:
37+
type: Unity::VM
38+
# Any generic image can be used, no need to have Android tools in the image for building
39+
# All Android tools will be downloaded by unity-downloader-cli
40+
image: desktop/android-execution-r19:v0.1.1-860408
41+
flavor: b1.xlarge
42+
43+
commands:
44+
# Download unity-downloader-cli
45+
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
46+
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools/utr-standalone/utr.bat --output utr.bat
47+
- python .yamato/disable-burst-if-requested.py --project-path {{ project.path }} --platform Android
48+
- unity-downloader-cli -c Editor -c Android -u {{ editor }} --fast --wait
49+
# Build player(s)
50+
- set UTR_VERSION=0.12.0
51+
- ./utr.bat --suite=playmode --platform=Android --editor-location=.Editor --testproject={{ project.path }} --player-save-path=build/players --artifacts_path=build/logs --scripting-backend=mono --build-only --testfilter=Unity.Multiplayer.Samples.BossRoom.Tests.Runtime
52+
artifacts:
53+
players:
54+
paths:
55+
- "build/players/**"
56+
logs:
57+
paths:
58+
- "build/logs/**"
59+
variables:
60+
CI: true
61+
ENABLE_BURST_COMPILATION: False
62+
{% endfor -%}
63+
{% endfor -%}
64+
65+
# For every editor version, run iOS project tests without
66+
# running package tests too since they are handled on their respective jobs
67+
{% for project in projects -%}
68+
{% for editor in project.test_editors -%}
69+
mobile_test_ios_{{ project.name }}_{{ editor }}:
70+
name: {{ project.name }} mobile project tests - {{ editor }} on iOS
71+
agent:
72+
type: Unity::mobile::iPhone
73+
image: mobile/macos-10.15-testing:latest
74+
flavor: b1.medium
75+
76+
# Skip repository cloning
77+
skip_checkout: true
78+
79+
# Set a dependency on the build job
80+
dependencies:
81+
- .yamato/mobile-build-and-run.yml#Build_Player_With_Tests_iOS_{{ project.name }}_{{ editor }}
82+
83+
commands:
84+
# Download standalone UnityTestRunner
85+
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr --output utr
86+
# Give UTR execution permissions
87+
- chmod +x ./utr
88+
# Run the test build on the device
89+
- ./utr --suite=playmode --platform=iOS --player-load-path=build/players --artifacts_path=build/test-results --testfilter=Unity.Multiplayer.Samples.BossRoom.Tests.Runtime
90+
91+
artifacts:
92+
logs:
93+
paths:
94+
- "build/test-results/**"
95+
{% endfor -%}
96+
{% endfor -%}
97+
98+
# For every editor version, run Android project tests without
99+
# running package tests too since they are handled on their respective jobs
100+
{% for project in projects -%}
101+
{% for editor in project.test_editors -%}
102+
mobile_test_android_{{ project.name }}_{{ editor }}:
103+
name: {{ project.name }} mobile project tests - {{ editor }} on Android
104+
agent:
105+
type: Unity::mobile::shield
106+
image: mobile/android-execution-r19:stable
107+
flavor: b1.medium
108+
109+
# Skip repository cloning
110+
skip_checkout: true
111+
# Set a dependency on the build job
112+
dependencies:
113+
- .yamato/mobile-build-and-run.yml#Build_Player_With_Tests_Android_{{ project.name }}_{{ editor }}
114+
commands:
115+
# Download standalone UnityTestRunner
116+
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools/utr-standalone/utr.bat --output utr.bat
117+
- |
118+
set ANDROID_DEVICE_CONNECTION=%BOKKEN_DEVICE_IP%
119+
start %ANDROID_SDK_ROOT%\platform-tools\adb.exe connect %BOKKEN_DEVICE_IP%
120+
start %ANDROID_SDK_ROOT%\platform-tools\adb.exe devices
121+
set UTR_VERSION=0.12.0
122+
./utr --artifacts_path=build/test-results --testproject={{ project.path }} --editor-location=.Editor --reruncount=2 --suite=playmode --platform=android --player-connection-ip=%BOKKEN_HOST_IP% --player-load-path=build/players --testfilter=Unity.Multiplayer.Samples.BossRoom.Tests.Runtime
123+
# Set uploadable artifact paths
124+
artifacts:
125+
logs:
126+
paths:
127+
- "build/test-results/**"
128+
{% endfor -%}
129+
{% endfor -%}

.yamato/project-pack.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{% metadata_file .yamato/project.metafile %}
2+
---
3+
{% for project in projects -%}
4+
pack_{{ project.name }}:
5+
name: Pack {{ project.name }}
6+
agent:
7+
type: Unity::VM
8+
image: package-ci/ubuntu:stable
9+
flavor: b1.small
10+
commands:
11+
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
12+
- upm-ci project pack --project-path {{ project.path }}
13+
artifacts:
14+
packages:
15+
paths:
16+
- "upm-ci~/packages/**/*"
17+
{% endfor -%}

.yamato/project-tests.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{% metadata_file .yamato/project.metafile %}
2+
---
3+
4+
# For every platform and editor version, run its project tests without
5+
# running package tests too since they are handled on their respective
6+
# jobs
7+
{% for project in projects -%}
8+
{% for editor in project.test_editors -%}
9+
{% for platform in test_platforms -%}
10+
test_{{ project.name }}_{{ editor }}_{{ platform.name }}:
11+
name : {{ project.name }} project tests - {{ editor }} on {{ platform.name }}
12+
agent:
13+
type: {{ platform.type }}
14+
image: {{ platform.image }}
15+
flavor: {{ platform.flavor}}
16+
commands:
17+
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
18+
- pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
19+
- unity-downloader-cli -u {{ editor }} -c editor -w --fast
20+
- upm-ci project test -u {{ editor }} --project-path {{ project.path }} --type project-tests --extra-utr-arg=--testfilter=Unity.Multiplayer.Samples.BossRoom.Tests.Runtime
21+
artifacts:
22+
logs:
23+
paths:
24+
- "upm-ci~/test-results/**/*"
25+
dependencies:
26+
- .yamato/project-pack.yml#pack_{{ project.name }}
27+
{% endfor -%}
28+
{% endfor -%}
29+
{% endfor -%}

.yamato/project.metafile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,4 @@ projects:
3333
- name: com.unity.multiplayer.samples.coop
3434
path: Packages/com.unity.multiplayer.samples.coop
3535
test_editors:
36-
- 2021.1
37-
- 2021.2
38-
- 2020.3
39-
- trunk
36+
- 2021.3

ARCHITECTURE.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The Boss Room network connection flow is owned by the `GameNetPortal`:
3232
Game data in Boss Room is defined in `ScriptableObjects`. The `ScriptableObjects` are organized by enum and made available in a singleton class: the `GameDataSource`, in particular `ActionDescription` and `CharacterData`. `Actions` represent discrete verbs (like swinging a weapon, or reviving someone), and are substantially data driven. Characters represent both the different player classes, and also monsters, and represent basic details like health, as well as what "Skill" Actions are available to each Character.
3333

3434
## Transports
35-
Currently three network transport mechanisms are supported:
35+
Currently two network transport mechanisms are supported:
3636
- IP based
3737
- Unity Relay Based
3838

@@ -42,10 +42,8 @@ For Unity Relay based multiplayer sessions, some setup is required. Please see o
4242

4343
Please see [Multiplayer over internet](README.md) section of our Readme for more information on using either one.
4444

45-
To allow for any of these options to be chosen at runtime we created `TransportPicker`. It allows one to choose between an IP-based and a Relay-based transport and will hook up the game UI to use those transports. The transport field in the `NetworkManager` will be ignored. Currently we support the following transports:
46-
- **UNET(IP):** UNET is the default Netcode transport. However, it is not the default IP transport for Boss Room.
47-
- **UTP (IP):** Unity Transport Package is a network transport layer, packaged with network simulation tools which are useful for spotting networking issues early during development. This IP based protocol is the default IP transport for Boss Room. See the documentation on [Unity Transport Package](https://docs-multiplayer.unity3d.com/docs/transport-utp/about-transport-utp/#unity-transport-package-utp).
48-
- **Unity (Relay):** Unity Relay is a relay service provided by Unity services, supported by Unity Transport. Read more about [Unity Relay](https://docs-multiplayer.unity3d.com/docs/relay/relay).
45+
The transport is set in the transport field in the `NetworkManager`. We are using the following transport:
46+
- **Unity Transport Package (UTP):** Unity Transport Package is a network transport layer, packaged with network simulation tools which are useful for spotting networking issues early during development. This protocol is initialized to use direct IP to connect, but is configured at runtime to use Unity Relay if starting a game as a host using the Lobby Service, or joining a Lobby as a client. Unity Relay is a relay service provided by Unity services, supported by Unity Transport. See the documentation on [Unity Transport Package](https://docs-multiplayer.unity3d.com/docs/transport-utp/about-transport-utp/#unity-transport-package-utp) and on [Unity Relay](https://docs-multiplayer.unity3d.com/docs/relay/relay).
4947

5048
To add new transports in the project, parts of `GameNetPortal` and `ClientGameNetPortal` (transport switches) need to be extended.
5149

Assets/BossRoom.meta renamed to Assets/Animations.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/BossRoom/Scripts/Shared/Game/UI.meta renamed to Assets/Animations/UI.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)