联网推进36,部分功能已经可用
This commit is contained in:
@@ -188,7 +188,6 @@ end
|
||||
function scene.socketRead(mes)
|
||||
local cmd=mes:sub(1,1)
|
||||
local args=splitStr(mes:sub(2),":")
|
||||
print(cmd.." "..table.concat(args, " ; "))-------DEBUG PRINT
|
||||
if cmd=="J"or cmd=="L"then
|
||||
textBox:push{
|
||||
COLOR.lR,args[1],
|
||||
@@ -198,8 +197,10 @@ function scene.socketRead(mes)
|
||||
if cmd=="J"then
|
||||
if tostring(USER.id)~=args[2]then
|
||||
wsWrite("C"..dumpBasicConfig())
|
||||
ins(playerData,{name=args[1],id=args[2]})
|
||||
ins(playerData,{name=args[1],id=args[2],sid=tonumber(args[3])})
|
||||
resetGameData("qn",playerData)
|
||||
else
|
||||
ins(playerData,1,{name=args[1],id=args[2],sid=tonumber(args[3])})
|
||||
end
|
||||
else
|
||||
for i=1,#playerData do
|
||||
@@ -230,7 +231,7 @@ function scene.socketRead(mes)
|
||||
}
|
||||
elseif cmd=="C"then
|
||||
if tostring(USER.id)~=args[2]then
|
||||
local ENV=json.decode(data.decode("string","base64",args[3]))
|
||||
local ENV=json.decode(data.decode("string","base64",args[4]))
|
||||
for i=1,#playerData do
|
||||
if playerData[i].id==args[2]then
|
||||
playerData[i].conf=ENV
|
||||
@@ -238,7 +239,7 @@ function scene.socketRead(mes)
|
||||
return
|
||||
end
|
||||
end
|
||||
ins(playerData,{name=args[1],id=args[2],conf=ENV})
|
||||
ins(playerData,{name=args[1],id=args[2],sid=tonumber(args[3]),conf=ENV})
|
||||
resetGameData("qn",playerData)
|
||||
end
|
||||
elseif cmd=="S"then
|
||||
|
||||
@@ -191,14 +191,6 @@ function scene.update(dt)
|
||||
elseif key<=64 then--Release key
|
||||
VK[key-32].isDown=false
|
||||
P1:releaseKey(key-32)
|
||||
elseif key>1023 then--Receiving garbage
|
||||
local sid=key%256
|
||||
local amount=int(key/256)%256
|
||||
local time=int(key/4194304)%16384
|
||||
local line=int(key/274877906944)%65536
|
||||
local color=int(key/70368744177664)%256
|
||||
P1:receive(sid,amount,time,line,color)
|
||||
--TODO
|
||||
end
|
||||
_=_+2
|
||||
end
|
||||
@@ -206,8 +198,8 @@ function scene.update(dt)
|
||||
end
|
||||
|
||||
--Counting,include pre-das,directy RETURN,or restart counting
|
||||
if GAME.frame<180 then
|
||||
if GAME.frame==179 then
|
||||
if GAME.frame<=180 then
|
||||
if GAME.frame==180 then
|
||||
gameStart()
|
||||
elseif GAME.frame==60 or GAME.frame==120 then
|
||||
SFX.play("ready")
|
||||
|
||||
Reference in New Issue
Block a user