添加获取连接的接口,优化事件参数

This commit is contained in:
kercylan98
2023-05-05 17:01:42 +08:00
parent 32f28fb457
commit 30848faebc
2 changed files with 7 additions and 2 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ func init() {
Server.RegConnectionReceivePacketEvent(onConnectionReceivePacket)
}
func onConnectionReceivePacket(conn *server.Conn, packet []byte) {
func onConnectionReceivePacket(srv *server.Server, conn *server.Conn, packet []byte) {
player := Game.World.GetPlayerWithConnID(conn.GetID())
if player == nil {
return
@@ -31,7 +31,7 @@ func onConnectionClosed(player *Player) {
player.Close()
}
func onConnectionOpened(conn *server.Conn) {
func onConnectionOpened(srv *server.Server, conn *server.Conn) {
player := NewPlayer(sole.GetSync(), conn)
if err := Game.World.Join(player); err != nil {
panic(err)