# HG changeset patch # User Medo # Date 1345306117 -7200 # Node ID 57d343ee382f407247e4222e0eca21e821a7c115 # Parent 09a44c8fbfbad1d3b83de78a07acffb9c06626a0 frontlib: Return more filled-in team objects diff -r 09a44c8fbfba -r 57d343ee382f project_files/frontlib/hwconsts.h --- a/project_files/frontlib/hwconsts.h Sat Aug 18 13:45:00 2012 +0200 +++ b/project_files/frontlib/hwconsts.h Sat Aug 18 18:08:37 2012 +0200 @@ -34,6 +34,9 @@ #include #define HEDGEHOGS_PER_TEAM 8 +#define DEFAULT_HEDGEHOG_COUNT 4 +#define DEFAULT_COLOR_INDEX 0 + #define NETGAME_DEFAULT_PORT 46631 #define PROTOCOL_VERSION 42 #define MIN_SERVER_VERSION 1 diff -r 09a44c8fbfba -r 57d343ee382f project_files/frontlib/net/netconn.c --- a/project_files/frontlib/net/netconn.c Sat Aug 18 13:45:00 2012 +0200 +++ b/project_files/frontlib/net/netconn.c Sat Aug 18 18:08:37 2012 +0200 @@ -333,7 +333,6 @@ conn->onDisconnectedCb(conn->onDisconnectedCtx, NETCONN_DISCONNECT_INTERNAL_ERROR, "Internal error"); exit = true; } else { - team->remoteDriven = true; conn->onTeamAddCb(conn->onTeamAddCtx, team); } } diff -r 09a44c8fbfba -r 57d343ee382f project_files/frontlib/net/netprotocol.c --- a/project_files/frontlib/net/netprotocol.c Sat Aug 18 13:45:00 2012 +0200 +++ b/project_files/frontlib/net/netprotocol.c Sat Aug 18 18:08:37 2012 +0200 @@ -57,6 +57,11 @@ return -1; } } + + // Set some default assumptions as well + team->colorIndex = DEFAULT_COLOR_INDEX; + team->hogsInGame = DEFAULT_HEDGEHOG_COUNT; + team->remoteDriven = true; return 0; }