Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 1 | #ifndef AOS_COMMON_NETWORK_TEAM_NUMBER_H_ |
| 2 | #define AOS_COMMON_NETWORK_TEAM_NUMBER_H_ |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | |
| 6 | namespace aos { |
| 7 | namespace network { |
| 8 | |
| 9 | // Retrieves the current team number based off of the network address. |
| 10 | // This function will only do the complicated stuff once so it is cheap to call |
| 11 | // repeatedly. |
| 12 | uint16_t GetTeamNumber(); |
| 13 | |
Brian Silverman | de0a53a | 2014-02-10 22:27:44 -0800 | [diff] [blame^] | 14 | // Overrides the team number returned from GetTeamNumber(). Must be called |
| 15 | // before GetTeamNumber() is ever called. |
| 16 | // Overriding to team 0 won't work. |
| 17 | // Intended only for tests. |
| 18 | void OverrideTeamNumber(uint16_t team); |
| 19 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 20 | } // namespace network |
| 21 | } // namespace aos |
| 22 | |
| 23 | #endif // AOS_COMMON_NETWORK_TEAM_NUMBER_H_ |