mirror of
https://gitee.com/dgflash/oops-framework.git
synced 2026-05-20 17:55:41 +08:00
30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
import { CallbackObject, IRequestProtocol } from "../../../core/network/NetInterface";
|
|
import { NetNode } from "../../../core/network/NetNode";
|
|
import { netConfig } from "./NetConfig";
|
|
|
|
/** 网络节点扩展 */
|
|
export class NetNodeGame extends NetNode {
|
|
private isCompress: boolean = false;
|
|
|
|
public req(action: string, method: string, data: any, rspObject: CallbackObject, showTips: boolean = true, force: boolean = false) {
|
|
let protocol: IRequestProtocol = {
|
|
action: action,
|
|
method: method,
|
|
data: JSON.stringify(data),
|
|
isCompress: this.isCompress,
|
|
channelid: netConfig.channelid
|
|
}
|
|
return this.request(protocol, rspObject, showTips, force);
|
|
}
|
|
|
|
public reqUnique(action: string, method: string, data: any, rspObject: CallbackObject, showTips: boolean = true, force: boolean = false): boolean {
|
|
let protocol: IRequestProtocol = {
|
|
action: action,
|
|
method: method,
|
|
data: JSON.stringify(data),
|
|
isCompress: this.isCompress,
|
|
channelid: netConfig.channelid
|
|
}
|
|
return super.requestUnique(protocol, rspObject, showTips, force);
|
|
}
|
|
} |