Author Topic: data that all players can access?  (Read 4894 times)

acronyte

  • Newbie
  • *
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 46
    • View Profile
data that all players can access?
« 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.

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: data that all players can access?
« Reply #1 on: October 29, 2017, 05:07:37 PM »
Have you tried TNManager.LoadFile?

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: data that all players can access?
« Reply #2 on: October 30, 2017, 05:42:55 PM »
TNManager.SetChannelData could work as well

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: data that all players can access?
« Reply #3 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.

acronyte

  • Newbie
  • *
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: data that all players can access?
« Reply #4 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 :'(

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: data that all players can access?
« Reply #5 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: data that all players can access?
« Reply #6 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.