refactor: move game_server utils into global utils

This commit is contained in:
Naruse
2024-11-08 11:18:47 +08:00
parent 787cf1dd15
commit 27976c3ffd
13 changed files with 118 additions and 105 deletions

View File

@@ -1,11 +1,8 @@
import betterproto
from game_server.net.session import Session
from game_server.utils import get_unix_in_seconds
from lib.proto import (
GetLoginActivityReq,
GetLoginActivityRsp,
LoginActivityData
)
from utils.time import get_unix_in_seconds
from lib.proto import GetLoginActivityReq, GetLoginActivityRsp, LoginActivityData
async def handle(session: Session, msg: GetLoginActivityReq) -> betterproto.Message:
return GetLoginActivityRsp(
@@ -15,7 +12,7 @@ async def handle(session: Session, msg: GetLoginActivityReq) -> betterproto.Mess
id=581,
login_days=get_unix_in_seconds(),
accept_time=get_unix_in_seconds(),
duration_end_time=get_unix_in_seconds() + 604800 * 2
duration_end_time=get_unix_in_seconds() + 604800 * 2,
)
]
],
)