【删除多余方法】
This commit is contained in:
parent
a13f759c10
commit
f2c13335c2
@ -4,12 +4,9 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
"joylink.club/bj-rtsts-server/dto"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -148,23 +145,6 @@ func (c *RsspConfig) CheckAddress(srcAddr uint16, dstAddr uint16) bool {
|
||||
|
||||
var Config AppConfig
|
||||
|
||||
var SimulationId_prefix = (func() string {
|
||||
ip := "127.0.0.1"
|
||||
addrList, err := net.InterfaceAddrs()
|
||||
if err != nil {
|
||||
panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()})
|
||||
}
|
||||
for _, address := range addrList {
|
||||
if ipNet, ok := address.(*net.IPNet); ok && !ipNet.IP.IsLoopback() {
|
||||
if ipNet.IP.To4() != nil {
|
||||
ip = ipNet.IP.String()
|
||||
}
|
||||
}
|
||||
}
|
||||
ipArr := strings.Split(ip, ".")
|
||||
return ipArr[2] + "_" + ipArr[3]
|
||||
})()
|
||||
|
||||
// 获取配置文件名称,从运行flag参数config中获取,若未提供,使用默认'dev'
|
||||
func getConfigName() string {
|
||||
configName := ""
|
||||
|
@ -143,8 +143,6 @@ func stopThirdParty(s *memory.VerifySimulation) {
|
||||
}
|
||||
|
||||
func createSimulationId(projectId int32) string {
|
||||
// // 当前服务器IP + 端口 + 项目
|
||||
// return config.SimulationId_prefix + "_" + strconv.Itoa(config.Config.Server.Port) + "_" + strconv.Itoa(int(projectId))
|
||||
// MQTT客户端id+项目
|
||||
return mqtt.GetClientId() + "_" + strconv.Itoa(int(projectId))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user