mirror of
https://git.xeondev.com/LR/S.git
synced 2026-03-22 07:32:21 +01:00
chore(build!): update to zig 0.16.0-dev.2510+bcb5218a2
This commit is contained in:
@@ -39,7 +39,7 @@ pub fn processLoginRequest(io: Io, session: *Session, request: *const pb.CS_LOGI
|
||||
|
||||
try session.send(pb.SC_LOGIN{
|
||||
.uid = request.uid,
|
||||
.server_time = @intCast((Io.Clock.real.now(io) catch Io.Timestamp.zero).toSeconds()),
|
||||
.server_time = @intCast(Io.Clock.real.now(io).toSeconds()),
|
||||
.server_time_zone = 3,
|
||||
});
|
||||
|
||||
|
||||
@@ -15,10 +15,7 @@ pub const PingTimer = struct {
|
||||
last_client_ts: u64 = 0,
|
||||
|
||||
pub fn serverTime(pt: PingTimer) u64 {
|
||||
return if (Io.Clock.real.now(pt.io)) |ts|
|
||||
@intCast(ts.toMilliseconds())
|
||||
else |_|
|
||||
pt.last_client_ts;
|
||||
return @intCast(Io.Clock.real.now(pt.io).toMilliseconds());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ fn start(init: Init.Minimal, io: Io, gpa: Allocator) u8 {
|
||||
var sessions: Io.Group = .init;
|
||||
defer sessions.cancel(io);
|
||||
|
||||
var preferred_clock: Io.Clock = .awake;
|
||||
const preferred_clock: Io.Clock = if (Io.Clock.awake.resolution(io)) |_| .awake else |_| .real;
|
||||
var concurrency_availability: Session.ConcurrencyAvailability = .undetermined;
|
||||
|
||||
log.info("listening at {f}", .{listen_address});
|
||||
@@ -77,11 +77,6 @@ fn start(init: Init.Minimal, io: Io, gpa: Allocator) u8 {
|
||||
while (true) {
|
||||
if (io.sleep(.fromSeconds(1), preferred_clock)) break else |sleep_err| switch (sleep_err) {
|
||||
error.Canceled => break :accept_loop, // Shutdown requested
|
||||
error.UnsupportedClock => preferred_clock = if (preferred_clock == .awake)
|
||||
.real
|
||||
else
|
||||
continue :accept_loop, // No clock available.
|
||||
error.Unexpected => continue :accept_loop, // Sleep is unimportant then.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user