drawstring(tmp_in, tmp_str, duel_score_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
draw_endBoldFont();
+ tmp_in = tmp;
+ tmp_in.y += (duel_score_size.y - duel_name_fontsize.y) / 2;
+
+ // RJZ rank
+ int rank = entcs_GetRank(pl.sv_entnum);
+ string rank_str = "";
+ if(rank) {
+ rank_str = strcat("(", ftos(rank), ")");
+ if(invert)
+ tmp_in.x -= stringwidth_colors(rank_str, duel_name_fontsize) + duel_name_fontsize.x * 0.5;
+ else
+ tmp_in.x += duel_score_size.x + duel_name_fontsize.x * 0.5;
+
+ draw_beginBoldFont();
+ drawcolorcodedstring(tmp_in, rank_str, teamname_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+ draw_endBoldFont();
+ }
+
// Player name
tmp_str = Scoreboard_GetField(pl, SP_NAME);
- tmp_in = tmp;
if(invert)
tmp_in.x -= stringwidth_colors(tmp_str, duel_name_fontsize) + duel_name_fontsize.x * 0.5;
else
- tmp_in.x += duel_score_size.x + duel_name_fontsize.x * 0.5;
- tmp_in.y += (duel_score_size.y - duel_name_fontsize.y) / 2;
+ tmp_in.x += (rank ? stringwidth_colors(rank_str, duel_name_fontsize) : duel_score_size.x) + duel_name_fontsize.x * 0.5;
drawcolorcodedstring(tmp_in, tmp_str, duel_name_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
//LegendGuard adds a conditional sentence for country column 05-04-2021
drawfill(tmp, vec2(armor, armor_sz.y), autocvar_hud_progressbar_armor_color, 0.7, DRAWFLAG_NORMAL);
}
+ // Align vertically
+ tmp = pos;
+ tmp.y += ((teamscore_size.y / 2) - teamname_fontsize.y) / 2;
+ tmp.y += teamscore_size.y / 2;
+
+ // RJZ rank
+ int rank = entcs_GetRank(pl.sv_entnum);
+ string rank_str = "";
+ if(rank) {
+ rank_str = strcat("(", ftos(rank), ")");
+ if(invert)
+ tmp.x -= stringwidth_colors(rank_str, teamname_fontsize) + teamname_fontsize.x * 0.5;
+ else
+ tmp.x += teamscore_size.x + teamname_fontsize.x * 0.5;
+
+ draw_beginBoldFont();
+ drawcolorcodedstring(tmp, rank_str, teamname_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+ draw_endBoldFont();
+ }
+
// Player name
tmp_str = entcs_GetName(pl.sv_entnum);
- tmp = pos;
if(invert)
tmp.x -= stringwidth_colors(tmp_str, teamname_fontsize) + teamname_fontsize.x * 0.5;
else
- tmp.x += teamscore_size.x + teamname_fontsize.x * 0.5;
- tmp.y += ((teamscore_size.y / 2) - teamname_fontsize.y) / 2;
- tmp.y += teamscore_size.y / 2;
+ tmp.x += (rank ? stringwidth_colors(rank_str, teamname_fontsize) : teamscore_size.x) + teamname_fontsize.x * 0.5;
drawcolorcodedstring(tmp, tmp_str, teamname_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
}
.int team;
.int team_size;
.int countrycode;
+.int rank;
int binddb;
{ WriteByte(chan, ent.countrycode); },
{ ent.countrycode = ReadByte(); })
+ENTCS_PROP(RANK, true, rank, rank, ENTCS_SET_NORMAL,
+ { WriteByte(chan, ent.rank); },
+ { ent.rank = ReadByte(); })
+
// use sv_solid to avoid changing solidity state of entcs entities
ENTCS_PROP(SOLID, true, sv_solid, solid, ENTCS_SET_NORMAL,
{ WriteByte(chan, ent.sv_solid); },
entity e = entcs_receiver(i);
return e.countrycode;
}
+
+ int entcs_GetRank(int i)
+ {
+ entity e = entcs_receiver(i);
+ return e.rank;
+ }
/**
* @param i zero indexed player
else
CS(this).allowed_timeouts = autocvar_sv_timeout_number;
- if (autocvar_sv_eventlog)
+ if (autocvar_sv_eventlog) {
GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? GameLog_ProcessIP(this.netaddress) : "bot"), ":", playername(this.netname, this.team, false)));
+
+ /* z411 for RJZ */
+ if(autocvar_rjz_ranks) GameLogEcho(strcat(":idfp:", this.crypto_idfp));
+ }
CS(this).just_joined = true; // stop spamming the eventlog with additional lines when the client connects
ATTRIB(Client, team, int, this.team);
ATTRIB(Client, clientcolors, int, this.clientcolors);
ATTRIB(Client, countrycode, int, this.countrycode);
+ ATTRIB(Client, rank, int, this.rank);
/** Client IP */
ATTRIB(Client, netaddress, string, this.netaddress);
ATTRIB(Client, playermodel, string, this.playermodel);
.float lastkill;
.int countrycode;
.int killcount;
+.int rank;
//flood fields
.float nickspamtime; // time of last nick change
}
}
+void GameCommand_setrank(int request, int argc)
+{
+ switch (request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ entity client;
+ float accepted;
+
+ client = GetFilteredEntity(argv(1));
+ accepted = VerifyClientEntity(client, false, false);
+
+ if (accepted <= 0)
+ {
+ LOG_INFO("^1ERROR^7: Couldn't set player rank");
+ LOG_HELP("Usage:^3 sv_cmd setrank #client_id #rank");
+ return;
+ }
+
+ client.rank = stof(argv(2));
+ LOG_INFO("^2SUCCESS^7: Player rank set!");
+ return;
+ }
+ default:
+ LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_HELP("Usage:^3 sv_cmd setrank #client_id #rank");
+ return;
+ }
+ }
+}
+
void GameCommand_moveplayer(int request, int argc)
{
switch (request)
SERVER_COMMAND(resetmatch, "Soft restart the game without changing teams; goes back to warmup if enabled") { GameCommand_resetmatch(request); }
SERVER_COMMAND(setbots, "Adjust how many bots are in the match") { GameCommand_setbots(request, arguments); }
SERVER_COMMAND(setflag, "Set client flag") { GameCommand_setflag(request, arguments); }
+SERVER_COMMAND(setrank, "Set client rank") { GameCommand_setrank(request, arguments); }
SERVER_COMMAND(shuffleteams, "Randomly move players to different teams") { GameCommand_shuffleteams(request); }
SERVER_COMMAND(stuffto, "Send a command to be executed on a client") { GameCommand_stuffto(request, arguments); }
SERVER_COMMAND(teamname, "Set team name") { GameCommand_teamname(request, arguments); }
/* z411 for RJZ */
bool autocvar_rjz_count_shards = false;
+bool autocvar_rjz_ranks = false;
int total_shards = 0;
void send_TotalShards(entity to);
void send_TotalShardsAll();