大世界ability相关交互完善第二弹
This commit is contained in:
1 parent
0750f2a984
commit
7f2fa99a82
25 files changed
+323
-342
No files matched your search
@@ -1,39 +0,0 @@
|
||||
package constant
|
||||
|
||||
import "hk4e/pkg/endec"
|
||||
|
||||
var (
|
||||
DEFAULT_ABILITY_HASH_CODE []int32
|
||||
DEFAULT_TEAM_ABILITY_HASH_CODE []int32
|
||||
)
|
||||
|
||||
func init() {
|
||||
abilityList := []string{
|
||||
"Avatar_DefaultAbility_VisionReplaceDieInvincible",
|
||||
"Avatar_DefaultAbility_AvartarInShaderChange",
|
||||
"Avatar_SprintBS_Invincible",
|
||||
"Avatar_Freeze_Duration_Reducer",
|
||||
"Avatar_Attack_ReviveEnergy",
|
||||
"Avatar_Component_Initializer",
|
||||
"Avatar_FallAnthem_Achievement_Listener",
|
||||
"GrapplingHookSkill_Ability",
|
||||
"Avatar_PlayerBoy_DiveStamina_Reduction",
|
||||
"Ability_Avatar_Dive_SealEcho",
|
||||
"Absorb_SealEcho_Bullet_01",
|
||||
"Absorb_SealEcho_Bullet_02",
|
||||
"Ability_Avatar_Dive_CrabShield",
|
||||
"ActivityAbility_Absorb_Shoot",
|
||||
"SceneAbility_DiveVolume",
|
||||
}
|
||||
DEFAULT_ABILITY_HASH_CODE = make([]int32, 0)
|
||||
for _, ability := range abilityList {
|
||||
DEFAULT_ABILITY_HASH_CODE = append(DEFAULT_ABILITY_HASH_CODE, endec.Hk4eAbilityHashCode(ability))
|
||||
}
|
||||
abilityList = []string{
|
||||
"Ability_Avatar_Dive_Team",
|
||||
}
|
||||
DEFAULT_TEAM_ABILITY_HASH_CODE = make([]int32, 0)
|
||||
for _, ability := range abilityList {
|
||||
DEFAULT_TEAM_ABILITY_HASH_CODE = append(DEFAULT_TEAM_ABILITY_HASH_CODE, endec.Hk4eAbilityHashCode(ability))
|
||||
}
|
||||
}
|
||||
@@ -206,21 +206,25 @@ func (g *GameDataConfig) loadAbilityJsonConfigLoop(path string) {
|
||||
}
|
||||
for _, file := range fileList {
|
||||
fileName := file.Name()
|
||||
filePath := path + "/" + fileName
|
||||
if file.IsDir() {
|
||||
g.loadAbilityJsonConfigLoop(path + "/" + fileName)
|
||||
g.loadAbilityJsonConfigLoop(filePath)
|
||||
}
|
||||
if split := strings.Split(fileName, "."); split[len(split)-1] != "json" {
|
||||
continue
|
||||
}
|
||||
fileData, err := os.ReadFile(path + "/" + fileName)
|
||||
fileData, err := os.ReadFile(filePath)
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("open file error: %v, path: %v", err, path+"/"+fileName)
|
||||
info := fmt.Sprintf("open file error: %v", err)
|
||||
panic(info)
|
||||
}
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
fileData = fileData[3:]
|
||||
}
|
||||
var abilityJsonConfigList []*AbilityJsonConfig = nil
|
||||
err = hjson.Unmarshal(fileData, &abilityJsonConfigList)
|
||||
if err != nil {
|
||||
logger.Info("parse file error: %v, path: %v", err, path+"/"+fileName)
|
||||
logger.Info("parse file error: %v, path: %v", err, filePath)
|
||||
continue
|
||||
}
|
||||
for _, abilityJsonConfig := range abilityJsonConfigList {
|
||||
|
||||
@@ -78,9 +78,12 @@ func (g *GameDataConfig) loadAvatarData() {
|
||||
for _, avatarData := range avatarDataList {
|
||||
fileData, err := os.ReadFile(g.jsonPrefix + "avatar/" + avatarData.ConfigJson + ".json")
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("open file error: %v, avatarId: %v", err, avatarData.AvatarId)
|
||||
info := fmt.Sprintf("open file error: %v", err)
|
||||
panic(info)
|
||||
}
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
fileData = fileData[3:]
|
||||
}
|
||||
configAbilityJson := new(ConfigAbilityJson)
|
||||
err = hjson.Unmarshal(fileData, configAbilityJson)
|
||||
if err != nil {
|
||||
|
||||
@@ -54,20 +54,22 @@ func (g *GameDataConfig) loadAvatarSkillDepotData() {
|
||||
g.AvatarSkillDepotDataMap = make(map[int32]*AvatarSkillDepotData)
|
||||
avatarSkillDepotDataList := make([]*AvatarSkillDepotData, 0)
|
||||
readTable[AvatarSkillDepotData](g.txtPrefix+"AvatarSkillDepotData.txt", &avatarSkillDepotDataList)
|
||||
playerElementsFilePath := g.jsonPrefix + "ability_group/AbilityGroup_Other_PlayerElementAbility.json"
|
||||
playerElementsFile, err := os.ReadFile(playerElementsFilePath)
|
||||
filePath := g.jsonPrefix + "ability_group/AbilityGroup_Other_PlayerElementAbility.json"
|
||||
fileData, err := os.ReadFile(filePath)
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("open file error: %v", err)
|
||||
panic(info)
|
||||
}
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
fileData = fileData[3:]
|
||||
}
|
||||
playerAbilities := make(map[string]*ConfigAbilityJson)
|
||||
err = hjson.Unmarshal(playerElementsFile, &playerAbilities)
|
||||
err = hjson.Unmarshal(fileData, &playerAbilities)
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("parse file error: %v", err)
|
||||
panic(info)
|
||||
}
|
||||
logger.Info("load %v PlayerAbilities", len(playerAbilities))
|
||||
|
||||
for _, avatarSkillDepotData := range avatarSkillDepotDataList {
|
||||
// 把全部技能数据放进一个列表里 以后要是没用到或者不需要的话就可以删了
|
||||
avatarSkillDepotData.Skills = make([]int32, 0)
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package gdconf
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hk4e/pkg/logger"
|
||||
"os"
|
||||
|
||||
"github.com/hjson/hjson-go/v4"
|
||||
)
|
||||
|
||||
type ConfigGlobalCombat struct {
|
||||
DefaultAbilities struct {
|
||||
DefaultAvatarAbilities []string `json:"defaultAvatarAbilities"`
|
||||
} `json:"defaultAbilities"`
|
||||
}
|
||||
|
||||
func (g *GameDataConfig) loadDefaultAbilityJsonConfig() {
|
||||
CONF.DefaultAbilityNameList = make([]string, 0)
|
||||
filePath := g.jsonPrefix + "common/ConfigGlobalCombat.json"
|
||||
fileData, err := os.ReadFile(filePath)
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("open file error: %v", err)
|
||||
panic(info)
|
||||
}
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
fileData = fileData[3:]
|
||||
}
|
||||
configGlobalCombat := new(ConfigGlobalCombat)
|
||||
err = hjson.Unmarshal(fileData, configGlobalCombat)
|
||||
if err != nil {
|
||||
logger.Info("parse file error: %v, path: %v", err, filePath)
|
||||
panic(err)
|
||||
}
|
||||
for _, defaultAbilityName := range configGlobalCombat.DefaultAbilities.DefaultAvatarAbilities {
|
||||
CONF.DefaultAbilityNameList = append(CONF.DefaultAbilityNameList, defaultAbilityName)
|
||||
}
|
||||
}
|
||||
|
||||
func GetDefaultAbilityNameList() []string {
|
||||
return CONF.DefaultAbilityNameList
|
||||
}
|
||||
@@ -9,8 +9,46 @@ import (
|
||||
"github.com/hjson/hjson-go/v4"
|
||||
)
|
||||
|
||||
type ConfigGadget struct {
|
||||
Type string `json:"$type"`
|
||||
ConfigGadgetVehicle
|
||||
ConfigAbilityJson
|
||||
}
|
||||
|
||||
type ConfigGadgetVehicle struct {
|
||||
Vehicle *ConfigVehicle `json:"vehicle"` // 载具
|
||||
Combat *ConfigVehicleCombat `json:"combat"` // 战斗
|
||||
}
|
||||
|
||||
type ConfigVehicle struct {
|
||||
VehicleType string `json:"vehicleType"` // 载具类型
|
||||
DefaultLevel int32 `json:"defaultLevel"` // 默认等级
|
||||
MaxSeatCount int32 `json:"maxSeatCount"` // 最大座位数
|
||||
Stamina *ConfigVehicleStamina `json:"stamina"` // 耐力
|
||||
}
|
||||
|
||||
type ConfigVehicleStamina struct {
|
||||
StaminaUpperLimit float32 `json:"staminaUpperLimit"` // 耐力上限
|
||||
StaminaRecoverSpeed float32 `json:"staminaRecoverSpeed"` // 耐力回复速度
|
||||
StaminaRecoverWaitTime float32 `json:"staminaRecoverWaitTime"` // 耐力回复等待时间
|
||||
ExtraStaminaUpperLimit float32 `json:"extraStaminaUpperLimit"` // 额外耐力上限
|
||||
SprintStaminaCost float32 `json:"sprintStaminaCost"` // 冲刺时耐力消耗
|
||||
DashStaminaCost float32 `json:"dashStaminaCost"` // 猛冲时耐力消耗
|
||||
}
|
||||
|
||||
type ConfigVehicleCombat struct {
|
||||
Property *ConfigVehicleCombatProperty `json:"property"` // 属性
|
||||
}
|
||||
|
||||
type ConfigVehicleCombatProperty struct {
|
||||
HP float32 `json:"HP"` // 血量
|
||||
Attack float32 `json:"attack"` // 攻击力
|
||||
DefenseBase float32 `json:"defenseBase"` // 防御力
|
||||
Weight float32 `json:"weight"` // 重量
|
||||
}
|
||||
|
||||
func (g *GameDataConfig) loadGadgetJsonConfig() {
|
||||
g.GadgetJsonConfigMap = make(map[string]*ConfigAbilityJson)
|
||||
g.GadgetJsonConfigMap = make(map[string]*ConfigGadget)
|
||||
g.loadGadgetJsonConfigLoop(g.jsonPrefix + "gadget")
|
||||
logger.Info("GadgetJsonConfig Count: %v", len(g.GadgetJsonConfigMap))
|
||||
}
|
||||
@@ -23,21 +61,25 @@ func (g *GameDataConfig) loadGadgetJsonConfigLoop(path string) {
|
||||
}
|
||||
for _, file := range fileList {
|
||||
fileName := file.Name()
|
||||
filePath := path + "/" + fileName
|
||||
if file.IsDir() {
|
||||
g.loadGadgetJsonConfigLoop(path + "/" + fileName)
|
||||
g.loadGadgetJsonConfigLoop(filePath)
|
||||
}
|
||||
if split := strings.Split(fileName, "."); split[len(split)-1] != "json" {
|
||||
continue
|
||||
}
|
||||
fileData, err := os.ReadFile(path + "/" + fileName)
|
||||
fileData, err := os.ReadFile(filePath)
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("open file error: %v, path: %v", err, path+"/"+fileName)
|
||||
info := fmt.Sprintf("open file error: %v", err)
|
||||
panic(info)
|
||||
}
|
||||
var gadgetJsonConfigMap map[string]*ConfigAbilityJson = nil
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
fileData = fileData[3:]
|
||||
}
|
||||
var gadgetJsonConfigMap map[string]*ConfigGadget = nil
|
||||
err = hjson.Unmarshal(fileData, &gadgetJsonConfigMap)
|
||||
if err != nil {
|
||||
logger.Info("parse file error: %v, path: %v", err, path+"/"+fileName)
|
||||
logger.Info("parse file error: %v, path: %v", err, filePath)
|
||||
continue
|
||||
}
|
||||
for k, v := range gadgetJsonConfigMap {
|
||||
@@ -46,6 +88,6 @@ func (g *GameDataConfig) loadGadgetJsonConfigLoop(path string) {
|
||||
}
|
||||
}
|
||||
|
||||
func GetGadgetJsonConfigByName(name string) *ConfigAbilityJson {
|
||||
func GetGadgetJsonConfigByName(name string) *ConfigGadget {
|
||||
return CONF.GadgetJsonConfigMap[name]
|
||||
}
|
||||
@@ -28,8 +28,9 @@ func (g *GameDataConfig) loadGadgetLuaConfigLoop(path string) {
|
||||
}
|
||||
for _, file := range fileList {
|
||||
fileName := file.Name()
|
||||
filePath := path + "/" + fileName
|
||||
if file.IsDir() {
|
||||
g.loadGadgetLuaConfigLoop(path + "/" + fileName)
|
||||
g.loadGadgetLuaConfigLoop(filePath)
|
||||
}
|
||||
split := strings.Split(fileName, ".")
|
||||
if split[len(split)-1] != "lua" {
|
||||
@@ -39,9 +40,9 @@ func (g *GameDataConfig) loadGadgetLuaConfigLoop(path string) {
|
||||
continue
|
||||
}
|
||||
gadgetLuaName := split[0]
|
||||
fileData, err := os.ReadFile(path + "/" + fileName)
|
||||
fileData, err := os.ReadFile(filePath)
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("open file error: %v, path: %v", err, path+"/"+fileName)
|
||||
info := fmt.Sprintf("open file error: %v", err)
|
||||
panic(info)
|
||||
}
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
@@ -59,7 +60,10 @@ func GetGadgetLuaConfigByName(name string) *GadgetLuaConfig {
|
||||
return nil
|
||||
}
|
||||
if gadgetLuaConfig.LuaState == nil {
|
||||
luaState := newLuaState(gadgetLuaConfig.LuaStr)
|
||||
luaState, err := newLuaState(gadgetLuaConfig.LuaStr)
|
||||
if err != nil {
|
||||
logger.Error("lua parse error: %v, name: %v", err, name)
|
||||
}
|
||||
scriptLib := luaState.NewTable()
|
||||
luaState.SetGlobal("ScriptLib", scriptLib)
|
||||
for _, scriptLibFunc := range SCRIPT_LIB_FUNC_LIST {
|
||||
|
||||
+12
-12
@@ -38,6 +38,11 @@ type GameDataConfig struct {
|
||||
SceneLuaStateLruMap map[int32]*LuaStateLru // 场景LUA虚拟机LRU内存淘汰
|
||||
TriggerDataMap map[int32]*TriggerData // 场景区域触发器
|
||||
ScenePointJsonConfigMap map[int32]*ScenePointJsonConfig // 场景传送点JSON配置
|
||||
AbilityDataMap map[string]*AbilityData // 能力
|
||||
AbilityDataHashMap map[uint32]*AbilityData // 能力哈希
|
||||
DefaultAbilityNameList []string // 默认能力
|
||||
GadgetJsonConfigMap map[string]*ConfigGadget // 物件JSON配置
|
||||
GadgetLuaConfigMap map[string]*GadgetLuaConfig // 物件LUA配置
|
||||
SceneTagDataMap map[int32]*SceneTagData // 场景标签
|
||||
GatherDataMap map[int32]*GatherData // 采集物
|
||||
GatherDataPointTypeMap map[int32]*GatherData // 采集物场景节点索引
|
||||
@@ -69,7 +74,6 @@ type GameDataConfig struct {
|
||||
GCGCharDataMap map[int32]*GCGCharData // 七圣召唤角色卡牌
|
||||
GCGSkillDataMap map[int32]*GCGSkillData // 七圣召唤卡牌技能
|
||||
GachaDropGroupDataMap map[int32]*GachaDropGroupData // 卡池掉落组 临时的
|
||||
VehicleDataMap map[int32]*VehicleData // 载具
|
||||
OpenStateDataMap map[int32]*OpenStateData // 开放状态
|
||||
WeatherDataMap map[int32]*WeatherData // 天气
|
||||
WeatherDataJsonMap map[int32]map[int32]*WeatherData // 天气 json的天气区域id格式
|
||||
@@ -83,10 +87,6 @@ type GameDataConfig struct {
|
||||
WeaponCurveDataMap map[int32]*WeaponCurveData // 武器曲线
|
||||
ReliquaryLevelDataMap map[int32]map[int32]*ReliquaryLevelData // 圣遗物等级
|
||||
MonsterCurveDataMap map[int32]*MonsterCurveData // 怪物曲线
|
||||
AbilityDataMap map[string]*AbilityData // 能力
|
||||
AbilityDataHashMap map[uint32]*AbilityData // 能力哈希
|
||||
GadgetJsonConfigMap map[string]*ConfigAbilityJson // 物件JSON配置
|
||||
GadgetLuaConfigMap map[string]*GadgetLuaConfig // 物件LUA配置
|
||||
}
|
||||
|
||||
func InitGameDataConfig() {
|
||||
@@ -160,6 +160,10 @@ func (g *GameDataConfig) load(loadSceneLua bool) {
|
||||
g.loadSceneLuaConfig(loadSceneLua) // 场景LUA配置
|
||||
g.loadTriggerData() // 场景区域触发器
|
||||
g.loadScenePointJsonConfig() // 场景传送点JSON配置
|
||||
g.loadAbilityJsonConfig() // 能力JSON配置
|
||||
g.loadDefaultAbilityJsonConfig() // 默认能力
|
||||
g.loadGadgetJsonConfig() // 物件JSON配置
|
||||
g.loadGadgetLuaConfig() // 物件LUA配置
|
||||
g.loadSceneTagData() // 场景标签
|
||||
g.loadGatherData() // 采集物
|
||||
g.loadWorldAreaData() // 世界区域
|
||||
@@ -188,7 +192,6 @@ func (g *GameDataConfig) load(loadSceneLua bool) {
|
||||
g.loadGCGCharData() // 七圣召唤角色卡牌
|
||||
g.loadGCGSkillData() // 七圣召唤卡牌技能
|
||||
g.loadGachaDropGroupData() // 卡池掉落组 临时的
|
||||
g.loadVehicleData() // 载具
|
||||
g.loadOpenStateData() // 开放状态
|
||||
g.loadWeatherData() // 天气
|
||||
g.loadWeatherTemplateData() // 天气模版
|
||||
@@ -201,9 +204,6 @@ func (g *GameDataConfig) load(loadSceneLua bool) {
|
||||
g.loadWeaponCurveData() // 武器曲线
|
||||
g.loadReliquaryLevelData() // 圣遗物等级
|
||||
g.loadMonsterCurveData() // 怪物曲线
|
||||
g.loadAbilityJsonConfig() // 能力JSON配置
|
||||
g.loadGadgetJsonConfig() // 物件JSON配置
|
||||
g.loadGadgetLuaConfig() // 物件LUA配置
|
||||
}
|
||||
|
||||
// CSV相关
|
||||
@@ -395,7 +395,7 @@ func initLuaState(luaState *lua.LState) {
|
||||
luaState.SetField(elementType, "Rock", lua.LNumber(constant.ELEMENT_TYPE_ROCK))
|
||||
}
|
||||
|
||||
func newLuaState(luaStr string) *lua.LState {
|
||||
func newLuaState(luaStr string) (*lua.LState, error) {
|
||||
luaState := lua.NewState(lua.Options{
|
||||
IncludeGoStackTrace: true,
|
||||
})
|
||||
@@ -413,10 +413,10 @@ func newLuaState(luaStr string) *lua.LState {
|
||||
err = luaState.DoString(luaStr)
|
||||
}
|
||||
if err != nil {
|
||||
logger.Error("lua parse error: %v", err)
|
||||
return luaState, err
|
||||
}
|
||||
}
|
||||
return luaState
|
||||
return luaState, nil
|
||||
}
|
||||
|
||||
func getSceneLuaConfigTable[T any](luaState *lua.LState, tableName string, object T) bool {
|
||||
|
||||
@@ -47,6 +47,9 @@ func CheckJsonLoop(path string, errorJsonFileList *[]string, totalJsonFileCount
|
||||
logger.Error("open file error: %v", err)
|
||||
continue
|
||||
}
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
fileData = fileData[3:]
|
||||
}
|
||||
var obj any
|
||||
err = hjson.Unmarshal(fileData, &obj)
|
||||
if err != nil {
|
||||
|
||||
@@ -51,9 +51,12 @@ func (g *GameDataConfig) loadGCGSkillData() {
|
||||
// 技能效果Config
|
||||
fileData, err := os.ReadFile(g.jsonPrefix + "gcg_card_skill/" + gcgSkillData.ConfigJson + ".json")
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("open file error: %v, SkillId: %v", err, gcgSkillData.SkillId)
|
||||
info := fmt.Sprintf("open file error: %v", err)
|
||||
panic(info)
|
||||
}
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
fileData = fileData[3:]
|
||||
}
|
||||
configSkillEffect := new(ConfigSkillEffect)
|
||||
err = hjson.Unmarshal(fileData, configSkillEffect)
|
||||
if err != nil {
|
||||
|
||||
@@ -72,9 +72,12 @@ func (g *GameDataConfig) loadMonsterData() {
|
||||
for _, monsterData := range monsterDataList {
|
||||
fileData, err := os.ReadFile(g.jsonPrefix + "monster/" + monsterData.ConfigJson + ".json")
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("open file error: %v, monsterId: %v", err, monsterData.MonsterId)
|
||||
info := fmt.Sprintf("open file error: %v", err)
|
||||
panic(info)
|
||||
}
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
fileData = fileData[3:]
|
||||
}
|
||||
configAbilityJson := new(ConfigAbilityJson)
|
||||
err = hjson.Unmarshal(fileData, configAbilityJson)
|
||||
if err != nil {
|
||||
|
||||
+27
-11
@@ -169,13 +169,19 @@ func (g *GameDataConfig) loadGroup(group *Group, block *Block, sceneId int32, bl
|
||||
sceneIdStr := strconv.Itoa(int(sceneId))
|
||||
groupId := group.Id
|
||||
groupIdStr := strconv.Itoa(int(groupId))
|
||||
groupLuaData, err := os.ReadFile(sceneLuaPrefix + sceneIdStr + "/scene" + sceneIdStr + "_group" + groupIdStr + ".lua")
|
||||
fileData, err := os.ReadFile(sceneLuaPrefix + sceneIdStr + "/scene" + sceneIdStr + "_group" + groupIdStr + ".lua")
|
||||
if err != nil {
|
||||
logger.Error("open file error: %v, sceneId: %v, blockId: %v, groupId: %v", err, sceneId, blockId, groupId)
|
||||
logger.Error("open file error: %v", err)
|
||||
return
|
||||
}
|
||||
group.LuaStr = string(groupLuaData)
|
||||
luaState := newLuaState(group.LuaStr)
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
fileData = fileData[3:]
|
||||
}
|
||||
group.LuaStr = string(fileData)
|
||||
luaState, err := newLuaState(group.LuaStr)
|
||||
if err != nil {
|
||||
logger.Error("lua parse error: %v, groupId: %v", err, groupId)
|
||||
}
|
||||
// init_config
|
||||
group.GroupInitConfig = new(GroupInitConfig)
|
||||
ok := getSceneLuaConfigTable[*GroupInitConfig](luaState, "init_config", group.GroupInitConfig)
|
||||
@@ -320,12 +326,15 @@ func (g *GameDataConfig) loadSceneLuaConfig(loadSceneLua bool) {
|
||||
for _, sceneData := range g.SceneDataMap {
|
||||
sceneId := sceneData.SceneId
|
||||
sceneIdStr := strconv.Itoa(int(sceneId))
|
||||
mainLuaData, err := os.ReadFile(sceneLuaPrefix + sceneIdStr + "/scene" + sceneIdStr + ".lua")
|
||||
filePath := sceneLuaPrefix + sceneIdStr + "/scene" + sceneIdStr + ".lua"
|
||||
mainLuaData, err := os.ReadFile(filePath)
|
||||
if err != nil {
|
||||
logger.Info("open file error: %v, sceneId: %v", err, sceneId)
|
||||
continue
|
||||
}
|
||||
luaState := newLuaState(string(mainLuaData))
|
||||
luaState, err := newLuaState(string(mainLuaData))
|
||||
if err != nil {
|
||||
logger.Error("lua parse error: %v, path: %v", err, filePath)
|
||||
}
|
||||
sceneLuaConfig := new(SceneLuaConfig)
|
||||
sceneLuaConfig.Id = sceneId
|
||||
// scene_config
|
||||
@@ -361,12 +370,16 @@ func (g *GameDataConfig) loadSceneLuaConfig(loadSceneLua bool) {
|
||||
}
|
||||
block.BlockRange = blockRectList[index]
|
||||
blockIdStr := strconv.Itoa(int(block.Id))
|
||||
blockLuaData, err := os.ReadFile(sceneLuaPrefix + sceneIdStr + "/scene" + sceneIdStr + "_block" + blockIdStr + ".lua")
|
||||
filePath := sceneLuaPrefix + sceneIdStr + "/scene" + sceneIdStr + "_block" + blockIdStr + ".lua"
|
||||
blockLuaData, err := os.ReadFile(filePath)
|
||||
if err != nil {
|
||||
logger.Error("open file error: %v, sceneId: %v, blockId: %v", err, sceneId, blockId)
|
||||
logger.Error("open file error: %v", err)
|
||||
continue
|
||||
}
|
||||
luaState = newLuaState(string(blockLuaData))
|
||||
luaState, err := newLuaState(string(blockLuaData))
|
||||
if err != nil {
|
||||
logger.Error("lua parse error: %v, path: %v", err, filePath)
|
||||
}
|
||||
// groups
|
||||
block.GroupMap = make(map[int32]*Group)
|
||||
groupList := make([]*Group, 0)
|
||||
@@ -477,7 +490,10 @@ func (g *Group) GetLuaState() *lua.LState {
|
||||
AccessTime: time.Now().UnixMilli(),
|
||||
}
|
||||
if g.LuaState == nil {
|
||||
luaState := newLuaState(g.LuaStr)
|
||||
luaState, err := newLuaState(g.LuaStr)
|
||||
if err != nil {
|
||||
logger.Error("lua parse error: %v, groupId: %v", err, g.Id)
|
||||
}
|
||||
scriptLib := luaState.NewTable()
|
||||
luaState.SetGlobal("ScriptLib", scriptLib)
|
||||
for _, scriptLibFunc := range SCRIPT_LIB_FUNC_LIST {
|
||||
|
||||
@@ -12,33 +12,18 @@ import (
|
||||
|
||||
// 传送点类型
|
||||
const (
|
||||
PointTypeStrTransPointNormal = "TransPointNormal"
|
||||
PointTypeStrTransPointPortal = "TransPointPortal"
|
||||
PointTypeStrTransPointStatue = "TransPointStatue"
|
||||
PointTypeStrDungeonEntry = "DungeonEntry"
|
||||
PointTypeStrDungeonExit = "DungeonExit"
|
||||
PointTypeStrDungeonQuitPoint = "DungeonQuitPoint"
|
||||
PointTypeStrDungeonWayPoint = "DungeonWayPoint"
|
||||
PointTypeStrDungeonSlipRevivePoint = "DungeonSlipRevivePoint"
|
||||
PointTypeStrSceneBuildingPoint = "SceneBuildingPoint"
|
||||
PointTypeStrPersonalSceneJumpPoint = "PersonalSceneJumpPoint"
|
||||
PointTypeStrVehicleSummonPoint = "VehicleSummonPoint"
|
||||
PointTypeStrOther = "Other"
|
||||
)
|
||||
|
||||
const (
|
||||
PointTypeTransPointNormal = iota // X
|
||||
PointTypeTransPointPortal
|
||||
PointTypeTransPointStatue // X
|
||||
PointTypeDungeonEntry // X
|
||||
PointTypeDungeonExit
|
||||
PointTypeDungeonQuitPoint
|
||||
PointTypeDungeonWayPoint
|
||||
PointTypeDungeonSlipRevivePoint
|
||||
PointTypeSceneBuildingPoint // X
|
||||
PointTypePersonalSceneJumpPoint // X
|
||||
PointTypeVehicleSummonPoint // X
|
||||
PointTypeOther
|
||||
PointTypeTransPointNormal = "TransPointNormal"
|
||||
PointTypeTransPointPortal = "TransPointPortal"
|
||||
PointTypeTransPointStatue = "TransPointStatue"
|
||||
PointTypeDungeonEntry = "DungeonEntry"
|
||||
PointTypeDungeonExit = "DungeonExit"
|
||||
PointTypeDungeonQuitPoint = "DungeonQuitPoint"
|
||||
PointTypeDungeonWayPoint = "DungeonWayPoint"
|
||||
PointTypeDungeonSlipRevivePoint = "DungeonSlipRevivePoint"
|
||||
PointTypeSceneBuildingPoint = "SceneBuildingPoint"
|
||||
PointTypePersonalSceneJumpPoint = "PersonalSceneJumpPoint"
|
||||
PointTypeVehicleSummonPoint = "VehicleSummonPoint"
|
||||
PointTypeOther = "Other"
|
||||
)
|
||||
|
||||
type ScenePointJsonConfig struct {
|
||||
@@ -48,8 +33,7 @@ type ScenePointJsonConfig struct {
|
||||
|
||||
type PointData struct {
|
||||
Id int32 `json:"-"`
|
||||
PointType int `json:"-"`
|
||||
PointTypeStr string `json:"pointType"` // 传送点类型
|
||||
PointType string `json:"pointType"` // 传送点类型
|
||||
TranPos *Position `json:"tranPos"` // 传送后位置
|
||||
TranRot *Position `json:"tranRot"` // 传送后朝向
|
||||
DungeonIds []int32 `json:"dungeonIds"` // 地牢id列表
|
||||
@@ -72,9 +56,11 @@ func (g *GameDataConfig) loadScenePointJsonConfig() {
|
||||
sceneIdStr := strconv.Itoa(int(sceneId))
|
||||
fileData, err := os.ReadFile(sceneLuaPrefix + sceneIdStr + "/scene" + sceneIdStr + "_point.json")
|
||||
if err != nil {
|
||||
logger.Info("open file error: %v, sceneId: %v", err, sceneId)
|
||||
continue
|
||||
}
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
fileData = fileData[3:]
|
||||
}
|
||||
scenePointJsonConfig := new(ScenePointJsonConfig)
|
||||
err = json.Unmarshal(fileData, scenePointJsonConfig)
|
||||
if err != nil {
|
||||
@@ -89,35 +75,6 @@ func (g *GameDataConfig) loadScenePointJsonConfig() {
|
||||
continue
|
||||
}
|
||||
pointData.Id = int32(pointId)
|
||||
switch pointData.PointTypeStr {
|
||||
case PointTypeStrTransPointNormal:
|
||||
pointData.PointType = PointTypeTransPointNormal
|
||||
case PointTypeStrTransPointPortal:
|
||||
pointData.PointType = PointTypeTransPointPortal
|
||||
case PointTypeStrTransPointStatue:
|
||||
pointData.PointType = PointTypeTransPointStatue
|
||||
case PointTypeStrDungeonEntry:
|
||||
pointData.PointType = PointTypeDungeonEntry
|
||||
case PointTypeStrDungeonExit:
|
||||
pointData.PointType = PointTypeDungeonExit
|
||||
case PointTypeStrDungeonQuitPoint:
|
||||
pointData.PointType = PointTypeDungeonQuitPoint
|
||||
case PointTypeStrDungeonWayPoint:
|
||||
pointData.PointType = PointTypeDungeonWayPoint
|
||||
case PointTypeStrDungeonSlipRevivePoint:
|
||||
pointData.PointType = PointTypeDungeonSlipRevivePoint
|
||||
case PointTypeStrSceneBuildingPoint:
|
||||
pointData.PointType = PointTypeSceneBuildingPoint
|
||||
case PointTypeStrPersonalSceneJumpPoint:
|
||||
pointData.PointType = PointTypePersonalSceneJumpPoint
|
||||
case PointTypeStrVehicleSummonPoint:
|
||||
pointData.PointType = PointTypeVehicleSummonPoint
|
||||
case PointTypeStrOther:
|
||||
pointData.PointType = PointTypeOther
|
||||
default:
|
||||
logger.Info("unknown scene point type: %v", pointData.PointTypeStr)
|
||||
pointData.PointType = PointTypeOther
|
||||
}
|
||||
scenePointJsonConfig.PointMap[int32(pointId)] = pointData
|
||||
}
|
||||
g.ScenePointJsonConfigMap[sceneId] = scenePointJsonConfig
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
package gdconf
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"hk4e/pkg/logger"
|
||||
|
||||
"github.com/hjson/hjson-go/v4"
|
||||
)
|
||||
|
||||
// VehicleData 载具配置表
|
||||
type VehicleData struct {
|
||||
VehicleId int32 `csv:"ID"`
|
||||
TextName string `csv:"名称$text_name_Name,omitempty"`
|
||||
|
||||
ConfigGadgetVehicle *ConfigGadgetVehicle
|
||||
}
|
||||
|
||||
type ConfigGadgetVehicle struct {
|
||||
Vehicle *ConfigVehicle `json:"vehicle"` // 载具
|
||||
Combat *ConfigVehicleCombat `json:"combat"` // 战斗
|
||||
}
|
||||
|
||||
type ConfigVehicle struct {
|
||||
VehicleType string `json:"vehicleType"` // 载具类型
|
||||
DefaultLevel int32 `json:"defaultLevel"` // 默认等级
|
||||
MaxSeatCount int32 `json:"maxSeatCount"` // 最大座位数
|
||||
Stamina *ConfigVehicleStamina `json:"stamina"` // 耐力
|
||||
}
|
||||
|
||||
type ConfigVehicleStamina struct {
|
||||
StaminaUpperLimit float32 `json:"staminaUpperLimit"` // 耐力上限
|
||||
StaminaRecoverSpeed float32 `json:"staminaRecoverSpeed"` // 耐力回复速度
|
||||
StaminaRecoverWaitTime float32 `json:"staminaRecoverWaitTime"` // 耐力回复等待时间
|
||||
ExtraStaminaUpperLimit float32 `json:"extraStaminaUpperLimit"` // 额外耐力上限
|
||||
SprintStaminaCost float32 `json:"sprintStaminaCost"` // 冲刺时耐力消耗
|
||||
DashStaminaCost float32 `json:"dashStaminaCost"` // 猛冲时耐力消耗
|
||||
}
|
||||
|
||||
type ConfigVehicleCombat struct {
|
||||
Property *ConfigVehicleCombatProperty // 属性
|
||||
}
|
||||
|
||||
type ConfigVehicleCombatProperty struct {
|
||||
HP float32 `json:"HP"` // 血量
|
||||
Attack float32 `json:"attack"` // 攻击力
|
||||
DefenseBase float32 `json:"defenseBase"` // 防御力
|
||||
Weight float32 `json:"weight"` // 重量
|
||||
}
|
||||
|
||||
func (g *GameDataConfig) loadVehicleData() {
|
||||
g.VehicleDataMap = make(map[int32]*VehicleData)
|
||||
configGadgetVehiclesMap := make(map[string]map[string]*ConfigGadgetVehicle)
|
||||
vehicleDataList := make([]*VehicleData, 0)
|
||||
readTable[VehicleData](g.txtPrefix+"GadgetData_Vehicle.txt", &vehicleDataList)
|
||||
for _, vehicleData := range vehicleDataList {
|
||||
vehicleNameSplit := strings.Split(vehicleData.TextName, "_")
|
||||
if len(vehicleNameSplit) < 3 {
|
||||
info := fmt.Sprintf("vehicle text name split len less 3, TextName: %v", vehicleData.TextName)
|
||||
panic(info)
|
||||
}
|
||||
// 载具类型
|
||||
vehicleType := vehicleNameSplit[0]
|
||||
// 先判断一下是否已读取过同类型的载具配置
|
||||
configGadgetVehicles, ok := configGadgetVehiclesMap[vehicleType]
|
||||
if !ok {
|
||||
// 读取载具config
|
||||
fileData, err := os.ReadFile(g.jsonPrefix + "gadget/ConfigGadget_Vehicle_" + vehicleType + ".json")
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("open file error: %v, vehicleType: %v", err, vehicleType)
|
||||
panic(info)
|
||||
}
|
||||
err = hjson.Unmarshal(fileData, &configGadgetVehicles)
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("parse file error: %v, vehicleType: %v", err, vehicleType)
|
||||
panic(info)
|
||||
}
|
||||
configGadgetVehiclesMap[vehicleType] = configGadgetVehicles
|
||||
}
|
||||
// 载具config配置是否存在
|
||||
configVehicle, ok := configGadgetVehicles[vehicleData.TextName]
|
||||
if !ok {
|
||||
logger.Info("can not find any config of vehicle, vehicleId: %v", vehicleData.VehicleId)
|
||||
}
|
||||
vehicleData.ConfigGadgetVehicle = configVehicle
|
||||
|
||||
g.VehicleDataMap[vehicleData.VehicleId] = vehicleData
|
||||
}
|
||||
logger.Info("VehicleData Count: %v", len(g.VehicleDataMap))
|
||||
}
|
||||
|
||||
func GetVehicleDataById(vehicleId int32) *VehicleData {
|
||||
return CONF.VehicleDataMap[vehicleId]
|
||||
}
|
||||
|
||||
func GetVehicleDataMap() map[int32]*VehicleData {
|
||||
return CONF.VehicleDataMap
|
||||
}
|
||||
@@ -32,10 +32,11 @@ func (g *GameDataConfig) loadWeatherAreaJsonConfig() {
|
||||
// 读取场景天气区域
|
||||
fileData, err := os.ReadFile(sceneLuaPrefix + sceneIdStr + "/scene" + sceneIdStr + "_weather_areas.json")
|
||||
if err != nil {
|
||||
// 有些场景没有天气区域是正常情况
|
||||
// logger.Error("open file error: %v, sceneId: %v", err, sceneId)
|
||||
continue
|
||||
}
|
||||
if fileData[0] == 0xEF && fileData[1] == 0xBB && fileData[2] == 0xBF {
|
||||
fileData = fileData[3:]
|
||||
}
|
||||
weatherAreaJsonConfigList := make([]*WeatherAreaJsonConfig, 0)
|
||||
err = hjson.Unmarshal(fileData, &weatherAreaJsonConfigList)
|
||||
if err != nil {
|
||||
|
||||
+60
-53
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"hk4e/pkg/endec"
|
||||
"math"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"hk4e/gdconf"
|
||||
@@ -257,8 +258,8 @@ func (s *Scene) CreateEntityGadgetClient(pos, rot *model.Vector, entityId, confi
|
||||
},
|
||||
entityType: constant.ENTITY_TYPE_GADGET,
|
||||
visionLevel: constant.VISION_LEVEL_NORMAL,
|
||||
configId: configId,
|
||||
},
|
||||
gadgetId: configId,
|
||||
},
|
||||
campId: campId,
|
||||
campType: campType,
|
||||
@@ -274,9 +275,14 @@ func (s *Scene) CreateEntityGadgetClient(pos, rot *model.Vector, entityId, confi
|
||||
|
||||
func (s *Scene) CreateEntityGadgetVehicle(ownerUid uint32, pos, rot *model.Vector, vehicleId uint32) uint32 {
|
||||
// 获取载具配置表
|
||||
vehicleDataConfig := gdconf.GetVehicleDataById(int32(vehicleId))
|
||||
if vehicleDataConfig == nil {
|
||||
logger.Error("vehicle config error, vehicleId: %v", vehicleId)
|
||||
gadgetDataConfig := gdconf.GetGadgetDataById(int32(vehicleId))
|
||||
if gadgetDataConfig == nil {
|
||||
logger.Error("get gadget data config is nil, gadgetId: %v", vehicleId)
|
||||
return 0
|
||||
}
|
||||
gadgetJsonConfig := gdconf.GetGadgetJsonConfigByName(gadgetDataConfig.JsonName)
|
||||
if gadgetJsonConfig == nil {
|
||||
logger.Error("get gadget json config is nil, name: %v", gadgetDataConfig.JsonName)
|
||||
return 0
|
||||
}
|
||||
entityId := s.world.GetNextWorldEntityId(constant.ENTITY_TYPE_GADGET)
|
||||
@@ -292,20 +298,19 @@ func (s *Scene) CreateEntityGadgetVehicle(ownerUid uint32, pos, rot *model.Vecto
|
||||
lastMoveSceneTimeMs: 0,
|
||||
lastMoveReliableSeq: 0,
|
||||
fightProp: map[uint32]float32{
|
||||
constant.FIGHT_PROP_BASE_DEFENSE: vehicleDataConfig.ConfigGadgetVehicle.Combat.Property.DefenseBase,
|
||||
constant.FIGHT_PROP_CUR_HP: vehicleDataConfig.ConfigGadgetVehicle.Combat.Property.HP,
|
||||
constant.FIGHT_PROP_MAX_HP: vehicleDataConfig.ConfigGadgetVehicle.Combat.Property.HP,
|
||||
constant.FIGHT_PROP_CUR_ATTACK: vehicleDataConfig.ConfigGadgetVehicle.Combat.Property.Attack,
|
||||
constant.FIGHT_PROP_BASE_DEFENSE: gadgetJsonConfig.Combat.Property.DefenseBase,
|
||||
constant.FIGHT_PROP_CUR_HP: gadgetJsonConfig.Combat.Property.HP,
|
||||
constant.FIGHT_PROP_MAX_HP: gadgetJsonConfig.Combat.Property.HP,
|
||||
constant.FIGHT_PROP_CUR_ATTACK: gadgetJsonConfig.Combat.Property.Attack,
|
||||
},
|
||||
entityType: constant.ENTITY_TYPE_GADGET,
|
||||
visionLevel: constant.VISION_LEVEL_NORMAL,
|
||||
},
|
||||
gadgetId: vehicleId,
|
||||
},
|
||||
vehicleId: vehicleId,
|
||||
worldId: s.world.id,
|
||||
ownerUid: ownerUid,
|
||||
maxStamina: vehicleDataConfig.ConfigGadgetVehicle.Vehicle.Stamina.StaminaUpperLimit,
|
||||
curStamina: vehicleDataConfig.ConfigGadgetVehicle.Vehicle.Stamina.StaminaUpperLimit,
|
||||
maxStamina: gadgetJsonConfig.Vehicle.Stamina.StaminaUpperLimit,
|
||||
curStamina: gadgetJsonConfig.Vehicle.Stamina.StaminaUpperLimit,
|
||||
restoreDelay: 0,
|
||||
memberMap: make(map[uint32]uint32),
|
||||
}
|
||||
@@ -615,7 +620,7 @@ func (e *Entity) InitAbility() {
|
||||
}
|
||||
|
||||
func (e *Entity) AddAbility(abilityName string, instancedAbilityId uint32) {
|
||||
logger.Debug("[AddAbility] abilityName: %v, instancedAbilityId: %v, entityId: %v", abilityName, instancedAbilityId, e.GetId())
|
||||
// logger.Debug("[AddAbility] abilityName: %v, instancedAbilityId: %v, entityId: %v", abilityName, instancedAbilityId, e.GetId())
|
||||
_, exist := e.abilityMap[instancedAbilityId]
|
||||
if exist {
|
||||
logger.Error("ability already exist, abilityName: %v, entityId: %v", abilityName, e.GetId())
|
||||
@@ -627,11 +632,6 @@ func (e *Entity) AddAbility(abilityName string, instancedAbilityId uint32) {
|
||||
instancedAbilityId: instancedAbilityId,
|
||||
abilitySpecialOverrideMap: make(map[uint32]float32),
|
||||
}
|
||||
abilityDataConfig := gdconf.GetAbilityDataByName(abilityName)
|
||||
if abilityDataConfig == nil {
|
||||
logger.Error("get ability data config is nil, abilityName: %v", abilityName)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Entity) GetAbility(instancedAbilityId uint32) *Ability {
|
||||
@@ -647,8 +647,8 @@ func (e *Entity) GetAllAbility() []*Ability {
|
||||
}
|
||||
|
||||
func (e *Entity) AddModifier(ability *Ability, instancedModifierId uint32, modifierLocalId uint32) {
|
||||
logger.Debug("[AddModifier] abilityName: %v, instancedModifierId: %v, modifierLocalId: %v, entityId: %v",
|
||||
ability.abilityName, instancedModifierId, modifierLocalId, e.GetId())
|
||||
// logger.Debug("[AddModifier] abilityName: %v, instancedModifierId: %v, modifierLocalId: %v, entityId: %v",
|
||||
// ability.abilityName, instancedModifierId, modifierLocalId, e.GetId())
|
||||
_, exist := e.modifierMap[instancedModifierId]
|
||||
if exist {
|
||||
logger.Error("modifier already exist, abilityName: %v, modifierLocalId: %v, entityId: %v", ability.abilityName, modifierLocalId, e.GetId())
|
||||
@@ -661,16 +661,6 @@ func (e *Entity) AddModifier(ability *Ability, instancedModifierId uint32, modif
|
||||
instancedAbilityId: ability.instancedAbilityId,
|
||||
instancedModifierId: instancedModifierId,
|
||||
}
|
||||
abilityDataConfig := gdconf.GetAbilityDataByName(ability.abilityName)
|
||||
if abilityDataConfig == nil {
|
||||
logger.Error("get ability data config is nil, abilityName: %v", ability.abilityName)
|
||||
return
|
||||
}
|
||||
modifierDataConfig := abilityDataConfig.Modifiers.GetByLocalId(modifierLocalId)
|
||||
if modifierDataConfig == nil {
|
||||
logger.Error("get modifier data config is nil, modifierLocalId: %v", modifierLocalId)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Entity) GetAllModifier() []*Modifier {
|
||||
@@ -687,18 +677,8 @@ func (e *Entity) RemoveModifier(instancedModifierId uint32) {
|
||||
logger.Error("modifier not exist, instancedModifierId: %v, entityId: %v", instancedModifierId, e.GetId())
|
||||
return
|
||||
}
|
||||
logger.Debug("[RemoveModifier] abilityName: %v, modifierLocalId: %v, entityId: %v", modifier.parentAbilityName, modifier.modifierLocalId, e.GetId())
|
||||
delete(e.modifierMap, instancedModifierId)
|
||||
abilityDataConfig := gdconf.GetAbilityDataByName(modifier.parentAbilityName)
|
||||
if abilityDataConfig == nil {
|
||||
logger.Error("get ability data config is nil, abilityName: %v", modifier.parentAbilityName)
|
||||
return
|
||||
}
|
||||
modifierDataConfig := abilityDataConfig.Modifiers.GetByLocalId(modifier.modifierLocalId)
|
||||
if modifierDataConfig == nil {
|
||||
logger.Error("get modifier data config is nil, modifierLocalId: %v", modifier.modifierLocalId)
|
||||
return
|
||||
}
|
||||
// logger.Debug("[RemoveModifier] abilityName: %v, modifierLocalId: %v, entityId: %v", modifier.parentAbilityName, modifier.modifierLocalId, e.GetId())
|
||||
delete(e.modifierMap, modifier.instancedModifierId)
|
||||
}
|
||||
|
||||
func (a *Ability) GetDynamicFloat(abilityData *gdconf.AbilityData, dynamicFloat gdconf.DynamicFloat) float32 {
|
||||
@@ -791,6 +771,43 @@ func (e *Entity) AbilityAction(ability *Ability, action *gdconf.ActionData, enti
|
||||
}
|
||||
staminaCost := ability.GetDynamicFloat(abilityDataConfig, action.CostStaminaRatio)
|
||||
GAME.UpdatePlayerStamina(owner, int32(staminaCost)*-100)
|
||||
GAME.TriggerQuest(owner, constant.QUEST_FINISH_COND_TYPE_SKILL, "", action.SkillID)
|
||||
case "CreateGadget":
|
||||
if !action.ByServer {
|
||||
return
|
||||
}
|
||||
GAME.CreateGadget(owner, entity.GetPos(), uint32(action.GadgetID), false, 0, 0)
|
||||
case "GenerateElemBall":
|
||||
itemDataConfig := gdconf.GetItemDataById(action.ConfigID)
|
||||
if itemDataConfig == nil {
|
||||
logger.Error("get item data config is nil, itemId: %v", action.ConfigID)
|
||||
return
|
||||
}
|
||||
if itemDataConfig.GadgetId == 0 {
|
||||
return
|
||||
}
|
||||
abilityDataConfig := gdconf.GetAbilityDataByName(ability.abilityName)
|
||||
if abilityDataConfig == nil {
|
||||
logger.Error("get ability data config is nil, abilityName: %v", ability.abilityName)
|
||||
return
|
||||
}
|
||||
baseEnergy := ability.GetDynamicFloat(abilityDataConfig, action.BaseEnergy)
|
||||
ratio := ability.GetDynamicFloat(abilityDataConfig, action.Ratio)
|
||||
totalEnergy := baseEnergy * ratio
|
||||
for _, itemUse := range itemDataConfig.ItemUseList {
|
||||
if itemUse.UseOption != constant.ITEM_USE_ADD_ELEM_ENERGY {
|
||||
continue
|
||||
}
|
||||
if len(itemUse.UseParam) != 3 {
|
||||
continue
|
||||
}
|
||||
sameEnergy, err := strconv.Atoi(itemUse.UseParam[1])
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
count := math.Ceil(float64(totalEnergy) / float64(sameEnergy))
|
||||
GAME.CreateDropGadget(owner, entity.GetPos(), uint32(itemDataConfig.GadgetId), uint32(action.ConfigID), uint32(count))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -941,7 +958,7 @@ func (g *GadgetEntity) InitAbility() {
|
||||
for configAbilityIndex, configAbility := range gadgetJsonConfig.Abilities {
|
||||
abilityDataConfig := gdconf.GetAbilityDataByName(configAbility.AbilityName)
|
||||
if abilityDataConfig == nil {
|
||||
logger.Error("get ability data config is nil, abilityName: %v", gadgetDataConfig.JsonName)
|
||||
logger.Error("get ability data config is nil, abilityName: %v", configAbility.AbilityName)
|
||||
continue
|
||||
}
|
||||
instancedAbilityId := uint32(configAbilityIndex + 1)
|
||||
@@ -999,8 +1016,6 @@ func (g *GadgetClientEntity) GetPropOwnerEntityId() uint32 {
|
||||
|
||||
type GadgetVehicleEntity struct {
|
||||
*GadgetEntity
|
||||
vehicleId uint32
|
||||
worldId uint64
|
||||
ownerUid uint32
|
||||
maxStamina float32
|
||||
curStamina float32
|
||||
@@ -1008,14 +1023,6 @@ type GadgetVehicleEntity struct {
|
||||
memberMap map[uint32]uint32 // key:pos value:uid
|
||||
}
|
||||
|
||||
func (g *GadgetVehicleEntity) GetVehicleId() uint32 {
|
||||
return g.vehicleId
|
||||
}
|
||||
|
||||
func (g *GadgetVehicleEntity) GetWorldId() uint64 {
|
||||
return g.worldId
|
||||
}
|
||||
|
||||
func (g *GadgetVehicleEntity) GetOwnerUid() uint32 {
|
||||
return g.ownerUid
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ func (g *Game) ScenePlayerLocationNotify(world *World) {
|
||||
Z: float32(entity.GetPos().Z),
|
||||
},
|
||||
UidList: make([]uint32, 0, len(gadgetVehicleEntity.GetMemberMap())),
|
||||
GadgetId: gadgetVehicleEntity.GetVehicleId(),
|
||||
GadgetId: gadgetVehicleEntity.GetGadgetId(),
|
||||
MaxHp: entity.GetFightProp()[constant.FIGHT_PROP_MAX_HP],
|
||||
}
|
||||
for _, uid := range gadgetVehicleEntity.GetMemberMap() {
|
||||
|
||||
@@ -232,7 +232,7 @@ func (g *Game) handleEvtBeingHit(player *model.Player, scene *Scene, hitInfo *pr
|
||||
logger.Error("get gadget data config is nil, gadgetId: %v", iGadgetEntity.GetGadgetId())
|
||||
return
|
||||
}
|
||||
logger.Debug("[EvtBeingHit] GadgetData: %+v, EntityId: %v, uid: %v", gadgetDataConfig, defEntity.GetId(), player.PlayerId)
|
||||
logger.Debug("[EvtBeingHit] GadgetData: %+v, entityId: %v, uid: %v", gadgetDataConfig, defEntity.GetId(), player.PlayerId)
|
||||
if gadgetDataConfig.ServerLuaScript != "" {
|
||||
gadgetLuaConfig := gdconf.GetGadgetLuaConfigByName(gadgetDataConfig.ServerLuaScript)
|
||||
if gadgetLuaConfig == nil {
|
||||
@@ -962,7 +962,7 @@ func (g *Game) handleAbilityInvoke(player *model.Player, entry *proto.AbilityInv
|
||||
if entity == nil {
|
||||
return
|
||||
}
|
||||
logger.Debug("[LocalAbilityInvoke] type: %v, localId: %v, entityId: %v, uid: %v", entry.ArgumentType, entry.Head.LocalId, entity.GetId(), player.PlayerId)
|
||||
// logger.Debug("[LocalAbilityInvoke] type: %v, localId: %v, entityId: %v, uid: %v", entry.ArgumentType, entry.Head.LocalId, entity.GetId(), player.PlayerId)
|
||||
if strings.Contains(entry.ArgumentType.String(), "ACTION") || entry.ArgumentType == proto.AbilityInvokeArgument_ABILITY_NONE {
|
||||
ability := entity.GetAbility(entry.Head.InstancedAbilityId)
|
||||
if ability == nil {
|
||||
|
||||
@@ -523,11 +523,6 @@ func (g *Game) TriggerQuest(player *model.Player, cond int32, complexParam strin
|
||||
dbQuest.ForceFinishQuest(quest.QuestId)
|
||||
updateQuestIdList = append(updateQuestIdList, quest.QuestId)
|
||||
case constant.QUEST_FINISH_COND_TYPE_SKILL:
|
||||
// TODO 实在不知道客户端要在怎样的情况下 才会发长按10006这个技能 这里先临时改表解决了
|
||||
// 是走ability体系计算出来的 操了
|
||||
if quest.QuestId == 35303 {
|
||||
questCond.Param[0] = 10067
|
||||
}
|
||||
// 使用技能 参数1:技能id
|
||||
ok := matchParamEqual(questCond.Param, param, 1)
|
||||
if !ok {
|
||||
|
||||
@@ -2119,7 +2119,7 @@ func (g *Game) PacketSceneGadgetInfoNormal(player *model.Player, entity IEntity)
|
||||
|
||||
func (g *Game) PacketSceneGadgetInfoClient(gadgetClientEntity *GadgetClientEntity) *proto.SceneGadgetInfo {
|
||||
sceneGadgetInfo := &proto.SceneGadgetInfo{
|
||||
GadgetId: gadgetClientEntity.GetConfigId(),
|
||||
GadgetId: gadgetClientEntity.GetGadgetId(),
|
||||
OwnerEntityId: gadgetClientEntity.GetOwnerEntityId(),
|
||||
AuthorityPeerId: 1,
|
||||
IsEnableInteract: true,
|
||||
@@ -2143,8 +2143,8 @@ func (g *Game) PacketSceneGadgetInfoVehicle(gadgetVehicleEntity *GadgetVehicleEn
|
||||
return new(proto.SceneGadgetInfo)
|
||||
}
|
||||
sceneGadgetInfo := &proto.SceneGadgetInfo{
|
||||
GadgetId: gadgetVehicleEntity.GetVehicleId(),
|
||||
AuthorityPeerId: WORLD_MANAGER.GetWorldById(gadgetVehicleEntity.GetWorldId()).GetPlayerPeerId(player),
|
||||
GadgetId: gadgetVehicleEntity.GetGadgetId(),
|
||||
AuthorityPeerId: gadgetVehicleEntity.GetScene().GetWorld().GetPlayerPeerId(player),
|
||||
IsEnableInteract: true,
|
||||
Content: &proto.SceneGadgetInfo_VehicleInfo{
|
||||
VehicleInfo: &proto.VehicleInfo{
|
||||
|
||||
@@ -114,14 +114,19 @@ func (g *Game) RestoreCountStaminaHandler(player *model.Player) {
|
||||
continue
|
||||
}
|
||||
// 获取载具配置表
|
||||
vehicleDataConfig := gdconf.GetVehicleDataById(int32(gadgetVehicleEntity.GetVehicleId()))
|
||||
if vehicleDataConfig == nil {
|
||||
logger.Error("vehicle config error, vehicleId: %v", gadgetVehicleEntity.GetVehicleId())
|
||||
gadgetDataConfig := gdconf.GetGadgetDataById(int32(gadgetVehicleEntity.GetGadgetId()))
|
||||
if gadgetDataConfig == nil {
|
||||
logger.Error("get gadget data config is nil, gadgetId: %v", gadgetVehicleEntity.GetGadgetId())
|
||||
continue
|
||||
}
|
||||
gadgetJsonConfig := gdconf.GetGadgetJsonConfigByName(gadgetDataConfig.JsonName)
|
||||
if gadgetJsonConfig == nil {
|
||||
logger.Error("get gadget json config is nil, name: %v", gadgetDataConfig.JsonName)
|
||||
continue
|
||||
}
|
||||
restoreDelay := gadgetVehicleEntity.GetRestoreDelay()
|
||||
// 做个限制不然一直加就panic了
|
||||
if restoreDelay < uint8(vehicleDataConfig.ConfigGadgetVehicle.Vehicle.Stamina.StaminaRecoverWaitTime*10) {
|
||||
if restoreDelay < uint8(gadgetJsonConfig.Vehicle.Stamina.StaminaRecoverWaitTime*10) {
|
||||
gadgetVehicleEntity.SetRestoreDelay(restoreDelay + 1)
|
||||
}
|
||||
}
|
||||
@@ -219,16 +224,21 @@ func (g *Game) UpdateVehicleStamina(player *model.Player, entity IEntity, stamin
|
||||
return
|
||||
}
|
||||
// 获取载具配置表
|
||||
vehicleDataConfig := gdconf.GetVehicleDataById(int32(gadgetVehicleEntity.GetVehicleId()))
|
||||
if vehicleDataConfig == nil {
|
||||
logger.Error("vehicle config error, vehicleId: %v", gadgetVehicleEntity.GetVehicleId())
|
||||
gadgetDataConfig := gdconf.GetGadgetDataById(int32(gadgetVehicleEntity.GetGadgetId()))
|
||||
if gadgetDataConfig == nil {
|
||||
logger.Error("get gadget data config is nil, gadgetId: %v", gadgetVehicleEntity.GetGadgetId())
|
||||
return
|
||||
}
|
||||
gadgetJsonConfig := gdconf.GetGadgetJsonConfigByName(gadgetDataConfig.JsonName)
|
||||
if gadgetJsonConfig == nil {
|
||||
logger.Error("get gadget json config is nil, name: %v", gadgetDataConfig.JsonName)
|
||||
return
|
||||
}
|
||||
// 添加的耐力大于0为恢复
|
||||
if staminaCost > 0 {
|
||||
// 耐力延迟1.5s(15 ticks)恢复 动作状态为加速将立刻恢复耐力
|
||||
restoreDelay := gadgetVehicleEntity.GetRestoreDelay()
|
||||
if restoreDelay < uint8(vehicleDataConfig.ConfigGadgetVehicle.Vehicle.Stamina.StaminaRecoverWaitTime*10) && staminaInfo.State != proto.MotionState_MOTION_SKIFF_POWERED_DASH {
|
||||
if restoreDelay < uint8(gadgetJsonConfig.Vehicle.Stamina.StaminaRecoverWaitTime*10) && staminaInfo.State != proto.MotionState_MOTION_SKIFF_POWERED_DASH {
|
||||
return // 不恢复耐力
|
||||
}
|
||||
} else {
|
||||
|
||||
+33
-10
@@ -459,15 +459,35 @@ func (g *Game) PacketAvatarAbilityControlBlock(avatarId uint32, skillDepotId uin
|
||||
}
|
||||
abilityId := 0
|
||||
// 默认ability
|
||||
for _, abilityHashCode := range constant.DEFAULT_ABILITY_HASH_CODE {
|
||||
for _, defaultAbilityName := range gdconf.GetDefaultAbilityNameList() {
|
||||
abilityId++
|
||||
ae := &proto.AbilityEmbryo{
|
||||
AbilityId: uint32(abilityId),
|
||||
AbilityNameHash: uint32(abilityHashCode),
|
||||
AbilityNameHash: uint32(endec.Hk4eAbilityHashCode(defaultAbilityName)),
|
||||
AbilityOverrideNameHash: uint32(endec.Hk4eAbilityHashCode("Default")),
|
||||
}
|
||||
acb.AbilityEmbryoList = append(acb.AbilityEmbryoList, ae)
|
||||
}
|
||||
if SELF != nil && SELF.ClientVersion >= 400 {
|
||||
defaultAbilityNameList := []string{
|
||||
"Avatar_PlayerBoy_DiveStamina_Reduction",
|
||||
"Ability_Avatar_Dive_SealEcho",
|
||||
"Absorb_SealEcho_Bullet_01",
|
||||
"Absorb_SealEcho_Bullet_02",
|
||||
"Ability_Avatar_Dive_CrabShield",
|
||||
"ActivityAbility_Absorb_Shoot",
|
||||
"SceneAbility_DiveVolume",
|
||||
}
|
||||
for _, defaultAbilityName := range defaultAbilityNameList {
|
||||
abilityId++
|
||||
ae := &proto.AbilityEmbryo{
|
||||
AbilityId: uint32(abilityId),
|
||||
AbilityNameHash: uint32(endec.Hk4eAbilityHashCode(defaultAbilityName)),
|
||||
AbilityOverrideNameHash: uint32(endec.Hk4eAbilityHashCode("Default")),
|
||||
}
|
||||
acb.AbilityEmbryoList = append(acb.AbilityEmbryoList, ae)
|
||||
}
|
||||
}
|
||||
// 角色ability
|
||||
avatarDataConfig := gdconf.GetAvatarDataById(int32(avatarId))
|
||||
if avatarDataConfig != nil && avatarDataConfig.ConfigAbility != nil {
|
||||
@@ -504,15 +524,18 @@ func (g *Game) PacketTeamAbilityControlBlock() *proto.AbilityControlBlock {
|
||||
AbilityEmbryoList: make([]*proto.AbilityEmbryo, 0),
|
||||
}
|
||||
abilityId := 0
|
||||
// 默认ability
|
||||
for _, abilityHashCode := range constant.DEFAULT_TEAM_ABILITY_HASH_CODE {
|
||||
abilityId++
|
||||
ae := &proto.AbilityEmbryo{
|
||||
AbilityId: uint32(abilityId),
|
||||
AbilityNameHash: uint32(abilityHashCode),
|
||||
AbilityOverrideNameHash: uint32(endec.Hk4eAbilityHashCode("Default")),
|
||||
if SELF != nil && SELF.ClientVersion >= 400 {
|
||||
// 默认ability
|
||||
defaultTeamAbilityNameList := []string{"Ability_Avatar_Dive_Team"}
|
||||
for _, defaultTeamAbilityName := range defaultTeamAbilityNameList {
|
||||
abilityId++
|
||||
ae := &proto.AbilityEmbryo{
|
||||
AbilityId: uint32(abilityId),
|
||||
AbilityNameHash: uint32(endec.Hk4eAbilityHashCode(defaultTeamAbilityName)),
|
||||
AbilityOverrideNameHash: uint32(endec.Hk4eAbilityHashCode("Default")),
|
||||
}
|
||||
acb.AbilityEmbryoList = append(acb.AbilityEmbryoList, ae)
|
||||
}
|
||||
acb.AbilityEmbryoList = append(acb.AbilityEmbryoList, ae)
|
||||
}
|
||||
return acb
|
||||
}
|
||||
@@ -86,7 +86,7 @@ func (g *Game) VehicleInteractReq(player *model.Player, payloadMsg pb.Message) {
|
||||
}
|
||||
// 判断实体类型是否为载具
|
||||
_, ok := entity.(*GadgetVehicleEntity)
|
||||
if ok {
|
||||
if !ok {
|
||||
logger.Error("vehicle entity error, entity: %v", entity)
|
||||
g.SendError(cmd.VehicleInteractRsp, player, &proto.VehicleInteractRsp{}, proto.Retcode_RET_GADGET_NOT_VEHICLE)
|
||||
return
|
||||
@@ -120,7 +120,7 @@ func (g *Game) VehicleDestroyMotion(player *model.Player, entity IEntity, state
|
||||
// 状态等于 MOTION_STATE_DESTROY_VEHICLE 代表请求销毁
|
||||
if state == proto.MotionState_MOTION_DESTROY_VEHICLE {
|
||||
gadgetVehicleEntity := entity.(*GadgetVehicleEntity)
|
||||
g.DestroyVehicleEntity(player, scene, gadgetVehicleEntity.GetVehicleId(), entity.GetId())
|
||||
g.DestroyVehicleEntity(player, scene, gadgetVehicleEntity.GetGadgetId(), entity.GetId())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ func (g *Game) IsPlayerInVehicle(player *model.Player, entity IEntity) bool {
|
||||
}
|
||||
|
||||
// DestroyVehicleEntity 删除载具实体
|
||||
func (g *Game) DestroyVehicleEntity(player *model.Player, scene *Scene, vehicleId uint32, entityId uint32) {
|
||||
func (g *Game) DestroyVehicleEntity(player *model.Player, scene *Scene, gadgetId uint32, entityId uint32) {
|
||||
entity := scene.GetEntity(entityId)
|
||||
if entity == nil {
|
||||
return
|
||||
@@ -151,7 +151,7 @@ func (g *Game) DestroyVehicleEntity(player *model.Player, scene *Scene, vehicleI
|
||||
}
|
||||
// 目前原神仅有一种载具 多载具目前理论上是兼容了 到时候有问题再改
|
||||
// 确保载具Id为将要创建的 (每种载具允许存在1个)
|
||||
if gadgetVehicleEntity.GetVehicleId() != vehicleId {
|
||||
if gadgetVehicleEntity.GetGadgetId() != gadgetId {
|
||||
return
|
||||
}
|
||||
// 该载具是否为此玩家的
|
||||
@@ -169,7 +169,7 @@ func (g *Game) DestroyVehicleEntity(player *model.Player, scene *Scene, vehicleI
|
||||
scene.DestroyEntity(entity.GetId())
|
||||
g.RemoveSceneEntityNotifyBroadcast(scene, proto.VisionType_VISION_MISS, []uint32{entity.GetId()}, 0)
|
||||
// 删除玩家载具在线数据
|
||||
delete(player.VehicleInfo.CreateEntityIdMap, vehicleId)
|
||||
delete(player.VehicleInfo.CreateEntityIdMap, gadgetId)
|
||||
}
|
||||
|
||||
// EnterVehicle 进入载具
|
||||
@@ -179,12 +179,17 @@ func (g *Game) EnterVehicle(player *model.Player, entity IEntity, avatarGuid uin
|
||||
return
|
||||
}
|
||||
// 获取载具配置表
|
||||
vehicleDataConfig := gdconf.GetVehicleDataById(int32(gadgetVehicleEntity.GetVehicleId()))
|
||||
if vehicleDataConfig == nil {
|
||||
logger.Error("vehicle config error, vehicleId: %v", gadgetVehicleEntity.GetVehicleId())
|
||||
gadgetDataConfig := gdconf.GetGadgetDataById(int32(gadgetVehicleEntity.GetGadgetId()))
|
||||
if gadgetDataConfig == nil {
|
||||
logger.Error("get gadget data config is nil, gadgetId: %v", gadgetVehicleEntity.GetGadgetId())
|
||||
return
|
||||
}
|
||||
maxSlot := int(vehicleDataConfig.ConfigGadgetVehicle.Vehicle.MaxSeatCount)
|
||||
gadgetJsonConfig := gdconf.GetGadgetJsonConfigByName(gadgetDataConfig.JsonName)
|
||||
if gadgetJsonConfig == nil {
|
||||
logger.Error("get gadget json config is nil, name: %v", gadgetDataConfig.JsonName)
|
||||
return
|
||||
}
|
||||
maxSlot := int(gadgetJsonConfig.Vehicle.MaxSeatCount)
|
||||
// 判断载具是否已满
|
||||
if len(gadgetVehicleEntity.GetMemberMap()) >= maxSlot {
|
||||
g.SendError(cmd.VehicleInteractRsp, player, &proto.VehicleInteractRsp{}, proto.Retcode_RET_VEHICLE_SLOT_OCCUPIED)
|
||||
|
||||
@@ -420,7 +420,7 @@ func (g *Game) GadgetInteractReq(player *model.Player, payloadMsg pb.Message) {
|
||||
logger.Error("get gadget data config is nil, gadgetId: %v, uid: %v", entity.(IGadgetEntity).GetGadgetId(), player.PlayerId)
|
||||
return
|
||||
}
|
||||
logger.Debug("[GadgetInteractReq] GadgetData: %+v, EntityId: %v, uid: %v", gadgetDataConfig, entity.GetId(), player.PlayerId)
|
||||
logger.Debug("[GadgetInteractReq] GadgetData: %+v, entityId: %v, uid: %v", gadgetDataConfig, entity.GetId(), player.PlayerId)
|
||||
switch gadgetDataConfig.Type {
|
||||
case constant.GADGET_TYPE_GADGET, constant.GADGET_TYPE_EQUIP, constant.GADGET_TYPE_ENERGY_BALL:
|
||||
// 掉落物捡起
|
||||
|
||||
@@ -246,11 +246,12 @@ func (s *DiscoveryService) CancelServer(ctx context.Context, req *api.CancelServ
|
||||
if !exist {
|
||||
return nil, errors.New("server type not exist")
|
||||
}
|
||||
_, exist = instMap.Load(req.AppId)
|
||||
serverInstance, exist := instMap.Load(req.AppId)
|
||||
if !exist {
|
||||
logger.Error("recv not exist server cancel, server type: %v, appid: %v", req.ServerType, req.AppId)
|
||||
return nil, errors.New("server not exist")
|
||||
}
|
||||
s.handleServerOffline(serverInstance.(*ServerInstance))
|
||||
instMap.Delete(req.AppId)
|
||||
return &api.NullMsg{}, nil
|
||||
}
|
||||
@@ -543,8 +544,10 @@ func (s *DiscoveryService) removeDeadServer() {
|
||||
instMap.Range(func(appid, inst any) bool {
|
||||
serverInstance := inst.(*ServerInstance)
|
||||
if nowTime-serverInstance.lastAliveTime > 30 {
|
||||
logger.Warn("remove dead server, server type: %v, appid: %v, last alive time: %v",
|
||||
serverInstance.serverType, serverInstance.appId, serverInstance.lastAliveTime)
|
||||
instMap.Delete(appid)
|
||||
s.handleServerDead(serverInstance)
|
||||
s.handleServerOffline(serverInstance)
|
||||
}
|
||||
return true
|
||||
})
|
||||
@@ -552,9 +555,7 @@ func (s *DiscoveryService) removeDeadServer() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DiscoveryService) handleServerDead(serverInstance *ServerInstance) {
|
||||
logger.Warn("remove dead server, server type: %v, appid: %v, last alive time: %v",
|
||||
serverInstance.serverType, serverInstance.appId, serverInstance.lastAliveTime)
|
||||
func (s *DiscoveryService) handleServerOffline(serverInstance *ServerInstance) {
|
||||
if serverInstance.serverType == api.GS {
|
||||
s.globalGsOnlineMap.Range(func(uid, gsAppid any) bool {
|
||||
if serverInstance.appId == gsAppid.(string) {
|
||||
|
||||
Reference in new issue
Block a user