Skip to content

Organizing the Servervault and Sticky Player Names

I'm looking to get opinions on the benefits vs drawbacks of organizing the multiplayer servervault with folders for each player named by their CD Key (the default 1.74 method now) instead of by player name (the original 1.69 method). It's nice that Beamdog has given us the option so that if you change the nwnplayer.ini setting of Server Vault By Player Name=1, it will organize by the old way.

But I am assuming there must have been a reason that they chose to change the default method of server vault organization to go by CD Key, rather than player name. Any ideas? Or does anyone care to share their preference and why? I'm also assuming once you choose one or the other, your server is "locked in for life" and cannot change since players would lose their characters (or at least not be able to connect to the correct folder in the server vault) if you change the servervault organization from one to the other. Correct?

Finally, I'm looking for confirmation on what Sticky Player Names=1 (or 0) does in the nwnplayer.ini. From what I understand it allows players on the server to tie their CD Key to their player name so no one else can login to the server with their player name. But it seems this is being accomplished by the creation of a knownservernames.2da that gets created in the override folder on the server, and has nothing to do with any verification checks to the Master Server at all. Is that correct?
Phantomizer

Comments

  • PhantomizerPhantomizer Member Posts: 76
    Follwoing...but I'd just like to point out that tying organizing by CD Key makes server vault management so much more confusing and painful, like I literally had to go through each folder to find my characters on my own server >_>
  • BalanorBalanor Member Posts: 175
    edited March 2018
    If you turn on Sticky Player Names on your server (Sticky Player Names=1 in the nwnplayer.ini), you can use the knownservernames.2da to find a player's CD Key. Unfortunately the 2da opens really ugly for me as it appears to have no line breaks, but it *should* look like this:
    2DA V2.0        CDKey       ConnectType  PlayerName
    00000           "ULFRD41P"  016          "Balanor"
    00001           "UPC4JG6P"  016          "IronRook"
    00002           "UPXV3ANQ"  016          "Keter Class"
    00003           "UPCRWMJH"  016          "awinter"
    So if you have Sticky Names enabled, you can use the .2da it generates to find the CD Key for the folder of the player you're looking for if you have your servervault organized by CD Key.

    Edit: Changed a few letters in each the CD Key examples so they are not correct. ;)
    shadguySweetness
  • PhantomizerPhantomizer Member Posts: 76
    Can I turn on Sticky Player Names on an existing server without breaking anything?
  • FinalStandFinalStand Member Posts: 87

    Can I turn on Sticky Player Names on an existing server without breaking anything?

    yea, have that same question. Not sure what this does. Just log only in that 2da file or does it force character name to cdkey?

    If someone reinstalls and forgets their name, they are out of luck ?
  • BalanorBalanor Member Posts: 175
    edited March 2018
    So I've been playing around with this more. @Phantomizer you can turn on Sticky Player Names at any time, which will start creation of the knownservernames.2da in your server's override folder.

    It also seems that unless you have enabled "Sticky Player Names" to tie player names to CD Keys on your server, the "Server Vault By Player Name=1" isn't going to work as intended. That's because, since we don't have Gamespy anymore, anyone can login to Multiplayer with "Phantomizer" as their login name. So if you are organizing the server vault by player name, you need to have Sticky Player Names enabled for your server so when you log in to your server as Phantomizer, knownservernames.2da is used to tie your CD Key to your login name so no one else can use that login on your server. They could, however, login on a different server and use it as their login name there, if it hasn't been claimed there yet.

    Otherwise, the default 1.74 way of storing by CD Key basically says "I don't care what your login name is", and you could login to your server as Mickey Mouse or Phantomizer and still see the same characters.

    But to FinalStand's point; it would appear that one benefit of using the default 1.74 method of organizing the server vault by CD Key, is that if someone does forget their login name, they'll still be able to access their characters on your server. Although if you have legacy NWN systems which use the PlayerName+PCName method to uniquely identify a PC, your systems could break since it would allow a player to login as Mickey Mouse one time, and then Phantomizer, or Balanor, or whoever, the next time.

    I myself am still really on the fence about what method is better for EE. So if anyone else has messed around with either of these settings or has more insight about them, I'd love to hear about it.
    PhantomizerSweetnessNecroGalo
  • PhantomizerPhantomizer Member Posts: 76
    Thanks a lot for the In depth reply!
  • SweetnessSweetness Member Posts: 7
    @Balanor Any idea how I can enable sticky players / player vault and migrate files after having started a CDKey vault?

    It turns out that using the CDKey vault conflicts with some of the scripts on my server in that if they log in as a different username and use the same character it's inventory will be wiped. I really want to protect players from the bug, but I don't want to inconvenience anyone by wiping the server after the first day.
  • BalanorBalanor Member Posts: 175
    Hiya Sweetness. That was one of my original questions too. I'm pretty sure that, unfortunately, the answer is "you are locked in for life" with whatever method you first choose.

    The only option I can see to change this would be to manually or programmatically (via a .bat file or something) rename every folder in your servervault from the CD Key to the actual player name the player would normally use. But you'd need to have both the CD Key and the player name for each determined somewhere else before you could do this. One way to start would be to enable Sticky Names ASAP to start creation of the knownservernames.2da. That way you can use that to at least help map player names to CD Keys for your regular and new players that login to the server, and that could be used as a guide as you go through and rename the folders in the servervault.
  • SweetnessSweetness Member Posts: 7
    Thanks again Balanor - that is exactly what I started doing earlier today. I'll post back to let people know how it goes!
    Balanor
  • BalanorBalanor Member Posts: 175
    edited March 2018
    So the knownservernames.2da, at least on my machines, is apparently being created as a Linux-based file even on Windows servers, which is why it opens as a wall of unformatted text.

    A quick way to format it so it can actually be used in Windows is to copy and paste the contents into a comment or new discussion topic here (kind of weird, but it works), and then copy and paste it from here into a text file. Or you can use a program like todos to convert the file to a Windows formatted txt file.
    Post edited by Balanor on
  • SweetnessSweetness Member Posts: 7
    @Balanor

    I was hoping you might be able to help me fix an issue I'm having on my server that's directly related to this (I kinda already told you about it and you may have already given me the answer, lol).

    We employ a semi-permanent death for characters on the server which is enforced via the campaign variable and a custom death token. The issue is that with player vaults (even w/ sticky players) using a new player name, but the same character, resets these variables and allows them to play a previously dead character (it also resets all of their items but that's a small price to pay). If I understand your information correctly, I need to convert the knownservernames.2da files that I've been generating over the past week using sticky players to a readable format that I can get use to sort character files into a newly created legacy-style CDKey vault? Thus allowing me to switch my login method without completely wiping all of the my players characters?

    Looking for all of the help I can get here. :)
  • BalanorBalanor Member Posts: 175
    edited April 2018
    Gotcha. Yeah, that is a problem which just changing how your servervault is organized won't fix. You're going to want to start a new master database for all the PCs created and map them to CD key. That way you can at least determine if the CD Key has created a PC with that name before.

    Here's the code that we use to prevent duplicate PCs in our module. While you're going to need to modify it to suit whatever DB system you're using (we use NBDE for this), it should give you an idea of how to solve the problem in a way that works best for you.

    string sCDKey = GetPCPublicCDKey(oPC); string sPCName = GetName(oPC); int iTotalPCsCreatedByPlayer = NBDE_GetCampaignInt("MasterPCDatabase", sCDKey+"TotalCharacters"); if (iTotalPCsCreatedByPlayer) { //Ensure this PC has not been named after another due to persistency settings int i = 1; while (i <= iTotalPCsCreatedByPlayer) { if (NBDE_GetCampaignString("MasterPCDatabase", sCDKey+"Character"+IntToString(iTotalPCsCreatedByPlayer)) == sPCName) { sDisallowedMessage = "Due to persistency settings, you may not recreate a character whose name is the same as one of your previous characters."; WriteTimestampedLogEntry("DUPLICATE PC ALERT: "+sPlayername+" logged in with a character who had the same name as one they previously created."); break; } i=i+1; } } if (sDisallowedMessage == "") { //If this a new, valid character, record its name and player info to the master database int iNewPCDatabaseNumber = iTotalPCsCreatedByPlayer+1; NBDE_SetCampaignString("MasterPCDatabase", sCDKey+"Character"+IntToString(iNewPCDatabaseNumber), sPCName); NBDE_SetCampaignInt("MasterPCDatabase", sCDKey+"TotalCharacters", iNewPCDatabaseNumber); DelayCommand(1.0, NBDE_FlushCampaignDatabase("MasterPCDatabase")); }
    Post edited by Balanor on
  • shadguyshadguy Member Posts: 154
    @Balanor & co,

    Thanks for kicking off this discussion; I've been following without much to add since the thread was posted. Lately, as our migration gets closer, I've been starting to think about this more. I think with our legacy servervault we're a bit tied to the Sticky vault setup. I'm a bit concerned some players could "race" to claim someone else's chars. We're small enough this won't be an issue; if it comes up, we can deal with it case by case.

    However, one additional wrinkle we may want to consider: a single player may have more than 1 CDKey, through legitimate means, from a single purchase of the game. Since those who bought through Beamdog now also have a separate/different Steam key, we may need to associate multiple keys with one player when using Keys as player identifiers.

    Background info: https://forums.beamdog.com/discussion/69206/regenerated-cdkey

    Even without that, I can imagine players investing in multiple keys for whatever reason, and I'm wary of things like GoG potentially introducing even more Keys for individuals.

    I think for my server and community, I can go StickyAll and forget about it, handling issues case by case if necessary. I wouldn't want to do this for a large server with a large community of players.

    -Dave
Sign In or Register to comment.