feat(37需求): 添加上报名称接口

This commit is contained in:
luying
2023-04-28 16:35:37 +08:00
parent 03bea4d932
commit f73ad9bc77
4 changed files with 71 additions and 3 deletions
+63
View File
@@ -190,6 +190,39 @@ export class CheckName37Params {
}
}
export class PostName37Params {
game_key: string;
sid: number; // 游戏区
username: number; // channelInfo.uid
actor: string; // roleName
actor_id: string; // roleId
ip: string; // 玩家ip
time: number; // unix时间戳
sign: string;
constructor(role: RoleType, roleName: string, user: UserType) {
let channelInfo = <LoginValidateData37>user.channelInfo;
this.game_key = SDK_37_CONST.GAME_KEY;
this.sid = role.serverId;
this.username = channelInfo.uid;
this.actor = roleName;
this.actor_id = role.roleId;
this.ip = user.ip;
this.time = nowSeconds();
}
getBody() {
let { game_key, sid, username, actor_id, ip, time } = this;
return {
game_key, sid, username, actor_id, ip, time
}
}
setSign(sign: string) {
this.sign = sign;
}
}
export class CheckGuild37Params {
game_key: string;
sid: number; // 游戏区
@@ -220,6 +253,36 @@ export class CheckGuild37Params {
}
}
export class PostGuild37Params {
game_key: string;
sid: number; // 游戏区
guildid: string; // 军团code
time: number; // unix时间戳
sign: string;
type: number;
content: string; // 内容
constructor(guildCode: string, serverId: number, type: number, content: string) {
this.game_key = SDK_37_CONST.GAME_KEY;
this.sid = serverId;
this.guildid = guildCode;
this.time = nowSeconds();
this.type = type;
this.content = content;
}
getBody() {
let { game_key, sid, time, type } = this;
return {
game_key, sid, time, type
}
}
setSign(sign: string) {
this.sign = sign;
}
}
export class RoleNameCallBackParam {
username: number; // 玩家账号
game_key: string; // 游戏标识