mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-10 06:30:41 +00:00
Small updates
This commit is contained in:
parent
6110f6e3a3
commit
d1d37fb13e
@ -196,7 +196,7 @@ else
|
|||||||
fin
|
fin
|
||||||
hellopkt:2 = version
|
hellopkt:2 = version
|
||||||
chatpkt:2 = version
|
chatpkt:2 = version
|
||||||
puts("CHAT cliet version:"); puti(version); putln
|
puts("CHAT client version:"); puti(version); putln
|
||||||
if !iNet:initIP()
|
if !iNet:initIP()
|
||||||
return -1
|
return -1
|
||||||
fin
|
fin
|
||||||
|
@ -10,10 +10,12 @@
|
|||||||
<file name="UPDATE" type="0xFE" aux="0x1000" mask="0x0080"/>
|
<file name="UPDATE" type="0xFE" aux="0x1000" mask="0x0080"/>
|
||||||
<file name="CHAT" type="0xFE" aux="0x1000" mask="0x0100"/>
|
<file name="CHAT" type="0xFE" aux="0x1000" mask="0x0100"/>
|
||||||
<file name="AUTORUN" type="0x06" aux="0x0000" mask="0x0200"/>
|
<file name="AUTORUN" type="0x06" aux="0x0000" mask="0x0200"/>
|
||||||
<file name="VERSION" type="0x06" aux="4" mask="0x0400"/>
|
<file name="VERSION" type="0x06" aux="6" mask="0x0400"/>
|
||||||
<current level="4"/>
|
<current level="6"/>
|
||||||
<version level="1" updates="0x0000"/>
|
<version level="1" updates="0x0000"/>
|
||||||
<version level="2" updates="0x0180"/>
|
<version level="2" updates="0x0180"/>
|
||||||
<version level="3" updates="0x0380"/>
|
<version level="3" updates="0x0380"/>
|
||||||
<version level="4" updates="0x0408"/>
|
<version level="4" updates="0x0408"/>
|
||||||
|
<version level="5" updates="0x0440"/>
|
||||||
|
<version level="6" updates="0x0580"/>
|
||||||
</chat>
|
</chat>
|
||||||
|
@ -3,7 +3,7 @@ import sys, struct, socket, select
|
|||||||
|
|
||||||
server = ("localhost", 0x6502)
|
server = ("localhost", 0x6502)
|
||||||
myhandle = "Python"
|
myhandle = "Python"
|
||||||
VERSION = 4
|
VERSION = 6
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
server = (sys.argv[1], 0x6502)
|
server = (sys.argv[1], 0x6502)
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -13,13 +13,12 @@ chat_vers = []
|
|||||||
def client_add(address, port, handle):
|
def client_add(address, port, handle):
|
||||||
global client_list
|
global client_list
|
||||||
client_list[address] = (port, handle)
|
client_list[address] = (port, handle)
|
||||||
|
print "Welcome, ", handle, "@", address, ":", port
|
||||||
|
|
||||||
def broadcast(handle, msg):
|
def broadcast(handle, msg):
|
||||||
global client_list
|
global client_list
|
||||||
if msg:
|
if msg:
|
||||||
print handle, ": ", msg
|
print handle, ": ", msg
|
||||||
else:
|
|
||||||
print "Welcome, ", handle
|
|
||||||
bcastmsg = struct.pack('<HHHBc8p32p', 0x7EDA, VERSION, 0, 0xCA, 'C', handle, msg)
|
bcastmsg = struct.pack('<HHHBc8p32p', 0x7EDA, VERSION, 0, 0xCA, 'C', handle, msg)
|
||||||
for c in client_list:
|
for c in client_list:
|
||||||
client = (c, client_list[c][0])
|
client = (c, client_list[c][0])
|
||||||
|
@ -81,9 +81,9 @@ byte[4] ones = $FF, $FF, $FF, $FF
|
|||||||
//
|
//
|
||||||
// Default static net IP addresses
|
// Default static net IP addresses
|
||||||
//
|
//
|
||||||
byte localdns = 0,0,0,0
|
byte localdns = 8,8,8,8
|
||||||
byte localgw = 192,168,123,1
|
byte localgw = 192,168,1,1
|
||||||
byte localip = 192,168,123,10
|
byte localip = 192,168,1,10
|
||||||
byte localnet = 255,255,255,0
|
byte localnet = 255,255,255,0
|
||||||
//
|
//
|
||||||
// Pre-configured DHCP packet
|
// Pre-configured DHCP packet
|
||||||
@ -252,7 +252,7 @@ repeat
|
|||||||
optsSRV = 255
|
optsSRV = 255
|
||||||
DHCP.dhcp_secs.1 = retry
|
DHCP.dhcp_secs.1 = retry
|
||||||
iNet:sendUDP(portDHCP, 0, DHCP_SERVER_PORT, @DHCP, @optsSRV - @DHCP + 1)
|
iNet:sendUDP(portDHCP, 0, DHCP_SERVER_PORT, @DHCP, @optsSRV - @DHCP + 1)
|
||||||
for timeout = 1 to 1000
|
for timeout = 0 to 1000
|
||||||
iNet:serviceIP()
|
iNet:serviceIP()
|
||||||
if optsOP.2 == DHCP_ACK
|
if optsOP.2 == DHCP_ACK
|
||||||
break
|
break
|
||||||
@ -263,8 +263,6 @@ until retry > 4 or optsOP.2 == DHCP_ACK
|
|||||||
iNet:closeUDP(portDHCP)
|
iNet:closeUDP(portDHCP)
|
||||||
iNet:setInterfaceIP(@localip, @localnet, @localgw)
|
iNet:setInterfaceIP(@localip, @localnet, @localgw)
|
||||||
puts(@boundstr);putip(@localip);putc('/');putip(@localnet);putln
|
puts(@boundstr);putip(@localip);putc('/');putip(@localnet);putln
|
||||||
if localdns:0 | localdns:2
|
iNet:setDNS(@localdns)
|
||||||
iNet:setDNS(@localdns)
|
puts(@dnsstr);putip(@localdns);putln
|
||||||
puts(@dnsstr);putip(@localdns);putln
|
|
||||||
fin
|
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user