Browse Source

RenX.Core:

* Players list is now erased when changing maps using non-seamless travel
* PLAYER "Exit;" event no longer has potential to create a PlayerInfo object
* Added translations for Communications Center
RenX.ServerList: Added levels list to browser.jsp
pull/3/head
Jessica James 8 years ago
parent
commit
f2c45afbbe
  1. BIN
      Release/Plugins/RenX.Core.lib
  2. 4
      RenX.Core/RenX_Functions.cpp
  3. 53
      RenX.Core/RenX_Server.cpp
  4. 30
      RenX.ServerList/RenX_ServerList.cpp

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

4
RenX.Core/RenX_Functions.cpp

@ -303,7 +303,9 @@ Jupiter::ReferenceString translated_Building_Obelisk_Internals = STRING_LITERAL_
/** Other structures */
Jupiter::ReferenceString translated_Building_Silo = STRING_LITERAL_AS_REFERENCE("Tiberium Silo");
Jupiter::ReferenceString translated_Building_CommCentre = STRING_LITERAL_AS_REFERENCE("Communications Center");
Jupiter::ReferenceString translated_Building_Silo_Internals = STRING_LITERAL_AS_REFERENCE("Tiberium Silo");
Jupiter::ReferenceString translated_Building_CommCentre_Internals = STRING_LITERAL_AS_REFERENCE("Communications Center");
/** Defences */
Jupiter::ReferenceString translated_Defence_GuardTower = STRING_LITERAL_AS_REFERENCE("Guard Tower");
@ -751,7 +753,9 @@ const Jupiter::ReferenceString RenX::translateName(const Jupiter::ReadableString
/** Other structures */
if (object.equals(STRING_LITERAL_AS_REFERENCE("Silo"))) return translated_Building_Silo;
if (object.equals(STRING_LITERAL_AS_REFERENCE("CommCentre"))) return translated_Building_CommCentre;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Silo_Internals"))) return translated_Building_Silo_Internals;
if (object.equals(STRING_LITERAL_AS_REFERENCE("CommCentre_Internals"))) return translated_Building_CommCentre_Internals;
}
else if (object.find(STRING_LITERAL_AS_REFERENCE("Defence_")) == 0)
{

53
RenX.Core/RenX_Server.cpp

@ -1380,22 +1380,27 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line)
player = n->data;
if (player != nullptr)
{
player->score = 0.0f;
player->credits = 0.0f;
player->kills = 0;
player->deaths = 0;
player->suicides = 0;
player->headshots = 0;
player->vehicleKills = 0;
player->buildingKills = 0;
player->defenceKills = 0;
player->beaconPlacements = 0;
player->beaconDisarms = 0;
player->proxy_placements = 0;
player->proxy_disarms = 0;
player->captures = 0;
player->steals = 0;
player->stolen = 0;
if (this->isSeamless())
{
player->score = 0.0f;
player->credits = 0.0f;
player->kills = 0;
player->deaths = 0;
player->suicides = 0;
player->headshots = 0;
player->vehicleKills = 0;
player->buildingKills = 0;
player->defenceKills = 0;
player->beaconPlacements = 0;
player->beaconDisarms = 0;
player->proxy_placements = 0;
player->proxy_disarms = 0;
player->captures = 0;
player->steals = 0;
player->stolen = 0;
}
else
this->removePlayer(player);
}
}
}
@ -2655,10 +2660,18 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line)
else if (subHeader.equals("Exit;"))
{
// Player
RenX::PlayerInfo *player = parseGetPlayerOrAdd(tokens.getToken(2));
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnPart(this, player);
this->removePlayer(player);
Jupiter::ReferenceString playerToken = tokens.getToken(2);
PARSE_PLAYER_DATA_P(playerToken);
RenX::PlayerInfo *player = getPlayer(id);
//RenX::PlayerInfo *player = parseGetPlayerOrAdd(tokens.getToken(2));
if (player != nullptr)
{
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnPart(this, player);
this->removePlayer(player);
}
if (this->gameover_when_empty && this->players.size() == this->bot_count)
this->gameover();

30
RenX.ServerList/RenX_ServerList.cpp

@ -254,13 +254,34 @@ Jupiter::StringS server_as_json(const RenX::Server *server)
Jupiter::StringS server_as_game(const RenX::Server *server)
{
Jupiter::String server_game_block(128);
Jupiter::String server_game_block(256);
Jupiter::String server_name = sanitize_game(server->getName());
Jupiter::String server_map = sanitize_game(server->getMap().name);
Jupiter::String server_version = sanitize_game(server->getGameVersion());
Jupiter::String server_levels;
server_game_block.format("\n<@>%.*s~%.*s~%u~%s~%.*s~" "%d;%d;%d;%s;%d;%d;%d;%s;%s;%s;%.*s;%s" "~%u~%d~%s~%s",
RenX::Map *map;
if (server->maps.size() != 0)
{
map = server->maps.get(0);
server_levels = sanitize_game(RenX::formatGUID(*map));
server_levels += '=';
server_levels += sanitize_game(map->name);
for (size_t index = 1; index != server->maps.size(); ++index)
{
map = server->maps.get(index);
server_levels += ';';
server_levels += sanitize_game(RenX::formatGUID(*map));
server_levels += '=';
server_levels += sanitize_game(map->name);
}
}
server_game_block.format("\n<@>%.*s~%.*s~%u~%s~%.*s~" "%d;%d;%d;%s;%d;%d;%d;%s;%s;%s;%.*s;%s" "~%u~%d~%s~%s~%.*s",
server_name.size(), server_name.ptr(),
server->getSocketHostname().size(), server->getSocketHostname().ptr(),
server->getPort(),
@ -282,8 +303,9 @@ Jupiter::StringS server_as_game(const RenX::Server *server)
//END OPTIONS
server->players.size() - server->getBotCount(),
server->getPlayerLimit(),
json_bool_as_cstring(server->isRanked()), // json_bool_as_cstring(plugin != nullptr && (reinterpret_cast<RenX_LadderPlugin *>(plugin)->isOnlyPure() == false || server->isPure())),
json_bool_as_cstring(server->isMatchInProgress()));
json_bool_as_cstring(server->isRanked()),
json_bool_as_cstring(server->isMatchInProgress()),
server_levels.size(), server_levels.ptr());
return server_game_block;
}

Loading…
Cancel
Save