mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 07:25:03 +01:00
parse host as FQDN or IP
This commit is contained in:
@@ -28,7 +28,7 @@ func encodeServerInfo(config *config.Config, s *Server) []byte {
|
||||
panic(err)
|
||||
}
|
||||
if si.IP == "" {
|
||||
si.IP = config.HostIP
|
||||
si.IP = config.Host
|
||||
}
|
||||
bf.WriteUint32(binary.LittleEndian.Uint32(net.ParseIP(si.IP).To4()))
|
||||
bf.WriteUint16(16 + uint16(serverIdx))
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
func serverList(s *Server, w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w,
|
||||
`<?xml version="1.0"?><server_groups><group idx='0' nam='Erupe' ip='%s' port="%d"/></server_groups>`,
|
||||
s.erupeConfig.HostIP,
|
||||
s.erupeConfig.Host,
|
||||
s.erupeConfig.Sign.Port,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func (s *Session) makeSignInResp(uid int) []byte {
|
||||
bf.WriteUint32(0xFFFFFFFF) // login_token_number
|
||||
bf.WriteBytes([]byte(token)) // login_token
|
||||
bf.WriteUint32(uint32(time.Now().Unix())) // current time
|
||||
ps.Uint8(bf, fmt.Sprintf("%s:%d", s.server.erupeConfig.HostIP, s.server.erupeConfig.Entrance.Port), false)
|
||||
ps.Uint8(bf, fmt.Sprintf("%s:%d", s.server.erupeConfig.Host, s.server.erupeConfig.Entrance.Port), false)
|
||||
|
||||
lastPlayed := uint32(0)
|
||||
for _, char := range chars {
|
||||
|
||||
Reference in New Issue
Block a user