2
0

test_multiplayer.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  3. gameid=minimal
  4. minetest=$dir/../bin/minetest
  5. testspath=$dir/../tests
  6. worldpath=$testspath/testworld_$gameid
  7. configpath=$testspath/configs
  8. logpath=$testspath/log
  9. conf_server=$configpath/minetest.conf.multi.server
  10. conf_client1=$configpath/minetest.conf.multi.client1
  11. conf_client2=$configpath/minetest.conf.multi.client2
  12. log_server=$logpath/server.log
  13. log_client1=$logpath/client1.log
  14. log_client2=$logpath/client2.log
  15. mkdir -p $worldpath
  16. mkdir -p $configpath
  17. mkdir -p $logpath
  18. echo -ne 'client1::shout,interact,settime,teleport,give
  19. client2::shout,interact,settime,teleport,give
  20. ' > $worldpath/auth.txt
  21. echo -ne '' > $conf_server
  22. echo -ne '# client 1 config
  23. screenW=500
  24. screenH=380
  25. name=client1
  26. viewing_range_nodes_min=10
  27. ' > $conf_client1
  28. echo -ne '# client 2 config
  29. screenW=500
  30. screenH=380
  31. name=client2
  32. viewing_range_nodes_min=10
  33. ' > $conf_client2
  34. echo $(sleep 1; $minetest --disable-unittests --logfile $log_client1 --config $conf_client1 --go --address localhost) &
  35. echo $(sleep 2; $minetest --disable-unittests --logfile $log_client2 --config $conf_client2 --go --address localhost) &
  36. $minetest --disable-unittests --server --logfile $log_server --config $conf_server --world $worldpath --gameid $gameid