Commit 3ae395a3 authored by progs's avatar progs

backport bugfixes


git-svn-id: svn://svn.gna.org/svn/menareants/branches/stable@966 6832cf7c-ce15-0410-9f4e-c008ec2580bf
parent bd4a63a4
......@@ -56,10 +56,10 @@ static void list_servers(struct Client* cl)
struct Server* s = server_head;
for(; s; s = s->next)
{
sendrpl(cl, MSG_SERVLIST, "%s:%d %s %c %d %d %d %d %d %d %s %d %d %ld", s->client->ip, s->port ? s->port : SERV_DEFPORT, s->name,
sendrpl(cl, MSG_SERVLIST, "%s:%d %s %c %d %d %d %d %d %d %s %d %d %ld %d", s->client->ip, s->port ? s->port : SERV_DEFPORT, s->name,
((s->nb_games - s->nb_wait_games) >= s->max_games || s->nb_players >= s->max_players) ? '-' : '+',
s->nb_players, s->max_players, s->nb_games, s->max_games, s->nb_wait_games, s->proto, FormatStr(s->version),
s->tot_users, s->tot_games, s->uptime);
s->tot_users, s->tot_games, s->uptime, (s->client->flags & CL_LOGGED) ? 1 : 0);
if(cl->proto >= 2)
{
unsigned i;
......
......@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: CheckBox.h 907 2007-02-13 19:46:20Z progs $
* $Id$
*/
#include <stdio.h>
......@@ -175,6 +175,7 @@ static struct ConfigTab *get_tab(const char *item)
static int readconf (FILE* fp)
{
int line = 0;
int error = 1;
char buf[512], vreason[CF_REASONLEN + 1];
struct ConfigTab* section = 0;
......@@ -193,12 +194,14 @@ static int readconf (FILE* fp)
if(!(section = get_tab(ptr)))
{
printf("conf(%d): Unknown section '%s'\n", line, ptr);
error = -1;
continue;
}
if((section->flags & CONF_READ) && !(section->flags & CONF_CLONE))
{
printf("conf(%d): Section '%s' is already read\n", line, ptr);
section = 0;
error = -1;
continue;
}
section->flags |= CONF_READ;
......@@ -213,11 +216,13 @@ static int readconf (FILE* fp)
if(!item)
{
printf("conf(%d): Unknown item '%s'\n", line, label);
error = -1;
continue;
}
if(!*ptr)
{
printf("conf(%d): There isn't any value\n", line);
error = -1;
continue;
}
const char* value = strtok(NULL, "=\r\n");
......@@ -225,6 +230,7 @@ static int readconf (FILE* fp)
if(!value || !*value)
{
printf("conf(%d): There isn't any value\n", line);
error = -1;
continue;
}
......@@ -262,6 +268,7 @@ static int readconf (FILE* fp)
if(!section)
{
printf("conf(%d): a '}' out of a section !?\n", line);
error = -1;
continue;
}
......@@ -275,7 +282,7 @@ static int readconf (FILE* fp)
return -1;
}
return 1;
return error;
}
int load_config(const char* path)
......
......@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: CheckBox.h 907 2007-02-13 19:46:20Z progs $
* $Id$
*/
#ifndef ECMS_config_h
......
......@@ -81,8 +81,6 @@ int sendbuf(struct Client* cl, char* buf, int len)
buf[len++] = '\n';
buf[len] = 0;
printf("S - %s\n", buf);
send(cl->fd, buf, len, 0);
return 0;
......@@ -92,8 +90,6 @@ int senderr(struct Client* cl, enum ECError err)
{
char buf[] = {(char)MSG_ERROR, ' ', (char)err, '\r', '\n', '\0' };
printf("S - %s\n", buf);
send(cl->fd, buf, 5, 0);
return 0;
......@@ -103,8 +99,6 @@ int sendcmd(struct Client* cl, enum ECMessage cmd)
{
char buf[] = {(char)cmd, '\r', '\n', '\0' };
printf("S - %s\n", buf);
send(cl->fd, buf, 3, 0);
return 0;
......
......@@ -128,7 +128,7 @@ static void send_stats(TClient *cl)
args += TypToStr(app.NBachan);
args += TypToStr(app.NBtotchan);
args += TypToStr(app.Uptime());
args += "MenAreAnts Daemon v" APP_VERSION " P" APP_PVERSION
args += "MenAreAnts Daemon v" APP_VERSION
" (c) Romain Bignon (Build #" GENERATION " " __DATE__ " " __TIME__ ")";
cl->sendrpl(MSG_STAT, args);
}
......
......@@ -1036,6 +1036,7 @@ int JOICommand::Exec(PlayerList players, EC_Client *me, ParvList parv)
GameInfosForm->RecalcMemo();
pline->couleur->SetEnabled(false);
pline->nation->SetEnabled(false);
GameInfosForm->RefreshPositions();
if(me->Player()->IsOwner())
pline->Nick->SetHint(StringF(_("Clic on his nickname to kick %s"), pl->GetNick()));
}
......@@ -1497,6 +1498,8 @@ void TGameInfosForm::RefreshPositions()
ECPlayer* pl = pll->Player();
pll->Pos->SetCaption(TypToStr(i));
if(pl->Position())
{
TButtonText* bt = Positions[pl->Position()-1];
......@@ -1546,7 +1549,7 @@ void TGameInfosForm::MapSetted()
TButtonText* bt = AddComponent(new TButtonText(Preview->X() + (begin_x+max_x)/2 * map->PixelSize(),
Preview->Y() + (begin_y+max_y)/2 * map->PixelSize(),
150,50, "", Font::GetInstance(Font::Normal), black_color));
bt->SetImage(new ECSprite(Resources::CheckBox(), Window()));
bt->SetImage(new ECSprite(Resources::RadioButton(), Window()));
bt->SetAlwaysRedraw();
Positions.push_back(bt);
}
......@@ -1635,10 +1638,12 @@ TPlayerLine::TPlayerLine(ECPlayer *_pl)
Ready = 0;
Nick = 0;
Status = 0;
Pos = 0;
}
TPlayerLine::~TPlayerLine()
{
delete Pos;
delete nation;
delete couleur;
delete Ready;
......@@ -1654,6 +1659,7 @@ void TPlayerLine::SetXY (int px, int py)
if(nation) nation->SetXY(px+395, py);
if(Ready) Ready->SetXY(px, py);
if(Pos) Ready->SetXY(px+75, py+10);
if(Status) Status->SetXY(px+85, py);
if(Nick) Nick->SetXY(px+105, py);
}
......@@ -1672,6 +1678,7 @@ bool TPlayerLine::Test (const Point2i& mouse, int button) const
void TPlayerLine::Init()
{
assert(pl);
delete Pos;
delete couleur;
delete nation;
delete Ready;
......@@ -1684,10 +1691,12 @@ void TPlayerLine::Init()
nation = new TComboBox(Font::GetInstance(Font::Small), X()+395, Y(), 120);
MyComponent(nation);
Pos = new TLabel(X()+75, Y()+10, " ", white_color, Font::GetInstance(Font::Normal));
Ready = new TLabel(X(), Y(), "OK", gray_color, Font::GetInstance(Font::Big));
Status = new TLabel(X()+85, Y(), pl->IsOwner() ? "*" : "", red_color, Font::GetInstance(Font::Big));
Nick = new TLabel(X()+105, Y(), pl->GetNick(), white_color, Font::GetInstance(Font::Big));
MyComponent(Pos);
MyComponent(Ready);
MyComponent(Status);
MyComponent(Nick);
......@@ -1710,6 +1719,7 @@ void TPlayerLine::Draw(const Point2i& mouse)
Status->SetCaption(pl->IsOp() ? "@" : pl->IsOwner() ? "*" : "");
Ready->SetColor(pl->Ready() ? red_color : gray_color);
Pos->Draw(mouse);
Ready->Draw(mouse);
Status->Draw(mouse);
Nick->Draw(mouse);
......
......@@ -133,6 +133,7 @@ public:
TColorEdit *couleur;
TComboBox *nation;
TLabel* Pos;
TLabel* Ready;
TLabel* Status;
TLabel* Nick;
......
......@@ -162,6 +162,7 @@ void MenAreAntsApp::RefreshList()
ListServerForm->StatsButton->SetEnabled(false);
ListServerForm->RegisterButton->SetEnabled(false);
ListServerForm->AccountButton->SetEnabled(false);
ListServerForm->RetourButton->SetEnabled(false);
ListServerForm->ServerList->ClearItems();
MetaServer.Request(MSG_SERVLIST);
......@@ -328,6 +329,7 @@ int EOLmsCommand::Exec(PlayerList players, EC_Client* me, ParvList parv)
ListServerForm->RefreshButton->SetEnabled();
ListServerForm->EscarmoucheButton->SetEnabled();
ListServerForm->MissionButton->SetEnabled();
ListServerForm->RetourButton->SetEnabled();
ListServerForm->StatsButton->SetEnabled();
ListServerForm->RegisterButton->SetEnabled();
ListServerForm->AccountButton->SetEnabled();
......
......@@ -1334,7 +1334,6 @@ TLoadMapFile::TLoadMapFile(ECImage* w)
Title = AddComponent(new TLabel(60,_("Map editor"), white_color, Font::GetInstance(Font::Huge)));
MapsList = AddComponent(new TListBox(Rectanglei(Width()/2-200,200,200,300)));
Refresh();
NewButton = AddComponent(new TButtonText(Width()/2+50,250,150,50, _("New map"), Font::GetInstance(Font::Normal)));
LoadButton = AddComponent(new TButtonText(Width()/2+50,300,150,50, _("Load a file"), Font::GetInstance(Font::Normal)));
......@@ -1342,4 +1341,6 @@ TLoadMapFile::TLoadMapFile(ECImage* w)
RetourButton = AddComponent(new TButtonText(Width()/2+50,350,150,50, _("Back"), Font::GetInstance(Font::Normal)));
SetBackground(Resources::Titlescreen());
Refresh();
}
......@@ -131,6 +131,7 @@
R_RESOURCE(ECSpriteBase, RefreshButton, "buttons/refresh");
R_RESOURCE(ECSpriteBase, SaveButton, "buttons/save");
R_RESOURCE(ECSpriteBase, ScoresButton, "buttons/scores");
R_RESOURCE(ECSpriteBase, RadioButton, "buttons/radio");
R_RESOURCE(ECSpriteBase, CheckBox, "checkbox");
R_RESOURCE(ECSpriteBase, CaseMer, "cases/mer");
R_RESOURCE(ECSpriteBase, CaseTerre, "cases/terre");
......
......@@ -166,6 +166,7 @@ public:
R_RESOURCE(ECSpriteBase, RefreshButton);
R_RESOURCE(ECSpriteBase, SaveButton);
R_RESOURCE(ECSpriteBase, ScoresButton);
R_RESOURCE(ECSpriteBase, RadioButton);
R_RESOURCE(ECSpriteBase, CheckBox);
R_RESOURCE(ECSpriteBase, CaseMer);
R_RESOURCE(ECSpriteBase, CaseTerre);
......
......@@ -86,7 +86,7 @@ uint TMessageBox::Show()
{
case SDLK_RETURN:
if((!edit || edit->Focused()) && !boutons.empty())
return boutons[0]->Tag;
return boutons.at(boutons.size()-1)->Tag;
break;
default: break;
}
......
#!/bin/sh
find . -type f -a '(' -path '*/.*' -prune -o -print ')' | while read file; do
if grep -q '\$Id:' "$file" && ! svn propget svn:keywords "$file" | grep -q '^Id$'; then svn propset svn:keywords Id "$file"; fi
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment