mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-06 04:52:26 +00:00
works!
This commit is contained in:
parent
2a708f215c
commit
6f74eab47e
4 changed files with 49 additions and 98 deletions
38
IRC.Mod
Normal file
38
IRC.Mod
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
MODULE IRC;
|
||||
IMPORT Internet, Out, Strings, types;
|
||||
|
||||
CONST strLen = 1024;
|
||||
|
||||
VAR
|
||||
connection : Internet.Socket;
|
||||
|
||||
PROCEDURE Auth*(user, nick: ARRAY OF CHAR): BOOLEAN;
|
||||
VAR
|
||||
str0, str1: ARRAY 255 OF CHAR;
|
||||
b : BOOLEAN;
|
||||
BEGIN
|
||||
(* "USER test 0 0 :test\r\n" *)
|
||||
(* "NICK test\r\n\000\060 :test\r\n"*)
|
||||
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(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;
|
||||
RETURN b
|
||||
|
||||
END Auth;
|
||||
|
||||
PROCEDURE Connect*(host, port: ARRAY OF CHAR): BOOLEAN;
|
||||
VAR
|
||||
res: BOOLEAN;
|
||||
BEGIN
|
||||
res := Internet.Connect(host, port, connection);
|
||||
RETURN res
|
||||
END Connect;
|
||||
|
||||
END IRC.
|
||||
Loading…
Add table
Add a link
Reference in a new issue