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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>InspIRCd: users.h File Reference</title>
<link href="inspircd.doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.4-20050815 -->
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">home</a> » <a class="el" href="dir_000001.html">brain</a> » <a class="el" href="dir_000002.html">inspircd-cvs</a> » <a class="el" href="dir_000003.html">inspircd</a> » <a class="el" href="dir_000004.html">include</a></div>
<h1>users.h File Reference</h1><code>#include "inspircd_config.h"</code><br>
<code>#include "<a class="el" href="channels_8h-source.html">channels.h</a>"</code><br>
<code>#include "inspstring.h"</code><br>
<code>#include "<a class="el" href="connection_8h-source.html">connection.h</a>"</code><br>
<code>#include <string></code><br>
<code>#include "<a class="el" href="hashcomp_8h-source.html">hashcomp.h</a>"</code><br>
<p>
Include dependency graph for users.h:<p><center><img src="users_8h__incl.gif" border="0" usemap="#users.h_map" alt=""></center>
<map name="users.h_map">
<area href="channels_8h-source.html" shape="rect" coords="128,108,213,135" alt="">
<area href="connection_8h-source.html" shape="rect" coords="121,159,220,185" alt="">
<area href="hashcomp_8h-source.html" shape="rect" coords="124,57,217,84" alt="">
</map>
<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="users_8h__dep__incl.gif" border="0" usemap="#users.hdep_map" alt=""></center>
<map name="users.hdep_map">
<area href="channels_8cpp-source.html" shape="rect" coords="531,235,629,261" alt="">
<area href="modules_8cpp-source.html" shape="rect" coords="531,387,629,413" alt="">
<area href="users_8cpp-source.html" shape="rect" coords="540,564,620,591" alt="">
<area href="commands_8h-source.html" shape="rect" coords="379,615,477,641" alt="">
<area href="cull__list_8h-source.html" shape="rect" coords="121,311,199,337" alt="">
<area href="globals_8h-source.html" shape="rect" coords="249,159,324,185" alt="">
<area href="typedefs_8h-source.html" shape="rect" coords="385,260,471,287" alt="">
<area href="inspircd_8h-source.html" shape="rect" coords="247,412,327,439" alt="">
<area href="userprocess_8h-source.html" shape="rect" coords="376,463,480,489" alt="">
<area href="mode_8h-source.html" shape="rect" coords="127,361,193,388" alt="">
<area href="message_8h-source.html" shape="rect" coords="385,311,471,337" alt="">
<area href="xline_8h-source.html" shape="rect" coords="397,513,459,540" alt="">
</map>
<p>
<a href="users_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classInvited.html">Invited</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Holds a channel name to which a user has been invited. <a href="classInvited.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classConnectClass.html">ConnectClass</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Holds information relevent to <connect allow> and <connect deny> tags in the config file. <a href="classConnectClass.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classuserrec.html">userrec</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Holds all information about a user This class stores all information about a user connected to the irc server. <a href="classuserrec.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classWhoWasUser.html">WhoWasUser</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">A lightweight userrec used by WHOWAS. <a href="classWhoWasUser.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#STATUS_5FOP">STATUS_OP</a> 4</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#STATUS_5FHOP">STATUS_HOP</a> 2</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#STATUS_5FVOICE">STATUS_VOICE</a> 1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#STATUS_5FNORMAL">STATUS_NORMAL</a> 0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#CC_5FALLOW">CC_ALLOW</a> 0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#CC_5FDENY">CC_DENY</a> 1</td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef std::vector< <a class="el" href="classInvited.html">Invited</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#InvitedList">InvitedList</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Holds a complete list of all channels to which a user has been invited and has not yet joined. <a href="#InvitedList"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef std::vector< <a class="el" href="classConnectClass.html">ConnectClass</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#ClassVector">ClassVector</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Holds a complete list of all allow and deny tags from the configuration file (connection classes). <a href="#ClassVector"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2">template<typename T> </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceirc.html#string">string</a> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="users_8h.html#ConvToStr_28const_20T_20_26in_29">ConvToStr</a> (const T &in)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#AddOper_28userrec_20_2Auser_29">AddOper</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#DeleteOper_28userrec_20_2Auser_29">DeleteOper</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a> (<a class="el" href="classuserrec.html">userrec</a> *user, const char *r)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#kill_5Flink_5Fsilent_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link_silent</a> (<a class="el" href="classuserrec.html">userrec</a> *user, const char *r)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#AddWhoWas_28userrec_20_2Au_29">AddWhoWas</a> (<a class="el" href="classuserrec.html">userrec</a> *u)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#AddClient_28int_20socket_2C_20char_20_2Ahost_2C_20int_20port_2C_20bool_20iscached_2C_20char_20_2Aip_29">AddClient</a> (int socket, char *host, int port, bool iscached, char *ip)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#FullConnectUser_28userrec_20_2Auser_29">FullConnectUser</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#ConnectUser_28userrec_20_2Auser_29">ConnectUser</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#ReHashNick_28char_20_2AOld_2C_20char_20_2ANew_29">ReHashNick</a> (char *Old, char *New)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="users_8h.html#force_5Fnickchange_28userrec_20_2Auser_2C_20const_20char_20_2Anewnick_29">force_nickchange</a> (<a class="el" href="classuserrec.html">userrec</a> *user, const char *newnick)</td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="CC_5FALLOW"></a><!-- doxytag: member="users.h::CC_ALLOW" ref="CC_5FALLOW" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define CC_ALLOW 0 </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8h-source.html#l00036">36</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00524">AddClient()</a>. </td>
</tr>
</table>
<a class="anchor" name="CC_5FDENY"></a><!-- doxytag: member="users.h::CC_DENY" ref="CC_5FDENY" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define CC_DENY 1 </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8h-source.html#l00037">37</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td>
</tr>
</table>
<a class="anchor" name="STATUS_5FHOP"></a><!-- doxytag: member="users.h::STATUS_HOP" ref="STATUS_5FHOP" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define STATUS_HOP 2 </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8h-source.html#l00032">32</a> of file <a class="el" href="users_8h-source.html">users.h</a>.
<p>
Referenced by <a class="el" href="channels_8cpp-source.html#l00459">kick_channel()</a>. </td>
</tr>
</table>
<a class="anchor" name="STATUS_5FNORMAL"></a><!-- doxytag: member="users.h::STATUS_NORMAL" ref="STATUS_5FNORMAL" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define STATUS_NORMAL 0 </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8h-source.html#l00034">34</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td>
</tr>
</table>
<a class="anchor" name="STATUS_5FOP"></a><!-- doxytag: member="users.h::STATUS_OP" ref="STATUS_5FOP" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define STATUS_OP 4 </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8h-source.html#l00031">31</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td>
</tr>
</table>
<a class="anchor" name="STATUS_5FVOICE"></a><!-- doxytag: member="users.h::STATUS_VOICE" ref="STATUS_5FVOICE" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">#define STATUS_VOICE 1 </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8h-source.html#l00033">33</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td>
</tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="ClassVector"></a><!-- doxytag: member="users.h::ClassVector" ref="ClassVector" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">typedef std::vector<<a class="el" href="classConnectClass.html">ConnectClass</a>> <a class="el" href="users_8h.html#ClassVector">ClassVector</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Holds a complete list of all allow and deny tags from the configuration file (connection classes).
<p>
<p>
Definition at line <a class="el" href="users_8h-source.html#l00107">107</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td>
</tr>
</table>
<a class="anchor" name="InvitedList"></a><!-- doxytag: member="users.h::InvitedList" ref="InvitedList" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">typedef std::vector<<a class="el" href="classInvited.html">Invited</a>> <a class="el" href="users_8h.html#InvitedList">InvitedList</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Holds a complete list of all channels to which a user has been invited and has not yet joined.
<p>
<p>
Definition at line <a class="el" href="users_8h-source.html#l00101">101</a> of file <a class="el" href="users_8h-source.html">users.h</a>. </td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="AddClient_28int_20socket_2C_20char_20_2Ahost_2C_20int_20port_2C_20bool_20iscached_2C_20char_20_2Aip_29"></a><!-- doxytag: member="users.h::AddClient" ref="AddClient_28int_20socket_2C_20char_20_2Ahost_2C_20int_20port_2C_20bool_20iscached_2C_20char_20_2Aip_29" args="(int socket, char *host, int port, bool iscached, char *ip)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void AddClient </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname" nowrap> <em>socket</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>char * </td>
<td class="mdname" nowrap> <em>host</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>port</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>iscached</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>char * </td>
<td class="mdname" nowrap> <em>ip</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00524">524</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="socketengine_8cpp-source.html#l00065">SocketEngine::AddFd()</a>, <a class="el" href="users_8h-source.html#l00036">CC_ALLOW</a>, <a class="el" href="channels_8h-source.html#l00254">ucrec::channel</a>, <a class="el" href="inspircd__io_8h-source.html#l00243">ServerConfig::Classes</a>, <a class="el" href="modules_8cpp.html#clientlist">clientlist</a>, <a class="el" href="users_8cpp-source.html#l00056">ConvToStr()</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, <a class="el" href="inspircd__io_8h-source.html#l00177">ServerConfig::dns_timeout</a>, <a class="el" href="inspircd_8h.html#FindServerNamePtr_28std_3A_3Astring_20servername_29">FindServerNamePtr()</a>, <a class="el" href="users_8cpp-source.html#l00349">kill_link()</a>, <a class="el" href="users_8cpp-source.html#l00052">local_users</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, <a class="el" href="xline_8h.html#matches_5Fexception_28const_20char_20_2Ahost_29">matches_exception()</a>, <a class="el" href="xline_8h.html#matches_5Fzline_28const_20char_20_2Aipaddr_29">matches_zline()</a>, <a class="el" href="inspircd_8h-source.html#l00111">InspIRCd::SE</a>, <a class="el" href="inspircd__io_8h-source.html#l00069">ServerConfig::ServerName</a>, <a class="el" href="inspircd__io_8h-source.html#l00194">ServerConfig::SoftLimit</a>, <a class="el" href="channels_8cpp.html#TIME">TIME</a>, <a class="el" href="channels_8h-source.html#l00249">ucrec::uc_modes</a>, and <a class="el" href="socketengine_8h-source.html#l00043">X_ESTAB_CLIENT</a>.<div class="fragment"><pre class="fragment"><a name="l00525"></a>00525 {
<a name="l00526"></a>00526 <a class="code" href="namespaceirc.html#string">string</a> tempnick;
<a name="l00527"></a>00527 <span class="keywordtype">char</span> tn2[MAXBUF];
<a name="l00528"></a>00528 user_hash::iterator iter;
<a name="l00529"></a>00529
<a name="l00530"></a>00530 tempnick = <a class="code" href="users_8cpp.html#ConvToStr_28const_20T_20_26in_29">ConvToStr</a>(socket) + <span class="stringliteral">"-unknown"</span>;
<a name="l00531"></a>00531 sprintf(tn2,<span class="stringliteral">"%lu-unknown"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)socket);
<a name="l00532"></a>00532
<a name="l00533"></a>00533 iter = <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.find(tempnick);
<a name="l00534"></a>00534
<a name="l00535"></a>00535 <span class="comment">// fix by brain.</span>
<a name="l00536"></a>00536 <span class="comment">// as these nicknames are 'RFC impossible', we can be sure nobody is going to be</span>
<a name="l00537"></a>00537 <span class="comment">// using one as a registered connection. As theyre per fd, we can also safely assume</span>
<a name="l00538"></a>00538 <span class="comment">// that we wont have collisions. Therefore, if the nick exists in the list, its only</span>
<a name="l00539"></a>00539 <span class="comment">// used by a dead socket, erase the iterator so that the new client may reclaim it.</span>
<a name="l00540"></a>00540 <span class="comment">// this was probably the cause of 'server ignores me when i hammer it with reconnects'</span>
<a name="l00541"></a>00541 <span class="comment">// issue in earlier alphas/betas</span>
<a name="l00542"></a>00542 <span class="keywordflow">if</span> (iter != <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.end())
<a name="l00543"></a>00543 {
<a name="l00544"></a>00544 <a class="code" href="classuserrec.html">userrec</a>* goner = iter->second;
<a name="l00545"></a>00545 <span class="keyword">delete</span> goner;
<a name="l00546"></a>00546 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.erase(iter);
<a name="l00547"></a>00547 }
<a name="l00548"></a>00548
<a name="l00549"></a>00549 <span class="comment">/*</span>
<a name="l00550"></a>00550 <span class="comment"> * It is OK to access the value here this way since we know</span>
<a name="l00551"></a>00551 <span class="comment"> * it exists, we just created it above.</span>
<a name="l00552"></a>00552 <span class="comment"> *</span>
<a name="l00553"></a>00553 <span class="comment"> * At NO other time should you access a value in a map or a</span>
<a name="l00554"></a>00554 <span class="comment"> * hash_map this way.</span>
<a name="l00555"></a>00555 <span class="comment"> */</span>
<a name="l00556"></a>00556 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick] = <span class="keyword">new</span> <a class="code" href="classuserrec.html">userrec</a>();
<a name="l00557"></a>00557
<a name="l00558"></a>00558 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"AddClient: %lu %s %d %s"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)socket,host,port,ip);
<a name="l00559"></a>00559
<a name="l00560"></a>00560 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->fd = socket;
<a name="l00561"></a>00561 strlcpy(clientlist[tempnick]->nick, tn2,NICKMAX);
<a name="l00562"></a>00562 strlcpy(clientlist[tempnick]->host, host,160);
<a name="l00563"></a>00563 strlcpy(clientlist[tempnick]->dhost, host,160);
<a name="l00564"></a>00564 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->server = (<span class="keywordtype">char</span>*)<a class="code" href="inspircd_8h.html#FindServerNamePtr_28std_3A_3Astring_20servername_29">FindServerNamePtr</a>(<a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#ServerName_5BMAXBUF_5D">ServerName</a>);
<a name="l00565"></a>00565 strlcpy(clientlist[tempnick]->ident, <span class="stringliteral">"unknown"</span>,IDENTMAX);
<a name="l00566"></a>00566 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->registered = 0;
<a name="l00567"></a>00567 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->signon = <a class="code" href="channels_8cpp.html#TIME">TIME</a> + <a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#dns_5Ftimeout">dns_timeout</a>;
<a name="l00568"></a>00568 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->lastping = 1;
<a name="l00569"></a>00569 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->port = port;
<a name="l00570"></a>00570 strlcpy(clientlist[tempnick]->ip,ip,16);
<a name="l00571"></a>00571
<a name="l00572"></a>00572 <span class="comment">// set the registration timeout for this user</span>
<a name="l00573"></a>00573 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> class_regtimeout = 90;
<a name="l00574"></a>00574 <span class="keywordtype">int</span> class_flood = 0;
<a name="l00575"></a>00575 <span class="keywordtype">long</span> class_threshold = 5;
<a name="l00576"></a>00576 <span class="keywordtype">long</span> class_sqmax = 262144; <span class="comment">// 256kb</span>
<a name="l00577"></a>00577 <span class="keywordtype">long</span> class_rqmax = 4096; <span class="comment">// 4k</span>
<a name="l00578"></a>00578
<a name="l00579"></a>00579 <span class="keywordflow">for</span> (ClassVector::iterator i = <a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#Classes">Classes</a>.begin(); i != <a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#Classes">Classes</a>.end(); i++)
<a name="l00580"></a>00580 {
<a name="l00581"></a>00581 <span class="keywordflow">if</span> (match(clientlist[tempnick]->host,i->host) && (i->type == <a class="code" href="users_8h.html#CC_5FALLOW">CC_ALLOW</a>))
<a name="l00582"></a>00582 {
<a name="l00583"></a>00583 class_regtimeout = (<span class="keywordtype">unsigned</span> long)i->registration_timeout;
<a name="l00584"></a>00584 class_flood = i->flood;
<a name="l00585"></a>00585 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->pingmax = i->pingtime;
<a name="l00586"></a>00586 class_threshold = i->threshold;
<a name="l00587"></a>00587 class_sqmax = i->sendqmax;
<a name="l00588"></a>00588 class_rqmax = i->recvqmax;
<a name="l00589"></a>00589 <span class="keywordflow">break</span>;
<a name="l00590"></a>00590 }
<a name="l00591"></a>00591 }
<a name="l00592"></a>00592
<a name="l00593"></a>00593 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->nping = <a class="code" href="channels_8cpp.html#TIME">TIME</a>+<a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->pingmax + <a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#dns_5Ftimeout">dns_timeout</a>;
<a name="l00594"></a>00594 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->timeout = <a class="code" href="channels_8cpp.html#TIME">TIME</a>+class_regtimeout;
<a name="l00595"></a>00595 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->flood = class_flood;
<a name="l00596"></a>00596 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->threshold = class_threshold;
<a name="l00597"></a>00597 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->sendqmax = class_sqmax;
<a name="l00598"></a>00598 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->recvqmax = class_rqmax;
<a name="l00599"></a>00599
<a name="l00600"></a>00600 <a class="code" href="classucrec.html">ucrec</a> a;
<a name="l00601"></a>00601 a.<a class="code" href="classucrec.html#channel">channel</a> = NULL;
<a name="l00602"></a>00602 a.<a class="code" href="classucrec.html#uc_5Fmodes">uc_modes</a> = 0;
<a name="l00603"></a>00603 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < MAXCHANS; i++)
<a name="l00604"></a>00604 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick]->chans.push_back(a);
<a name="l00605"></a>00605
<a name="l00606"></a>00606 <span class="keywordflow">if</span> (<a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.size() > <a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#SoftLimit">SoftLimit</a>)
<a name="l00607"></a>00607 {
<a name="l00608"></a>00608 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(clientlist[tempnick],<span class="stringliteral">"No more connections allowed"</span>);
<a name="l00609"></a>00609 <span class="keywordflow">return</span>;
<a name="l00610"></a>00610 }
<a name="l00611"></a>00611
<a name="l00612"></a>00612 <span class="keywordflow">if</span> (<a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.size() >= MAXCLIENTS)
<a name="l00613"></a>00613 {
<a name="l00614"></a>00614 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(clientlist[tempnick],<span class="stringliteral">"No more connections allowed"</span>);
<a name="l00615"></a>00615 <span class="keywordflow">return</span>;
<a name="l00616"></a>00616 }
<a name="l00617"></a>00617
<a name="l00618"></a>00618 <span class="comment">// this is done as a safety check to keep the file descriptors within range of fd_ref_table.</span>
<a name="l00619"></a>00619 <span class="comment">// its a pretty big but for the moment valid assumption:</span>
<a name="l00620"></a>00620 <span class="comment">// file descriptors are handed out starting at 0, and are recycled as theyre freed.</span>
<a name="l00621"></a>00621 <span class="comment">// therefore if there is ever an fd over 65535, 65536 clients must be connected to the</span>
<a name="l00622"></a>00622 <span class="comment">// irc server at once (or the irc server otherwise initiating this many connections, files etc)</span>
<a name="l00623"></a>00623 <span class="comment">// which for the time being is a physical impossibility (even the largest networks dont have more</span>
<a name="l00624"></a>00624 <span class="comment">// than about 10,000 users on ONE server!)</span>
<a name="l00625"></a>00625 <span class="keywordflow">if</span> ((<span class="keywordtype">unsigned</span>)socket > 65534)
<a name="l00626"></a>00626 {
<a name="l00627"></a>00627 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(clientlist[tempnick],<span class="stringliteral">"Server is full"</span>);
<a name="l00628"></a>00628 <span class="keywordflow">return</span>;
<a name="l00629"></a>00629 }
<a name="l00630"></a>00630 <span class="keywordtype">char</span>* e = <a class="code" href="xline_8h.html#matches_5Fexception_28const_20char_20_2Ahost_29">matches_exception</a>(ip);
<a name="l00631"></a>00631 <span class="keywordflow">if</span> (!e)
<a name="l00632"></a>00632 {
<a name="l00633"></a>00633 <span class="keywordtype">char</span>* r = <a class="code" href="xline_8h.html#matches_5Fzline_28const_20char_20_2Aipaddr_29">matches_zline</a>(ip);
<a name="l00634"></a>00634 <span class="keywordflow">if</span> (r)
<a name="l00635"></a>00635 {
<a name="l00636"></a>00636 <span class="keywordtype">char</span> reason[MAXBUF];
<a name="l00637"></a>00637 snprintf(reason,MAXBUF,<span class="stringliteral">"Z-Lined: %s"</span>,r);
<a name="l00638"></a>00638 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(clientlist[tempnick],reason);
<a name="l00639"></a>00639 <span class="keywordflow">return</span>;
<a name="l00640"></a>00640 }
<a name="l00641"></a>00641 }
<a name="l00642"></a>00642 <a class="code" href="modules_8cpp.html#fd_5Fref_5Ftable_5B_36_35_35_33_36_5D">fd_ref_table</a>[socket] = <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[tempnick];
<a name="l00643"></a>00643 <a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.push_back(clientlist[tempnick]);
<a name="l00644"></a>00644 <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-><a class="code" href="classInspIRCd.html#SE">SE</a>-><a class="code" href="classSocketEngine.html#AddFd_28int_20fd_2C_20bool_20readable_2C_20char_20type_29">AddFd</a>(socket,<span class="keyword">true</span>,<a class="code" href="socketengine_8h.html#X_5FESTAB_5FCLIENT">X_ESTAB_CLIENT</a>);
<a name="l00645"></a>00645 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="AddOper_28userrec_20_2Auser_29"></a><!-- doxytag: member="users.h::AddOper" ref="AddOper_28userrec_20_2Auser_29" args="(userrec *user)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void AddOper </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>user</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00330">330</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="users_8cpp-source.html#l00054">all_opers</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, and <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>.<div class="fragment"><pre class="fragment"><a name="l00331"></a>00331 {
<a name="l00332"></a>00332 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Oper added to optimization list"</span>);
<a name="l00333"></a>00333 <a class="code" href="users_8cpp.html#all_5Fopers">all_opers</a>.push_back(user);
<a name="l00334"></a>00334 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="AddWhoWas_28userrec_20_2Au_29"></a><!-- doxytag: member="users.h::AddWhoWas" ref="AddWhoWas_28userrec_20_2Au_29" args="(userrec *u)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void AddWhoWas </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>u</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00471">471</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, <a class="el" href="users_8h-source.html#l00138">userrec::dhost</a>, <a class="el" href="users_8h-source.html#l00341">WhoWasUser::dhost</a>, <a class="el" href="users_8h-source.html#l00142">userrec::fullname</a>, <a class="el" href="users_8h-source.html#l00343">WhoWasUser::fullname</a>, <a class="el" href="connection_8h-source.html#l00046">connection::host</a>, <a class="el" href="users_8h-source.html#l00342">WhoWasUser::host</a>, <a class="el" href="users_8h-source.html#l00133">userrec::ident</a>, <a class="el" href="users_8h-source.html#l00340">WhoWasUser::ident</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, <a class="el" href="users_8h-source.html#l00339">WhoWasUser::nick</a>, <a class="el" href="users_8h-source.html#l00128">userrec::nick</a>, <a class="el" href="users_8h-source.html#l00157">userrec::server</a>, <a class="el" href="users_8h-source.html#l00344">WhoWasUser::server</a>, <a class="el" href="connection_8h-source.html#l00088">connection::signon</a>, <a class="el" href="users_8h-source.html#l00345">WhoWasUser::signon</a>, <a class="el" href="channels_8cpp.html#TIME">TIME</a>, <a class="el" href="users_8cpp.html#whowas">whowas</a>, <a class="el" href="channels_8cpp.html#WHOWAS_5FMAX">WHOWAS_MAX</a>, and <a class="el" href="channels_8cpp.html#WHOWAS_5FSTALE">WHOWAS_STALE</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00349">kill_link()</a>.<div class="fragment"><pre class="fragment"><a name="l00472"></a>00472 {
<a name="l00473"></a>00473 whowas_hash::iterator iter = <a class="code" href="users_8cpp.html#whowas">whowas</a>.find(u-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>);
<a name="l00474"></a>00474 <a class="code" href="classWhoWasUser.html">WhoWasUser</a> *a = <span class="keyword">new</span> <a class="code" href="classWhoWasUser.html">WhoWasUser</a>();
<a name="l00475"></a>00475 strlcpy(a-><a class="code" href="classWhoWasUser.html#nick_5BNICKMAX_5D">nick</a>,u-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,NICKMAX);
<a name="l00476"></a>00476 strlcpy(a-><a class="code" href="classWhoWasUser.html#ident_5BIDENTMAX_2B_31_5D">ident</a>,u-><a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,IDENTMAX);
<a name="l00477"></a>00477 strlcpy(a-><a class="code" href="classWhoWasUser.html#dhost_5B_31_36_30_5D">dhost</a>,u-><a class="code" href="classuserrec.html#dhost_5B_31_36_30_5D">dhost</a>,160);
<a name="l00478"></a>00478 strlcpy(a-><a class="code" href="classWhoWasUser.html#host_5B_31_36_30_5D">host</a>,u-><a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>,160);
<a name="l00479"></a>00479 strlcpy(a-><a class="code" href="classWhoWasUser.html#fullname_5BMAXGECOS_2B_31_5D">fullname</a>,u-><a class="code" href="classuserrec.html#fullname_5BMAXGECOS_2B_31_5D">fullname</a>,MAXGECOS);
<a name="l00480"></a>00480 strlcpy(a-><a class="code" href="classWhoWasUser.html#server_5B_32_35_36_5D">server</a>,u-><a class="code" href="classuserrec.html#server">server</a>,256);
<a name="l00481"></a>00481 a-><a class="code" href="classWhoWasUser.html#signon">signon</a> = u-><a class="code" href="classconnection.html#signon">signon</a>;
<a name="l00482"></a>00482
<a name="l00483"></a>00483 <span class="comment">/* MAX_WHOWAS: max number of /WHOWAS items</span>
<a name="l00484"></a>00484 <span class="comment"> * WHOWAS_STALE: number of hours before a WHOWAS item is marked as stale and</span>
<a name="l00485"></a>00485 <span class="comment"> * can be replaced by a newer one</span>
<a name="l00486"></a>00486 <span class="comment"> */</span>
<a name="l00487"></a>00487
<a name="l00488"></a>00488 <span class="keywordflow">if</span> (iter == <a class="code" href="users_8cpp.html#whowas">whowas</a>.end())
<a name="l00489"></a>00489 {
<a name="l00490"></a>00490 <span class="keywordflow">if</span> (<a class="code" href="users_8cpp.html#whowas">whowas</a>.size() >= (unsigned)<a class="code" href="channels_8cpp.html#WHOWAS_5FMAX">WHOWAS_MAX</a>)
<a name="l00491"></a>00491 {
<a name="l00492"></a>00492 <span class="keywordflow">for</span> (whowas_hash::iterator i = <a class="code" href="users_8cpp.html#whowas">whowas</a>.begin(); i != <a class="code" href="users_8cpp.html#whowas">whowas</a>.end(); i++)
<a name="l00493"></a>00493 {
<a name="l00494"></a>00494 <span class="comment">// 3600 seconds in an hour ;)</span>
<a name="l00495"></a>00495 <span class="keywordflow">if</span> ((i->second->signon)<(TIME-(WHOWAS_STALE*3600)))
<a name="l00496"></a>00496 {
<a name="l00497"></a>00497 <span class="comment">// delete the old one</span>
<a name="l00498"></a>00498 <span class="keywordflow">if</span> (i->second) <span class="keyword">delete</span> i->second;
<a name="l00499"></a>00499 <span class="comment">// replace with new one</span>
<a name="l00500"></a>00500 i->second = a;
<a name="l00501"></a>00501 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"added WHOWAS entry, purged an old record"</span>);
<a name="l00502"></a>00502 <span class="keywordflow">return</span>;
<a name="l00503"></a>00503 }
<a name="l00504"></a>00504 }
<a name="l00505"></a>00505 <span class="comment">// no space left and user doesnt exist. Don't leave ram in use!</span>
<a name="l00506"></a>00506 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Not able to update whowas (list at WHOWAS_MAX entries and trying to add new?), freeing excess ram"</span>);
<a name="l00507"></a>00507 <span class="keyword">delete</span> a;
<a name="l00508"></a>00508 }
<a name="l00509"></a>00509 <span class="keywordflow">else</span>
<a name="l00510"></a>00510 {
<a name="l00511"></a>00511 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"added fresh WHOWAS entry"</span>);
<a name="l00512"></a>00512 <a class="code" href="users_8cpp.html#whowas">whowas</a>[a-><a class="code" href="classWhoWasUser.html#nick_5BNICKMAX_5D">nick</a>] = a;
<a name="l00513"></a>00513 }
<a name="l00514"></a>00514 }
<a name="l00515"></a>00515 <span class="keywordflow">else</span>
<a name="l00516"></a>00516 {
<a name="l00517"></a>00517 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"updated WHOWAS entry"</span>);
<a name="l00518"></a>00518 <span class="keywordflow">if</span> (iter->second) <span class="keyword">delete</span> iter->second;
<a name="l00519"></a>00519 iter->second = a;
<a name="l00520"></a>00520 }
<a name="l00521"></a>00521 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="ConnectUser_28userrec_20_2Auser_29"></a><!-- doxytag: member="users.h::ConnectUser" ref="ConnectUser_28userrec_20_2Auser_29" args="(userrec *user)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void ConnectUser </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>user</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00731">731</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="users_8h-source.html#l00185">userrec::dns_done</a>, <a class="el" href="users_8cpp-source.html#l00647">FullConnectUser()</a>, and <a class="el" href="connection_8h-source.html#l00080">connection::registered</a>.<div class="fragment"><pre class="fragment"><a name="l00732"></a>00732 {
<a name="l00733"></a>00733 <span class="comment">// dns is already done, things are fast. no need to wait for dns to complete just pass them straight on</span>
<a name="l00734"></a>00734 <span class="keywordflow">if</span> ((user-><a class="code" href="classuserrec.html#dns_5Fdone">dns_done</a>) && (user-><a class="code" href="classconnection.html#registered">registered</a> >= 3) && (AllModulesReportReady(user)))
<a name="l00735"></a>00735 {
<a name="l00736"></a>00736 <a class="code" href="users_8cpp.html#FullConnectUser_28userrec_20_2Auser_29">FullConnectUser</a>(user);
<a name="l00737"></a>00737 }
<a name="l00738"></a>00738 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="ConvToStr_28const_20T_20_26in_29"></a><!-- doxytag: member="users.h::ConvToStr" ref="ConvToStr_28const_20T_20_26in_29" args="(const T &in)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="mdPrefix" colspan="4">
template<typename T> </td>
</tr>
<tr>
<td class="md" nowrap valign="top"><a class="el" href="namespaceirc.html#string">string</a> ConvToStr </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const T & </td>
<td class="mdname1" valign="top" nowrap> <em>in</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00056">56</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00524">AddClient()</a>.<div class="fragment"><pre class="fragment"><a name="l00057"></a>00057 {
<a name="l00058"></a>00058 stringstream tmp;
<a name="l00059"></a>00059 <span class="keywordflow">if</span> (!(tmp << in)) <span class="keywordflow">return</span> <a class="code" href="namespaceirc.html#string">string</a>();
<a name="l00060"></a>00060 <span class="keywordflow">return</span> tmp.str();
<a name="l00061"></a>00061 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="DeleteOper_28userrec_20_2Auser_29"></a><!-- doxytag: member="users.h::DeleteOper" ref="DeleteOper_28userrec_20_2Auser_29" args="(userrec *user)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void DeleteOper </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>user</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00336">336</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="users_8cpp-source.html#l00054">all_opers</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, and <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>.<div class="fragment"><pre class="fragment"><a name="l00337"></a>00337 {
<a name="l00338"></a>00338 <span class="keywordflow">for</span> (std::vector<userrec*>::iterator a = <a class="code" href="users_8cpp.html#all_5Fopers">all_opers</a>.begin(); a < <a class="code" href="users_8cpp.html#all_5Fopers">all_opers</a>.end(); a++)
<a name="l00339"></a>00339 {
<a name="l00340"></a>00340 <span class="keywordflow">if</span> (*a == user)
<a name="l00341"></a>00341 {
<a name="l00342"></a>00342 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Oper removed from optimization list"</span>);
<a name="l00343"></a>00343 <a class="code" href="users_8cpp.html#all_5Fopers">all_opers</a>.erase(a);
<a name="l00344"></a>00344 <span class="keywordflow">return</span>;
<a name="l00345"></a>00345 }
<a name="l00346"></a>00346 }
<a name="l00347"></a>00347 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="force_5Fnickchange_28userrec_20_2Auser_2C_20const_20char_20_2Anewnick_29"></a><!-- doxytag: member="users.h::force_nickchange" ref="force_5Fnickchange_28userrec_20_2Auser_2C_20const_20char_20_2Anewnick_29" args="(userrec *user, const char *newnick)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void force_nickchange </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname" nowrap> <em>user</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>newnick</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00769">769</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="modules_8h-source.html#l00090">FOREACH_RESULT</a>, <a class="el" href="users_8cpp-source.html#l00349">kill_link()</a>, <a class="el" href="xline_8h.html#matches_5Fqline_28const_20char_20_2Anick_29">matches_qline()</a>, <a class="el" href="inspircd_8h-source.html#l00110">InspIRCd::Parser</a>, <a class="el" href="connection_8h-source.html#l00080">connection::registered</a>, <a class="el" href="inspircd_8h-source.html#l00112">InspIRCd::stats</a>, and <a class="el" href="inspircd_8h-source.html#l00080">serverstats::statsCollisions</a>.
<p>
Referenced by <a class="el" href="modules_8cpp-source.html#l00385">Server::ChangeUserNick()</a>.<div class="fragment"><pre class="fragment"><a name="l00770"></a>00770 {
<a name="l00771"></a>00771 <span class="keywordtype">char</span> nick[MAXBUF];
<a name="l00772"></a>00772 <span class="keywordtype">int</span> MOD_RESULT = 0;
<a name="l00773"></a>00773
<a name="l00774"></a>00774 strcpy(nick,<span class="stringliteral">""</span>);
<a name="l00775"></a>00775
<a name="l00776"></a>00776 <a class="code" href="modules_8h.html#FOREACH_5FRESULT_28x_29">FOREACH_RESULT</a>(OnUserPreNick(user,newnick));
<a name="l00777"></a>00777 <span class="keywordflow">if</span> (MOD_RESULT) {
<a name="l00778"></a>00778 <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-><a class="code" href="classInspIRCd.html#stats">stats</a>-><a class="code" href="classserverstats.html#statsCollisions">statsCollisions</a>++;
<a name="l00779"></a>00779 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(user,<span class="stringliteral">"Nickname collision"</span>);
<a name="l00780"></a>00780 <span class="keywordflow">return</span>;
<a name="l00781"></a>00781 }
<a name="l00782"></a>00782 <span class="keywordflow">if</span> (<a class="code" href="xline_8h.html#matches_5Fqline_28const_20char_20_2Anick_29">matches_qline</a>(newnick))
<a name="l00783"></a>00783 {
<a name="l00784"></a>00784 <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-><a class="code" href="classInspIRCd.html#stats">stats</a>-><a class="code" href="classserverstats.html#statsCollisions">statsCollisions</a>++;
<a name="l00785"></a>00785 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(user,<span class="stringliteral">"Nickname collision"</span>);
<a name="l00786"></a>00786 <span class="keywordflow">return</span>;
<a name="l00787"></a>00787 }
<a name="l00788"></a>00788
<a name="l00789"></a>00789 <span class="keywordflow">if</span> (user)
<a name="l00790"></a>00790 {
<a name="l00791"></a>00791 <span class="keywordflow">if</span> (newnick)
<a name="l00792"></a>00792 {
<a name="l00793"></a>00793 strncpy(nick,newnick,MAXBUF);
<a name="l00794"></a>00794 }
<a name="l00795"></a>00795 <span class="keywordflow">if</span> (user-><a class="code" href="classconnection.html#registered">registered</a> == 7)
<a name="l00796"></a>00796 {
<a name="l00797"></a>00797 <span class="keywordtype">char</span>* pars[1];
<a name="l00798"></a>00798 pars[0] = nick;
<a name="l00799"></a>00799 <a class="code" href="namespaceirc.html#string">std::string</a> cmd = <span class="stringliteral">"NICK"</span>;
<a name="l00800"></a>00800 <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-><a class="code" href="classInspIRCd.html#Parser">Parser</a>->CallHandler(cmd,pars,1,user);
<a name="l00801"></a>00801 }
<a name="l00802"></a>00802 }
<a name="l00803"></a>00803 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="FullConnectUser_28userrec_20_2Auser_29"></a><!-- doxytag: member="users.h::FullConnectUser" ref="FullConnectUser_28userrec_20_2Auser_29" args="(userrec *user)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void FullConnectUser </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>user</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00647">647</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, <a class="el" href="connection_8h-source.html#l00042">connection::fd</a>, <a class="el" href="modules_8h-source.html#l00082">FOREACH_MOD</a>, <a class="el" href="connection_8h-source.html#l00070">connection::haspassed</a>, <a class="el" href="connection_8h-source.html#l00046">connection::host</a>, <a class="el" href="users_8h-source.html#l00133">userrec::ident</a>, <a class="el" href="connection_8h-source.html#l00092">connection::idle_lastmsg</a>, <a class="el" href="connection_8h-source.html#l00050">connection::ip</a>, <a class="el" href="users_8cpp-source.html#l00349">kill_link()</a>, <a class="el" href="users_8cpp-source.html#l00412">kill_link_silent()</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, <a class="el" href="xline_8h.html#matches_5Fexception_28const_20char_20_2Ahost_29">matches_exception()</a>, <a class="el" href="xline_8h.html#matches_5Fgline_28const_20char_20_2Ahost_29">matches_gline()</a>, <a class="el" href="xline_8h.html#matches_5Fkline_28const_20char_20_2Ahost_29">matches_kline()</a>, <a class="el" href="inspircd__io_8h-source.html#l00075">ServerConfig::Network</a>, <a class="el" href="users_8h-source.html#l00128">userrec::nick</a>, <a class="el" href="connection_8h-source.html#l00076">connection::port</a>, <a class="el" href="connection_8h-source.html#l00080">connection::registered</a>, <a class="el" href="inspircd__io_8h-source.html#l00069">ServerConfig::ServerName</a>, <a class="el" href="inspircd_8h-source.html#l00112">InspIRCd::stats</a>, <a class="el" href="inspircd_8h-source.html#l00084">serverstats::statsConnects</a>, <a class="el" href="channels_8cpp.html#TIME">TIME</a>, <a class="el" href="globals_8h.html#WriteOpers_28char_20_2Atext_2C_2E_2E_2E_29">WriteOpers()</a>, and <a class="el" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ()</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00731">ConnectUser()</a>.<div class="fragment"><pre class="fragment"><a name="l00648"></a>00648 {
<a name="l00649"></a>00649 <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-><a class="code" href="classInspIRCd.html#stats">stats</a>-><a class="code" href="classserverstats.html#statsConnects">statsConnects</a>++;
<a name="l00650"></a>00650 user-><a class="code" href="classconnection.html#idle_5Flastmsg">idle_lastmsg</a> = <a class="code" href="channels_8cpp.html#TIME">TIME</a>;
<a name="l00651"></a>00651 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"ConnectUser: %s"</span>,user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>);
<a name="l00652"></a>00652
<a name="l00653"></a>00653 <span class="keywordflow">if</span> ((strcmp(Passwd(user),<span class="stringliteral">""</span>)) && (!user-><a class="code" href="classconnection.html#haspassed">haspassed</a>))
<a name="l00654"></a>00654 {
<a name="l00655"></a>00655 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(user,<span class="stringliteral">"Invalid password"</span>);
<a name="l00656"></a>00656 <span class="keywordflow">return</span>;
<a name="l00657"></a>00657 }
<a name="l00658"></a>00658 <span class="keywordflow">if</span> (IsDenied(user))
<a name="l00659"></a>00659 {
<a name="l00660"></a>00660 <a class="code" href="users_8cpp.html#kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link</a>(user,<span class="stringliteral">"Unauthorised connection"</span>);
<a name="l00661"></a>00661 <span class="keywordflow">return</span>;
<a name="l00662"></a>00662 }
<a name="l00663"></a>00663
<a name="l00664"></a>00664 <span class="keywordtype">char</span> match_against[MAXBUF];
<a name="l00665"></a>00665 snprintf(match_against,MAXBUF,<span class="stringliteral">"%s@%s"</span>,user-><a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-><a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>);
<a name="l00666"></a>00666 <span class="keywordtype">char</span>* e = <a class="code" href="xline_8h.html#matches_5Fexception_28const_20char_20_2Ahost_29">matches_exception</a>(match_against);
<a name="l00667"></a>00667 <span class="keywordflow">if</span> (!e)
<a name="l00668"></a>00668 {
<a name="l00669"></a>00669 <span class="keywordtype">char</span>* r = <a class="code" href="xline_8h.html#matches_5Fgline_28const_20char_20_2Ahost_29">matches_gline</a>(match_against);
<a name="l00670"></a>00670 <span class="keywordflow">if</span> (r)
<a name="l00671"></a>00671 {
<a name="l00672"></a>00672 <span class="keywordtype">char</span> reason[MAXBUF];
<a name="l00673"></a>00673 snprintf(reason,MAXBUF,<span class="stringliteral">"G-Lined: %s"</span>,r);
<a name="l00674"></a>00674 <a class="code" href="users_8cpp.html#kill_5Flink_5Fsilent_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link_silent</a>(user,reason);
<a name="l00675"></a>00675 <span class="keywordflow">return</span>;
<a name="l00676"></a>00676 }
<a name="l00677"></a>00677 r = <a class="code" href="xline_8h.html#matches_5Fkline_28const_20char_20_2Ahost_29">matches_kline</a>(user-><a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>);
<a name="l00678"></a>00678 <span class="keywordflow">if</span> (r)
<a name="l00679"></a>00679 {
<a name="l00680"></a>00680 <span class="keywordtype">char</span> reason[MAXBUF];
<a name="l00681"></a>00681 snprintf(reason,MAXBUF,<span class="stringliteral">"K-Lined: %s"</span>,r);
<a name="l00682"></a>00682 <a class="code" href="users_8cpp.html#kill_5Flink_5Fsilent_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29">kill_link_silent</a>(user,reason);
<a name="l00683"></a>00683 <span class="keywordflow">return</span>;
<a name="l00684"></a>00684 }
<a name="l00685"></a>00685 }
<a name="l00686"></a>00686
<a name="l00687"></a>00687
<a name="l00688"></a>00688 <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-><a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"NOTICE Auth :Welcome to \002%s\002!"</span>,<a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#Network_5BMAXBUF_5D">Network</a>);
<a name="l00689"></a>00689 <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-><a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"001 %s :Welcome to the %s IRC Network %s!%s@%s"</span>,user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,<a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#Network_5BMAXBUF_5D">Network</a>,user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,user-><a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-><a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>);
<a name="l00690"></a>00690 <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-><a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"002 %s :Your host is %s, running version %s"</span>,user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,<a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#ServerName_5BMAXBUF_5D">ServerName</a>,VERSION);
<a name="l00691"></a>00691 <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-><a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"003 %s :This server was created %s %s"</span>,user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,__TIME__,__DATE__);
<a name="l00692"></a>00692 <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-><a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"004 %s %s %s iowghraAsORVSxNCWqBzvdHtGI lvhopsmntikrRcaqOALQbSeKVfHGCuzN"</span>,user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,<a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#ServerName_5BMAXBUF_5D">ServerName</a>,VERSION);
<a name="l00693"></a>00693 <span class="comment">// the neatest way to construct the initial 005 numeric, considering the number of configure constants to go in it...</span>
<a name="l00694"></a>00694 std::stringstream v;
<a name="l00695"></a>00695 v << <span class="stringliteral">"WALLCHOPS MODES=13 CHANTYPES=# PREFIX=(ohv)@%+ MAP SAFELIST MAXCHANNELS="</span> << MAXCHANS;
<a name="l00696"></a>00696 v << <span class="stringliteral">" MAXBANS=60 NICKLEN="</span> << NICKMAX;
<a name="l00697"></a>00697 v << <span class="stringliteral">" TOPICLEN="</span> << MAXTOPIC << <span class="stringliteral">" KICKLEN="</span> << MAXKICK << <span class="stringliteral">" MAXTARGETS=20 AWAYLEN="</span> << MAXAWAY << <span class="stringliteral">" CHANMODES=ohvb,k,l,psmnti NETWORK="</span>;
<a name="l00698"></a>00698 v << <a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#Network_5BMAXBUF_5D">Network</a>;
<a name="l00699"></a>00699 <a class="code" href="namespaceirc.html#string">std::string</a> data005 = v.str();
<a name="l00700"></a>00700 <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> On005Numeric(data005);
<a name="l00701"></a>00701 <span class="comment">// anfl @ #ratbox, efnet reminded me that according to the RFC this cant contain more than 13 tokens per line...</span>
<a name="l00702"></a>00702 <span class="comment">// so i'd better split it :)</span>
<a name="l00703"></a>00703 std::stringstream out(data005);
<a name="l00704"></a>00704 <a class="code" href="namespaceirc.html#string">std::string</a> token = <span class="stringliteral">""</span>;
<a name="l00705"></a>00705 <a class="code" href="namespaceirc.html#string">std::string</a> line5 = <span class="stringliteral">""</span>;
<a name="l00706"></a>00706 <span class="keywordtype">int</span> token_counter = 0;
<a name="l00707"></a>00707 <span class="keywordflow">while</span> (!out.eof())
<a name="l00708"></a>00708 {
<a name="l00709"></a>00709 out >> token;
<a name="l00710"></a>00710 line5 = line5 + token + <span class="stringliteral">" "</span>;
<a name="l00711"></a>00711 token_counter++;
<a name="l00712"></a>00712 <span class="keywordflow">if</span> ((token_counter >= 13) || (out.eof() == <span class="keyword">true</span>))
<a name="l00713"></a>00713 {
<a name="l00714"></a>00714 <a class="code" href="globals_8h.html#WriteServ_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteServ</a>(user-><a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"005 %s %s:are supported by this server"</span>,user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,line5.c_str());
<a name="l00715"></a>00715 line5 = <span class="stringliteral">""</span>;
<a name="l00716"></a>00716 token_counter = 0;
<a name="l00717"></a>00717 }
<a name="l00718"></a>00718 }
<a name="l00719"></a>00719 ShowMOTD(user);
<a name="l00720"></a>00720
<a name="l00721"></a>00721 <span class="comment">// fix 3 by brain, move registered = 7 below these so that spurious modes and host changes dont go out</span>
<a name="l00722"></a>00722 <span class="comment">// onto the network and produce 'fake direction'</span>
<a name="l00723"></a>00723 <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnUserConnect(user);
<a name="l00724"></a>00724 <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnGlobalConnect(user);
<a name="l00725"></a>00725 user-><a class="code" href="classconnection.html#registered">registered</a> = 7;
<a name="l00726"></a>00726 <a class="code" href="globals_8h.html#WriteOpers_28char_20_2Atext_2C_2E_2E_2E_29">WriteOpers</a>(<span class="stringliteral">"*** Client connecting on port %lu: %s!%s@%s [%s]"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)user-><a class="code" href="classconnection.html#port">port</a>,user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,user-><a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-><a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>,user-><a class="code" href="classconnection.html#ip_5B_31_36_5D">ip</a>);
<a name="l00727"></a>00727 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29"></a><!-- doxytag: member="users.h::kill_link" ref="kill_5Flink_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29" args="(userrec *user, const char *r)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void kill_link </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname" nowrap> <em>user</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>r</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00349">349</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="users_8cpp-source.html#l00471">AddWhoWas()</a>, <a class="el" href="modules_8cpp.html#clientlist">clientlist</a>, <a class="el" href="users_8cpp-source.html#l00093">userrec::CloseSocket()</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, <a class="el" href="socketengine_8cpp-source.html#l00103">SocketEngine::DelFd()</a>, <a class="el" href="connection_8h-source.html#l00042">connection::fd</a>, <a class="el" href="users_8cpp-source.html#l00295">userrec::FlushWriteBuf()</a>, <a class="el" href="modules_8h-source.html#l00082">FOREACH_MOD</a>, <a class="el" href="classServerConfig.html#GetIOHook_28int_20port_29">ServerConfig::GetIOHook()</a>, <a class="el" href="connection_8h-source.html#l00046">connection::host</a>, <a class="el" href="users_8h-source.html#l00133">userrec::ident</a>, <a class="el" href="users_8cpp-source.html#l00052">local_users</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, <a class="el" href="users_8h-source.html#l00128">userrec::nick</a>, <a class="el" href="modules_8cpp-source.html#l00270">Module::OnRawSocketClose()</a>, <a class="el" href="connection_8h-source.html#l00076">connection::port</a>, <a class="el" href="connection_8h-source.html#l00080">connection::registered</a>, <a class="el" href="inspircd_8h-source.html#l00111">InspIRCd::SE</a>, <a class="el" href="globals_8h.html#Write_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">Write()</a>, <a class="el" href="globals_8h.html#WriteCommonExcept_28userrec_20_2Au_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteCommonExcept()</a>, and <a class="el" href="globals_8h.html#WriteOpers_28char_20_2Atext_2C_2E_2E_2E_29">WriteOpers()</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00524">AddClient()</a>, <a class="el" href="users_8cpp-source.html#l00769">force_nickchange()</a>, <a class="el" href="users_8cpp-source.html#l00647">FullConnectUser()</a>, <a class="el" href="modules_8cpp-source.html#l00609">Server::PseudoToUser()</a>, and <a class="el" href="modules_8cpp-source.html#l00390">Server::QuitUser()</a>.<div class="fragment"><pre class="fragment"><a name="l00350"></a>00350 {
<a name="l00351"></a>00351 user_hash::iterator iter = <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.find(user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>);
<a name="l00352"></a>00352
<a name="l00353"></a>00353 <span class="keywordtype">char</span> reason[MAXBUF];
<a name="l00354"></a>00354
<a name="l00355"></a>00355 strncpy(reason,r,MAXBUF);
<a name="l00356"></a>00356
<a name="l00357"></a>00357 <span class="keywordflow">if</span> (strlen(reason)>MAXQUIT)
<a name="l00358"></a>00358 {
<a name="l00359"></a>00359 reason[MAXQUIT-1] = <span class="charliteral">'\0'</span>;
<a name="l00360"></a>00360 }
<a name="l00361"></a>00361
<a name="l00362"></a>00362 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"kill_link: %s '%s'"</span>,user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,reason);
<a name="l00363"></a>00363 <a class="code" href="globals_8h.html#Write_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">Write</a>(user-><a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"ERROR :Closing link (%s@%s) [%s]"</span>,user-><a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-><a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>,reason);
<a name="l00364"></a>00364 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"closing fd %lu"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)user-><a class="code" href="classconnection.html#fd">fd</a>);
<a name="l00365"></a>00365
<a name="l00366"></a>00366 <span class="keywordflow">if</span> (user-><a class="code" href="classconnection.html#registered">registered</a> == 7) {
<a name="l00367"></a>00367 <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnUserQuit(user,reason);
<a name="l00368"></a>00368 <a class="code" href="globals_8h.html#WriteCommonExcept_28userrec_20_2Au_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteCommonExcept</a>(user,<span class="stringliteral">"QUIT :%s"</span>,reason);
<a name="l00369"></a>00369 }
<a name="l00370"></a>00370
<a name="l00371"></a>00371 user-><a class="code" href="classuserrec.html#FlushWriteBuf_28_29">FlushWriteBuf</a>();
<a name="l00372"></a>00372
<a name="l00373"></a>00373 <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnUserDisconnect(user);
<a name="l00374"></a>00374
<a name="l00375"></a>00375 <span class="keywordflow">if</span> (user-><a class="code" href="classconnection.html#fd">fd</a> > -1)
<a name="l00376"></a>00376 {
<a name="l00377"></a>00377 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#GetIOHook_28int_20port_29">GetIOHook</a>(user-><a class="code" href="classconnection.html#port">port</a>))
<a name="l00378"></a>00378 {
<a name="l00379"></a>00379 <a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#GetIOHook_28int_20port_29">GetIOHook</a>(user-><a class="code" href="classconnection.html#port">port</a>)-><a class="code" href="classModule.html#OnRawSocketClose_28int_20fd_29">OnRawSocketClose</a>(user-><a class="code" href="classconnection.html#fd">fd</a>);
<a name="l00380"></a>00380 }
<a name="l00381"></a>00381 <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-><a class="code" href="classInspIRCd.html#SE">SE</a>-><a class="code" href="classSocketEngine.html#DelFd_28int_20fd_29">DelFd</a>(user-><a class="code" href="classconnection.html#fd">fd</a>);
<a name="l00382"></a>00382 user-><a class="code" href="classuserrec.html#CloseSocket_28_29">CloseSocket</a>();
<a name="l00383"></a>00383 }
<a name="l00384"></a>00384
<a name="l00385"></a>00385 <span class="comment">// this must come before the WriteOpers so that it doesnt try to fill their buffer with anything</span>
<a name="l00386"></a>00386 <span class="comment">// if they were an oper with +s.</span>
<a name="l00387"></a>00387 <span class="keywordflow">if</span> (user-><a class="code" href="classconnection.html#registered">registered</a> == 7) {
<a name="l00388"></a>00388 purge_empty_chans(user);
<a name="l00389"></a>00389 <span class="comment">// fix by brain: only show local quits because we only show local connects (it just makes SENSE)</span>
<a name="l00390"></a>00390 <span class="keywordflow">if</span> (user-><a class="code" href="classconnection.html#fd">fd</a> > -1)
<a name="l00391"></a>00391 <a class="code" href="globals_8h.html#WriteOpers_28char_20_2Atext_2C_2E_2E_2E_29">WriteOpers</a>(<span class="stringliteral">"*** Client exiting: %s!%s@%s [%s]"</span>,user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,user-><a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-><a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>,reason);
<a name="l00392"></a>00392 <a class="code" href="users_8cpp.html#AddWhoWas_28userrec_20_2Au_29">AddWhoWas</a>(user);
<a name="l00393"></a>00393 }
<a name="l00394"></a>00394
<a name="l00395"></a>00395 <span class="keywordflow">if</span> (iter != <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.end())
<a name="l00396"></a>00396 {
<a name="l00397"></a>00397 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"deleting user hash value %lu"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)user);
<a name="l00398"></a>00398 <span class="keywordflow">if</span> (user-><a class="code" href="classconnection.html#fd">fd</a> > -1)
<a name="l00399"></a>00399 {
<a name="l00400"></a>00400 <a class="code" href="modules_8cpp.html#fd_5Fref_5Ftable_5B_36_35_35_33_36_5D">fd_ref_table</a>[user-><a class="code" href="classconnection.html#fd">fd</a>] = NULL;
<a name="l00401"></a>00401 <span class="keywordflow">if</span> (find(<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.begin(),<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end(),user) != <a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end())
<a name="l00402"></a>00402 {
<a name="l00403"></a>00403 <a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.erase(find(<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.begin(),<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end(),user));
<a name="l00404"></a>00404 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Delete local user"</span>);
<a name="l00405"></a>00405 }
<a name="l00406"></a>00406 }
<a name="l00407"></a>00407 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.erase(iter);
<a name="l00408"></a>00408 }
<a name="l00409"></a>00409 <span class="keyword">delete</span> user;
<a name="l00410"></a>00410 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="kill_5Flink_5Fsilent_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29"></a><!-- doxytag: member="users.h::kill_link_silent" ref="kill_5Flink_5Fsilent_28userrec_20_2Auser_2C_20const_20char_20_2Ar_29" args="(userrec *user, const char *r)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void kill_link_silent </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname" nowrap> <em>user</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>r</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00412">412</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="modules_8cpp.html#clientlist">clientlist</a>, <a class="el" href="users_8cpp-source.html#l00093">userrec::CloseSocket()</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, <a class="el" href="socketengine_8cpp-source.html#l00103">SocketEngine::DelFd()</a>, <a class="el" href="connection_8h-source.html#l00042">connection::fd</a>, <a class="el" href="users_8cpp-source.html#l00295">userrec::FlushWriteBuf()</a>, <a class="el" href="modules_8h-source.html#l00082">FOREACH_MOD</a>, <a class="el" href="classServerConfig.html#GetIOHook_28int_20port_29">ServerConfig::GetIOHook()</a>, <a class="el" href="connection_8h-source.html#l00046">connection::host</a>, <a class="el" href="users_8h-source.html#l00133">userrec::ident</a>, <a class="el" href="users_8cpp-source.html#l00052">local_users</a>, <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>, <a class="el" href="users_8h-source.html#l00128">userrec::nick</a>, <a class="el" href="modules_8cpp-source.html#l00270">Module::OnRawSocketClose()</a>, <a class="el" href="connection_8h-source.html#l00076">connection::port</a>, <a class="el" href="connection_8h-source.html#l00080">connection::registered</a>, <a class="el" href="inspircd_8h-source.html#l00111">InspIRCd::SE</a>, <a class="el" href="globals_8h.html#Write_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">Write()</a>, and <a class="el" href="globals_8h.html#WriteCommonExcept_28userrec_20_2Au_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteCommonExcept()</a>.
<p>
Referenced by <a class="el" href="users_8cpp-source.html#l00647">FullConnectUser()</a>.<div class="fragment"><pre class="fragment"><a name="l00413"></a>00413 {
<a name="l00414"></a>00414 user_hash::iterator iter = <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.find(user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>);
<a name="l00415"></a>00415
<a name="l00416"></a>00416 <span class="keywordtype">char</span> reason[MAXBUF];
<a name="l00417"></a>00417
<a name="l00418"></a>00418 strncpy(reason,r,MAXBUF);
<a name="l00419"></a>00419
<a name="l00420"></a>00420 <span class="keywordflow">if</span> (strlen(reason)>MAXQUIT)
<a name="l00421"></a>00421 {
<a name="l00422"></a>00422 reason[MAXQUIT-1] = <span class="charliteral">'\0'</span>;
<a name="l00423"></a>00423 }
<a name="l00424"></a>00424
<a name="l00425"></a>00425 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"kill_link: %s '%s'"</span>,user-><a class="code" href="classuserrec.html#nick_5BNICKMAX_5D">nick</a>,reason);
<a name="l00426"></a>00426 <a class="code" href="globals_8h.html#Write_28int_20sock_2C_20char_20_2Atext_2C_2E_2E_2E_29">Write</a>(user-><a class="code" href="classconnection.html#fd">fd</a>,<span class="stringliteral">"ERROR :Closing link (%s@%s) [%s]"</span>,user-><a class="code" href="classuserrec.html#ident_5BIDENTMAX_2B_32_5D">ident</a>,user-><a class="code" href="classconnection.html#host_5B_31_36_30_5D">host</a>,reason);
<a name="l00427"></a>00427 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"closing fd %lu"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)user-><a class="code" href="classconnection.html#fd">fd</a>);
<a name="l00428"></a>00428
<a name="l00429"></a>00429 user-><a class="code" href="classuserrec.html#FlushWriteBuf_28_29">FlushWriteBuf</a>();
<a name="l00430"></a>00430
<a name="l00431"></a>00431 <span class="keywordflow">if</span> (user-><a class="code" href="classconnection.html#registered">registered</a> == 7) {
<a name="l00432"></a>00432 <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnUserQuit(user,reason);
<a name="l00433"></a>00433 <a class="code" href="globals_8h.html#WriteCommonExcept_28userrec_20_2Au_2C_20char_20_2Atext_2C_2E_2E_2E_29">WriteCommonExcept</a>(user,<span class="stringliteral">"QUIT :%s"</span>,reason);
<a name="l00434"></a>00434 }
<a name="l00435"></a>00435
<a name="l00436"></a>00436 <a class="code" href="modules_8h.html#FOREACH_5FMOD">FOREACH_MOD</a> OnUserDisconnect(user);
<a name="l00437"></a>00437
<a name="l00438"></a>00438 <span class="keywordflow">if</span> (user-><a class="code" href="classconnection.html#fd">fd</a> > -1)
<a name="l00439"></a>00439 {
<a name="l00440"></a>00440 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#GetIOHook_28int_20port_29">GetIOHook</a>(user-><a class="code" href="classconnection.html#port">port</a>))
<a name="l00441"></a>00441 {
<a name="l00442"></a>00442 <a class="code" href="channels_8cpp.html#Config">Config</a>-><a class="code" href="classServerConfig.html#GetIOHook_28int_20port_29">GetIOHook</a>(user-><a class="code" href="classconnection.html#port">port</a>)-><a class="code" href="classModule.html#OnRawSocketClose_28int_20fd_29">OnRawSocketClose</a>(user-><a class="code" href="classconnection.html#fd">fd</a>);
<a name="l00443"></a>00443 }
<a name="l00444"></a>00444 <a class="code" href="modules_8cpp.html#ServerInstance">ServerInstance</a>-><a class="code" href="classInspIRCd.html#SE">SE</a>-><a class="code" href="classSocketEngine.html#DelFd_28int_20fd_29">DelFd</a>(user-><a class="code" href="classconnection.html#fd">fd</a>);
<a name="l00445"></a>00445 user-><a class="code" href="classuserrec.html#CloseSocket_28_29">CloseSocket</a>();
<a name="l00446"></a>00446 }
<a name="l00447"></a>00447
<a name="l00448"></a>00448 <span class="keywordflow">if</span> (user-><a class="code" href="classconnection.html#registered">registered</a> == 7) {
<a name="l00449"></a>00449 purge_empty_chans(user);
<a name="l00450"></a>00450 }
<a name="l00451"></a>00451
<a name="l00452"></a>00452 <span class="keywordflow">if</span> (iter != <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.end())
<a name="l00453"></a>00453 {
<a name="l00454"></a>00454 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"deleting user hash value %lu"</span>,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)user);
<a name="l00455"></a>00455 <span class="keywordflow">if</span> (user-><a class="code" href="classconnection.html#fd">fd</a> > -1)
<a name="l00456"></a>00456 {
<a name="l00457"></a>00457 <a class="code" href="modules_8cpp.html#fd_5Fref_5Ftable_5B_36_35_35_33_36_5D">fd_ref_table</a>[user-><a class="code" href="classconnection.html#fd">fd</a>] = NULL;
<a name="l00458"></a>00458 <span class="keywordflow">if</span> (find(<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.begin(),<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end(),user) != <a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end())
<a name="l00459"></a>00459 {
<a name="l00460"></a>00460 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Delete local user"</span>);
<a name="l00461"></a>00461 <a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.erase(find(<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.begin(),<a class="code" href="users_8cpp.html#local_5Fusers">local_users</a>.end(),user));
<a name="l00462"></a>00462 }
<a name="l00463"></a>00463 }
<a name="l00464"></a>00464 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.erase(iter);
<a name="l00465"></a>00465 }
<a name="l00466"></a>00466 <span class="keyword">delete</span> user;
<a name="l00467"></a>00467 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="ReHashNick_28char_20_2AOld_2C_20char_20_2ANew_29"></a><!-- doxytag: member="users.h::ReHashNick" ref="ReHashNick_28char_20_2AOld_2C_20char_20_2ANew_29" args="(char *Old, char *New)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a>* ReHashNick </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">char * </td>
<td class="mdname" nowrap> <em>Old</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>char * </td>
<td class="mdname" nowrap> <em>New</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="users_8cpp-source.html#l00743">743</a> of file <a class="el" href="users_8cpp-source.html">users.cpp</a>.
<p>
References <a class="el" href="modules_8cpp.html#clientlist">clientlist</a>, <a class="el" href="inspircd__io_8h-source.html#l00029">DEBUG</a>, and <a class="el" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log()</a>.<div class="fragment"><pre class="fragment"><a name="l00744"></a>00744 {
<a name="l00745"></a>00745 <span class="comment">//user_hash::iterator newnick;</span>
<a name="l00746"></a>00746 user_hash::iterator oldnick = <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.find(Old);
<a name="l00747"></a>00747
<a name="l00748"></a>00748 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"ReHashNick: %s %s"</span>,Old,New);
<a name="l00749"></a>00749
<a name="l00750"></a>00750 <span class="keywordflow">if</span> (!strcasecmp(Old,New))
<a name="l00751"></a>00751 {
<a name="l00752"></a>00752 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"old nick is new nick, skipping"</span>);
<a name="l00753"></a>00753 <span class="keywordflow">return</span> oldnick->second;
<a name="l00754"></a>00754 }
<a name="l00755"></a>00755
<a name="l00756"></a>00756 <span class="keywordflow">if</span> (oldnick == <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.end()) <span class="keywordflow">return</span> NULL; <span class="comment">/* doesnt exist */</span>
<a name="l00757"></a>00757
<a name="l00758"></a>00758 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"ReHashNick: Found hashed nick %s"</span>,Old);
<a name="l00759"></a>00759
<a name="l00760"></a>00760 <a class="code" href="classuserrec.html">userrec</a>* olduser = oldnick->second;
<a name="l00761"></a>00761 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[New] = olduser;
<a name="l00762"></a>00762 <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>.erase(oldnick);
<a name="l00763"></a>00763
<a name="l00764"></a>00764 <a class="code" href="globals_8h.html#log_28int_20level_2C_20char_20_2Atext_2C_2E_2E_2E_29">log</a>(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"ReHashNick: Nick rehashed as %s"</span>,New);
<a name="l00765"></a>00765
<a name="l00766"></a>00766 <span class="keywordflow">return</span> <a class="code" href="modules_8cpp.html#clientlist">clientlist</a>[New];
<a name="l00767"></a>00767 }
</pre></div>
<p>
</td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Mon Dec 19 18:05:21 2005 for InspIRCd by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4-20050815 </small></address>
</body>
</html>
|