IRC-Client: internal handling if some IRC commands
This commit is contained in:
parent
3c690d4fe3
commit
a76f4cdd98
|
@ -0,0 +1,11 @@
|
||||||
|
IRC
|
||||||
|
IRC-Client für den Hive
|
||||||
|
|
||||||
|
Author: Jörg Deckert (joergd@bitquell.de)
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Einleitung
|
||||||
|
----------
|
||||||
|
|
||||||
|
IRC ist ein IRC-Client für den Hive. Er sollte auf jedem Hive mit bestücktem
|
||||||
|
Netzwerk-Interface und RTC funktionieren.
|
|
@ -54,7 +54,7 @@ COL_FRAME = 0 'Fensterrahmen (nicht ausgewählt)
|
||||||
COL_FOCUS = 3 'Fensterrahmen (ausgewählt/Fokus)
|
COL_FOCUS = 3 'Fensterrahmen (ausgewählt/Fokus)
|
||||||
COL_HEAD = 8 'Titelzeile
|
COL_HEAD = 8 'Titelzeile
|
||||||
COL_TIME = 8 'aktuelle Zeit in Message-Zeile
|
COL_TIME = 8 'aktuelle Zeit in Message-Zeile
|
||||||
COL_STTIME = 8 'aktuelle Zeit im Status-Fenster
|
COL_STTIME = 8 'aktuelle Zeit im Status-Fenster
|
||||||
COL_CHAN = 5 'Channel in Message-Zeile
|
COL_CHAN = 5 'Channel in Message-Zeile
|
||||||
COL_NICK = 4 'Nickname in Message-Zeile
|
COL_NICK = 4 'Nickname in Message-Zeile
|
||||||
COL_MYNICK = 2 'Nickname in selbst geschriebener Message-Zeile
|
COL_MYNICK = 2 'Nickname in selbst geschriebener Message-Zeile
|
||||||
|
@ -121,7 +121,7 @@ PUB main | key
|
||||||
f_input(key)
|
f_input(key)
|
||||||
|
|
||||||
ifnot handleidx == $FF
|
ifnot handleidx == $FF
|
||||||
irc_getLine
|
ircGetLine
|
||||||
|
|
||||||
PRI init
|
PRI init
|
||||||
|
|
||||||
|
@ -139,75 +139,14 @@ PRI init
|
||||||
|
|
||||||
ios.start 'ios initialisieren
|
ios.start 'ios initialisieren
|
||||||
ifnot (ios.admgetspec & LANMASK)
|
ifnot (ios.admgetspec & LANMASK)
|
||||||
ios.print(string(10,"Administra stellt keine Netzwerk-Funktionen zur Verfügung!",10,"Bitte admnet laden.",10))
|
ios.print(string(13,"Administra stellt keine Netzwerk-Funktionen zur Verfügung!",13,"Bitte admnet laden.",13))
|
||||||
ios.stop
|
ios.stop
|
||||||
ios.print(string(10,"Initialisiere, bitte warten...",10))
|
ios.print(string(13,"Initialisiere, bitte warten...",13))
|
||||||
setscreen
|
setscreen
|
||||||
conf_load
|
conf_load
|
||||||
if ip_addr == 0
|
if ip_addr == 0
|
||||||
f_setconf
|
f_setconf
|
||||||
|
|
||||||
PRI conf_load | i
|
|
||||||
|
|
||||||
ios.sddmset(ios#DM_USER) 'u-marker setzen
|
|
||||||
ios.sddmact(ios#DM_SYSTEM) 's-marker aktivieren
|
|
||||||
|
|
||||||
ifnot ios.sdopen("R",@strConfFile)
|
|
||||||
ip_addr := ios.sdgetc << 24
|
|
||||||
ip_addr += ios.sdgetc << 16
|
|
||||||
ip_addr += ios.sdgetc << 8
|
|
||||||
ip_addr += ios.sdgetc
|
|
||||||
ip_port := ios.sdgetc << 8
|
|
||||||
ip_port += ios.sdgetc
|
|
||||||
|
|
||||||
repeat i from 0 to LEN_PASS
|
|
||||||
password[i] := ios.sdgetc
|
|
||||||
repeat i from 0 to LEN_NICK
|
|
||||||
nickname[i] := ios.sdgetc
|
|
||||||
repeat i from 0 to LEN_USER
|
|
||||||
username[i] := ios.sdgetc
|
|
||||||
repeat i from 0 to LEN_CHAN
|
|
||||||
channel[i] := ios.sdgetc
|
|
||||||
|
|
||||||
ios.sdclose
|
|
||||||
|
|
||||||
ios.sddmact(ios#DM_USER) 'u-marker aktivieren
|
|
||||||
|
|
||||||
hiveid := ios.getNVSRAM(NVRAM_HIVE)
|
|
||||||
hiveid += ios.getNVSRAM(NVRAM_HIVE+1) << 8
|
|
||||||
hiveid += ios.getNVSRAM(NVRAM_HIVE+2) << 16
|
|
||||||
hiveid += ios.getNVSRAM(NVRAM_HIVE+3) << 24
|
|
||||||
|
|
||||||
|
|
||||||
PRI conf_save | i
|
|
||||||
|
|
||||||
ios.sddmset(ios#DM_USER) 'u-marker setzen
|
|
||||||
ios.sddmact(ios#DM_SYSTEM) 's-marker aktivieren
|
|
||||||
|
|
||||||
ios.sdnewfile(@strConfFile)
|
|
||||||
ifnot ios.sdopen("W",@strConfFile)
|
|
||||||
ios.sdputc(ip_addr >> 24)
|
|
||||||
ios.sdputc(ip_addr >> 16)
|
|
||||||
ios.sdputc(ip_addr >> 8)
|
|
||||||
ios.sdputc(ip_addr )
|
|
||||||
ios.sdputc(ip_port >> 8)
|
|
||||||
ios.sdputc(ip_port )
|
|
||||||
|
|
||||||
repeat i from 0 to LEN_PASS
|
|
||||||
ios.sdputc(password[i])
|
|
||||||
repeat i from 0 to LEN_NICK
|
|
||||||
ios.sdputc(nickname[i])
|
|
||||||
repeat i from 0 to LEN_USER
|
|
||||||
ios.sdputc(username[i])
|
|
||||||
repeat i from 0 to LEN_CHAN
|
|
||||||
ios.sdputc(channel[i])
|
|
||||||
|
|
||||||
ios.sdclose
|
|
||||||
|
|
||||||
ios.sddmact(ios#DM_USER) 'u-marker aktivieren
|
|
||||||
|
|
||||||
handleStatusStr(string("Konfiguration gespeichert."), 2, TRUE)
|
|
||||||
|
|
||||||
PRI f_focus
|
PRI f_focus
|
||||||
|
|
||||||
if ++focus == 4
|
if ++focus == 4
|
||||||
|
@ -244,7 +183,7 @@ PRI f_scrollup | lineAddr, lineNum, lineMax
|
||||||
lineNum += lineMax
|
lineNum += lineMax
|
||||||
lineAddr := bufstart[focus] + (lineNum * buflinelen) 'Adresse im eRAM (Usermode)
|
lineAddr := bufstart[focus] + (lineNum * buflinelen) 'Adresse im eRAM (Usermode)
|
||||||
|
|
||||||
printBufWin(lineAddr, focus)
|
printBufWin(lineAddr)
|
||||||
|
|
||||||
PRI f_scrolldown | lineAddr, lineNum, lineMax
|
PRI f_scrolldown | lineAddr, lineNum, lineMax
|
||||||
|
|
||||||
|
@ -263,85 +202,30 @@ PRI f_scrolldown | lineAddr, lineNum, lineMax
|
||||||
lineNum += lineMax
|
lineNum += lineMax
|
||||||
lineAddr := bufstart[focus] + (lineNum * buflinelen) 'Adresse im eRAM (Usermode)
|
lineAddr := bufstart[focus] + (lineNum * buflinelen) 'Adresse im eRAM (Usermode)
|
||||||
|
|
||||||
printBufWin(lineAddr, focus)
|
printBufWin(lineAddr)
|
||||||
|
|
||||||
PRI f_setconf | i,n
|
PRI f_setconf | i,n
|
||||||
|
|
||||||
if ip_addr == 0
|
ifnot confServer
|
||||||
temp_str[0] := 0
|
return(TRUE)
|
||||||
else
|
confPass
|
||||||
IpPortToStr(ip_addr, ip_port)
|
confNick
|
||||||
input(string("IRC-Server angeben (IP:Port):"),@temp_str ,21)
|
confUser
|
||||||
ifnot strToIpPort(@input_str, @ip_addr, @ip_port)
|
confChannel
|
||||||
handleStatusStr(string("Fehlerhafte Eingabe von IP-Adresse und Port des IRC-Servers."), 2, TRUE)
|
|
||||||
|
|
||||||
input(string("Paßwort eingeben:"),@password,LEN_PASS)
|
|
||||||
n := 1
|
|
||||||
repeat i from 0 to LEN_PASS
|
|
||||||
if n == 0
|
|
||||||
password[i] := 0
|
|
||||||
else
|
|
||||||
n := input_str[i]
|
|
||||||
password[i] := n
|
|
||||||
|
|
||||||
input(string("Nickname eingeben:"),@nickname,LEN_NICK)
|
|
||||||
n := 1
|
|
||||||
repeat i from 0 to LEN_NICK
|
|
||||||
if n == 0
|
|
||||||
nickname[i] := 0
|
|
||||||
else
|
|
||||||
n := input_str[i]
|
|
||||||
nickname[i] := n
|
|
||||||
|
|
||||||
input(string("Username eingeben:"),@username,LEN_USER)
|
|
||||||
n := 1
|
|
||||||
repeat i from 0 to LEN_USER
|
|
||||||
if n == 0
|
|
||||||
username[i] := 0
|
|
||||||
else
|
|
||||||
n := input_str[i]
|
|
||||||
username[i] := n
|
|
||||||
|
|
||||||
input(string("Channel eingeben:"),@channel,LEN_CHAN)
|
|
||||||
n := 1
|
|
||||||
repeat i from 0 to LEN_CHAN
|
|
||||||
if n == 0
|
|
||||||
channel[i] := 0
|
|
||||||
else
|
|
||||||
n := input_str[i]
|
|
||||||
channel[i] := n
|
|
||||||
|
|
||||||
win_contentRefresh
|
win_contentRefresh
|
||||||
|
confSave
|
||||||
|
|
||||||
conf_save
|
PRI f_connect
|
||||||
|
|
||||||
PRI f_connect | t
|
ircConnect
|
||||||
|
ircPass
|
||||||
handleStatusStr(string("Starte LAN..."), 2, TRUE)
|
ircReg
|
||||||
ios.lanstart
|
ircJoin
|
||||||
handleStatusStr(string("Verbinde mit IRC-Server..."), 2, TRUE)
|
|
||||||
if (handleidx := ios.lan_connect(ip_addr, ip_port)) == $FF
|
|
||||||
ios.print(string(10,"Kein Socket frei!"))
|
|
||||||
handleStatusStr(string("Kein Socket frei!"), 2, TRUE)
|
|
||||||
return(-1)
|
|
||||||
ifnot (ios.lan_waitconntimeout(handleidx, 2000))
|
|
||||||
handleStatusStr(string("Verbindung mit IRC-Server konnte nicht aufgebaut werden."), 2, TRUE)
|
|
||||||
f_close
|
|
||||||
return(-1)
|
|
||||||
handleStatusStr(string("Verbunden, warte auf Bereitschaft..."), 2, TRUE)
|
|
||||||
|
|
||||||
t := cnt
|
|
||||||
repeat until (cnt - t) / clkfreq > 1 '1s lang Meldungen des Servers entgegennehmen
|
|
||||||
irc_getline
|
|
||||||
|
|
||||||
irc_pass
|
|
||||||
irc_join
|
|
||||||
|
|
||||||
PRI f_close
|
PRI f_close
|
||||||
|
|
||||||
ifnot handleidx == $FF
|
ircClose
|
||||||
ios.lan_close(handleidx)
|
|
||||||
handleidx := $FF
|
|
||||||
|
|
||||||
PRI f_quit
|
PRI f_quit
|
||||||
|
|
||||||
|
@ -354,7 +238,7 @@ PRI f_input(key)
|
||||||
|
|
||||||
case key
|
case key
|
||||||
$0d: if strsize(@send_str) > 0 'Zeilenende, absenden
|
$0d: if strsize(@send_str) > 0 'Zeilenende, absenden
|
||||||
irc_putLine
|
ircPutLine
|
||||||
ios.winset(3)
|
ios.winset(3)
|
||||||
ios.printnl
|
ios.printnl
|
||||||
sendpos := 0
|
sendpos := 0
|
||||||
|
@ -371,14 +255,154 @@ PRI f_input(key)
|
||||||
sendpos++
|
sendpos++
|
||||||
send_str[sendpos] := 0
|
send_str[sendpos] := 0
|
||||||
|
|
||||||
PRI irc_pass
|
PRI confServer
|
||||||
|
|
||||||
|
if ip_addr == 0
|
||||||
|
temp_str[0] := 0
|
||||||
|
else
|
||||||
|
IpPortToStr(ip_addr, ip_port)
|
||||||
|
input(string("IRC-Server angeben (IP:Port):"),@temp_str ,21)
|
||||||
|
ifnot strToIpPort(@input_str, @ip_addr, @ip_port)
|
||||||
|
handleStatusStr(string("Fehlerhafte Eingabe von IP-Adresse und Port des IRC-Servers."), 2, TRUE)
|
||||||
|
return (FALSE)
|
||||||
|
return(TRUE)
|
||||||
|
|
||||||
|
PRI confPass | i,n
|
||||||
|
|
||||||
|
input(string("Paßwort eingeben:"),@password,LEN_PASS)
|
||||||
|
n := 1
|
||||||
|
repeat i from 0 to LEN_PASS
|
||||||
|
if n == 0
|
||||||
|
password[i] := 0
|
||||||
|
else
|
||||||
|
n := input_str[i]
|
||||||
|
password[i] := n
|
||||||
|
|
||||||
|
PRI confNick | i,n
|
||||||
|
|
||||||
|
input(string("Nickname eingeben:"),@nickname,LEN_NICK)
|
||||||
|
n := 1
|
||||||
|
repeat i from 0 to LEN_NICK
|
||||||
|
if n == 0
|
||||||
|
nickname[i] := 0
|
||||||
|
else
|
||||||
|
n := input_str[i]
|
||||||
|
nickname[i] := n
|
||||||
|
|
||||||
|
PRI confUser | i,n
|
||||||
|
|
||||||
|
input(string("Username eingeben:"),@username,LEN_USER)
|
||||||
|
n := 1
|
||||||
|
repeat i from 0 to LEN_USER
|
||||||
|
if n == 0
|
||||||
|
username[i] := 0
|
||||||
|
else
|
||||||
|
n := input_str[i]
|
||||||
|
username[i] := n
|
||||||
|
|
||||||
|
PRI confChannel | i,n
|
||||||
|
|
||||||
|
input(string("Channel eingeben:"),@channel,LEN_CHAN)
|
||||||
|
n := 1
|
||||||
|
repeat i from 0 to LEN_CHAN
|
||||||
|
if n == 0
|
||||||
|
channel[i] := 0
|
||||||
|
else
|
||||||
|
n := input_str[i]
|
||||||
|
channel[i] := n
|
||||||
|
|
||||||
|
PRI confSave | i
|
||||||
|
|
||||||
|
ios.sddmset(ios#DM_USER) 'u-marker setzen
|
||||||
|
ios.sddmact(ios#DM_SYSTEM) 's-marker aktivieren
|
||||||
|
|
||||||
|
ios.sdnewfile(@strConfFile)
|
||||||
|
ifnot ios.sdopen("W",@strConfFile)
|
||||||
|
ios.sdputc(ip_addr >> 24)
|
||||||
|
ios.sdputc(ip_addr >> 16)
|
||||||
|
ios.sdputc(ip_addr >> 8)
|
||||||
|
ios.sdputc(ip_addr )
|
||||||
|
ios.sdputc(ip_port >> 8)
|
||||||
|
ios.sdputc(ip_port )
|
||||||
|
|
||||||
|
repeat i from 0 to LEN_PASS
|
||||||
|
ios.sdputc(password[i])
|
||||||
|
repeat i from 0 to LEN_NICK
|
||||||
|
ios.sdputc(nickname[i])
|
||||||
|
repeat i from 0 to LEN_USER
|
||||||
|
ios.sdputc(username[i])
|
||||||
|
repeat i from 0 to LEN_CHAN
|
||||||
|
ios.sdputc(channel[i])
|
||||||
|
|
||||||
|
ios.sdclose
|
||||||
|
|
||||||
|
ios.sddmact(ios#DM_USER) 'u-marker aktivieren
|
||||||
|
|
||||||
|
handleStatusStr(string("Konfiguration gespeichert."), 2, TRUE)
|
||||||
|
|
||||||
|
PRI conf_load | i
|
||||||
|
|
||||||
|
ios.sddmset(ios#DM_USER) 'u-marker setzen
|
||||||
|
ios.sddmact(ios#DM_SYSTEM) 's-marker aktivieren
|
||||||
|
|
||||||
|
ifnot ios.sdopen("R",@strConfFile)
|
||||||
|
ip_addr := ios.sdgetc << 24
|
||||||
|
ip_addr += ios.sdgetc << 16
|
||||||
|
ip_addr += ios.sdgetc << 8
|
||||||
|
ip_addr += ios.sdgetc
|
||||||
|
ip_port := ios.sdgetc << 8
|
||||||
|
ip_port += ios.sdgetc
|
||||||
|
|
||||||
|
repeat i from 0 to LEN_PASS
|
||||||
|
password[i] := ios.sdgetc
|
||||||
|
repeat i from 0 to LEN_NICK
|
||||||
|
nickname[i] := ios.sdgetc
|
||||||
|
repeat i from 0 to LEN_USER
|
||||||
|
username[i] := ios.sdgetc
|
||||||
|
repeat i from 0 to LEN_CHAN
|
||||||
|
channel[i] := ios.sdgetc
|
||||||
|
|
||||||
|
ios.sdclose
|
||||||
|
|
||||||
|
ios.sddmact(ios#DM_USER) 'u-marker aktivieren
|
||||||
|
|
||||||
|
hiveid := ios.getNVSRAM(NVRAM_HIVE)
|
||||||
|
hiveid += ios.getNVSRAM(NVRAM_HIVE+1) << 8
|
||||||
|
hiveid += ios.getNVSRAM(NVRAM_HIVE+2) << 16
|
||||||
|
hiveid += ios.getNVSRAM(NVRAM_HIVE+3) << 24
|
||||||
|
|
||||||
|
PRI ircConnect | t
|
||||||
|
|
||||||
|
handleStatusStr(string("Verbinde mit IRC-Server..."), 2, TRUE)
|
||||||
|
ios.lanstart
|
||||||
|
if (handleidx := ios.lan_connect(ip_addr, ip_port)) == $FF
|
||||||
|
handleStatusStr(string("Kein Socket frei!"), 2, TRUE)
|
||||||
|
return(-1)
|
||||||
|
ifnot (ios.lan_waitconntimeout(handleidx, 2000))
|
||||||
|
handleStatusStr(string("Verbindung mit IRC-Server konnte nicht aufgebaut werden."), 2, TRUE)
|
||||||
|
f_close
|
||||||
|
return(-1)
|
||||||
|
handleStatusStr(string("Verbunden, warte auf Bereitschaft..."), 2, TRUE)
|
||||||
|
|
||||||
|
t := cnt
|
||||||
|
repeat until (cnt - t) / clkfreq > 1 '1s lang Meldungen des Servers entgegennehmen
|
||||||
|
ircGetline
|
||||||
|
|
||||||
|
PRI ircClose
|
||||||
|
|
||||||
|
ifnot handleidx == $FF
|
||||||
|
ios.lan_close(handleidx)
|
||||||
|
handleidx := $FF
|
||||||
|
handleStatusStr(string("Verbindung mit IRC-Server getrennt..."), 2, TRUE)
|
||||||
|
|
||||||
|
PRI ircPass
|
||||||
|
|
||||||
handleStatusStr(string("Sende Paßwort..."), 2, TRUE)
|
handleStatusStr(string("Sende Paßwort..."), 2, TRUE)
|
||||||
if sendStr(string("PASS ")) or sendStr(@password) or sendStr(string(13,10))
|
if sendStr(string("PASS ")) or sendStr(@password) or sendStr(string(13,10))
|
||||||
handleStatusStr(string("Fehler beim Senden des Paßwortes"), 2, TRUE)
|
handleStatusStr(string("Fehler beim Senden des Paßwortes"), 2, TRUE)
|
||||||
return(-1)
|
return(-1)
|
||||||
|
|
||||||
PRI irc_join
|
PRI ircReg
|
||||||
|
|
||||||
if strsize(@channel) == 0
|
if strsize(@channel) == 0
|
||||||
handleStatusStr(string("Sende Nickname und Benutzerinformationen..."), 2, TRUE)
|
handleStatusStr(string("Sende Nickname und Benutzerinformationen..."), 2, TRUE)
|
||||||
|
@ -395,12 +419,14 @@ PRI irc_join
|
||||||
|
|
||||||
waitcnt(cnt + clkfreq) '1sek warten
|
waitcnt(cnt + clkfreq) '1sek warten
|
||||||
|
|
||||||
|
PRI ircJoin
|
||||||
|
|
||||||
ifnot strsize(@channel) == 0
|
ifnot strsize(@channel) == 0
|
||||||
if sendStr(string("JOIN ")) or sendStr(@channel) or sendStr(string(13,10))
|
if sendStr(string("JOIN ")) or sendStr(@channel) or sendStr(string(13,10))
|
||||||
handleStatusStr(string("Fehler beim Verbinden mit Channel"), 2, TRUE)
|
handleStatusStr(string("Fehler beim Verbinden mit Channel"), 2, TRUE)
|
||||||
return(-1)
|
return(-1)
|
||||||
|
|
||||||
PRI irc_getLine | i, x, prefixstr, nickstr, chanstr, msgstr, commandstr
|
PRI ircGetLine | i, x, prefixstr, nickstr, chanstr, msgstr, commandstr
|
||||||
|
|
||||||
if readLine(2000) 'vollständige Zeile empfangen
|
if readLine(2000) 'vollständige Zeile empfangen
|
||||||
|
|
||||||
|
@ -477,11 +503,45 @@ PRI irc_getLine | i, x, prefixstr, nickstr, chanstr, msgstr, commandstr
|
||||||
else 'unbekanntes Kommando
|
else 'unbekanntes Kommando
|
||||||
handleStatusStr(commandstr, 2, FALSE)
|
handleStatusStr(commandstr, 2, FALSE)
|
||||||
|
|
||||||
PRI irc_putLine | i
|
PRI ircPutLine | i
|
||||||
|
|
||||||
if str.startsWithCharacters(@send_str, string("/set")) 'Einstellungen
|
if str.startsWithCharacters(@send_str, string("/set")) 'alle Einstellungen ändern und speichern
|
||||||
f_setconf
|
f_setconf
|
||||||
elseif str.startsWithCharacters(@send_str, string("/msg")) 'Message an Nickname
|
elseif str.startsWithCharacters(@send_str, string("/save")) 'Konfiguration speichern
|
||||||
|
confSave
|
||||||
|
elseif str.startsWithCharacters(@send_str, string("/srv")) 'mit Server verbinden
|
||||||
|
if confServer 'wenn Eingabe IP und Port korrekt
|
||||||
|
win_contentRefresh
|
||||||
|
ircClose 'bei bestehender Verbindung diese beenden
|
||||||
|
ircConnect
|
||||||
|
ircPass
|
||||||
|
ircReg
|
||||||
|
else
|
||||||
|
win_contentRefresh
|
||||||
|
elseif str.startsWithCharacters(@send_str, string("/quit")) 'Verbindung mit Server trennen
|
||||||
|
ircClose
|
||||||
|
elseif str.startsWithCharacters(@send_str, string("/pass")) 'Paßwort ändern
|
||||||
|
confPass
|
||||||
|
win_contentRefresh
|
||||||
|
elseif str.startsWithCharacters(@send_str, string("/nick")) 'Nickname ändern
|
||||||
|
confNick
|
||||||
|
win_contentRefresh
|
||||||
|
elseif str.startsWithCharacters(@send_str, string("/user")) 'User ändern
|
||||||
|
confUser
|
||||||
|
win_contentRefresh
|
||||||
|
elseif str.startsWithCharacters(@send_str, string("/join")) 'mit Channel verbinden
|
||||||
|
confChannel
|
||||||
|
win_contentRefresh
|
||||||
|
ircJoin
|
||||||
|
elseif str.startsWithCharacters(@send_str, string("/part")) 'Channel verlassen
|
||||||
|
sendStr(string("PART "))
|
||||||
|
sendStr(@channel)
|
||||||
|
if send_str[5] == " "
|
||||||
|
sendStr(@send_str[5])
|
||||||
|
sendStr(string(13,10))
|
||||||
|
channel[0] := 0
|
||||||
|
handleChatStr(@channel, @nickname, @send_str, 1)
|
||||||
|
elseif str.startsWithCharacters(@send_str, string("/msg")) 'Message an Nickname
|
||||||
sendStr(string("PRIVMSG "))
|
sendStr(string("PRIVMSG "))
|
||||||
if (i := str.replaceCharacter(@send_str[5], " ", 0))
|
if (i := str.replaceCharacter(@send_str[5], " ", 0))
|
||||||
sendStr(@send_str[5])
|
sendStr(@send_str[5])
|
||||||
|
@ -489,11 +549,11 @@ PRI irc_putLine | i
|
||||||
sendStr(i)
|
sendStr(i)
|
||||||
sendStr(string(13,10))
|
sendStr(string(13,10))
|
||||||
handleChatStr(@send_str[5], @nickname, i, 1)
|
handleChatStr(@send_str[5], @nickname, i, 1)
|
||||||
elseif send_str[0] == "/" 'anderes IRC-Kommando an Server
|
elseif send_str[0] == "/" 'anderes IRC-Kommando an Server
|
||||||
sendStr(@send_str[1])
|
sendStr(@send_str[1])
|
||||||
sendStr(string(13,10))
|
sendStr(string(13,10))
|
||||||
handleChatStr(@channel, @nickname, @send_str[1], 1)
|
handleChatStr(@channel, @nickname, @send_str, 1)
|
||||||
else 'Message an Channel
|
else 'Message an Channel
|
||||||
sendStr(string("PRIVMSG "))
|
sendStr(string("PRIVMSG "))
|
||||||
sendStr(@channel)
|
sendStr(@channel)
|
||||||
sendStr(string(" :"))
|
sendStr(string(" :"))
|
||||||
|
@ -577,15 +637,13 @@ PRI win_contentRefresh | win, lines, lineNum
|
||||||
2: lineNum := MAX_LINES_WIN2 + buflinenr[win] - lines
|
2: lineNum := MAX_LINES_WIN2 + buflinenr[win] - lines
|
||||||
ios.winset(win)
|
ios.winset(win)
|
||||||
ios.printcls
|
ios.printcls
|
||||||
printBufWin(bufstart[win] + (lineNum * buflinelen), win)
|
printBufWin(bufstart[win] + (lineNum * buflinelen))
|
||||||
repeat lines - 1
|
repeat lines - 1
|
||||||
lineNum++
|
lineNum++
|
||||||
if lineNum == MAX_LINES_WIN1
|
if lineNum == MAX_LINES_WIN1
|
||||||
lineNum := 0
|
lineNum := 0
|
||||||
' ios.printnl
|
ios.printnl
|
||||||
ios.printchar(10)
|
printBufWin(bufstart[win] + (lineNum * buflinelen))
|
||||||
printBufWin(bufstart[win] + (lineNum * buflinelen), win)
|
|
||||||
win++
|
|
||||||
|
|
||||||
PRI setscreen | buflen[4], i
|
PRI setscreen | buflen[4], i
|
||||||
|
|
||||||
|
@ -716,10 +774,9 @@ PRI handleChatStr(chanstr, nickstr, msgstr, me) | i, channicklen, msglineend, ch
|
||||||
print_str[print_str_ptr++] := 0 'komplette Chat-Zeile fertig
|
print_str[print_str_ptr++] := 0 'komplette Chat-Zeile fertig
|
||||||
print_str[print_str_ptr] := 0
|
print_str[print_str_ptr] := 0
|
||||||
print_str_ptr := 0
|
print_str_ptr := 0
|
||||||
if scrolllinenr[1] == 0
|
if scrolllinenr[1] == 0 'Chat-Fenster nicht gescrollt
|
||||||
' ios.printnl
|
ios.printnl
|
||||||
ios.printchar(10)
|
printStrWin(@print_str)
|
||||||
printStrWin(@print_str, 1)
|
|
||||||
printStrBuf(1)
|
printStrBuf(1)
|
||||||
quit
|
quit
|
||||||
else 'msgline muß umgebrochen werden
|
else 'msgline muß umgebrochen werden
|
||||||
|
@ -734,9 +791,8 @@ PRI handleChatStr(chanstr, nickstr, msgstr, me) | i, channicklen, msglineend, ch
|
||||||
print_str[print_str_ptr] := 0
|
print_str[print_str_ptr] := 0
|
||||||
print_str_ptr := 0
|
print_str_ptr := 0
|
||||||
if scrolllinenr[1] == 0
|
if scrolllinenr[1] == 0
|
||||||
' ios.printnl
|
ios.printnl
|
||||||
ios.printchar(10)
|
printStrWin(@print_str)
|
||||||
printStrWin(@print_str, 1)
|
|
||||||
printStrBuf(1)
|
printStrBuf(1)
|
||||||
else 'kein einziges Leerzeichen
|
else 'kein einziges Leerzeichen
|
||||||
repeat i from 0 to strsize(msgstr) 'in print_str schreiben
|
repeat i from 0 to strsize(msgstr) 'in print_str schreiben
|
||||||
|
@ -745,9 +801,8 @@ PRI handleChatStr(chanstr, nickstr, msgstr, me) | i, channicklen, msglineend, ch
|
||||||
print_str[print_str_ptr] := 0
|
print_str[print_str_ptr] := 0
|
||||||
print_str_ptr := 0
|
print_str_ptr := 0
|
||||||
if scrolllinenr[1] == 0
|
if scrolllinenr[1] == 0
|
||||||
' ios.printnl
|
ios.printnl
|
||||||
ios.printchar(10)
|
printStrWin(@print_str)
|
||||||
printStrWin(@print_str, 1)
|
|
||||||
printStrBuf(1)
|
printStrBuf(1)
|
||||||
if me == 1
|
if me == 1
|
||||||
print_str[print_str_ptr++] := COL_MYMSG 'nach Zeilenumbruch beginnt neue Zeile wieder mit Farbbyte
|
print_str[print_str_ptr++] := COL_MYMSG 'nach Zeilenumbruch beginnt neue Zeile wieder mit Farbbyte
|
||||||
|
@ -792,9 +847,8 @@ PRI handleCTCPStr(nickstr, msgstr) | i, msglineend
|
||||||
print_str[print_str_ptr] := 0
|
print_str[print_str_ptr] := 0
|
||||||
print_str_ptr := 0
|
print_str_ptr := 0
|
||||||
if scrolllinenr[1] == 0
|
if scrolllinenr[1] == 0
|
||||||
' ios.printnl
|
ios.printnl
|
||||||
ios.printchar(10)
|
printStrWin(@print_str)
|
||||||
printStrWin(@print_str, 1)
|
|
||||||
printStrBuf(1)
|
printStrBuf(1)
|
||||||
|
|
||||||
PRI handleStatusStr(statusstr, win, showtime) | i, statlineend
|
PRI handleStatusStr(statusstr, win, showtime) | i, statlineend
|
||||||
|
@ -829,18 +883,15 @@ PRI handleStatusStr(statusstr, win, showtime) | i, statlineend
|
||||||
print_str[print_str_ptr] := 0
|
print_str[print_str_ptr] := 0
|
||||||
print_str_ptr := 0
|
print_str_ptr := 0
|
||||||
if scrolllinenr[win] == 0
|
if scrolllinenr[win] == 0
|
||||||
' ios.printnl
|
ios.printnl
|
||||||
ios.printchar(10)
|
printStrWin(@print_str)
|
||||||
printStrWin(@print_str, win)
|
|
||||||
printStrBuf(win)
|
printStrBuf(win)
|
||||||
|
|
||||||
PRI printStrWin(printStr, win) | i
|
PRI printStrWin(printStr) | i
|
||||||
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
'' │ Chat-Zeile anzeigen │
|
'' │ Chat-Zeile in aktuellem Fenster zeigen │
|
||||||
'' └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
'' └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
|
|
||||||
ios.winset(win)
|
|
||||||
|
|
||||||
i := 0
|
i := 0
|
||||||
repeat
|
repeat
|
||||||
if byte[printStr][i] == 0 and byte[printStr][i+1] == 0 'nichts mehr anzuzeigen, Ende
|
if byte[printStr][i] == 0 and byte[printStr][i+1] == 0 'nichts mehr anzuzeigen, Ende
|
||||||
|
@ -849,6 +900,8 @@ PRI printStrWin(printStr, win) | i
|
||||||
ios.print(printStr + i) 'restlichen String anzeigen
|
ios.print(printStr + i) 'restlichen String anzeigen
|
||||||
i += strsize(printStr + i) + 1 'i zeigt auf nächsten Teilstring
|
i += strsize(printStr + i) + 1 'i zeigt auf nächsten Teilstring
|
||||||
|
|
||||||
|
ios.curpos1 'ohne diesen befehl wird, wenn letztes Zeichen ganz am Ende steht
|
||||||
|
'bei einem ios.printnl eine zusätzliche Leerzeile angezeigt
|
||||||
|
|
||||||
PRI printStrBuf(win) | lineAddr, lineMax, i
|
PRI printStrBuf(win) | lineAddr, lineMax, i
|
||||||
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
'' ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
|
@ -873,7 +926,7 @@ PRI printStrBuf(win) | lineAddr, lineMax, i
|
||||||
quit
|
quit
|
||||||
i++
|
i++
|
||||||
|
|
||||||
PRI printBufWin(lineAddr, win) | i
|
PRI printBufWin(lineAddr) | i
|
||||||
|
|
||||||
repeat i from 0 to buflinelen
|
repeat i from 0 to buflinelen
|
||||||
if (temp_str[i] := ios.ram_rdbyte(1,lineAddr++)) == 0
|
if (temp_str[i] := ios.ram_rdbyte(1,lineAddr++)) == 0
|
||||||
|
@ -881,7 +934,7 @@ PRI printBufWin(lineAddr, win) | i
|
||||||
if (temp_str[i-1] == 0) and (temp_str[i-2] == 0)
|
if (temp_str[i-1] == 0) and (temp_str[i-2] == 0)
|
||||||
quit
|
quit
|
||||||
|
|
||||||
printStrWin(@temp_str, win)
|
printStrWin(@temp_str)
|
||||||
|
|
||||||
PRI strToIpPort(ipstr, ip, port) | octet
|
PRI strToIpPort(ipstr, ip, port) | octet
|
||||||
' extracts the IP and PORT from a string
|
' extracts the IP and PORT from a string
|
||||||
|
|
Loading…
Reference in New Issue