コード例 #1
0
// ------------------------------------------------------ //
//                     RECEIVE
// ------------------------------------------------------ //
func (c *Connection) ReceivePlayerWalk(_packet *pnet.Packet) {
	msg := pnetmsg.NewWalkMessage(c.Owner)
	msg.ReadPacket(_packet)

	g_game.OnPlayerMove(msg.Creature, msg.Direction, msg.SendMap)
}
コード例 #2
0
func (c *Connection) SendCreatureMove(_creature pul.ICreature, _from *Tile, _to *Tile) {
	msg := pnetmsg.NewWalkMessage(_creature)
	msg.AddPositions(_from.Position, _to.Position)
	c.SendMessage(msg)
}