News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

[Online] Is the player authenticated?

Started by Yona-TYT, June 03, 2017, 04:16:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT


In online games I need to know if the player is authorized (enter password) to prevent other players from using their function.

It would be nice something like: "player_x(pl).is_unlocked()"

DrSuperGood

Not that easy to implement as only the server truly knows that and can be trusted. One would need to sync the results with all clients before permitting the script to execute any further.

Yona-TYT


I need this to be able to advance in the divided regions scenario.  :-[
Otherwise it would be useless, since the players have free access to the functions that I want to create.

Dwachs

@DrSuperGood: Scenarios only run on the server, so there is a chance to get this working.
Quote from: Yona-TYT on June 03, 2017, 04:16:49 PM
In online games I need to know if the player is authorized (enter password) to prevent other players from using their function.
@Yona: Can you please be more specific with respect to 'their function' ? What do you want to achieve?

Running scripts from clicks in scenario info window does not work currently for clients in network mode. It only works on the server itself.

In order to make it work in network mode, there should be some safety net in order to decide whether a script call is legitimate. Otherwise a modified client could sent arbitrary requests to spoil the scenario.
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

Quote from: Dwachs on June 12, 2017, 06:15:48 AM
Running scripts from clicks in scenario info window does not work currently for clients in network mode. It only works on the server itself.
I suppose that is the problem, maybe some kind of interaction is needed that shows the window to enter the password.

Yona-TYT

Quote from: Dwachs on June 12, 2017, 06:15:48 AM
@Yona: Can you please be more specific with respect to 'their function' ? What do you want to achieve?

Running scripts from clicks in scenario info window does not work currently for clients in network mode. It only works on the server itself.

In order to make it work in network mode, there should be some safety net in order to decide whether a script call is legitimate. Otherwise a modified client could sent arbitrary requests to spoil the scenario.
I was hoping this would work. :-[