mirror of
https://github.com/PretendoNetwork/nex-protocols-common-go.git
synced 2025-04-02 11:02:13 -04:00
Add callback function `ValidateLoginData` on the `ticket-granting` and `secure-connection` common protocols to allow validation of the given login data on the `LoginEx` or `RegisterEx` methods. Alongside that, add a toggle on the `secure-connection` common protocol for enabling or disabling the insecure `Register` method, like the one for `Login` on `ticket-granting`. Also implement the Pretendo token validation inside the globals section, so that both common protocols can use them. The common protocols include an option to use the Pretendo token validation `SetPretendoValidation` on that protocol, but custom handling can be added by setting the callback function to a custom one. And finally, replace the error handling on the protocols to set any errors that aren't related to invalid arguments on `%retval%`. This is accurate as per previous research, since this is where errors like maintenace or validation failures get populated. By default, both of the insecure methods are disabled. That means that current game servers that use the insecure `Register` method will have to enable them using `EnableInsecureRegister`. Server implementers **MUST NOT** enable both of the insecure methods at the same time. The new `SetPretendoValidation` function expects an AES key as an argument. This matches with the AES key that is stored on the server list from the account server, after being hex-decoded. Servers are expected to set the AES key from an environment variable and validate that the input provided is valid (the key must be decoded using `hex.DecodeString` before being provided to the validation fucntion). |
||
---|---|---|
.. | ||
generate_ticket.go | ||
login.go | ||
login_ex.go | ||
protocol.go | ||
request_ticket.go |