mirror of
https://github.com/CPunch/gopenfusion.git
synced 2024-11-14 03:50:05 +00:00
CPunch
5b2a8b838e
- misc. cleanup - core/db/players.go: works with core.Player types, will also grab inventory table
26 lines
717 B
Go
26 lines
717 B
Go
package server
|
|
|
|
import "github.com/CPunch/gopenfusion/core/protocol"
|
|
|
|
func (server *ShardServer) RequestEnter(peer *protocol.CNPeer, pkt protocol.Packet) (retErr error) {
|
|
var enter protocol.SP_CL2FE_REQ_PC_ENTER
|
|
pkt.Decode(&enter)
|
|
|
|
loginData, err := server.CheckLogin(enter.IEnterSerialKey)
|
|
if err != nil {
|
|
// the error codes for P_FE2CL_REP_PC_ENTER_FAIL aren't referenced in the client :(
|
|
peer.Send(protocol.P_FE2CL_REP_PC_ENTER_FAIL, protocol.SP_FE2CL_REP_PC_ENTER_FAIL{})
|
|
return err
|
|
}
|
|
|
|
plr, err := server.dbHndlr.GetPlayer(int(loginData.PlayerID))
|
|
if err != nil {
|
|
peer.Send(protocol.P_FE2CL_REP_PC_ENTER_FAIL, protocol.SP_FE2CL_REP_PC_ENTER_FAIL{})
|
|
return err
|
|
}
|
|
|
|
// TODO
|
|
_ = plr
|
|
return nil
|
|
}
|