Merge pull request #1 from Lost-MSth/dev

[Bug fix] Link Play kicked out & last song scores
This commit is contained in:
Guzi_422
2024-09-14 21:43:13 +08:00
committed by GitHub
4 changed files with 32 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
from .config_manager import Config
ARCAEA_SERVER_VERSION = 'v2.11.3.17'
ARCAEA_DATABASE_VERSION = 'v2.11.3.17'
ARCAEA_SERVER_VERSION = 'v2.11.3.18'
ARCAEA_DATABASE_VERSION = 'v2.11.3.18'
ARCAEA_LOG_DATBASE_VERSION = 'v1.1'

View File

@@ -1882,5 +1882,23 @@
],
"orig_price": 100,
"price": 100
},
{
"name": "rainofconflict",
"items": [
{
"type": "single",
"id": "rainofconflict",
"is_available": true
},
{
"type": "core",
"amount": 1,
"id": "core_generic",
"is_available": true
}
],
"orig_price": 100,
"price": 100
}
]

View File

@@ -101,7 +101,7 @@ class Player:
self.rating_ptt: int = 0 # 2 bytes
self.is_hide_rating: int = 0 # 1 byte
self.switch_4: int = 0 # 1 byte 只能确定有 00 和 01
self.is_staff: int = 0 # 1 byte
@property
def name(self) -> str:
@@ -162,7 +162,7 @@ class Player:
re.append(self.switch_2)
re.extend(b(self.rating_ptt, 2))
re.append(self.is_hide_rating)
re.append(self.switch_4)
re.append(self.is_staff)
return bytes(re)
@@ -356,7 +356,6 @@ class Room:
self.song_idx = 0xffff
self.voting_clear()
print(self.player_num)
if self.state in (1, 2) and self.timed_mode and self.player_num <= 1:
self.next_state_timestamp = 0
self.countdown = 0xffffffff
@@ -382,7 +381,7 @@ class Room:
def is_finish(self):
# 是否全部进入结算
if self.state == 8:
if self.state != 7:
return False
for i in self.players:

View File

@@ -179,7 +179,7 @@ class CommandParser:
flag_12 = True
player.online = 1
if self.room.state in (1, 2) and player.player_state == 8:
if self.room.timed_mode and self.room.state in (1, 2) and player.player_state == 8:
# 还在结算给踢了
# 冗余,为了保险
self.room.delete_player(self.player_index)
@@ -248,12 +248,13 @@ class CommandParser:
logging.info(f'Room `{self.room.room_code}` starts playing')
if self.room.state == 4:
if player.download_percent != 0xff:
# 有人没下载完把他踢了!
self.room.delete_player(self.player_index)
self.room.command_queue.append(
self.s.command_12(self.player_index))
self.room.command_queue.append(self.s.command_14())
# 这好像会误判
# if player.download_percent < 99:
# # 有人没下载完把他踢了!
# self.room.delete_player(self.player_index)
# self.room.command_queue.append(
# self.s.command_12(self.player_index))
# self.room.command_queue.append(self.s.command_14())
if self.room.should_next_state:
self.room.state = 5
@@ -296,7 +297,7 @@ class CommandParser:
self.room.state = 1
self.room.song_idx = 0xffff
if self.room.state in (1, 2) and player.player_state == 8:
if self.room.timed_mode and self.room.state in (1, 2) and player.player_state == 8:
# 还在结算给踢了
self.room.delete_player(self.player_index)
self.room.command_queue.append(