Opened 2 years ago

Closed 2 years ago

#123 closed enhancement (fixed)

Make sure that AllTypeInfos list in GameImpl.cpp is complete

Reported by: Carsten Owned by:
Priority: high Milestone:
Component: other Version: svn-head
Keywords: Cc:
Platform:

Description

As described at http://www.cafu.de/forum/viewtopic.php?f=8&t=1046&start=30, right now it's all too easy to add a new entity and to accidentally not add it to the AllTypeInfos list in http://trac.cafu.de/browser/cafu/trunk/Games/DeathMatch/Code/GameImpl.cpp#L96

The situation could be improved either

  • by generating the AllTypeInfos list automatically in the build script (where it however might be difficult to figure out the list of entities that should be added to the list), or
  • by brute-force testing all entities defined in EntityClassDefs.lua if they have a proper C++ class in the type manager (this test would be done only in debug builds), and if they haven't, fail loudly and explain the issue.

Change History (1)

comment:1 Changed 2 years ago by Carsten

  • Resolution set to fixed
  • Status changed from new to closed

(In [682]) Server: Loudly complain if type info for C++ entity class is not found.

Before this change, when a developer added a new C++ entity class and forgot to update the AllTypeInfos[] list in GameImpl.cpp, only a warning message was printed to the console that did not easily catch the attention of the developer.
We now show an explicit dialog box that prominently indicates the problem and suggests the likely solution.

Fixes #123.

Note: See TracTickets for help on using tickets.