Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: acronyte on October 29, 2017, 08:13:56 AM

Title: data that all players can access?
Post by: acronyte on October 29, 2017, 08:13:56 AM
How is this done?

I tried using one file on my server where all players can access, but the file gets rewritten everytime a player uses SetPlayerData.
Title: Re: data that all players can access?
Post by: devomage on October 29, 2017, 05:07:37 PM
Have you tried TNManager.LoadFile?
Title: Re: data that all players can access?
Post by: cmifwdll on October 30, 2017, 05:42:55 PM
TNManager.SetChannelData could work as well
Title: Re: data that all players can access?
Post by: ArenMook on November 06, 2017, 07:50:48 AM
Current version of TNet I'm using for Sightseer explicitly disallows multiple players from using the same save file to avoid this kind of confusion.

SetServerData can be used by admins for important stuff that players should not be able to change - configuration, message of the day, etc.
SetChannelData in a common channel (such as the global chat channel) can be used for player-settable configuration.

Keep in mind that all players have access to all other players' data, as long as they are in the same channel -- so SetPlayerData will work too.
Title: Re: data that all players can access?
Post by: acronyte on November 23, 2017, 05:46:44 AM
Current version of TNet I'm using for Sightseer explicitly disallows multiple players from using the same save file to avoid this kind of confusion.

SetServerData can be used by admins for important stuff that players should not be able to change - configuration, message of the day, etc.
SetChannelData in a common channel (such as the global chat channel) can be used for player-settable configuration.

Keep in mind that all players have access to all other players' data, as long as they are in the same channel -- so SetPlayerData will work too.

Thank you. I believe 'SetServerData' is the option I'm looking for, however Im not to clear on how to first create an admin.... You mentioned in another thread -
Quote
SetServerData can only be done by the server's administrator. You need to SetAdmin("password") before you use those calls.
....

How do I go about creating an admin? I dont see any admin files on my server :'(
Title: Re: data that all players can access?
Post by: cmifwdll on November 23, 2017, 10:02:20 PM
Yeah, one of the updates caused the admin.txt file to not be created automatically anymore. The reason is that the mAdmin list remains empty and Tools.SaveList deletes the file if list is empty.

You should be able to create it manually in ServerConfig/admin.txt.
Each line is a "password". Blank lines break processing.
Title: Re: data that all players can access?
Post by: ArenMook on November 25, 2017, 10:22:40 PM
Admin file not being created should actually be resolved in the current Pro version. I noticed it about a week ago and fixed it.