timestamp fixes

This commit is contained in:
wish
2023-03-12 23:31:39 +11:00
parent ccfd2ac36f
commit 6aa075009e
3 changed files with 8 additions and 15 deletions

View File

@@ -1,14 +1,12 @@
package channelserver package channelserver
import ( import (
"fmt"
"io"
"time"
"erupe-ce/common/byteframe" "erupe-ce/common/byteframe"
"erupe-ce/common/stringsupport" "erupe-ce/common/stringsupport"
"erupe-ce/network/mhfpacket" "erupe-ce/network/mhfpacket"
"fmt"
"go.uber.org/zap" "go.uber.org/zap"
"io"
) )
func handleMsgMhfPostGuildScout(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfPostGuildScout(s *Session, p mhfpacket.MHFPacket) {
@@ -247,7 +245,7 @@ func handleMsgMhfGetGuildScoutList(s *Session, p mhfpacket.MHFPacket) {
bf.WriteUint32(charID) bf.WriteUint32(charID)
bf.WriteUint32(actorID) bf.WriteUint32(actorID)
bf.WriteUint32(charID) bf.WriteUint32(charID)
bf.WriteUint32(uint32(time.Now().Unix())) bf.WriteUint32(uint32(TimeAdjusted().Unix()))
bf.WriteUint16(0x00) // HR? bf.WriteUint16(0x00) // HR?
bf.WriteUint16(0x00) // GR? bf.WriteUint16(0x00) // GR?

View File

@@ -3,8 +3,6 @@ package channelserver
import ( import (
"sync" "sync"
"time"
"erupe-ce/common/byteframe" "erupe-ce/common/byteframe"
"erupe-ce/network/mhfpacket" "erupe-ce/network/mhfpacket"
) )
@@ -49,7 +47,6 @@ type Stage struct {
host *Session host *Session
maxPlayers uint16 maxPlayers uint16
password string password string
createdAt string
} }
// NewStage creates a new stage with intialized values. // NewStage creates a new stage with intialized values.
@@ -62,7 +59,6 @@ func NewStage(ID string) *Stage {
objectIndex: 0, objectIndex: 0,
rawBinaryData: make(map[stageBinaryKey][]byte), rawBinaryData: make(map[stageBinaryKey][]byte),
maxPlayers: 4, maxPlayers: 4,
createdAt: time.Now().Format("01-02-2006 15:04:05"),
} }
return s return s
} }

View File

@@ -9,7 +9,6 @@ import (
"fmt" "fmt"
"go.uber.org/zap" "go.uber.org/zap"
"strings" "strings"
"time"
) )
func makeSignInFailureResp(respID RespID) []byte { func makeSignInFailureResp(respID RespID) []byte {
@@ -39,10 +38,10 @@ func (s *Session) makeSignInResp(uid int) []byte {
bf.WriteUint8(0) bf.WriteUint8(0)
} }
bf.WriteUint8(1) // entrance server count bf.WriteUint8(1) // entrance server count
bf.WriteUint8(uint8(len(chars))) // character count bf.WriteUint8(uint8(len(chars)))
bf.WriteUint32(0xFFFFFFFF) // login_token_number bf.WriteUint32(0xFFFFFFFF) // login_token_number
bf.WriteBytes([]byte(sessToken)) // login_token bf.WriteBytes([]byte(sessToken))
bf.WriteUint32(uint32(time.Now().Unix())) // current time bf.WriteUint32(uint32(channelserver.TimeAdjusted().Unix()))
if s.server.erupeConfig.DevMode { if s.server.erupeConfig.DevMode {
if s.server.erupeConfig.PatchServerManifest != "" && s.server.erupeConfig.PatchServerFile != "" { if s.server.erupeConfig.PatchServerManifest != "" && s.server.erupeConfig.PatchServerFile != "" {
ps.Uint8(bf, s.server.erupeConfig.PatchServerManifest, false) ps.Uint8(bf, s.server.erupeConfig.PatchServerManifest, false)