Compare commits

...

23 Commits

Author SHA1 Message Date
MrZ626
b7ee5e771e 完善0.14.2更新日志 2021-04-11 13:55:36 +08:00
MrZ626
4967782464 减少一个ws库debug开启后可能输出的信息 2021-04-11 13:37:23 +08:00
MrZ626
29582469d2 成功登录后不再尝试清除登录界面的输入框 2021-04-11 13:36:57 +08:00
MrZ626
18c1c9c69a 重新启用注册菜单 2021-04-11 13:36:04 +08:00
MrZ626
ed3521cc53 添加0.14.2版本号和版本说明 2021-04-11 02:23:14 +08:00
MrZ626
4795d77e84 整理代码(远程玩家录像播放) 2021-04-11 02:19:02 +08:00
MrZ626
e0c594c402 攻击特效从全局改为玩家设置项一部分 2021-04-11 02:18:01 +08:00
MrZ626
5f02042124 微调联网游戏房间内ui 2021-04-11 01:57:03 +08:00
MrZ626
4b09023b21 修改词典的techmino词条,加上联网功能说明 2021-04-11 01:52:45 +08:00
MrZ626
320197198b 整理代码 2021-04-11 01:50:52 +08:00
MrZ626
d31423d91e 删除马拉松模式忘了删的测试代码 2021-04-10 23:00:23 +08:00
MrZ626
23bb6ac486 对战传输的玩家配置信息格式简化和修复一个问题(未使用所以从未触发) 2021-04-10 22:24:38 +08:00
MrZ626
7da178c5ec 减少联网玩家传输的设置项 2021-04-10 22:14:19 +08:00
MrZ626
1fe9d2598b 联网推进(修复尝试保存用户信息时错误) 2021-04-10 21:07:26 +08:00
MrZ626
9f56948f47 移除进入已经开始游戏的房间时弹出的提示 2021-04-10 18:33:42 +08:00
MrZ626
4e2822eb0a 修复创建房间失败问题(打错房间类型),微调房间内ui 2021-04-10 17:05:45 +08:00
MrZ626
54697c44de VERSION改为全局table并包含版本名称 2021-04-10 16:56:27 +08:00
MrZ626
b757055525 点击联网游戏时无网络的提示更加清晰 2021-04-10 16:51:21 +08:00
MrZ626
906211f0f5 更改版本号为0.14.1 2021-04-10 16:34:38 +08:00
MrZ626
05808e4587 整理代码,准备缓存用户信息相关功能 2021-04-10 16:18:47 +08:00
MrZ626
0b685cc9a2 更换新的服务器域名 2021-04-10 15:40:28 +08:00
MrZ626
a9985fec2c 增加联网对战模式的垃圾行上涨速度,添加0.14.1更新说明 2021-04-10 02:57:45 +08:00
MrZ626
315237d0fc 限制客户端一般只能开单挑房,电脑用户可以开多人房,特殊电脑用户可以开更大的房 2021-04-10 02:48:51 +08:00
31 changed files with 187 additions and 146 deletions

View File

@@ -390,7 +390,7 @@ function love.errorhandler(msg)
--Write messages to log file
love.filesystem.append("conf/error.log",
os.date("%Y/%m/%d %A %H:%M:%S\n")..
#ERRDATA.." crash(es) "..SYSTEM.."-"..VERSION_NAME.." scene: "..scn.."\n"..
#ERRDATA.." crash(es) "..SYSTEM.."-"..VERSION.string.." scene: "..scn.."\n"..
table.concat(err,"\n",1,c-2).."\n\n"
)
@@ -432,7 +432,7 @@ function love.errorhandler(msg)
setFont(100)gc_print(":(",100,0,0,1.2)
setFont(40)gc.printf(errorMsg,100,160,SCR.w0-100)
setFont(20)
gc_print(SYSTEM.."-"..VERSION_NAME.." scene:"..(SCN and SCN.cur or"NULL"),100,660)
gc_print(SYSTEM.."-"..VERSION.string.." scene:"..(SCN and SCN.cur or"NULL"),100,660)
gc.printf(err[1],100,360,1260-100)
gc_print("TRACEBACK",100,450)
for i=4,#err-2 do

View File

@@ -4,7 +4,7 @@ local ins,rem=table.insert,table.remove
local debugMesList={}
local debugMesHistory={
"Version: "..VERSION_NAME,
"Version: "..VERSION.string,
os.date("Launched at %Y/%m/%d %H:%M"),
}
local LOG={}

