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
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Server class Reference</title>
<link href="inspircd.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3-rc3 -->
<center>
<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">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center>
<hr><h1>Server Class Reference</h1>Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers.
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code>
<p>
Inheritance diagram for Server:<p><center><img src="classServer__inherit__graph.gif" border="0" usemap="#Server__inherit__map" alt="Inheritance graph"></center>
<map name="Server__inherit__map">
<area href="classclassbase.html" shape="rect" coords="7,16,73,37" alt="">
</map>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for Server:<p><center><img src="classServer__coll__graph.gif" border="0" usemap="#Server__coll__map" alt="Collaboration graph"></center>
<map name="Server__coll__map">
<area href="classclassbase.html" shape="rect" coords="7,106,73,128" alt="">
</map>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><a href="classServer-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classServer.html#a0">Server</a> ()</td></tr>
<tr><td> </td><td><font size=-1><em>Default constructor.</em> <a href="#a0"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classServer.html#a1">~Server</a> ()</td></tr>
<tr><td> </td><td><font size=-1><em>Default destructor.</em> <a href="#a1"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a2">SendOpers</a> (std::string s)</td></tr>
<tr><td> </td><td><font size=-1><em>Sends text to all opers.</em> <a href="#a2"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a3">Log</a> (int level, std::string s)</td></tr>
<tr><td> </td><td><font size=-1><em>Writes a log string.</em> <a href="#a3"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a4">Send</a> (int Socket, std::string s)</td></tr>
<tr><td> </td><td><font size=-1><em>Sends a line of text down a TCP/IP socket.</em> <a href="#a4"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a5">SendServ</a> (int Socket, std::string s)</td></tr>
<tr><td> </td><td><font size=-1><em>Sends text from the server to a socket.</em> <a href="#a5"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a6">SendFrom</a> (int Socket, <a class="el" href="classuserrec.html">userrec</a> *User, std::string s)</td></tr>
<tr><td> </td><td><font size=-1><em>Sends text from a user to a socket.</em> <a href="#a6"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a7">SendTo</a> (<a class="el" href="classuserrec.html">userrec</a> *Source, <a class="el" href="classuserrec.html">userrec</a> *Dest, std::string s)</td></tr>
<tr><td> </td><td><font size=-1><em>Sends text from a user to another user.</em> <a href="#a7"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a8">SendChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Channel, std::string s, bool IncludeSender)</td></tr>
<tr><td> </td><td><font size=-1><em>Sends text from a user to a channel (mulicast).</em> <a href="#a8"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a9">CommonChannels</a> (<a class="el" href="classuserrec.html">userrec</a> *u1, <a class="el" href="classuserrec.html">userrec</a> *u2)</td></tr>
<tr><td> </td><td><font size=-1><em>Returns true if two users share a common channel.</em> <a href="#a9"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a10">SendCommon</a> (<a class="el" href="classuserrec.html">userrec</a> *User, std::string text, bool IncludeSender)</td></tr>
<tr><td> </td><td><font size=-1><em>Sends text from a user to one or more channels (mulicast).</em> <a href="#a10"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a11">SendWallops</a> (<a class="el" href="classuserrec.html">userrec</a> *User, std::string text)</td></tr>
<tr><td> </td><td><font size=-1><em>Sends a WALLOPS message.</em> <a href="#a11"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a12">IsNick</a> (std::string nick)</td></tr>
<tr><td> </td><td><font size=-1><em>Returns true if a nick is valid.</em> <a href="#a12"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classServer.html#a13">CountUsers</a> (<a class="el" href="classchanrec.html">chanrec</a> *c)</td></tr>
<tr><td> </td><td><font size=-1><em>Returns a count of the number of users on a channel.</em> <a href="#a13"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual <a class="el" href="classuserrec.html">userrec</a> * </td><td valign=bottom><a class="el" href="classServer.html#a14">FindNick</a> (std::string nick)</td></tr>
<tr><td> </td><td><font size=-1><em>Attempts to look up a nick and return a pointer to it.</em> <a href="#a14"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> * </td><td valign=bottom><a class="el" href="classServer.html#a15">FindChannel</a> (std::string channel)</td></tr>
<tr><td> </td><td><font size=-1><em>Attempts to look up a channel and return a pointer to it.</em> <a href="#a15"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual std::string </td><td valign=bottom><a class="el" href="classServer.html#a16">ChanMode</a> (<a class="el" href="classuserrec.html">userrec</a> *User, <a class="el" href="classchanrec.html">chanrec</a> *Chan)</td></tr>
<tr><td> </td><td><font size=-1><em>Attempts to look up a user's privilages on a channel.</em> <a href="#a16"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual std::string </td><td valign=bottom><a class="el" href="classServer.html#a17">GetServerName</a> ()</td></tr>
<tr><td> </td><td><font size=-1><em>Returns the server name of the server where the module is loaded.</em> <a href="#a17"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual std::string </td><td valign=bottom><a class="el" href="classServer.html#a18">GetNetworkName</a> ()</td></tr>
<tr><td> </td><td><font size=-1><em>Returns the network name, global to all linked servers.</em> <a href="#a18"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual <a class="el" href="classAdmin.html">Admin</a> </td><td valign=bottom><a class="el" href="classServer.html#a19">GetAdmin</a> ()</td></tr>
<tr><td> </td><td><font size=-1><em>Returns the information of the server as returned by the /ADMIN command.</em> <a href="#a19"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a20">AddExtendedMode</a> (char modechar, int type, bool requires_oper, int params_when_on, int params_when_off)</td></tr>
<tr><td> </td><td><font size=-1><em>Adds an extended mode letter which is parsed by a module This allows modules to add extra mode letters, e.g.</em> <a href="#a20"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a21">AddCommand</a> (char *cmd, handlerfunc f, char flags, int minparams)</td></tr>
<tr><td> </td><td><font size=-1><em>Adds a command to the command table.</em> <a href="#a21"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a22">SendMode</a> (char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
<tr><td> </td><td><font size=-1><em>Sends a servermode.</em> <a href="#a22"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a23">SendToModeMask</a> (std::string modes, int flags, std::string text)</td></tr>
<tr><td> </td><td><font size=-1><em>Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.</em> <a href="#a23"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> * </td><td valign=bottom><a class="el" href="classServer.html#a24">JoinUserToChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string key)</td></tr>
<tr><td> </td><td><font size=-1><em>Forces a user to join a channel.</em> <a href="#a24"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual <a class="el" href="classchanrec.html">chanrec</a> * </td><td valign=bottom><a class="el" href="classServer.html#a25">PartUserFromChannel</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string cname, std::string reason)</td></tr>
<tr><td> </td><td><font size=-1><em>Forces a user to part a channel.</em> <a href="#a25"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a26">ChangeUserNick</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string nickname)</td></tr>
<tr><td> </td><td><font size=-1><em>Forces a user nickchange.</em> <a href="#a26"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a27">QuitUser</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string reason)</td></tr>
<tr><td> </td><td><font size=-1><em>Forces a user to quit with the specified reason.</em> <a href="#a27"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a28">MatchText</a> (std::string sliteral, std::string spattern)</td></tr>
<tr><td> </td><td><font size=-1><em>Matches text against a glob pattern.</em> <a href="#a28"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a29">CallCommandHandler</a> (std::string commandname, char **parameters, int pcnt, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
<tr><td> </td><td><font size=-1><em>Calls the handler for a command, either implemented by the core or by another module.</em> <a href="#a29"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a30">ChangeHost</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string host)</td></tr>
<tr><td> </td><td><font size=-1><em>Change displayed hostname of a user.</em> <a href="#a30"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classServer.html#a31">ChangeGECOS</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string gecos)</td></tr>
<tr><td> </td><td><font size=-1><em>Change GECOS (fullname) of a user.</em> <a href="#a31"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classServer.html#a32">IsUlined</a> (std::string server)</td></tr>
<tr><td> </td><td><font size=-1><em>Returns true if the servername you give is ulined.</em> <a href="#a32"></a><em></em></font><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers.
<p>
All modules should instantiate at least one copy of this class, and use its member functions to perform their tasks.
<p>
<p>
Definition at line <a class="el" href="modules_8h-source.html#l00252">252</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
<a name="a0" doxytag="Server::Server"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> Server::Server </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </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>
Default constructor.
<p>
Creates a Server object.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00135">135</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00136 {
00137 }
</pre></div> </td>
</tr>
</table>
<a name="a1" doxytag="Server::~Server"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> Server::~Server </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Default destructor.
<p>
Destroys a Server object.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00139">139</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00140 {
00141 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a21" doxytag="Server::AddCommand"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::AddCommand </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">char * </td>
<td class="mdname" nowrap> <em>cmd</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>handlerfunc </td>
<td class="mdname" nowrap> <em>f</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>char </td>
<td class="mdname" nowrap> <em>flags</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>minparams</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Adds a command to the command table.
<p>
This allows modules to add extra commands into the command table. You must place a function within your module which is is of type handlerfunc:<p>
typedef void (handlerfunc) (char**, int, userrec*); ... void <a class="el" href="commands_8h.html#a5">handle_kill(char **parameters, int pcnt, userrec *user)</a><p>
When the command is typed, the parameters will be placed into the parameters array (similar to argv) and the parameter count will be placed into pcnt (similar to argv). There will never be any less parameters than the 'minparams' value you specified when creating the command. The *user parameter is the class of the user which caused the command to trigger, who will always have the flag you specified in 'flags' when creating the initial command. For example to create an oper only command create the commands with flags='o'.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00197">197</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="modules_8h.html#a13">createcommand()</a>.
<p>
<div class="fragment"><pre>00198 {
00199 <a class="code" href="modules_8h.html#a13">createcommand</a>(cmd,f,flags,minparams);
00200 }
</pre></div> </td>
</tr>
</table>
<a name="a20" doxytag="Server::AddExtendedMode"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool Server::AddExtendedMode </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">char </td>
<td class="mdname" nowrap> <em>modechar</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>type</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>requires_oper</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>params_when_on</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>params_when_off</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Adds an extended mode letter which is parsed by a module This allows modules to add extra mode letters, e.g.
<p>
+x for hostcloak. the "type" parameter is either MT_CHANNEL, MT_CLIENT, or MT_SERVER, to indicate wether the mode is a channel mode, a client mode, or a server mode. requires_oper is used with MT_CLIENT type modes only to indicate the mode can only be set or unset by an oper. If this is used for MT_CHANNEL type modes it is ignored. params_when_on is the number of modes to expect when the mode is turned on (for type MT_CHANNEL only), e.g. with mode +k, this would have a value of 1. the params_when_off value has a similar value to params_when_on, except it indicates the number of parameters to expect when the mode is disabled. Modes which act in a similar way to channel mode +l (e.g. require a parameter to enable, but not to disable) should use this parameter. The function returns false if the mode is unavailable, and will not attempt to allocate another character, as this will confuse users. This also means that as only one module can claim a specific mode character, the core does not need to keep track of which modules own which modes, which speeds up operation of the server. In this version, a mode can have at most one parameter, attempting to use more parameters will have undefined effects.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00317">317</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="modules_8cpp-source.html#l00093">DoAddExtendedMode()</a>, <a class="el" href="modules_8h-source.html#l00018">MT_CLIENT</a>, and <a class="el" href="modules_8h-source.html#l00019">MT_SERVER</a>.
<p>
<div class="fragment"><pre>00318 {
00319 <span class="keywordflow">if</span> (type == <a class="code" href="modules_8h.html#a7">MT_SERVER</a>)
00320 {
00321 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"</span>);
00322 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00323 }
00324 <span class="keywordflow">if</span> (((params_when_on>0) || (params_when_off>0)) && (type == <a class="code" href="modules_8h.html#a6">MT_CLIENT</a>))
00325 {
00326 log(DEBUG,<span class="stringliteral">"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"</span>);
00327 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00328 }
00329 <span class="keywordflow">if</span> ((params_when_on>1) || (params_when_off>1))
00330 {
00331 log(DEBUG,<span class="stringliteral">"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"</span>);
00332 <span class="keywordflow">return</span> <span class="keyword">false</span>;
00333 }
00334 <span class="keywordflow">return</span> <a class="code" href="modules_8cpp.html#a8">DoAddExtendedMode</a>(modechar,type,requires_oper,params_when_on,params_when_off);
00335 }
</pre></div> </td>
</tr>
</table>
<a name="a29" doxytag="Server::CallCommandHandler"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::CallCommandHandler </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::string </td>
<td class="mdname" nowrap> <em>commandname</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>char ** </td>
<td class="mdname" nowrap> <em>parameters</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>pcnt</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname" nowrap> <em>user</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Calls the handler for a command, either implemented by the core or by another module.
<p>
You can use this function to trigger other commands in the ircd, such as PRIVMSG, JOIN, KICK etc, or even as a method of callback. By defining command names that are untypeable for users on irc (e.g. those which contain a or <br>
) you may use them as callback identifiers. The first parameter to this method is the name of the command handler you wish to call, e.g. PRIVMSG. This will be a command handler previously registered by the core or wih <a class="el" href="classServer.html#a21">AddCommand()</a>. The second parameter is an array of parameters, and the third parameter is a count of parameters in the array. If you do not pass enough parameters to meet the minimum needed by the handler, the functiom will silently ignore it. The final parameter is the user executing the command handler, used for privilage checks, etc.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00187">187</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00188 {
00189 call_handler(commandname.c_str(),parameters,pcnt,user);
00190 }
</pre></div> </td>
</tr>
</table>
<a name="a31" doxytag="Server::ChangeGECOS"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::ChangeGECOS </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></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>gecos</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Change GECOS (fullname) of a user.
<p>
You should always call this method to change a user's GECOS rather than writing directly to the fullname member of userrec, as any change applied via this method will be propogated to any linked servers.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00275">275</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="message_8h.html#a10">ChangeName()</a>.
<p>
<div class="fragment"><pre>00276 {
00277 <a class="code" href="message_8h.html#a10">ChangeName</a>(user,gecos.c_str());
00278 }
</pre></div> </td>
</tr>
</table>
<a name="a30" doxytag="Server::ChangeHost"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::ChangeHost </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></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>host</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Change displayed hostname of a user.
<p>
You should always call this method to change a user's host rather than writing directly to the dhost member of userrec, as any change applied via this method will be propogated to any linked servers.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00270">270</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="message_8h.html#a11">ChangeDisplayedHost()</a>.
<p>
<div class="fragment"><pre>00271 {
00272 <a class="code" href="message_8h.html#a11">ChangeDisplayedHost</a>(user,host.c_str());
00273 }
</pre></div> </td>
</tr>
</table>
<a name="a26" doxytag="Server::ChangeUserNick"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::ChangeUserNick </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></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>nickname</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Forces a user nickchange.
<p>
This command works similarly to SVSNICK, and can be used to implement Q-lines etc. If you specify an invalid nickname, the nick change will be dropped and the target user will receive the error numeric for it.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00171">171</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00172 {
00173 force_nickchange(user,nickname.c_str());
00174 }
</pre></div> </td>
</tr>
</table>
<a name="a16" doxytag="Server::ChanMode"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> std::string Server::ChanMode </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></td>
<td></td>
<td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
<td class="mdname" nowrap> <em>Chan</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Attempts to look up a user's privilages on a channel.
<p>
This function will return a string containing either @, , +, or an empty string, representing the user's privilages upon the channel you specify.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00295">295</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="message_8h.html#a14">cmode()</a>.
<p>
<div class="fragment"><pre>00296 {
00297 <span class="keywordflow">return</span> <a class="code" href="message_8h.html#a14">cmode</a>(User,Chan);
00298 }
</pre></div> </td>
</tr>
</table>
<a name="a9" doxytag="Server::CommonChannels"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool Server::CommonChannels </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>u1</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname" nowrap> <em>u2</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns true if two users share a common channel.
<p>
This method is used internally by the NICK and QUIT commands, and the <a class="el" href="classServer.html#a10">Server::SendCommon</a> method.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00248">248</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="message_8h.html#a0">common_channels()</a>.
<p>
<div class="fragment"><pre>00249 {
00250 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a0">common_channels</a>(u1,u2) != 0);
00251 }
</pre></div> </td>
</tr>
</table>
<a name="a13" doxytag="Server::CountUsers"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int Server::CountUsers </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>c</em> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns a count of the number of users on a channel.
<p>
This will NEVER be 0, as if the chanrec exists, it will have at least one user in the channel.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00337">337</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00338 {
00339 <span class="keywordflow">return</span> usercount(c);
00340 }
</pre></div> </td>
</tr>
</table>
<a name="a15" doxytag="Server::FindChannel"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::FindChannel </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::string </td>
<td class="mdname1" valign="top" nowrap> <em>channel</em> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Attempts to look up a channel and return a pointer to it.
<p>
This function will return NULL if the channel does not exist.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00290">290</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00291 {
00292 <span class="keywordflow">return</span> FindChan(channel.c_str());
00293 }
</pre></div> </td>
</tr>
</table>
<a name="a14" doxytag="Server::FindNick"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classuserrec.html">userrec</a> * Server::FindNick </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::string </td>
<td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Attempts to look up a nick and return a pointer to it.
<p>
This function will return NULL if the nick does not exist.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00285">285</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00286 {
00287 <span class="keywordflow">return</span> Find(nick);
00288 }
</pre></div> </td>
</tr>
</table>
<a name="a19" doxytag="Server::GetAdmin"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classAdmin.html">Admin</a> Server::GetAdmin </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the information of the server as returned by the /ADMIN command.
<p>
See the <a class="el" href="classAdmin.html">Admin</a> class for further information of the return value. The members <a class="el" href="classAdmin.html#m2">Admin::Nick</a>, <a class="el" href="classAdmin.html#m1">Admin::Email</a> and <a class="el" href="classAdmin.html#m0">Admin::Name</a> contain the information for the server where the module is loaded.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00310">310</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00311 {
00312 <span class="keywordflow">return</span> <a class="code" href="classAdmin.html">Admin</a>(getadminname(),getadminemail(),getadminnick());
00313 }
</pre></div> </td>
</tr>
</table>
<a name="a18" doxytag="Server::GetNetworkName"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> std::string Server::GetNetworkName </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the network name, global to all linked servers.
<p>
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00305">305</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00306 {
00307 <span class="keywordflow">return</span> getnetworkname();
00308 }
</pre></div> </td>
</tr>
</table>
<a name="a17" doxytag="Server::GetServerName"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> std::string Server::GetServerName </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the server name of the server where the module is loaded.
<p>
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00300">300</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00301 {
00302 <span class="keywordflow">return</span> getservername();
00303 }
</pre></div> </td>
</tr>
</table>
<a name="a12" doxytag="Server::IsNick"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool Server::IsNick </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::string </td>
<td class="mdname1" valign="top" nowrap> <em>nick</em> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns true if a nick is valid.
<p>
Nicks for unregistered connections will return false.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00280">280</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="message_8h.html#a13">isnick()</a>.
<p>
<div class="fragment"><pre>00281 {
00282 <span class="keywordflow">return</span> (<a class="code" href="message_8h.html#a13">isnick</a>(nick.c_str()) != 0);
00283 }
</pre></div> </td>
</tr>
</table>
<a name="a32" doxytag="Server::IsUlined"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool Server::IsUlined </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::string </td>
<td class="mdname1" valign="top" nowrap> <em>server</em> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns true if the servername you give is ulined.
<p>
ULined servers have extra privilages. They are allowed to change nicknames on remote servers, change modes of clients which are on remote servers and set modes of channels where there are no channel operators for that channel on the ulined server, amongst other things. Ulined server data is also broadcast across the mesh at all times as opposed to selectively messaged in the case of normal servers, as many ulined server types (such as services) do not support meshed links and must operate in this manner.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00182">182</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="commands_8h.html#a70">is_uline()</a>.
<p>
<div class="fragment"><pre>00183 {
00184 <span class="keywordflow">return</span> <a class="code" href="commands_8h.html#a70">is_uline</a>(server.c_str());
00185 }
</pre></div> </td>
</tr>
</table>
<a name="a24" doxytag="Server::JoinUserToChannel"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::JoinUserToChannel </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></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>cname</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>key</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Forces a user to join a channel.
<p>
This is similar to svsjoin and can be used to implement redirection, etc. On success, the return value is a valid pointer to a chanrec* of the channel the user was joined to. On failure, the result is NULL.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00161">161</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00162 {
00163 <span class="keywordflow">return</span> add_channel(user,cname.c_str(),key.c_str(),<span class="keyword">true</span>);
00164 }
</pre></div> </td>
</tr>
</table>
<a name="a3" doxytag="Server::Log"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::Log </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname" nowrap> <em>level</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>s</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Writes a log string.
<p>
This method writes a line of text to the log. If the level given is lower than the level given in the configuration, this command has no effect.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00192">192</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00193 {
00194 log(level,<span class="stringliteral">"%s"</span>,s.c_str());
00195 }
</pre></div> </td>
</tr>
</table>
<a name="a28" doxytag="Server::MatchText"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool Server::MatchText </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::string </td>
<td class="mdname" nowrap> <em>sliteral</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>spattern</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Matches text against a glob pattern.
<p>
Uses the ircd's internal matching function to match string against a globbing pattern, e.g. *!*@*.com Returns true if the literal successfully matches the pattern, false if otherwise.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00148">148</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00149 {
00150 <span class="keywordtype">char</span> literal[MAXBUF],pattern[MAXBUF];
00151 strncpy(literal,sliteral.c_str(),MAXBUF);
00152 strncpy(pattern,spattern.c_str(),MAXBUF);
00153 <span class="keywordflow">return</span> match(literal,pattern);
00154 }
</pre></div> </td>
</tr>
</table>
<a name="a25" doxytag="Server::PartUserFromChannel"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classchanrec.html">chanrec</a> * Server::PartUserFromChannel </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></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>cname</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>reason</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Forces a user to part a channel.
<p>
This is similar to svspart and can be used to implement redirection, etc. Although the return value of this function is a pointer to a channel record, the returned data is undefined and should not be read or written to. This behaviour may be changed in a future version.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00166">166</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00167 {
00168 <span class="keywordflow">return</span> del_channel(user,cname.c_str(),reason.c_str(),<span class="keyword">false</span>);
00169 }
</pre></div> </td>
</tr>
</table>
<a name="a27" doxytag="Server::QuitUser"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::QuitUser </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></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>reason</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Forces a user to quit with the specified reason.
<p>
To the user, it will appear as if they typed /QUIT themselves, except for the fact that this function may bypass the quit prefix specified in the config file.<p>
WARNING!<p>
Once you call this function, userrec* user will immediately become INVALID. You MUST NOT write to, or read from this pointer after calling the QuitUser method UNDER ANY CIRCUMSTANCES! The best course of action after calling this method is to immediately bail from your handler.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00176">176</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="users_8h-source.html#l00091">userrec::nick</a>, and <a class="el" href="message_8h.html#a19">send_network_quit()</a>.
<p>
<div class="fragment"><pre>00177 {
00178 <a class="code" href="message_8h.html#a19">send_network_quit</a>(user-><a class="code" href="classuserrec.html#m0">nick</a>,reason.c_str());
00179 kill_link(user,reason.c_str());
00180 }
</pre></div> </td>
</tr>
</table>
<a name="a4" doxytag="Server::Send"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::Send </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></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>s</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sends a line of text down a TCP/IP socket.
<p>
This method writes a line of text to an established socket, cutting it to 510 characters plus a carriage return and linefeed if required.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00207">207</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00208 {
00209 Write(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
00210 }
</pre></div> </td>
</tr>
</table>
<a name="a8" doxytag="Server::SendChannel"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::SendChannel </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></td>
<td></td>
<td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
<td class="mdname" nowrap> <em>Channel</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>s</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>IncludeSender</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sends text from a user to a channel (mulicast).
<p>
This method writes a line of text to a channel, with the given user's nick/ident /host combination prepended, as used in PRIVMSG etc commands (see RFC 1459). If the IncludeSender flag is set, then the text is also sent back to the user from which it originated, as seen in MODE (see RFC 1459).
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00236">236</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00237 {
00238 <span class="keywordflow">if</span> (IncludeSender)
00239 {
00240 WriteChannel(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
00241 }
00242 <span class="keywordflow">else</span>
00243 {
00244 ChanExceptSender(Channel,User,<span class="stringliteral">"%s"</span>,s.c_str());
00245 }
00246 }
</pre></div> </td>
</tr>
</table>
<a name="a10" doxytag="Server::SendCommon"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::SendCommon </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></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>text</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>IncludeSender</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sends text from a user to one or more channels (mulicast).
<p>
This method writes a line of text to all users which share a common channel with a given user, with the user's nick/ident/host combination prepended, as used in PRIVMSG etc commands (see RFC 1459). If the IncludeSender flag is set, then the text is also sent back to the user from which it originated, as seen in NICK (see RFC 1459). Otherwise, it is only sent to the other recipients, as seen in QUIT.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00253">253</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00254 {
00255 <span class="keywordflow">if</span> (IncludeSender)
00256 {
00257 WriteCommon(User,<span class="stringliteral">"%s"</span>,text.c_str());
00258 }
00259 <span class="keywordflow">else</span>
00260 {
00261 WriteCommonExcept(User,<span class="stringliteral">"%s"</span>,text.c_str());
00262 }
00263 }
</pre></div> </td>
</tr>
</table>
<a name="a6" doxytag="Server::SendFrom"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::SendFrom </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></td>
<td></td>
<td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname" nowrap> <em>User</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>s</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sends text from a user to a socket.
<p>
This method writes a line of text to an established socket, with the given user's nick/ident /host combination prepended, as used in PRIVSG etc commands (see RFC 1459)
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00217">217</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00218 {
00219 WriteFrom(Socket,User,<span class="stringliteral">"%s"</span>,s.c_str());
00220 }
</pre></div> </td>
</tr>
</table>
<a name="a22" doxytag="Server::SendMode"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::SendMode </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">char ** </td>
<td class="mdname" nowrap> <em>parameters</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>pcnt</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname" nowrap> <em>user</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sends a servermode.
<p>
you must format the parameters array with the target, modes and parameters for those modes.<p>
For example:<p>
char *modes[3];<p>
modes[0] = ChannelName;<p>
modes[1] = "+o";<p>
modes[2] = user->nick;<p>
Srv->SendMode(modes,3,user);<p>
The modes will originate from the server where the command was issued, however responses (e.g. numerics) will be sent to the user you provide as the third parameter. You must be sure to get the number of parameters correct in the pcnt parameter otherwise you could leave your server in an unstable state!
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00202">202</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="modules_8h.html#a14">server_mode()</a>.
<p>
<div class="fragment"><pre>00203 {
00204 <a class="code" href="modules_8h.html#a14">server_mode</a>(parameters,pcnt,user);
00205 }
</pre></div> </td>
</tr>
</table>
<a name="a2" doxytag="Server::SendOpers"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::SendOpers </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::string </td>
<td class="mdname1" valign="top" nowrap> <em>s</em> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sends text to all opers.
<p>
This method sends a server notice to all opers with the usermode +s.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00143">143</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00144 {
00145 WriteOpers(<span class="stringliteral">"%s"</span>,s.c_str());
00146 }
</pre></div> </td>
</tr>
</table>
<a name="a5" doxytag="Server::SendServ"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::SendServ </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></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>s</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sends text from the server to a socket.
<p>
This method writes a line of text to an established socket, with the servername prepended as used by numerics (see RFC 1459)
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00212">212</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00213 {
00214 WriteServ(Socket,<span class="stringliteral">"%s"</span>,s.c_str());
00215 }
</pre></div> </td>
</tr>
</table>
<a name="a7" doxytag="Server::SendTo"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::SendTo </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>Source</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
<td class="mdname" nowrap> <em>Dest</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>s</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sends text from a user to another user.
<p>
This method writes a line of text to a user, with a user's nick/ident /host combination prepended, as used in PRIVMSG etc commands (see RFC 1459) If you specify NULL as the source, then the data will originate from the local server, e.g. instead of:<p>
:user!ident TEXT<p>
The format will become:<p>
:localserver TEXT<p>
Which is useful for numerics and server notices to single users, etc.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00222">222</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
References <a class="el" href="connection_8h-source.html#l00166">connection::fd</a>.
<p>
<div class="fragment"><pre>00223 {
00224 <span class="keywordflow">if</span> (!Source)
00225 {
00226 <span class="comment">// if source is NULL, then the message originates from the local server</span>
00227 Write(Dest-><a class="code" href="classconnection.html#m0">fd</a>,<span class="stringliteral">":%s %s"</span>,this->GetServerName().c_str(),s.c_str());
00228 }
00229 <span class="keywordflow">else</span>
00230 {
00231 <span class="comment">// otherwise it comes from the user specified</span>
00232 WriteTo(Source,Dest,<span class="stringliteral">"%s"</span>,s.c_str());
00233 }
00234 }
</pre></div> </td>
</tr>
</table>
<a name="a23" doxytag="Server::SendToModeMask"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::SendToModeMask </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::string </td>
<td class="mdname" nowrap> <em>modes</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>flags</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>text</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sends to all users matching a mode mask You must specify one or more usermodes as the first parameter.
<p>
These can be RFC specified modes such as +i, or module provided modes, including ones provided by your own module. In the second parameter you must place a flag value which indicates wether the modes you have given will be logically ANDed or OR'ed. You may use one of either WM_AND or WM_OR. for example, if you were to use:<p>
Serv->SendToModeMask("xi", WM_OR, "m00");<p>
Then the text 'm00' will be sent to all users with EITHER mode x or i. Conversely if you used WM_AND, the user must have both modes set to receive the message.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00156">156</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00157 {
00158 WriteMode(modes.c_str(),flags,<span class="stringliteral">"%s"</span>,text.c_str());
00159 }
</pre></div> </td>
</tr>
</table>
<a name="a11" doxytag="Server::SendWallops"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void Server::SendWallops </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></td>
<td></td>
<td class="md" nowrap>std::string </td>
<td class="mdname" nowrap> <em>text</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sends a WALLOPS message.
<p>
This method writes a WALLOPS message to all users with the +w flag, originating from the specified user.
<p>
Definition at line <a class="el" href="modules_8cpp-source.html#l00265">265</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
<p>
<div class="fragment"><pre>00266 {
00267 WriteWallOps(User,<span class="keyword">false</span>,<span class="stringliteral">"%s"</span>,text.c_str());
00268 }
</pre></div> </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul>
<hr><address style="align: right;"><small>Generated on Fri Apr 30 13:23:39 2004 for InspIRCd by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0
width=110 height=53></a>1.3-rc3 </small></address>
</body>
</html>
|