equal
deleted
inserted
replaced
37 class HWNewNet : public QObject |
37 class HWNewNet : public QObject |
38 { |
38 { |
39 Q_OBJECT |
39 Q_OBJECT |
40 |
40 |
41 public: |
41 public: |
|
42 enum ClientState { Disconnected, Connecting, Connected, InLobby, InRoom, InGame }; |
|
43 |
42 HWNewNet(); |
44 HWNewNet(); |
43 ~HWNewNet(); |
45 ~HWNewNet(); |
44 void Connect(const QString & hostName, quint16 port, const QString & nick); |
46 void Connect(const QString & hostName, quint16 port, const QString & nick); |
45 void Disconnect(); |
47 void Disconnect(); |
46 void SendPasswordHash(const QString & hash); |
48 void SendPasswordHash(const QString & hash); |
47 void NewNick(const QString & nick); |
49 void NewNick(const QString & nick); |
48 bool isRoomChief(); |
50 bool isRoomChief(); |
49 bool isInRoom(); |
51 bool isInRoom(); |
50 int getClientState(); |
52 ClientState clientState(); |
51 QString getNick(); |
53 QString getNick(); |
52 QString getRoom(); |
54 QString getRoom(); |
53 QString getHost(); |
55 QString getHost(); |
54 |
56 |
55 private: |
57 private: |
86 void RawSendNet(const QByteArray & buf); |
88 void RawSendNet(const QByteArray & buf); |
87 void ParseCmd(const QStringList & lst); |
89 void ParseCmd(const QStringList & lst); |
88 void handleNotice(int n); |
90 void handleNotice(int n); |
89 |
91 |
90 int loginStep; |
92 int loginStep; |
91 int netClientState; |
93 ClientState netClientState; |
92 |
94 |
93 signals: |
95 signals: |
94 void AskForRunGame(); |
96 void AskForRunGame(); |
95 void Connected(); |
97 void connected(); |
96 void Disconnected(const QString & reason); |
98 void disconnected(const QString & reason); |
97 void Error(const QString & errmsg); |
99 void Error(const QString & errmsg); |
98 void Warning(const QString & wrnmsg); |
100 void Warning(const QString & wrnmsg); |
99 void AskForPassword(const QString & nick); |
101 void AskForPassword(const QString & nick); |
100 void NickTaken(const QString & nick); |
102 void NickTaken(const QString & nick); |
101 void AuthFailed(); |
103 void AuthFailed(); |