mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-02-09 19:31:13 +00:00
CHAT updates
This commit is contained in:
parent
098d777855
commit
4a0597884b
Binary file not shown.
@ -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)
|
||||
|
@ -10,8 +10,10 @@
|
||||
<file name="UPDATE" type="0xFE" aux="0x1000" mask="0x0080"/>
|
||||
<file name="CHAT" type="0xFE" aux="0x1000" mask="0x0100"/>
|
||||
<file name="AUTORUN" type="0x06" aux="0x0000" mask="0x0200"/>
|
||||
<current level="3"/>
|
||||
<file name="VERSION" type="0x06" aux="4" mask="0x0400"/>
|
||||
<current level="4"/>
|
||||
<version level="1" updates="0x0000"/>
|
||||
<version level="2" updates="0x0180"/>
|
||||
<version level="3" updates="0x0380"/>
|
||||
<version level="4" updates="0x0408"/>
|
||||
</chat>
|
||||
|
@ -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)
|
||||
|
Binary file not shown.
Binary file not shown.
0
src/chatsrc/chatserver/clientfiles/VERSION
Normal file
0
src/chatsrc/chatserver/clientfiles/VERSION
Normal file
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user