whois check for admin role (some redundancy now), commenting the interesting but unused lss code (to avoid a annoying warning about '>' bool comparison), and transparency for vote icons (again, thanks for Kirin for the help)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5290 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-07-05 19:26:08 +00:00
parent 15e9274e27
commit 03a994ee9b
3 changed files with 18 additions and 15 deletions
+1 -1
View File
@@ -1104,7 +1104,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
int cn = getint(p);
playerent *pl = cn == getclientnum() ? player1 : getclient(cn);
int ip = getint(p);
if((ip>>24&0xFF) > 0) conoutf("WHOIS %2d: %-16s\t%d.%d.%d.%d", cn, pl ? colorname(pl) : "", ip&0xFF, ip>>8&0xFF, ip>>16&0xFF, ip>>24&0xFF); // full IP
if((ip>>24&0xFF) > 0 || player1->clientrole==CR_ADMIN) conoutf("WHOIS %2d: %-16s\t%d.%d.%d.%d", cn, pl ? colorname(pl) : "", ip&0xFF, ip>>8&0xFF, ip>>16&0xFF, ip>>24&0xFF); // full IP
else conoutf("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.%d.x", cn, pl ? colorname(pl) : "", ip&0xFF, ip>>8&0xFF, ip>>16&0xFF); // censored IP
break;
}
+13 -10
View File
@@ -7,7 +7,13 @@ void drawicon(Texture *tex, float x, float y, float s, int col, int row, float t
if(tex && tex->xs == tex->ys) quad(tex->id, x, y, s, ts*col, ts*row, ts);
}
VARP(equiptransparency, 0, 1, 1); // ft: 2010jun12 : seems it's not needed - the opaque/orig items.png works with it on or off - delete if no graphics guy has any objection
VARP(transparency, 0, 1, 1); // ft: 2010jun12 : seems it's not needed - the opaque/orig items.png works with it on or off - delete if no graphics guy has any objection
inline void turn_on_transparency()
{
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4ub(255, 255, 255, 255);
}
void drawequipicon(float x, float y, int col, int row, float blend)
{
@@ -15,14 +21,10 @@ void drawequipicon(float x, float y, int col, int row, float blend)
if(!tex) tex = textureload("packages/misc/items.png", 4);
if(tex)
{
if(blend||equiptransparency) glEnable(GL_BLEND);
if(equiptransparency)
{
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4ub(255, 255, 255, 255);
}
if(blend||transparency) glEnable(GL_BLEND);
if(transparency) turn_on_transparency();
drawicon(tex, x, y, 120, col, row, 1/4.0f);
if(blend||equiptransparency) glDisable(GL_BLEND);
if(blend||transparency) glDisable(GL_BLEND);
}
}
@@ -64,9 +66,10 @@ void drawvoteicon(float x, float y, int col, int row, bool noblend)
if(!tex) tex = textureload("packages/misc/voteicons.png", 3);
if(tex)
{
if(noblend) glDisable(GL_BLEND);
if(noblend||transparency) glDisable(GL_BLEND);
if(transparency) turn_on_transparency();
drawicon(tex, x, y, 240, col, row, 1/2.0f);
if(noblend) glEnable(GL_BLEND);
if(noblend||transparency) glEnable(GL_BLEND);
}
}
+4 -4
View File
@@ -1106,9 +1106,9 @@ void arenacheck()
}
//#define LMS_CLEARATROUNDSTART
#define LMS_ITEMMAXAGE 2
//#define LMS_ITEMMAXAGE 2
void lmscheck() // spawn random item class once per round
/*void lmscheck() // spawn random item class once per round
{
const int types[] = { I_CLIPS, I_AMMO, I_GRENADE, I_GRENADE, I_HEALTH, I_HELMET, I_ARMOUR, I_AKIMBO }, types_n = sizeof(types) / sizeof(types[0]); // double probability for grenades ;)
static bool cleared = false, announced = false, spawned = false;
@@ -1177,7 +1177,7 @@ void lmscheck() // spawn random item class once per round
}
spawned = true;
}
}
}*/
#define SPAMREPEATINTERVAL 20 // detect doubled lines only if interval < 20 seconds
#define SPAMMAXREPEAT 3 // 4th time is SPAM
@@ -1305,7 +1305,7 @@ bool serverpickup(int i, int sender) // server side item pickup, acknowl
client *cl = clients[sender];
if(cl->type==ST_TCPIP)
{
if(cl->state.state!=CS_ALIVE || !cl->state.canpickup(e.type) || ( m_arena && !free_items(sender) ) ) return false;
if( cl->state.state!=CS_ALIVE || !cl->state.canpickup(e.type) || ( m_arena && !free_items(sender) ) ) return false;
vec v(e.x, e.y, cl->state.o.z);
float dist = cl->state.o.dist(v);
if(dist > 10 && !m_demo) // <2.5 would be normal, LAG may increase the value