Skip to content

Error prone code with GameMessage::getArgument #586

Open

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 );

Activity

  1. added
    DebugIs mostly debug functionality
    MinorSeverity: Minor < Major < Critical < Blocker
    on Apr 3, 2025
  2. added theissue type on Apr 3, 2025
  3. added this to the Stability fixes milestone on Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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