Enforce Votifier version

This commit is contained in:
Jacob Gunther 2024-05-19 13:13:29 -05:00
parent 29ed1cb231
commit bf3d6ecb83
No known key found for this signature in database
GPG Key ID: 9E6F3F4BF45EC433

View File

@ -170,12 +170,13 @@ func SendVoteHandler(ctx *fiber.Ctx) error {
defer cancel() defer cancel()
if err = mcutil.SendVote(c, opts.Host, opts.Port, options.Vote{ if err = mcutil.SendVote(c, opts.Host, opts.Port, options.Vote{
PublicKey: opts.PublicKey, RequireVersion: 1,
ServiceName: opts.ServiceName, PublicKey: opts.PublicKey,
Username: opts.Username, ServiceName: opts.ServiceName,
IPAddress: opts.IPAddress, Username: opts.Username,
Timestamp: opts.Timestamp, IPAddress: opts.IPAddress,
Timeout: opts.Timeout, Timestamp: opts.Timestamp,
Timeout: opts.Timeout,
}); err != nil { }); err != nil {
return ctx.Status(http.StatusBadRequest).SendString(err.Error()) return ctx.Status(http.StatusBadRequest).SendString(err.Error())
} }
@ -187,12 +188,13 @@ func SendVoteHandler(ctx *fiber.Ctx) error {
defer cancel() defer cancel()
if err = mcutil.SendVote(c, opts.Host, opts.Port, options.Vote{ if err = mcutil.SendVote(c, opts.Host, opts.Port, options.Vote{
ServiceName: opts.ServiceName, RequireVersion: 2,
Username: opts.Username, ServiceName: opts.ServiceName,
Token: opts.Token, Username: opts.Username,
UUID: opts.UUID, Token: opts.Token,
Timestamp: opts.Timestamp, UUID: opts.UUID,
Timeout: opts.Timeout, Timestamp: opts.Timestamp,
Timeout: opts.Timeout,
}); err != nil { }); err != nil {
return ctx.Status(http.StatusBadRequest).SendString(err.Error()) return ctx.Status(http.StatusBadRequest).SendString(err.Error())
} }