mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-12 19:14:46 +02:00
Merge of 3.1-final (Mon Aug 7 18:39:12 BST 2000)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
|
||||
Unreal3.1-Silverheart Release Notes
|
||||
===================================
|
||||
|
||||
* It is most wise to have a Unreal3.1 (FINAL) -only network whenever possible. Do not
|
||||
link this to 2.1.7 or alike (might have unexpected problems). Unreal3.0
|
||||
linking might at times cause channel desynchs because of 3.0 broken SJOIN
|
||||
code.
|
||||
|
||||
* It is ADVISABLE that you allocate numerics to each server on your network.
|
||||
You simply in the M: line, just after the port, add :numeric, like:
|
||||
|
||||
M:irc.fyremoon.net:*:Description:6667:20
|
||||
|
||||
Where 20 is the numeric. Numerics are 1-255, 0 means no numeric (bad),
|
||||
and no server must have same numeric
|
||||
|
||||
* We have introduced encrypted irc connections, and we will soon have a
|
||||
client out for it (this is not SSL). Stay tuned in #UnrealIRCd for more
|
||||
information
|
||||
|
||||
* NOTE, in #UnrealIRCD we don't help with Services etc.
|
||||
|
||||
* Documentation will show up on the website sooner or later,
|
||||
http://unreal.tspre.org
|
||||
|
||||
* Read Unreal.nfo for any sake. To update your IRCd, please run the ./update
|
||||
script. This requires "wget" and "cvs" on the box to function
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
*
|
||||
*
|
||||
* UnrealIRCd Upgrade Script
|
||||
*
|
||||
|
||||
*** Downloading upgrade script from unreal.tspre.org
|
||||
@@ -458,3 +458,77 @@
|
||||
- Updated networks/networks.ndx (bad sts!)
|
||||
- Added networks/linuxsquare.network
|
||||
- Added networks/chatstation.network
|
||||
[recall]
|
||||
- Fixed the pesky hostname bug
|
||||
- Fixed a NO_OPEROVERDIE bug reported by Taz
|
||||
- Fixed a +L bug
|
||||
- Fixed a typo in Config
|
||||
- SJ3 fixes. Let's hope this works (f*cken hell..)
|
||||
- Fixed a V:line bug
|
||||
- Added /infoserv (you can stop bugging us now skold ;P)
|
||||
- Removed ALN, and the ALN system.
|
||||
- Added base64 encoding instead, for ALN v2 (NS)
|
||||
- Removed a SJ3 debug msg
|
||||
- Removed SVSMODE +l support, and fixed servicestamp and +d support
|
||||
- Changed to ircu/hybrid6/unreal mix of numeric 005
|
||||
- Fixed a SJ3 Fake Direction loopbug (kills on nick collisions)
|
||||
- SJ3 fixes, loop fix
|
||||
- Added NS, new generation ALN.
|
||||
- Added llthangel's whoisfix.patch, Makes sure +hv users show up as
|
||||
%#channel instead of +#channel. Bug report by ^Fanta.
|
||||
- Changed find_server_quick to work with masks too ..
|
||||
- Removed UPING UDP socket. Only resfd opens a udp fd now
|
||||
- Small memory cleanup
|
||||
- NS introduction in sendto_serv_butone_token
|
||||
- Fixed Q:lined nick NickServ from <unregistered> on Nickname Server message
|
||||
- Fixed a problem in synch using acptr->name as info line
|
||||
- Introduced NS in SQLINE..
|
||||
- Fixed a problem in SVS2MODE not displaying mode changes, and well known
|
||||
why
|
||||
- Recoded SVSNOOP, but the IRCd doesn't get it at all??
|
||||
- added llthangel to credits
|
||||
- Changed channel.c so when you kick someone as halfop it doesn't show as an
|
||||
OperKick (unless you kick an op) (reported by ^Fanta, patch by llthangel)
|
||||
(rc2)
|
||||
- Fixed SVS2MODE bug with illegal modes
|
||||
- Fixed /notice @%+ bug, where it didnt work at all
|
||||
- Fixed a small chmode +u bug
|
||||
- Added sendto_chanops_butone because of codemastr's laziness
|
||||
- Fixed a few +u bugs
|
||||
- Fixed a +I bug (yes another one)
|
||||
- Changed channel.c so that when an opped non +q/+a Oper kicks a user who
|
||||
is +q/+a it invokes an OperKick (patch by llthangel)
|
||||
- Fixed the +lL (+Ll) bug, will first be fixed 100% when all is 3.1
|
||||
- Possible fixed the lopts bug
|
||||
- Fixed a egcs problem in Config, the strtok bug
|
||||
- Fixed the 'ulimit core size failed' bug (now checks whether it should
|
||||
set the core size to unlimited in ./Config
|
||||
- Changed s_user.c so that Opers will see +s channels in /whois
|
||||
(patch by llthangel)
|
||||
- +u now lists +a and +q people, and sends JOINs/PARTs to +a and +q people
|
||||
- Fixed a /mode (umode) typo where it said no such channel rather than no such nick,
|
||||
reported by llthangel
|
||||
- Disabled anything with time in /list options temporary, causes bugs
|
||||
- Fixed a little /chghost bug
|
||||
- Fixed a SJ3 bug with ban syncing to SJ2 servers
|
||||
- Fixed some cloak bugs(???)
|
||||
- Made it so you can /knock without a reason, and a few /knock cleanups
|
||||
- Made it so if the server name specified in the M:line does not contain a "."
|
||||
the ircd logs it to ircd.log and dies
|
||||
- Updated ./ircd to also say to look at ircd.log
|
||||
- Fixed a SQLINE synch bug
|
||||
- Added command line option -F to prevent the ircd to fork out
|
||||
- Fixed the f*cken TKL bug
|
||||
- Fixed a netsplit bug
|
||||
- Changed some find_server(name, NULL) to find_server_quick to speed up
|
||||
lookup of servers
|
||||
- Made find_server_quick a prototype, and made some work more quicker as
|
||||
well
|
||||
- Removed the : in :nick NICK newnick :timestamp
|
||||
- Added script ./update to help update, uses pull technology (wget, cvs)
|
||||
- Added script ./Setup which makes the user forced through Unreal.nfo, FAQ,
|
||||
Config, and all the things we want them to read/do to compile the IRCd
|
||||
- Updated PREFIX Client Protoctl
|
||||
- Added ^MrMike^'s command list, this one will be updated
|
||||
- Removed ID_CVS, hopefully fixing some bastard stuff
|
||||
- Fixed a last minute SJOIN bug
|
||||
|
||||
@@ -33,6 +33,7 @@ STRINGH=undef
|
||||
STRINGSH=undef
|
||||
RUSAGEH=undef
|
||||
NOINDEX=undef
|
||||
FORCECORE=define
|
||||
NSTRERROR=undef
|
||||
NSTRTOKEN=undef
|
||||
NSTRTOK=undef
|
||||
@@ -104,6 +105,13 @@ clear
|
||||
more .CHANGES.NEW
|
||||
echo $n "[Enter to begin]"
|
||||
read cc
|
||||
clear
|
||||
fi
|
||||
if [ -r .RELEASE.NOTES ] ; then
|
||||
more .RELEASE.NOTES
|
||||
echo $n "[Enter to begin]"
|
||||
read cc
|
||||
clear
|
||||
fi
|
||||
|
||||
if [ "$1" = "-n" ] ; then
|
||||
@@ -157,7 +165,7 @@ case "$OS" in
|
||||
CRYPT_OPER_PASSWORD=""
|
||||
CRYPT_LINK_PASSWORD=""
|
||||
CRYPT_ILINE_PASSWORD=""
|
||||
CRYPT+XLINE_PASSWORD=""
|
||||
CRYPT_XLINE_PASSWORD=""
|
||||
echo "You are using FreeBSD 4.0; You can use encrypted passwords now."
|
||||
;;
|
||||
*FreeBSD*3*)
|
||||
@@ -737,6 +745,39 @@ __EOF__
|
||||
TIMES=none
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# Can we set the core size to unlimited
|
||||
#
|
||||
|
||||
echo $n "Can we set the core size to unlimited...$c"
|
||||
cat > $TMP <<__EOF__
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <unistd.h>
|
||||
main() {
|
||||
struct rlimit corelim;
|
||||
corelim.rlim_cur = corelim.rlim_max = RLIM_INFINITY;
|
||||
if (setrlimit(RLIMIT_CORE, &corelim))
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
__EOF__
|
||||
|
||||
$COMP >/dev/null 2>&1
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo " no"
|
||||
FORCECORE=undef
|
||||
else
|
||||
$EXEC
|
||||
if [ $? -ne 1 ] ; then
|
||||
echo " yes"
|
||||
else
|
||||
echo " no"
|
||||
FORCECORE=undef
|
||||
fi
|
||||
fi
|
||||
$RM -f $EXEC $TMP
|
||||
|
||||
#
|
||||
# what do we need that isn't here already ?
|
||||
#
|
||||
@@ -873,7 +914,7 @@ cat > $TMP <<__EOF__
|
||||
#endif
|
||||
main()
|
||||
{
|
||||
char *t = "1\0", *s;
|
||||
char t[] = "a\0", *s;
|
||||
s = strtok(t, ",");
|
||||
if (!strcmp(t, s))
|
||||
exit(0);
|
||||
@@ -1009,6 +1050,7 @@ cat > $SETUP <<__EOF__
|
||||
#$STDDEFH STDDEFH
|
||||
#$SYSSYSLOGH SYSSYSLOGH
|
||||
#$NOINDEX NOINDEX
|
||||
#$FORCECORE FORCE_CORE
|
||||
#$NSTRERROR NEED_STRERROR
|
||||
#$NSTRTOKEN NEED_STRTOKEN
|
||||
#$NSTRTOK NEED_STRTOK
|
||||
@@ -1194,7 +1236,7 @@ while [ -z "$FOO" ] ; do
|
||||
esac
|
||||
done
|
||||
|
||||
DOMAINNAME=`hostname -f`
|
||||
DOMAINNAME=`hostname`
|
||||
FOO=""
|
||||
runonce=""
|
||||
while [ -z "$FOO" ] ; do
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
clear
|
||||
echo "Starting up UnrealIRCd Setup"
|
||||
echo ""
|
||||
echo "Press enter to proceed to setup..."
|
||||
read cc
|
||||
more -d Unreal.nfo
|
||||
echo "Press enter to proceed to FAQ..."
|
||||
read cc
|
||||
more -d doc/faq
|
||||
echo "Press enter to proceed to configuration..."
|
||||
read cc
|
||||
if [ "$1" != "-noconfig" ] ; then
|
||||
./Config
|
||||
fi
|
||||
|
||||
echo "Press enter to proceed to compiling..."
|
||||
read cc
|
||||
make
|
||||
echo "Press enter to proceed to ircd.conf making..."
|
||||
read cc
|
||||
./makeconf
|
||||
echo "Press enter to proceed to network configuration..."
|
||||
read cc
|
||||
clear
|
||||
echo "Do you want to use one of these network files, or make your own?"
|
||||
cd networks
|
||||
ls *.network
|
||||
echo "[Type "no" if you want to make your own]"
|
||||
read cc
|
||||
if [ "$cc" == "no" ] ; then
|
||||
./makenet
|
||||
fi
|
||||
echo "Press enter to proceed to dynamic ircd configuration..."
|
||||
read cc
|
||||
pico unrealircd.conf
|
||||
echo "You should be able to run UnrealIRCd using ./ircd now".
|
||||
@@ -47,3 +47,10 @@ Assigned to DrBin:
|
||||
* #define for auto oflag +H
|
||||
* Port to MacOS 7-9, 68k architecture and PPC
|
||||
* Port to BeOS
|
||||
* +N (no nickname changes chmode)
|
||||
* Chmodes in /list possbility
|
||||
* Make cached MOTDs more memory friendly (dynamic allocation)
|
||||
* Fix up the flag and proto system
|
||||
* Make a is_chan_op, is_chanprot, is_chanowner all-in-one function
|
||||
* Split up Link (SLink)
|
||||
* Add Dlink (DSLink)
|
||||
|
||||
@@ -0,0 +1,334 @@
|
||||
Written by ^MrMike^ (mike@sector001.org) for the UnrealIRCd
|
||||
Modified by codemastr to include a few other commands
|
||||
(note, this file will be updated in CVS asap)
|
||||
|
||||
PRIVMSG
|
||||
- Used to send a message to a person or a channel
|
||||
Syntax: MSG <nick>,<nick2>,<nick3>,<nick4> <text>
|
||||
Example: PRIVMSG Stskeeps :Hello. Unreal is a very good ircd.
|
||||
Example: PRIVMSG Stskeeps,codemastr,DrBin :Hello Unreal Coding Team
|
||||
|
||||
NOTICE
|
||||
- Mainly used for one-time communication or for the results of a command.
|
||||
Syntax: NOTICE <nick>,<nick2>,<nick3>,<nick4> <text>
|
||||
Example: NOTICE codemastr :Hi. How are you?
|
||||
Example: NOTICE codemastr,Stskeeps :Hi codemastr and Stskeeps.
|
||||
|
||||
MODE
|
||||
- Used to change the mode of a channel or a user. You can only change modes for channel you are an Operator or Half-Op on. Also, you can only changes user modes for yourself.
|
||||
Syntax: MODE <channel/user> <mode>
|
||||
Example: MODE #UnrealIRCD +tn
|
||||
Example: MODE #UnrealIRCD +ootn codemastr Stskeeps
|
||||
|
||||
NICK
|
||||
- Changes your "online identity" on a server. All those in the channel you are in will be alerted of your nickname change.
|
||||
Syntax: NICK <new nickname>
|
||||
Example: NICK |codemastr|
|
||||
|
||||
JOIN
|
||||
- Used to enter one or more channels on an IRC server. All occupants of the channel will be notified of your arrival.
|
||||
Syntax: JOIN <chan>,<chan2>,<chan3>
|
||||
Example: JOIN #UnrealIRCD
|
||||
Example: JOIN #UnrealIRCD,#OperHelp
|
||||
|
||||
PING
|
||||
- Determines the amount of lag (time it takes for a response to reach a person and come back) between yourself and someone else.
|
||||
Syntax: PING <user>
|
||||
Example: PING Stskeeps
|
||||
|
||||
WHOIS
|
||||
- Shows information about the user in question, such as their "name", channels they are currently in, their hostmask, etc.
|
||||
Syntax: WHOIS <user>
|
||||
Example: WHOIS DrBin
|
||||
|
||||
ISON
|
||||
- Used to determine of a certain user or users are currently on the IRC server based upon their nickname.
|
||||
Syntax: ISON <user> <user2> <user3> <user4>
|
||||
Example: ISON Stskeeps DrBin codemastr NickServ ChanServ OperServ MemoServ
|
||||
|
||||
USER
|
||||
- Used during registration to server (i.e. during inital connection sequence.)
|
||||
|
||||
PART
|
||||
- Used to part (or leave) a channel you currently occupy. All those in the channel will be notified of your departure.
|
||||
Syntax: PART <chan>,<chan2>,<chan3>,<chan4>
|
||||
Example: PART #UnrealIRCD
|
||||
Example: PART #UnrealIRCD,#OperHelp
|
||||
|
||||
QUIT
|
||||
- Disconnects you from the IRC server. Those in the channels you occupy will be notified of your departure. If you do not specify a reason, your nickname becomes the reason.
|
||||
Syntax: QUIT <reason>
|
||||
Example: QUIT Leaving!
|
||||
|
||||
USERHOST
|
||||
- Returns the userhost of the user in question. Usually used by scripts or bots to retrieve userhost information.
|
||||
Syntax: USERHOST <nickname>
|
||||
Example: USERHOST codemastr
|
||||
|
||||
SVSNICK
|
||||
- Can only be used by a U:Lined server (i.e. services). Changes the nickname of the user in question.
|
||||
Syntax: SVSNICK <nickname> <new nickname> :<timestamp>
|
||||
Example: SVSNICK Stskeeps Techie :963086432
|
||||
|
||||
SVSMODE
|
||||
- Can only be used by a U:Lined server (i.e. services). Changes the mode of the channel or user in question.
|
||||
Syntax: SVSMODE <channel/user> :<mode>
|
||||
Example: SVSMODE #UnrealIRCD :+o Stskeeps
|
||||
Example: SVSMODE codemastr :+i
|
||||
|
||||
LUSERS
|
||||
- Provides local and global user information (such as current and maximum user count).
|
||||
Syntax: LUSERS <server>
|
||||
|
||||
CHANSERV
|
||||
- Will send a secure message to ChanServ. Similar to /msg ChanServ, but more secure. May not work if server is configured improperly.
|
||||
|
||||
TOPIC
|
||||
- Sets/Changes the topic of the channel in question, or just display the current topic.
|
||||
Syntax: TOPIC <channel>
|
||||
Syntax: TOPIC <channel> <topic>
|
||||
Example: TOPIC #operhelp
|
||||
Example: TOPIC #UnrealIRCD Welcome to the Unreal IRCD Home Channel.
|
||||
|
||||
INVITE
|
||||
- Sends a user an invitation to join a perticular channel. You must be an operator on the channel in order to invite a user into it.
|
||||
Syntax: INVITE <user> <channel>
|
||||
Example: INVITE codemastr #OperHelp
|
||||
|
||||
KICK
|
||||
- Removes a user from a channel. Can only be used by Operators or Half-Ops. If no reason is specified, your nickname becomes the reason.
|
||||
Syntax: KICK <channel> <user> <reason>
|
||||
|
||||
WALLOPS
|
||||
- Sends a "message" to all those with the umode +w. Only IRCops can send wallops, while anyone can view them.
|
||||
Syntax: WALLOPS <message>
|
||||
|
||||
KILL
|
||||
- Forcefully disconnects a user from an IRC Sever. Can only be used by IRCops.
|
||||
Syntax: KILL <user> <reason>
|
||||
Example: KILL Clone5 Cloning is not allowed
|
||||
|
||||
AWAY
|
||||
- Sets your online status to "away".
|
||||
Syntax: AWAY <reason> (AWAY without a reason will unset you away)
|
||||
Example: AWAY Walking the dog...
|
||||
|
||||
SQUIT
|
||||
- Disconnects an IRC Server from the network
|
||||
Syntax: SQUIT <server>
|
||||
Example: SQUIT leaf.*
|
||||
|
||||
WHO
|
||||
- Searches user information (-i users only) for supplied information. IRCops are a ble to search +i users.
|
||||
Syntax: WHO <search>
|
||||
Example: WHO *.aol.com
|
||||
|
||||
WHOWAS
|
||||
- Retrieves previous 'WHOIS' information for users no longer connected to the server.
|
||||
Syntax: WHOWAS <nickname>
|
||||
Example: WHOWAS Stskeeps
|
||||
|
||||
LIST
|
||||
- Provides a complete listing of all channels on the network. If a search string is specified, it will only show those matching the search string.
|
||||
Syntax: LIST <search string>
|
||||
Example: LIST
|
||||
Example: LIST *ircd*
|
||||
|
||||
NAMES
|
||||
- Provides a list of users on the specified channel.
|
||||
Syntax: NAMES <channel>
|
||||
Example: NAMES #help
|
||||
|
||||
OPER
|
||||
- Attempts to give a user IRCop status.
|
||||
Syntax: OPER <uid> <pass>
|
||||
Example: OPER codemastr codeit
|
||||
|
||||
CONNECT
|
||||
- Links another IRC server to the one you are currently on. Remote connections are also possible.
|
||||
Syntax: CONNECT <server>
|
||||
Syntax: <CONNECT> <hub> <port> <leaf>
|
||||
Example: CONNECT leaf.*
|
||||
Example: CONNECT hub.* 6667 leaf.*
|
||||
|
||||
VERSION
|
||||
- Provides version information of the IRCD software in usage.
|
||||
Syntax: VERSION
|
||||
|
||||
STATS
|
||||
- Provides certain statistical information about the server (for example, u will provide uptime information).
|
||||
Syntax: STATS <letter>
|
||||
Example: STATS u
|
||||
|
||||
LINKS
|
||||
- Lists all of the servers currently linked to the network.
|
||||
Syntax: LINKS
|
||||
|
||||
ADMIN
|
||||
- Provides administrative information regarding the server.
|
||||
Syntax: ADMIN <server>
|
||||
|
||||
SAMODE
|
||||
- Allowed a services administrator to change the mode on a channel, without having operator status.
|
||||
Syntax: SAMODE <channel> <mode>
|
||||
Example: SAMODE #UnrealIRCD +m
|
||||
|
||||
SVSKILL
|
||||
- Can only be used by a U:Lined server. Forcefully disconnects a user from the network.
|
||||
Syntax: SVSKILL <user> <reason>
|
||||
Example: SVSKILL codemastr Goodbye
|
||||
|
||||
SVSNOOP
|
||||
- Can only be used by a U:Lined server. Enabled or disables whether Global IRCop functions exist on the server in question or not.
|
||||
Syntax: SVSNOOP <server> <+/->
|
||||
Example: SVSNOOP leaf.* -
|
||||
|
||||
MOTD
|
||||
- Displays the Message of the Day.
|
||||
Syntax: MOTD
|
||||
Syntax: MOTD <server>
|
||||
|
||||
KLINE
|
||||
- "Bans" a hostmask from connection to the IRC server.
|
||||
Syntax: KLINE <hostmask> <reason>
|
||||
Example: KLINE *@*.aol.com Abuse
|
||||
|
||||
UNKLINE
|
||||
- Removes a k:line from the server.
|
||||
Syntax: UNKLINE <hostmask>
|
||||
Example: UNKLINE *@*.aol.com
|
||||
|
||||
ZLINE
|
||||
- Disables all access to the IRC server from a specified IP.
|
||||
Syntax: ZLINE <ip>
|
||||
Example: ZLINE 127.0.0.1
|
||||
|
||||
UNZLINE
|
||||
- Removes a currently active z:Line.
|
||||
Syntax: UNZLINE <ip>
|
||||
Example: ZLINE 127.0.0.1
|
||||
|
||||
GLOBOPS
|
||||
- Sends a global "message" to all IRCops. Only viewable by IRCops (unlike WallOps, which can be viewed by normal users).
|
||||
Syntax: GLOBOPS <message>
|
||||
Example: GLOBOPS Going to be akilling those clones...
|
||||
|
||||
CHATOPS
|
||||
- GLOBOPS is usually reserved for important network information. Therefore, for Oper Chat, CHATOPS was invented. IRCops with the +c flag enabled will be able to send/receive CHATOPS messages.
|
||||
Syntax: CHATOPS <message>
|
||||
Example: CHATOPS How's everyone doing today?
|
||||
|
||||
LOCOPS
|
||||
- Similar to GLOBOPS, except only received by those IRCops local to your server.
|
||||
Syntax: LOCOPS <message>
|
||||
Example: LOCOPS Going to be adding a temp k:line for that user...
|
||||
|
||||
REHASH
|
||||
- Prompts the server to reread its configuration file (ircd.conf). Will also remove any temporarly lines (i.e. k:line).
|
||||
Syntax: REHASH
|
||||
|
||||
RESTART
|
||||
- Kills and restarts the irc daemon, disconnecting all users currently on that server.
|
||||
Syntax: RESTART
|
||||
Syntax: RESTART <password>
|
||||
|
||||
DIE
|
||||
- Kills the irc daemon, disconnecting all users currently on that server.
|
||||
Syntax: DIE
|
||||
Syntax: DIE <password>
|
||||
|
||||
RULES
|
||||
- Reads the rules.conf file and sends the contents to the user.
|
||||
Syntax: RULES
|
||||
|
||||
MAP
|
||||
- Provides a "network map" of the IRC network. Mainly used for routing purposes.
|
||||
Syntax: MAP
|
||||
|
||||
DALINFO
|
||||
- Original DALnet ircd credits.
|
||||
Syntax: DALINFO
|
||||
|
||||
MKPASSWD
|
||||
- Used for generating an encrypted password. Mainly used for encrypted O:Line passwords.
|
||||
Syntax: MKPASSWD <password>
|
||||
Example: MKPASSWD codeit
|
||||
|
||||
ADDLINE
|
||||
- Adds a line to the server's ircd.conf file. After added, you must REHASH the server for it to take affect.
|
||||
Syntax: ADDLINE <line>
|
||||
Example: ADDLINE C:127.0.0.1:server.dal.net:linking:7325:50
|
||||
|
||||
TECHAT
|
||||
- Similar to CHATOPS, but only Technical Admins are able to send/receive messages on this "channel".
|
||||
Syntax: TECHAT <message>
|
||||
Example: TECHAT What do you think of the new routing map?
|
||||
|
||||
NACHAT
|
||||
- Similar to CHATOPS (and TECHAT), but only Network Admins are able to send/recieve messages.
|
||||
Syntax: NACHAT <message>
|
||||
Example: NACHAT Linking a new server in a couple minutes...
|
||||
|
||||
KNOCK
|
||||
- For channels which are invite only, you can "knock" on the channel to request an invite.
|
||||
Syntax: KNOCK <channel> <message>
|
||||
Example: KNOCK #secret_chan I'm an op, let me in!
|
||||
|
||||
CREDITS
|
||||
- Credits for Unreal IRCD.
|
||||
Syntax: CREDITS
|
||||
|
||||
LICENSE
|
||||
- GPL information.
|
||||
Syntax: LICENSE
|
||||
|
||||
SVSJOIN
|
||||
- Forces a user to join a channel. Can only be used by a U:Lined server.
|
||||
Syntax: SVSJOIN <nick> <channel>
|
||||
Example: SVSJOIN codemastr #jail
|
||||
|
||||
SAJOIN
|
||||
- Forces a user to join a channel. Can only be used by a Services Admin.
|
||||
Syntax: SAJOIN <nick> <channel>
|
||||
Example: SAJOIN Stskeeps #OperHelp
|
||||
|
||||
SVSPART
|
||||
- Forces a user to leave a channel. Can only be used by a U:Lined server.
|
||||
Syntax: SVSPART <nick> <channel>
|
||||
Example: SVSPART codemastr #jail
|
||||
|
||||
SAPART
|
||||
- Forces a user to leave a channel. Can only be used by a Services Admin.
|
||||
Syntax: SAPART <nick> <channel>
|
||||
Example: SAPART Stskeeps #OperHelp
|
||||
|
||||
SETHOST
|
||||
- Changes the hostname of yourself. Only available to IRCops.
|
||||
Syntax: SETHOST <host>
|
||||
Example: SETHOST coder.tspre.org
|
||||
|
||||
SETIDENT
|
||||
- Changes the ident of yourself. Only available to IRCops.
|
||||
Syntax: SETIDENT <ident>
|
||||
Example: SETIDENT coder
|
||||
|
||||
SETNAME
|
||||
- Changes the "IRC Name" (or "Real Name") of yourself. Available to everyone.
|
||||
Syntax: SETNAME <name>
|
||||
Example: SETNAME Unreal Coding Team Member
|
||||
|
||||
CHGHOST
|
||||
- Changes the hostname of a user currently on the IRC network. Only available to IRCops.
|
||||
Syntax: CHGHOST <nick> <host>
|
||||
Example: CHGHOST codemastr coder.tspre.org
|
||||
|
||||
CHGIDENT
|
||||
- Changes the ident of a user currently on the IRC network. Only available to IRCops.
|
||||
Syntax: CHGIDENT <nick> <ident>
|
||||
Example: CHGIDENT codemastr coder
|
||||
|
||||
CHGNAME
|
||||
- Changes the "IRC Name" (or "Real Name") of a user currently on the IRC network. Only available to IRCops.
|
||||
Syntax: CHGNAME <nick> <name>
|
||||
Example: CHGNAME codemastr Unreal Coding Team Member
|
||||
|
||||
@@ -65,61 +65,12 @@ A: Mostly you can download the newest version at
|
||||
|
||||
Versions may be spewed out regulary due to new features and bugs..
|
||||
|
||||
8) Why does it say "unlimit core failed" or something when I boot the IRCd?
|
||||
A: It's just a warning, mainly just ignore it.
|
||||
|
||||
9) I use Linux Mandrake and ./Config always hangs! What can I do??
|
||||
A: Go edit the Config script and remove those lines:
|
||||
-SNIP START-
|
||||
cat > $TMP <<__EOF__
|
||||
#$STRINGH STRINGH
|
||||
#$STRINGSH STRINGSH
|
||||
#ifdef STRINGH
|
||||
#include <string.h>
|
||||
#endif
|
||||
#ifdef STRINGSH
|
||||
#include <strings.h>
|
||||
#endif
|
||||
main()
|
||||
{
|
||||
char *t = "a", *s = strtok(t, ",");
|
||||
if (!strcmp(t, s))
|
||||
exit(0);
|
||||
exit(1);
|
||||
}
|
||||
__EOF__
|
||||
$COMP >/dev/null 2>&1
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo $n " strtok$c"
|
||||
NSTRTOK=define
|
||||
else
|
||||
$EXEC
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo $n " strtok$c"
|
||||
NSTRTOK=define
|
||||
fi
|
||||
fi
|
||||
$RM -f $EXEC $TMP
|
||||
--- SNIP END---
|
||||
And replace it by
|
||||
NSTRTOK=undef
|
||||
|
||||
This should get it to work=) (thanks to Joe Whipple for reporting this bug)
|
||||
---END----
|
||||
|
||||
10) Hosts show up as (null).network.net !!
|
||||
A: This is because you have forgotten to include the network file.
|
||||
The correct form is (in unrealircd.conf)
|
||||
Include ..........: <network file>
|
||||
|
||||
If this doesn't work .. seek me at irc.global-irc.net #unrealircd
|
||||
|
||||
11) The IRCd uses like 66.7% CPU !!!?
|
||||
A: Try run it with nice :
|
||||
/usr/bin/nice -n 19 src/ircd
|
||||
|
||||
if services go this way too just place ./<name> instead of src/ircd
|
||||
Any more support seek me at the default place:P
|
||||
If this doesn't work .. seek me at irc.ircsystems.net #unrealircd
|
||||
|
||||
12) My IRCd which runs on a FreeBSD says something about FDs and
|
||||
Max: 0 What shall I do??
|
||||
@@ -190,4 +141,4 @@ match.c:247: argument 'n' doesn't match prototype
|
||||
Then go into include/setup.h and add this line:
|
||||
#define GOT_STRCASECMP
|
||||
|
||||
(C) Carsten Munk 1999
|
||||
(C) Carsten Munk 1999-2000
|
||||
+33
-4
@@ -47,11 +47,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef DEVELOP_CVS
|
||||
#define ID_CVS(x) static char id_cvs[] = x
|
||||
#define ID_Copyright(x) static char id_copyright[] = x
|
||||
#define ID_Notes(x) static char id_notes[] = x
|
||||
#else
|
||||
#define ID_CVS(x)
|
||||
#define ID_Copyright(x)
|
||||
#define ID_Notes(x)
|
||||
#endif
|
||||
@@ -208,8 +206,39 @@ extern struct SLink *find_user_link( /* struct SLink *, struct Client * */ );
|
||||
#define ZIPSTUFF ""
|
||||
#endif
|
||||
|
||||
#define PROTOCTL_CLIENT "TOKEN WATCH=128 SAFELIST HCN PREFIX=@+%"
|
||||
#define PROTOCTL_SERVER "NOQUIT TOKEN NICKv2 SJOIN SJOIN2 UMODE2 ALN VL SJ3" ZIPSTUFF
|
||||
/* IRCu/Hybrid/Unreal way now :) -Stskeeps */
|
||||
|
||||
#define PROTOCTL_CLIENT \
|
||||
":%s 005 %s" \
|
||||
" MAP" \
|
||||
" KNOCK" \
|
||||
" SAFELIST" \
|
||||
" HCN" \
|
||||
" WATCH=%i" \
|
||||
" SILENCE=%i" \
|
||||
" MODES=%i" \
|
||||
" MAXCHANNELS=%i" \
|
||||
" MAXBANS=%i" \
|
||||
" NICKLEN=%i" \
|
||||
" TOPICLEN=%i" \
|
||||
" KICKLEN=%i" \
|
||||
" CHANTYPES=%s" \
|
||||
" PREFIX=%s" \
|
||||
" :are supported by this server"
|
||||
|
||||
#define PROTOCTL_PARAMETERS MAXWATCH, \
|
||||
MAXSILES, \
|
||||
MAXMODEPARAMS, \
|
||||
MAXCHANNELSPERUSER, \
|
||||
MAXBANS, \
|
||||
NICKLEN, \
|
||||
TOPICLEN, \
|
||||
TOPICLEN, \
|
||||
"#", \
|
||||
"(ohv)@%+"
|
||||
|
||||
/* Server-Server PROTOCTL -Stskeeps */
|
||||
#define PROTOCTL_SERVER "NOQUIT TOKEN NICKv2 SJOIN SJOIN2 UMODE2 VL SJ3 NS" ZIPSTUFF
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
|
||||
+3
-1
@@ -197,11 +197,12 @@
|
||||
|
||||
/* #undef DEBUGMODE /* define DEBUGMODE to enable debugging mode.*/
|
||||
|
||||
/* We not check whether this is ok at compile time -- codemastr */
|
||||
/*
|
||||
* defining FORCE_CORE will automatically "unlimit core", forcing the
|
||||
* server to dump a core file whenever it has a fatal error. -mlv
|
||||
*/
|
||||
#define FORCE_CORE
|
||||
/* #define FORCE_CORE */
|
||||
|
||||
/*
|
||||
* Full pathnames and defaults of irc system's support files. Please note that
|
||||
@@ -399,6 +400,7 @@
|
||||
#define OperServ "OperServ"
|
||||
#define HelpServ "HelpServ"
|
||||
#define StatServ "StatServ"
|
||||
#define InfoServ "InfoServ"
|
||||
|
||||
/*
|
||||
* How many seconds in between simultaneous nick changes?
|
||||
|
||||
+6
-1
@@ -81,6 +81,11 @@ extern int R_do_socks, R_good_socks, R_no_socks;
|
||||
#endif
|
||||
extern aChannel *find_channel PROTO((char *, aChannel *));
|
||||
extern void remove_user_from_channel PROTO((aClient *, aChannel *));
|
||||
extern char *base64enc PROTO((unsigned long));
|
||||
extern unsigned long base64dec PROTO((char *));
|
||||
extern void add_server_to_table PROTO((aClient *));
|
||||
extern void remove_server_from_tabel PROTO((aClient *));
|
||||
|
||||
/* for services */
|
||||
extern void del_invite PROTO((aClient *, aChannel *));
|
||||
extern int del_silence PROTO((aClient *, char *));
|
||||
@@ -101,7 +106,7 @@ extern aClient *find_nickserv PROTO((char *, aClient *));
|
||||
extern aClient *find_person PROTO((char *, aClient *));
|
||||
extern aClient *find_server PROTO((char *, aClient *));
|
||||
extern aClient *find_service PROTO((char *, aClient *));
|
||||
|
||||
extern aClient *find_server_quick PROTO((char *));
|
||||
extern char *find_or_add PROTO((char *));
|
||||
extern int attach_conf PROTO((aClient *, aConfItem *));
|
||||
extern aConfItem *attach_confs PROTO((aClient *, char *, int));
|
||||
|
||||
+6
-2
@@ -314,9 +314,11 @@
|
||||
#define TOK_CRYPTO "BM"
|
||||
#endif
|
||||
#define MSG_NEWJOIN "NEWJOIN" /* For CR Java Chat */
|
||||
|
||||
#define MSG_POST "POST"
|
||||
#define TOK_POST "BN"
|
||||
#define MSG_INFOSERV "INFOSERV"
|
||||
#define MSG_IS "IS"
|
||||
#define TOK_INFOSERV "BO"
|
||||
#define MAXPARA 15
|
||||
|
||||
extern int m_private(), m_topic(), m_join(), m_part(), m_mode(), m_svsmode();
|
||||
@@ -332,7 +334,7 @@ extern int m_motd(), m_who(), m_whois(), m_user(), m_list();
|
||||
extern int m_server(), m_info(), m_links(), m_summon(), m_stats();
|
||||
extern int m_users(), m_version(), m_help();
|
||||
extern int m_nickserv(), m_operserv(), m_chanserv(), m_memoserv(),
|
||||
m_helpserv(), m_services(), m_identify();
|
||||
m_infoserv(), m_helpserv(), m_services(), m_identify();
|
||||
extern int m_statserv();
|
||||
extern int m_squit(), m_away(), m_connect();
|
||||
extern int m_oper(), m_pass(), m_trace();
|
||||
@@ -413,6 +415,8 @@ struct Message msgtab[] = {
|
||||
{MSG_CS, m_chanserv, 0, 1, 1, TOK_CHANSERV, 0L},
|
||||
{MSG_NICKSERV, m_nickserv, 0, 1, 1, TOK_NICKSERV, 0L},
|
||||
{MSG_NS, m_nickserv, 0, 1, 1, TOK_NICKSERV, 0L},
|
||||
{MSG_INFOSERV, m_infoserv, 0, 1, 1, TOK_INFOSERV, 0L},
|
||||
{MSG_IS, m_infoserv, 0, 1, 1, TOK_INFOSERV, 0L},
|
||||
{MSG_OPERSERV, m_operserv, 0, 1, 1, TOK_OPERSERV, 0L},
|
||||
{MSG_OS, m_operserv, 0, 1, 1, TOK_OPERSERV, 0L},
|
||||
{MSG_MEMOSERV, m_memoserv, 0, 1, 1, TOK_MEMOSERV, 0L},
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
* $Id$
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.1.1.1.6.2 2000/07/16 20:37:04 stskeeps
|
||||
* Unreal3.1-beta3 to Unreal3.1
|
||||
*
|
||||
* Revision 1.1.1.1.6.1.2.1 2000/07/14 20:22:57 stskeeps
|
||||
* +- Indentation and more SJ3 fixes
|
||||
*
|
||||
|
||||
+6
-4
@@ -140,6 +140,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
|
||||
#define BOOT_TTY 16
|
||||
#define BOOT_OPER 32
|
||||
#define BOOT_AUTODIE 64
|
||||
#define BOOT_NOFORK 128
|
||||
|
||||
#define STAT_LOG -6 /* logfile for -x */
|
||||
#define STAT_CONNECTING -4
|
||||
@@ -267,7 +268,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
|
||||
#define PROTO_NICKv2 0x8 /* Negotiated NICKv2 protocol */
|
||||
#define PROTO_SJOIN2 0x10 /* Negotiated SJOIN2 protocol */
|
||||
#define PROTO_UMODE2 0x20 /* Negotiated UMODE2 protocol */
|
||||
#define PROTO_ALN 0x40 /* Negotiated ALN protocol */
|
||||
#define PROTO_NS 0x40 /* Negotiated NS protocol */
|
||||
#define PROTO_ZIP 0x80 /* Negotiated ZIP protocol */
|
||||
#define PROTO_VL 0x100 /* Negotiated VL protocol */
|
||||
#define PROTO_SJ3 0x200 /* Negotiated SJ3 protocol */
|
||||
@@ -405,7 +406,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
|
||||
#define SupportNICKv2(x) ((x)->proto & PROTO_NICKv2)
|
||||
#define SupportSJOIN2(x) ((x)->proto & PROTO_SJOIN2)
|
||||
#define SupportUMODE2(x) ((x)->proto & PROTO_UMODE2)
|
||||
#define SupportALN(x) ((x)->proto & PROTO_ALN)
|
||||
#define SupportNS(x) ((x)->proto & PROTO_NS)
|
||||
#define SupportVL(x) ((x)->proto & PROTO_VL)
|
||||
#define SupportSJ3(x) ((x)->proto & PROTO_SJ3)
|
||||
#define SupportVHP(x) ((x)->proto & PROTO_VHP)
|
||||
@@ -416,7 +417,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
|
||||
#define SetNICKv2(x) ((x)->proto |= PROTO_NICKv2)
|
||||
#define SetSJOIN2(x) ((x)->proto |= PROTO_SJOIN2)
|
||||
#define SetUMODE2(x) ((x)->proto |= PROTO_UMODE2)
|
||||
#define SetALN(x) ((x)->proto |= PROTO_ALN)
|
||||
#define SetNS(x) ((x)->proto |= PROTO_NS)
|
||||
#define SetVL(x) ((x)->proto |= PROTO_VL)
|
||||
#define SetSJ3(x) ((x)->proto |= PROTO_SJ3)
|
||||
#define SetVHP(x) ((x)->proto |= PROTO_VHP)
|
||||
@@ -705,6 +706,7 @@ struct Server {
|
||||
char by[NICKLEN + 1];
|
||||
aConfItem *nline; /* N-line pointer for this server */
|
||||
time_t timestamp; /* Remotely determined connect try time */
|
||||
unsigned short numeric; /* NS numeric, 0 if none */
|
||||
#ifdef LIST_DEBUG
|
||||
aClient *bcptr;
|
||||
#endif
|
||||
@@ -926,7 +928,7 @@ struct SMode {
|
||||
/* x:y */
|
||||
int msgs; /* x */
|
||||
int per; /* y */
|
||||
int kmode; /* mode 0 = kick 1 = ban */
|
||||
unsigned short kmode; /* mode 0 = kick 1 = ban */
|
||||
};
|
||||
|
||||
/* Message table structure */
|
||||
|
||||
@@ -24,6 +24,8 @@ echo "| (3) DPATH or SPATH's are incorrect. Run |"
|
||||
echo "| ./Config to correct that. |"
|
||||
echo "| (4) Someone else is running an ircd on the |"
|
||||
echo "| default port you chose in ircd.conf. |"
|
||||
echo "| |"
|
||||
echo "| see ircd.log for more information |"
|
||||
echo "|********************************************|"
|
||||
echo "| If you can't get Unreal IRCd to work - go |"
|
||||
echo "| to /server irc.flirt.org and join |"
|
||||
|
||||
@@ -13,6 +13,7 @@ ADMADDR="admin@no.where.com"
|
||||
OPERNAME="admin"
|
||||
OPERADDR="*@*"
|
||||
OPERPASS="password"
|
||||
NUMERIC=""
|
||||
PORT="6667"
|
||||
OPRT="default"
|
||||
LINKPASS="linkpass"
|
||||
@@ -173,6 +174,15 @@ if [ ! -z "$cc" ]; then
|
||||
PORT="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "What server numeric does the server have (range = 1..256)"
|
||||
echo "Must NOT be the same as other servers you link with"
|
||||
echo $n " [] -> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ]; then
|
||||
NUMERIC="$cc"
|
||||
fi
|
||||
|
||||
echo " "
|
||||
echo "What is your real name? (ie: John Doe)"
|
||||
echo $n " [$ADMIN] -> $c"
|
||||
@@ -311,7 +321,7 @@ cat > $CONF << __EOF__
|
||||
########################
|
||||
|
||||
############ Server Info ############
|
||||
M:$SERVNAME:$VIRTUAL:$COMMENT:$PORT
|
||||
M:$SERVNAME:$VIRTUAL:$COMMENT:$PORT:$NUMERIC
|
||||
#####################################
|
||||
|
||||
############ Administrator Information #############
|
||||
|
||||
@@ -122,7 +122,7 @@ Set OPER_AUTO_JOIN_CHANS : 0
|
||||
Set HOST_TIMEOUT ........: 2
|
||||
|
||||
#
|
||||
# This allows you to specify the anount of retries
|
||||
# This allows you to specify the amount of retries
|
||||
# that should be send when no DNS response is received
|
||||
#
|
||||
Set HOST_RETRIES ........: 2
|
||||
|
||||
@@ -41,5 +41,4 @@
|
||||
#include <fcntl.h>
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) Carsten Munk 1999");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/************************************************************************
|
||||
* Unreal Internet Relay Chat Daemo, src/aln.c
|
||||
* (C) 2000 Carsten Munk (Techie/Stskeeps) <stskeeps@tspre.org>
|
||||
* Copyright (C) 2000 Lucas Madar [bahamut team]
|
||||
*
|
||||
* See file AUTHORS in IRC package for additional names of
|
||||
* the programmers.
|
||||
@@ -45,115 +46,198 @@
|
||||
#ifndef STANDALONE
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) Carsten Munk 2000");
|
||||
#endif
|
||||
|
||||
static char *aln_chars[] = {
|
||||
/* 0-9 */ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
|
||||
/* 10-19 */ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
|
||||
/* 20-29 */ "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
|
||||
/* 30-35 */ "U", "V", "W", "X", "Y", "Z",
|
||||
/* 36-45 */ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
|
||||
/* 46-55 */ "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
|
||||
/* 56-61 */ "u", "v", "w", "x", "y", "z",
|
||||
/* 62-71 */ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9",
|
||||
/* 73-82 */ "AA", "AB", "AC", "AD", "AE", "AF", "AG", "AH", "AI", "AJ",
|
||||
/* 83-92 */ "AK", "AL", "AM", "AN", "AO", "AP", "AQ", "AR", "AS", "AT",
|
||||
/* 93-98 */ "AU", "AV", "AW", "AX", "AY", "AZ",
|
||||
/* 99-108 */ "Aa", "Ab", "Ac", "Ad", "Ae", "Af", "Ag", "Ah", "Ai", "Aj",
|
||||
/* 109-118 */ "Ak", "Al", "Am", "An", "Ao", "Ap", "Aq", "Ar", "As",
|
||||
"At",
|
||||
/* 119-124 */ "Au", "Av", "Aw", "Ax", "Ay", "Az",
|
||||
/* 125-134 */ "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8",
|
||||
"B9",
|
||||
/* 135-144 */ "BA", "BB", "BC", "BD", "BE", "BF", "BG", "BH", "BI",
|
||||
"BJ",
|
||||
/* 145-154 */ "BK", "BL", "BM", "BN", "BO", "BP", "BQ", "BR", "BS",
|
||||
"BT",
|
||||
/* 155-160 */ "BU", "BV", "BW", "BX", "BY", "BZ",
|
||||
/* 161-170 */ "Ba", "Bb", "Bc", "Bd", "Be", "Bf", "Bg", "Bh", "Bi",
|
||||
"Bj",
|
||||
/* 171-180 */ "Bk", "Bl", "Bm", "Bn", "Bo", "Bp", "Bq", "Br", "Bs",
|
||||
"Bt",
|
||||
/* 181-186 */ "Bu", "Bv", "Bw", "Bx", "By", "Bz",
|
||||
/* 187-196 */ "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8",
|
||||
"C9",
|
||||
/* 196-205 */ "CA", "CB", "CC", "CD", "CE", "CF", "CG", "CH", "CI",
|
||||
"CJ",
|
||||
/* 206-215 */ "CK", "CL", "CM", "CN", "CO", "CP", "CQ", "CR", "CS",
|
||||
"CT",
|
||||
/* 216-227 */ "CU", "CV", "CW", "CX", "CY", "CZ",
|
||||
/* 228-237 */ "Ca", "Cb", "Cc", "Cd", "Ce", "Cf", "Cg", "Ch", "Ci",
|
||||
"Cj",
|
||||
/* 238-247 */ "Ck", "Cl", "Cm", "Cn", "Co", "Cp", "Cq", "Cr", "Cs",
|
||||
"Ct",
|
||||
/* 248-253 */ "Cu", "Cv", "Cw", "Cx", "Cy", "Cz",
|
||||
/* 254-257 */ "D0", "D1", "D2", "D3", "D4", "D5", "D6",
|
||||
/* */ "D7", "D8", "D9", "DA", "DB", "DC", "DD",
|
||||
/* EOT */ NULL
|
||||
static inline char *int_to_base64(unsigned long);
|
||||
static inline unsigned long base64_to_int(char *);
|
||||
|
||||
|
||||
static Link *servers = NULL;
|
||||
|
||||
char *base64enc(unsigned long i)
|
||||
{
|
||||
return int_to_base64(i);
|
||||
}
|
||||
|
||||
unsigned long base64dec(char *b64)
|
||||
{
|
||||
return base64_to_int(b64);
|
||||
}
|
||||
|
||||
int numeric_collides(unsigned long numeric)
|
||||
{
|
||||
Link *lp;
|
||||
|
||||
if (!numeric)
|
||||
return 0;
|
||||
|
||||
for (lp = servers; lp; lp = lp->next)
|
||||
if (numeric == lp->value.cptr->serv->numeric)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void add_server_to_table(aClient *what)
|
||||
{
|
||||
Link *ptr;
|
||||
|
||||
if (IsServer(what) || IsMe(what))
|
||||
{
|
||||
ptr = make_link();
|
||||
ptr->value.cptr = what;
|
||||
ptr->flags = what->serv->numeric;
|
||||
ptr->flood = NULL;
|
||||
ptr->next = servers;
|
||||
servers = ptr;
|
||||
}
|
||||
}
|
||||
|
||||
void remove_server_from_table(aClient *what)
|
||||
{
|
||||
Link **curr;
|
||||
Link *tmp;
|
||||
Link *lp = servers;
|
||||
|
||||
for (; lp && (lp->value.cptr == what); lp = lp->next);
|
||||
for (;;)
|
||||
{
|
||||
for (curr = &servers; (tmp = *curr); curr = &tmp->next)
|
||||
if (tmp->value.cptr == what)
|
||||
{
|
||||
*curr = tmp->next;
|
||||
free_link(tmp);
|
||||
break;
|
||||
}
|
||||
if (lp)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
aClient *find_server_by_numeric(unsigned long value)
|
||||
{
|
||||
Link *lp;
|
||||
|
||||
for (lp = servers; lp; lp = lp->next)
|
||||
if (lp->value.cptr->serv->numeric == value)
|
||||
return (lp->value.cptr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
aClient *find_server_by_base64(char *b64)
|
||||
{
|
||||
return find_server_by_numeric(base64dec(b64));
|
||||
}
|
||||
|
||||
char *find_server_id(aClient *which)
|
||||
{
|
||||
return (base64enc(which->serv->numeric));
|
||||
}
|
||||
|
||||
aClient *find_server_quick(char *name)
|
||||
{
|
||||
Link *lp;
|
||||
|
||||
for (lp = servers; lp; lp = lp->next)
|
||||
if (!match(name, lp->value.cptr->name))
|
||||
return (lp->value.cptr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
aClient *find_server_b64_or_real(char *name)
|
||||
{
|
||||
Link *lp;
|
||||
|
||||
if (strlen(name) < 4)
|
||||
{
|
||||
for (lp = servers; lp; lp = lp->next)
|
||||
if (!strcmp(base64enc(lp->value.cptr->serv->numeric), name))
|
||||
return (lp->value.cptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
return find_server_quick(name);
|
||||
}
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
/* ':' and '#' and '&' and '+' and '@' must never be in this table. */
|
||||
/* these tables must NEVER CHANGE! >) */
|
||||
char int6_to_base64_map[] = {
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D',
|
||||
'E', 'F',
|
||||
'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
|
||||
'U', 'V',
|
||||
'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
|
||||
'k', 'l',
|
||||
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'{', '}'
|
||||
};
|
||||
|
||||
int a_row = 62;
|
||||
int b_row = 124;
|
||||
int c_row = 186;
|
||||
int d_row = 248;
|
||||
char base64_to_int6_map[] = {
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
|
||||
-1, 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, -1, -1, -1, -1, -1,
|
||||
-1, 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, -1, 63, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
|
||||
};
|
||||
|
||||
char *convert2aln(int i)
|
||||
static inline char *int_to_base64(unsigned long val)
|
||||
{
|
||||
return (aln_chars[i]);
|
||||
/* 32/6 == max 6 bytes for representation,
|
||||
* +1 for the null, +1 for byte boundaries
|
||||
*/
|
||||
static char base64buf[8];
|
||||
unsigned long i = 7;
|
||||
|
||||
base64buf[i] = '\0';
|
||||
|
||||
do
|
||||
{
|
||||
base64buf[--i] = int6_to_base64_map[val & 63];
|
||||
}
|
||||
while (val >>= 6);
|
||||
|
||||
return base64buf + i;
|
||||
}
|
||||
|
||||
int convertfromaln(char *s)
|
||||
static inline unsigned long base64_to_int(char *b64)
|
||||
{
|
||||
int i;
|
||||
if (strlen(s) == 1)
|
||||
{
|
||||
for (i = 0; i < a_row; i++)
|
||||
if (!strcmp(s, aln_chars[i]))
|
||||
return (i);
|
||||
/* no matches? we return 0 */
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (*s)
|
||||
{
|
||||
case 'A':
|
||||
i = a_row;
|
||||
break;
|
||||
case 'B':
|
||||
i = b_row;
|
||||
break;
|
||||
case 'C':
|
||||
i = c_row;
|
||||
break;
|
||||
case 'D':
|
||||
i = d_row;
|
||||
break;
|
||||
default:
|
||||
i = 0;
|
||||
}
|
||||
for (; i < 257; i++)
|
||||
if (!strcmp(s, aln_chars[i]))
|
||||
return (i);
|
||||
unsigned int v = base64_to_int6_map[(u_char)*b64++];
|
||||
|
||||
/* no matches? we return 0 */
|
||||
return 0;
|
||||
while (*b64)
|
||||
{
|
||||
v <<= 6;
|
||||
v += base64_to_int6_map[(u_char)*b64++];
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
void ns_stats(aClient *cptr)
|
||||
{
|
||||
Link *lp;
|
||||
aClient *sptr;
|
||||
for (lp = servers; lp; lp = lp->next)
|
||||
{
|
||||
sptr = lp->value.cptr;
|
||||
sendto_one(cptr,
|
||||
":%s NOTICE %s :*** server=%s numeric=%i b64=%s", me.name,
|
||||
cptr->name, sptr->name, sptr->serv->numeric,
|
||||
find_server_id(sptr));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef STANDALONE
|
||||
main()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= 100; i++)
|
||||
printf("(%i = %s)\n", i, aln_chars[i]);
|
||||
|
||||
printf("62 = %s\n", convert2aln(62));
|
||||
printf("256 = %s\n", convert2aln(256));
|
||||
printf("C0 = %i\n", convertfromaln("C0"));
|
||||
printf("D = %i\n", convertfromaln("D"));
|
||||
}
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ static int message_wordlist;
|
||||
* in both private and public messages
|
||||
*/
|
||||
|
||||
void badwords_stats(aClient *sptr)
|
||||
void badwords_stats(aClient *sptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "h.h"
|
||||
#include <signal.h>
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright
|
||||
("(C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen");
|
||||
|
||||
|
||||
+333
-166
@@ -1,4 +1,5 @@
|
||||
/************************************************************************
|
||||
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/channel.c
|
||||
* Copyright (C) 1990 Jarkko Oikarinen and
|
||||
* University of Oulu, Co Center
|
||||
@@ -46,7 +47,6 @@
|
||||
#include "hash.h" /* For CHANNELHASHSIZE */
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright
|
||||
("(C) 1990 University of Oulu, Computing Center and Jarkko Oikarinen");
|
||||
|
||||
@@ -1425,27 +1425,6 @@ void make_mode_str(chptr, oldm, oldl, pcount, pvar, mode_buf, parabuf, bounce)
|
||||
}
|
||||
|
||||
*x = '\0';
|
||||
/* reconstruct bkov chain */
|
||||
for (cnt = 0; cnt < pcount; cnt++)
|
||||
{
|
||||
if ((*(pvar[cnt]) == '+') && what != MODE_ADD)
|
||||
{
|
||||
*x++ = bounce ? '-' : '+';
|
||||
what = MODE_ADD;
|
||||
}
|
||||
if ((*(pvar[cnt]) == '-') && what != MODE_DEL)
|
||||
{
|
||||
*x++ = bounce ? '+' : '-';
|
||||
what = MODE_DEL;
|
||||
}
|
||||
*x++ = *(pvar[cnt] + 1);
|
||||
tmpstr = &pvar[cnt][2];
|
||||
strncat(parabuf, tmpstr, MODEBUFLEN - 1);
|
||||
parabuf[MODEBUFLEN - 1] = '\0';
|
||||
z = strlen(parabuf);
|
||||
parabuf[z] = ' '; /* add a space */
|
||||
parabuf[z + 1] = '\0';
|
||||
}
|
||||
/* user limit */
|
||||
if (chptr->mode.limit != oldl)
|
||||
{
|
||||
@@ -1474,6 +1453,27 @@ void make_mode_str(chptr, oldm, oldl, pcount, pvar, mode_buf, parabuf, bounce)
|
||||
ircsprintf(parabuf, "%s%d", parabuf, chptr->mode.limit);
|
||||
}
|
||||
}
|
||||
/* reconstruct bkov chain */
|
||||
for (cnt = 0; cnt < pcount; cnt++)
|
||||
{
|
||||
if ((*(pvar[cnt]) == '+') && what != MODE_ADD)
|
||||
{
|
||||
*x++ = bounce ? '-' : '+';
|
||||
what = MODE_ADD;
|
||||
}
|
||||
if ((*(pvar[cnt]) == '-') && what != MODE_DEL)
|
||||
{
|
||||
*x++ = bounce ? '+' : '-';
|
||||
what = MODE_DEL;
|
||||
}
|
||||
*x++ = *(pvar[cnt] + 1);
|
||||
tmpstr = &pvar[cnt][2];
|
||||
strncat(parabuf, tmpstr, MODEBUFLEN - 1);
|
||||
parabuf[MODEBUFLEN - 1] = '\0';
|
||||
z = strlen(parabuf);
|
||||
parabuf[z] = ' '; /* add a space */
|
||||
parabuf[z + 1] = '\0';
|
||||
}
|
||||
if (bounce)
|
||||
chptr->mode.mode = oldm;
|
||||
z = strlen(parabuf);
|
||||
@@ -1902,6 +1902,14 @@ int do_mode_char(chptr, modetype, modechar, param, what, cptr, pcount, pvar,
|
||||
chptr->chname);
|
||||
break;
|
||||
}
|
||||
if (strchr(param, ','))
|
||||
{
|
||||
if (MyClient(cptr))
|
||||
sendto_one(cptr,
|
||||
":%s NOTICE %s :*** You may only specify 1 channel to link to",
|
||||
me.name, cptr->name);
|
||||
break;
|
||||
}
|
||||
if (!IsChannelName(param))
|
||||
{
|
||||
if (MyClient(cptr))
|
||||
@@ -2727,9 +2735,8 @@ int channel_link(cptr, sptr, parc, parv)
|
||||
if (MyClient(sptr))
|
||||
sendto_one(sptr, ":%s!%s@%s JOIN :%s",
|
||||
sptr->name, sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->
|
||||
user->virthost : sptr->user->realhost),
|
||||
name);
|
||||
(IsHidden(sptr) ? sptr->user->
|
||||
virthost : sptr->user->realhost), name);
|
||||
sendto_umode(UMODE_NETADMIN | UMODE_TECHADMIN,
|
||||
"*** Invisible(+I) user %s joined %s", sptr->name,
|
||||
chptr->chname);
|
||||
@@ -2949,19 +2956,15 @@ int m_join(cptr, sptr, parc, parv)
|
||||
/*
|
||||
** notify all other users on the new channel
|
||||
*/
|
||||
if (!(IsHiding(sptr)))
|
||||
sendto_channel_butserv(chptr, sptr,
|
||||
":%s JOIN :%s", parv[0], chptr->chname);
|
||||
else
|
||||
if (IsHiding(sptr))
|
||||
{
|
||||
if (MyClient(sptr))
|
||||
{
|
||||
sendto_one(sptr, ":%s!%s@%s JOIN :%s",
|
||||
sptr->name, sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->
|
||||
user->virthost : sptr->user->realhost),
|
||||
(IsHidden(sptr) ? sptr->user->
|
||||
virthost : sptr->user->realhost),
|
||||
chptr->chname);
|
||||
if (MyClient(sptr))
|
||||
{
|
||||
sendto_umode(UMODE_ADMIN,
|
||||
"*** [+I] %s invisible joined %s",
|
||||
sptr->name, chptr->chname);
|
||||
@@ -2971,6 +2974,22 @@ int m_join(cptr, sptr, parc, parv)
|
||||
sptr->name, chptr->chname);
|
||||
}
|
||||
}
|
||||
else if (chptr->mode.mode & MODE_AUDITORIUM) {
|
||||
if (MyClient(sptr))
|
||||
sendto_one(sptr, ":%s!%s@%s JOIN :%s",
|
||||
sptr->name, sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->user->
|
||||
virthost : sptr->user->realhost),
|
||||
chptr->chname);
|
||||
sendto_chanops_butone(NULL, chptr, ":%s!%s@%s JOIN :%s",
|
||||
sptr->name, sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->user->
|
||||
virthost : sptr->user->realhost),
|
||||
chptr->chname);
|
||||
}
|
||||
else
|
||||
sendto_channel_butserv(chptr, sptr,
|
||||
":%s JOIN :%s", parv[0], chptr->chname);
|
||||
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_JOIN,
|
||||
TOK_JOIN, "%s", chptr->chname);
|
||||
@@ -3076,22 +3095,8 @@ int m_part(cptr, sptr, parc, parv)
|
||||
|
||||
if (1)
|
||||
{
|
||||
if (!IsHiding(sptr))
|
||||
{
|
||||
if (parc < 3)
|
||||
{
|
||||
sendto_channel_butserv(chptr,
|
||||
sptr, PartFmt, parv[0],
|
||||
chptr->chname);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_channel_butserv(chptr,
|
||||
sptr, PartFmt2, parv[0],
|
||||
chptr->chname, comment);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (IsHiding(sptr))
|
||||
{
|
||||
if (MyClient(sptr))
|
||||
{
|
||||
@@ -3124,6 +3129,61 @@ int m_part(cptr, sptr, parc, parv)
|
||||
sptr->user->realhost),
|
||||
chptr->chname, comment);
|
||||
}
|
||||
else if (chptr->mode.mode & MODE_AUDITORIUM) {
|
||||
if (MyClient(sptr)) {
|
||||
if (parc < 3) {
|
||||
sendto_chanops_butone(NULL, chptr,
|
||||
":%s!%s@%s PART %s",
|
||||
sptr->name,
|
||||
sptr->user->username,
|
||||
(IsHidden(sptr) ?
|
||||
sptr->user->virthost :
|
||||
sptr->user->realhost),
|
||||
chptr->chname);
|
||||
if (!is_chan_op(sptr, chptr))
|
||||
sendto_one(sptr, ":%s!%s@%s PART %s",
|
||||
sptr->name,
|
||||
sptr->user->username,
|
||||
(IsHidden(sptr) ?
|
||||
sptr->user->virthost :
|
||||
sptr->user->realhost),
|
||||
chptr->chname);
|
||||
}
|
||||
else {
|
||||
sendto_chanops_butone(NULL, chptr,
|
||||
":%s!%s@%s PART %s %s",
|
||||
sptr->name,
|
||||
sptr->user->username,
|
||||
(IsHidden(sptr) ?
|
||||
sptr->user->virthost :
|
||||
sptr->user->realhost),
|
||||
chptr->chname, comment);
|
||||
if (!is_chan_op(cptr, chptr))
|
||||
sendto_one(sptr, ":%s!%s@%s PART %s %s",
|
||||
sptr->name,
|
||||
sptr->user->username,
|
||||
(IsHidden(sptr) ?
|
||||
sptr->user->virthost :
|
||||
sptr->user->realhost),
|
||||
chptr->chname, comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (MyClient(sptr)) {
|
||||
|
||||
if (parc < 3)
|
||||
|
||||
sendto_channel_butserv(chptr,
|
||||
sptr, PartFmt, parv[0],
|
||||
chptr->chname);
|
||||
else
|
||||
sendto_channel_butserv(chptr,
|
||||
sptr, PartFmt2, parv[0],
|
||||
chptr->chname, comment);
|
||||
}
|
||||
}
|
||||
remove_user_from_channel(sptr, chptr);
|
||||
}
|
||||
}
|
||||
@@ -3220,7 +3280,8 @@ int m_kick(cptr, sptr, parc, parv)
|
||||
}
|
||||
|
||||
if (IsOper(sptr))
|
||||
if (!is_chan_op(sptr, chptr))
|
||||
if (!is_chan_op(sptr, chptr) && !is_halfop(sptr, chptr)
|
||||
|| (is_halfop(sptr, chptr) && is_chan_op(who, chptr)))
|
||||
{
|
||||
sendto_umode(UMODE_EYES,
|
||||
"*** OperKick [%s @ %s -> %s (%s)]",
|
||||
@@ -3232,7 +3293,16 @@ int m_kick(cptr, sptr, parc, parv)
|
||||
if (is_chanprot(who, chptr)
|
||||
|| is_chanowner(who, chptr)
|
||||
|| IsServices(who))
|
||||
if (!IsULine(cptr, sptr) && who != sptr)
|
||||
if IsOper(sptr)
|
||||
{ /* IRCop kicking owner/prot */
|
||||
sendto_umode(UMODE_EYES,
|
||||
"*** OperKick [%s @ %s -> %s (%s)]",
|
||||
sptr->name,
|
||||
chptr->chname,
|
||||
who->name, comment);
|
||||
goto attack;
|
||||
}
|
||||
else if (!IsULine(cptr, sptr) && who != sptr)
|
||||
{
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** You cannot kick %s from %s because %s is channel protected",
|
||||
@@ -3439,7 +3509,7 @@ int m_topic(cptr, sptr, parc, parv)
|
||||
&& (chptr->mode.mode & MODE_TOPICLIMIT))
|
||||
{
|
||||
#ifdef NO_OPEROVERRIDE
|
||||
continue;
|
||||
return 0;
|
||||
#endif
|
||||
sendto_umode(UMODE_EYES,
|
||||
"*** OperTopic [IRCop: %s] - [Channel: %s] - [Topic: %s]",
|
||||
@@ -3634,18 +3704,17 @@ void send_list(aClient *cptr, int numsend)
|
||||
&& !IsMember(cptr, chptr)
|
||||
&& !IsAnOper(cptr))
|
||||
continue;
|
||||
if ((!lopt->showall)
|
||||
&& ((chptr->users < lopt->usermin)
|
||||
|| ((lopt->usermax >= 0)
|
||||
|
||||
if ((!lopt->showall)
|
||||
&& ((chptr->users < lopt->usermin) || ((lopt->usermax >= 0)
|
||||
&& (chptr->users > lopt->usermax))
|
||||
|| ((chptr->creationtime
|
||||
|| 1) <= lopt->chantimemin)
|
||||
|| (chptr->topic_time <
|
||||
|| ((chptr->creationtime) <= lopt->chantimemin)
|
||||
/* || (chptr->topic_time <
|
||||
lopt->topictimemin)
|
||||
|| (chptr->creationtime >=
|
||||
lopt->chantimemax)
|
||||
|| (chptr->topic_time >
|
||||
lopt->topictimemax)))
|
||||
lopt->topictimemax) */))
|
||||
continue;
|
||||
|
||||
if (lopt->nolist &&
|
||||
@@ -3762,8 +3831,8 @@ int check_for_chan_flood(cptr, sptr, chptr)
|
||||
if (chptr->mode.kmode == 1)
|
||||
{ /* ban. */
|
||||
ircsprintf(mask, "*!*@%s",
|
||||
(IsHidden(sptr) ? sptr->user->
|
||||
virthost : sptr->user->realhost));
|
||||
(IsHidden(sptr) ? sptr->user->virthost : sptr->
|
||||
user->realhost));
|
||||
add_banid(&me, chptr, mask);
|
||||
sendto_serv_butone(&me, ":%s MODE %s +b %s 0",
|
||||
me.name, chptr->chname, mask);
|
||||
@@ -4093,11 +4162,13 @@ int m_names(cptr, sptr, parc, parv)
|
||||
acptr = cm->value.cptr;
|
||||
if (IsInvisible(acptr) && !member)
|
||||
continue;
|
||||
if (IsHiding(acptr))
|
||||
if (IsHiding(acptr) && acptr != sptr)
|
||||
continue;
|
||||
if (chptr->mode.mode & MODE_AUDITORIUM)
|
||||
if (!is_chan_op(sptr, chptr))
|
||||
if (!(cm->flags & CHFL_CHANOP))
|
||||
if (!is_chan_op(sptr, chptr) && !is_chanprot(sptr, chptr) &&
|
||||
!is_chanowner(sptr, chptr))
|
||||
if (!(cm->flags & (CHFL_CHANOP | CHFL_CHANPROT | CHFL_CHANOWNER))
|
||||
&& acptr != sptr)
|
||||
continue;
|
||||
|
||||
if (cm->flags & CHFL_CHANOP)
|
||||
@@ -4196,7 +4267,7 @@ int m_knock(cptr, sptr, parc, parv)
|
||||
{
|
||||
aChannel *chptr;
|
||||
|
||||
if (parc < 3 || *parv[1] == '\0')
|
||||
if (parc < 2 || *parv[1] == '\0')
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NEEDMOREPARAMS),
|
||||
me.name, parv[0], "KNOCK");
|
||||
@@ -4209,7 +4280,7 @@ int m_knock(cptr, sptr, parc, parv)
|
||||
if (check_channelmask(sptr, cptr, parv[1]))
|
||||
return 0;
|
||||
/* bugfix for /knock PRv Please? */
|
||||
if (*parv[1] != '#' && *parv[1] != '&')
|
||||
if (*parv[1] != '#')
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_CANNOTKNOCK),
|
||||
me.name,
|
||||
@@ -4241,10 +4312,7 @@ int m_knock(cptr, sptr, parc, parv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (chptr->mode.mode & MODE_INVITEONLY)
|
||||
{
|
||||
}
|
||||
else
|
||||
if (!(chptr->mode.mode & MODE_INVITEONLY))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_CANNOTKNOCK),
|
||||
me.name,
|
||||
@@ -4274,9 +4342,9 @@ int m_knock(cptr, sptr, parc, parv)
|
||||
me.name, chptr->chname, sptr->name,
|
||||
sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->user->virthost : sptr->user->realhost),
|
||||
parv[2]);
|
||||
parv[2] ? parv[2] : "no reason specified");
|
||||
|
||||
sendto_one(sptr, ":%s NOTICE %s :Knocked on to %s", me.name,
|
||||
sendto_one(sptr, ":%s NOTICE %s :Knocked on %s", me.name,
|
||||
sptr->name, chptr->chname);
|
||||
return 0;
|
||||
}
|
||||
@@ -4331,7 +4399,7 @@ aParv *mp2parv(char *xmbuf, char *parmbuf)
|
||||
/* Some ugly macros, but useful */
|
||||
#define Addit(x,y) modebuf[b] = x; strcat(parabuf, y); \
|
||||
strcat(parabuf, " "); \
|
||||
if (b == RESYNCMODES) \
|
||||
if (b >= RESYNCMODES) \
|
||||
{ modebuf[b + 1] = '\0'; sendto_serv_butone_sjoin(cptr, \
|
||||
":%s MODE %s %s %s %lu", sptr->name, chptr->chname, \
|
||||
modebuf, parabuf, chptr->creationtime); \
|
||||
@@ -4342,8 +4410,12 @@ aParv *mp2parv(char *xmbuf, char *parmbuf)
|
||||
b = 1; \
|
||||
} else b++
|
||||
|
||||
|
||||
|
||||
#define Addsingle(x) modebuf[b] = x; b++
|
||||
#define CheckStatus(x,y) if (modeflags & (y)) { Addit((x), nick); }
|
||||
#define AddBan(x) strcat(banbuf, x); strcat(banbuf, " ");
|
||||
#define AddEx(x) strcat(exbuf, x); strcat(exbuf, " ");
|
||||
|
||||
|
||||
int m_sjoin(cptr, sptr, parc, parv)
|
||||
@@ -4358,16 +4430,19 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
unsigned short merge; /* same timestamp */
|
||||
char pvar[MAXMODEPARAMS][MODEBUFLEN + 3];
|
||||
char paraback[1024], modeback[1024];
|
||||
char banbuf[1024];
|
||||
char exbuf[1024];
|
||||
char nick[NICKLEN + 1];
|
||||
char *s;
|
||||
aClient *acptr, *tempptr;
|
||||
aChannel *chptr;
|
||||
Link *lp;
|
||||
Ban *ban;
|
||||
Ban *ban;
|
||||
aParv *ap;
|
||||
int ts, oldts, pcount, x, y, z, i;
|
||||
unsigned short b;
|
||||
int ts, oldts, pcount, x, y, z, i, f;
|
||||
unsigned short b, c;
|
||||
Mode oldmode;
|
||||
char *t;
|
||||
char *t, *bp, *tp;
|
||||
long modeflags;
|
||||
|
||||
if (IsClient(sptr) || parc < 3 || !IsServer(sptr))
|
||||
@@ -4378,18 +4453,18 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
|
||||
merge = nopara = nomode = removeours = removetheirs = 0;
|
||||
|
||||
if (SupportSJOIN(sptr) && !SupportSJ3(sptr) &&
|
||||
!strncmp(parv[4], "<none>", 6))
|
||||
nopara = 1;
|
||||
if (SupportSJOIN2(sptr) && !SupportSJ3(sptr) &&
|
||||
!strncmp(parv[4], "<->", 6))
|
||||
nopara = 1;
|
||||
if (SupportSJ3(sptr) && (parc < 5))
|
||||
if (SupportSJOIN(cptr) && !SupportSJ3(cptr) &&
|
||||
!strncmp(parv[4], "<none>", 6))
|
||||
nopara = 1;
|
||||
if (SupportSJOIN2(cptr) && !SupportSJ3(cptr) &&
|
||||
!strncmp(parv[4], "<->", 6))
|
||||
nopara = 1;
|
||||
if (SupportSJ3(cptr) && (parc < 6))
|
||||
nopara = 1;
|
||||
|
||||
if (SupportSJ3(sptr))
|
||||
if (SupportSJ3(cptr))
|
||||
{
|
||||
if (parc < 4)
|
||||
if (parc < 5)
|
||||
nomode = 1;
|
||||
}
|
||||
else
|
||||
@@ -4428,6 +4503,8 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
parabuf[0] = '\0';
|
||||
modebuf[0] = '+';
|
||||
modebuf[1] = '\0';
|
||||
banbuf[0] = '\0';
|
||||
exbuf[0] = '\0';
|
||||
channel_modes(cptr, modebuf, parabuf, chptr);
|
||||
if (removeours)
|
||||
{
|
||||
@@ -4524,8 +4601,7 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
if (merge && !nomode)
|
||||
{
|
||||
aCtab *acp;
|
||||
|
||||
bcopy(&chptr->mode, &oldmode, sizeof(oldmode));
|
||||
bcopy(&chptr->mode, &oldmode, sizeof(Mode));
|
||||
/* merge the modes */
|
||||
strcpy(modebuf, parv[3]);
|
||||
parabuf[0] = '\0';
|
||||
@@ -4535,7 +4611,6 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
strcat(parabuf, parv[b]);
|
||||
strcat(parabuf, " ");
|
||||
}
|
||||
strcpy(paraback, parabuf);
|
||||
ap = mp2parv(modebuf, parabuf);
|
||||
set_mode(chptr, cptr, ap->parc, ap->parv, &pcount, pvar, 0);
|
||||
|
||||
@@ -4699,23 +4774,31 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
/* Mode setting done :), now for our beloved clients */
|
||||
parabuf[0] = 0;
|
||||
modebuf[0] = '+';
|
||||
modebuf[1] = '\0';
|
||||
t = parv[parc - 1];
|
||||
*(--t) = ' '; /* set to leading space */
|
||||
f = 1;
|
||||
b = 1;
|
||||
strcpy(modebuf, "+");
|
||||
c = 0;
|
||||
bp = buf;
|
||||
while (*t != '\0')
|
||||
{
|
||||
if (*t == ' ')
|
||||
{
|
||||
i = 0;
|
||||
t++;
|
||||
if (f)
|
||||
strncpyzt(bp, (t - c), (c + 1)); /* Put the nick in bp */
|
||||
else
|
||||
strncpyzt(bp, (t - (c - 1)), c); /* Put the nick in bp */
|
||||
|
||||
c = f = 0;
|
||||
modeflags = 0;
|
||||
i = 0;
|
||||
tp = bp;
|
||||
while (
|
||||
(*t == '@') || (*t == '+') || (*t == '%')
|
||||
|| (*t == '*') || (*t == '~') || (*t == '&')
|
||||
|| (*t == '"'))
|
||||
(*tp == '@') || (*tp == '+') || (*tp == '%')
|
||||
|| (*tp == '*') || (*tp == '~') || (*tp == '&')
|
||||
|| (*tp == '"'))
|
||||
{
|
||||
switch (*(t++))
|
||||
switch (*(tp++))
|
||||
{
|
||||
case '@':
|
||||
modeflags |= CHFL_CHANOP;
|
||||
@@ -4744,13 +4827,13 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
}
|
||||
getnick:
|
||||
i = 0;
|
||||
while ((*t != ' ') && (*t != '\0'))
|
||||
nick[i++] = *(t++); /* get nick */
|
||||
while ((*tp != ' ') && (*tp != '\0'))
|
||||
nick[i++] = *(tp++); /* get nick */
|
||||
nick[i] = '\0';
|
||||
if (nick[0] == ' ')
|
||||
continue;
|
||||
goto nextnick;
|
||||
if (nick[0] == '\0')
|
||||
continue;
|
||||
goto nextnick;
|
||||
if (!(modeflags & CHFL_BAN)
|
||||
&& !(modeflags & CHFL_EXCEPT))
|
||||
{
|
||||
@@ -4760,21 +4843,20 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
("Missing user %s in SJOIN for %s from %s (%s)",
|
||||
nick, chptr->chname, sptr->name,
|
||||
backupbuf);
|
||||
continue;
|
||||
goto nextnick;
|
||||
}
|
||||
if (acptr->from != sptr)
|
||||
if (acptr->from != sptr->from)
|
||||
{
|
||||
/* The client is not from the server, send a kick for it */
|
||||
sendto_one(sptr,
|
||||
":%s KICK %s %s :Fake direction",
|
||||
me.name, acptr->name);
|
||||
me.name,chptr->chname, acptr->name);
|
||||
sendto_ops
|
||||
("Fake direction from user %s in SJOIN from %s at %s",
|
||||
acptr->from, sptr->name,
|
||||
("Fake direction from user %s in SJOIN from %s(%s) at %s",
|
||||
nick,
|
||||
sptr->from->name, sptr->name,
|
||||
chptr->chname);
|
||||
continue;
|
||||
goto nextnick;
|
||||
}
|
||||
|
||||
if (removetheirs)
|
||||
{
|
||||
modeflags = 0;
|
||||
@@ -4784,7 +4866,7 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
sendto_channel_butserv(chptr, acptr,
|
||||
":%s JOIN :%s", nick,
|
||||
chptr->chname);
|
||||
sendto_serv_butone_sjoin(cptr, ":%s JOIN :%s",
|
||||
sendto_serv_butone_sjoin(cptr, ":%s JOIN %s",
|
||||
nick, chptr->chname);
|
||||
|
||||
CheckStatus('q', CHFL_CHANOWNER);
|
||||
@@ -4796,26 +4878,28 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
else
|
||||
{
|
||||
if (removetheirs)
|
||||
continue;
|
||||
goto nextnick;
|
||||
if (modeflags & CHFL_BAN)
|
||||
{
|
||||
add_banid(sptr, chptr, nick);
|
||||
Addit('b', nick);
|
||||
sendto_serv_butone_token_opt(cptr, OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE, "%s +b %s %li", chptr->chname,
|
||||
nick, TStime());
|
||||
AddBan(nick);
|
||||
}
|
||||
if (modeflags & CHFL_EXCEPT)
|
||||
{
|
||||
add_exbanid(sptr, chptr, nick);
|
||||
Addit('e', nick);
|
||||
sendto_serv_butone_token_opt(cptr, OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE, "%s +e %s %li", chptr->chname,
|
||||
nick, TStime());
|
||||
AddEx(nick);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
nextnick:
|
||||
t++;
|
||||
c++;
|
||||
}
|
||||
|
||||
|
||||
if (modebuf[1])
|
||||
{
|
||||
sendto_serv_butone_sjoin(cptr,
|
||||
@@ -4828,69 +4912,154 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
/* we should be synched by now, */
|
||||
if (oldts != -1)
|
||||
if (oldts != chptr->creationtime)
|
||||
sendto_channel_butserv(chptr, &me,
|
||||
":%s NOTICE %s :*** Notice -- TS for %s changed from %ld to %ld",
|
||||
me.name, chptr->chname, chptr->chname,
|
||||
oldts, chptr->creationtime);
|
||||
|
||||
|
||||
strcpy(parabuf, "");
|
||||
for (i = 1; i <= (parc - 2); i++)
|
||||
{
|
||||
strcat(parabuf, parv[i]);
|
||||
if (((i + 1) <= (parc - 2)))
|
||||
strcat(parabuf, " ");
|
||||
}
|
||||
sendto_channel_butserv(chptr, &me,
|
||||
":%s NOTICE %s :*** Notice -- TS for %s changed from %ld to %ld",
|
||||
me.name, chptr->chname, chptr->chname,
|
||||
oldts, chptr->creationtime);
|
||||
|
||||
|
||||
strcpy(parabuf, "");
|
||||
for (i = 1; i <= (parc - 2); i++)
|
||||
{
|
||||
if (!parv[i])
|
||||
{
|
||||
sendto_ops("Got null parv in SJ3 code");
|
||||
continue;
|
||||
}
|
||||
strcat(parabuf, parv[i]);
|
||||
if (((i + 1) <= (parc - 2)))
|
||||
strcat(parabuf, " ");
|
||||
}
|
||||
|
||||
/* This sends out to SJ3 servers .. */
|
||||
sendto_serv_butone_token_opt(cptr, OPT_SJOIN|OPT_SJ3, sptr->name,
|
||||
MSG_SJOIN, TOK_SJOIN, "%s :%s", parabuf, parv[parc - 1]);
|
||||
|
||||
sendto_serv_butone_token_opt(cptr, OPT_SJOIN | OPT_SJ3, sptr->name,
|
||||
MSG_SJOIN, TOK_SJOIN, "%s :%s", parabuf, parv[parc - 1]);
|
||||
Debug((DEBUG_DEBUG, "Sending '%s :%s' to sj3", parabuf, parv[parc - 1]));
|
||||
/* We strip out & and " here, for SJ2 */
|
||||
strcpy(parabuf, "");
|
||||
t = parv[parc - 1];
|
||||
ap = mp2parv("*", t);
|
||||
strcpy(parabuf, "");
|
||||
t = parv[parc - 1];
|
||||
ap = mp2parv("*", t);
|
||||
for (i = 1; i < ap->parc; i++)
|
||||
{
|
||||
if (!ap->parv[i])
|
||||
{
|
||||
sendto_ops("Got null parv in SJ2 code");
|
||||
continue;
|
||||
}
|
||||
if (*ap->parv[i] == '&')
|
||||
continue;
|
||||
if (*ap->parv[i] == '"')
|
||||
continue;
|
||||
|
||||
|
||||
strcat(parabuf, ap->parv[i]);
|
||||
if (!((i + 1) == ap->parc))
|
||||
strcat(parabuf, " ");
|
||||
}
|
||||
|
||||
|
||||
if (nomode)
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr, OPT_SJOIN|OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name,
|
||||
MSG_SJOIN, TOK_SJOIN, "%s %s + <-> :%s", parv[1],
|
||||
parv[2], parabuf);
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN | OPT_SJOIN2 | OPT_NOT_SJ3, sptr->name, MSG_SJOIN,
|
||||
TOK_SJOIN, "%s %s + <-> :%s", parv[1], parv[2], parabuf);
|
||||
Debug((DEBUG_DEBUG, "Sending to SJ2: %s %s + <-> :%s", parv[1], parv[2], parabuf));
|
||||
if (*banbuf)
|
||||
{
|
||||
for (s = (char *) strtok(banbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +b %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
|
||||
if (*exbuf)
|
||||
{
|
||||
for (s = (char *) strtok(exbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +e %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (nopara)
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr, OPT_SJOIN|OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name,
|
||||
MSG_SJOIN, TOK_SJOIN, "%s %s %s <-> :%s", parv[1],
|
||||
parv[2], parv[3], parabuf);
|
||||
return 0;
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN | OPT_SJOIN2 | OPT_NOT_SJ3, sptr->name, MSG_SJOIN,
|
||||
TOK_SJOIN, "%s %s %s <-> :%s", parv[1], parv[2], parv[3],
|
||||
parabuf);
|
||||
Debug((DEBUG_DEBUG, "Sending to SJ2: %s %s %s <-> :%s",
|
||||
parv[1], parv[2], parv[3], parabuf));
|
||||
if (*banbuf)
|
||||
{
|
||||
for (s = (char *) strtok(banbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +b %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
|
||||
if (*exbuf)
|
||||
{
|
||||
for (s = (char *) strtok(exbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +e %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
strcpy(paraback, "");
|
||||
ap = mp2parv("*", parv[4]);
|
||||
ap = mp2parv("*", parv[4]);
|
||||
for (i = 2; i < ap->parc; i++)
|
||||
{
|
||||
strcat(paraback, ap->parv[i]);
|
||||
strcat(paraback, " ");
|
||||
}
|
||||
sendto_serv_butone_token_opt(cptr, OPT_SJOIN|OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name,
|
||||
MSG_SJOIN, TOK_SJOIN, "%s %s %s %s :%s",
|
||||
parv[1], parv[2], parv[3], paraback, parabuf);
|
||||
sendto_serv_butone_token_opt(cptr, OPT_SJOIN | OPT_SJOIN2 | OPT_NOT_SJ3,
|
||||
sptr->name,
|
||||
MSG_SJOIN, TOK_SJOIN, "%s %s %s %s :%s",
|
||||
parv[1], parv[2], parv[3], paraback, parabuf);
|
||||
Debug((DEBUG_DEBUG, "sending to SJ2: %s %s %s %s :%s",
|
||||
parv[1], parv[2], parv[3], paraback, parabuf));
|
||||
/* Syncing bans to sj2 .. correctly. */
|
||||
if (*banbuf)
|
||||
{
|
||||
for (s = (char *) strtok(banbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +b %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
|
||||
if (*exbuf)
|
||||
{
|
||||
for (s = (char *) strtok(exbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +e %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
/* And we are synched */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -5108,7 +5277,7 @@ void send_channel_modes_sjoin3(cptr, chptr)
|
||||
Ban *ban;
|
||||
char *name;
|
||||
char *bufptr;
|
||||
short nomode, nopara;
|
||||
short nomode, nopara;
|
||||
char bbuf[1024];
|
||||
int n = 0;
|
||||
|
||||
@@ -5123,36 +5292,34 @@ void send_channel_modes_sjoin3(cptr, chptr)
|
||||
|
||||
*modebuf = *parabuf = '\0';
|
||||
channel_modes(cptr, modebuf, parabuf, chptr);
|
||||
|
||||
|
||||
if (!modebuf[1])
|
||||
nomode = 1;
|
||||
if (!(*parabuf))
|
||||
nopara = 1;
|
||||
|
||||
|
||||
if (nomode)
|
||||
|
||||
|
||||
if (nomode && nopara)
|
||||
{
|
||||
ircsprintf(buf, "%s %ld %s :",
|
||||
(IsToken(cptr) ? TOK_SJOIN : MSG_SJOIN),
|
||||
chptr->creationtime, chptr->chname);
|
||||
}
|
||||
else
|
||||
if (nopara)
|
||||
if (nopara && !nomode)
|
||||
{
|
||||
ircsprintf(buf, "%s %ld %s %s :",
|
||||
(IsToken(cptr) ? TOK_SJOIN : MSG_SJOIN),
|
||||
chptr->creationtime, chptr->chname, modebuf);
|
||||
|
||||
}
|
||||
else
|
||||
if (!nopara && !nomode)
|
||||
{
|
||||
ircsprintf(buf, "%s %ld %s %s %s :",
|
||||
(IsToken(cptr) ? TOK_SJOIN : MSG_SJOIN),
|
||||
(IsToken(cptr) ? TOK_SJOIN : MSG_SJOIN),
|
||||
chptr->creationtime, chptr->chname, modebuf, parabuf);
|
||||
}
|
||||
strcpy(bbuf, buf);
|
||||
|
||||
|
||||
bufptr = buf + strlen(buf);
|
||||
|
||||
for (lp = members; lp; lp = lp->next)
|
||||
@@ -5212,7 +5379,7 @@ void send_channel_modes_sjoin3(cptr, chptr)
|
||||
|
||||
bufptr = buf + strlen(buf);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
for (ban = chptr->exlist; ban; ban = ban->next)
|
||||
{
|
||||
@@ -5233,9 +5400,9 @@ void send_channel_modes_sjoin3(cptr, chptr)
|
||||
|
||||
bufptr = buf + strlen(buf);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (n)
|
||||
{
|
||||
*bufptr++ = '\0';
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) 1993 Darren Reed");
|
||||
ID_Notes("DF version was 1.9 1/30/94");
|
||||
|
||||
|
||||
+17
-16
@@ -1,8 +1,8 @@
|
||||
|
||||
#include <windows.h>
|
||||
#include "Cio.h"
|
||||
#include "CioFunc.h"
|
||||
#include "common.h"
|
||||
ID_CVS("$Id$");
|
||||
|
||||
//
|
||||
// FUNCTION: Cio_Init(void)
|
||||
@@ -11,22 +11,23 @@ ID_CVS("$Id$");
|
||||
//
|
||||
BOOL Cio_Init(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
WNDCLASS wc;
|
||||
|
||||
// Fill in window class structure with parameters that describe
|
||||
// the main window.
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wc.lpfnWndProc = (WNDPROC)Cio_WndProc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 4;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = NULL;
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE);
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.lpszClassName = CIOCLASS;
|
||||
// Fill in window class structure with parameters that describe
|
||||
// the main window.
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wc.lpfnWndProc = (WNDPROC) Cio_WndProc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 4;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = NULL;
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE);
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.lpszClassName = CIOCLASS;
|
||||
|
||||
if ( !RegisterClass(&wc) ) return FALSE;
|
||||
if (!RegisterClass(&wc))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+421
-412
File diff suppressed because it is too large
Load Diff
+2
-3
@@ -23,7 +23,6 @@
|
||||
#include "numeric.h"
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) 1990 Darren Reed");
|
||||
ID_Notes("1.4 6/28/93");
|
||||
|
||||
@@ -33,7 +32,7 @@ ID_Notes("1.4 6/28/93");
|
||||
#define BAD_CLIENT_CLASS -3
|
||||
|
||||
aClass *classes;
|
||||
int badclass = 0;
|
||||
int badclass = 0;
|
||||
|
||||
int get_conf_class(aconf)
|
||||
aConfItem *aconf;
|
||||
@@ -143,7 +142,7 @@ void add_class(class, ping, confreq, maxli, sendq)
|
||||
if (maxli > (MAXCONNECTIONS - 15))
|
||||
{
|
||||
Debug((DEBUG_DEBUG, "Reducing class %d to %i",
|
||||
class, (MAXCONNECTIONS - 15)));
|
||||
class, (MAXCONNECTIONS - 15)));
|
||||
maxli = MAXCONNECTIONS - 15;
|
||||
}
|
||||
t = find_class(class);
|
||||
|
||||
@@ -41,7 +41,6 @@ static char sccxid[] = "@(#)cloak.c 9.00 7/12/99 UnrealIRCd";
|
||||
#endif
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
|
||||
// #define iNAH /* networks.h now */
|
||||
/* Hidden host code below */
|
||||
@@ -215,8 +214,6 @@ char *make_virthost(char *curr, char *new, int mode)
|
||||
int i;
|
||||
if (curr == NULL)
|
||||
return;
|
||||
if (new == NULL)
|
||||
return;
|
||||
|
||||
mask = hidehost(curr, 0);
|
||||
if (mode == 0)
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
char *collapse PROTO((char *pattern));
|
||||
extern aClient *client, *local[];
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) Tony Vincell");
|
||||
|
||||
#else
|
||||
|
||||
+1
-2
@@ -42,7 +42,6 @@
|
||||
#ifdef USE_DMALLOC
|
||||
#include "h.h"
|
||||
#endif
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) 1990 Markku Savela");
|
||||
ID_Notes("2.17 1/30/94 (C) 1990 Markku Savela");
|
||||
#if !defined(VALLOC) && !defined(valloc) && !defined(USE_DMALLOC)
|
||||
@@ -313,7 +312,7 @@ int dbuf_getmsg(dyn, buf, length)
|
||||
while (length > 0 && dlen > 0)
|
||||
{
|
||||
dlen--;
|
||||
if (*s == '\n' /* || *s == '\r' */) /*let stop at \n now .. */
|
||||
if (*s == '\n' /* || *s == '\r' */ ) /*let stop at \n now .. */
|
||||
{
|
||||
copy = dyn->length - dlen;
|
||||
/*
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include "h.h"
|
||||
#include "setup.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) 1999-2000 Carsten Munk");
|
||||
|
||||
#define DoDebug fprintf(stderr, "[%s] %s | %li\n", babuf, __FILE__, __LINE__);
|
||||
|
||||
+5
-5
@@ -22,11 +22,11 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
main()
|
||||
main()
|
||||
{
|
||||
int i;
|
||||
int s;
|
||||
|
||||
int i;
|
||||
int s;
|
||||
|
||||
for (i = 1; i <= 10000; i++)
|
||||
{
|
||||
s = socket(AF_INET, SOCK_STREAM, 0);
|
||||
@@ -36,4 +36,4 @@ main()
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -25,7 +25,6 @@
|
||||
#include "hash.h"
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) 1991 Darren Reed");
|
||||
ID_Notes("2.10 7/3/93");
|
||||
|
||||
@@ -572,8 +571,8 @@ int hash_check_notify(cptr, reply)
|
||||
lp->value.cptr->name, cptr->name,
|
||||
(IsPerson(cptr) ? cptr->user->username : "<N/A>"),
|
||||
(IsPerson(cptr) ?
|
||||
(IsHidden(cptr) ? cptr->user->virthost : cptr->user->
|
||||
realhost) : "<N/A>"), anptr->lasttime, cptr->info);
|
||||
(IsHidden(cptr) ? cptr->user->virthost : cptr->
|
||||
user->realhost) : "<N/A>"), anptr->lasttime, cptr->info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+2
-2
@@ -26,7 +26,6 @@
|
||||
#include "sys.h"
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("DALnet & Techie");
|
||||
ID_Notes("6.20 7/5/99");
|
||||
|
||||
@@ -96,7 +95,8 @@ int parse_help(sptr, name, help)
|
||||
}
|
||||
else if (!myncmp(help, "ABOUT", 8))
|
||||
{
|
||||
SND("Type /info for UnrealIRCd information -- Carsten Munk / Techie .. =)");
|
||||
SND
|
||||
("Type /info for UnrealIRCd information -- Carsten Munk / Techie .. =)");
|
||||
}
|
||||
else if (!myncmp(help, "WATCH", 8))
|
||||
{
|
||||
|
||||
+26
-11
@@ -61,7 +61,6 @@ Computing Center and Jarkko Oikarinen";
|
||||
#endif
|
||||
#include "version.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright
|
||||
("(C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen");
|
||||
ID_Notes("2.48 3/9/94");
|
||||
@@ -101,7 +100,7 @@ char REPORT_DO_SOCKS[128], REPORT_NO_SOCKS[128], REPORT_GOOD_SOCKS[128];
|
||||
#endif
|
||||
#endif
|
||||
aClient me; /* That's me */
|
||||
char *me_hash;
|
||||
char *me_hash;
|
||||
aClient *client = &me; /* Pointer to beginning of Client list */
|
||||
extern char backupbuf[8192];
|
||||
|
||||
@@ -649,6 +648,8 @@ extern time_t check_pings(time_t currenttime, int check_kills)
|
||||
return (oldest);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** bad_command
|
||||
** This is called when the commandline is not acceptable.
|
||||
@@ -784,6 +785,9 @@ int InitwIRCD(argc, argv)
|
||||
#endif
|
||||
dpath = p;
|
||||
break;
|
||||
case 'F':
|
||||
bootopt |= BOOT_NOFORK;
|
||||
break;
|
||||
#ifndef _WIN32
|
||||
#ifdef CMDLINE_CONFIG
|
||||
case 'f':
|
||||
@@ -806,6 +810,17 @@ int InitwIRCD(argc, argv)
|
||||
(void)printf("sizeof(aClient) == %u\n", sizeof(aClient));
|
||||
(void)printf("sizeof(aChannel) == %u\n", sizeof(aChannel));
|
||||
(void)printf("sizeof(aServer) == %u\n", sizeof(aServer));
|
||||
(void)printf("sizeof(Link) == %u\n", sizeof(Link));
|
||||
(void)printf("sizeof(anUser) == %u\n", sizeof(anUser));
|
||||
(void)printf("sizeof(aConfItem) == %u\n", sizeof(aConfItem));
|
||||
(void)printf("sizeof(aVhost) == %u\n", sizeof(aVhost));
|
||||
(void)printf("sizeof(aTKline) == %u\n", sizeof(aTKline));
|
||||
|
||||
(void)printf("sizeof(struct ircstatsx) == %u\n",
|
||||
sizeof(struct ircstatsx));
|
||||
(void)printf("aClient remote == %u\n",
|
||||
CLIENT_REMOTE_SIZE);
|
||||
|
||||
exit(0);
|
||||
break;
|
||||
#ifndef _WIN32
|
||||
@@ -997,6 +1012,8 @@ int InitwIRCD(argc, argv)
|
||||
(void)init_sys();
|
||||
me.flags = FLAGS_LISTEN;
|
||||
me.fd = -1;
|
||||
SetMe(&me);
|
||||
make_server(&me);
|
||||
|
||||
#ifdef USE_SYSLOG
|
||||
openlog(myargv[0], LOG_PID | LOG_NDELAY, LOG_FACILITY);
|
||||
@@ -1032,7 +1049,6 @@ int InitwIRCD(argc, argv)
|
||||
motd = (aMotd *) read_motd(MPATH);
|
||||
svsmotd = (aMotd *) read_svsmotd(VPATH);
|
||||
read_tlines();
|
||||
(void)setup_ping();
|
||||
(void)get_my_name(&me, me.sockhost, sizeof(me.sockhost) - 1);
|
||||
if (me.name[0] == '\0')
|
||||
strncpyzt(me.name, me.sockhost, sizeof(me.name));
|
||||
@@ -1045,16 +1061,15 @@ int InitwIRCD(argc, argv)
|
||||
#ifdef SOCKSPORT
|
||||
me.socksfd = -1;
|
||||
#endif
|
||||
SetMe(&me);
|
||||
make_server(&me);
|
||||
me_hash = find_or_add(me.name);
|
||||
me.serv->up = me_hash;
|
||||
|
||||
add_server_to_table(&me);
|
||||
me.lasttime = me.since = me.firsttime = TStime();
|
||||
(void)add_to_client_hash_table(me.name, &me);
|
||||
#if !defined(_AMIGA) && !defined(_WIN32) && !defined(NO_FORKING)
|
||||
if (fork())
|
||||
exit(0);
|
||||
if (!(bootopt & BOOT_NOFORK))
|
||||
if (fork())
|
||||
exit(0);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1087,10 +1102,9 @@ int InitwIRCD(argc, argv)
|
||||
#ifdef SOCKSPORT
|
||||
init_socks(&me);
|
||||
#endif
|
||||
|
||||
check_class();
|
||||
write_pidfile();
|
||||
|
||||
|
||||
Debug((DEBUG_NOTICE, "Server ready..."));
|
||||
#ifdef USE_SYSLOG
|
||||
syslog(LOG_NOTICE, "Server Ready");
|
||||
@@ -1104,6 +1118,7 @@ int InitwIRCD(argc, argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void SocketLoop(void *dummy)
|
||||
{
|
||||
time_t delay = 0, now;
|
||||
@@ -1162,7 +1177,7 @@ void SocketLoop(void *dummy)
|
||||
}
|
||||
if (do_garbage_collect == 1)
|
||||
do_garbage_collect = 0;
|
||||
|
||||
|
||||
last_garbage_collect = now;
|
||||
}
|
||||
/*
|
||||
|
||||
+6
-3
@@ -48,7 +48,6 @@ void free_link PROTO((Link *));
|
||||
Link *make_link PROTO(());
|
||||
extern ircstats IRCstats;
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright
|
||||
("(C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen");
|
||||
ID_Notes("2.24 4/20/94");
|
||||
@@ -186,8 +185,7 @@ anUser *make_user(cptr)
|
||||
user->invited = NULL;
|
||||
user->silence = NULL;
|
||||
user->server = NULL;
|
||||
user->virthost = MyMalloc(2);
|
||||
*user->virthost = '\0';
|
||||
user->virthost = NULL;
|
||||
cptr->user = user;
|
||||
}
|
||||
return user;
|
||||
@@ -196,6 +194,7 @@ anUser *make_user(cptr)
|
||||
aServer *make_server(cptr)
|
||||
aClient *cptr;
|
||||
{
|
||||
|
||||
aServer *serv = cptr->serv;
|
||||
|
||||
if (!serv)
|
||||
@@ -207,6 +206,7 @@ aServer *make_server(cptr)
|
||||
serv->user = NULL;
|
||||
serv->nexts = NULL;
|
||||
*serv->by = '\0';
|
||||
serv->numeric = 0;
|
||||
serv->up = NULL;
|
||||
cptr->serv = serv;
|
||||
}
|
||||
@@ -263,7 +263,10 @@ void remove_client_from_list(cptr)
|
||||
aClient *cptr;
|
||||
{
|
||||
if (IsServer(cptr))
|
||||
{
|
||||
remove_server_from_table(cptr);
|
||||
IRCstats.servers--;
|
||||
}
|
||||
if (IsClient(cptr))
|
||||
{
|
||||
if (IsInvisible(cptr))
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include <fcntl.h>
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) Carsten Munk 2000");
|
||||
|
||||
ircstats IRCstats;
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "common.h"
|
||||
#include "sys.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) 1990 Jarkko Oikarinen");
|
||||
|
||||
/*
|
||||
|
||||
+54
-44
@@ -1,3 +1,4 @@
|
||||
|
||||
/************************************************************************
|
||||
* Unreal Internet Relay Chat Daemon, src/packet.c
|
||||
* Copyright (C) 1990 Jarkko Oikarinen and
|
||||
@@ -24,64 +25,65 @@
|
||||
#include "msg.h"
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright
|
||||
("(C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen");
|
||||
ID_Notes("2.12 1/30/94");
|
||||
|
||||
#ifdef CRYPTOIRCD
|
||||
char *ep_encrypt(aClient *cptr, char *string, int *len)
|
||||
char *ep_encrypt(aClient *cptr, char *string, int *len)
|
||||
{
|
||||
static unsigned char cryptobuffer[8192];
|
||||
char ivec[9];
|
||||
int length;
|
||||
char *c;
|
||||
int num;
|
||||
static unsigned char cryptobuffer[8192];
|
||||
char ivec[9];
|
||||
int length;
|
||||
char *c;
|
||||
int num;
|
||||
|
||||
if (!cptr->cryptinfo)
|
||||
return string;
|
||||
|
||||
|
||||
bzero(cryptobuffer, sizeof(cryptobuffer));
|
||||
bzero(ivec, sizeof(ivec));
|
||||
num = 0;
|
||||
|
||||
|
||||
if ((c = (char *)strchr(string, '\n')))
|
||||
*c = '\0';
|
||||
if ((c = (char *)strchr(string, '\r')))
|
||||
*c = '\0';
|
||||
|
||||
*c = '\0';
|
||||
|
||||
length = strlen(string) + 1;
|
||||
cryptobuffer[0] = (unsigned char) length / 256;
|
||||
cryptobuffer[1] = (unsigned char) length - (cryptobuffer[0] * 256);
|
||||
|
||||
cryptobuffer[0] = (unsigned char)length / 256;
|
||||
cryptobuffer[1] = (unsigned char)length - (cryptobuffer[0] * 256);
|
||||
|
||||
if (cptr->cryptinfo->method == METHOD_BLOWFISH)
|
||||
{
|
||||
BF_cfb64_encrypt(string, &cryptobuffer[2], length, cptr->cryptinfo->key, ivec, &num, BF_ENCRYPT);
|
||||
BF_cfb64_encrypt(string, &cryptobuffer[2], length,
|
||||
cptr->cryptinfo->key, ivec, &num, BF_ENCRYPT);
|
||||
*len = length + 2;
|
||||
return (cryptobuffer);
|
||||
}
|
||||
}
|
||||
|
||||
char *ep_decrypt(aClient *cptr, char *string)
|
||||
char *ep_decrypt(aClient *cptr, char *string)
|
||||
{
|
||||
static char decryptbuffer[8192];
|
||||
int num;
|
||||
char ivec[9];
|
||||
int length;
|
||||
|
||||
static char decryptbuffer[8192];
|
||||
int num;
|
||||
char ivec[9];
|
||||
int length;
|
||||
|
||||
if (!cptr->cryptinfo)
|
||||
return string;
|
||||
|
||||
|
||||
bzero(decryptbuffer, sizeof(decryptbuffer));
|
||||
bzero(ivec, sizeof(ivec));
|
||||
num = 0;
|
||||
length = (*(string) * 256) + (*(string + 1));
|
||||
|
||||
|
||||
if (cptr->cryptinfo->method == METHOD_BLOWFISH)
|
||||
{
|
||||
BF_cfb64_encrypt(string + 2, decryptbuffer, length, cptr->cryptinfo->key, ivec, &num, BF_DECRYPT);
|
||||
return (decryptbuffer);
|
||||
}
|
||||
BF_cfb64_encrypt(string + 2, decryptbuffer, length,
|
||||
cptr->cryptinfo->key, ivec, &num, BF_DECRYPT);
|
||||
return (decryptbuffer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
@@ -129,7 +131,7 @@ int dopacket(cptr, buffer, length)
|
||||
#ifdef CRYPTOIRCD
|
||||
int lengthweneed, num, lengthbackup, li;
|
||||
char *s;
|
||||
char f[4096], x[512];
|
||||
char f[4096], x[512];
|
||||
#endif
|
||||
|
||||
me.receiveB += length; /* Update bytes received */
|
||||
@@ -163,36 +165,44 @@ int dopacket(cptr, buffer, length)
|
||||
*ch1 = *ch2++;
|
||||
if (ch1 - cptr->buffer > 2)
|
||||
{
|
||||
lengthweneed = ((unsigned char) *cptr->buffer) * 256
|
||||
+ ((unsigned char) *(cptr->buffer + 1));
|
||||
lengthweneed =
|
||||
((unsigned char)*cptr->buffer) * 256 +
|
||||
((unsigned char)*(cptr->buffer + 1));
|
||||
lengthbackup = ch1 - cptr->buffer;
|
||||
if (lengthbackup >= (lengthweneed + 1))
|
||||
{
|
||||
ch1 = cptr->buffer;
|
||||
cptr->count = 0;
|
||||
Debug((DEBUG_ERROR, "packet recieved len %i", lengthweneed));
|
||||
s = (char *) ep_decrypt(cptr, cptr->buffer);
|
||||
Debug((DEBUG_ERROR,
|
||||
"packet recieved len %i",
|
||||
lengthweneed));
|
||||
s =
|
||||
(char *)ep_decrypt(cptr,
|
||||
cptr->buffer);
|
||||
me.receiveM += 1;
|
||||
cptr->receiveM += 1;
|
||||
if (cptr->acpt != &me)
|
||||
cptr->acpt->receiveM += 1;
|
||||
if (parse(cptr, s, s + lengthweneed, msgtab) == FLUSH_BUFFER)
|
||||
if (parse(cptr, s, s + lengthweneed,
|
||||
msgtab) == FLUSH_BUFFER)
|
||||
return FLUSH_BUFFER;
|
||||
if (cptr->flags & FLAGS_DEADSOCKET)
|
||||
return exit_client(cptr, cptr, &me, "Dead socket");
|
||||
}
|
||||
else
|
||||
if (ch1 < cptr->buffer + (sizeof(cptr->buffer) - 1))
|
||||
return exit_client(cptr, cptr,
|
||||
&me, "Dead socket");
|
||||
}
|
||||
else
|
||||
if (ch1 <
|
||||
cptr->buffer + (sizeof(cptr->buffer) - 1))
|
||||
ch1++;
|
||||
}
|
||||
else
|
||||
if (ch1 < cptr->buffer + (sizeof(cptr->buffer) - 1))
|
||||
ch1++;
|
||||
|
||||
if (ch1 < cptr->buffer + (sizeof(cptr->buffer) - 1))
|
||||
ch1++;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
else
|
||||
#endif
|
||||
while (--length >= 0)
|
||||
{
|
||||
@@ -201,7 +211,7 @@ int dopacket(cptr, buffer, length)
|
||||
* Yuck. Stuck. To make sure we stay backward compatible,
|
||||
* we must assume that either CR or LF terminates the message
|
||||
* and not CR-LF. By allowing CR or LF (alone) into the body
|
||||
* of messages, backward compatibility is lost and major
|
||||
* of messages, backward compatibility is lost and major
|
||||
* problems will arise. - Avalon
|
||||
*/
|
||||
if (g < '\16' && (g == '\n' || g == '\r'))
|
||||
@@ -233,10 +243,10 @@ int dopacket(cptr, buffer, length)
|
||||
"Dead Socket");
|
||||
ch1 = cptr->buffer;
|
||||
}
|
||||
else if (ch1 < cptr->buffer + (sizeof(cptr->buffer) - 1))
|
||||
else if (ch1 <
|
||||
cptr->buffer + (sizeof(cptr->buffer) - 1))
|
||||
ch1++; /* There is always room for the null */
|
||||
}
|
||||
cptr->count = ch1 - cptr->buffer;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+36
-80
@@ -30,7 +30,6 @@ Computing Center and Jarkko Oikarinen";
|
||||
#include "struct.h"
|
||||
#include "common.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright
|
||||
("(C) 1988 University of Oulu, Computing Center and Jarkko Oikarinen");
|
||||
ID_Notes("2.33 1/30/94");
|
||||
@@ -54,6 +53,7 @@ static char sender[HOSTLEN + 1];
|
||||
static int cancel_clients PROTO((aClient *, aClient *, char *));
|
||||
static void remove_unknown PROTO((aClient *, char *));
|
||||
static char unknownserver[] = "Unknown.Server";
|
||||
static char nsprefix = 0;
|
||||
/*
|
||||
** Find a client (server or user) by name.
|
||||
**
|
||||
@@ -70,13 +70,6 @@ aClient *find_client(name, cptr)
|
||||
|
||||
if (name)
|
||||
{
|
||||
if (*name == '@')
|
||||
{
|
||||
newname = name;
|
||||
name = find_by_aln(name + 1);
|
||||
if (!name)
|
||||
name = newname;
|
||||
}
|
||||
cptr = hash_find_client(name, cptr);
|
||||
}
|
||||
return cptr;
|
||||
@@ -113,49 +106,11 @@ aClient *find_server(name, cptr)
|
||||
char *newname;
|
||||
if (name)
|
||||
{
|
||||
if (*name == '@')
|
||||
{
|
||||
newname = name;
|
||||
name = find_by_aln(name + 1);
|
||||
if (!name)
|
||||
name = newname;
|
||||
}
|
||||
cptr = hash_find_server(name, cptr);
|
||||
}
|
||||
return cptr;
|
||||
}
|
||||
|
||||
aClient *find_serveraln(name, cptr)
|
||||
char *name;
|
||||
aClient *cptr;
|
||||
{
|
||||
char *newname;
|
||||
if (name)
|
||||
{
|
||||
if (*name == '@')
|
||||
{
|
||||
newname = name;
|
||||
name = find_by_aln(name + 1);
|
||||
if (!name)
|
||||
name = newname;
|
||||
}
|
||||
if (strlen(name) < 3)
|
||||
{
|
||||
newname = name;
|
||||
#ifdef DEVELOP
|
||||
// sendto_ops("Trying to find %s", name);
|
||||
#endif
|
||||
name = find_by_aln(name);
|
||||
if (!name)
|
||||
name = newname;
|
||||
}
|
||||
cptr = hash_find_client(name, cptr);
|
||||
#ifdef DEVELOP
|
||||
// (cptr) sendto_ops("Found it ! (%s)", cptr->name);
|
||||
#endif
|
||||
}
|
||||
return cptr;
|
||||
}
|
||||
|
||||
aClient *find_name(name, cptr)
|
||||
char *name;
|
||||
@@ -200,11 +155,10 @@ aClient *find_person(name, cptr)
|
||||
return cptr;
|
||||
}
|
||||
|
||||
int alnprefix = 0;
|
||||
|
||||
void ban_flooder(aClient *cptr)
|
||||
void ban_flooder(aClient *cptr)
|
||||
{
|
||||
char hostip[128], mo[100], mo2[100];
|
||||
char hostip[128], mo[100], mo2[100];
|
||||
char *tkllayer[9] = {
|
||||
me.name, /*0 server.name */
|
||||
"+", /*1 +|- */
|
||||
@@ -216,10 +170,10 @@ void ban_flooder(aClient *cptr)
|
||||
NULL, /*7 set_at */
|
||||
NULL /*8 reason */
|
||||
};
|
||||
|
||||
strcpy(hostip, (char *)inetntoa((char *) &cptr->ip));
|
||||
|
||||
strcpy(hostip, (char *)inetntoa((char *)&cptr->ip));
|
||||
exit_client(cptr, cptr, &me, "Flooding");
|
||||
|
||||
|
||||
tkllayer[4] = hostip;
|
||||
tkllayer[5] = me.name;
|
||||
ircsprintf(mo, "%li", 600 + TStime());
|
||||
@@ -231,7 +185,7 @@ void ban_flooder(aClient *cptr)
|
||||
return;
|
||||
}
|
||||
|
||||
int Rha = 0;
|
||||
int Rha = 0;
|
||||
|
||||
/*
|
||||
* parse a buffer.
|
||||
@@ -261,27 +215,29 @@ int parse(cptr, buffer, bufend, mptr)
|
||||
#ifdef RAWDEBUG
|
||||
sendto_ops("Debug: parse(): %s", buffer);
|
||||
#endif
|
||||
|
||||
|
||||
if ((cptr->receiveK >= 4) && IsUnknown(cptr))
|
||||
{
|
||||
sendto_realops("Flood from unknown connection %s detected", cptr->sockhost);
|
||||
sendto_realops("Flood from unknown connection %s detected",
|
||||
cptr->sockhost);
|
||||
ban_flooder(cptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* this call is a bit obsolete? - takes up CPU*/
|
||||
|
||||
/* this call is a bit obsolete? - takes up CPU */
|
||||
backupbuf[0] = '\0';
|
||||
strcpy(backupbuf, buffer);
|
||||
s = sender;
|
||||
*s = '\0';
|
||||
alnprefix = 0;
|
||||
for (ch = buffer; *ch == ' '; ch++)
|
||||
;
|
||||
para[0] = from->name;
|
||||
if (*ch == ':' || *ch == '@')
|
||||
{
|
||||
if (*ch == '@')
|
||||
alnprefix = 1;
|
||||
nsprefix = 1;
|
||||
else
|
||||
nsprefix = 0;
|
||||
/*
|
||||
** Copy the prefix to 'sender' assuming it terminates
|
||||
** with SPACE (or NULL, which is an error, though).
|
||||
@@ -303,19 +259,21 @@ int parse(cptr, buffer, bufend, mptr)
|
||||
*/
|
||||
if (*sender && IsServer(cptr))
|
||||
{
|
||||
if ((strlen(sender) < 3) && alnprefix)
|
||||
if (nsprefix)
|
||||
{
|
||||
p = find_by_aln(sender);
|
||||
if (p)
|
||||
strcpy(sender, p);
|
||||
from = (aClient *) find_server_by_base64(sender);
|
||||
if (from)
|
||||
para[0] = from->name;
|
||||
}
|
||||
else
|
||||
{
|
||||
from = find_client(sender, (aClient *)NULL);
|
||||
if (!from || match(from->name, sender))
|
||||
from = find_server_quick(sender);
|
||||
else if (!from && index(sender, '@'))
|
||||
from = find_nickserv(sender, (aClient *)NULL);
|
||||
para[0] = sender;
|
||||
}
|
||||
from = find_client(sender, (aClient *)NULL);
|
||||
if (!from || match(from->name, sender))
|
||||
from = find_server(sender, (aClient *)NULL);
|
||||
else if (!from && index(sender, '@'))
|
||||
from = find_nickserv(sender, (aClient *)NULL);
|
||||
|
||||
para[0] = sender;
|
||||
|
||||
/* Hmm! If the client corresponding to the
|
||||
* prefix is not found--what is the correct
|
||||
@@ -323,7 +281,7 @@ int parse(cptr, buffer, bufend, mptr)
|
||||
* (old IRC just let it through as if the
|
||||
* prefix just wasn't there...) --msa
|
||||
*/
|
||||
|
||||
|
||||
/* debugging tool */
|
||||
if (Rha == 1)
|
||||
from = NULL;
|
||||
@@ -509,9 +467,9 @@ int parse(cptr, buffer, bufend, mptr)
|
||||
* unregistered users. -Studded */
|
||||
if (IsShunned(cptr) && IsRegistered(cptr))
|
||||
if ((mptr->func != m_admin) && (mptr->func != m_quit)
|
||||
&& (mptr->func != m_pong))
|
||||
&& (mptr->func != m_pong))
|
||||
return -4;
|
||||
|
||||
|
||||
if ((!IsRegistered(cptr)) &&
|
||||
(((mptr->func != m_user) && (mptr->func != m_nick) &&
|
||||
(mptr->func != m_server) && (mptr->func != m_pong) &&
|
||||
@@ -532,9 +490,8 @@ int parse(cptr, buffer, bufend, mptr)
|
||||
}
|
||||
|
||||
mptr->count++;
|
||||
if (IsRegisteredUser(cptr) &&
|
||||
mptr->func == m_private)
|
||||
from->user->last = TStime();
|
||||
if (IsRegisteredUser(cptr) && mptr->func == m_private)
|
||||
from->user->last = TStime();
|
||||
|
||||
#ifndef DEBUGMODE
|
||||
return (*mptr->func) (cptr, from, i, para);
|
||||
@@ -734,12 +691,11 @@ static void remove_unknown(cptr, sender)
|
||||
* Do kill if it came from a server because it means there is a ghost
|
||||
* user on the other server which needs to be removed. -avalon
|
||||
*/
|
||||
if (!index(sender, '.') && !alnprefix)
|
||||
if (!index(sender, '.') && !nsprefix)
|
||||
sendto_one(cptr, ":%s KILL %s :%s (%s(?) <- %s)",
|
||||
me.name, sender, me.name, sender,
|
||||
get_client_name(cptr, FALSE));
|
||||
else
|
||||
sendto_one(cptr, ":%s SQUIT %s%s :(Unknown from %s)",
|
||||
me.name, (alnprefix ? "@" : ""), sender,
|
||||
get_client_name(cptr, FALSE));
|
||||
sendto_one(cptr, ":%s SQUIT %s :(Unknown from %s)",
|
||||
me.name, sender, get_client_name(cptr, FALSE));
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
static char sccsid[] = "@(#)res.c 2.38 4/13/94 (C) 1992 Darren Reed";
|
||||
#endif
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) 1992 Darren Reed");
|
||||
ID_Notes("2.38 4/13/94");
|
||||
|
||||
|
||||
Binary file not shown.
@@ -34,7 +34,6 @@ static char sccsid[] = "@(#)res_init.c 6.14.1 (Berkeley) 6/27/90";
|
||||
#include "nameser.h"
|
||||
#include "resolv.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
/*
|
||||
* Resolver state default settings
|
||||
*/
|
||||
|
||||
Binary file not shown.
@@ -3,7 +3,6 @@
|
||||
#include "nameser.h"
|
||||
#include "common.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
/*
|
||||
* Skip over a compressed domain name. Return the size or -1.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -1,4 +1,5 @@
|
||||
/************************************************************************
|
||||
/************************************************************************
|
||||
/************************************************************************
|
||||
* Unreal Internet Relay Chat Daemon, src/s_auth.c
|
||||
* Copyright (C) 1992 Darren Reed
|
||||
@@ -43,7 +44,6 @@ static char sccsid[] = "@(#)s_auth.c 1.18 4/18/94 (C) 1992 Darren Reed";
|
||||
/* define it (BSD4.2 needs this) */
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
/*
|
||||
* start_auth
|
||||
*
|
||||
|
||||
+9
-153
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/s_bsd.c
|
||||
* Copyright (C) 1990 Jarkko Oikarinen and
|
||||
@@ -80,7 +81,6 @@ int rr;
|
||||
|
||||
#endif
|
||||
|
||||
ID_CVS("$Id$");
|
||||
|
||||
#ifndef IN_LOOPBACKNET
|
||||
#define IN_LOOPBACKNET 0x7f
|
||||
@@ -94,9 +94,8 @@ extern HWND hwIRCDWnd;
|
||||
#endif
|
||||
extern char backupbuf[8192];
|
||||
aClient *local[MAXCONNECTIONS];
|
||||
int highest_fd = 0, readcalls = 0, udpfd = -1, resfd = -1;
|
||||
int highest_fd = 0, readcalls = 0, resfd = -1;
|
||||
static struct SOCKADDR_IN mysk;
|
||||
static void polludp();
|
||||
|
||||
static struct SOCKADDR *connect_inet PROTO((aConfItem *, aClient *, int *));
|
||||
static int completed_connection PROTO((aClient *));
|
||||
@@ -199,8 +198,8 @@ void report_error(text, cptr)
|
||||
|
||||
host = (cptr) ? get_client_name(cptr, FALSE) : "";
|
||||
|
||||
fprintf(stderr, text, host, strerror(errtmp));
|
||||
fputc('\n', stderr);
|
||||
/* fprintf(stderr, text, host, strerror(errtmp));
|
||||
fputc('\n', stderr); */
|
||||
Debug((DEBUG_ERROR, text, host, strerror(errtmp)));
|
||||
|
||||
/*
|
||||
@@ -944,7 +943,7 @@ static int completed_connection(cptr)
|
||||
aClient *cptr;
|
||||
{
|
||||
aConfItem *aconf;
|
||||
|
||||
extern char serveropts[];
|
||||
SetHandshake(cptr);
|
||||
|
||||
aconf = find_conf(cptr->confs, cptr->name, CONF_CONNECT_SERVER);
|
||||
@@ -963,8 +962,9 @@ static int completed_connection(cptr)
|
||||
return -1;
|
||||
}
|
||||
sendto_one(cptr, "PROTOCTL %s", PROTOCTL_SERVER);
|
||||
sendto_one(cptr, "SERVER %s 1 :%s",
|
||||
my_name_for_link(me.name, aconf), me.info);
|
||||
sendto_one(cptr, "SERVER %s 1 :U%d-%s-%i %s",
|
||||
my_name_for_link(me.name, aconf), UnrealProtocol, serveropts, me.serv->numeric,
|
||||
me.info);
|
||||
if (!IsDead(cptr))
|
||||
start_auth(cptr);
|
||||
|
||||
@@ -1805,8 +1805,6 @@ int read_message(delay, listp)
|
||||
if (me.socksfd >= 0)
|
||||
FD_SET(me.socksfd, &read_set);
|
||||
#endif
|
||||
if (udpfd >= 0)
|
||||
FD_SET(udpfd, &read_set);
|
||||
#ifndef _WIN32
|
||||
if (resfd >= 0)
|
||||
FD_SET(resfd, &read_set);
|
||||
@@ -1859,13 +1857,6 @@ int read_message(delay, listp)
|
||||
FD_CLR(me.socksfd, &read_set);
|
||||
}
|
||||
#endif /* SOCKSPORT */
|
||||
|
||||
if (udpfd >= 0 && FD_ISSET(udpfd, &read_set))
|
||||
{
|
||||
polludp();
|
||||
nfds--;
|
||||
FD_CLR(udpfd, &read_set);
|
||||
}
|
||||
#ifndef _WIN32
|
||||
if (resfd >= 0 && FD_ISSET(resfd, &read_set))
|
||||
{
|
||||
@@ -2514,7 +2505,7 @@ int connect_server(aconf, by, hp)
|
||||
Debug((DEBUG_NOTICE, "Connect to %s[%s] @%s",
|
||||
aconf->name, aconf->host, inetntoa((char *)&aconf->ipnum)));
|
||||
|
||||
if ((c2ptr = find_server(aconf->name, NULL)))
|
||||
if ((c2ptr = find_server_quick(aconf->name)))
|
||||
{
|
||||
sendto_ops("Server %s already present from %s",
|
||||
aconf->name, get_client_name(c2ptr, TRUE));
|
||||
@@ -2981,141 +2972,6 @@ void get_my_name(cptr, name, len)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** setup a UDP socket and listen for incoming packets
|
||||
*/
|
||||
int setup_ping()
|
||||
{
|
||||
struct SOCKADDR_IN from;
|
||||
int on = 1;
|
||||
|
||||
bzero((char *)&from, sizeof(from));
|
||||
from.SIN_ADDR = me.ip;
|
||||
from.SIN_PORT = htons(7007);
|
||||
from.SIN_FAMILY = AFINET;
|
||||
|
||||
if ((udpfd = socket(AFINET, SOCK_DGRAM, 0)) == -1)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
Debug((DEBUG_ERROR, "socket udp : %s", strerror(errno)));
|
||||
#else
|
||||
Debug((DEBUG_ERROR, "socket udp : %s",
|
||||
strerror(WSAGetLastError())));
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
if (setsockopt(udpfd, SOL_SOCKET, SO_REUSEADDR,
|
||||
(OPT_TYPE *)&on, sizeof(on)) == -1)
|
||||
{
|
||||
#ifdef USE_SYSLOG
|
||||
syslog(LOG_ERR, "setsockopt udp fd %d : %m", udpfd);
|
||||
#endif
|
||||
#ifndef _WIN32
|
||||
Debug((DEBUG_ERROR, "setsockopt so_reuseaddr : %s",
|
||||
strerror(errno)));
|
||||
(void)close(udpfd);
|
||||
#else
|
||||
Debug((DEBUG_ERROR, "setsockopt so_reuseaddr : %s",
|
||||
strerror(WSAGetLastError())));
|
||||
(void)closesocket(udpfd);
|
||||
#endif
|
||||
udpfd = -1;
|
||||
return -1;
|
||||
}
|
||||
on = 0;
|
||||
(void)setsockopt(udpfd, SOL_SOCKET, SO_BROADCAST,
|
||||
(char *)&on, sizeof(on));
|
||||
if (bind(udpfd, (struct SOCKADDR *)&from, sizeof(from)) == -1)
|
||||
{
|
||||
#ifdef USE_SYSLOG
|
||||
syslog(LOG_ERR, "bind udp.%d fd %d : %m", from.SIN_PORT, udpfd);
|
||||
#endif
|
||||
#ifndef _WIN32
|
||||
Debug((DEBUG_ERROR, "bind : %s", strerror(errno)));
|
||||
(void)close(udpfd);
|
||||
#else
|
||||
Debug((DEBUG_ERROR, "bind : %s", strerror(WSAGetLastError())));
|
||||
(void)closesocket(udpfd);
|
||||
#endif
|
||||
udpfd = -1;
|
||||
return -1;
|
||||
}
|
||||
#ifndef _WIN32
|
||||
if (fcntl(udpfd, F_SETFL, FNDELAY) == -1)
|
||||
{
|
||||
Debug((DEBUG_ERROR, "fcntl fndelay : %s", strerror(errno)));
|
||||
(void)close(udpfd);
|
||||
udpfd = -1;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
return udpfd;
|
||||
}
|
||||
|
||||
/*
|
||||
* max # of pings set to 15/sec.
|
||||
*/
|
||||
static void polludp()
|
||||
{
|
||||
char *s;
|
||||
struct SOCKADDR_IN from;
|
||||
int n, fromlen = sizeof(from);
|
||||
static time_t last = 0, now;
|
||||
static int cnt = 0, mlen = 0;
|
||||
|
||||
/*
|
||||
* find max length of data area of packet.
|
||||
*/
|
||||
if (!mlen)
|
||||
{
|
||||
mlen = sizeof(readbuf) - strlen(me.name) - strlen(version);
|
||||
mlen -= 6;
|
||||
if (mlen < 0)
|
||||
mlen = 0;
|
||||
}
|
||||
Debug((DEBUG_DEBUG, "udp poll"));
|
||||
|
||||
n = recvfrom(udpfd, readbuf, mlen, 0,
|
||||
(struct SOCKADDR *)&from, &fromlen);
|
||||
now = TStime();
|
||||
if (now == last)
|
||||
if (++cnt > 14)
|
||||
return;
|
||||
cnt = 0;
|
||||
last = now;
|
||||
|
||||
if (n == -1)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
if ((errno == EWOULDBLOCK) || (errno == EAGAIN))
|
||||
#else
|
||||
if ((WSAGetLastError() == WSAEWOULDBLOCK))
|
||||
#endif
|
||||
return;
|
||||
else
|
||||
{
|
||||
report_error("udp port recvfrom (%s): %s", &me);
|
||||
return;
|
||||
}
|
||||
}
|
||||
ircstp->is_udp++;
|
||||
if (n < 19)
|
||||
return;
|
||||
|
||||
s = readbuf + n;
|
||||
/*
|
||||
* attach my name and version for the reply
|
||||
*/
|
||||
*readbuf |= 1;
|
||||
(void)strcpy(s, me.name);
|
||||
s += strlen(s) + 1;
|
||||
(void)strcpy(s, version);
|
||||
s += strlen(s);
|
||||
(void)sendto(udpfd, readbuf, s - readbuf, 0,
|
||||
(struct SOCKADDR *)&from, sizeof(from));
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* do_dns_async
|
||||
*
|
||||
|
||||
+57
-8
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/s_conf.c
|
||||
* Copyright (C) 1990 Jarkko Oikarinen and
|
||||
@@ -53,7 +54,6 @@ Computing Center and Jarkko Oikarinen";
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Notes("O:line flags in here");
|
||||
#include "h.h"
|
||||
#define IN6ADDRSZ (sizeof(struct IN_ADDR))
|
||||
@@ -64,7 +64,7 @@ static int advanced_check(char *, int);
|
||||
aSqlineItem *sqline = NULL;
|
||||
aConfItem *conf = NULL;
|
||||
extern char zlinebuf[];
|
||||
|
||||
extern ircstats IRCstats;
|
||||
/*
|
||||
* remove all conf entries from the client except those which match
|
||||
* the status field mask.
|
||||
@@ -839,28 +839,53 @@ aSqlineItem *find_sqline_match(nickname)
|
||||
** parv[2] = +/-
|
||||
**
|
||||
*/
|
||||
|
||||
int SVSNOOP = 0;
|
||||
|
||||
int m_svsnoop(cptr, sptr, parc, parv)
|
||||
aClient *cptr, *sptr;
|
||||
int parc;
|
||||
char *parv[];
|
||||
{
|
||||
aConfItem *aconf;
|
||||
aClient *acptr;
|
||||
|
||||
if (!(check_registered(sptr) && IsULine(cptr, sptr) && parc > 2))
|
||||
return 0;
|
||||
/* svsnoop bugfix --binary */
|
||||
/* svsnoop bugfix --binary */
|
||||
if (hunt_server(cptr, sptr, ":%s SVSNOOP %s :%s", 1, parc,
|
||||
parv) == HUNTED_ISME)
|
||||
{
|
||||
if (parv[2][0] == '+')
|
||||
for (aconf = conf; aconf; aconf = aconf->next)
|
||||
{
|
||||
SVSNOOP = 1;
|
||||
sendto_ops("This server has been placed in NOOP mode");
|
||||
for (acptr = &me; acptr; acptr = acptr->prev)
|
||||
{
|
||||
if (aconf->status & CONF_OPERATOR
|
||||
|| aconf->status & CONF_LOCOP)
|
||||
aconf->status = CONF_ILLEGAL;
|
||||
if (MyClient(acptr) && IsAnOper(acptr))
|
||||
{
|
||||
if (IsOper(acptr))
|
||||
IRCstats.operators--;
|
||||
acptr->umodes &=
|
||||
~(UMODE_OPER | UMODE_LOCOP | UMODE_HELPOP | UMODE_SERVICES |
|
||||
UMODE_SADMIN | UMODE_ADMIN);
|
||||
acptr->umodes &=
|
||||
~(UMODE_NETADMIN | UMODE_TECHADMIN | UMODE_CLIENT |
|
||||
UMODE_FLOOD | UMODE_EYES | UMODE_CHATOP | UMODE_WHOIS);
|
||||
acptr->umodes &=
|
||||
~(UMODE_KIX | UMODE_FCLIENT | UMODE_HIDING | UMODE_CODER |
|
||||
UMODE_DEAF | UMODE_HIDEOPER);
|
||||
acptr->oflag = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
(void)rehash(&me, &me, 2);
|
||||
{
|
||||
SVSNOOP = 0;
|
||||
sendto_ops("This server is no longer in NOOP mode");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1309,8 +1334,28 @@ int initconf(opt)
|
||||
else
|
||||
aconf->port = atoi(tmp);
|
||||
if ((tmp = getfield(NULL)) == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
Class(aconf) = find_class(atoi(tmp));
|
||||
if (aconf->status == CONF_ME)
|
||||
{
|
||||
if (me.serv->numeric)
|
||||
{
|
||||
if (atoi(tmp) != me.serv->numeric)
|
||||
{
|
||||
if (IRCstats.servers > 1)
|
||||
{
|
||||
sendto_ops("You cannot change numeric when servers are connected");
|
||||
}
|
||||
else
|
||||
{
|
||||
me.serv->numeric = atoi(tmp);
|
||||
}
|
||||
}
|
||||
} else
|
||||
me.serv->numeric = atoi(tmp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
/*
|
||||
@@ -1477,6 +1522,10 @@ int initconf(opt)
|
||||
if (aconf->status == CONF_ME)
|
||||
{
|
||||
strncpyzt(me.info, aconf->name, sizeof(me.info));
|
||||
if (me.name[0] == '\0' && !strchr(aconf->host, '.')) {
|
||||
ircd_log("ERROR: Invalid Server Name %s, Reason: Servername must contain at least one \".\"\n",aconf->host);
|
||||
exit(-1);
|
||||
}
|
||||
if (me.name[0] == '\0' && aconf->host[0])
|
||||
strncpyzt(me.name, aconf->host,
|
||||
sizeof(me.name));
|
||||
|
||||
+3
-3
@@ -1,5 +1,4 @@
|
||||
/************************************************************************
|
||||
/************************************************************************
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/s_debug.c
|
||||
* Copyright (C) 1990 Jarkko Oikarinen and
|
||||
* University of Oulu, Computing Center
|
||||
@@ -106,6 +105,8 @@ char serveropts[] = {
|
||||
#ifdef CRYPTOIRCD
|
||||
'r',
|
||||
#endif
|
||||
/* we are a stable ircd */
|
||||
'S',
|
||||
'\0'
|
||||
};
|
||||
|
||||
@@ -153,7 +154,6 @@ char serveropts[] = {
|
||||
#define ssize_t unsigned int
|
||||
#endif
|
||||
|
||||
ID_CVS("$Id$");
|
||||
|
||||
#ifdef DEBUGMODE
|
||||
static char debugbuf[1024];
|
||||
|
||||
+3
-8
@@ -1,5 +1,4 @@
|
||||
/************************************************************************
|
||||
/************************************************************************
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/s_err.c
|
||||
* Copyright (C) 1992 Darren Reed
|
||||
*
|
||||
@@ -26,7 +25,6 @@
|
||||
static char sccsid[] = "@(#)s_err.c 1.12 11/1/93 (C) 1992 Darren Reed";
|
||||
#endif
|
||||
|
||||
ID_CVS("$Id$");
|
||||
|
||||
/* Redone to be similar to bahamut's s_err.c -- codemastr */
|
||||
|
||||
@@ -36,8 +34,8 @@ static char *replies[] = {
|
||||
/* 002 RPL_YOURHOST */ ":%s 002 %s :Your host is %s, running version %s",
|
||||
/* 003 RPL_CREATED */ ":%s 003 %s :This server was created %s",
|
||||
/* 004 RPL_MYINFO */ ":%s 004 %s %s %s %s %s",
|
||||
/* 005 RPL_PROTOCTL */ ":%s 005 %s %s :are available on this server",
|
||||
/* 006 RPL_MAP */ ":%s 006 %s :%s%-*s\2[Users:%5d] [%2d%%]\2",
|
||||
/* 005 RPL_PROTOCTL */ PROTOCTL_CLIENT,
|
||||
/* 006 RPL_MAP */ ":%s 006 %s :%s%-*s(%d) %s",
|
||||
/* 007 RPL_MAPEND */ ":%s 007 %s :End of /MAP",
|
||||
/* 008 */ NULL,
|
||||
/* 009 */ NULL,
|
||||
@@ -1067,6 +1065,3 @@ char *getreply(int numeric) {
|
||||
else
|
||||
return(replies[numeric]);
|
||||
}
|
||||
|
||||
/* this was the old RPL_MYINFO line ....
|
||||
RPL_MYINFO, "%s %s oiwsghOkcSNfraAbexTCWq biklmnopstvRzqxOAqa", */
|
||||
|
||||
+2
-4
@@ -1,7 +1,6 @@
|
||||
/************************************************************************
|
||||
/************************************************************************
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/s_extra.c
|
||||
* (C) 1999 Carsten Munk (Techie/Stskeeps) <stskeeps@tspre.org>
|
||||
* (C) 1999-2000 Carsten Munk (Techie/Stskeeps) <stskeeps@tspre.org>
|
||||
*
|
||||
* See file AUTHORS in IRC package for additional names of
|
||||
* the programmers.
|
||||
@@ -42,7 +41,6 @@
|
||||
#include <fcntl.h>
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) Carsten Munk 1999");
|
||||
|
||||
/*
|
||||
|
||||
+6
-7
@@ -255,7 +255,7 @@ int find_tkline_match(cptr, xx)
|
||||
|
||||
nowtime = TStime();
|
||||
chost = cptr->sockhost;
|
||||
cname = cptr->user->username;
|
||||
cname = (xx != 2) ? cptr->user->username : NULL;
|
||||
|
||||
cip = (char *)inet_ntoa(cptr->ip);
|
||||
|
||||
@@ -267,13 +267,12 @@ int find_tkline_match(cptr, xx)
|
||||
else
|
||||
is_ip = 0;
|
||||
|
||||
if (is_ip == 0 ? (!match(lp->hostmask, chost)
|
||||
&& !match(lp->usermask, cname)) : (!match(lp->hostmask,
|
||||
chost) || !match(lp->hostmask, cip))
|
||||
&& !match(lp->usermask, cname) && (xx != 2 || !match(lp->usermask, cname)))
|
||||
if (xx != 2 ? is_ip == 0 ? (!match(lp->hostmask, chost)
|
||||
&& !match(lp->usermask, cname)) :
|
||||
(!match(lp->hostmask, chost) || !match(lp->hostmask, cip))
|
||||
: !match(lp->hostmask, chost))
|
||||
{
|
||||
|
||||
if ((lp->type & (TKL_KILL)) && (xx != 2))
|
||||
if (lp->type & TKL_KILL)
|
||||
{
|
||||
if (lp->type & TKL_GLOBAL)
|
||||
{
|
||||
|
||||
+3
-4
@@ -1,5 +1,5 @@
|
||||
/************************************************************************
|
||||
/************************************************************************
|
||||
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/s_misc.c
|
||||
* Copyright (C) 1990 Jarkko Oikarinen and
|
||||
* University of Oulu, Computing Center
|
||||
@@ -63,7 +63,6 @@ extern float currentrate2;
|
||||
extern ircstats IRCstats;
|
||||
extern char *me_hash;
|
||||
|
||||
ID_CVS("$Id$");
|
||||
static void exit_one_client PROTO((aClient *, aClient *, aClient *, char *));
|
||||
static void exit_one_client_in_split PROTO((aClient *, aClient *, aClient *,
|
||||
char *));
|
||||
@@ -303,7 +302,7 @@ char *get_client_host(cptr)
|
||||
return get_client_name(cptr, FALSE);
|
||||
(void)ircsprintf(nbuf, "%s[%-.*s@%-.*s]",
|
||||
cptr->name, USERLEN,
|
||||
(!(cptr->flags & FLAGS_GOTID)) ? "" : cptr->username,
|
||||
(!(cptr->flags & FLAGS_GOTID)) ? "" : cptr->username,
|
||||
HOSTLEN, cptr->hostp->h_name);
|
||||
return nbuf;
|
||||
}
|
||||
|
||||
+1
-3
@@ -1,5 +1,4 @@
|
||||
/************************************************************************
|
||||
/************************************************************************
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/s_numeric.c
|
||||
* Copyright (C) 1990 Jarkko Oikarinen
|
||||
*
|
||||
@@ -32,7 +31,6 @@ Computing Center and Jarkko Oikarinen";
|
||||
#include "numeric.h"
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
|
||||
static char buffer[1024];
|
||||
|
||||
|
||||
+367
-266
File diff suppressed because it is too large
Load Diff
+1
-2
@@ -1,5 +1,4 @@
|
||||
/************************************************************************
|
||||
/************************************************************************
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/s_socks.c
|
||||
* Copyright (C) 1998 Lucas Madar
|
||||
*
|
||||
|
||||
+4
-5
@@ -1,3 +1,4 @@
|
||||
/************************************************************************
|
||||
/************************************************************************
|
||||
* IRC - Internet Relay Chat, s_unreal.c
|
||||
* (C) 1999 Carsten Munk (Techie/Stskeeps) <cmunk@toybox.flirt.org>
|
||||
@@ -41,7 +42,6 @@
|
||||
#include <fcntl.h>
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
ID_Copyright("(C) Carsten Munk 1999");
|
||||
|
||||
time_t TSoffset = 0;
|
||||
@@ -178,7 +178,7 @@ int m_sethost(cptr, sptr, parc, parv)
|
||||
if (sptr->user->virthost)
|
||||
MyFree(sptr->user->virthost);
|
||||
sptr->user->virthost = MyMalloc(strlen(vhost) + 1);
|
||||
sprintf(sptr->user->virthost, "%s", vhost);
|
||||
ircsprintf(sptr->user->virthost, "%s", vhost);
|
||||
/* spread it out */
|
||||
sendto_serv_butone_token(cptr, sptr->name, MSG_SETHOST, TOK_SETHOST,
|
||||
"%s", parv[1]);
|
||||
@@ -277,8 +277,7 @@ int m_chghost(cptr, sptr, parc, parv)
|
||||
sendto_umode(UMODE_EYES,
|
||||
"%s changed the virtual hostname of %s (%s@%s) to be %s",
|
||||
sptr->name, acptr->name, acptr->user->username,
|
||||
(acptr->umodes & UMODE_HIDE ? acptr->
|
||||
user->virthost : acptr->user->realhost), parv[2]);
|
||||
acptr->user->realhost, parv[2]);
|
||||
}
|
||||
acptr->umodes |= UMODE_HIDE;
|
||||
acptr->umodes |= UMODE_SETHOST;
|
||||
@@ -1604,4 +1603,4 @@ int m_crypto(cptr, sptr, parc, parv)
|
||||
}
|
||||
sendto_one(sptr, "CRYPTO ERROR :No such method/command %s", parv[1]);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+99
-57
@@ -54,7 +54,6 @@ Computing Center and Jarkko Oikarinen";
|
||||
#include "version.h"
|
||||
#endif
|
||||
|
||||
ID_CVS("$Id$");
|
||||
void send_umode_out PROTO((aClient *, aClient *, int));
|
||||
void send_umode_out_nickv2 PROTO((aClient *, aClient *, int));
|
||||
void send_svsmode_out PROTO((aClient *, aClient *, aClient *, int));
|
||||
@@ -66,7 +65,7 @@ int sendanyways = 0;
|
||||
int dontspread = 0;
|
||||
extern char *me_hash;
|
||||
extern ircstats IRCstats;
|
||||
|
||||
extern char backupbuf[];
|
||||
static char buf[BUFSIZE], buf2[BUFSIZE];
|
||||
static int user_modes[] = { UMODE_OPER, 'o',
|
||||
UMODE_LOCOP, 'O',
|
||||
@@ -107,10 +106,12 @@ static int user_modes[] = { UMODE_OPER, 'o',
|
||||
|
||||
void iNAH_host(aClient *sptr, char *host)
|
||||
{
|
||||
if (!sptr->user)
|
||||
return;
|
||||
if (sptr->user->virthost)
|
||||
MyFree(sptr->user->virthost);
|
||||
sptr->user->virthost = MyMalloc(strlen(host) + 1);
|
||||
ircsprintf(sptr->user->virthost, host);
|
||||
ircsprintf(sptr->user->virthost, "%s", host);
|
||||
if (MyConnect(sptr))
|
||||
sendto_serv_butone_token(&me, sptr->name, MSG_SETHOST,
|
||||
TOK_SETHOST, "%s", sptr->user->virthost);
|
||||
@@ -324,7 +325,7 @@ int hunt_server(cptr, sptr, command, server, parc, parv)
|
||||
if ((acptr = find_client(parv[server], NULL)))
|
||||
if (acptr->from == sptr->from && !MyConnect(acptr))
|
||||
acptr = NULL;
|
||||
if (!acptr && (acptr = find_server(parv[server], NULL)))
|
||||
if (!acptr && (acptr = find_server_quick(parv[server])))
|
||||
if (acptr->from == sptr->from && !MyConnect(acptr))
|
||||
acptr = NULL;
|
||||
if (!acptr)
|
||||
@@ -867,7 +868,7 @@ static int register_user(cptr, sptr, nick, username, umode, virthost)
|
||||
cmodestring);
|
||||
#endif
|
||||
sendto_one(sptr, rpl_str(RPL_PROTOCTL), me.name, nick,
|
||||
PROTOCTL_CLIENT);
|
||||
PROTOCTL_PARAMETERS);
|
||||
(void)m_lusers(sptr, sptr, 1, parv);
|
||||
update_load();
|
||||
(void)m_motd(sptr, sptr, 1, parv);
|
||||
@@ -892,7 +893,7 @@ static int register_user(cptr, sptr, nick, username, umode, virthost)
|
||||
{
|
||||
aClient *acptr;
|
||||
|
||||
if (!(acptr = find_server(user->server, NULL)))
|
||||
if (!(acptr = (aClient *) find_server_quick(user->server)))
|
||||
{
|
||||
sendto_ops
|
||||
("Bad USER [%s] :%s USER %s %s : No such server",
|
||||
@@ -1060,6 +1061,7 @@ int m_nick(cptr, sptr, parc, parv)
|
||||
aConfItem *aconf;
|
||||
aSqlineItem *asqline;
|
||||
aClient *acptr, *serv;
|
||||
aClient *acptrs;
|
||||
char nick[NICKLEN + 2], *s;
|
||||
Link *lp;
|
||||
time_t lastnick = (time_t) 0;
|
||||
@@ -1129,12 +1131,13 @@ int m_nick(cptr, sptr, parc, parv)
|
||||
** We should really only deal with this for msgs from servers.
|
||||
** -- Aeto
|
||||
*/
|
||||
/* Fixed up to work with ALN too .. --Stskeeps */
|
||||
if (IsServer(cptr) &&
|
||||
(parc > 7 && (!(serv = (aClient *)find_serveraln(parv[6], NULL)) ||
|
||||
(parc > 7 && (!(serv = (aClient *)find_server_b64_or_real(parv[6], NULL)) ||
|
||||
serv->from != cptr->from)))
|
||||
{
|
||||
sendto_ops("Cannot find server (%s)", backupbuf);
|
||||
return 0;
|
||||
|
||||
}
|
||||
/*
|
||||
** Check against nick name collisions.
|
||||
**
|
||||
@@ -1143,7 +1146,7 @@ int m_nick(cptr, sptr, parc, parv)
|
||||
** is present in the nicklist (due to the way the below for loop is
|
||||
** constructed). -avalon
|
||||
*/
|
||||
if ((acptr = find_server(nick, NULL)))
|
||||
if ((acptr = find_server_quick(nick)))
|
||||
{
|
||||
if (MyConnect(sptr))
|
||||
{
|
||||
@@ -1169,13 +1172,23 @@ int m_nick(cptr, sptr, parc, parv)
|
||||
&& ((aconf = find_conf_name(nick, CONF_QUARANTINED_NICK))
|
||||
|| (asqline = find_sqline_match(nick))))
|
||||
{
|
||||
sendto_realops("Q-lined nick %s from %s on %s.", nick,
|
||||
(*sptr->name != 0 && !IsServer(sptr)) ? sptr->name :
|
||||
"<unregistered>",
|
||||
(sptr->user ==
|
||||
NULL) ? ((IsServer(sptr)) ? (strlen(parv[6]) <
|
||||
3 ? find_by_aln(parv[6]) : parv[6]) : me.name) : sptr->
|
||||
user->server);
|
||||
if (IsServer(sptr))
|
||||
{
|
||||
acptrs = (aClient *) find_server_b64_or_real(sptr->user == NULL ? (char *) parv[6] : (char *) sptr->user->server);
|
||||
sendto_realops("Q:lined nick %s from %s on %s",
|
||||
nick,
|
||||
(*sptr->name != 0 && !IsServer(sptr) ? sptr->name :
|
||||
"<unregistered>"),
|
||||
acptrs ? acptrs->name : "unknown server");
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_realops("Q:lined nick %s from %s on %s",
|
||||
nick,
|
||||
*sptr->name ? sptr->name : "<unregistered>",
|
||||
me.name);
|
||||
}
|
||||
|
||||
if ((!IsServer(cptr)) && (!IsOper(cptr)))
|
||||
{
|
||||
|
||||
@@ -1530,7 +1543,7 @@ int m_nick(cptr, sptr, parc, parv)
|
||||
add_history(sptr, 1);
|
||||
sendto_common_channels(sptr, ":%s NICK :%s", parv[0], nick);
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_NICK, TOK_NICK,
|
||||
"%s :%d", nick, sptr->lastnick);
|
||||
"%s %d", nick, sptr->lastnick);
|
||||
}
|
||||
else if (!sptr->name[0])
|
||||
{
|
||||
@@ -1910,7 +1923,7 @@ static int m_message(cptr, sptr, parc, parv, notice)
|
||||
/* There is always a \0 if its a string */
|
||||
if (*(server + 1) != '\0')
|
||||
{
|
||||
acptr = find_server(server + 1, NULL);
|
||||
acptr = find_server_quick(server + 1);
|
||||
if (acptr)
|
||||
{
|
||||
/*
|
||||
@@ -2048,6 +2061,27 @@ int m_nickserv(cptr, sptr, parc, parv)
|
||||
parv[0], NickServ);
|
||||
}
|
||||
|
||||
int m_infoserv(cptr, sptr, parc, parv)
|
||||
aClient *cptr, *sptr;
|
||||
int parc;
|
||||
char *parv[];
|
||||
{
|
||||
aClient *acptr;
|
||||
if (parc < 2 || *parv[1] == '\0')
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOTEXTTOSEND), me.name, parv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((acptr = find_person(InfoServ, NULL)))
|
||||
{
|
||||
sendto_one(acptr, ":%s PRIVMSG %s@%s :%s", parv[0],
|
||||
InfoServ, SERVICES_NAME, parv[1]);
|
||||
}
|
||||
else
|
||||
sendto_one(sptr, err_str(ERR_SERVICESDOWN), me.name,
|
||||
parv[0], InfoServ);
|
||||
}
|
||||
int m_operserv(cptr, sptr, parc, parv)
|
||||
aClient *cptr, *sptr;
|
||||
int parc;
|
||||
@@ -2405,13 +2439,14 @@ int m_who(cptr, sptr, parc, parv)
|
||||
for (acptr = client; acptr; acptr = acptr->next)
|
||||
{
|
||||
aChannel *ch2ptr = NULL;
|
||||
int showperson, isinvis;
|
||||
int showsecret, showperson, isinvis;
|
||||
|
||||
if (!IsPerson(acptr))
|
||||
continue;
|
||||
if (oper && (!IsAnOper(acptr) || (IsHideOper(acptr) && sptr != acptr && !IsAnOper(sptr))))
|
||||
continue;
|
||||
showperson = 0;
|
||||
showsecret = 0;
|
||||
/*
|
||||
* Show user if they are on the same channel, or not
|
||||
* invisible and on a non secret channel (if any).
|
||||
@@ -2537,7 +2572,7 @@ int m_whois(cptr, sptr, parc, parv)
|
||||
|
||||
for (tmp = parv[1]; (nick = strtoken(&p, tmp, ",")); tmp = NULL)
|
||||
{
|
||||
int invis, showperson, member, wilds;
|
||||
int invis, showsecret, showperson, member, wilds;
|
||||
|
||||
found = 0;
|
||||
(void)collapse(nick);
|
||||
@@ -2592,10 +2627,14 @@ int m_whois(cptr, sptr, parc, parv)
|
||||
if (!invis && HiddenChannel(chptr) &&
|
||||
!SecretChannel(chptr))
|
||||
showperson = 1;
|
||||
else if (IsAnOper(sptr) && SecretChannel(chptr)) {
|
||||
showperson = 1;
|
||||
showsecret = 1;
|
||||
}
|
||||
}
|
||||
if (!showperson)
|
||||
continue;
|
||||
a2cptr = find_server(user->server, NULL);
|
||||
a2cptr = find_server_quick(user->server);
|
||||
|
||||
if (!IsPerson(acptr))
|
||||
continue;
|
||||
@@ -2640,7 +2679,7 @@ int m_whois(cptr, sptr, parc, parv)
|
||||
lp = lp->next)
|
||||
{
|
||||
chptr = lp->value.chptr;
|
||||
if (ShowChannel(sptr, chptr) || (acptr == sptr))
|
||||
if (IsAnOper(sptr) || ShowChannel(sptr, chptr) || (acptr == sptr))
|
||||
{
|
||||
if (len + strlen(chptr->chname)
|
||||
> (size_t)BUFSIZE - 4 - mlen)
|
||||
@@ -2653,16 +2692,19 @@ int m_whois(cptr, sptr, parc, parv)
|
||||
*buf = '\0';
|
||||
len = 0;
|
||||
}
|
||||
if (!(acptr == sptr) && IsAnOper(sptr)
|
||||
&& (showsecret == 1) && SecretChannel(chptr))
|
||||
*(buf + len++) = '~';
|
||||
if (is_chanowner(acptr, chptr))
|
||||
*(buf + len++) = '*';
|
||||
else if (is_chanprot(acptr, chptr))
|
||||
*(buf + len++) = '^';
|
||||
else if (is_chan_op(acptr, chptr))
|
||||
*(buf + len++) = '@';
|
||||
else if (has_voice(acptr, chptr))
|
||||
*(buf + len++) = '+';
|
||||
else if (is_half_op(acptr, chptr))
|
||||
*(buf + len++) = '%';
|
||||
else if (has_voice(acptr, chptr))
|
||||
*(buf + len++) = '+';
|
||||
if (len)
|
||||
*(buf + len) = '\0';
|
||||
(void)strcpy(buf + len, chptr->chname);
|
||||
@@ -2774,6 +2816,7 @@ int m_user(cptr, sptr, parc, parv)
|
||||
NULL;
|
||||
u_int32_t sstamp = 0;
|
||||
anUser *user;
|
||||
aClient *acptr;
|
||||
char *mparv[] = { sptr->name, sptr->name, NULL };
|
||||
|
||||
if (IsServer(cptr) && !IsUnknown(sptr))
|
||||
@@ -2827,24 +2870,16 @@ int m_user(cptr, sptr, parc, parv)
|
||||
if (sptr->srvptr == NULL)
|
||||
sendto_ops("WARNING, User %s introduced as being "
|
||||
"on non-existant server %s.", sptr->name, server);
|
||||
if (SupportALN(cptr))
|
||||
if (SupportNS(cptr))
|
||||
{
|
||||
if (strlen(server) < 3)
|
||||
{
|
||||
user->server = find_by_aln(server);
|
||||
if (!user->server)
|
||||
user->server =
|
||||
find_or_add("unknownserver");
|
||||
}
|
||||
acptr = (aClient *) find_server_b64_or_real(server);
|
||||
if (acptr)
|
||||
user->server = find_or_add(acptr->name);
|
||||
else
|
||||
{
|
||||
user->server = find_or_add(server);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
user->server = find_or_add(server);
|
||||
}
|
||||
else
|
||||
user->server = find_or_add(server);
|
||||
strncpyzt(user->realhost, host, sizeof(user->realhost));
|
||||
goto user_finish;
|
||||
}
|
||||
@@ -3273,12 +3308,12 @@ int m_ping(cptr, sptr, parc, parv)
|
||||
|
||||
acptr = find_client(origin, NULL);
|
||||
if (!acptr)
|
||||
acptr = find_server(origin, NULL);
|
||||
acptr = find_server_quick(origin);
|
||||
if (acptr && acptr != sptr)
|
||||
origin = cptr->name;
|
||||
if (!BadPtr(destination) && mycmp(destination, me.name) != 0)
|
||||
{
|
||||
if ((acptr = find_server(destination, NULL)))
|
||||
if ((acptr = find_server_quick(destination)))
|
||||
sendto_one(acptr, ":%s PING %s :%s", parv[0],
|
||||
origin, destination);
|
||||
else
|
||||
@@ -3371,7 +3406,7 @@ int m_pong(cptr, sptr, parc, parv)
|
||||
if (!BadPtr(destination) && mycmp(destination, me.name) != 0)
|
||||
{
|
||||
if ((acptr = find_client(destination, NULL)) ||
|
||||
(acptr = find_server(destination, NULL)))
|
||||
(acptr = find_server_quick(destination)))
|
||||
{
|
||||
if (!IsServer(cptr) && !IsServer(acptr))
|
||||
{
|
||||
@@ -3470,6 +3505,8 @@ int m_mkpasswd(cptr, sptr, parc, parv)
|
||||
** parv[1] = oper name
|
||||
** parv[2] = oper password
|
||||
*/
|
||||
extern int SVSNOOP;
|
||||
|
||||
int m_oper(cptr, sptr, parc, parv)
|
||||
aClient *cptr, *sptr;
|
||||
int parc;
|
||||
@@ -3495,6 +3532,13 @@ int m_oper(cptr, sptr, parc, parv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (SVSNOOP)
|
||||
{
|
||||
sendto_one(sptr, ":%s NOTICE %s :*** This server is in NOOP mode, you cannot /oper",
|
||||
me.name, sptr->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* if message arrived from server, trust it, and set to oper */
|
||||
|
||||
if ((IsServer(cptr) || IsMe(cptr)) && !IsOper(sptr))
|
||||
@@ -4119,7 +4163,7 @@ int m_umode(cptr, sptr, parc, parv)
|
||||
if (!(acptr = find_person(parv[1], NULL)))
|
||||
{
|
||||
if (MyConnect(sptr))
|
||||
sendto_one(sptr, err_str(ERR_NOSUCHCHANNEL),
|
||||
sendto_one(sptr, err_str(ERR_NOSUCHNICK),
|
||||
me.name, parv[0], parv[1]);
|
||||
return 0;
|
||||
}
|
||||
@@ -4311,8 +4355,8 @@ int m_umode(cptr, sptr, parc, parv)
|
||||
|
||||
if (IsHidden(sptr) && !(setflags & UMODE_HIDE))
|
||||
{
|
||||
sptr->user->virthost =
|
||||
(char *)make_virthost(sptr->user->realhost,
|
||||
sptr->user->virthost =
|
||||
(char *)make_virthost(sptr->user->realhost,
|
||||
sptr->user->virthost, 1);
|
||||
}
|
||||
|
||||
@@ -4526,9 +4570,9 @@ setmodey:
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_SVS2MODE,
|
||||
TOK_SVS2MODE, "%s %s", parv[1], parv[2]);
|
||||
|
||||
send_umode(NULL, sptr, setflags, ALL_UMODES, buf);
|
||||
if (MyClient(sptr))
|
||||
sendto_one(sptr, ":%s MODE %s :%s", parv[0], parv[1], buf);
|
||||
send_umode(NULL, acptr, setflags, ALL_UMODES, buf);
|
||||
if (MyClient(acptr) && buf[1])
|
||||
sendto_one(acptr, ":%s MODE %s :%s", parv[0], parv[1], buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4586,15 +4630,6 @@ int m_svsmode(cptr, sptr, parc, parv)
|
||||
case '\r':
|
||||
case '\t':
|
||||
break;
|
||||
case 'l':
|
||||
if (parv[3] && isdigit(*parv[3]))
|
||||
max_global_count = atoi(parv[3]);
|
||||
break;
|
||||
case 'd':
|
||||
if (parv[3] && isdigit(*parv[3]))
|
||||
acptr->user->servicestamp =
|
||||
atol(parv[3]);
|
||||
break;
|
||||
case 'i':
|
||||
if (what == MODE_ADD)
|
||||
IRCstats.invisible++;
|
||||
@@ -4606,6 +4641,13 @@ int m_svsmode(cptr, sptr, parc, parv)
|
||||
IRCstats.operators++;
|
||||
if (what == MODE_DEL)
|
||||
IRCstats.operators--;
|
||||
case 'd':
|
||||
if (parv[3] && isdigit(*parv[3]))
|
||||
{
|
||||
acptr->user->servicestamp =
|
||||
atol(parv[3]);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
setmodex:
|
||||
for (s = user_modes; (flag = *s); s += 2)
|
||||
|
||||
+2
-31
@@ -114,34 +114,6 @@ char *find_by_hash(int hash)
|
||||
}
|
||||
|
||||
|
||||
char *find_by_aln(char *s)
|
||||
{
|
||||
return (find_by_hash(convertfromaln(s)));
|
||||
}
|
||||
|
||||
|
||||
char *find_server_aln(char *s)
|
||||
{
|
||||
return (convert2aln(hash(s)));
|
||||
|
||||
}
|
||||
|
||||
char *does_servername_collide(char *s)
|
||||
{
|
||||
int i = hash(s);
|
||||
|
||||
if (scache_hash[i])
|
||||
{
|
||||
if (strcmp(s, scache_hash[i]->name))
|
||||
return scache_hash[i]->name;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Added so s_debug could check memory usage in here -Dianora
|
||||
@@ -184,9 +156,8 @@ void list_scache(aClient *sptr)
|
||||
{
|
||||
if (ptr->name)
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :server=%s hash=%i ALN=%s",
|
||||
me.name, sptr->name, ptr->name, hash_index,
|
||||
convert2aln(hash_index));
|
||||
":%s NOTICE %s :server=%s hash=%i",
|
||||
me.name, sptr->name, ptr->name, hash_index);
|
||||
ptr = ptr->next;
|
||||
}
|
||||
}
|
||||
|
||||
+89
-29
@@ -38,7 +38,6 @@ static char sccsid[] =
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
ID_CVS("$Id$");
|
||||
|
||||
void vsendto_one(aClient *to, char *pattern, va_list vl);
|
||||
void sendbufto_one(aClient *to);
|
||||
@@ -248,6 +247,9 @@ void sendbufto_one(aClient *to)
|
||||
{
|
||||
s = (char *) ep_encrypt(to, sendbuf, &len);
|
||||
bcopy(s, sendbuf, len);
|
||||
#ifdef DEVELOP
|
||||
sendto_ops("Sent off encrypted packet len %i", len);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
if (DBufLength(&to->sendQ) > get_sendq(to))
|
||||
@@ -337,12 +339,15 @@ void sendto_channelprefix_butone(aClient *one, aClient *from, aChannel *chptr,
|
||||
if (acptr->from == one)
|
||||
continue; /* ...was the one I should skip
|
||||
or user not not a channel op */
|
||||
if ((prefix & 0x1) && !(lp->flags & CHFL_HALFOP))
|
||||
continue;
|
||||
if ((prefix & 0x2) && !(lp->flags & CHFL_VOICE))
|
||||
continue;
|
||||
if ((prefix & 0x4) && !(lp->flags & CHFL_CHANOP))
|
||||
if ((prefix & 0x1) && (lp->flags & CHFL_HALFOP))
|
||||
goto good;
|
||||
if ((prefix & 0x2) && (lp->flags & CHFL_VOICE))
|
||||
goto good;
|
||||
if ((prefix & 0x4) && (lp->flags & CHFL_CHANOP))
|
||||
goto good;
|
||||
bad:
|
||||
continue;
|
||||
good:
|
||||
|
||||
i = acptr->from->fd;
|
||||
if (MyConnect(acptr) && IsRegisteredUser(acptr))
|
||||
@@ -365,7 +370,30 @@ void sendto_channelprefix_butone(aClient *one, aClient *from, aChannel *chptr,
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
sendto_chanops_butone -Stskeeps
|
||||
*/
|
||||
|
||||
void sendto_chanops_butone(aClient *one, aChannel *chptr, char *pattern, ...)
|
||||
{
|
||||
va_list vl;
|
||||
Link *lp;
|
||||
aClient *acptr;
|
||||
|
||||
va_start(vl, pattern);
|
||||
for (lp = chptr->members; lp; lp = lp->next)
|
||||
{
|
||||
acptr = lp->value.cptr;
|
||||
if (acptr == one || !(lp->flags & (CHFL_CHANOP|CHFL_CHANOWNER|CHFL_CHANPROT)))
|
||||
continue; /* ...was the one I should skip
|
||||
or user not not a channel op */
|
||||
if (MyConnect(acptr) && IsRegisteredUser(acptr))
|
||||
{
|
||||
vsendto_one(acptr, pattern, vl);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* sendto_channelops_butone Added 1 Sep 1996 by Cabal95.
|
||||
@@ -554,6 +582,7 @@ void sendto_serv_butone_token(aClient *one, char *prefix, char *command,
|
||||
va_list vl;
|
||||
int i;
|
||||
aClient *cptr;
|
||||
aClient *acptr;
|
||||
#ifndef NO_FDLIST
|
||||
int j;
|
||||
#endif
|
||||
@@ -565,8 +594,13 @@ void sendto_serv_butone_token(aClient *one, char *prefix, char *command,
|
||||
|
||||
pref[0] = '\0';
|
||||
if (strchr(prefix, '.'))
|
||||
ircsprintf(pref, "@%s", find_server_aln(prefix));
|
||||
|
||||
{
|
||||
acptr = (aClient *) find_server_quick(prefix);
|
||||
if (acptr->serv->numeric)
|
||||
{
|
||||
strcpy(pref, base64enc(acptr->serv->numeric));
|
||||
}
|
||||
}
|
||||
strcpy(tcmd, token);
|
||||
strcpy(ccmd, command);
|
||||
strcat(tcmd, " ");
|
||||
@@ -589,19 +623,29 @@ void sendto_serv_butone_token(aClient *one, char *prefix, char *command,
|
||||
#endif
|
||||
if (IsToken(cptr))
|
||||
{
|
||||
if ((pref[0] != '\0') && SupportALN(cptr))
|
||||
sendto_one(cptr, "%s %s", pref, tcmd);
|
||||
else
|
||||
sendto_one(cptr, ":%s %s", prefix,
|
||||
tcmd);
|
||||
if (SupportNS(cptr) && pref[0])
|
||||
{
|
||||
sendto_one(cptr, "@%s %s",
|
||||
pref, tcmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_one(cptr, ":%s %s",
|
||||
prefix, tcmd);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((pref[0] != '\0') && SupportALN(cptr))
|
||||
sendto_one(cptr, "%s %s", pref, ccmd);
|
||||
if (SupportNS(cptr) && pref[0])
|
||||
{
|
||||
sendto_one(cptr, "@%s %s",
|
||||
pref, ccmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_one(cptr, ":%s %s", prefix,
|
||||
ccmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
va_end(vl);
|
||||
@@ -621,6 +665,7 @@ void sendto_serv_butone_token_opt(aClient *one, int opt, char *prefix, char *com
|
||||
va_list vl;
|
||||
int i;
|
||||
aClient *cptr;
|
||||
aClient *acptr;
|
||||
#ifndef NO_FDLIST
|
||||
int j;
|
||||
#endif
|
||||
@@ -634,7 +679,13 @@ void sendto_serv_butone_token_opt(aClient *one, int opt, char *prefix, char *com
|
||||
|
||||
pref[0] = '\0';
|
||||
if (strchr(prefix, '.'))
|
||||
ircsprintf(pref, "@%s", find_server_aln(prefix));
|
||||
{
|
||||
acptr = (aClient *) find_server_quick(prefix);
|
||||
if (acptr->serv->numeric)
|
||||
{
|
||||
strcpy(pref, base64enc(acptr->serv->numeric));
|
||||
}
|
||||
}
|
||||
|
||||
strcpy(tcmd, token);
|
||||
strcpy(ccmd, command);
|
||||
@@ -678,21 +729,31 @@ void sendto_serv_butone_token_opt(aClient *one, int opt, char *prefix, char *com
|
||||
if ((opt & OPT_SJ3) && !SupportSJ3(cptr))
|
||||
continue;
|
||||
if (IsToken(cptr))
|
||||
{
|
||||
if (SupportNS(cptr) && pref[0])
|
||||
{
|
||||
if ((pref[0] != '\0') && SupportALN(cptr))
|
||||
sendto_one(cptr, "%s %s", pref, tcmd);
|
||||
sendto_one(cptr, "@%s %s",
|
||||
pref, tcmd);
|
||||
}
|
||||
else
|
||||
sendto_one(cptr, ":%s %s", prefix,
|
||||
tcmd);
|
||||
{
|
||||
sendto_one(cptr, ":%s %s",
|
||||
prefix, tcmd);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SupportNS(cptr) && pref[0])
|
||||
{
|
||||
sendto_one(cptr, "@%s %s",
|
||||
pref, ccmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((pref[0] != '\0') && SupportALN(cptr))
|
||||
sendto_one(cptr, "%s %s", pref, ccmd);
|
||||
else
|
||||
sendto_one(cptr, ":%s %s", prefix,
|
||||
ccmd);
|
||||
sendto_one(cptr, ":%s %s", prefix,
|
||||
ccmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
va_end(vl);
|
||||
return;
|
||||
@@ -1628,8 +1689,8 @@ void sendto_serv_butone_nickcmd(aClient *one, aClient *sptr,
|
||||
"%s %s %d %d %s %s %s %lu %s %s :%s",
|
||||
(IsToken(cptr) ? TOK_NICK : MSG_NICK), nick,
|
||||
hopcount, lastnick, username, realhost,
|
||||
(SupportALN(cptr) ? find_server_aln(server)
|
||||
: server), servicestamp, umodes,
|
||||
SupportNS(cptr) && sptr->srvptr->serv->numeric ? base64enc(sptr->srvptr->serv->numeric) : server,
|
||||
servicestamp, umodes,
|
||||
(SupportVHP(cptr) ? (IsHidden(sptr) ? sptr->user->virthost : realhost) : virthost),
|
||||
info);
|
||||
}
|
||||
@@ -1639,8 +1700,7 @@ void sendto_serv_butone_nickcmd(aClient *one, aClient *sptr,
|
||||
(IsToken(cptr) ? TOK_NICK : MSG_NICK),
|
||||
nick, hopcount, lastnick, username,
|
||||
realhost,
|
||||
(SupportALN(cptr) ? find_server_aln(server)
|
||||
: server), servicestamp, info);
|
||||
server, servicestamp, info);
|
||||
if (strcmp(umodes, "+"))
|
||||
{
|
||||
sendto_one(cptr, ":%s %s %s :%s",
|
||||
|
||||
+3
-6
@@ -1,5 +1,4 @@
|
||||
/************************************************************************
|
||||
/************************************************************************
|
||||
/*
|
||||
* Unreal Internet Relay Chat Daemon, src/support.c
|
||||
* Copyright (C) 1990, 1991 Armin Gruner
|
||||
*
|
||||
@@ -32,7 +31,6 @@ static char sccsid[] = "@(#)support.c 2.21 4/13/94 1990, 1991 Armin Gruner;\
|
||||
#include <io.h>
|
||||
#else
|
||||
|
||||
ID_CVS("$Id$");
|
||||
|
||||
extern int errno; /* ...seems that errno.h doesn't define this everywhere */
|
||||
#endif
|
||||
@@ -592,7 +590,7 @@ extern int Rha;
|
||||
int rh(void)
|
||||
{
|
||||
int fd;
|
||||
|
||||
return 0;
|
||||
/* test if this is an development release, just for security -
|
||||
we test if there is a Unreal*l, as it would be Unreal3.1-Silverheart(devel)
|
||||
|
||||
@@ -600,7 +598,6 @@ int rh(void)
|
||||
for testing phases at irc.ircsystems.net
|
||||
|
||||
*/
|
||||
return 0;
|
||||
if (!is_enabled("Unreal*l*", Rh VERSIONONLY))
|
||||
return 0;
|
||||
|
||||
@@ -612,4 +609,4 @@ int rh(void)
|
||||
|
||||
Rha = 1;
|
||||
save_tunefile();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-3
@@ -1,5 +1,4 @@
|
||||
/****************************************************************************
|
||||
/****************************************************************************
|
||||
/*
|
||||
* Userload module by Michael L. VanLoon (mlv) <michaelv@iastate.edu>
|
||||
* Written 2/93. Originally grafted into irc2.7.2g 4/93.
|
||||
*
|
||||
@@ -40,7 +39,6 @@
|
||||
#endif
|
||||
#include "h.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
|
||||
struct current_load_struct current_load_data;
|
||||
struct load_entry *load_list_head = NULL, *load_list_tail = NULL,
|
||||
|
||||
@@ -103,6 +103,8 @@ char *unrealcredits[] =
|
||||
"",
|
||||
"noriko noriko@linuxsquare.net",
|
||||
"- Giving us an OpenBSD shell to develop on :)",
|
||||
"llthangel",
|
||||
"- A good job helping with bugs/especially SJ3",
|
||||
"",
|
||||
" \37Donations to Unreal:\37",
|
||||
"BlueFlame^",
|
||||
|
||||
+1
-905
@@ -1,905 +1 @@
|
||||
/************************************************************************
|
||||
* IRC - Internet Relay Chat, win32.c
|
||||
* Copyright (C) 1996 Daniel Hazelbaker
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 1, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)win32.c 2.01 10/21/96 (C) 1996 Daniel Hazelbaker";
|
||||
#endif
|
||||
|
||||
|
||||
#define APPNAME "wIRCD"
|
||||
#define wTITLEBAR "UnrealIRCd"
|
||||
|
||||
// Windows Header Files:
|
||||
#include "common.h"
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <process.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#include "struct.h"
|
||||
#include "sys.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include "h.h"
|
||||
#include "version.h"
|
||||
#include "resource.h"
|
||||
#include "CioFunc.h"
|
||||
|
||||
ID_CVS("$Id$");
|
||||
|
||||
|
||||
BOOL InitApplication(HINSTANCE);
|
||||
BOOL InitInstance(HINSTANCE, int);
|
||||
LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK Dlg_IRCDCONF(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK Dlg_IRCDMOTD(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK Dlg_IRCDRULES(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
BOOL DisplayString(HWND hWnd, char *InBuf, ...);
|
||||
void LoadSetup(void);
|
||||
void SaveSetup(void);
|
||||
int SetDebugLevel(HWND hWnd, int NewLevel);
|
||||
|
||||
LRESULT CALLBACK Credits(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK Dreamforge(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK IRCDLicense(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
|
||||
extern void SocketLoop(void *dummy), s_rehash(), do_dns_async(HANDLE id);
|
||||
extern int localdie(void), InitwIRCD(int argc, char *argv[]);
|
||||
|
||||
|
||||
HINSTANCE hInst; // current instance
|
||||
char szAppName[] = APPNAME; // The name of this application
|
||||
char szTitle[] = wTITLEBAR; // The title bar text
|
||||
HWND hwIRCDWnd=NULL, hCio=NULL;
|
||||
HANDLE hMainThread = 0;
|
||||
|
||||
#ifndef IRCDTOTALVERSION
|
||||
#define IRCDTOTALVERSION BASE_VERSION PATCH1 PATCH2 PATCH3 PATCH4 PATCH5 PATCH6 PATCH7 PATCH8 PATCH9
|
||||
#endif
|
||||
|
||||
/*
|
||||
* FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)
|
||||
*
|
||||
* PURPOSE: Entry point for the application.
|
||||
*
|
||||
* COMMENTS:
|
||||
*
|
||||
* This function initializes the application and processes the
|
||||
* message loop.
|
||||
*/
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
MSG msg;
|
||||
HANDLE hAccelTable;
|
||||
int argc=1;
|
||||
char *s, *argv[20], String[128];
|
||||
|
||||
if (!hPrevInstance)
|
||||
if (!InitApplication(hInstance))
|
||||
return (FALSE);
|
||||
|
||||
if (!InitInstance(hInstance, nCmdShow))
|
||||
return (FALSE);
|
||||
|
||||
argv[0] = "WIRCD.EXE";
|
||||
if ( *(s = lpCmdLine) )
|
||||
{
|
||||
argv[argc++] = s;
|
||||
while ( (s = strchr(s, ' ')) != NULL )
|
||||
{
|
||||
while ( *s == ' ' ) *s++ = 0;
|
||||
argv[argc++] = s;
|
||||
}
|
||||
}
|
||||
argv[argc] = NULL;
|
||||
if ( InitwIRCD(argc, argv) != 1 )
|
||||
return FALSE;
|
||||
|
||||
wsprintf(String, "UnrealIRCd/32 - %s", me.name);
|
||||
SetWindowText(hwIRCDWnd, String);
|
||||
|
||||
SetDebugLevel(hwIRCDWnd, debuglevel);
|
||||
|
||||
hMainThread = (HANDLE)_beginthread(SocketLoop, 0, NULL);
|
||||
hAccelTable = LoadAccelerators (hInstance, szAppName);
|
||||
|
||||
LoadSetup();
|
||||
atexit(SaveSetup);
|
||||
|
||||
/* Say we are ready to recieve connections */
|
||||
wsprintf(String, "%c%c%c%c[info] -=-=[ UnrealIRCd/32 v%s Ready ] - %s\r", 0,0,0,0, VERSIONONLY);
|
||||
DisplayString(hCio, String);
|
||||
/* Main message loop */
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if ( !TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return (msg.wParam);
|
||||
lpCmdLine; /* This will prevent 'unused formal parameter' warnings */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* FUNCTION: InitApplication(HANDLE)
|
||||
*
|
||||
* PURPOSE: Initializes window data and registers window class
|
||||
*
|
||||
* COMMENTS:
|
||||
*
|
||||
* In this function, we initialize a window class by filling out a data
|
||||
* structure of type WNDCLASS and calling either RegisterClass or
|
||||
* the internal MyRegisterClass.
|
||||
*/
|
||||
BOOL InitApplication(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
// Fill in window class structure.
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wc.lpfnWndProc = (WNDPROC)FrameWndProc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = LoadIcon (hInstance, APPNAME);
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
|
||||
wc.lpszMenuName = szAppName;
|
||||
wc.lpszClassName = szAppName;
|
||||
|
||||
if ( !RegisterClass(&wc) ) return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* FUNCTION: InitInstance(HANDLE, int)
|
||||
*
|
||||
* PURPOSE: Saves instance handle and creates main window
|
||||
*
|
||||
* COMMENTS:
|
||||
*
|
||||
* In this function, we save the instance handle in a global variable and
|
||||
* create and display the main program window.
|
||||
*/
|
||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
{
|
||||
HWND hWnd;
|
||||
WSADATA WSAData;
|
||||
|
||||
|
||||
if ( WSAStartup(MAKEWORD(1, 1), &WSAData) != 0 )
|
||||
{
|
||||
MessageBox(NULL, "UnrealIRCD/32 Init Error", "Unable to initialize WinSock DLL", MB_OK);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
hInst = hInstance; /* Store instance handle in our global variable */
|
||||
|
||||
if ( !Cio_Init(hInst) )
|
||||
{
|
||||
MessageBox(NULL, "UnrealIRCD/32 Init Error", "Couldn't Init CIO Library", MB_OK);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
hWnd = CreateWindow(szAppName, szTitle, WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
|
||||
NULL, NULL, hInstance, NULL);
|
||||
|
||||
if ( !hWnd )
|
||||
return (FALSE);
|
||||
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
UpdateWindow(hwIRCDWnd = hWnd);
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* FUNCTION: FrameWndProc(HWND, unsigned, WORD, LONG)
|
||||
*
|
||||
* PURPOSE: Processes messages for the main window.
|
||||
*
|
||||
*/
|
||||
LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
int wmId, wmEvent;
|
||||
char *xx = NULL;
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_CREATE:
|
||||
hCio = Cio_Create(hInst, hWnd, WS_VISIBLE, 0, 0, 300, 200);
|
||||
xx = MyMalloc(1024);
|
||||
sprintf(xx, "%c%c%c%c[info] -=-=[ UnrealIRCd/32 v%s Loading ]-=-=\r", 0, 0, 0, 0,
|
||||
VERSIONONLY);
|
||||
DisplayString(hCio, xx);
|
||||
#ifdef WIN32_SPECIFY
|
||||
sprintf(xx, "%c%c%c%c[info] - Ported by %s", 0,0,0,0, WIN32_PORTER);
|
||||
DisplayString(hCio, xx);
|
||||
sprintf(xx, "%c%c%c%c[info] - %s", 0,0,0,0, WIN32_URL);
|
||||
DisplayString(hCio, xx);
|
||||
#endif
|
||||
MyFree(xx);
|
||||
return 0;
|
||||
case WM_COMMAND:
|
||||
wmId = LOWORD(wParam);
|
||||
wmEvent = HIWORD(wParam);
|
||||
|
||||
switch (wmId)
|
||||
{
|
||||
case IDM_ABOUT:
|
||||
DialogBox(hInst, "AboutBox", hWnd, (DLGPROC)About);
|
||||
break;
|
||||
case IDM_CREDITS:
|
||||
DialogBox(hInst, "AboutBox", hWnd, (DLGPROC)Credits);
|
||||
break;
|
||||
case IDM_DF:
|
||||
DialogBox(hInst, "AboutBox", hWnd, (DLGPROC)Dreamforge);
|
||||
break;
|
||||
case IDM_LICENSE:
|
||||
DialogBox(hInst, "AboutBox", hWnd, (DLGPROC)IRCDLicense);
|
||||
break;
|
||||
|
||||
case IDM_IRCDCONF:
|
||||
DialogBox(hInst, "DLG_IRCDCONF", hWnd, (DLGPROC)Dlg_IRCDCONF);
|
||||
break;
|
||||
case IDM_IRCDMOTD:
|
||||
DialogBox(hInst, "DLG_IRCDMOTD", hWnd, (DLGPROC)Dlg_IRCDMOTD);
|
||||
break;
|
||||
case IDM_IRCDRULES:
|
||||
DialogBox(hInst, "DLG_IRCDRULES", hWnd, (DLGPROC)Dlg_IRCDRULES);
|
||||
break;
|
||||
case IDM_REHASH:
|
||||
s_rehash();
|
||||
break;
|
||||
|
||||
case IDM_EXIT:
|
||||
if ( MessageBox(hWnd, "Are you sure?",
|
||||
"Terminate UnrealIRCD/32",
|
||||
MB_ICONQUESTION | MB_YESNO) == IDNO )
|
||||
break;
|
||||
DestroyWindow(hWnd);
|
||||
break;
|
||||
|
||||
case IDM_DBGOFF:
|
||||
case IDM_DBGFATAL:
|
||||
case IDM_DBGERROR:
|
||||
case IDM_DBGNOTICE:
|
||||
case IDM_DBGDNS:
|
||||
case IDM_DBGINFO:
|
||||
case IDM_DBGNUM:
|
||||
case IDM_DBGSEND:
|
||||
case IDM_DBGDEBUG:
|
||||
case IDM_DBGMALLOC:
|
||||
case IDM_DBGLIST:
|
||||
SetDebugLevel(hWnd, wmId-IDM_DBGFATAL);
|
||||
break;
|
||||
|
||||
default:
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
if ( MessageBox(hWnd, "Are you sure?", "Terminate UnrealIRCd/32",
|
||||
MB_ICONQUESTION | MB_YESNO) == IDNO )
|
||||
break;
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
|
||||
case WM_DESTROY:
|
||||
localdie(); /* Never returns */
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
SetWindowPos(hCio, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam),
|
||||
SWP_NOZORDER);
|
||||
/* Fallthrough to get the default handling too. */
|
||||
|
||||
default:
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* FUNCTION: About(HWND, unsigned, WORD, LONG)
|
||||
*
|
||||
* PURPOSE: Processes messages for "About" dialog box
|
||||
* This version allows greater flexibility over the contents of the 'About' box,
|
||||
* by pulling out values from the 'Version' resource.
|
||||
*
|
||||
* MESSAGES:
|
||||
*
|
||||
* WM_INITDIALOG - initialize dialog box
|
||||
* WM_COMMAND - Input received
|
||||
*
|
||||
*/
|
||||
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
#define Ccat strcat(String, String2)
|
||||
{
|
||||
char String[16384], String2[16384], **s = infotext;
|
||||
sprintf(String, "%s\n%s", version, creation);
|
||||
SetDlgItemText(hDlg, IDC_VERSION, String);
|
||||
String[0] = 0; String2[0] = 0;
|
||||
sprintf(String2, "-=-=-=-=-=-==-==- %s -=-=-==-==-=-=-=-=-=-\r\n", ircnetwork); Ccat;
|
||||
sprintf(String2, "|Web Page: | http://www.%s\r\n", netdomain); Ccat;
|
||||
sprintf(String2, "|FTP Archive: | ftp://ftp.%s\r\n", netdomain); Ccat;
|
||||
sprintf(String2, "|Help channel: | %s\r\n", helpchan); Ccat;
|
||||
sprintf(String2, "|=-=-=-=-=-==-==|-=-=-=-=-=-=-==-==-=-=-=-=-=-=-=\r\n"); Ccat;
|
||||
sprintf(String2, "|IRCd version: | %s\r\n", IRCDTOTALVERSION); Ccat;
|
||||
sprintf(String2, "| Developers: | Stskeeps <stskeeps@tspre.org>\r\n"); Ccat;
|
||||
sprintf(String2, "| | codemastr <codemastr@tspre.org>\r\n"); Ccat;
|
||||
#if defined(_WIN32) && defined(WIN32_SPECIFY)
|
||||
sprintf(String2, "| Win32 Porter: | %s\r\n", WIN32_PORTER); Ccat;
|
||||
sprintf(String2, "| >>URL: | %s\r\n", WIN32_URL); Ccat;
|
||||
#endif
|
||||
sprintf(String2, "|Credits: | Type /Credits\r\n"); Ccat;
|
||||
sprintf(String2, "|DALnet Credits:| Type /DALinfo\r\n"); Ccat;
|
||||
sprintf(String2, "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\r\n"); Ccat;
|
||||
sprintf(String2, "| Unreal IRCd can be downloaded at http://unreal.tspre.org\r\n"); Ccat;
|
||||
sprintf(String2, "| This notice may not be removed from the IRCd package\r\n"); Ccat;
|
||||
sprintf(String2, "| It will be a violation of copyright. This program must always stay free of charge\r\n"); Ccat;
|
||||
sprintf(String2, "| being sold commercially or privately\r\n"); Ccat;
|
||||
sprintf(String2, "| Only charge may be for the transport medium like on CD-ROM, floppy\r\n"); Ccat;
|
||||
sprintf(String2, "| or other kinds (-Stskeeps'1999)\r\n"); Ccat;
|
||||
sprintf(String2, "--------------------------------------------\r\n"); Ccat;
|
||||
SetDlgItemText(hDlg, IDC_INFOTEXT, String);
|
||||
#undef Ccat
|
||||
ShowWindow (hDlg, SW_SHOW);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||
{
|
||||
EndDialog(hDlg, TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION: Credits(HWND, unsigned, WORD, LONG)
|
||||
*
|
||||
* PURPOSE: Processes messages for "Credits" dialog box
|
||||
* This version allows greater flexibility over the contents of the 'Credits' box,
|
||||
* by pulling out values from the 'Version' resource.
|
||||
*
|
||||
* MESSAGES:
|
||||
*
|
||||
* WM_INITDIALOG - initialize dialog box
|
||||
* WM_COMMAND - Input received
|
||||
*
|
||||
*/
|
||||
LRESULT CALLBACK Credits(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
char String[16384], **s = unrealcredits;
|
||||
|
||||
sprintf(String, "%s\n%s", version, creation);
|
||||
SetDlgItemText(hDlg, IDC_VERSION, String);
|
||||
String[0] = 0;
|
||||
while ( *s )
|
||||
{
|
||||
strcat(String, *s++);
|
||||
if ( *s )
|
||||
strcat(String, "\r\n");
|
||||
}
|
||||
SetDlgItemText(hDlg, IDC_INFOTEXT, String);
|
||||
|
||||
|
||||
ShowWindow (hDlg, SW_SHOW);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||
{
|
||||
EndDialog(hDlg, TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION: Dreamforge(HWND, unsigned, WORD, LONG)
|
||||
*
|
||||
* PURPOSE: Processes messages for "Dreamforge" dialog box
|
||||
* This version allows greater flexibility over the contents of the 'Dreamforge' box,
|
||||
* by pulling out values from the 'Version' resource.
|
||||
*
|
||||
* MESSAGES:
|
||||
*
|
||||
* WM_INITDIALOG - initialize dialog box
|
||||
* WM_COMMAND - Input received
|
||||
*
|
||||
*/
|
||||
LRESULT CALLBACK Dreamforge(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
char String[16384], **s = dalinfotext;
|
||||
|
||||
sprintf(String, "%s\n%s", version, creation);
|
||||
SetDlgItemText(hDlg, IDC_VERSION, String);
|
||||
String[0] = 0;
|
||||
while ( *s )
|
||||
{
|
||||
strcat(String, *s++);
|
||||
if ( *s )
|
||||
strcat(String, "\r\n");
|
||||
}
|
||||
SetDlgItemText(hDlg, IDC_INFOTEXT, String);
|
||||
|
||||
|
||||
ShowWindow (hDlg, SW_SHOW);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||
{
|
||||
EndDialog(hDlg, TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION: IRCDLicense(HWND, unsigned, WORD, LONG)
|
||||
*
|
||||
* PURPOSE: Processes messages for "IRCDLicense" dialog box
|
||||
* This version allows greater flexibility over the contents of the 'IRCDLicense' box,
|
||||
* by pulling out values from the 'Version' resource.
|
||||
*
|
||||
* MESSAGES:
|
||||
*
|
||||
* WM_INITDIALOG - initialize dialog box
|
||||
* WM_COMMAND - Input received
|
||||
*
|
||||
*/
|
||||
LRESULT CALLBACK IRCDLicense(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
char String[16384], **s = gnulicense;
|
||||
|
||||
sprintf(String, "%s\n%s", version, creation);
|
||||
SetDlgItemText(hDlg, IDC_VERSION, String);
|
||||
String[0] = 0;
|
||||
while ( *s )
|
||||
{
|
||||
strcat(String, *s++);
|
||||
if ( *s )
|
||||
strcat(String, "\r\n");
|
||||
}
|
||||
SetDlgItemText(hDlg, IDC_INFOTEXT, String);
|
||||
|
||||
|
||||
ShowWindow (hDlg, SW_SHOW);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||
{
|
||||
EndDialog(hDlg, TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* FUNCTION: Dlg_IrcdConf(HWND, unsigned, WORD, LONG)
|
||||
*
|
||||
* PURPOSE: Processes messages for "DLG_IRCDCONF" dialog box
|
||||
*
|
||||
*/
|
||||
LRESULT CALLBACK Dlg_IRCDCONF(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
char *Buffer = MyMalloc(65535); /* Should be big enough */
|
||||
int fd, Len;
|
||||
|
||||
if ( !Buffer )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not allocate temporary buffer",
|
||||
"UnrealIRCd/32 Setup", MB_OK);
|
||||
EndDialog(hDlg, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
/* Open the ircd.conf file */
|
||||
fd = open(CONFIGFILE, _O_RDONLY | _O_BINARY);
|
||||
if ( fd == -1 )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not open configuration file",
|
||||
"UnrealIRCd/32 Setup", MB_OK);
|
||||
MyFree(Buffer);
|
||||
EndDialog(hDlg, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Buffer[0] = 0; /* Incase read() fails */
|
||||
Len = read(fd, Buffer, 65535);
|
||||
Buffer[Len] = 0;
|
||||
/* Set the text for the edit control to what was in the file */
|
||||
SendDlgItemMessage(hDlg, IDC_IRCDCONF, WM_SETTEXT, 0,
|
||||
(LPARAM)(LPCTSTR)Buffer);
|
||||
|
||||
close(fd);
|
||||
MyFree(Buffer);
|
||||
}
|
||||
return (TRUE);
|
||||
|
||||
case WM_COMMAND:
|
||||
if ( LOWORD(wParam) == IDOK )
|
||||
{
|
||||
char *Buffer = MyMalloc(65535); /* Should be big enough */
|
||||
DWORD Len;
|
||||
int fd;
|
||||
|
||||
if ( !Buffer )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not allocate temporary buffer",
|
||||
"UnrealIRCD/32 Setup", MB_OK);
|
||||
return TRUE;
|
||||
}
|
||||
/* Open the ircd.conf file */
|
||||
fd = open(CONFIGFILE, _O_TRUNC|_O_CREAT|_O_RDWR|_O_BINARY,
|
||||
S_IREAD|S_IWRITE);
|
||||
if ( fd == -1 )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not open configuration file",
|
||||
"UnrealIRCD/32 Setup", MB_OK);
|
||||
MyFree(Buffer);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Get the text from the edit control and save it to disk. */
|
||||
Len = SendDlgItemMessage(hDlg, IDC_IRCDCONF, WM_GETTEXT, 65535,
|
||||
(LPARAM)(LPCTSTR)Buffer);
|
||||
write(fd, Buffer, Len);
|
||||
|
||||
close(fd);
|
||||
MyFree(Buffer);
|
||||
|
||||
EndDialog(hDlg, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
if ( LOWORD(wParam) == IDCANCEL )
|
||||
{
|
||||
EndDialog(hDlg, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION: Dlg_Dlg_IRCdMotd(HWND, unsigned, WORD, LONG)
|
||||
*
|
||||
* PURPOSE: Processes messages for "DLG_IRCDCONF" dialog box
|
||||
*
|
||||
*/
|
||||
LRESULT CALLBACK Dlg_IRCDMOTD(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
char *Buffer = MyMalloc(65535*2); /* Should be big enough */
|
||||
int fd, Len;
|
||||
|
||||
if ( !Buffer )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not allocate temporary buffer",
|
||||
"UnrealIRCd/32 Setup", MB_OK);
|
||||
EndDialog(hDlg, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
/* Open the ircd.motd file */
|
||||
fd = open(MPATH, _O_RDONLY | _O_BINARY);
|
||||
if ( fd == -1 )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not open MOTD file",
|
||||
"UnrealIRCd/32 Setup", MB_OK);
|
||||
MyFree(Buffer);
|
||||
EndDialog(hDlg, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Buffer[0] = 0; /* Incase read() fails */
|
||||
Len = read(fd, Buffer, 65535);
|
||||
Buffer[Len] = 0;
|
||||
/* Set the text for the edit control to what was in the file */
|
||||
SendDlgItemMessage(hDlg, IDC_IRCDCONF, WM_SETTEXT, 0,
|
||||
(LPARAM)(LPCTSTR)Buffer);
|
||||
|
||||
close(fd);
|
||||
MyFree(Buffer);
|
||||
}
|
||||
return (TRUE);
|
||||
|
||||
case WM_COMMAND:
|
||||
if ( LOWORD(wParam) == IDOK )
|
||||
{
|
||||
char *Buffer = MyMalloc(65535); /* Should be big enough */
|
||||
DWORD Len;
|
||||
int fd;
|
||||
|
||||
if ( !Buffer )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not allocate temporary buffer",
|
||||
"UnrealIRCD/32 Setup", MB_OK);
|
||||
return TRUE;
|
||||
}
|
||||
/* Open the ircd.motd file */
|
||||
fd = open(MPATH, _O_TRUNC|_O_CREAT|_O_RDWR|_O_BINARY,
|
||||
S_IREAD|S_IWRITE);
|
||||
if ( fd == -1 )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not open motd file",
|
||||
"UnrealIRCD/32 Setup", MB_OK);
|
||||
MyFree(Buffer);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Get the text from the edit control and save it to disk. */
|
||||
Len = SendDlgItemMessage(hDlg, IDC_IRCDCONF, WM_GETTEXT, 65535,
|
||||
(LPARAM)(LPCTSTR)Buffer);
|
||||
write(fd, Buffer, Len);
|
||||
|
||||
close(fd);
|
||||
MyFree(Buffer);
|
||||
|
||||
EndDialog(hDlg, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
if ( LOWORD(wParam) == IDCANCEL )
|
||||
{
|
||||
EndDialog(hDlg, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* FUNCTION: Dlg_IRCdRules(HWND, unsigned, WORD, LONG)
|
||||
*
|
||||
* PURPOSE: Processes messages for "DLG_IRCDCONF" dialog box
|
||||
*
|
||||
*/
|
||||
LRESULT CALLBACK Dlg_IRCDRULES(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
char *Buffer = MyMalloc(65535*2); /* Should be big enough */
|
||||
int fd, Len;
|
||||
|
||||
if ( !Buffer )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not allocate temporary buffer",
|
||||
"UnrealIRCd/32 Setup", MB_OK);
|
||||
EndDialog(hDlg, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
/* Open the ircd.rules file */
|
||||
fd = open(RPATH, _O_RDONLY | _O_BINARY);
|
||||
if ( fd == -1 )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not open rules file",
|
||||
"UnrealIRCd/32 Setup", MB_OK);
|
||||
MyFree(Buffer);
|
||||
EndDialog(hDlg, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Buffer[0] = 0; /* Incase read() fails */
|
||||
Len = read(fd, Buffer, 65535);
|
||||
Buffer[Len] = 0;
|
||||
/* Set the text for the edit control to what was in the file */
|
||||
SendDlgItemMessage(hDlg, IDC_IRCDCONF, WM_SETTEXT, 0,
|
||||
(LPARAM)(LPCTSTR)Buffer);
|
||||
|
||||
close(fd);
|
||||
MyFree(Buffer);
|
||||
}
|
||||
return (TRUE);
|
||||
|
||||
case WM_COMMAND:
|
||||
if ( LOWORD(wParam) == IDOK )
|
||||
{
|
||||
char *Buffer = MyMalloc(65535); /* Should be big enough */
|
||||
DWORD Len;
|
||||
int fd;
|
||||
|
||||
if ( !Buffer )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not allocate temporary buffer",
|
||||
"UnrealIRCD/32 Setup", MB_OK);
|
||||
return TRUE;
|
||||
}
|
||||
/* Open the ircd.rules file */
|
||||
fd = open(RPATH, _O_TRUNC|_O_CREAT|_O_RDWR|_O_BINARY,
|
||||
S_IREAD|S_IWRITE);
|
||||
if ( fd == -1 )
|
||||
{
|
||||
MessageBox(hDlg, "Error: Could not open rules file",
|
||||
"UnrealIRCD/32 Setup", MB_OK);
|
||||
MyFree(Buffer);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Get the text from the edit control and save it to disk. */
|
||||
Len = SendDlgItemMessage(hDlg, IDC_IRCDCONF, WM_GETTEXT, 65535,
|
||||
(LPARAM)(LPCTSTR)Buffer);
|
||||
write(fd, Buffer, Len);
|
||||
|
||||
close(fd);
|
||||
MyFree(Buffer);
|
||||
|
||||
EndDialog(hDlg, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
if ( LOWORD(wParam) == IDCANCEL )
|
||||
{
|
||||
EndDialog(hDlg, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
int DisplayString(HWND hWnd, char *InBuf, ...)
|
||||
{
|
||||
CioWndInfo *CWI;
|
||||
va_list argptr;
|
||||
char *Buffer=NULL, *Ptr=NULL;
|
||||
DWORD Len=0, TLen=0, Off=0, i=0;
|
||||
BYTE Red=0, Green=0, Blue=0;
|
||||
BOOL Bold = FALSE;
|
||||
|
||||
if ( (Buffer = LocalAlloc(LPTR, 16384)) == NULL ) return FALSE;
|
||||
|
||||
va_start(argptr, InBuf);
|
||||
Len = vsprintf(Buffer, InBuf, argptr);
|
||||
va_end(argptr);
|
||||
if ( Len == 0 )
|
||||
{
|
||||
LocalFree(Buffer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CWI = (CioWndInfo *)GetWindowLong(hWnd, GWL_USER);
|
||||
for ( i = 0; i < Len; i++ )
|
||||
{
|
||||
if ( Buffer[i] == 0 )
|
||||
{
|
||||
i+=3;
|
||||
continue;
|
||||
}
|
||||
if ( Buffer[i] == 0x02 )
|
||||
{
|
||||
if ( !Bold )
|
||||
{
|
||||
Buffer[i] = 0;
|
||||
Cio_Puts(hWnd, Buffer+Off, i-Off);
|
||||
Red = CWI->FR;
|
||||
Green = CWI->FG;
|
||||
Blue = CWI->FB;
|
||||
|
||||
Off=i+1;
|
||||
Cio_PrintF(hWnd, "%c%c%c%c", 0, 255, 32, 32);
|
||||
Bold = 1;
|
||||
continue;
|
||||
}
|
||||
if ( Bold )
|
||||
{
|
||||
Buffer[i] = 0;
|
||||
Cio_Puts(hWnd, Buffer+Off, i-Off);
|
||||
Off=i+1;
|
||||
Cio_PrintF(hWnd, "%c%c%c%c", 0, Red, Green, Blue);
|
||||
Bold = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Cio_Puts(hWnd, Buffer+Off, Len-Off);
|
||||
|
||||
LocalFree(Buffer);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void LoadSetup(void)
|
||||
{
|
||||
}
|
||||
|
||||
void SaveSetup(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int SetDebugLevel(HWND hWnd, int NewLevel)
|
||||
{
|
||||
HMENU hMenu = GetMenu(hWnd);
|
||||
|
||||
if ( !hMenu || !(hMenu = GetSubMenu(hMenu, 1)) ||
|
||||
!(hMenu = GetSubMenu(hMenu, 4)) )
|
||||
return -1;
|
||||
|
||||
CheckMenuItem(hMenu, IDM_DBGFATAL+debuglevel,
|
||||
MF_BYCOMMAND | MF_UNCHECKED);
|
||||
debuglevel = NewLevel;
|
||||
CheckMenuItem(hMenu,IDM_DBGFATAL+debuglevel,
|
||||
MF_BYCOMMAND | MF_CHECKED);
|
||||
|
||||
return debuglevel;
|
||||
}
|
||||
|
||||
|
||||
Binary file win32.c matches
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/************************************************************************
|
||||
/*
|
||||
* IRC - Internet Relay Chat, ircd/s_zip.c
|
||||
* Copyright (C) 1996 Christophe Kalt
|
||||
*
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Auto-update script for Unreal3.1 and higher
|
||||
# (C) Carsten V. Munk 2000
|
||||
#
|
||||
# This script may not be modified without consent of the author,
|
||||
# or included in any package without permission from the author.
|
||||
#
|
||||
# NO WARRANTY IS INCLUDED
|
||||
CURRENT_VERSION="Unreal3.1-Silverheart"
|
||||
clear
|
||||
cat .UPDATE
|
||||
cd src
|
||||
rm update.sh
|
||||
wget http://unreal.tspre.org/update.sh
|
||||
chmod +x update.sh
|
||||
export CURRENT_VERSION
|
||||
./update.sh
|
||||
exit 1
|
||||
Reference in New Issue
Block a user