mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 15:04:38 +01:00
add LoopDelay config option
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
"QuestCacheExpiry": 300,
|
"QuestCacheExpiry": 300,
|
||||||
"CommandPrefix": "!",
|
"CommandPrefix": "!",
|
||||||
"AutoCreateAccount": true,
|
"AutoCreateAccount": true,
|
||||||
|
"LoopDelay": 50,
|
||||||
"DefaultCourses": [1, 23, 24],
|
"DefaultCourses": [1, 23, 24],
|
||||||
"EarthStatus": 0,
|
"EarthStatus": 0,
|
||||||
"EarthID": 0,
|
"EarthID": 0,
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ type Config struct {
|
|||||||
QuestCacheExpiry int // Number of seconds to keep quest data cached
|
QuestCacheExpiry int // Number of seconds to keep quest data cached
|
||||||
CommandPrefix string // The prefix for commands
|
CommandPrefix string // The prefix for commands
|
||||||
AutoCreateAccount bool // Automatically create accounts if they don't exist
|
AutoCreateAccount bool // Automatically create accounts if they don't exist
|
||||||
|
LoopDelay int // Delay in milliseconds between each loop iteration
|
||||||
DefaultCourses []uint16
|
DefaultCourses []uint16
|
||||||
EarthStatus int32
|
EarthStatus int32
|
||||||
EarthID int32
|
EarthID int32
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"erupe-ce/common/mhfcourse"
|
"erupe-ce/common/mhfcourse"
|
||||||
|
_config "erupe-ce/config"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
@@ -169,7 +170,7 @@ func (s *Session) sendLoop() {
|
|||||||
}
|
}
|
||||||
buffer = buffer[:0]
|
buffer = buffer[:0]
|
||||||
}
|
}
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(time.Duration(_config.ErupeConfig.LoopDelay) * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,7 +195,7 @@ func (s *Session) recvLoop() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
s.handlePacketGroup(pkt)
|
s.handlePacketGroup(pkt)
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(time.Duration(_config.ErupeConfig.LoopDelay) * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user