--- a/QTfrontend/net/newnetclient.cpp Wed Dec 17 23:41:10 2014 +0100
+++ b/QTfrontend/net/newnetclient.cpp Mon Dec 22 17:47:22 2014 -0500
@@ -32,7 +32,7 @@
#include "servermessages.h"
#include "HWApplication.h"
-char delimeter='\n';
+char delimiter='\n';
HWNewNet::HWNewNet() :
isChief(false),
@@ -74,7 +74,7 @@
{
if (m_game_connected)
{
- RawSendNet(QString("QUIT%1%2").arg(delimeter).arg("User quit"));
+ RawSendNet(QString("QUIT%1%2").arg(delimiter).arg("User quit"));
emit disconnected(tr("User quit"));
}
NetSocket.flush();
@@ -91,7 +91,7 @@
void HWNewNet::Disconnect()
{
if (m_game_connected)
- RawSendNet(QString("QUIT%1%2").arg(delimeter).arg("User quit"));
+ RawSendNet(QString("QUIT%1%2").arg(delimiter).arg("User quit"));
m_game_connected = false;
NetSocket.disconnectFromHost();
@@ -108,9 +108,9 @@
myroom = room;
if(password.isEmpty())
- RawSendNet(QString("CREATE_ROOM%1%2").arg(delimeter).arg(room));
+ RawSendNet(QString("CREATE_ROOM%1%2").arg(delimiter).arg(room));
else
- RawSendNet(QString("CREATE_ROOM%1%2%1%3").arg(delimeter).arg(room).arg(password));
+ RawSendNet(QString("CREATE_ROOM%1%2%1%3").arg(delimiter).arg(room).arg(password));
isChief = true;
}
@@ -126,29 +126,29 @@
myroom = room;
if(password.isEmpty())
- RawSendNet(QString("JOIN_ROOM%1%2").arg(delimeter).arg(room));
+ RawSendNet(QString("JOIN_ROOM%1%2").arg(delimiter).arg(room));
else
- RawSendNet(QString("JOIN_ROOM%1%2%1%3").arg(delimeter).arg(room).arg(password));
+ RawSendNet(QString("JOIN_ROOM%1%2%1%3").arg(delimiter).arg(room).arg(password));
isChief = false;
}
void HWNewNet::AddTeam(const HWTeam & team)
{
- QString cmd = QString("ADD_TEAM") + delimeter +
- team.name() + delimeter +
- QString::number(team.color()) + delimeter +
- team.grave() + delimeter +
- team.fort() + delimeter +
- team.voicepack() + delimeter +
- team.flag() + delimeter +
+ QString cmd = QString("ADD_TEAM") + delimiter +
+ team.name() + delimiter +
+ QString::number(team.color()) + delimiter +
+ team.grave() + delimiter +
+ team.fort() + delimiter +
+ team.voicepack() + delimiter +
+ team.flag() + delimiter +
QString::number(team.difficulty());
for(int i = 0; i < HEDGEHOGS_PER_TEAM; ++i)
{
- cmd.append(delimeter);
+ cmd.append(delimiter);
cmd.append(team.hedgehog(i).Name);
- cmd.append(delimeter);
+ cmd.append(delimiter);
cmd.append(team.hedgehog(i).Hat);
}
RawSendNet(cmd);
@@ -156,12 +156,12 @@
void HWNewNet::RemoveTeam(const HWTeam & team)
{
- RawSendNet(QString("REMOVE_TEAM") + delimeter + team.name());
+ RawSendNet(QString("REMOVE_TEAM") + delimiter + team.name());
}
void HWNewNet::NewNick(const QString & nick)
{
- RawSendNet(QString("NICK%1%2").arg(delimeter).arg(nick));
+ RawSendNet(QString("NICK%1%2").arg(delimiter).arg(nick));
}
void HWNewNet::ToggleReady()
@@ -173,7 +173,7 @@
{
QString msg = QString(buf.toBase64());
- RawSendNet(QString("EM%1%2").arg(delimeter).arg(msg));
+ RawSendNet(QString("EM%1%2").arg(delimiter).arg(msg));
}
void HWNewNet::RawSendNet(const QString & str)
@@ -292,14 +292,14 @@
{
// TODO: Warn user, disconnect
qWarning() << "Server too old";
- RawSendNet(QString("QUIT%1%2").arg(delimeter).arg("Server too old"));
+ RawSendNet(QString("QUIT%1%2").arg(delimiter).arg("Server too old"));
Disconnect();
emit disconnected(tr("The server is too old. Disconnecting now."));
return;
}
- RawSendNet(QString("NICK%1%2").arg(delimeter).arg(mynick));
- RawSendNet(QString("PROTO%1%2").arg(delimeter).arg(*cProtoVer));
+ RawSendNet(QString("NICK%1%2").arg(delimiter).arg(mynick));
+ RawSendNet(QString("PROTO%1%2").arg(delimiter).arg(*cProtoVer));
netClientState = Connected;
m_game_connected = true;
emit adminAccess(false);
@@ -331,7 +331,7 @@
if (lst[0] == "PING")
{
if (lst.size() > 1)
- RawSendNet(QString("PONG%1%2").arg(delimeter).arg(lst[1]));
+ RawSendNet(QString("PONG%1%2").arg(delimiter).arg(lst[1]));
else
RawSendNet(QString("PONG"));
return;
@@ -873,7 +873,7 @@
{
if (isChief)
RawSendNet(QString("HH_NUM%1%2%1%3")
- .arg(delimeter)
+ .arg(delimiter)
.arg(team.name())
.arg(team.numHedgehogs()));
}
@@ -882,7 +882,7 @@
{
if (isChief)
RawSendNet(QString("TEAM_COLOR%1%2%1%3")
- .arg(delimeter)
+ .arg(delimiter)
.arg(team.name())
.arg(team.color()));
}
@@ -892,9 +892,9 @@
if (isChief)
RawSendNet(
QString("CFG%1%2%1%3")
- .arg(delimeter)
+ .arg(delimiter)
.arg(param)
- .arg(value.join(QString(delimeter)))
+ .arg(value.join(QString(delimiter)))
);
}
@@ -911,7 +911,7 @@
{
if(str != "")
{
- RawSendNet(QString("CHAT") + delimeter + str);
+ RawSendNet(QString("CHAT") + delimiter + str);
QString action = HWProto::chatStringToAction(str);
if (action != NULL)
emit(roomChatAction(mynick, action));
@@ -924,7 +924,7 @@
{
if(str != "")
{
- RawSendNet(QString("CHAT") + delimeter + str);
+ RawSendNet(QString("CHAT") + delimiter + str);
QString action = HWProto::chatStringToAction(str);
if (action != NULL)
emit(lobbyChatAction(mynick, action));
@@ -935,7 +935,7 @@
void HWNewNet::SendTeamMessage(const QString& str)
{
- RawSendNet(QString("TEAMCHAT") + delimeter + str);
+ RawSendNet(QString("TEAMCHAT") + delimiter + str);
}
void HWNewNet::askRoomsList()
@@ -978,23 +978,23 @@
if (netClientState == InGame)
{
netClientState = InRoom;
- RawSendNet(QString("ROUNDFINISHED%1%2").arg(delimeter).arg(correctly ? "1" : "0"));
+ RawSendNet(QString("ROUNDFINISHED%1%2").arg(delimiter).arg(correctly ? "1" : "0"));
}
}
void HWNewNet::banPlayer(const QString & nick)
{
- RawSendNet(QString("BAN%1%2").arg(delimeter).arg(nick));
+ RawSendNet(QString("BAN%1%2").arg(delimiter).arg(nick));
}
void HWNewNet::banIP(const QString & ip, const QString & reason, int seconds)
{
- RawSendNet(QString("BANIP%1%2%1%3%1%4").arg(delimeter).arg(ip).arg(reason).arg(seconds));
+ RawSendNet(QString("BANIP%1%2%1%3%1%4").arg(delimiter).arg(ip).arg(reason).arg(seconds));
}
void HWNewNet::banNick(const QString & nick, const QString & reason, int seconds)
{
- RawSendNet(QString("BANNICK%1%2%1%3%1%4").arg(delimeter).arg(nick).arg(reason).arg(seconds));
+ RawSendNet(QString("BANNICK%1%2%1%3%1%4").arg(delimiter).arg(nick).arg(reason).arg(seconds));
}
void HWNewNet::getBanList()
@@ -1004,31 +1004,31 @@
void HWNewNet::removeBan(const QString & b)
{
- RawSendNet(QString("UNBAN%1%2").arg(delimeter).arg(b));
+ RawSendNet(QString("UNBAN%1%2").arg(delimiter).arg(b));
}
void HWNewNet::kickPlayer(const QString & nick)
{
- RawSendNet(QString("KICK%1%2").arg(delimeter).arg(nick));
+ RawSendNet(QString("KICK%1%2").arg(delimiter).arg(nick));
}
void HWNewNet::infoPlayer(const QString & nick)
{
- RawSendNet(QString("INFO%1%2").arg(delimeter).arg(nick));
+ RawSendNet(QString("INFO%1%2").arg(delimiter).arg(nick));
}
void HWNewNet::followPlayer(const QString & nick)
{
if (!isInRoom())
{
- RawSendNet(QString("FOLLOW%1%2").arg(delimeter).arg(nick));
+ RawSendNet(QString("FOLLOW%1%2").arg(delimiter).arg(nick));
isChief = false;
}
}
void HWNewNet::consoleCommand(const QString & cmd)
{
- RawSendNet(QString("CMD%1%2").arg(delimeter).arg(cmd));
+ RawSendNet(QString("CMD%1%2").arg(delimiter).arg(cmd));
}
bool HWNewNet::allPlayersReady()
@@ -1047,7 +1047,7 @@
void HWNewNet::updateRoomName(const QString & name)
{
- RawSendNet(QString("ROOM_NAME%1%2").arg(delimeter).arg(name));
+ RawSendNet(QString("ROOM_NAME%1%2").arg(delimiter).arg(name));
}
@@ -1085,17 +1085,17 @@
void HWNewNet::setServerMessageNew(const QString & msg)
{
- RawSendNet(QString("SET_SERVER_VAR%1MOTD_NEW%1%2").arg(delimeter).arg(msg));
+ RawSendNet(QString("SET_SERVER_VAR%1MOTD_NEW%1%2").arg(delimiter).arg(msg));
}
void HWNewNet::setServerMessageOld(const QString & msg)
{
- RawSendNet(QString("SET_SERVER_VAR%1MOTD_OLD%1%2").arg(delimeter).arg(msg));
+ RawSendNet(QString("SET_SERVER_VAR%1MOTD_OLD%1%2").arg(delimiter).arg(msg));
}
void HWNewNet::setLatestProtocolVar(int proto)
{
- RawSendNet(QString("SET_SERVER_VAR%1LATEST_PROTO%1%2").arg(delimeter).arg(proto));
+ RawSendNet(QString("SET_SERVER_VAR%1LATEST_PROTO%1%2").arg(delimiter).arg(proto));
}
void HWNewNet::askServerVars()
@@ -1165,5 +1165,5 @@
.append("!hedgewars")
, QCryptographicHash::Sha1).toHex();
- RawSendNet(QString("PASSWORD%1%2%1%3").arg(delimeter).arg(hash).arg(m_clientSalt));
+ RawSendNet(QString("PASSWORD%1%2%1%3").arg(delimiter).arg(hash).arg(m_clientSalt));
}