Skip to content
Open

Dev #14

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3dd2dba
Added coroutine to button controller that periodically gets room status
antoniomsgneto Jan 19, 2022
7d9976a
Added coroutine to button controller that periodically gets room status
antoniomsgneto Jan 20, 2022
77d59b7
Added OnPeriodicUpdate abstract class
antoniomsgneto Jan 21, 2022
397ded3
Used Actions instead of abstract class and function
antoniomsgneto Jan 21, 2022
b914d8b
Periodic Update coroutine is now on a separate use case and is called…
antoniomsgneto Jan 26, 2022
dad52be
Removed unused var
antoniomsgneto Jan 26, 2022
95787e3
Merge branch 'dev' into feature/eskl-171
antoniomsgneto Jan 26, 2022
8ebe653
Merge pull request #2 from Catappult/feature/eskl-171
Trinkes Jan 26, 2022
7b14552
Allow eskills to start a match through editor
Trinkes Apr 9, 2023
8f650ac
merge origin/dev into trinkes/master
Trinkes Apr 10, 2023
d50292d
Add a warning to the user when a LIVE environment is set in the match…
Trinkes Apr 10, 2023
8279736
bumped editor version
TiagoAVieira Jul 11, 2023
280d9df
added endgame flow call
TiagoAVieira Jul 11, 2023
584d8f9
compiler parameters
TiagoAVieira Jul 12, 2023
618c901
endgame activity
TiagoAVieira Jul 12, 2023
e30cbf5
fixed issue launching endgame
TiagoAVieira Jul 13, 2023
b76b8c0
working endgame flow launch
TiagoAVieira Jul 19, 2023
e1011f9
altered for dev environment for testing, on completed receiver
TiagoAVieira Jul 20, 2023
f5c7510
reverted back to prod and bumped version
TiagoAVieira Jul 20, 2023
5969a12
changed back changes for debugging
TiagoAVieira Jul 20, 2023
7a254cf
removed unnecessary changes
TiagoAVieira Jul 21, 2023
ee5223b
added new package
TiagoAVieira Jul 21, 2023
eb14e1d
Merge pull request #11 from Catappult/feature/ESKL-332-end-game-flow-…
antoniomsgneto Jul 24, 2023
192f7f3
Merge dev into start-match-editor
Trinkes Aug 7, 2023
d810bc2
Update unitypackage file
Trinkes Aug 7, 2023
0c81940
Merge pull request #12 from Trinkes/start-match-editor
antoniomsgneto Sep 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"files.exclude":
{
"**/.DS_Store":true,
"**/.git":true,
"**/.gitignore":true,
"**/.gitmodules":true,
"**/*.booproj":true,
"**/*.pidb":true,
"**/*.suo":true,
"**/*.user":true,
"**/*.userprefs":true,
"**/*.unityproj":true,
"**/*.dll":true,
"**/*.exe":true,
"**/*.pdf":true,
"**/*.mid":true,
"**/*.midi":true,
"**/*.wav":true,
"**/*.gif":true,
"**/*.ico":true,
"**/*.jpg":true,
"**/*.jpeg":true,
"**/*.png":true,
"**/*.psd":true,
"**/*.tga":true,
"**/*.tif":true,
"**/*.tiff":true,
"**/*.3ds":true,
"**/*.3DS":true,
"**/*.fbx":true,
"**/*.FBX":true,
"**/*.lxo":true,
"**/*.LXO":true,
"**/*.ma":true,
"**/*.MA":true,
"**/*.obj":true,
"**/*.OBJ":true,
"**/*.asset":true,
"**/*.cubemap":true,
"**/*.flare":true,
"**/*.mat":true,
"**/*.meta":true,
"**/*.prefab":true,
"**/*.unity":true,
"build/":true,
"Build/":true,
"Library/":true,
"library/":true,
"obj/":true,
"Obj/":true,
"ProjectSettings/":true,
"temp/":true,
"Temp/":true
}
}
1 change: 1 addition & 0 deletions Assets/Plugins/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<activity android:name="com.appcoins.eskills_purchase.PurchaseActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity android:name="com.appcoins.eskills_endgame.EndgameActivity" android:theme="@style/Theme.AppCompat" />
</application>
</manifest>
5 changes: 5 additions & 0 deletions Assets/Plugins/Android/gradleTemplate.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M
org.gradle.parallel=true
unityStreamingAssets=**STREAMING_ASSETS**
android.useAndroidX=true
**ADDITIONAL_PROPERTIES**
7 changes: 7 additions & 0 deletions Assets/Plugins/Android/gradleTemplate.properties.meta

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

