浏览代码

shqy demo开发

#Suyghur 3 年之前
父节点
当前提交
5b55cacc37

+ 18 - 0
demo/src/main/assets/yyxx_game/ext_log.json

@@ -0,0 +1,18 @@
+{
+  "create_play": "apjl7l",
+  "enter_game": "qfd1ul",
+  "level_55": "lejbpf",
+  "level_120": "btff0z",
+  "level_150": "vqv099",
+  "finish_tower_1": "5t568v",
+  "finish_tower_4": "a034b1",
+  "finish_tower_8": "whtlap",
+  "vip4": "j9uu42",
+  "vip6": "uzpoi6",
+  "vip8": "nmry7k",
+  "online_20mins": "jd5uzd",
+  "boss_level90": "uk0i8w",
+  "boss_level135": "7s9qoa",
+  "boss_level180": "6922bf",
+  "finish_marry": "avl1zv"
+}

+ 11 - 0
demo/src/main/assets/yyxx_game/sdk_log.json

@@ -0,0 +1,11 @@
+{
+  "open_app": "rjo5ax",
+  "choose_login_page": "eo8k08",
+  "sign_up": "mzvwmo",
+  "login_success_quick": "3igk4b",
+  "login_success_fb": "dwbri1",
+  "login_success_google": "tk971u",
+  "login_success_account": "wp73dt",
+  "ecommerce_purchase": "qum6x5",
+  "first_purchase": "r1mt2x"
+}

+ 14 - 0
demo/src/main/assets/yyxx_game/yyxx_cfg.properties

@@ -0,0 +1,14 @@
+# 游戏代码
+YYXX_GAME_CODE=100001
+# 应用代码
+YYXX_GCP_CODE=G010101
+# 事件打点应用ID
+YYXX_ADJUST_APP_ID=43gp4f912rgg
+# Google AppId
+YYXX_GOOGLE_APP_ID=740926956270
+# Google Server Client Id
+YYXX_GOOGLE_CLIENT_ID=740926956270-s3urrtiv4h9r4ja1bmngbrmc03d7h8rd.apps.googleusercontent.com
+# Facebook AppId
+YYXX_FACEBOOK_ID=348223516775059
+# debug模式(cp出正式包请关闭)
+YYXX_OWN_DEBUG=true

+ 181 - 0
demo/src/main/java/com/yyxx/eyuangame/demo/CacheInfo.java

