Skip to content

Commit

Permalink
add LoopDelay config option
Browse files Browse the repository at this point in the history
  • Loading branch information
sekaiwish committed Oct 8, 2024
1 parent 436e30f commit 8191994
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"QuestCacheExpiry": 300,
"CommandPrefix": "!",
"AutoCreateAccount": true,
"LoopDelay": 50,
"DefaultCourses": [1, 23, 24],
"EarthStatus": 0,
"EarthID": 0,
Expand Down
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ type Config struct {
QuestCacheExpiry int // Number of seconds to keep quest data cached
CommandPrefix string // The prefix for commands
AutoCreateAccount bool // Automatically create accounts if they don't exist
LoopDelay int // Delay in milliseconds between each loop iteration
DefaultCourses []uint16
EarthStatus int32
EarthID int32
Expand Down
5 changes: 3 additions & 2 deletions server/channelserver/sys_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/binary"
"encoding/hex"
"erupe-ce/common/mhfcourse"
_config "erupe-ce/config"
"fmt"
"io"
"net"
Expand Down Expand Up @@ -169,7 +170,7 @@ func (s *Session) sendLoop() {
}
buffer = buffer[:0]
}
time.Sleep(100 * time.Millisecond)
time.Sleep(time.Duration(_config.ErupeConfig.LoopDelay) * time.Millisecond)
}
}

Expand All @@ -194,7 +195,7 @@ func (s *Session) recvLoop() {
return
}
s.handlePacketGroup(pkt)
time.Sleep(100 * time.Millisecond)
time.Sleep(time.Duration(_config.ErupeConfig.LoopDelay) * time.Millisecond)
}
}

Expand Down

0 comments on commit 8191994

Please sign in to comment.