mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-06 04:52:26 +00:00
forgot to add Internet.Mod.
This commit is contained in:
parent
801de6a0c2
commit
b1d7006dfc
4 changed files with 106 additions and 10 deletions
19
IRC.Mod
19
IRC.Mod
|
|
@ -1,28 +1,35 @@
|
|||
MODULE IRC;
|
||||
IMPORT Internet, Out, Strings, types;
|
||||
|
||||
CONST strLen = 1024;
|
||||
CONST msgLen = 512; (* message length not more than 512 characters *)
|
||||
|
||||
VAR
|
||||
connection : Internet.Socket;
|
||||
|
||||
PROCEDURE Auth*(user, nick: ARRAY OF CHAR): BOOLEAN;
|
||||
PROCEDURE Auth*(user, nick, owner: ARRAY OF CHAR): BOOLEAN;
|
||||
VAR
|
||||
str0, str1: ARRAY 255 OF CHAR;
|
||||
b : BOOLEAN;
|
||||
BEGIN
|
||||
(* "USER test 0 0 :test\r\n" *)
|
||||
(* "USER test 0 * :test\r\n" *)
|
||||
(* "NICK test\r\n\000\060 :test\r\n"*)
|
||||
COPY("USER ", str0);
|
||||
|
||||
str1[0] := 0AX; str1[1] := 0DX; str1[2] := 0X;
|
||||
|
||||
COPY("USER ", str0);
|
||||
Strings.Append(user, str0);
|
||||
Strings.Append(" 0 0 :", str0);
|
||||
Strings.Append(nick, str0);
|
||||
str1[0] := 0AX; str1[1] := 0DX; str1[2] := 0X;
|
||||
Strings.Append(owner, str0);
|
||||
(* by the spec the command is terminated by \r\n *)
|
||||
Strings.Append(str1, str0);
|
||||
Out.String("sending:"); Out.Ln;
|
||||
Out.String(str0); Out.Ln;
|
||||
b := Internet.Write(connection, str0, Strings.Length(str0));
|
||||
IF b THEN Out.String("wrote!"); Out.Ln ELSE Out.String("write failed"); Out.Ln END;
|
||||
COPY ("NICK ", str0);
|
||||
Strings.Append (nick, str0);
|
||||
Strings.Append(str1, str0);
|
||||
IF b THEN Out.String("wrote!"); Out.Ln ELSE Out.String("write failed"); Out.Ln END;
|
||||
RETURN b
|
||||
|
||||
END Auth;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue