Implement handlers for stage movement and quest completion

This commit is contained in:
Andrew Gutekanst
2020-02-22 22:20:29 -05:00
parent c505686893
commit 1d8eec2280
3 changed files with 124 additions and 12 deletions

View File

@@ -6,6 +6,7 @@ import (
"net"
"sync"
"github.com/Andoryuuta/Erupe/common/stringstack"
"github.com/Andoryuuta/Erupe/network"
"github.com/Andoryuuta/Erupe/network/mhfpacket"
"github.com/Andoryuuta/byteframe"
@@ -25,16 +26,20 @@ type Session struct {
stage *Stage
charID uint32
logKey []byte
// A stack containing the stage movement history (push on enter/move, pop on back)
stageMoveStack *stringstack.StringStack
}
// NewSession creates a new Session type.
func NewSession(server *Server, conn net.Conn) *Session {
s := &Session{
logger: server.logger.Named(conn.RemoteAddr().String()),
server: server,
rawConn: conn,
cryptConn: network.NewCryptConn(conn),
sendPackets: make(chan []byte, 20),
logger: server.logger.Named(conn.RemoteAddr().String()),
server: server,
rawConn: conn,
cryptConn: network.NewCryptConn(conn),
sendPackets: make(chan []byte, 20),
stageMoveStack: stringstack.New(),
}
return s
}