diff --git a/src/chatsrc/CHAT.PO b/src/chatsrc/CHAT.PO
index c38aa56..74d4d60 100644
Binary files a/src/chatsrc/CHAT.PO and b/src/chatsrc/CHAT.PO differ
diff --git a/src/chatsrc/chat.pla b/src/chatsrc/chat.pla
index a04dee1..28892a2 100644
--- a/src/chatsrc/chat.pla
+++ b/src/chatsrc/chat.pla
@@ -32,18 +32,19 @@ import inet
end
end
-const VERSION = 3
const txtline = $07D0
const inbuf = $0200
const instr = $01FF
byte[4] serverIP
+word[] fileinfo
+word version
word port, timeout
word update_list, update_len
byte response
-byte hellopkt = $DA, $7E, VERSION, VERSION >> 8, $00, $00, $A2, 'H'
+byte hellopkt = $DA, $7E, 0, 0, $00, $00, $A2, 'H'
byte[9] handle = ""
-byte chatpkt = $DA, $7E, VERSION, VERSION >> 8, $00, $01, $A2, 'C'
+byte chatpkt = $DA, $7E, 0, 0, $00, $01, $A2, 'C'
byte[33] msg
//
// DEBUG
@@ -113,6 +114,9 @@ def recvUDP(ipsrc, portsrc, data, len, param)
break;
is 'E'
puts("Server error!"); putln
+ break
+ otherwise
+ puts("Unkwown server packet:"); putc(response)
wend
end
@@ -178,6 +182,21 @@ def kbstr
until inlen == $FF
return instr
end
+
+//
+// CHAT session
+//
+fileinfo = heapmark()
+fileinfo->0 = $0A
+fileinfo=>1 = "VERSION"
+if !syscall($C4, fileinfo)
+ version = fileinfo=>5 // AUX type has version #
+else
+ version = 1
+fin
+hellopkt:2 = version
+chatpkt:2 = version
+puts("CHAT cliet version:"); puti(version); putln
if !iNet:initIP()
return -1
fin
@@ -187,7 +206,7 @@ repeat
if ^instr
if iNet:resolveIP(instr, @serverIP)
repeat
- puts("Enter chat handle (7 characters or less)\n")
+ puts("Enter chat handle (7 characters or less)")
gets(':'+$80)
until ^instr > 0 and ^instr < 8
memcpy(@handle, instr, ^instr + 1)
diff --git a/src/chatsrc/chatserver/chat-version.xml b/src/chatsrc/chatserver/chat-version.xml
index 94acfd7..249eb1e 100644
--- a/src/chatsrc/chatserver/chat-version.xml
+++ b/src/chatsrc/chatserver/chat-version.xml
@@ -10,8 +10,10 @@
-
+
+
+
diff --git a/src/chatsrc/chatserver/client.py b/src/chatsrc/chatserver/client.py
index 0facd64..5383451 100755
--- a/src/chatsrc/chatserver/client.py
+++ b/src/chatsrc/chatserver/client.py
@@ -3,7 +3,7 @@ import sys, struct, socket, select
server = ("localhost", 0x6502)
myhandle = "Python"
-VERSION = 3
+VERSION = 4
if len(sys.argv) > 1:
server = (sys.argv[1], 0x6502)
diff --git a/src/chatsrc/chatserver/clientfiles/CHAT b/src/chatsrc/chatserver/clientfiles/CHAT
index a0e6e4c..349b21c 100644
Binary files a/src/chatsrc/chatserver/clientfiles/CHAT and b/src/chatsrc/chatserver/clientfiles/CHAT differ
diff --git a/src/chatsrc/chatserver/clientfiles/UTHERNET2 b/src/chatsrc/chatserver/clientfiles/UTHERNET2
index 6ab44d6..0efd94c 100644
Binary files a/src/chatsrc/chatserver/clientfiles/UTHERNET2 and b/src/chatsrc/chatserver/clientfiles/UTHERNET2 differ
diff --git a/src/chatsrc/chatserver/clientfiles/VERSION b/src/chatsrc/chatserver/clientfiles/VERSION
new file mode 100644
index 0000000..e69de29
diff --git a/src/libsrc/uthernet2.pla b/src/libsrc/uthernet2.pla
index 1baffff..c6316e8 100644
--- a/src/libsrc/uthernet2.pla
+++ b/src/libsrc/uthernet2.pla
@@ -722,6 +722,9 @@ def wizServiceIP
if ir
wiz = @wizChannel
for i = 0 to 3
+ //
+ // Socket activity
+ //
if ir & (1 << i)
wizregs = wiz=>channel_regs
wizdata = wiz=>channel_rxmem
@@ -811,11 +814,29 @@ def wizServiceIP
pokereg(wiz=>channel_regs + WIZ_SnCR, $10) // CLOSE
wend
fin
- wend
+ wend
fin
wiz = wiz + t_channel
next
- fin
+ if ir & $80
+ //
+ // IP conflict
+ //
+ pokereg(WIZ_IR, $80)
+ fin
+ if ir & $40
+ //
+ // Destination unreachable
+ //
+ pokereg(WIZ_IR, $40)
+ fin
+ if ir & $20
+ //
+ // PPOE connection close
+ //
+ pokereg(WIZ_IR, $20)
+ fin
+ fin
end
//
// Set the local IP addresses