chore(build!): update to zig 0.16.0-dev.2510+bcb5218a2

This commit is contained in:
xeon
2026-02-07 11:39:07 +03:00
parent 82938dcfdb
commit d6fbbafcfd
8 changed files with 65 additions and 37 deletions

View File

@@ -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,
});

View File

@@ -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());
}
};

View File

@@ -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.
}
}