-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random token numbering can result in duplicate token names #943
Comments
The random generator must be keeping a list of used numerals in memory. Question: if you use sequence vs random, does the count start over as well (I think this one checks for token names? At least partially) |
Confirmed. Note that setting to MT does keep a list of used random numbers assigned in memory which isn't preserved across restarts of the program. Choosing |
Yeah, I should have tested with non-"Creature" settings, sorry. I stumbled into the issue when trying to figure out why I was having issues with Bag of Tricks "on token move" macros moving the wrong token, and it took some troubleshooting to even identify that I had duplicate token names, which led me to a whole new set of experimenting to see why that happened and finally narrow down the key variable was multiple MapTool sessions. As an interesting coincidence, I happened to stumble on my first rptools.net forum post from September 2009, which just happened to be a bug report on random token naming way back in 1.3b57 with Azhrei being the first to respond. I was reading a bunch of these github issues to make sure this was a new issue and saw Azhrei is still active, so thanks for 10 years of MapTool improvements, and thanks to all of you other contributors for keeping this project thriving. I've been loving the 1.5x changes from the merging in of Jamz's fork. |
Phergus wrote:
Does it actually keep a list? IIRC, it generates a random number and then checks to see if a token with that name already exists by calling Rico wrote:
Yeah, it's been Jamz really keeping things alive on the coding side, but we now have a few more contributors — some code monkeys, some QA folks, some doc/wiki editors. All the thanks really go to the community for sticking around during the "dry spells"! ;) |
IIRC back in 1.4.1.x someone submitted an "improved" random generator, forgot what the improvement was, maybe the in memory list? I'm pretty sure there is a small class just for this. |
@RicoTheBold - No worries on the There have been a couple iterations of changes to the way the names are generated. Was it the 1.4.x change that went from 2 digit to 3 digit? |
Closing. |
Describe the bug
Copying/cutting a token and pasting can result in duplicate token names due to some kind of error in validation. This appears to only occur across multiple Maptool sessions.
To Reproduce
Steps to reproduce the behavior:
-Duplicate Token Numbering: Random
-Show Numbering on: Name
-New Token Naming: Use "Creature"
Expected behavior
MapTool should not create duplicate token names just because it has been closed and reopened. Users are instructed not to ever use duplicate token names. http://lmwcs.com/rptools/wiki/Introduction_to_Mapping#Changing_a_Token.27s_Name.2C_GM_Name.2C_and_Label
Screenshots
MapTool Info
Desktop (please complete the following information):
Additional context
Debug info:
==== MapTool Information ====
MapTool Version: 1.5.7 MapTool Home...: C:\Users\Rico\.maptool-rptools Max mem avail..: 4 GB Max mem used...: 254 MB Custom Property: -DMAPTOOL_DATADIR=.maptool-rptools==== Java Information ====
Java Vendor.: Oracle Corporation
Java Home...: C:\Users\Rico\AppData\Local\MapTool\runtime
Java Version: 10.0.1
==== OS Information ====
OS Name........: Windows 10
OS Version.....: 10.0
OS Architecture: amd64
PATH...........: C:\Users\Rico\AppData\Local\MapTool\app;C:\Users\Rico\AppData\Local\MapTool
Number of Procs: 8
==== User Information ====
User Name: Rico
User Home: C:\Users\Rico
User Dir.: C:\Users\Rico\AppData\Local\MapTool\app
==== Network Interfaces ====
Display Name..: Software Loopback Interface 1
Interface Name: lo
Address...: 127.0.0.1
Address...: 0:0:0:0:0:0:0:1
Display Name..: LogMeIn Hamachi Virtual Ethernet Adapter
Interface Name: eth4
Address...: 2620:9b:0:0:0:0:1903:3c87
Address...: fe80:0:0:0:c527:65f5:a8ae:ced3%eth4
Display Name..: Qualcomm Atheros QCA61x4A Wireless Network Adapter
Interface Name: wlan3
Address...: 192.168.1.181
Address...: fe80:0:0:0:d586:e408:bfe6:492d%wlan3
Host Address...: 192.168.1.181
Default Gateway: 192.168.1.1
==== Locale Information ====
Country.: United States
Language: English
Locale..: English (United States)
Variant.:
==== Encoding Information ====
Default Locale: en_US
Default Charset: UTF-8
file.encoding: UTF-8
sun.jnu.encoding: Cp1252
Default Encoding: UTF8
==== Display Information ====
Number of Displays: 1
Display 1: 3840x1080(32)
==== Internet Gateway Devices ====
No IGDs Found!
The text was updated successfully, but these errors were encountered: