* @brief Called by engine for single, called by ui for multi */
| 108 | * @brief Called by engine for single, called by ui for multi |
| 109 | */ |
| 110 | BOOL SNetCreateGame(const char *pszGameName, const char *pszGamePassword, const char *pszGameStatString, |
| 111 | DWORD dwGameType, char *GameTemplateData, int GameTemplateSize, int playerCount, |
| 112 | char *creatorName, char *a11, int *playerID) |
| 113 | { |
| 114 | if (GameTemplateSize != 8) |
| 115 | ABORT(); |
| 116 | net::buffer_t game_init_info(GameTemplateData, GameTemplateData + GameTemplateSize); |
| 117 | dvlnet_inst->setup_gameinfo(std::move(game_init_info)); |
| 118 | |
| 119 | char addrstr[129] = "0.0.0.0"; |
| 120 | getIniValue("dvlnet", "bindaddr", addrstr, 128); |
| 121 | strncpy(gpszGameName, addrstr, sizeof(gpszGameName) - 1); |
| 122 | if (pszGamePassword) |
| 123 | strncpy(gpszGamePassword, pszGamePassword, sizeof(gpszGamePassword) - 1); |
| 124 | *playerID = dvlnet_inst->create(addrstr, pszGamePassword); |
| 125 | return *playerID != -1; |
| 126 | } |
| 127 | |
| 128 | BOOL SNetJoinGame(int id, char *pszGameName, char *pszGamePassword, char *playerName, char *userStats, int *playerID) |
| 129 | { |
no test coverage detected