@@ -0,0 +1,181 @@
+package com.yyxx.eyuangame.demo;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.text.TextUtils;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * @author #Suyghur.
+ * Created on 2020/12/21
+ */
+public class CacheInfo {
+
+    public static RoleInfo setDemoRoleInfo(Context context, String userId) {
+        RoleInfo roleInfo = new RoleInfo();
+        long ts = System.currentTimeMillis() / 1000;
+        roleInfo.setRoleId("aaa" + ts);
+        roleInfo.setRoleName("角色名123");
+        roleInfo.setRoleLevel("110");
+        roleInfo.setRoleCTime(ts);
+        roleInfo.setServerId("333");
+        roleInfo.setServerName("服务器名333");
+        roleInfo.setVipLevel("1");
+        roleInfo.setBalance("600");
+        roleInfo.setTotalPurchase(0);
+        String info = roleInfo.toJsonString();
+        SharedPreferences sp = context.getSharedPreferences("app_role_info", Context.MODE_PRIVATE);
+        SharedPreferences.Editor editor = sp.edit();
+        editor.putString(userId, info);
+        editor.apply();
+        return roleInfo;
+    }
+
+    public static RoleInfo getDemoRoleInfo(Context context, String userId) {
+        try {
+            SharedPreferences sp = context.getSharedPreferences("app_role_info", Context.MODE_PRIVATE);
+            String info = sp.getString(userId, "");
+            if (TextUtils.isEmpty(info)) {
+                //不存在则创建
+                return setDemoRoleInfo(context, userId);
+            } else {
+                JSONObject jsonObject = new JSONObject(info);
+                RoleInfo roleInfo = new RoleInfo();
+                roleInfo.setRoleId(jsonObject.getString("role_id"));
+                roleInfo.setRoleName(jsonObject.getString("role_name"));
+                roleInfo.setRoleLevel(jsonObject.getString("role_level"));
+                roleInfo.setRoleCTime(jsonObject.getLong("role_ctime"));
+                roleInfo.setServerId(jsonObject.getString("server_id"));
+                roleInfo.setServerName(jsonObject.getString("server_name"));
+                roleInfo.setVipLevel(jsonObject.getString("vip_level"));
+                roleInfo.setBalance(jsonObject.getString("balance"));
+                roleInfo.setTotalPurchase(jsonObject.getInt("total_purchase"));
+                return roleInfo;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static class RoleInfo {
+
+        private String roleId = "";
+        private String roleName = "";
+        private String roleLevel = "";
+        private long roleCTime = 0L;
+        private String serverId = "";
+        private String serverName = "";
+        private String vipLevel = "";
+        private String balance = "";
+        private int totalPurchase = 0;
+
+        public String getRoleId() {
+            return roleId;
+        }
+
+        public void setRoleId(String roleId) {
+            this.roleId = roleId;
+        }
+
+        public String getRoleName() {
+            return roleName;
+        }
+
+        public void setRoleName(String roleName) {
+            this.roleName = roleName;
+        }
+
+        public String getRoleLevel() {
+            return roleLevel;
+        }
+
+        public void setRoleLevel(String roleLevel) {
+            this.roleLevel = roleLevel;
+        }
+
+        public long getRoleCTime() {
+            return roleCTime;
+        }
+
+        public void setRoleCTime(long roleCTime) {
+            this.roleCTime = roleCTime;
+        }
+
+        public String getServerId() {
+            return serverId;
+        }
+
+        public void setServerId(String serverId) {
+            this.serverId = serverId;
+        }
+
+        public String getServerName() {
+            return serverName;
+        }
+
+        public void setServerName(String serverName) {
+            this.serverName = serverName;
+        }
+
+        public String getVipLevel() {
+            return vipLevel;
+        }
+
+        public void setVipLevel(String vipLevel) {
+            this.vipLevel = vipLevel;
+        }
+
+        public String getBalance() {
+            return balance;
+        }
+
+        public void setBalance(String balance) {
+            this.balance = balance;
+        }
+
+        public int getTotalPurchase() {
+            return totalPurchase;
+        }
+
+        public void setTotalPurchase(int totalPurchase) {
+            this.totalPurchase = totalPurchase;
+        }
+
+        public final String toJsonString() {
+            try {
+                JSONObject jsonObject = new JSONObject();
+                jsonObject.put("role_id", this.roleId);
+                jsonObject.put("role_name", this.roleName);
+                jsonObject.put("role_level", this.roleLevel);
+                jsonObject.put("server_id", this.serverId);
+                jsonObject.put("server_name", this.serverName);
+                jsonObject.put("vip_level", this.vipLevel);
+                jsonObject.put("balance", this.balance);
+                jsonObject.put("total_purchase", this.totalPurchase);
+                jsonObject.put("role_ctime", this.roleCTime);
+                return jsonObject.toString();
+            } catch (JSONException var2) {
+                var2.printStackTrace();
+                return "";
+            }
+        }
+
+        @Override
+        public String toString() {
+            return "RoleInfo{" +
+                    "roleId='" + roleId + '\'' +
+                    ", roleName='" + roleName + '\'' +
+                    ", roleLevel='" + roleLevel + '\'' +
+                    ", roleCTime=" + roleCTime +
+                    ", serverCode='" + serverId + '\'' +
+                    ", serverName='" + serverName + '\'' +
+                    ", vipLevel='" + vipLevel + '\'' +
+                    ", balance='" + balance + '\'' +
+                    ", totalPurchase=" + totalPurchase +
+                    '}';
+        }
+    }
+}

+ 5 - 0
demo/src/main/res/values/styles.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <!-- Base application theme. -->
+    <style name="AppTheme" parent="android:Theme.Light.NoTitleBar.Fullscreen" />
+</resources>

+ 10 - 0
library_pad/build.gradle

@@ -0,0 +1,10 @@
+// In the asset pack’s build.gradle file:
+apply plugin: 'com.android.asset-pack'
+
+assetPack {
+    packName = "library_pad" // Directory name for the asset pack
+    dynamicDelivery {
+//        deliveryType = "[ install-time | fast-follow | on-demand ]"
+        deliveryType = "on-demand"
+    }
+}

+ 4 - 0
library_pad/src/main/assets/test_assets.json

@@ -0,0 +1,4 @@
+{
+  "test": "test",
+  "feature": "feature"
+}

二进制
library_pad/src/main/assets/yyxx_float_logo_img.png


二进制
library_pad/src/main/assets/yyxx_float_logo_left_img.png


二进制
library_pad/src/main/assets/yyxx_float_logo_right_img.png


二进制
zkeystore/shqy_yyxx.keystore