Player 2.1 Upgrade

From The Player Project

Revision as of 07:22, 23 November 2009 by TraceLouac (Talk | contribs)
Jump to: navigation, search

cheap grand prix tickets monaco french translator car accident monopoly online game free breast cyst download free game voice city game birthday greeting card pga tour partners london budget accommodation online poker tournament smoke detector pregnancy calculation due date hotels london cheap travel inn hotel ny


Guide to upgrading from 2.0 to 2.1

General Changes

  • The player core (libplayercore, libplayerxdr, libplayertcp and the client libs) are now licensed under LGPL

Driver Upgrades

  • the player_pose_t type has been replaced with player_pose2d_t and player_pose3d_t. For geometries use the 3d pose and change pa to pyaw. If you really mean a 2d pose (i.e. a position 2d report) then use player_pose2d_t.
  • almost all of the static arrays in the player interfaces are now dynamically allocated. This means drivers need to allocate and clean up memory for the player_ structures that they create. It also means there are no more _MAX defines. Each player interface type now has 4 methods to aid in this. These are named after the type followed by _copy, _cleanup, _clone, _free. These perform deep copy and free operations on the data types ensuring you don't leak memory.
  • The signature for ProcessMessage now uses QueuePointer & queue instead of MessageQueue *, this is to allow for reference counting on the queues.
  • Publish no longer allows a NULL second parameter for a global publish, simply omit the second parameter to achieve this.
  • The following bash script will automate the Message Queue changes, its not perfect so feel free to post improvements. Run it with the source file as an argument and it will update it.

COUNT=`grep -c MessageQueue $1`
COUNT2=`grep -c "Publish[ 	]*[(][^,]*,[ 	]*NULL" $1`
if (( $COUNT + $COUNT2 > 0 ))
	echo backing up original in $1.pre.2.1
	cp $1 $1.pre2.1
	cat $1.pre2.1 | sed \
		-e "s/\(Publish[ ]*[(][ ]*[^,]*\),[ ]*NULL/\1/" \
		-e "s/MessageQueue[	 ]*\*[ 	]*/QueuePointer \&/" \
		> $1

Client Upgrades

  • Some proxies will reflect the pose change mentioned in the drivers above
  • Some proxies have been modified in small ways to accomodate the player interface array changes described above. Also it is even more important now to use the appropriate _create and _destroy methods which will clean up any dynamic memory allocated in the proxy.
Personal tools