This repository has been archived by the owner on Sep 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCodes.php
1085 lines (942 loc) · 21.1 KB
/
Codes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Hoa
*
*
* @license
*
* New BSD License
*
* Copyright © 2007-2017, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Hoa nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS`.
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace Hoa\Irc;
/**
* Class \Hoa\Irc\Codes.
*
* This class contains all well-known IRC codes, based on RFC1459, RFC2810,
* RFC2811, RFC2812, RFC2813, RFC3675.
*
* Source: http://www.networksorcery.com/enp/protocol/irc.htm.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Codes
{
/*
* Replies in the range from 001 to 099 are used for client-server
* connections only and should never travel between servers.
*/
/**
* `Welcome to the Internet Relay Network <nick>!<user>@<host>`.
*
* @const int
*/
const RPL_WELCOME = 1;
/**
* `Your host is <servername>, running version <ver>`.
*
* @const int
*/
const RPL_YOURHOST = 2;
/**
* `This server was created <date>`.
*
* @const int
*/
const RPL_CREATED = 3;
/**
* `<servername> <version> <available user modes> <available channel modes>`.
*
* @const int
*/
const RPL_MYINFO = 4;
/**
* `Try server <server name>, port <port number>`.
*
* @const int
*/
const RPL_BOUNCE = 5;
/*
* Replies generated in the response to commands are found in the range
* from 200 to 399.
*/
/**
* `Link <version & debug level> <destination> <next server> V<protocol version> <link uptime in seconds> <backstream sendq> <upstream sendq>`.
*
* @const int
*/
const RPL_TRACELINK = 200;
/**
* `Try. <class> <server>`.
*
* @const int
*/
const RPL_TRACECONNECTING = 201;
/**
* `H.S. <class> <server>`.
*
* @const int
*/
const RPL_TRACEHANDSHAKE = 202;
/**
* `???? <class> [<client IP address in dot form>]`.
*
* @const int
*/
const RPL_TRACEUNKNOWN = 203;
/**
* `Oper <class> <nick>`.
*
* @const int
*/
const RPL_TRACEOPERATOR = 204;
/**
* `User <class> <nick>`.
*
* @const int
*/
const RPL_TRACEUSER = 205;
/**
* `Serv <class> <int>S <int>C <server> <nick!user|*!*>@<host|server> V<protocol version>`.
*
* @const int
*/
const RPL_TRACESERVER = 206;
/**
* `Service <class> <name> <type> <active type>`.
*
* @const int
*/
const RPL_TRACESERVICE = 207;
/**
* `<newtype> 0 <client name>`.
*
* @const int
*/
const RPL_TRACENEWTYPE = 208;
/**
* `Class <class> <count>`.
*
* @const int
*/
const RPL_TRACECLASS = 209;
/**
* Unused.
*
* @const int
*/
const RPL_TRACERECONNECT = 210;
/**
* `<linkname> <sendq> <sent messages> <sent Kbytes> <received messages> <received Kbytes> <time open>`.
*
* @const int
*/
const RPL_STATSLINKINFO = 211;
/**
* `<command> <count> <byte count> <remote count>`.
*
* @const int
*/
const RPL_STATSCOMMANDS = 212;
/**
* `<stats letter> :End of STATS report`.
*
* @const int
*/
const RPL_ENDOFSTATS = 219;
/**
* `<user mode string>`.
*
* @const int
*/
const RPL_UMODEIS = 221;
/**
* `<name> <server> <mask> <type> <hopcount> <info>`.
*
* @const int
*/
const RPL_SERVLIST = 234;
/**
* `<mask> <type> :End of service listing`.
*
* @const int
*/
const RPL_SERVLISTEND = 235;
/**
* `:Server Up %d days %d:%02d:%02d`.
*
* @const int
*/
const RPL_STATSUPTIME = 242;
/**
* `O <hostmask> * <name>`.
*
* @const int
*/
const RPL_STATSOLINE = 243;
/**
* `:There are <integer> users and <integer> services on <integer> servers`.
*
* @const int
*/
const RPL_LUSERCLIENT = 251;
/**
* `<integer> :operator(s) online`.
*
* @const int
*/
const RPL_LUSEROP = 252;
/**
* `<integer> :unknown connection(s)`.
*
* @const int
*/
const RPL_LUSERUNKNOWN = 253;
/**
* `<integer> :channels formed`.
*
* @const int
*/
const RPL_LUSERCHANNELS = 254;
/**
* `:I have <integer> clients and <integer> servers`.
*
* @const int
*/
const RPL_LUSERME = 255;
/**
* `<server> :Administrative info`.
*
* @const int
*/
const RPL_ADMINME = 256;
/**
* `:<admin info>`.
*
* @const int
*/
const RPL_ADMINLOC1 = 257;
/**
* `:<admin info>`.
*
* @const int
*/
const RPL_ADMINLOC2 = 258;
/**
* `:<admin info>`.
*
* @const int
*/
const RPL_ADMINEMAIL = 259;
/**
* `File <logfile> <debug level>`.
*
* @const int
*/
const RPL_TRACELOG = 261;
/**
* `<server name> <version & debug level> :End of TRACE`.
*
* @const int
*/
const RPL_TRACEEND = 262;
/**
* `<command> :Please wait a while and try again.`.
*
* @const int
*/
const RPL_TRYAGAIN = 263;
/**
* `<nick> :<away message>`.
*
* @const int
*/
const RPL_AWAY = 301;
/**
* `:*1<reply> *( " " <reply> )`.
*
* @const int
*/
const RPL_USERHOST = 302;
/**
* `:*1<nick> *( " " <nick> )`.
*
* @const int
*/
const RPL_ISON = 303;
/**
* `:You are no longer marked as being away`.
*
* @const int
*/
const RPL_UNAWAY = 305;
/**
* `:You have been marked as being away`.
*
* @const int
*/
const RPL_NOWAWAY = 306;
/**
* `<nick> <user> <host> * :<real name>`.
*
* @const int
*/
const RPL_WHOISUSER = 311;
/**
* `<nick> <server> :<server info>`.
*
* @const int
*/
const RPL_WHOISSERVER = 312;
/**
* `<nick> :is an IRC operator`.
*
* @const int
*/
const RPL_WHOISOPERATOR = 313;
/**
* `<nick> <user> <host> * :<real name>`.
*
* @const int
*/
const RPL_WHOWASUSER = 314;
/**
* `<name> :End of WHO list`.
*
* @const int
*/
const RPL_ENDOFWHO = 315;
/**
* `<nick> <integer> :seconds idle`.
*
* @const int
*/
const RPL_WHOISIDLE = 317;
/**
* `<nick> :End of WHOIS list`.
*
* @const int
*/
const RPL_ENDOFWHOIS = 318;
/**
* `<nick> :*( ( "@" / "+" ) <channel> " " )`.
*
* @const int
*/
const RPL_WHOISCHANNELS = 319;
/**
* Obsolete.
*
* @const int
*/
const RPL_LISTSTART = 321;
/**
* `<channel> <# visible> :<topic>`.
*
* @const int
*/
const RPL_LIST = 322;
/**
* `:End of LIST`.
*
* @const int
*/
const RPL_LISTEND = 323;
/**
* `<channel> <mode> <mode params>`.
*
* @const int
*/
const RPL_CHANNELMODEIS = 324;
/**
* `<channel> <nickname>`.
*
* @const int
*/
const RPL_UNIQOPIS = 325;
/**
* `<channel> :No topic is set`.
*
* @const int
*/
const RPL_NOTOPIC = 331;
/**
* `<channel> :<topic>`.
*
* @const int
*/
const RPL_TOPIC = 332;
/**
* `<channel> <nick>`.
*
* @const int
*/
const RPL_INVITING = 341;
/**
* `<user> :Summoning user to IRC`.
*
* @const int
*/
const RPL_SUMMONING = 342;
/**
* `<channel> <invitemask>`.
*
* @const int
*/
const RPL_INVITELIST = 346;
/**
* `<channel> :End of channel invite list`.
*
* @const int
*/
const RPL_ENDOFINVITELIST = 347;
/**
* `<channel> <exceptionmask>`.
*
* @const int
*/
const RPL_EXCEPTLIST = 348;
/**
* `<channel> :End of channel exception list`.
*
* @const int
*/
const RPL_ENDOFEXCEPTLIST = 349;
/**
* `<version>.<debuglevel> <server> :<comments>`.
*
* @const int
*/
const RPL_VERSION = 351;
/**
* `<channel> <user> <host> <server> <nick> ( "H" / "G" > ["*"] [ ( "@" / "+" ) ] :<hopcount> <real name>`.
*
* @const int
*/
const RPL_WHOREPLY = 352;
/**
* `( "=" / "*" / "@" ) <channel> :[ "@" / "+" ] <nick> *( " " [ "@" / "+" ] <nick> )`.
*
* @const int
*/
const RPL_NAMREPLY = 353;
/**
* `<mask> <server> :<hopcount> <server info>`.
*
* @const int
*/
const RPL_LINKS = 364;
/**
* `<mask> :End of LINKS list`.
*
* @const int
*/
const RPL_ENDOFLINKS = 365;
/**
* `<channel> :End of NAMES list`.
*
* @const int
*/
const RPL_ENDOFNAMES = 366;
/**
* `<channel> <banmask>`.
*
* @const int
*/
const RPL_BANLIST = 367;
/**
* `<channel> :End of channel ban list`.
*
* @const int
*/
const RPL_ENDOFBANLIST = 368;
/**
* `<nick> :End of WHOWAS`.
*
* @const int
*/
const RPL_ENDOFWHOWAS = 369;
/**
* `:<string>`.
*
* @const int
*/
const RPL_INFO = 371;
/**
* `:- <text>`.
*
* @const int
*/
const RPL_MOTD = 372;
/**
* `:End of INFO list`.
*
* @const int
*/
const RPL_ENDOFINFO = 374;
/**
* `:- <server> Message of the day - `.
*
* @const int
*/
const RPL_MOTDSTART = 375;
/**
* `:End of MOTD command`.
*
* @const int
*/
const RPL_ENDOFMOTD = 376;
/**
* `:You are now an IRC operator`.
*
* @const int
*/
const RPL_YOUREOPER = 381;
/**
* `<config file> :Rehashing`.
*
* @const int
*/
const RPL_REHASHING = 382;
/**
* `You are service <servicename>`.
*
* @const int
*/
const RPL_YOURESERVICE = 383;
/**
* `<server> :<string showing server's local time>`.
*
* @const int
*/
const RPL_TIME = 391;
/**
* `:UserID Terminal Host`.
*
* @const int
*/
const RPL_USERSSTART = 392;
/**
* `:<username> <ttyline> <hostname>`.
*
* @const int
*/
const RPL_USERS = 393;
/**
* `:End of users`.
*
* @const int
*/
const RPL_ENDOFUSERS = 394;
/**
* `:Nobody logged in`.
*
* @const int
*/
const RPL_NOUSERS = 395;
/*
* Error replies are found in the range from 400 to 599.
*/
/**
* `<nickname> :No such nick/channel`.
*
* @const int
*/
const ERR_NOSUCHNICK = 401;
/**
* `<server name> :No such server`.
*
* @const int
*/
const ERR_NOSUCHSERVER = 402;
/**
* `<channel name> :No such channel`.
*
* @const int
*/
const ERR_NOSUCHCHANNEL = 403;
/**
* `<channel name> :Cannot send to channel`.
*
* @const int
*/
const ERR_CANNOTSENDTOCHAN = 404;
/**
* `<channel name> :You have joined too many channels`.
*
* @const int
*/
const ERR_TOOMANYCHANNELS = 405;
/**
* `<nickname> :There was no such nickname`.
*
* @const int
*/
const ERR_WASNOSUCHNICK = 406;
/**
* `<target> :<error code> recipients. <abort message>`.
*
* @const int
*/
const ERR_TOOMANYTARGETS = 407;
/**
* `<service name> :No such service`.
*
* @const int
*/
const ERR_NOSUCHSERVICE = 408;
/**
* `:No origin specified`.
*
* @const int
*/
const ERR_NOORIGIN = 409;
/**
* `:No recipient given (<command>)`.
*
* @const int
*/
const ERR_NORECIPIENT = 411;
/**
* `:No text to send`.
*
* @const int
*/
const ERR_NOTEXTTOSEND = 412;
/**
* `<mask> :No toplevel domain specified`.
*
* @const int
*/
const ERR_NOTOPLEVEL = 413;
/**
* `<mask> :Wildcard in toplevel domain`.
*
* @const int
*/
const ERR_WILDTOPLEVEL = 414;
/**
* `<mask> :Bad Server/host mask`.
*
* @const int
*/
const ERR_BADMASK = 415;
/**
* `<command> :Unknown command`.
*
* @const int
*/
const ERR_UNKNOWNCOMMAND = 421;
/**
* `:MOTD File is missing`.
*
* @const int
*/
const ERR_NOMOTD = 422;
/**
* `<server> :No administrative info available`.
*
* @const int
*/
const ERR_NOADMININFO = 423;
/**
* `:File error doing <file op> on <file>`.
*
* @const int
*/
const ERR_FILEERROR = 424;
/**
* `:No nickname given`.
*
* @const int
*/
const ERR_NONICKNAMEGIVEN = 431;
/**
* `<nick> :Erroneous nickname`.
*
* @const int
*/
const ERR_ERRONEUSNICKNAME = 432;
/**
* `<nick> :Nickname is already in use`.
*
* @const int
*/
const ERR_NICKNAMEINUSE = 433;
/**
* `<nick> :Nickname collision KILL from <user>@<host>`.
*
* @const int
*/
const ERR_NICKCOLLISION = 436;
/**
* `<nick/channel> :Nick/channel is temporarily unavailable`.
*
* @const int
*/
const ERR_UNAVAILRESOURCE = 437;
/**
* `<nick> <channel> :They aren't on that channel`.
*
* @const int
*/
const ERR_USERNOTINCHANNEL = 441;
/**
* `<channel> :You're not on that channel`.
*
* @const int
*/
const ERR_NOTONCHANNEL = 442;
/**
* `<user> <channel> :is already on channel`.
*
* @const int
*/
const ERR_USERONCHANNEL = 443;
/**
* `<user> :User not logged in`.
*
* @const int
*/
const ERR_NOLOGIN = 444;
/**
* `:SUMMON has been disabled`.
*
* @const int
*/
const ERR_SUMMONDISABLED = 445;
/**
* `:USERS has been disabled`.
*
* @const int
*/
const ERR_USERSDISABLED = 446;
/**
* `:You have not registered`.
*
* @const int
*/
const ERR_NOTREGISTERED = 451;
/**
* `<command> :Not enough parameters`.
*
* @const int
*/
const ERR_NEEDMOREPARAMS = 461;
/**
* `:Unauthorized command (already registered)`.
*
* @const int
*/
const ERR_ALREADYREGISTRED = 462;
/**
* `:Your host isn't among the privileged`.
*
* @const int
*/
const ERR_NOPERMFORHOST = 463;
/**
* `:Password incorrect`.
*
* @const int
*/
const ERR_PASSWDMISMATCH = 464;
/**
* `:You are banned from this server`.
*
* @const int
*/
const ERR_YOUREBANNEDCREEP = 465;
/**
* ":You will be banned from this server`.
*
* @const int
*/
const ERR_YOUWILLBEBANNED = 466;
/**
* `<channel> :Channel key already set`.
*
* @const int
*/
const ERR_KEYSET = 467;
/**
* `<channel> :Cannot join channel (+l)`.
*
* @const int
*/
const ERR_CHANNELISFULL = 471;
/**
* `<char> :is unknown mode char to me for <channel>`.
*
* @const int
*/
const ERR_UNKNOWNMODE = 472;
/**
* `<channel> :Cannot join channel (+i)`.
*
* @const int
*/
const ERR_INVITEONLYCHAN = 473;
/**
* `<channel> :Cannot join channel (+b)`.
*
* @const int
*/
const ERR_BANNEDFROMCHAN = 474;
/**
* `<channel> :Cannot join channel (+k)`.
*
* @const int
*/
const ERR_BADCHANNELKEY = 475;
/**
* `<channel> :Bad Channel Mask`.
*
* @const int
*/
const ERR_BADCHANMASK = 476;
/**
* `<channel> :Channel doesn't support modes`.
*
* @const int
*/
const ERR_NOCHANMODES = 477;
/**
* `<channel> <char> :Channel list is full`.
*
* @const int
*/
const ERR_BANLISTFULL = 478;
/**
* `:Permission Denied- You're not an IRC operator`.
*
* @const int
*/
const ERR_NOPRIVILEGES = 481;
/**
* `<channel> :You're not channel operator`.
*
* @const int
*/
const ERR_CHANOPRIVSNEEDED = 482;
/**
* `:You can't kill a server!`.
*
* @const int
*/
const ERR_CANTKILLSERVER = 483;
/**
* `:Your connection is restricted!`.
*
* @const int
*/
const ERR_RESTRICTED = 484;
/**
* `:You're not the original channel operator`.
*
* @const int