View File

@@ -1,6 +1,8 @@
-- local host="192.168.114.102"
-- local host="127.0.0.1"
local host="hdustea.3322.org"
-- local host="192.168.114.102"
-- local host="krakens.tpddns.cn"
-- local host="hdustea.3322.org"
local host="game.techmino.org"
local port="10026"
local path="/tech/socket/v1"
@@ -149,7 +151,6 @@ while true do--Running
--Receive data
local s,_,p=SOCK:receive(length)
if s then
]]..(debug==1 and""or"--")..[[print(("%s[%d]:%s"):format(threadName,length,s))
res=s
elseif p then--UNF head
]]..(debug==1 and""or"--")..[[print(("%s[%d/%d]:%s"):format(threadName,#p,length,p))

View File

@@ -1,5 +1,8 @@
VERSION_CODE=1400
VERSION_NAME="Alpha V0.14.0"
VERSION={
code=1402,
string="Alpha V0.14.2",
name="破晓 Dawn",
}
function love.conf(t)
t.identity="Techmino"--Saving folder
t.version="11.1"
@@ -12,7 +15,7 @@ function love.conf(t)
end
local W=t.window
W.title="Techmino "..VERSION_NAME
W.title="Techmino "..VERSION.string
W.icon="media/image/icon.png"
W.width,W.height=1280,720
W.minwidth,W.minheight=640,360

View File

@@ -34,7 +34,7 @@ love.keyboard.setTextInput(false)
love.mouse.setVisible(false)
--Create directories
for _,v in next,{"conf","record","replay"}do
for _,v in next,{"conf","record","replay","cache"}do
local info=fs.getInfo(v)
if not info then
fs.createDirectory(v)
@@ -327,9 +327,9 @@ do
end
USER.username=nil
if STAT.version~=VERSION_CODE then
if STAT.version~=VERSION.code then
newVersionLaunch=true
STAT.version=VERSION_CODE
STAT.version=VERSION.code
FILE.save(STAT,"conf/data","q")
end

View File

@@ -661,16 +661,21 @@ do--function dumpBasicConfig()
"skin","face",
--Graphic
"block","ghost","center","smooth","grid","bagLine",
"lockFX","dropFX","moveFX","clearFX","splashFX","shakeFX","atkFX",
"text","score","warn","highCam","nextPos",
"block","ghost","center","bagLine",
"dropFX","moveFX","shakeFX",
"text","highCam","nextPos",
--Unnecessary graphic
-- "grid","smooth",
-- "lockFX","clearFX","splashFX","atkFX",
-- "score",
}
function dumpBasicConfig()
local S={}
for _,key in next,gameSetting do
S[key]=SETTING[key]
end
return data.encode("string","base64",JSON.encode(S))
return JSON.encode(S)
end
end
do--function resetGameData(args)
@@ -956,7 +961,7 @@ do--function saveRecording()
local fileHead=
os.date("%Y/%m/%d %A %H:%M:%S\n")..
GAME.curModeName.."\n"..
VERSION_NAME.."\n"..
VERSION.string.."\n"..
(USER.username or"Player")
local fileBody=
GAME.seed.."\n"..

View File

@@ -305,7 +305,7 @@ if S then--Statistics
STAT=S
else
STAT={
version=VERSION_CODE,
version=VERSION.code,
run=0,game=0,time=0,frame=0,
key=0,rotate=0,hold=0,
extraPiece=0,finesseRate=0,

View File

@@ -148,7 +148,7 @@ return{
{"Techmino",
"techmino",
"game",
"*Windows, MacOS, Android | Single player*\nA game with many modes and loads of customization. Low input delay, decent controls.",
"*Windows, MacOS, Android | Single player and multiplyer*\nA game with many modes and loads of customization. Low input delay, decent controls.",
},
{"Cultris II",
"c2 cultris2 cultrisii",
@@ -924,7 +924,7 @@ return{
{"gggf",
"gggf kissne",
"name",
"Tetris Research community member.\nPersonal bests: Sprint 22.831 seconds (25.483 seconds on mobile), MPH Sprint 56 seconds, U rank on Tetr.io\nOne of the top players of 20G in China, achieved almost every achievement in TGM3.",
"Tetris Research community member.\nPersonal bests: Sprint 22.831 seconds (25.483 seconds on mobile), MPH Sprint 56 seconds, X rank on Tetr.io\nOne of the top players of 20G in China, achieved almost every achievement in TGM3.",
"https://space.bilibili.com/287769888",
},
{"xb",

View File

@@ -153,7 +153,7 @@ return{
{"Techmino",
"techmino tieke",
"game",
"一个win/android/linux/macOS方块只有单机,但是模式和各种设置都很齐全,适合有一定基础的新人,输入延迟很小,手感很好",
"一个win/android/linux/macOS方块单机模式和各种设置都很齐全,联机正在逐渐开发中,输入延迟很小,手感很好",
},
{"Cultris II",
"c2 cultris2 cultrisii",
@@ -603,7 +603,7 @@ return{
{"输入延迟",
"输入延迟 input delay",
"term",
"用任何设备玩任何游戏时,所有的操作(按键盘,点鼠标等)都会晚一点点(很短,几毫秒到几十毫秒)才达游戏如果过长就会很影响游戏手感作用效果类似于你拿qq远程控制打fps游戏\ntop、te等游戏比较明显\n这个延迟一般由硬件性能,硬件状态影响,通常来说不可设置,开启性能模式(或者关闭节能模式)可能会好一点",
"用任何设备玩任何游戏时,所有的操作(按键盘,点鼠标等)都会晚一点点(很短,几毫秒到几十毫秒)才达游戏如果过长就会很影响游戏手感作用效果类似于你拿qq远程控制打fps游戏\ntop、te等游戏比较明显\n这个延迟一般由硬件性能,硬件状态影响,通常来说不可设置,开启性能模式(或者关闭节能模式)可能会好一点",
},
{"Cold Clear",
"cc coldclear",
@@ -934,7 +934,7 @@ return{
{"gggf",
"gggf kissne t127",
"name",
"【研究群】「T127」\n40行22.831秒(手机25.483)MPH40行56秒tetr.io段位Utop数据约60L85A\n20G规则国内一流玩家拿到了TGM3几乎全部的最终成就(全世界都没几个)\n其他名称:小柒 kissne 127\n还是车车人,几个正作成绩:永EX NM 1B FS 风L NM",
"【研究群】「T127」\n40行22.831秒(手机25.483)MPH40行56秒tetr.io段位X数据约60L95A\n20G规则国内一流玩家拿到了TGM3几乎全部的最终成就(全世界都没几个)\n其他名称:小柒 kissne 127\n还是车车人,几个正作成绩:永EX NM 1B FS 风L NM",
"https://space.bilibili.com/287769888",
},
{"xb",

View File

@@ -73,6 +73,7 @@ return{
getVersionFail="Update detection failed",
oldVersion="Version $1 is now available!",
needUpdate="Newer version required!",
noInternet="Not connected to the network",
notFinished="Coming soon!",
jsonError="JSON error",
@@ -600,6 +601,7 @@ return{
email="Email Address",
password="Password",
password2="Re-enter Password",
register="Register",
},
account={
title="Account",

View File

@@ -74,6 +74,7 @@ return{
getVersionFail="Echec d'obtention de la dernière version",
oldVersion="La version $1 est disponible !",
-- needUpdate="Newer version required!",
-- noInternet="Not connected to the network",
-- notFinished="Coming soon!",
jsonError="Erreur json",
@@ -511,6 +512,7 @@ return{
email="E-mail",
password="Mot de passe",
password2="Confirmer le mot de passe",
register="Enregistrement",
},
account={
title="Compte",

View File

@@ -73,6 +73,7 @@ return{
getVersionFail="Falha ao detectar uma versão nova",
oldVersion="Versão $1 esta disponível agora!",
-- needUpdate="Newer version required!",
-- noInternet="Not connected to the network",
-- notFinished="Coming soon!",
jsonError="Json error",
@@ -594,11 +595,12 @@ return{
},
register={
title="Registrar",
login="Registrar",
login="Log in",
username="Nome De Usuário",
email="Endereço De Email",
password="Senha",
password2="Entre Senha Novamente",
register="Registrar",
},
account={
title="Conta",

View File

@@ -74,6 +74,7 @@ return{
getVersionFail="Error al buscar nuevas versiones.",
oldVersion="¡Está disponible la nueva versión $1!",
needUpdate="¡Nueva versión requerida!",
-- noInternet="Not connected to the network",
notFinished="Próximamente",
jsonError="Error en Json",
@@ -514,6 +515,7 @@ return{
email="Correo Elec.",
password="Contraseña",
password2="Repetir Contr.",
register="Registrarse",
},
account={
title="Cuenta",

View File

@@ -444,6 +444,7 @@ return{
email="@",
password="*",
password2="*",
register="Sign up",
},
account={
title="@_@",

View File

@@ -113,7 +113,7 @@ return{
qq="QQ对线",
},
register={
password2="觉得应该填啥",
password2="该填啥",
},
sound={
title="音效室",

View File

@@ -72,7 +72,8 @@ return{
getNoticeFail="拉取公告失败",
getVersionFail="检测新版本失败",
oldVersion="最新版本$1可以下载了!",
needUpdate="此功能需要更新游戏!",
needUpdate="更新游戏!",
noInternet="还未连接到网络",
notFinished="暂未完成,敬请期待!",
jsonError="json错误",
@@ -598,6 +599,7 @@ return{
email="邮箱",
password="密码",
password2="确认密码",
register="注册",
},
account={
title="账户",

View File

@@ -8,9 +8,6 @@ return{
drop=60,wait=8,fall=20,
task=function(P)P.modeData.target=10 end,
dropPiece=function(P)
if P.stat.row<180 then
P.stat.row=180
end
if P.stat.row>=P.modeData.target then
if P.modeData.target==200 then
P:win("finish")

View File

@@ -3,6 +3,7 @@ return{
env={
drop=30,
freshLimit=15,
pushSpeed=5,
garbageSpeed=2,
noMod=true,
bg="space",

View File

@@ -2,6 +2,7 @@ local data=love.data
local ins,rem=table.insert,table.remove
local WS,TIME=WS,TIME
local NET={
connected=false,
allow_online=false,
roomList={},
accessToken=false,
@@ -120,6 +121,18 @@ function NET.wsclose_stream()
end
--Account
function NET.register(username,email,password)
if NET.lock("register")then
WS.send("app",JSON.encode{
action=2,
data={
username=username,
email=email,
password=password,
}
})
end
end
function NET.pong(wsName,message)
WS.send(wsName,message,"pong")
end
@@ -137,23 +150,20 @@ function NET.getUserInfo(id,ifDetail)
},
})
end
function NET.storeUserInfo(res)
local user=USERS[res.uid]
function NET.storeUserInfo(d)
local user=USERS[d.uid]
if not user then
user={}
user.email=res.email
user.name=res.username
USERS[res.uid]=user
else
user.email=res.email
user.name=res.username
if not user.motto then user.motto=res.motto end
if not user.avatar then user.avatar=res.avatar end
USERS[d.uid]=user
end
user.uid=d.uid
user.username=d.username
user.motto=d.motto
user.avatar=d.avatar
--Get own name
if res.uid==USER.uid then
USER.username=res.username
if d.uid==USER.uid then
USER.username=d.username
FILE.save(USER,"conf/user","q")
end
@@ -173,13 +183,13 @@ function NET.fetchRoom()
})
end
end
function NET.createRoom()
function NET.createRoom(roomType,name)
if NET.lock("enterRoom",3)then
WS.send("play",JSON.encode{
action=1,
data={
type="classic",
name=(USER.username or"???").."'s room",
type=roomType,
name=name,
password=nil,
config=dumpBasicConfig(),
}
@@ -247,13 +257,21 @@ function NET.updateWS_app()
else
local res=_parse(message)
if res then
if VERSION_CODE>=res.lowest then
NET.allow_online=true
if res.type=="Connect"then
NET.connected=true
NET.allow_online=VERSION.code>=res.lowest
if VERSION.code<res.newestCode then
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky)
end
LOG.print(res.notice,300,COLOR.sky)
elseif res.action==0 then--Get new version info
--?
elseif res.action==1 then--Get notice
--?
elseif res.action==2 then--Register
LOG.print(res.data.message,300,COLOR.sky)
NET.unlock("register")
end
if VERSION_CODE<res.newestCode then
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky)
end
LOG.print(res.notice,300,COLOR.sky)
else
WS.alert("app")
end
@@ -287,8 +305,6 @@ function NET.updateWS_user()
if res.uid then
USER.uid=res.uid
USER.authToken=res.authToken
WIDGET.active.email:clear()
WIDGET.active.password:clear()
FILE.save(USER,"conf/user","q")
SCN.back()
end
@@ -303,7 +319,7 @@ function NET.updateWS_user()
NET.wsconn_play()
NET.unlock("accessToken")
elseif res.action==1 then--Get userInfo
NET.storeUserInfo(res)
NET.storeUserInfo(res.data)
end
else
WS.alert("user")
@@ -349,7 +365,7 @@ function NET.updateWS_play()
username=p.username,
sid=p.sid,
ready=p.ready,
conf=p.config,
config=p.config,
})
end
end
@@ -362,9 +378,9 @@ function NET.updateWS_play()
username=d.username,
sid=d.sid,
ready=d.ready,
conf=d.config,
config=d.config,
})
SCN.socketRead("Join",res.data)
SCN.socketRead("Join",d)
end
elseif res.action==3 then--Player leave
if not d.uid then
@@ -390,15 +406,15 @@ function NET.updateWS_play()
break
end
end
SCN.socketRead("Leave",res.data)
SCN.socketRead("Leave",d)
end
elseif res.action==4 then--Player talk
SCN.socketRead("Talk",res.data)
SCN.socketRead("Talk",d)
elseif res.action==5 then--Player change settings
if tostring(USER.uid)~=d.uid then
for i=1,#PLY_NET do
if PLY_NET[i].uid==d.uid then
PLY_NET[i].conf=d.config
PLY_NET[i].config=d.config
PLY_NET[i].p:setConf(d.config)
return
end
@@ -426,7 +442,7 @@ function NET.updateWS_play()
NET.wsconn_stream()
TASK.new(NET.updateWS_stream)
elseif res.action==9 then--Game finished
SCN.socketRead("Finish",res.data)
SCN.socketRead("Finish",d)
NET.wsclose_stream()
end
else
@@ -453,10 +469,11 @@ function NET.updateWS_stream()
else
local res=_parse(message)
if res then
local d=res.data
if res.type=="Connect"then
NET.unlock("wsc_stream")
elseif res.action==0 then--Game start
SCN.socketRead("Go",res.data)
SCN.socketRead("Go",d)
elseif res.action==1 then--Game finished
--?
elseif res.action==2 then--Player join
@@ -466,7 +483,7 @@ function NET.updateWS_stream()
elseif res.action==4 then--Player died
--?
elseif res.action==5 then--Receive stream
SCN.socketRead("Stream",res.data)
SCN.socketRead("Stream",d)
end
else
WS.alert("stream")

View File

@@ -234,11 +234,9 @@ local function loadGameEnv(P)--Load gameEnv
end
end
local function loadRemoteEnv(P,confStr)--Load gameEnv
local _,conf=pcall(love.data.decode,"string","base64",confStr)
if _ then
conf=JSON.decode(conf)
else
conf={}
confStr=JSON.decode(confStr)
if not confStr then
confStr={}
LOG.print("Bad conf from "..P.username.."#"..P.uid)
end
@@ -249,8 +247,8 @@ local function loadRemoteEnv(P,confStr)--Load gameEnv
for k,v in next,gameEnv0 do
if GAME.modeEnv[k]~=nil then
v=GAME.modeEnv[k] --Mode setting
elseif conf[k]~=nil then
v=conf[k] --Game setting
elseif confStr[k]~=nil then
v=confStr[k] --Game setting
elseif SETTING[k]~=nil then
v=SETTING[k] --Global setting
end
@@ -332,6 +330,7 @@ local function applyGameEnv(P)--Finish gameEnv processing
if ENV.clearFX==0 then ENV.clearFX=false end
if ENV.splashFX==0 then ENV.splashFX=false end
if ENV.shakeFX==0 then ENV.shakeFX=false end
if ENV.atkFX==0 then ENV.atkFX=false end
end
if ENV.ghost==0 then ENV.ghost=false end
if ENV.center==0 then ENV.center=false end
@@ -385,7 +384,7 @@ function PLY.newRemotePlayer(id,mini,data)
P.uid=data.uid
P.username=data.username
P.sid=data.sid
loadRemoteEnv(P,data.conf)
loadRemoteEnv(P,data.config)
applyGameEnv(P)
end

View File

@@ -97,7 +97,7 @@ end
function Player:createClearingFX(y,spd)
ins(self.clearFX,{y,0,spd})
end
function Player:createBeam(R,send,color)
function Player:createBeam(R,send,power,color)
local x1,y1,x2,y2
if self.mini then x1,y1=self.centerX,self.centerY
else x1,y1=self.x+(30*(self.curX+self.cur.sc[2])-30+15+150)*self.size,self.y+(600-30*(self.curY+self.cur.sc[1])+15)*self.size
@@ -110,7 +110,7 @@ function Player:createBeam(R,send,color)
local r,g,b=c[1]*2,c[2]*2,c[3]*2
local a=GAME.modeEnv.royaleMode and not(self.type=="human"or R.type=="human")and .2 or 1
SYSFX.newAttack(1-SETTING.atkFX*.1,x1,y1,x2,y2,int(send^.7*(4+SETTING.atkFX)),r,g,b,a*(SETTING.atkFX+2)*.0626)
SYSFX.newAttack(1-power*.1,x1,y1,x2,y2,int(send^.7*(4+power)),r,g,b,a*(power+2)*.0626)
end
--------------------------</FX>--------------------------
@@ -214,9 +214,9 @@ function Player:setRS(RSname)
end
function Player:setConf(confStr)
local _,conf=pcall(love.data.decode,"string","base64",confStr)
if _ then
for k,v in next,conf do
confStr=JSON.decode(confStr)
if confStr then
for k,v in next,confStr do
if not GAME.modeEnv[k]then
self.gameEnv[k]=v
end
@@ -1322,8 +1322,8 @@ do--Player.drop(self)--Place piece
if M>0 then
for i=1,M do
self:attack(self.atker[i],send,sendTime,generateLine(self:RND(10)))
if SETTING.atkFX>0 then
self:createBeam(self.atker[i],send,C.color)
if ENV.atkFX then
self:createBeam(self.atker[i],send,ENV.atkFX,C.color)
end
end
else
@@ -1338,8 +1338,8 @@ do--Player.drop(self)--Place piece
end
if T then
self:attack(T,send,sendTime,generateLine(self:RND(10)))
if SETTING.atkFX>0 then
self:createBeam(T,send,C.color)
if ENV.atkFX then
self:createBeam(T,send,ENV.atkFX,C.color)
end
end
end

View File

@@ -373,13 +373,13 @@ function update.dead(P,dt)
end
function update.remote_alive(P,dt)
local frmStep=GAME.frame-P.stat.frame
frmStep=
for _=1,
frmStep<20 and 1 or
frmStep<45 and rnd(2)or
frmStep<90 and 2 or
frmStep<180 and rnd(2,3) or
3
repeat
do
local eventTime=P.stream[P.streamProgress]
if eventTime then--Normal state, event forward
if P.stat.frame==eventTime then--Event time, execute action, read next so don't update immediately
@@ -394,23 +394,21 @@ function update.remote_alive(P,dt)
local amount=int(event/0x100)%0x100
local time=int(event/0x10000)%0x10000
local line=int(event/0x100000000)%0x10000
local L=PLY_ALIVE
for i=1,#L do
if L[i].sid==sid then
P:attack(L[i],amount,time,line,true)
if SETTING.atkFX>0 then
P:createBeam(L[i],amount,P.cur.color)
for _,p in next,PLY_ALIVE do
if p.sid==sid then
P:attack(p,amount,time,line,true)
if P.gameEnv.atkFX then
P:createBeam(p,amount,P.gameEnv.atkFX,P.cur.color)
end
break
end
end
elseif event>0x1000000000000 then--Receiving lines
local L=PLY_ALIVE
local sid=event%0x100
for i=1,#L do
if L[i].sid==sid then
for _,p in next,PLY_ALIVE do
if p.sid==sid then
P:receive(
L[i],
p,
int(event/0x100)%0x100,--amount
int(event/0x10000)%0x10000,--time
int(event/0x100000000)%0x10000--line
@@ -422,11 +420,10 @@ function update.remote_alive(P,dt)
P.streamProgress=P.streamProgress+2
else--No event now, run one frame
update.alive(P,dt)
frmStep=frmStep-1
end
else--Pause state, no actions, quit loop
break
end
until frmStep<=0
end
end
return update

View File

@@ -537,7 +537,7 @@ local function log_user(str)
log(noLog and"CHEATER."or tostring(str))
end
local userG={
_VERSION=VERSION_CODE,
_VERSION=VERSION.code,
assert=assert,error=error,
tonumber=tonumber,tostring=tostring,
select=select,next=next,

View File

@@ -9,7 +9,7 @@ local scene={}
function scene.sceneInit()
BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926}
stateInfo=SYSTEM.."-"..VERSION_NAME.." scene:"..ERRDATA[#ERRDATA].scene
stateInfo=SYSTEM.."-"..VERSION.string.." scene:"..ERRDATA[#ERRDATA].scene
errorText=LOADED and text.errorMsg or"An error has occurred during loading.\nError info has been created, and you can send it to the author."
errorShot,errorInfo=ERRDATA[#ERRDATA].shot,ERRDATA[#ERRDATA].mes
if SETTING then SFX.fplay("error",SETTING.voc*.8 or 0)end

View File

@@ -13,7 +13,7 @@ local scene={}
scene.widgetList={
WIDGET.newText{name="title", x=80, y=50,font=70,align="L"},
-- WIDGET.newButton{name="register",x=1140, y=100,w=170,h=80,color="green",code=function()SCN.swapTo("register","swipeR")end},
WIDGET.newButton{name="register", x=1140, y=100,w=170,h=80,color="lY",code=function()SCN.swapTo("register","swipeR")end},
WIDGET.newInputBox{name="email", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z@._-]"},
WIDGET.newInputBox{name="password", x=380, y=300,w=626,h=60,secret=true,regex="[ -~]"},
WIDGET.newKey{name="login", x=1140, y=540,w=170,h=80,font=40,code=login},

View File

@@ -2,7 +2,7 @@ local gc=love.graphics
local scene={}
local verName=SYSTEM.." "..VERSION_NAME
local verName=("%s %s %s"):format(SYSTEM,VERSION.string,VERSION.name)
local tipLength=760
local tip=gc.newText(getFont(30),"")
local scrollX--Tip scroll position
@@ -72,7 +72,10 @@ function scene.keyDown(key)
elseif key=="a"then
if testButton(3)then
if WS.status("user")=="running"then
if not NET.allow_online then
if not NET.connected then
TEXT.show(text.noInternet,640,450,60,"flicker")
SFX.play("finesseError")
elseif not NET.allow_online then
TEXT.show(text.needUpdate,640,450,60,"flicker")
SFX.play("finesseError")
else

View File

@@ -17,7 +17,7 @@ end
scene.widgetList={
WIDGET.newText{name="system", x=750,y=280,fText=SYSTEM,color="white",font=30,align="L"},
WIDGET.newText{name="version", x=950,y=280,fText=VERSION_NAME,color="white",font=30,align="L"},
WIDGET.newText{name="version", x=950,y=280,fText=VERSION.string,color="white",font=30,align="L"},
WIDGET.newButton{name="sprint", x=260,y=480,w=260,font=50,code=function()loadGame("sprint_40l",true)end},
WIDGET.newButton{name="marathon",x=640,y=480,w=260,font=50,code=function()loadGame("marathon_n",true)end},
WIDGET.newButton{name="setting",x=1000,y=400,w=120,fText="...",font=50,code=goScene"setting_game"},

View File

@@ -245,26 +245,20 @@ function scene.draw()
else
for i=1,#PLY_NET do
local p=PLY_NET[i]
gc.setColor(1,1,1)
--Rectangle
gc.setLineWidth(4)
gc.rectangle("line",40,65+50*i,1200,50)
gc.setColor(COLOR[p.ready and"G"or"white"])
gc.setLineWidth(3)
gc.rectangle("line",40,67+50*i,800,42)
--Username
gc.setColor(1,1,1)
setFont(40)
gc.print(p.username,230,60+50*i)
gc.print(p.username,200,60+50*i)
--UID
gc.setColor(.5,.5,.5)
gc.print("#"..p.uid,90,60+50*i)
if p.ready then
gc.setColor(.4,1,.4)
else
gc.setColor(1,1,1)
end
gc.rectangle("fill",50,60+50*i+14,30,30)
gc.print("#"..p.uid,50,60+50*i)
end
end
--New message

View File

@@ -1,4 +1,5 @@
local gc=love.graphics
local kb=love.keyboard
local NET=NET
local scrollPos,selected
@@ -29,7 +30,16 @@ function scene.keyDown(k)
end
elseif k=="n"then
if TIME()-lastCreateRoomTime>16.2 then
NET.createRoom()
NET.createRoom(
kb.isDown("1")and"solo"or
kb.isDown("2")and"classic"or
tonumber(USER.uid)<100 and(
kb.isDown("3")and"r49"or
kb.isDown("4")and"r99"or
kb.isDown("5")and"unlimited"
)or"solo",
(USER.username or"???").."'s room"
)
lastCreateRoomTime=TIME()
else
LOG.print(text.createRoomTooFast,"warn")
@@ -57,9 +67,6 @@ function scene.keyDown(k)
LOG.print("Can't enter private room now")
return
end
if NET.roomList[selected].start then
LOG.print("Can't enter room after start")
end
NET.enterRoom(NET.roomList[selected].rid)--,password
end
end

View File

@@ -1,41 +1,30 @@
local scene={}
function scene.keyDown(key)
if key=="return"then
local username= WIDGET.active.username.value
local email= WIDGET.active.email.value
local password= WIDGET.active.password.value
local password2=WIDGET.active.password2.value
if #username==0 then
LOG.print(text.noUsername)return
elseif not email:match("^[a-zA-Z0-9_]+@[a-zA-Z0-9_-]+%.[a-zA-Z0-9_]+$")then
LOG.print(text.wrongEmail)return
elseif #password==0 or #password2==0 then
LOG.print(text.noPassword)return
elseif password~=password2 then
LOG.print(text.diffPassword)return
end
--[[
JSON.encode{
username=username,
email=email,
password=password,
}
]]
elseif key=="escape"then
SCN.back()
else
WIDGET.keyPressed(key)
local function register()
local username= WIDGET.active.username.value
local email= WIDGET.active.email.value
local password= WIDGET.active.password.value
local password2=WIDGET.active.password2.value
if #username==0 then
LOG.print(text.noUsername)return
elseif not email:match("^[a-zA-Z0-9_]+@[a-zA-Z0-9_-]+%.[a-zA-Z0-9_]+$")then
LOG.print(text.wrongEmail)return
elseif #password==0 or #password2==0 then
LOG.print(text.noPassword)return
elseif password~=password2 then
LOG.print(text.diffPassword)return
end
NET.register(username,email,password)
end
scene.widgetList={
WIDGET.newText{name="title", x=80, y=50,font=70,align="L"},
WIDGET.newButton{name="login", x=1140, y=100,w=170,h=80,color="green",code=function()SCN.swapTo("login","swipeL")end},
WIDGET.newButton{name="login", x=1140, y=100,w=170,h=80,color="lY",code=function()SCN.swapTo("login","swipeL")end},
WIDGET.newInputBox{name="username", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z_]"},
WIDGET.newInputBox{name="email", x=380, y=300,w=626,h=60,regex="[0-9A-Za-z@._-]"},
WIDGET.newInputBox{name="email", x=380, y=300,w=626,h=60,regex="[0-9A-Za-z@._-]"},
WIDGET.newInputBox{name="password", x=380, y=400,w=626,h=60,secret=true,regex="[ -~]"},
WIDGET.newInputBox{name="password2", x=380, y=500,w=626,h=60,secret=true,regex="[ -~]"},
WIDGET.newInputBox{name="password2",x=380, y=500,w=626,h=60,secret=true,regex="[ -~]"},
WIDGET.newKey{name="register", x=1140, y=540,w=170,h=80,font=40,code=register},
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=backScene},
}

View File

@@ -22,6 +22,23 @@ return SPLITSTR([=[
可选虚拟按键颜色; 工程编译到字节码; task-Z(新AI)
录像回放菜单; 跳帧开关; 教学关; 超60帧; 热更新
0.14.2: 破晓 Dawn
新增:
重新启用注册菜单
改动:
优化一些联网对战相关内容
攻击特效从全局改为玩家设置项一部分
修复:
一些联网对战问题
马拉松模式忘了删测试用代码
0.14.1: 拂晓 Daybreak
改动:
为了更好的游戏体验,手机只能开单挑房,电脑开多人房(不建议),特殊用户可以开更大的房
增加联网对战模式的垃圾行上涨速度
修复:
一些联网对战的bug
0.14.0: 地平线 The Horizon
新增:
重新开放联网对战测试!!!
@@ -31,9 +48,9 @@ return SPLITSTR([=[
新模式:Backfire(四个难度)
新背景:BlackHole(用于Backfire)
新增BGM:echo(用于Backfire), hang out(用于两个小程序)
调整自定义场地的ui可以看到鼠标不同按键对应画笔颜色
调整自定义场地的ui,可以看到鼠标不同按键对应画笔颜色
小程序DTW增加双押功能
新增绘制优化设置(手机开启可能加速,花屏可能关闭解决)
新增绘制优化设置(手机开启可能加速,电脑花屏关闭可能解决)
改动:
错误处理机制大升级,更不容易闪退(CC爆炸除外)
赞助名单移至staff场景并添加动画(已经在榜上的可以来定制颜色!)