2023-03-17 21:27:47 +00:00
|
|
|
package server
|
|
|
|
|
2023-03-22 05:30:58 +00:00
|
|
|
import "github.com/CPunch/gopenfusion/core/protocol"
|
2023-03-17 21:27:47 +00:00
|
|
|
|
2023-03-22 05:30:58 +00:00
|
|
|
func (server *ShardServer) RequestEnter(peer *protocol.CNPeer, pkt protocol.Packet) (retErr error) {
|
2023-03-18 21:40:20 +00:00
|
|
|
var enter protocol.SP_CL2FE_REQ_PC_ENTER
|
|
|
|
pkt.Decode(&enter)
|
|
|
|
|
2023-03-22 05:30:58 +00:00
|
|
|
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
|
2023-03-17 21:27:47 +00:00
|
|
|
return nil
|
|
|
|
}
|