Author Topic: Admin folder & server file problem  (Read 292 times)

lynohd

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 21
    • View Profile
Admin folder & server file problem
« on: October 07, 2017, 12:16:54 AM »
Hi, for some reason the admin.txt file does not get created automaticly and i have to go into X directory to make it manually.

it was only after i added the "-app" parameter in my TNServer that it generated a folder in my documents (which i think is not a appropiate place for it to be generated, and idk how to change it).

i also tried the "-localpath" parameter but that did nothing.

also the "server.dat" file that the  TNServer generates when ran is completely empty aswell?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,137
  • Toronto, Canada
    • View Profile
Re: Admin folder & server file problem
« Reply #1 on: October 07, 2017, 06:30:09 AM »
It's "-localPath". Capital P.

Does the app have permissions to access your drive?

lynohd

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 21
    • View Profile
Re: Admin folder & server file problem
« Reply #2 on: October 07, 2017, 11:44:18 AM »
how do i know if its got permissions for that?

also in the TNServer source code theres nothing for the "localPath" parameter?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,137
  • Toronto, Canada
    • View Profile
Re: Admin folder & server file problem
« Reply #3 on: October 09, 2017, 09:56:04 AM »
Ah, my mistake, "-localPath" is actually specific to the game I'm working on. Looking at it, it's local by default. If you specify parameter -app "name", it will use that "name" as the folder name in My Documents -- so you were doing it right.

Btw, server.dat will only have something in it if you actually save RFCs -- meaning you have to use persistent channels as well.

The admin.txt file should get generated if it's not there, but it's done only when you launch a server instance from within your game iirc. It's like that because it automatically adds the local user as the administrator.

lynohd

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 21
    • View Profile
Re: Admin folder & server file problem
« Reply #4 on: October 09, 2017, 01:48:05 PM »
right
how can i make it so it generates the folder in the applications directory instead of in documents?

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 144
  • Posts: 269
  • TNet Alchemist
    • View Profile
Re: Admin folder & server file problem
« Reply #5 on: October 09, 2017, 06:19:16 PM »
The ServerConfig folder will be placed alongside your .exe by default. The -app switch places it in My Documents/<app>.

The admin.txt file is only created when the mAdmin list holds one or more values (same with the bans text file, or any call to SaveList, actually).

When you run the gameserver from within your game using TNServerInstance.Start, your player will automatically be granted admin. However, this does not populate the mAdmin list: it only sets the boolean flag on your player object (done in ProcessPlayerPacket in the if block for VerifyRequestID). But, with this flag set, you can call TNManager.AddAdmin(superSecretPassword) to then populate mAdmin and thus create the file.