QTfrontend/net/newnetclient.h
author unc0rr
Sun, 02 Dec 2012 01:25:11 +0400
changeset 8178 8bd087478b48
parent 8157 695f1eef72c8
child 8291 e4a0d980d1e2
permissions -rw-r--r--
Fix QSettings problems: - Reopen file in ReadOnly mode if it was open in ReadWrite mode and is being read. This is needed for stupid QSettings which opens file in ReadWrite mode just to call readAll() on it. - Implement setSize(0)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
315
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
     1
/*
1066
1f1b3686a2b0 Update copyright headers a bit
unc0rr
parents: 883
diff changeset
     2
 * Hedgewars, a free turn based strategy game
4976
088d40d8aba2 Happy 2011 :)
koda
parents: 4908
diff changeset
     3
 * Copyright (c) 2006-2008 Igor Ulyanov <iulyanov@gmail.com>
6952
7f70f37bbf08 license header year range adjustments
sheepluva
parents: 6732
diff changeset
     4
 * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
315
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
     5
 *
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
     6
 * This program is free software; you can redistribute it and/or modify
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
     7
 * it under the terms of the GNU General Public License as published by
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
     8
 * the Free Software Foundation; version 2 of the License
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
     9
 *
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    13
 * GNU General Public License for more details.
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    14
 *
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    16
 * along with this program; if not, write to the Free Software
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    18
 */
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    19
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    20
#ifndef _NEW_NETCLIENT_INCLUDED
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    21
#define _NEW_NETCLIENT_INCLUDED
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    22
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    23
#include <QObject>
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    24
#include <QString>
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    25
#include <QTcpSocket>
354
60e4af0a4375 network to local teams map, addteams from server before team config bug, fixed some segfaults
displacer
parents: 352
diff changeset
    26
#include <QMap>
315
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    27
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    28
#include "team.h"
448
e968e19a464c waiting state for net Go button
displacer
parents: 431
diff changeset
    29
#include "game.h" // for GameState
315
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    30
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    31
class GameUIConfig;
334
85eacbd9827f protocol changes
displacer
parents: 329
diff changeset
    32
class GameCFGWidget;
339
7535ab6c3820 Run game message added, team and config info provided for net game
displacer
parents: 338
diff changeset
    33
class TeamSelWidget;
6732
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents: 6700
diff changeset
    34
class RoomsListModel;
7723
ca05b576ec74 Start moving to players list model.
unc0rr
parents: 7684
diff changeset
    35
class PlayersListModel;
7728
664738870325 Bring back sorting
unc0rr
parents: 7723
diff changeset
    36
class QSortFilterProxyModel;
664738870325 Bring back sorting
unc0rr
parents: 7723
diff changeset
    37
