mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: guild operations should start based on server time instead of local time (#4548)
This commit is contained in:
parent
3dc3e7682b
commit
710994f751
@ -603,6 +603,17 @@ def get_server_weekday():
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def get_server_monthday():
|
||||||
|
"""
|
||||||
|
Returns:
|
||||||
|
int: The server's current day of the month
|
||||||
|
"""
|
||||||
|
diff = server_time_offset()
|
||||||
|
server_now = datetime.now() - diff
|
||||||
|
result = server_now.day
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
def random_id(length=32):
|
def random_id(length=32):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
|
|||||||
@ -3,6 +3,7 @@ from datetime import datetime
|
|||||||
from module.base.button import ButtonGrid
|
from module.base.button import ButtonGrid
|
||||||
from module.base.timer import Timer
|
from module.base.timer import Timer
|
||||||
from module.base.utils import *
|
from module.base.utils import *
|
||||||
|
from module.config.utils import get_server_monthday
|
||||||
from module.exception import GameBugError
|
from module.exception import GameBugError
|
||||||
from module.guild.assets import *
|
from module.guild.assets import *
|
||||||
from module.guild.base import GuildBase
|
from module.guild.base import GuildBase
|
||||||
@ -89,7 +90,7 @@ class GuildOperations(GuildBase):
|
|||||||
if not self.config.GuildOperation_SelectNewOperation:
|
if not self.config.GuildOperation_SelectNewOperation:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
today = datetime.now().day
|
today = get_server_monthday()
|
||||||
limit = self.config.GuildOperation_NewOperationMaxDate
|
limit = self.config.GuildOperation_NewOperationMaxDate
|
||||||
if today >= limit:
|
if today >= limit:
|
||||||
logger.info(f'No new guild operations because, today\'s date {today} >= limit {limit}')
|
logger.info(f'No new guild operations because, today\'s date {today} >= limit {limit}')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user