bug fix: disconnect when ignoring or mute, disrupt password connection force attempts; adds: whereami and go_to (useful for edit), logs about items (allowing the clips to be 3 cubes distant), and clean up

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5593 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-08-10 04:54:16 +00:00
parent 5c693f194f
commit 001baa1731
6 changed files with 53 additions and 23 deletions
+7
View File
@@ -597,6 +597,11 @@ docremark [Will be reset when you issue a 'recalc'. Only works in edit mode.];
docident [getentattr] [];
docident [getenttype] [];
docident [getmapmsg] [Returns the map message of the current map.];
docident [go_to] [teleport to some xy position when editing];
docargument [X] [x position] [] [0];
docargument [Y] [y position] [] [0];
docremark [managed to be used with whereami, only works at edit mode];
docexample [go_to 150 20] [];
docident [heightfield] [Marks the current selection as a heightfield.];
docargument [T] [an integer denoting the type] [0 (floor), 2 (ceiling)] [0];
docremark [marks the current selection as a heightfield, with T being floor or ceiling, as above. A surface marked as heightfield will use the vdelta values (see below) of its 4 corners to create a sloped surface. To mark a heightfield as normal again (ignoring vdelta values, set or not) use "solid 0". Default keys are h (floor) and i (ceiling).];
@@ -767,6 +772,8 @@ docident [waterlevel] [Sets the global water level for the map.];
docargument [H] [the water level] [integer] [0];
docremark [Every cube that has a lower floor than the water level will be rendered with a nice wavy water alpha texture. Water physics will be applied to any entity located below it.];
docremark [Performance notes: water is rendered for a whole square encapsulating all visible water areas in the map (try flying above the map in edit mode to see how). So the most efficient water is a single body of water, or multiple water areas that are mostly not visible from each other. Players can influence how accurate the water is rendered using the "watersubdiv" command (map config).];
docident [whereami] [Tells your position in the map];
docremark [managed to be used with go_to and check item positions];
docident [wpclear] [];
docident [wpflood] [];
docident [wpinfo] [makes waypoints visible and either turns on or off the waypoint information display.];
+15
View File
@@ -152,6 +152,19 @@ void modlanconnect()
connectserv_(NULL);
}
void whereami()
{
conoutf("you are at (%.2f,%.2f)",player1->o.x,player1->o.y);
}
void go_to(char *x, char *y)
{
if ( player1->state != CS_EDITING ) return;
player1->newpos.x=(float)atoi(x);
player1->newpos.y=(float)atoi(y);
conoutf("you are going to (%.2f,%.2f)",(float)atoi(x),(float)atoi(y));
}
void disconnect(int onlyclean, int async)
{
bool cleanup = onlyclean!=0;
@@ -260,6 +273,8 @@ COMMANDN(modconnect, modconnectserv, ARG_3STR);
COMMAND(modconnectadmin, ARG_3STR);
COMMAND(modlanconnect, ARG_NONE);
COMMANDN(disconnect, trydisconnect, ARG_NONE);
COMMAND(whereami, ARG_NONE);
COMMAND(go_to, ARG_2STR);
void cleanupclient()
{
+2 -2
View File
@@ -367,18 +367,18 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
{
playerent *d = getclient(getint(p));
if(d) d->lastvoicecom = lastmillis;
int t = getint(p);
if(!d || !(d->muted || d->ignored))
{
int t = getint(p);
if ( voicecomsounds == 1 || (voicecomsounds == 2 && m_teammode) ) audiomgr.playsound(t, SP_HIGH);
}
break;
}
case SV_VOICECOM:
{
int t = getint(p);
if(!d || !(d->muted || d->ignored))
{
int t = getint(p);
if ( voicecomsounds == 1 ) audiomgr.playsound(t, SP_HIGH);
}
if(d) d->lastvoicecom = lastmillis;
+5 -5
View File
@@ -736,19 +736,19 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat
bool menu = menuvisible();
bool command = getcurcommand() ? true : false;
if((p->state==CS_ALIVE || p->state==CS_EDITING) && !p->weaponsel->reloading)
{
bool drawteamwarning = crosshairteamsign && targetplayer && isteam(targetplayer->team, p->team) && targetplayer->state==CS_ALIVE;
p->weaponsel->renderaimhelp(drawteamwarning);
}
{
bool drawteamwarning = crosshairteamsign && targetplayer && isteam(targetplayer->team, p->team) && targetplayer->state==CS_ALIVE;
p->weaponsel->renderaimhelp(drawteamwarning);
}
drawdmgindicator();
if(p->state==CS_ALIVE && !hidehudequipment) drawequipicons(p);
if(/*!menu &&*/ (!hideradar || showmap)) drawradar(p, w, h);
if(!editmode)
{
glMatrixMode(GL_MODELVIEW);
if(/*!menu &&*/ (!hideradar || showmap)) drawradar(p, w, h);
if(!hideteam && m_teammode) drawteamicons(w, h);
glMatrixMode(GL_PROJECTION);
}
+13 -13
View File
@@ -64,7 +64,7 @@ bool mapisok(mapstats *ms)
short *q = &ms->entposs[j*3];
float r2 = 0;
loopk(3){ r2 += (p[k]-q[k])*(p[k]-q[k]); }
if ( r2 == 0.0f ) return false;
if ( r2 == 0.0f ) { logline(ACLOG_INFO, "Items too close %s %s (%hd,%hd)", entnames[v], entnames[w],p[0],p[1]); return false; }
r2 = 1/r2;
if (r2 < 0.0025f) continue;
if (w != v)
@@ -76,20 +76,20 @@ bool mapisok(mapstats *ms)
}
/* if (hdensity > 0.0f) { logline(ACLOG_INFO, "ITEM CHECK H %s %f", entnames[v], hdensity); }
if (density > 0.0f) { logline(ACLOG_INFO, "ITEM CHECK D %s %f", entnames[v], density); }*/
if ( hdensity > 0.5f ) return false;
if (v==I_HEALTH)
if ( hdensity > 0.5f ) { logline(ACLOG_INFO, "Items too close %s %.2f (%hd,%hd)", entnames[v],hdensity,p[0],p[1]); return false; }
switch(v)
{
if( density > 0.24f ) return false;
#define LOGTHISSWITCH(X) if( density > X ) { logline(ACLOG_INFO, "Items too close %s %.2f (%hd,%hd)", entnames[v],density,p[0],p[1]); return false; }
case I_CLIPS:
case I_HEALTH: LOGTHISSWITCH(0.24f); break;
case I_AMMO: LOGTHISSWITCH(0.04f); break;
case I_HELMET: LOGTHISSWITCH(0.02f); break;
case I_ARMOUR:
case I_GRENADE:
case I_AKIMBO: LOGTHISSWITCH(0.005f); break;
default: break;
#undef LOGTHISSWITCH
}
else if (v==I_GRENADE)
{
if( density > 0.005f ) return false;
}
else
{
if( density > 0.04f ) return false;
}
}
return Mheight < MAXMHEIGHT && (Mopen = checkarea(testlayout_factor, testlayout)) < MAXMAREA && FlagFlag > MINFF;
}
+11 -3
View File
@@ -696,16 +696,24 @@ struct serverpasswords : serverconfigfile
bool found = false;
if (address && passguy == address)
{
if (passtime + 1000 > servmillis || ( passtries > 10 && passtime + 10000 > servmillis ))
if (passtime + 3000 > servmillis || ( passtries > 5 && passtime + 10000 > servmillis ))
{
passtries++;
passtime = servmillis;
return false;
}
else
{
if ( passtime + 60000 < servmillis ) passtries = 0;
}
passtries++;
}
passtries = 0;
passtime = servmillis;
else
{
passtries = 0;
}
passguy = address;
passtime = servmillis;
loopv(adminpwds)
{
if(!strcmp(genpwdhash(name, adminpwds[i].pwd, salt), pwd))