用户:
某科学的七濑胡桃查看:8 回复:18 评论:8 创建时间:2022-07-20T11:53:14
那个瞬间!全世界70亿双眼睛瞳孔放大!!![]()
更新内容如下:
1.大幅修改美化了元生态UI
2.重新定义了整体生态色调
3.新增了基于喵的往返切换系统
4.对全部字体进行了元修订
体验地址在评论区!!
![]()
Architect_海绵那么,我们不妨说点人话()()()()
更新内容:
1,把按键变圆了()()()()()
2,改了改颜色()()()()()
3,新增了退出键()()()()()
4,修改了所有字体()()()()()
点赞1
评论
UP主終黙async function poll(fn, msg) {//无限轮询执行sql语句直到成功
while (true) {
try {
return await fn()//一旦成功执行, 停止无限轮询, 并返回查询结果
} catch (e) {
const m = e.message//需要简略显示的异常消息
//sql偶尔会执行超时, 但如果反复显示timeout 15秒以上一直不停, 大概是数据库出了故障只能等官方修复
if (m.includes('timeout')) {
world.say(m)
}
else {
world.say(msg || e.stack)//如果sql执行出错, 广播错误消息, 用来排查错误原因
}
}
await sleep(2000) //每2秒重试一次
}
}
poll(initTable, '等待pg数据库启动中...')
world.onPlayerJoin(async ({ entity }) => {
//初始化玩家属性
entity.exp = 0
entity.coin = 50
entity.item = ['剑', '盾']
await loadUser(entity)//尝试读取存档
entity.onVoxelContact(() => {//每走1格增加1经验
entity.exp += 1
})
entity.player.onPress(async ({ button }) => {//右键显示状态栏
if (button == Box3ButtonType.ACTION1) {
const sel = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: `
金币:${entity.coin}
经验:${entity.exp}
道具:[${entity.item}]
`,
options: ['保存','删档','游玩端数据','编辑端数据'],
})
if (sel) {
if (sel.value == '保存') {
await saveUser(entity)
entity.player.directMessage('保存完毕')
}
else if (sel.value == '删档') {
await deleteUser(entity)
entity.player.directMessage('删档完毕')
}
else if (sel.value == '游玩端数据') {
await showAllPlaySideUser()
}
else if (sel.value == '编辑端数据') {
await showAllEditSideUser()
}
}
}
})
})点赞0
评论
UP主終黙async function poll(fn, msg) {//无限轮询执行sql语句直到成功
while (true) {
try {
return await fn()//一旦成功执行, 停止无限轮询, 并返回查询结果
} catch (e) {
const m = e.message//需要简略显示的异常消息
//sql偶尔会执行超时, 但如果反复显示timeout 15秒以上一直不停, 大概是数据库出了故障只能等官方修复
if (m.includes('timeout')) {
world.say(m)
}
else {
world.say(msg || e.stack)//如果sql执行出错, 广播错误消息, 用来排查错误原因
}
}
await sleep(2000) //每2秒重试一次
}
}
poll(initTable, '等待pg数据库启动中...')
world.onPlayerJoin(async ({ entity }) => {
//初始化玩家属性
entity.exp = 0
entity.coin = 50
entity.item = ['剑', '盾']
await loadUser(entity)//尝试读取存档
entity.onVoxelContact(() => {//每走1格增加1经验
entity.exp += 1
})
entity.player.onPress(async ({ button }) => {//右键显示状态栏
if (button == Box3ButtonType.ACTION1) {
const sel = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: `
金币:${entity.coin}
经验:${entity.exp}
道具:[${entity.item}]
`,
options: ['保存','删档','游玩端数据','编辑端数据'],
})
if (sel) {
if (sel.value == '保存') {
await saveUser(entity)
entity.player.directMessage('保存完毕')
}
else if (sel.value == '删档') {
await deleteUser(entity)
entity.player.directMessage('删档完毕')
}
else if (sel.value == '游玩端数据') {
await showAllPlaySideUser()
}
else if (sel.value == '编辑端数据') {
await showAllEditSideUser()
}
}
}
})
})
async function poll(fn, msg) {//无限轮询执行sql语句直到成功
while (true) {
try {
return await fn()//一旦成功执行, 停止无限轮询, 并返回查询结果
} catch (e) {
const m = e.message//需要简略显示的异常消息
//sql偶尔会执行超时, 但如果反复显示timeout 15秒以上一直不停, 大概是数据库出了故障只能等官方修复
if (m.includes('timeout')) {
world.say(m)
}
else {
world.say(msg || e.stack)//如果sql执行出错, 广播错误消息, 用来排查错误原因
}
}
await sleep(2000) //每2秒重试一次
}
}
poll(initTable, '等待pg数据库启动中...')
world.onPlayerJoin(async ({ entity }) => {
//初始化玩家属性
entity.exp = 0
entity.coin = 50
entity.item = ['剑', '盾']
await loadUser(entity)//尝试读取存档
entity.onVoxelContact(() => {//每走1格增加1经验
entity.exp += 1
})
entity.player.onPress(async ({ button }) => {//右键显示状态栏
if (button == Box3ButtonType.ACTION1) {
const sel = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: `
金币:${entity.coin}
经验:${entity.exp}
道具:[${entity.item}]
`,
options: ['保存','删档','游玩端数据','编辑端数据'],
})
if (sel) {
if (sel.value == '保存') {
await saveUser(entity)
entity.player.directMessage('保存完毕')
}
else if (sel.value == '删档') {
await deleteUser(entity)
entity.player.directMessage('删档完毕')
}
else if (sel.value == '游玩端数据') {
await showAllPlaySideUser()
}
else if (sel.value == '编辑端数据') {
await showAllEditSideUser()
}
}
}
})
})
async function poll(fn, msg) {//无限轮询执行sql语句直到成功
while (true) {
try {
return await fn()//一旦成功执行, 停止无限轮询, 并返回查询结果
} catch (e) {
const m = e.message//需要简略显示的异常消息
//sql偶尔会执行超时, 但如果反复显示timeout 15秒以上一直不停, 大概是数据库出了故障只能等官方修复
if (m.includes('timeout')) {
world.say(m)
}
else {
world.say(msg || e.stack)//如果sql执行出错, 广播错误消息, 用来排查错误原因
}
}
await sleep(2000) //每2秒重试一次
}
}
poll(initTable, '等待pg数据库启动中...')
world.onPlayerJoin(async ({ entity }) => {
//初始化玩家属性
entity.exp = 0
entity.coin = 50
entity.item = ['剑', '盾']
await loadUser(entity)//尝试读取存档
entity.onVoxelContact(() => {//每走1格增加1经验
entity.exp += 1
})
entity.player.onPress(async ({ button }) => {//右键显示状态栏
if (button == Box3ButtonType.ACTION1) {
const sel = await entity.player.dialog({
type: Box3DialogType.SELECT,
content: `
金币:${entity.coin}
经验:${entity.exp}
道具:[${entity.item}]
`,
options: ['保存','删档','游玩端数据','编辑端数据'],
})
if (sel) {
if (sel.value == '保存') {
await saveUser(entity)
entity.player.directMessage('保存完毕')
}
else if (sel.value == '删档') {
await deleteUser(entity)
entity.player.directMessage('删档完毕')
}
else if (sel.value == '游玩端数据') {
await showAllPlaySideUser()
}
else if (sel.value == '编辑端数据') {
await showAllEditSideUser()
}
}
}
})
})
async function poll(fn, msg) {//无限轮询执行sql语句直到成功 while (true) { try { return await fn()//一旦成功执行, 停止无限轮询, 并返回查询结果 } catch (e) { const m = e.message//需要简略显示的异常消息 //sql偶尔会执行超时, 但如果反复显示timeout 15秒以上一直不停, 大概是数据库出了故障只能等官方修复 if (m.includes('timeout')) { world.say(m) } else { world.say(msg || e.stack)//如果sql执行出错, 广播错误消息, 用来排查错误原因 } } await sleep(2000) //每2秒重试一次 } } poll(initTable, '等待pg数据库启动中...') world.onPlayerJoin(async ({ entity }) => { //初始化玩家属性 entity.exp = 0 entity.coin = 50 entity.item = ['剑', '盾'] await loadUser(entity)//尝试读取存档 entity.onVoxelContact(() => {//每走1格增加1经验 entity.exp += 1 }) entity.player.onPress(async ({ button }) => {//右键显示状态栏 if (button == Box3ButtonType.ACTION1) { const sel = await entity.player.dialog({ type: Box3DialogType.SELECT, content: ` 金币:${entity.coin} 经验:${entity.exp} 道具:[${entity.item}] `, options: ['保存','删档','游玩端数据','编辑端数据'], }) if (sel) { if (sel.value == '保存') { await saveUser(entity) entity.player.directMessage('保存完毕') } else if (sel.value == '删档') { await deleteUser(entity) entity.player.directMessage('删档完毕') } else if (sel.value == '游玩端数据') { await showAllPlaySideUser() } else if (sel.value == '编辑端数据') { await showAllEditSideUser() } } } }) })
async function poll(fn, msg) {//无限轮询执行sql语句直到成功 while (true) { try { return await fn()//一旦成功执行, 停止无限轮询, 并返回查询结果 } catch (e) { const m = e.message//需要简略显示的异常消息 //sql偶尔会执行超时, 但如果反复显示timeout 15秒以上一直不停, 大概是数据库出了故障只能等官方修复 if (m.includes('timeout')) { world.say(m) } else { world.say(msg || e.stack)//如果sql执行出错, 广播错误消息, 用来排查错误原因 } } await sleep(2000) //每2秒重试一次 } } poll(initTable, '等待pg数据库启动中...') world.onPlayerJoin(async ({ entity }) => { //初始化玩家属性 entity.exp = 0 entity.coin = 50 entity.item = ['剑', '盾'] await loadUser(entity)//尝试读取存档 entity.onVoxelContact(() => {//每走1格增加1经验 entity.exp += 1 }) entity.player.onPress(async ({ button }) => {//右键显示状态栏 if (button == Box3ButtonType.ACTION1) { const sel = await entity.player.dialog({ type: Box3DialogType.SELECT, content: ` 金币:${entity.coin} 经验:${entity.exp} 道具:[${entity.item}] `, options: ['保存','删档','游玩端数据','编辑端数据'], }) if (sel) { if (sel.value == '保存') { await saveUser(entity) entity.player.directMessage('保存完毕') } else if (sel.value == '删档') { await deleteUser(entity) entity.player.directMessage('删档完毕') } else if (sel.value == '游玩端数据') { await showAllPlaySideUser() } else if (sel.value == '编辑端数据') { await showAllEditSideUser() } } } }) })点赞0
评论