2019-12-08 22:43:49 +01:00
|
|
|
import random
|
|
|
|
|
|
|
|
from bemani.backend.base import Base
|
|
|
|
from bemani.protocol import Node
|
|
|
|
|
|
|
|
|
|
|
|
class EventLogHandler(Base):
|
|
|
|
"""
|
|
|
|
A mixin that can be used to provide ESS eventlog handling.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def handle_eventlog_write_request(self, request: Node) -> Node:
|
|
|
|
# Just turn off further logging
|
2022-10-15 20:56:30 +02:00
|
|
|
gamesession = request.child_value("data/gamesession")
|
2019-12-08 22:43:49 +01:00
|
|
|
if gamesession < 0:
|
|
|
|
gamesession = random.randint(1, 1000000)
|
|
|
|
|
2022-10-15 20:56:30 +02:00
|
|
|
root = Node.void("eventlog")
|
|
|
|
root.add_child(Node.s64("gamesession", gamesession))
|
|
|
|
root.add_child(Node.s32("logsendflg", 0))
|
|
|
|
root.add_child(Node.s32("logerrlevel", 0))
|
|
|
|
root.add_child(Node.s32("evtidnosendflg", 0))
|
2019-12-08 22:43:49 +01:00
|
|
|
return root
|