Merge branch 'dev' of git.kingsome.cn:server/game2006go into dev

This commit is contained in:
yangduo 2024-06-28 17:15:17 +08:00
commit 91ff2614af
9 changed files with 35 additions and 23 deletions

View File

@ -55,7 +55,6 @@ CREATE TABLE `t_mail` (
`expiretime` int(11) NOT NULL DEFAULT '0' COMMENT '过期时间',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
UNIQUE KEY `idx` (`idx`),
UNIQUE KEY `unikey` (`unikey`),
UNIQUE KEY `mail_id` (`mail_id`),
PRIMARY KEY (`idx`)
@ -79,8 +78,8 @@ CREATE TABLE `t_group` (
`deleted` int(11) NOT NULL DEFAULT '0' COMMENT '是否已删除',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
UNIQUE KEY `idx` (`idx`),
PRIMARY KEY (`group_id`)
UNIQUE KEY `idx_group_id` (`group_id`),
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@ -99,8 +98,8 @@ CREATE TABLE `t_member` (
`deleted` int(11) NOT NULL DEFAULT '0' COMMENT '是否已删除',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
UNIQUE KEY `idx` (`idx`),
PRIMARY KEY (`group_id`, `member_id`)
UNIQUE KEY `idx_group_id_member_id` (`group_id`, `member_id`),
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@ -120,10 +119,10 @@ CREATE TABLE `t_inbox` (
`expiretime` int(11) NOT NULL DEFAULT '0' COMMENT '过期时间',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
UNIQUE KEY `idx` (`idx`),
PRIMARY KEY (`account_id`, `mail_id`),
UNIQUE KEY `idx_account_id_mail_id` (`account_id`, `mail_id`),
KEY `idx_state` (`state`),
KEY `idx_expiretime` (`expiretime`)
KEY `idx_expiretime` (`expiretime`),
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@ -159,8 +158,8 @@ CREATE TABLE `t_param` (
`param_val1` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '参数1',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
UNIQUE KEY `idx` (`idx`),
PRIMARY KEY (`param_name`)
UNIQUE KEY `idx_param_name` (`param_name`),
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@ -187,8 +186,8 @@ CREATE TABLE `t_sys_mail` (
`user_reg_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '用户注册结束时间',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `unikey` (`unikey`)
UNIQUE KEY `unikey` (`unikey`),
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

View File

@ -30,7 +30,8 @@ func (this *bcCurrency) init() () {
func (e *mt.BcCurrency) bool {
this.nameHash.Store(e.GetName(), int64(e.GetCurrentPrice() * DECIMALS))
if e.GetContractAddress() != "" {
this.addressHash.Store(e.GetContractAddress(), int64(e.GetCurrentPrice() * DECIMALS))
this.addressHash.Store(strings.ToLower(e.GetContractAddress()),
int64(e.GetCurrentPrice() * DECIMALS))
}
return true
})

View File

@ -145,6 +145,7 @@ func (this* webHook) orderUpdatedCb(ds *f5.DataSet) bool {
{"order_id", p.Data.Id},
{"chain", p.Chain},
{"status", p.Data.Status.Name},
{"seller_address", strings.ToLower(p.Data.AccountAddress)},
{"item_id", q5.ToString(itemId)},
{"hero_quality", q5.ToString(heroQuality)},
{"start_time", q5.ToString(startTime)},

View File

@ -25,6 +25,7 @@ type OrderUpdatedEvent struct {
Chain string `json:"chain"`
Data struct {
Id string `json:"id"`
AccountAddress string `json:"account_address"`
Buy [] struct {
Amount string `json:"amount"`
ContractAddress string `json:"contract_address"`

View File

@ -76,6 +76,7 @@ WHERE A.idx > %d AND A.net_id = %d AND A.owner_address=? `,
jsonData := val.NftCache.GetJsonData()
if jsonData != nil {
if v, ok := jsonData.(map[string]interface{}); ok {
v := q5.MapClone(v)
if val.Param1 != 0 {
v["on_sale"] = 1
} else {

View File

@ -105,6 +105,7 @@ func (this *ShopCartApi) List(c *gin.Context) {
func (this *ShopCartApi) Add(c *gin.Context) {
openId := c.MustGet("open_id").(string)
accountAddress := c.MustGet("account_address").(string)
rspObj := &struct {
ErrCode int32 `json:"errcode"`
@ -175,14 +176,16 @@ func (this *ShopCartApi) Add(c *gin.Context) {
err1 = err
if err == nil {
if ds.Next() {
cartDb.CurrSortIdx += 1
g := common.NewShopCartGoods()
g.NetId = netId
g.ContractAddress = contractAddress
g.TokenId = tokenId
g.SortIdx = cartDb.CurrSortIdx
g.AddTime = q5.ToInt32(f5.GetApp().GetRealSeconds())
q5.AppendSlice(&cartDb.Goods, g)
if ds.GetByName("seller_address") == accountAddress {
cartDb.CurrSortIdx += 1
g := common.NewShopCartGoods()
g.NetId = netId
g.ContractAddress = contractAddress
g.TokenId = tokenId
g.SortIdx = cartDb.CurrSortIdx
g.AddTime = q5.ToInt32(f5.GetApp().GetRealSeconds())
q5.AppendSlice(&cartDb.Goods, g)
}
} else {
}
}

View File

@ -29,6 +29,7 @@ func internalJwtAuth(c *gin.Context, maybe bool) {
} else {
if maybe {
c.Set("open_id", "")
c.Set("account_address", "")
c.Next()
return
}
@ -62,6 +63,9 @@ func internalImmutJwtAuth(c *gin.Context, jwtToken string) {
Email string `json:"email"`
EmailVerified bool `json:"email_verified"`
Sid string `json:"sid"`
Passport struct {
ZkevmEthAddress string `json:"zkevm_eth_address"`
} `json:"passport"`
} `json:"decoded"`
}{}
rspObj := &struct {
@ -96,6 +100,7 @@ func internalImmutJwtAuth(c *gin.Context, jwtToken string) {
}
openId := fmt.Sprintf("%d_2006_%s", jccommon.IMTBL_CHANNEL, jsonRspObj.Decoded.Sub)
c.Set("open_id", openId)
c.Set("account_address", jsonRspObj.Decoded.Passport.ZkevmEthAddress)
c.Next()
})
}
@ -161,6 +166,7 @@ func internalMetaMaskJwtAuth(c *gin.Context, jwtToken string) {
jccommon.BC_CHANNEL,
strings.ToLower(jsonRspObj.Decoded.OpenId))
c.Set("open_id", openId)
c.Set("account_address", strings.ToLower(jsonRspObj.Decoded.OpenId))
c.Next()
})
}

2
third_party/f5 vendored

@ -1 +1 @@
Subproject commit b41d63fcbb606038b4e906c6a598ca4563c49d24
Subproject commit af0bd957c2e0e26e0933661908ddf5ad4d3974cc

2
third_party/q5 vendored

@ -1 +1 @@
Subproject commit 91b9c416fb7a98cc8fac91e017968caf7b89510e
Subproject commit a0122ba8e585eb43765351cf206e319796e1d04a