class QAbstractItemModel;
315
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    38
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    39
extern char delimeter;
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    40
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    41
class HWNewNet : public QObject
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    42
{
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    43
        Q_OBJECT
315
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    44
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    45
    public:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    46
        enum ClientState { Disconnected, Connecting, Connected, InLobby, InRoom, InGame };
6036
727d13409891 small cleanup: enum instead of magic numbers
sheepluva
parents: 5998
diff changeset
    47
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    48
        HWNewNet();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    49
        ~HWNewNet();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    50
        void Connect(const QString & hostName, quint16 port, const QString & nick);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    51
        void Disconnect();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    52
        void SendPasswordHash(const QString & hash);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    53
        void NewNick(const QString & nick);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    54
        bool isRoomChief();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    55
        bool isInRoom();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    56
        ClientState clientState();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    57
        QString getNick();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    58
        QString getRoom();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    59
        QString getHost();
6732
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents: 6700
diff changeset
    60
        RoomsListModel * roomsListModel();
7728
664738870325 Bring back sorting
unc0rr
parents: 7723
diff changeset
    61
        QAbstractItemModel * lobbyPlayersModel();
664738870325 Bring back sorting
unc0rr
parents: 7723
diff changeset
    62
        QAbstractItemModel * roomPlayersModel();
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3283
diff changeset
    63
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    64
    private:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    65
        bool isChief;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    66
        QString mynick;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    67
        QString myroom;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    68
        QString myhost;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    69
        QTcpSocket NetSocket;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    70
        QString seed;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    71
        bool m_game_connected;
6732
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents: 6700
diff changeset
    72
        RoomsListModel * m_roomsListModel;
7728
664738870325 Bring back sorting
unc0rr
parents: 7723
diff changeset
    73
        PlayersListModel * m_playersModel;
664738870325 Bring back sorting
unc0rr
parents: 7723
diff changeset
    74
        QSortFilterProxyModel * m_lobbyPlayersModel;
664738870325 Bring back sorting
unc0rr
parents: 7723
diff changeset
    75
        QSortFilterProxyModel * m_roomPlayersModel;
315
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    76
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    77
        QStringList cmdbuf;
1082
596b1dcdc1df - Modify network protocol to use new delimiter
unc0rr
parents: 1066
diff changeset
    78
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    79
        void RawSendNet(const QString & buf);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    80
        void RawSendNet(const QByteArray & buf);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    81
        void ParseCmd(const QStringList & lst);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    82
        void handleNotice(int n);
315
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
    83
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    84
        int loginStep;
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    85
        ClientState netClientState;
1313
f4c54e9e1b8c - Introduce a bit of state miachine in client code (should be more robust and verbosive now)
unc0rr
parents: 1311
diff changeset
    86
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    87
    signals:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    88
        void AskForRunGame();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    89
        void connected();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    90
        void disconnected(const QString & reason);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    91
        void Error(const QString & errmsg);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    92
        void Warning(const QString & wrnmsg);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    93
        void AskForPassword(const QString & nick);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    94
        void NickTaken(const QString & nick);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    95
        void AuthFailed();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    96
        void EnteredGame();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    97
        void LeftRoom(const QString & reason);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    98
        void nickAdded(const QString& nick, bool notifyNick);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    99
        void nickRemoved(const QString& nick);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   100
        void nickAddedLobby(const QString& nick, bool notifyNick);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   101
        void nickRemovedLobby(const QString& nick);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   102
        void FromNet(const QByteArray & buf);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   103
        void adminAccess(bool);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   104
        void roomMaster(bool);
1856
e71dbf958c87 Enable admin button when have privilege. Button does nothing yet.
unc0rr
parents: 1797
diff changeset
   105
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   106
        void netSchemeConfig(QStringList &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   107
        void paramChanged(const QString & param, const QStringList & value);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   108
        void configAsked();
1875
189370d394db - Send initial room config
unc0rr
parents: 1874
diff changeset
   109
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   110
        void TeamAccepted(const QString&);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   111
        void AddNetTeam(const HWTeam&);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   112
        void RemoveNetTeam(const HWTeam&);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   113
        void hhnumChanged(const HWTeam&);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   114
        void teamColorChanged(const HWTeam&);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   115
        void chatStringLobby(const QString&);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   116
        void chatStringLobby(const QString&, const QString&);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   117
        void chatStringFromNet(const QString&);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   118
        void chatStringFromMe(const QString&);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   119
        void chatStringFromMeLobby(const QString&);
1377
a9e768739345 - Customize QTextBrowser look
unc0rr
parents: 1360
diff changeset
   120
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   121
        void roomsList(const QStringList&);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   122
        void serverMessage(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   123
        void serverMessageNew(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   124
        void serverMessageOld(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   125
        void latestProtocolVar(int);
8157
695f1eef72c8 Bans manager
unc0rr
parents: 7857
diff changeset
   126
        void bansList(const QStringList &);
329
4c3aad46baa5 Send game parameters by net... Currently it leads to infinite loop, flooding traffic with messages about changes
unc0rr
parents: 328
diff changeset
   127
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   128
        void setMyReadyStatus(bool isReady);
1405
ee4b28a1861d Show players ready status in chat nick list
unc0rr
parents: 1404
diff changeset
   129
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   130
    public slots:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   131
        void ToggleReady();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   132
        void chatLineToNet(const QString& str);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   133
        void chatLineToLobby(const QString& str);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   134
        void SendTeamMessage(const QString& str);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   135
        void SendNet(const QByteArray & buf);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   136
        void AddTeam(const HWTeam & team);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   137
        void RemoveTeam(const HWTeam& team);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   138
        void onHedgehogsNumChanged(const HWTeam& team);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   139
        void onTeamColorChanged(const HWTeam& team);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   140
        void onParamChanged(const QString & param, const QStringList & value);
2377
f3fab2b09e0c And in frontend
nemo
parents: 2345
diff changeset
   141
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   142
        void setServerMessageNew(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   143
        void setServerMessageOld(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   144
        void setLatestProtocolVar(int proto);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   145
        void askServerVars();
1873
815a3ff1fe4b Start refactoring some things. Frontend becomes temporarily unusable for network game
unc0rr
parents: 1860
diff changeset
   146
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   147
        void JoinRoom(const QString & room);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   148
        void CreateRoom(const QString & room);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   149
        void updateRoomName(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   150
        void askRoomsList();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   151
        void gameFinished(bool correcly);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   152
        void banPlayer(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   153
        void kickPlayer(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   154
        void infoPlayer(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   155
        void followPlayer(const QString &);
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   156
        void startGame();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   157
        void toggleRestrictJoins();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   158
        void toggleRestrictTeamAdds();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   159
        void partRoom();
8157
695f1eef72c8 Bans manager
unc0rr
parents: 7857
diff changeset
   160
        void clearAccountsCache();        
695f1eef72c8 Bans manager
unc0rr
parents: 7857
diff changeset
   161
        void getBanList();
695f1eef72c8 Bans manager
unc0rr
parents: 7857
diff changeset
   162
        void removeBan(const QString &);
695f1eef72c8 Bans manager
unc0rr
parents: 7857
diff changeset
   163
        void banIP(const QString & ip, const QString & reason, int seconds);
695f1eef72c8 Bans manager
unc0rr
parents: 7857
diff changeset
   164
        void banNick(const QString & nick, const QString & reason, int seconds);
315
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
   165
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   166
    private slots:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   167
        void ClientRead();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   168
        void OnConnect();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   169
        void OnDisconnect();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
   170
        void displayError(QAbstractSocket::SocketError socketError);
315
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
   171
};
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
   172
73003488240b client/server net pre-alpha
displacer
parents:
diff changeset
   173
#endif // _NEW_NETCLIENT_INCLUDED