|
@@ -305,24 +305,26 @@ void ClientNetworkGameSocketHandler::Cli
|
|
|
ClientNetworkGameSocketHandler * ClientNetworkGameSocketHandler::my_client = nullptr;
|
|
|
|
|
|
/** Last frame we performed an ack. */
|
|
|
static uint32 last_ack_frame;
|
|
|
|
|
|
/** One bit of 'entropy' used to generate a salt for the company passwords. */
|
|
|
static uint32 _password_game_seed;
|
|
|
/** The other bit of 'entropy' used to generate a salt for the company passwords. */
|
|
|
static std::string _password_server_id;
|
|
|
|
|
|
/** Maximum number of companies of the currently joined server. */
|
|
|
static uint8 _network_server_max_companies;
|
|
|
/** The current name of the server you are on. */
|
|
|
std::string _network_server_name;
|
|
|
|
|
|
/** Information about the game to join to. */
|
|
|
NetworkJoinInfo _network_join;
|
|
|
|
|
|
/** Make sure the server ID length is the same as a md5 hash. */
|
|
|
static_assert(NETWORK_SERVER_ID_LENGTH == 16 * 2 + 1);
|
|
|
|
|
|
/***********
|
|
|
* Sending functions
|
|
|
* DEF_CLIENT_SEND_COMMAND has no parameters
|
|
|
************/
|
|
|
|
|
@@ -1178,24 +1180,25 @@ NetworkRecvStatus ClientNetworkGameSocke
|
|
|
if (client_id == _network_own_client_id) {
|
|
|
SetLocalCompany(company_id);
|
|
|
}
|
|
|
|
|
|
return NETWORK_RECV_STATUS_OKAY;
|
|
|
}
|
|
|
|
|
|
NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_CONFIG_UPDATE(Packet *p)
|
|
|
{
|
|
|
if (this->status < STATUS_ACTIVE) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
|
|
|
|
|
|
_network_server_max_companies = p->Recv_uint8();
|
|
|
_network_server_name = p->Recv_string(NETWORK_NAME_LENGTH);
|
|
|
|
|
|
return NETWORK_RECV_STATUS_OKAY;
|
|
|
}
|
|
|
|
|
|
NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_COMPANY_UPDATE(Packet *p)
|
|
|
{
|
|
|
if (this->status < STATUS_ACTIVE) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
|
|
|
|
|
|
_network_company_passworded = p->Recv_uint16();
|
|
|
SetWindowClassesDirty(WC_COMPANY);
|
|
|
|
|
|
return NETWORK_RECV_STATUS_OKAY;
|