Skip to content

Error prone code with GameMessage::getArgument #586

Open
@xezon

Description

@xezon

GameMessageArgumentType's are pushed into a GameMessage. The producer can push anything and the consumer can access anything without any checking. If there is a single thing out of sync while the consumer makes assumptions, then this can be catastrophic. It would be good to make this more robust.

Producer functions:

	void appendIntegerArgument( Int arg );
	void appendRealArgument( Real arg );
	void appendBooleanArgument( Bool arg );
	void appendDrawableIDArgument( DrawableID arg );
	void appendObjectIDArgument( ObjectID arg );
	void appendTeamIDArgument( UnsignedInt arg );
	void appendLocationArgument( const Coord3D& arg );
	void appendPixelArgument( const ICoord2D& arg );
	void appendPixelRegionArgument( const IRegion2D& arg );
	void appendWideCharArgument( const WideChar& arg );

Consumer functions:

	const GameMessageArgumentType *getArgument( Int argIndex ) const;
	GameMessageArgumentDataType getArgumentDataType( Int argIndex );

Metadata

Metadata

Assignees

No one assigned

    Labels

    DebugIs mostly debug functionalityInvestigateMinorSeverity: Minor < Major < Critical < Blocker

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions