예제 #1
0
func OnPlayerMove(_player interfaces.IPlayer, _direction uint16) {
	basePosition := _player.GetPosition()
	retValue := internalCreatureMove(_player, _direction)
	if retValue == world.RET_NOTPOSSIBLE {
		// Send current position to client, so position is synced
		_player.Walk(basePosition, position.ZP, false, _direction)
	}
}
예제 #2
0
func (cw *ConnectionWrapper) AssignToPlayer(_player interfaces.IPlayer) {
	if _player == nil {
		panic("ConnectionWrapper - Player interface can not be nil")
	}

	cw.player = _player
	_player.SetNetworkChans(cw.rxChan, cw.txChan)
}