diff -r 45d0233e7d79 -r 187e3ef04cc9 src/network/network.cpp --- a/src/network/network.cpp Sat Mar 03 20:33:32 2007 +0000 +++ b/src/network/network.cpp Sun Mar 04 04:25:36 2007 +0000 @@ -1421,4 +1421,17 @@ NetworkCoreShutdown(); } +/** + * Checks whether the given version string is compatible with our version. + * It'll check the first NETWORK_REVISION_LENGTH - 1 characters (-1 for '\0') + * against the current version and the NOREV_STRING. + * @param other the version string to compare to + */ +bool IsNetworkCompatibleVersion(const char *other) +{ + extern const char _openttd_revision[]; + return strncmp(NOREV_STRING, other, NETWORK_REVISION_LENGTH - 1) == 0 || + strncmp(_openttd_revision, other, NETWORK_REVISION_LENGTH - 1) == 0; +} + #endif /* ENABLE_NETWORK */