Skip to content

Commit

Permalink
Merge pull request #163 from finol-digital/develop
Browse files Browse the repository at this point in the history
v1.122
  • Loading branch information
davidmfinol authored Nov 4, 2024
2 parents 4cc9375 + 52d3b9b commit f2b69c8
Show file tree
Hide file tree
Showing 135 changed files with 59,365 additions and 11,496 deletions.
57 changes: 20 additions & 37 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
lint:
name: Quality Check
runs-on: ubuntu-latest
container: unityci/editor:ubuntu-2022.3.8f1-linux-il2cpp-2
container: unityci/editor:ubuntu-6000.0.23f1-linux-il2cpp-3
steps:
- name: Checkout Repository
uses: actions/checkout@v1
Expand All @@ -109,7 +109,12 @@ jobs:
run: unity-editor -nographics -logFile /dev/stdout -customBuildName Card-Game-Simulator -projectPath . -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -quit
- name: Return License
if: always()
run: unity-editor -logFile /dev/stdout -quit -returnlicense
continue-on-error: true
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL_PERSONAL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD_PERSONAL }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL_PERSONAL }}
run: unity-editor -quit -batchmode -returnlicense -username "$UNITY_EMAIL" -password "$UNITY_PASSWORD" -serial "$UNITY_SERIAL"
- name: SonarQube Analysis
env:
FrameworkPathOverride: /opt/unity/Editor/Data/MonoBleedingEdge/
Expand Down Expand Up @@ -446,39 +451,16 @@ jobs:
with:
name: cgs-WebGL
path: Card-Game-Simulator/build/WebGL
- name: Checkout Firebase project
uses: actions/checkout@v4
with:
repository: finol-digital/cgs-games
token: ${{ secrets.CGS_PAT }}
path: cgs-games
- name: Copy the WebGL build artifacts to the Firebase public directory
- name: Copy the WebGL Build files to the Firebase public directory
env:
UNITY_BUILD_WEBGL_PATH: ${{ format('{0}/Card-Game-Simulator/build/WebGL', github.workspace) }}
FIREBASE_PUBLIC_BUILD_PATH: ${{ format('{0}/cgs-games/public/Unity', github.workspace) }}
run: find $UNITY_BUILD_WEBGL_PATH -type f -name "**WebGL.*" -exec cp {} $FIREBASE_PUBLIC_BUILD_PATH \;
- name: Update Release Notes
if: github.event.action == 'published'
env:
RELEASE_NOTES: ${{ github.event.release.body }}
run: echo "$RELEASE_NOTES" > Card-Game-Simulator/fastlane/metadata/en-US/release_notes.txt
- name: Raise PR to CGS games
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.CGS_PAT }}
path: cgs-games
branch: ${{ needs.buildWithLinux.outputs.buildVersion }}
title: ${{ needs.buildWithLinux.outputs.buildVersion }}
body-path: Card-Game-Simulator/fastlane/metadata/en-US/release_notes.txt
- name: Copy the WebGL build artifacts to the Firebase public directory
env:
UNITY_BUILD_WEBGL_PATH: ${{ format('{0}/Card-Game-Simulator/build/WebGL', github.workspace) }}
FIREBASE_PUBLIC_BUILD_PATH: ${{ format('{0}/Card-Game-Simulator/firebase/public/Unity', github.workspace) }}
run: find $UNITY_BUILD_WEBGL_PATH -type f -name "**WebGL.*" -exec cp {} $FIREBASE_PUBLIC_BUILD_PATH \;
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CARD_GAME_SIMULATOR }}'
UNITY_WEBGL_BUILD_PATH: ${{ format('{0}/Card-Game-Simulator/build/WebGL/Build', github.workspace) }}
FIREBASE_PUBLIC_BUILD_PATH: ${{ format('{0}/Card-Game-Simulator/firebase/public/Build', github.workspace) }}
run: cp -r "$UNITY_WEBGL_BUILD_PATH/." "$FIREBASE_PUBLIC_BUILD_PATH"
- name: Firebase Deploy
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CARD_GAME_SIMULATOR }}
channelId: live
projectId: card-game-simulator
entryPoint: ${{ format('{0}/Card-Game-Simulator/firebase', github.workspace) }}
Expand Down Expand Up @@ -817,6 +799,7 @@ jobs:
shell: pwsh
run: msstore reconfigure --tenantId ${{ secrets.MICROSOFT_TENANT_ID }} --sellerId ${{ secrets.MICROSOFT_SELLER_ID }} --clientId ${{ secrets.MICROSOFT_CLIENT_ID }} --clientSecret ${{ secrets.MICROSOFT_KEY }}
- name: Build the .appxupload with Microsoft Store Developer CLI
if: false
working-directory: C:/Card-Game-Simulator.git
shell: pwsh
run: |
Expand All @@ -829,23 +812,23 @@ jobs:
dir "C:\Card-Game-Simulator.git\build\WSAPlayer\WSAPlayer"
dir "C:\Card-Game-Simulator.git\build\WSAPlayer\WSAPlayer\Card Game Simulator"
- name: Build the .appxupload
if: false
# if: false
working-directory: C:/Card-Game-Simulator.git
shell: pwsh
env:
SolutionPath: build\WSAPlayer\WSAPlayer\Card Game Simulator.sln
SigningCertificate: Card Game Simulator_StoreKey.pfx
run: msbuild $env:SolutionPath /p:Configuration="Master" /p:Platform="x64" /p:UapAppxPackageBuildMode="StoreUpload" /p:AppxBundle="Always" /p:AppxBundlePlatforms="x86|x64|arm|arm64" /p:PackageCertificateKeyFile=$env:SigningCertificate
- name: Remove the .pfx
if: false
# if: false
working-directory: C:/Card-Game-Simulator.git
shell: pwsh
env:
UwpProjectDirectory: build\WSAPlayer\WSAPlayer\Card Game Simulator
SigningCertificate: Card Game Simulator_StoreKey.pfx
run: Remove-Item -path $env:UwpProjectDirectory\$env:SigningCertificate
- name: Copy .appxupload
if: false
# if: false
working-directory: C:/Card-Game-Simulator.git
shell: pwsh
env:
Expand Down
5 changes: 0 additions & 5 deletions Assets/Plugins/WebGL/React.jslib

