2020-06-22 20:31:42 -04:00
|
|
|
package d2netpacket
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2020-06-29 17:01:26 -04:00
|
|
|
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2networking/d2netpacket/d2netpackettype"
|
2020-06-22 20:31:42 -04:00
|
|
|
)
|
|
|
|
|
2020-06-29 17:01:26 -04:00
|
|
|
// ServerClosedPacket contains the current time. It is sent by the server
|
|
|
|
// to inform a client that the server has shut down.
|
2020-06-22 20:31:42 -04:00
|
|
|
type ServerClosedPacket struct {
|
|
|
|
TS time.Time `json:"ts"`
|
|
|
|
}
|
|
|
|
|
2020-06-29 17:01:26 -04:00
|
|
|
// CreateServerClosedPacket returns a NetPacket which declares a
|
|
|
|
// ServerClosedPacket with the current time.
|
2020-06-22 20:31:42 -04:00
|
|
|
func CreateServerClosedPacket() NetPacket {
|
|
|
|
return NetPacket{
|
|
|
|
PacketType: d2netpackettype.ServerClosed,
|
|
|
|
PacketData: ServerClosedPacket{
|
|
|
|
TS: time.Now(),
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|