44 changes: 44 additions & 0 deletions Assets/Plugins/Android/mainTemplate.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apply plugin: 'com.android.library'
**APPLY_PLUGINS**

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.0'
**DEPS**}

android {
ndkPath "**NDKPATH**"

compileSdkVersion **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

defaultConfig {
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
ndk {
abiFilters **ABIFILTERS**
}
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
}

lintOptions {
abortOnError false
}

aaptOptions {
noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
}**PACKAGING_OPTIONS**


}
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**
7 changes: 7 additions & 0 deletions Assets/Plugins/Android/mainTemplate.gradle.meta

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

1 change: 1 addition & 0 deletions Assets/Plugins/Eskills/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<activity android:name="com.appcoins.eskills_purchase.PurchaseActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity android:name="com.appcoins.eskills_endgame.EndgameActivity" android:theme="@style/Theme.AppCompat" />
</application>
</manifest>
102 changes: 102 additions & 0 deletions Assets/Plugins/Eskills/Android/EndgameActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package com.appcoins.eskills_endgame

import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Bundle
import android.util.Log
import androidx.activity.result.ActivityResult
import androidx.activity.result.ActivityResultLauncher
import android.app.Activity
import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult
import androidx.appcompat.app.AppCompatActivity
import com.unity3d.player.UnityPlayer

class EndgameActivity : AppCompatActivity() {
// activity result launcher
private lateinit var mLauncher: ActivityResultLauncher<Intent>
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val session = intent.getStringExtra(SESSION_KEY)
createLauncher()
launchEskillsEndgameFlow(session)
}

private fun createLauncher() {
mLauncher = registerForActivityResult(StartActivityForResult()) { result: ActivityResult ->
UnityPlayer.UnitySendMessage(
"Eskills",
"OnMatchCompleted",
result.resultCode.toString()
)
finish()
}
}

private fun launchEskillsEndgameFlow(session: String?) {
Log.d(TAG, "endgame session token : $session")
val url = ("https://apichain.catappult.io"
+ "/transaction/eskills/endgame?"
+ "session="
+ session
+ "&domain="
+ applicationContext.packageName)
val intent = buildTargetIntent(url)
try {
mLauncher.launch(intent)
} catch (e: Exception) {
e.printStackTrace()
}
}

/**
* This method generates the intent with the provided One Step URL to target the
* AppCoins Wallet.
*
* @param url The url that generated by following the One Step payment rules
*
* @return The intent used to call the wallet
*/
private fun buildTargetIntent(url: String): Intent {
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
// Check if there is an application that can process the AppCoins Billing
// flow
val packageManager = applicationContext.packageManager
val appsList = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY)
for (app in appsList) {
if (app.activityInfo.packageName == "cm.aptoide.pt") {
// If there's aptoide installed always choose Aptoide as default to open url
intent.setPackage(app.activityInfo.packageName)
break
} else if (app.activityInfo.packageName == "com.appcoins.wallet") {
// If Aptoide is not installed and wallet is installed then choose Wallet
// as default to open url
intent.setPackage(app.activityInfo.packageName)
}
}
return intent
}

companion object {
//result codes for endgame activity
private const val RESULT_OK = 0
private const val RESULT_RESTART = 1
private const val RESULT_SERVICE_UNAVAILABLE = 2
private const val RESULT_ERROR = 3
private const val RESULT_INVALID_URL = 4
//keys
private const val SESSION_KEY = "SESSION"

private val TAG = EndgameActivity::class.java.simpleName

public @JvmStatic
fun start(context: Activity, session: String){
Log.d(TAG, "start: $context")
val intent = Intent(context, EndgameActivity::class.java)
intent.putExtra(SESSION_KEY, session)
context.startActivity(intent)
}
}
}
32 changes: 32 additions & 0 deletions Assets/Plugins/Eskills/Android/EndgameActivity.kt.meta

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

Loading