This file was deleted.

32 changes: 0 additions & 32 deletions Assets/Plugins/WebGL/React.jslib.meta

This file was deleted.

10 changes: 0 additions & 10 deletions Assets/Prefabs/CardGameView/Viewer/Playable Viewer.prefab

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions Assets/Prefabs/Menus/Deck Load Menu.prefab

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions Assets/Scenes/MainMenu.unity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 14 additions & 28 deletions Assets/Scripts/Cgs/CardGameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityExtensionMethods;
#if UNITY_WEBGL && !UNITY_EDITOR
using System.Runtime.InteropServices;
#endif

#if UNITY_ANDROID && !UNITY_EDITOR
using UnityEngine.Networking;
#endif
Expand All @@ -31,10 +27,6 @@ namespace Cgs
{
public class CardGameManager : MonoBehaviour
{
#if UNITY_WEBGL && !UNITY_EDITOR
[DllImport("__Internal")]
private static extern void GameReady();
#endif
// Show all Debug.Log() to help with debugging?
private const bool IsMessengerDebugLogVerbose = false;
public const string PlayerPrefsDefaultGame = "DefaultGame";
Expand Down Expand Up @@ -192,10 +184,8 @@ private void Awake()

ResetCurrentToDefault();

#if !UNITY_WEBGL
Debug.Log("CardGameManager::Awake:CheckDeepLinks");
CheckDeepLinks();
#endif
}

// ReSharper disable once MemberCanBeMadeStatic.Local
Expand All @@ -217,7 +207,6 @@ internal void LookupCardGames()
#else
CreateDefaultCardGames();
#endif

foreach (var gameDirectory in Directory.GetDirectories(UnityCardGame.GamesDirectoryPath))
{
var gameDirectoryName = gameDirectory[(UnityCardGame.GamesDirectoryPath.Length + 1)..];
Expand All @@ -238,6 +227,7 @@ internal void LookupCardGames()
{
var newCardGame = new UnityCardGame(this, gameDirectoryName);
newCardGame.ReadProperties();
Debug.LogWarning(newCardGame.ToString());
if (!string.IsNullOrEmpty(newCardGame.Error))
Debug.LogError(LoadErrorMessage + newCardGame.Error);
else
Expand Down Expand Up @@ -356,7 +346,6 @@ internal void ResetCurrentToDefault()
: (AllCardGames.FirstOrDefault().Value ?? UnityCardGame.UnityInvalid);
}

#if !UNITY_WEBGL
private void CheckDeepLinks()
{
Application.deepLinkActivated += OnDeepLinkActivated;
Expand Down Expand Up @@ -384,10 +373,7 @@ private void OnDeepLinkActivated(string deepLink)
var autoUpdateUrl = GetAutoUpdateUrl(deepLink);
if (string.IsNullOrEmpty(autoUpdateUrl) ||
!Uri.IsWellFormedUriString(autoUpdateUrl, UriKind.RelativeOrAbsolute))
{
Debug.LogError("OnDeepLinkActivated::autoUpdateUrlMissingOrMalformed: " + deepLink);
Messenger.Show("OnDeepLinkActivated::autoUpdateUrlMissingOrMalformed: " + deepLink);
}
Debug.LogWarning("OnDeepLinkActivated::autoUpdateUrlMissingOrMalformed: " + deepLink);
else
StartGetCardGame(autoUpdateUrl);
}
Expand All @@ -408,7 +394,6 @@ private static string GetAutoUpdateUrl(string deepLink)

return autoUpdateUrl;
}
#endif

#if UNITY_WEBGL && !UNITY_EDITOR
private IEnumerator Start()
Expand All @@ -419,15 +404,21 @@ private IEnumerator Start()
while (Current is {IsDownloading: true})
yield return null;

bool callGameReady =
Current == null || Current == UnityCardGame.UnityInvalid || !string.IsNullOrEmpty(Current.Error)
|| Current.Id.Equals(Tags.StandardPlayingCardsDirectoryName);
Debug.Log("CardGameManager::Start:callGameReady " + callGameReady);
if (callGameReady)
GameReady();
bool isMissingGame =
Current == null || Current == UnityCardGame.UnityInvalid || !string.IsNullOrEmpty(Current.Error) || !Current.HasLoaded;
if (isMissingGame)
yield return StartGetDefaultCardGames();
}
#endif

