mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-15 08:25:09 +01:00
objects v3.1
This commit is contained in:
@@ -3,7 +3,6 @@ BEGIN;
|
|||||||
CREATE TABLE user_binaries
|
CREATE TABLE user_binaries
|
||||||
(
|
(
|
||||||
id int PRIMARY KEY,
|
id int PRIMARY KEY,
|
||||||
type1 bytea,
|
|
||||||
type2 bytea,
|
type2 bytea,
|
||||||
type3 bytea
|
type3 bytea
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ func handleMsgSysTerminalLog(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
|
|
||||||
func handleMsgSysLogin(s *Session, p mhfpacket.MHFPacket) {
|
func handleMsgSysLogin(s *Session, p mhfpacket.MHFPacket) {
|
||||||
pkt := p.(*mhfpacket.MsgSysLogin)
|
pkt := p.(*mhfpacket.MsgSysLogin)
|
||||||
name := ""
|
|
||||||
|
|
||||||
rights := uint32(0x0E)
|
rights := uint32(0x0E)
|
||||||
// 0e with normal sub 4e when having premium
|
// 0e with normal sub 4e when having premium
|
||||||
@@ -150,9 +149,7 @@ func handleMsgSysLogin(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.server.db.QueryRow("SELECT name FROM characters WHERE id = $1", pkt.CharID0).Scan(&name)
|
|
||||||
s.Lock()
|
s.Lock()
|
||||||
s.Name = name
|
|
||||||
s.charID = pkt.CharID0
|
s.charID = pkt.CharID0
|
||||||
s.rights = rights
|
s.rights = rights
|
||||||
s.token = pkt.LoginTokenString
|
s.token = pkt.LoginTokenString
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ package channelserver
|
|||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"erupe-ce/common/stringsupport"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@@ -308,6 +310,18 @@ func handleMsgMhfLoaddata(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
s.logger.Fatal("Failed to get savedata from db", zap.Error(err))
|
s.logger.Fatal("Failed to get savedata from db", zap.Error(err))
|
||||||
}
|
}
|
||||||
doAckBufSucceed(s, pkt.AckHandle, data)
|
doAckBufSucceed(s, pkt.AckHandle, data)
|
||||||
|
|
||||||
|
decompSaveData, err := nullcomp.Decompress(data)
|
||||||
|
if err != nil {
|
||||||
|
s.logger.Error("Failed to decompress savedata", zap.Error(err))
|
||||||
|
}
|
||||||
|
bf := byteframe.NewByteFrameFromBytes(decompSaveData)
|
||||||
|
bf.Seek(88, io.SeekStart)
|
||||||
|
binary1 := bf.ReadNullTerminatedBytes()
|
||||||
|
s.server.userBinaryPartsLock.Lock()
|
||||||
|
s.server.userBinaryParts[userBinaryPartID{charID: s.charID, index: 1}] = append(binary1, []byte{0x00}...)
|
||||||
|
s.server.userBinaryPartsLock.Unlock()
|
||||||
|
s.Name = stringsupport.SJISToUTF8(binary1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleMsgMhfSaveScenarioData(s *Session, p mhfpacket.MHFPacket) {
|
func handleMsgMhfSaveScenarioData(s *Session, p mhfpacket.MHFPacket) {
|
||||||
|
|||||||
Reference in New Issue
Block a user