major refactoring; started DB

- DB work has started in db. this will be a direct port of the OpenFusion DB format.
- LoginServer is now less of a dummy. You can create and login to accounts, and create a character to go through the tutorial with.
- config.go will host some commonly changed variables.
- protocol: fixed a bug relating to arrays being ignored while encoding packets
This commit is contained in:
2023-03-09 01:48:13 -06:00
parent 1fff485f93
commit 8569225ec7
16 changed files with 947 additions and 89 deletions

28
util/player.go Normal file
View File

@@ -0,0 +1,28 @@
package util
import (
"github.com/CPunch/GopenFusion/db"
"github.com/CPunch/GopenFusion/protocol"
)
func Player2PCStyle(plr *db.Player) (protocol.SPCStyle, protocol.SPCStyle2) {
return protocol.SPCStyle{
IPC_UID: int64(plr.PlayerID),
INameCheck: int8(plr.NameCheck),
SzFirstName: plr.FirstName,
SzLastName: plr.LastName,
IGender: int8(plr.Gender),
IFaceStyle: int8(plr.FaceStyle),
IHairStyle: int8(plr.HairStyle),
IHairColor: int8(plr.HairColor),
ISkinColor: int8(plr.SkinColor),
IEyeColor: int8(plr.EyeColor),
IHeight: int8(plr.Height),
IBody: int8(plr.Body),
},
protocol.SPCStyle2{
IAppearanceFlag: int8(plr.AppearanceFlag),
ITutorialFlag: int8(plr.TutorialFlag),
IPayzoneFlag: int8(plr.PayZoneFlag),
}
}