// ReSharper disable once UnusedMember.Local
private IEnumerator StartGetDefaultCardGames()
{
yield return GetCardGame(Tags.DominoesUrl);
yield return GetCardGame(Tags.MahjongUrl);
yield return GetCardGame(Tags.StandardPlayingCardsUrl);
}

[PublicAPI]
public void StartGetCardGame(string autoUpdateUrl)
{
Expand Down Expand Up @@ -615,11 +606,6 @@ internal void ResetGameScene()
return;
}

#if UNITY_WEBGL
foreach (var game in AllCardGames.Values)
game.ReadProperties();
#endif

// Now is the safest time to set this game as the preferred default game for the player
PlayerPrefs.SetString(PlayerPrefsDefaultGame, Current.Id);

Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Cgs/CardGameView/Multiplayer/CardModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class CardModel : CgsNetPlayable, ICardDisplay, ICardDropHandler, IStackD
public const string DropErrorMessage = "Error: Card dropped on Card outside of play area!";
public string DiscardPrompt => $"Delete cannot be undone. Delete {gameObject.name}?";

private const float ZoomHoldTime = 1.5f;
private const float ZoomHoldTime = 0.5f;
private const float MovementSpeed = 600f;

public int Index { get; set; }
Expand Down
Loading

0 comments on commit f2b69c8

Please sign in to comment.