yingchigamesdk-cocos-v3 25.7.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/resources/Privacy/PrivacyPolicy.txt.meta +11 -0
- package/assets/resources/Privacy/ad.png +0 -0
- package/assets/resources/Privacy/ad.png.meta +162 -0
- package/assets/resources/Privacy/bg.prefab +3184 -0
- package/assets/resources/Privacy/bg.prefab.meta +13 -0
- package/assets/resources/Privacy/close.png +0 -0
- package/assets/resources/Privacy/close.png.meta +162 -0
- package/assets/resources/Privacy/panelBg.png +0 -0
- package/assets/resources/Privacy/panelBg.png.meta +134 -0
- package/assets/resources/Privacy/panelBtn.png.meta +134 -0
- package/assets/resources/Privacy/policyUI.prefab +1450 -0
- package/assets/resources/Privacy/policyUI.prefab.meta +13 -0
- package/assets/resources/Privacy/rectbg.png.meta +134 -0
- package/assets/resources/Privacy/yinsiUI.prefab +2120 -0
- package/assets/resources/Privacy/yinsiUI.prefab.meta +13 -0
- package/dist/Demo.d.ts +11 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +2673 -0
- package/dist/index.js.map +7 -0
- package/dist/ycsdk/AdState.d.ts +9 -0
- package/dist/ycsdk/AdTactics.d.ts +36 -0
- package/dist/ycsdk/AdType.d.ts +7 -0
- package/dist/ycsdk/GameInterface.d.ts +52 -0
- package/dist/ycsdk/SDKConfig.d.ts +28 -0
- package/dist/ycsdk/StorageUtils.d.ts +6 -0
- package/dist/ycsdk/YCSDK.d.ts +43 -0
- package/dist/ycsdk/minigame/BannerType.d.ts +6 -0
- package/dist/ycsdk/minigame/DebugGame.d.ts +16 -0
- package/dist/ycsdk/minigame/HttpRequest.d.ts +15 -0
- package/dist/ycsdk/minigame/InterstitialType.d.ts +5 -0
- package/dist/ycsdk/minigame/MiniGame.d.ts +19 -0
- package/dist/ycsdk/minigame/PayParams.d.ts +19 -0
- package/dist/ycsdk/minigame/PrivacyEvent.d.ts +8 -0
- package/dist/ycsdk/minigame/PrivacyListener.d.ts +6 -0
- package/dist/ycsdk/minigame/douyin/DouYinGame.d.ts +18 -0
- package/dist/ycsdk/minigame/huawei/HuaWeiGame.d.ts +27 -0
- package/dist/ycsdk/minigame/kuaishou/KuaiShouGame.d.ts +15 -0
- package/dist/ycsdk/minigame/md5.d.ts +70 -0
- package/dist/ycsdk/minigame/oppo/OppoGame.d.ts +29 -0
- package/dist/ycsdk/minigame/vivo/VivoGame.d.ts +27 -0
- package/dist/ycsdk/minigame/wechat/WeChatGame.d.ts +17 -0
- package/dist/ycsdk/minigame/xiaomi/XiaoMiGame.d.ts +30 -0
- package/package.json +31 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Node } from "cc";
|
|
2
|
+
import { AdState } from "./AdState";
|
|
3
|
+
import { AdType } from "./AdType";
|
|
4
|
+
import { BannerType } from "./minigame/BannerType.js";
|
|
5
|
+
import { InterstitialType } from "./minigame/InterstitialType";
|
|
6
|
+
import { PayParams } from "./minigame/PayParams";
|
|
7
|
+
import { PrivacyListener } from "./minigame/PrivacyListener";
|
|
8
|
+
import { Config } from "./SDKConfig";
|
|
9
|
+
export declare class YCSDK {
|
|
10
|
+
private static instance;
|
|
11
|
+
private platform;
|
|
12
|
+
private states;
|
|
13
|
+
private suportPlatfrom;
|
|
14
|
+
private privacyKey;
|
|
15
|
+
private gameNode;
|
|
16
|
+
private constructor();
|
|
17
|
+
static get ins(): YCSDK;
|
|
18
|
+
private createPlatform;
|
|
19
|
+
isSupportMiniGame(platform: any): boolean;
|
|
20
|
+
isRun(platform: any): boolean;
|
|
21
|
+
init(config: Config, callBack?: Function): void;
|
|
22
|
+
agreePrivacy(): boolean;
|
|
23
|
+
showPolicy(node: Node, callBack: PrivacyListener): void;
|
|
24
|
+
login(callBack?: Function): void;
|
|
25
|
+
pay(params: PayParams, callBack: Function): void;
|
|
26
|
+
showBanner(position?: BannerType): void;
|
|
27
|
+
hideBanner(): void;
|
|
28
|
+
random(max: number): number;
|
|
29
|
+
showInters(type?: InterstitialType): void;
|
|
30
|
+
hideInters(type?: InterstitialType): void;
|
|
31
|
+
showVideo(callback: Function): boolean;
|
|
32
|
+
customFunc(methodName: string, params: any[], callBack: Function): void;
|
|
33
|
+
setAdStateListener(state: AdState): void;
|
|
34
|
+
vertical(): boolean;
|
|
35
|
+
setGameNode(node: Node): void;
|
|
36
|
+
getGameNode(): Node;
|
|
37
|
+
onLoad(type: AdType): void;
|
|
38
|
+
onError(type: AdType, callback?: Function): void;
|
|
39
|
+
onShow(type: AdType): void;
|
|
40
|
+
onClick(type: AdType): void;
|
|
41
|
+
onClose(type: AdType): void;
|
|
42
|
+
onReward(): void;
|
|
43
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GameInterface } from "../GameInterface";
|
|
2
|
+
import { BannerType } from "./BannerType";
|
|
3
|
+
import { InterstitialType } from "./InterstitialType";
|
|
4
|
+
import { PrivacyListener } from "./PrivacyListener";
|
|
5
|
+
export declare class DebugGame implements GameInterface {
|
|
6
|
+
init(callBack?: any): void;
|
|
7
|
+
showPolicy(node: string, callBack: PrivacyListener): void;
|
|
8
|
+
login(callBack?: Function): void;
|
|
9
|
+
pay(params: string, callBack: Function): void;
|
|
10
|
+
showBanner(position: BannerType): void;
|
|
11
|
+
hideBanner(): void;
|
|
12
|
+
showInters(type: InterstitialType): void;
|
|
13
|
+
hideInters(type: InterstitialType): void;
|
|
14
|
+
showVideo(callBack: Function): boolean;
|
|
15
|
+
customFunc(methodName: string, params: any[], callBack: Function): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum ContentType {
|
|
2
|
+
APPLICATION_JSON = "application/json",
|
|
3
|
+
APPLICATION_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded"
|
|
4
|
+
}
|
|
5
|
+
export default class HttpRequest {
|
|
6
|
+
private static instance;
|
|
7
|
+
private httpRequest;
|
|
8
|
+
static AUTHORIZATION: string;
|
|
9
|
+
static CONTENT_TYPE: string;
|
|
10
|
+
static Accept: string;
|
|
11
|
+
static get(): HttpRequest;
|
|
12
|
+
requestPostx3w(url: any, data: any, callback: any, head?: any): void;
|
|
13
|
+
requestGetx3w(url: any, data: any, callback: any, head?: any): void;
|
|
14
|
+
requestPostjson(url: any, data: any, callback: any, head?: any): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GameInterface } from "../GameInterface";
|
|
2
|
+
import { BannerType } from "./BannerType";
|
|
3
|
+
import { InterstitialType } from "./InterstitialType";
|
|
4
|
+
export declare class MiniGame implements GameInterface {
|
|
5
|
+
private channel;
|
|
6
|
+
constructor(platform: any);
|
|
7
|
+
private channelFactory;
|
|
8
|
+
jsonToKeyValue(json: Record<string, any>): string;
|
|
9
|
+
init(callBack?: any): void;
|
|
10
|
+
setAdStateListener(): void;
|
|
11
|
+
login(callBack?: Function): void;
|
|
12
|
+
pay(params: string, callBack: any): void;
|
|
13
|
+
showBanner(position: BannerType): void;
|
|
14
|
+
hideBanner(): void;
|
|
15
|
+
showInters(type: InterstitialType): void;
|
|
16
|
+
hideInters(type?: InterstitialType): void;
|
|
17
|
+
showVideo(callBack: Function): boolean;
|
|
18
|
+
customFunc(methodName: string, params: any[], callBack: Function): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface payParamsProps {
|
|
2
|
+
productId: string;
|
|
3
|
+
productName: string;
|
|
4
|
+
productDesc: string;
|
|
5
|
+
price: number;
|
|
6
|
+
coinNum?: number;
|
|
7
|
+
serverId?: string;
|
|
8
|
+
serverName?: string;
|
|
9
|
+
roleId?: string;
|
|
10
|
+
roleName?: string;
|
|
11
|
+
roleLevel?: number;
|
|
12
|
+
vip?: string;
|
|
13
|
+
extension?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class PayParams {
|
|
16
|
+
constructor(props: payParamsProps);
|
|
17
|
+
toJSonString(): string;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GameInterface } from "../../GameInterface";
|
|
2
|
+
import { BannerType } from "../BannerType";
|
|
3
|
+
import { InterstitialType } from "../InterstitialType";
|
|
4
|
+
export declare class DouYinGame implements GameInterface {
|
|
5
|
+
private bannerAd;
|
|
6
|
+
private videoAd;
|
|
7
|
+
private callBack;
|
|
8
|
+
init(): void;
|
|
9
|
+
login(callBack?: Function): void;
|
|
10
|
+
pay(params: string, callBack: Function): void;
|
|
11
|
+
showBanner(position: BannerType): void;
|
|
12
|
+
hideBanner(): void;
|
|
13
|
+
showInters(type: InterstitialType): void;
|
|
14
|
+
hideInters(type: InterstitialType): void;
|
|
15
|
+
initViedoAd(show: any): void;
|
|
16
|
+
showVideo(callBack: Function): boolean;
|
|
17
|
+
customFunc(methodName: string, params: any[], callBack: Function): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GameInterface } from "../../GameInterface";
|
|
2
|
+
import { BannerType } from "../BannerType";
|
|
3
|
+
import { InterstitialType } from "../InterstitialType";
|
|
4
|
+
export declare class HuaWeiGame implements GameInterface {
|
|
5
|
+
private qg;
|
|
6
|
+
private rewardedVideoAd;
|
|
7
|
+
private callback;
|
|
8
|
+
hideInters(type: InterstitialType): void;
|
|
9
|
+
customFunc(methodName: string, params: any[], callBack: Function): void;
|
|
10
|
+
init(callBack?: any): void;
|
|
11
|
+
login(callBack?: Function): void;
|
|
12
|
+
pay(params: string, callBack: Function): void;
|
|
13
|
+
createPurchaseIntent(params: any, callBack: any): void;
|
|
14
|
+
doCheck(content: string, sign: string, publicKey: string): boolean;
|
|
15
|
+
consumeOwnedPurchase(): void;
|
|
16
|
+
private bannerAd;
|
|
17
|
+
showBanner(position: BannerType): void;
|
|
18
|
+
hideBanner(): void;
|
|
19
|
+
showInters(type: InterstitialType): void;
|
|
20
|
+
showNative(): void;
|
|
21
|
+
renderNative(adItem: any, nativeAd: any): void;
|
|
22
|
+
showNativeDownload(adItem: any, nativeAd: any, node: any): void;
|
|
23
|
+
showIntersVideo(): void;
|
|
24
|
+
showVideo(callBack: Function): boolean;
|
|
25
|
+
loadVideo(show: any): void;
|
|
26
|
+
show(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GameInterface } from "../../GameInterface";
|
|
2
|
+
import { BannerType } from "../BannerType";
|
|
3
|
+
import { InterstitialType } from "../InterstitialType";
|
|
4
|
+
export declare class KuaiShouGame implements GameInterface {
|
|
5
|
+
private bannerAd;
|
|
6
|
+
init(callBack?: any): void;
|
|
7
|
+
login(callBack?: Function): void;
|
|
8
|
+
pay(params: string, callBack: Function): void;
|
|
9
|
+
showBanner(position: BannerType): void;
|
|
10
|
+
hideBanner(): void;
|
|
11
|
+
showInters(type: InterstitialType): void;
|
|
12
|
+
hideInters(type: InterstitialType): void;
|
|
13
|
+
showVideo(callBack: Function): boolean;
|
|
14
|
+
customFunc(methodName: string, params: any[], callBack: Function): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
interface HasherState {
|
|
2
|
+
buffer: string;
|
|
3
|
+
buflen: number;
|
|
4
|
+
length: number;
|
|
5
|
+
state: number[];
|
|
6
|
+
}
|
|
7
|
+
export declare class Md5 {
|
|
8
|
+
/**
|
|
9
|
+
* Hash a UTF-8 string on the spot
|
|
10
|
+
* @param str String to hash
|
|
11
|
+
* @param raw Whether to return the value as an `Int32Array`
|
|
12
|
+
*/
|
|
13
|
+
static hashStr(str: string, raw?: false): string;
|
|
14
|
+
static hashStr(str: string, raw: true): Int32Array;
|
|
15
|
+
/**
|
|
16
|
+
* Hash a ASCII string on the spot
|
|
17
|
+
* @param str String to hash
|
|
18
|
+
* @param raw Whether to return the value as an `Int32Array`
|
|
19
|
+
*/
|
|
20
|
+
static hashAsciiStr(str: string, raw?: false): string;
|
|
21
|
+
static hashAsciiStr(str: string, raw: true): Int32Array;
|
|
22
|
+
private static stateIdentity;
|
|
23
|
+
private static buffer32Identity;
|
|
24
|
+
private static hexChars;
|
|
25
|
+
private static hexOut;
|
|
26
|
+
private static onePassHasher;
|
|
27
|
+
private static _hex;
|
|
28
|
+
private static _md5cycle;
|
|
29
|
+
private _dataLength;
|
|
30
|
+
private _bufferLength;
|
|
31
|
+
private _state;
|
|
32
|
+
private _buffer;
|
|
33
|
+
private _buffer8;
|
|
34
|
+
private _buffer32;
|
|
35
|
+
constructor();
|
|
36
|
+
/**
|
|
37
|
+
* Initialise buffer to be hashed
|
|
38
|
+
*/
|
|
39
|
+
start(): this;
|
|
40
|
+
/**
|
|
41
|
+
* Append a UTF-8 string to the hash buffer
|
|
42
|
+
* @param str String to append
|
|
43
|
+
*/
|
|
44
|
+
appendStr(str: string): this;
|
|
45
|
+
/**
|
|
46
|
+
* Append an ASCII string to the hash buffer
|
|
47
|
+
* @param str String to append
|
|
48
|
+
*/
|
|
49
|
+
appendAsciiStr(str: string): this;
|
|
50
|
+
/**
|
|
51
|
+
* Append a byte array to the hash buffer
|
|
52
|
+
* @param input array to append
|
|
53
|
+
*/
|
|
54
|
+
appendByteArray(input: Uint8Array): this;
|
|
55
|
+
/**
|
|
56
|
+
* Get the state of the hash buffer
|
|
57
|
+
*/
|
|
58
|
+
getState(): HasherState;
|
|
59
|
+
/**
|
|
60
|
+
* Override the current state of the hash buffer
|
|
61
|
+
* @param state New hash buffer state
|
|
62
|
+
*/
|
|
63
|
+
setState(state: HasherState): void;
|
|
64
|
+
/**
|
|
65
|
+
* Hash the current state of the hash buffer and return the result
|
|
66
|
+
* @param raw Whether to return the value as an `Int32Array`
|
|
67
|
+
*/
|
|
68
|
+
end(raw?: boolean): string | Int32Array<ArrayBufferLike>;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { GameInterface } from "../../GameInterface";
|
|
2
|
+
import { BannerType } from "../BannerType";
|
|
3
|
+
import { InterstitialType } from "../InterstitialType";
|
|
4
|
+
export declare class OppoGame implements GameInterface {
|
|
5
|
+
private qg;
|
|
6
|
+
private bannerAd;
|
|
7
|
+
private nativeAd;
|
|
8
|
+
private bigPicAd;
|
|
9
|
+
private count;
|
|
10
|
+
constructor();
|
|
11
|
+
init(callback?: any): void;
|
|
12
|
+
config(): void;
|
|
13
|
+
login(callBack?: Function): void;
|
|
14
|
+
pay(params: string, callBack: Function): void;
|
|
15
|
+
showBanner(position?: BannerType): void;
|
|
16
|
+
createBannerAd(position: BannerType): void;
|
|
17
|
+
private timerBanner;
|
|
18
|
+
private refreshBanner;
|
|
19
|
+
hideBanner(): void;
|
|
20
|
+
hideBigPicAd(): void;
|
|
21
|
+
showInters(type: InterstitialType): void;
|
|
22
|
+
showInitialType(): void;
|
|
23
|
+
showNativeType(): void;
|
|
24
|
+
hideInters(type: InterstitialType): void;
|
|
25
|
+
showVideo(callBack: Function): boolean;
|
|
26
|
+
loadVideoAd(videoCallBack: any): void;
|
|
27
|
+
loadVideoAdNoCallBack(): void;
|
|
28
|
+
customFunc(methodName: string, params: any[], callBack: Function): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GameInterface } from "../../GameInterface";
|
|
2
|
+
import { BannerType } from "../BannerType";
|
|
3
|
+
import { InterstitialType } from "../InterstitialType";
|
|
4
|
+
export declare class VivoGame implements GameInterface {
|
|
5
|
+
private qg;
|
|
6
|
+
private bannerAd;
|
|
7
|
+
private customAd;
|
|
8
|
+
private rewardedAd;
|
|
9
|
+
private callback;
|
|
10
|
+
private platformVersionCode;
|
|
11
|
+
private boxBannerAd;
|
|
12
|
+
private boxPortalAd;
|
|
13
|
+
private bannerShowing;
|
|
14
|
+
init(): void;
|
|
15
|
+
login(callBack?: Function): void;
|
|
16
|
+
pay(params: string, callBack: Function): void;
|
|
17
|
+
showBanner(position: BannerType): void;
|
|
18
|
+
hideBanner(): void;
|
|
19
|
+
showInters(type: InterstitialType): void;
|
|
20
|
+
showInitial(): void;
|
|
21
|
+
hideNative(): void;
|
|
22
|
+
showNative(): void;
|
|
23
|
+
hideInters(type: InterstitialType): void;
|
|
24
|
+
showVideo(callBack: Function): boolean;
|
|
25
|
+
loadVideo(): void;
|
|
26
|
+
customFunc(methodName: string, params: any[], callBack: Function): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GameInterface } from "../../GameInterface";
|
|
2
|
+
import { BannerType } from "../BannerType";
|
|
3
|
+
import { InterstitialType } from "../InterstitialType";
|
|
4
|
+
export declare class WeChatGame implements GameInterface {
|
|
5
|
+
private wx;
|
|
6
|
+
private bannerAd;
|
|
7
|
+
init(callBack?: any): void;
|
|
8
|
+
login(callBack?: Function): void;
|
|
9
|
+
pay(params: string, callBack: Function): void;
|
|
10
|
+
showBanner(position: BannerType): void;
|
|
11
|
+
showNativeBanner(): void;
|
|
12
|
+
hideBanner(): void;
|
|
13
|
+
showInters(type: InterstitialType): void;
|
|
14
|
+
hideInters(type: InterstitialType): void;
|
|
15
|
+
showVideo(callBack: Function): boolean;
|
|
16
|
+
customFunc(methodName: string, params: any[], callBack: Function): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { GameInterface } from "../../GameInterface";
|
|
2
|
+
import { BannerType } from "../BannerType";
|
|
3
|
+
import { InterstitialType } from "../InterstitialType";
|
|
4
|
+
export declare class XiaoMiGame implements GameInterface {
|
|
5
|
+
private qg;
|
|
6
|
+
private platformVersionCode;
|
|
7
|
+
private callback;
|
|
8
|
+
private bannerAd;
|
|
9
|
+
private lastBanner;
|
|
10
|
+
private lastInters;
|
|
11
|
+
private rewardedVideoAd;
|
|
12
|
+
private nextVideoAd;
|
|
13
|
+
private lastReward;
|
|
14
|
+
private customAd;
|
|
15
|
+
private lastNative;
|
|
16
|
+
private lastGameBanner;
|
|
17
|
+
init(): void;
|
|
18
|
+
login(callBack?: Function): void;
|
|
19
|
+
pay(params: string, callBack: Function): void;
|
|
20
|
+
private bannerShowing;
|
|
21
|
+
showBanner(position: BannerType): void;
|
|
22
|
+
hideBanner(): void;
|
|
23
|
+
showInters(type: InterstitialType): void;
|
|
24
|
+
showNative(): void;
|
|
25
|
+
showInitial(): void;
|
|
26
|
+
hideInters(type: InterstitialType): void;
|
|
27
|
+
showVideo(callBack: Function): boolean;
|
|
28
|
+
loadVideo(show: any): void;
|
|
29
|
+
customFunc(methodName: string, params: any[], callBack: Function): void;
|
|
30
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "yingchigamesdk-cocos-v3",
|
|
3
|
+
"uuid": "090abbac-29dd-4a45-8ee7-beebe124e0b7",
|
|
4
|
+
"version": "25.7.23",
|
|
5
|
+
"creator": {
|
|
6
|
+
"version": "3.5.0"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "npm run build:js && npm run build:dts",
|
|
14
|
+
"build:js": "esbuild assets/script/index.ts --bundle --format=esm --outfile=dist/index.js --external:cc --sourcemap",
|
|
15
|
+
"build:dts": "tsc --emitDeclarationOnly --outDir dist"
|
|
16
|
+
},
|
|
17
|
+
"author": "jackYan",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"assets/resources/Privacy"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"esbuild": "^0.25.8"
|
|
30
|
+
}
|
|
31
|
+
}
|