*/
void Host_Status_f (void)
{
+ const char *protocolname;
client_t *client;
int seconds, minutes, hours = 0, j, players;
void (*print) (const char *fmt, ...);
players++;
print ("host: %s\n", Cvar_VariableString ("hostname"));
print ("version: %s build %s\n", gamename, buildstring);
+ switch(sv.protocol)
+ {
+ case PROTOCOL_QUAKE: protocolname = sv.netquakecompatible ? "QUAKE" : "QUAKEDP";break;
+ case PROTOCOL_DARKPLACES1: protocolname = "PROTOCOL_DARKPLACES1";break;
+ case PROTOCOL_DARKPLACES2: protocolname = "PROTOCOL_DARKPLACES2";break;
+ case PROTOCOL_DARKPLACES3: protocolname = "PROTOCOL_DARKPLACES3";break;
+ case PROTOCOL_DARKPLACES4: protocolname = "PROTOCOL_DARKPLACES4";break;
+ case PROTOCOL_DARKPLACES5: protocolname = "PROTOCOL_DARKPLACES5";break;
+ default: protocolname = "PROTOCOL_UNKNOWN";break;
+ }
+ print ("protocol: %i (%s)\n", sv.protocol, protocolname);
print ("map: %s\n", sv.name);
print ("players: %i active (%i max)\n\n", players, svs.maxclients);
for (j = 0, client = svs.clients;j < svs.maxclients;j++, client++)
cvar_t cl_name = {CVAR_SAVE, "_cl_name", "player"};
void Host_Name_f (void)
{
+ int i, j;
char newName[sizeof(host_client->name)];
if (Cmd_Argc () == 1)
else
strlcpy (newName, Cmd_Args(), sizeof (newName));
+ for (i = 0, j = 0;newName[i];i++)
+ if (newName[i] != '\r' && newName[i] != '\n')
+ newName[j++] = newName[i];
+ newName[j] = 0;
+
if (cmd_source == src_command)
{
Cvar_Set ("_cl_name", newName);
}
cvar_t cl_rate = {CVAR_SAVE, "_cl_rate", "10000"};
-cvar_t sv_maxrate = {CVAR_SAVE | CVAR_NOTIFY, "sv_maxrate", "10000"};
void Host_Rate_f(void)
{
- int rate, maxrate;
+ int rate;
if (Cmd_Argc() != 2)
{
return;
}
- maxrate = bound(NET_MINRATE, sv_maxrate.integer, NET_MAXRATE);
- if (sv_maxrate.integer != maxrate)
- Cvar_SetValueQuick(&sv_maxrate, maxrate);
-
- if (LHNETADDRESS_GetAddressType(&host_client->netconnection->peeraddress) != LHNETADDRESSTYPE_LOOP)
- host_client->netconnection->rate = bound(NET_MINRATE, rate, maxrate);
+ host_client->netconnection->rate = rate;
}
/*
// and it won't happen if the game was just loaded, so you wind up
// with a permanent head tilt
MSG_WriteByte (&host_client->message, svc_setangle);
- for (i=0 ; i < 2 ; i++)
- MSG_WriteAngle (&host_client->message, sv_player->v->angles[i] );
- MSG_WriteAngle (&host_client->message, 0 );
+ if (sv.protocol == PROTOCOL_DARKPLACES5)
+ {
+ MSG_WriteAngle16i (&host_client->message, sv_player->v->angles[0]);
+ MSG_WriteAngle16i (&host_client->message, sv_player->v->angles[1]);
+ MSG_WriteAngle16i (&host_client->message, 0);
+ }
+ else
+ {
+ MSG_WriteAngle8i (&host_client->message, sv_player->v->angles[0]);
+ MSG_WriteAngle8i (&host_client->message, sv_player->v->angles[1]);
+ MSG_WriteAngle8i (&host_client->message, 0);
+ }
SV_WriteClientdataToMessage (sv_player, &host_client->message);
Cmd_AddCommand ("color", Host_Color_f);
Cvar_RegisterVariable (&cl_rate);
Cmd_AddCommand ("rate", Host_Rate_f);
- Cvar_RegisterVariable (&sv_maxrate);
if (gamemode == GAME_NEHAHRA)
{
Cvar_RegisterVariable (&cl_pmodel);