Commit 42e544b4 authored by progs's avatar progs

Usage of a new protocole version


git-svn-id: svn://svn.gna.org/svn/menareants/trunk@903 6832cf7c-ce15-0410-9f4e-c008ec2580bf
parent 003326e2
2007-02-12 Romain Bignon <progs@headfucking.net>
* src/, meta-server/, server/: Changement complet du protocole ! Utilisation d'enumerateurs, changement dans les fonctions, etc.
2007-02-11 Romain Bignon <progs@headfucking.net>
* server/Main.cpp (sig_alarm): Correction d'un bug qui risquait de faire jarter tous les clients si l'un était victime d'un ping timeout.
......@@ -27,6 +31,8 @@
Egalement, maintenant lorsqu'une unité passe par un batiment qu'il peut investir mais qu'il n'y a pas d'enemis dessus (donc pas de combat), on investis
quand même et on continue le mouvement.
* Création d'une branche 0.4alpha P11
2007-02-10 Romain Bignon <progs@headfucking.net>
* src/InGame.cpp (ARMCommand): Vérifie ET la case visée ET la case de l'unité sendeuse pour voir si l'event est visible ou non.
......
......@@ -6,7 +6,7 @@ SUBDIRS = lib ${INSTALL_META_SERVER} ${INSTALL_SERVER} ${INSTALL_GAME}
AUTOMAKE_OPTIONS = foreign
doxygen:
@cd src && /usr/bin/doxygen && cd ../server && /usr/bin/doxygen && cd ../lib && /usr/bin/doxygen && cd ..
@cd src && /usr/bin/doxygen && cd ../server && /usr/bin/doxygen && cd ../lib && /usr/bin/doxygen && cd ../meta-server && /usr/bin/doxygen && cd ../
@echo "Created code documentation in `pwd`/doc"
update:
......
......@@ -603,7 +603,7 @@ uninstall-info: uninstall-info-recursive
doxygen:
@cd src && /usr/bin/doxygen && cd ../server && /usr/bin/doxygen && cd ../lib && /usr/bin/doxygen && cd ..
@cd src && /usr/bin/doxygen && cd ../server && /usr/bin/doxygen && cd ../lib && /usr/bin/doxygen && cd ../meta-server && /usr/bin/doxygen && cd ../
@echo "Created code documentation in `pwd`/doc"
update:
......
......@@ -14,6 +14,7 @@ This is documentations of the three parts of game :
</p>
<ul>
<li><a href="lib/index.html">Library</a>
<li><a href="meta-server/index.html">Meta Server</a>
<li><a href="game/index.html">Game</a>
<li><a href="server/index.html">Server</a>
</ul>
......
/* lib/Defines.h - A lot of defines
*
* Copyright (C) 2005-2006 Romain Bignon <Progs@headfucking.net>
* Copyright (C) 2005-2007 Romain Bignon <Progs@headfucking.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -38,7 +38,7 @@
/* Version protocolaire
* �incr�enter en cas de modification du protocole
*/
#define APP_PVERSION "11"
#define APP_PVERSION "12"
#define APP_MSPROTO "1"
/* Version du jeu (forme alpha.beta[-patch]) */
......@@ -57,6 +57,12 @@
#define APP_VERSION_PATCH "pre3" /* troisi�e pr�release */
#endif
#ifdef APP_VERSION_PATCH
# define APP_VERSION APP_VERSION_ALPHA "." APP_VERSION_BETA "-" APP_VERSION_PATCH
#else
# define APP_VERSION APP_VERSION_ALPHA "." APP_VERSION_BETA
#endif
#ifdef __cplusplus
/* Tailles de variables */
......
......@@ -4,7 +4,7 @@
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Men Are Ants :: Library"
PROJECT_NUMBER = 0.1
PROJECT_NUMBER = 0.4
OUTPUT_DIRECTORY = ../doc
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
......@@ -27,8 +27,8 @@ ABBREVIATE_BRIEF = "The $name class" \
ALWAYS_DETAILED_SEC = YES
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = YES
......@@ -37,7 +37,7 @@ INHERIT_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
......@@ -65,7 +65,7 @@ GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
......@@ -79,7 +79,7 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
......@@ -124,15 +124,15 @@ FILE_PATTERNS = *.c \
*.M \
*.MM
RECURSIVE = YES
EXCLUDE =
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to source browsing
......@@ -149,20 +149,20 @@ VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = lib
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
......@@ -179,8 +179,8 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
......@@ -192,8 +192,8 @@ GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
......@@ -206,8 +206,8 @@ MAN_LINKS = NO
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
......@@ -219,29 +219,29 @@ GENERATE_AUTOGEN_DEF = NO
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = NO
#---------------------------------------------------------------------------
# Configuration::additions related to external references
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
......@@ -257,8 +257,8 @@ CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 1000
......@@ -267,6 +267,6 @@ DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
/* lib/Messages.h - Messages enumerators for protocole
*
* Copyright (C) 2007 Romain Bignon <Progs@headfucking.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id$
*/
#ifndef ECLIB_Messages_h
#define ECLIB_Messages_h
enum ECMessage
{
MSG_NONE,
MSG_HELLO = 'A',
MSG_IAM,
MSG_MAJ,
MSG_PING,
MSG_PONG,
MSG_REJOIN,
MSG_MOTD,
MSG_ENDOFMOTD,
MSG_LOGGED,
MSG_BYE,
MSG_ADMIN,
MSG_ERROR,
MSG_STAT,
MSG_GLIST,
MSG_ENDOFGLIST,
MSG_JOIN,
MSG_LEAVE,
MSG_KICK,
MSG_SET,
MSG_IA_JOIN,
MSG_LISTMAPS,
MSG_ENDOFMAPS,
MSG_SENDMAP,
MSG_ENDOFSMAP,
MSG_PLIST,
MSG_ARM,
MSG_BREAKPOINT,
MSG_MSG,
MSG_AMSG,
MSG_INFO,
MSG_SAVE,
MSG_SCORE,
MSG_SERVLIST,
MSG_ENDOFSLIST
};
enum ECError
{
ERR_UNKNOWN = '0',
ERR_NICK_USED,
ERR_CANT_JOIN,
ERR_IA_CANT_JOIN,
ERR_SERV_FULL,
ERR_CANT_CREATE,
ERR_CMDS,
ERR_ADMIN_LOGFAIL,
ERR_ADMIN_NOSUCHVICTIM,
ERR_ADMIN_CANT_REHASH,
ERR_ADMIN_SUCCESS
};
#ifdef __cplusplus
#include <vector>
#include <string>
std::string FormatStr(std::string s);
class ECArgs
{
/* Constructeur */
public:
ECArgs() : dont_split(false) {}
ECArgs(const std::string& s) : dont_split(false) { Push(s); }
ECArgs(const char* s)
: dont_split(false)
{
Push(s);
}
ECArgs(const std::string& s1, const std::string& s2)
: dont_split(false)
{
Push(s1);
Push(s2);
}
ECArgs(const std::string& s1, const std::string& s2, const std::string& s3)
: dont_split(false)
{
Push(s1);
Push(s2);
Push(s3);
}
ECArgs(const std::string& s1, const std::string& s2, const std::string& s3,
const std::string& s4)
: dont_split(false)
{
Push(s1);
Push(s2);
Push(s3);
Push(s4);
}
ECArgs(const std::string& s1, const std::string& s2, const std::string& s3,
const std::string& s4, const std::string& s5)
: dont_split(false)
{
Push(s1);
Push(s2);
Push(s3);
Push(s4);
Push(s5);
}
/* Attributs */
public:
const std::vector<std::string>& List() const { return list; }
ECArgs& Push(const std::string& s) { list.push_back(s); return *this; }
ECArgs& operator+=(const ECArgs& args) { return Push(args.List()); }
//ECArgs& operator+=(const std::string& s) { return Push(s); }
ECArgs& Push(const std::vector<std::string>& s)
{
for(std::vector<std::string>::const_iterator it = s.begin(); it != s.end(); ++it)
list.push_back(*it);
return *this;
}
ECArgs& DontSplit() { dont_split = true; return *this; }
bool Empty() const { return list.empty(); }
std::vector<std::string>::size_type Size() const { return list.size(); }
std::string String() const
{
std::string s;
for(std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); ++it)
{
if(!s.empty()) s += " ";
s += dont_split ? *it : FormatStr(*it);
}
return s;
}
private:
std::vector<std::string> list;
bool dont_split;
};
class ECPacket
{
ECMessage cmd;
ECArgs args;
std::string from;
public:
ECPacket(const std::string& _from, const ECMessage& _cmd, const ECArgs& _args)
: cmd(_cmd), args(_args), from(_from)
{}
ECPacket(const ECMessage& _cmd, const ECArgs& _args)
: cmd(_cmd), args(_args)
{}
const ECMessage& Command() const { return cmd; }
const ECArgs& Args() const { return args; }
const std::string& From() const { return from; }
std::string Buffer() const
{
std::string buf;
if(from.empty() == false)
buf = ":" + from + " ";
buf += static_cast<char>(cmd);
if(!args.Empty())
buf += " " + args.String();
return buf;
}
};
#endif /* __cplusplus */
#endif /* ECLIB_Messages_h */
......@@ -239,11 +239,12 @@ bool FichierExiste(const std::string &nom)
return existe;
}
void SplitBuf(std::string buf, std::vector<std::string> *parv, std::string *cmdname)
void SplitBuf(std::string buf, std::vector<std::string> *parv, ECMessage *cmd)
{
char s[1024 + 20];
unsigned int j;
*cmd = MSG_NONE;
for(std::string::const_iterator it = buf.begin(); it != buf.end(); )
{
bool slash;
......@@ -255,7 +256,7 @@ void SplitBuf(std::string buf, std::vector<std::string> *parv, std::string *cmdn
s[j++]=*it, slash=false;
s[j]='\0';
if(!j) continue;
if(cmdname->empty())
if(*cmd == MSG_NONE)
{
if(s[0] == ':')
{
......@@ -265,7 +266,7 @@ void SplitBuf(std::string buf, std::vector<std::string> *parv, std::string *cmdn
else
{
if(!parv->size()) parv->push_back("");
*cmdname = s;
*cmd = static_cast<ECMessage>(*s);
}
}
else
......
......@@ -22,6 +22,7 @@
#define Outils_hpp
#include <sstream>
#include <vector>
#include "Messages.h"
typedef unsigned int uint;
......@@ -45,7 +46,7 @@ bool is_ip(const char *ip);
std::string StringF(const char* format, ...);
/** Mets une chaine dans un tableau de chaines */
void SplitBuf(std::string buf, std::vector<std::string> *parv, std::string *cmdname);
void SplitBuf(std::string buf, std::vector<std::string> *parv, ECMessage* cmd);
/** Retourne si le fichier existe ou non */
bool FichierExiste(const std::string &nom);
......
This diff is collapsed.
......@@ -33,11 +33,11 @@ static void list_servers(struct Client* cl)
{
struct Server* s = server_head;
for(; s; s = s->next)
sendrpl(cl, "LSP %s:%d %s %c %d %d %d %d %d %d", 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->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);
sendrpl(cl, "EOL");
sendcmd(cl, MSG_ENDOFSLIST);
return;
}
......@@ -67,12 +67,12 @@ int m_login (struct Client* cl, int parc, char** parv)
struct User* user = user_head;
for(; user; user = user->next)
if(!strcasecmp(user->name, parv[1]))
return sendrpl(cl, "NICKUSED");
return senderr(cl, ERR_NICK_USED);
add_user(cl, parv[1]);
}
cl->flags = CL_USER;
sendrpl(cl, "STAT %d %d", nb_tchan, nb_tusers);
sendrpl(cl, MSG_STAT, "%d %d", nb_tchan, nb_tusers);
list_servers(cl);
if(proto <= 1)
delclient(cl);
......
......@@ -39,7 +39,7 @@ int main(int argc, char **argv)
int tmp;
int background = 1;
while((tmp = getopt(argc, argv, "np:f:")) != EOF)
while((tmp = getopt(argc, argv, "nvhp:f:")) != EOF)
switch(tmp)
{
case 'n':
......@@ -51,8 +51,14 @@ int main(int argc, char **argv)
case 'P':
port = atoi(optarg);
break;
case 'v':
printf("MenAreAnts Meta Server v" APP_VERSION " P" APP_PVERSION
" (c) Romain Bignon (Build " __DATE__ " " __TIME__ ")\n");
exit(EXIT_SUCCESS);
break;
case 'h':
default:
printf("Usage: %s [-n] [-p <port>] [-f <ping freq>]", argv[0]);
printf("Usage: %s [-n] [-p <port>] [-f <ping freq>]\n", argv[0]);
exit(EXIT_FAILURE);
}
......
......@@ -19,6 +19,7 @@
*/
#include "lib/Defines.h" /* Pour le APP_MSPROTO */
#include "lib/Messages.h" /* Pour la liste des commandes */
#include "sockets.h"
#include "servers.h"
#include "clients.h"
......@@ -52,7 +53,7 @@ static void check_pings()
if(myClients[i].flags & CL_PING)
delclient(&myClients[i]);
else
sendrpl(&myClients[i], "PING");
sendcmd(&myClients[i], MSG_PING);
}
}
......@@ -67,12 +68,35 @@ int sendbuf(struct Client* cl, char* buf, int len)
return 0;
}
int sendrpl(struct Client* cl, const char *pattern, ...)
int senderr(struct Client* cl, enum ECError err)
{
char buf[] = {(char)MSG_ERROR, ' ', (char)err, '\r', '\n', '\0' };
send(cl->fd, buf, 5, 0);
return 0;
}
int sendcmd(struct Client* cl, enum ECMessage cmd)
{
char buf[] = {(char)cmd, '\r', '\n', '\0' };
send(cl->fd, buf, 3, 0);
return 0;
}
int sendrpl(struct Client* cl, enum ECMessage cmd, const char *pattern, ...)
{
static char buf[MAXBUFFER + 1];
va_list vl;
size_t len;
send(cl->fd, (char*)&cmd, 1, 0);
send(cl->fd, " ", 1, 0);
//snprintf(buf, sizeof buf - 2, "%c %s", cmd, pattern);
va_start(vl, pattern);
len = vsnprintf(buf, sizeof buf - 2, pattern, vl); /* format */
if(len > sizeof buf - 2) len = sizeof buf -2;
......@@ -107,28 +131,28 @@ int SplitBuf(char* buf, char **parv, int size)
int parsemsg(struct Client* cl)
{
const char* cmdname;
enum ECMessage cmdname;
char *parv[MAXPARA];
int parc;
unsigned int i;
static struct {
const char* cmd;
enum ECMessage cmd;
int (*func) (struct Client*, int, char**);
} cmds[] =
{
{"IAM", m_login},
{"SET", m_server_set},
{"POG", m_pong}
{MSG_IAM, m_login},
{MSG_SET, m_server_set},
{MSG_PONG, m_pong}
};
parc = SplitBuf(cl->RecvBuf, parv, MAXPARA);
if(!parc) return 0;
cmdname = parv[0];
cmdname = parv[0][0];
for(i = 0; i < ASIZE(cmds); ++i)
if(!strcmp(cmds[i].cmd, cmdname))
if(cmds[i].cmd == cmdname)
{
cmds[i].func (cl, parc, parv);
return 1;
......@@ -208,7 +232,7 @@ struct Client *addclient(int fd, const char *ip)
FD_SET(fd, &global_fd_set);
if((unsigned)fd > highsock) highsock = fd;
sendrpl(newC, "HEL " MS_SMALLNAME " " APP_MSPROTO);
sendrpl(newC, MSG_HELLO, MS_SMALLNAME " " APP_MSPROTO);
return newC;
}
......
......@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <time.h>
#include "lib/Messages.h"
#define DEFPORT 5460
#define DEFPINGFREQ 360
......@@ -57,7 +58,9 @@ struct Client
struct Client *addclient(int fd, const char *ip);
int delclient(struct Client *del);
int sendrpl(struct Client* cl, const char *pattern, ...);
int senderr(struct Client* cl, enum ECError err);
int sendcmd(struct Client* cl, enum ECMessage cmd);
int sendrpl(struct Client* cl, enum ECMessage cmd, const char *pattern, ...);
int run_server(void);
int init_socket(void);
......
......@@ -82,7 +82,10 @@ bool ECObelisk::Attaq(std::vector<ECEntity*> entities, ECEvent* event)
}
if(!killed) continue;
Channel()->send_info(0, EChannel::I_SHOOT, LongName() + " " + (*it)->LongName() + " " + TypToStr(killed));
if(Owner())
Channel()->send_info(Owner(), EChannel::I_SHOOT, ECArgs(LongName(), (*it)->LongName(), TypToStr(killed)));
if((*it)->Owner())
Channel()->send_info((*it)->Owner(), EChannel::I_SHOOT, ECArgs(LongName(), (*it)->LongName(), TypToStr(killed)));
Shoot(*it, killed);
}
......@@ -146,7 +149,10 @@ bool ECDefenseTower::Attaq(std::vector<ECEntity*> entities, ECEvent* event)
}
if(!killed) continue;
Channel()->send_info(0, EChannel::I_SHOOT, LongName() + " " + (*it)->LongName() + " " + TypToStr(killed));
if(Owner())
Channel()->send_info(Owner(), EChannel::I_SHOOT, ECArgs(LongName(), (*it)->LongName(), TypToStr(killed)));
if((*it)->Owner())
Channel()->send_info((*it)->Owner(), EChannel::I_SHOOT, ECArgs(LongName(), (*it)->LongName(), TypToStr(killed)));
Shoot(*it, killed);
}
......
This diff is collapsed.
......@@ -22,7 +22,8 @@
#ifndef ECD_CHANNELS_H
#define ECD_CHANNELS_H
#include "../lib/Channels.h"
#include "lib/Channels.h"
#include "lib/Messages.h"
#include "Map.h"
class TClient;
......@@ -155,21 +156,27 @@ public:
/** Send a message to all players.
*
* @param one if not null, we will not send message to \b this player.
* @param from this is the sender of this message (it can be null).
* @param command command
* @param args arguments
* @return always 0.
*/
int sendto_players(ECPlayer* one, const char*, ...);
int sendto_players(ECPlayer* one, ECBPlayer* from, ECMessage command, ECArgs args = ECArgs());
int sendto_players(ECPlayer* one, PlayerVector from, ECMessage, ECArgs = ECArgs());
int sendto_players(ECPlayer* one, std::vector<ECEntity*> from, ECMessage, ECArgs = ECArgs());
int sendto_players(ECPlayer*