New to the Maptools codebase
Moderators: dorpond, trevor, Azhrei
Forum rules
Posting now open to all registered forum users.
Posting now open to all registered forum users.
- Sheepyhead
- Kobold
- Posts: 6
- Joined: Wed Aug 30, 2017 8:53 am
- Location: Aarhus, Denmark
New to the Maptools codebase
Hey guys! My party have been using MapTools for a while now to great satisfaction, so I thought I'd look into contributing to the project! For now I've looked over the issue that attempting to embed an animated gif leads to strange (probably undefined) behavior, including crashing. I'm currently just trying to get an idea of the general structure of the software, and I'm having issues figuring out specifically where and how the HTML formatting is parsed. I've found the net.rptools.maptool.client.ui.chat.ChatProcessor class where it seems that messages pass through process(String incoming) unaltered, but trying to trace where in the chain of message processing this is happening is sorta difficult. It'd be awesome if someone more familiar with the software could help me figure out the structure of it, it's gonna take some time to figure out by myself
I guess I could write a bit about me; I recently graduated with a bachelor's degree in computer science from Aarhus University, and have been working with software development for 1-2 years on the side. I'm currently employed full time at a software consultant firm in Aarhus, so I've got a little experience, mostly with Java, but also with a bunch of other languages and paradigms etc. I hope I'll be able to contribute something meaningful
I guess I could write a bit about me; I recently graduated with a bachelor's degree in computer science from Aarhus University, and have been working with software development for 1-2 years on the side. I'm currently employed full time at a software consultant firm in Aarhus, so I've got a little experience, mostly with Java, but also with a bunch of other languages and paradigms etc. I hope I'll be able to contribute something meaningful
Re: New to the Maptools codebase
Hi, welcome to the rptools forum and thank you for the offer. I'll inform the devs of your request and perhaps one of them can help.
Aarhus IRC that lies in Danmark right? Recently read an article concerning the chief moderator (Viking83) of the trump-trolling subreddit forum and the impact he had on american society. Alledgedly he lived in Aarhus.
Been a couple of times to Denmark, it reminds me a lot of my own country.
anyhoot: welcome!
Aarhus IRC that lies in Danmark right? Recently read an article concerning the chief moderator (Viking83) of the trump-trolling subreddit forum and the impact he had on american society. Alledgedly he lived in Aarhus.
Been a couple of times to Denmark, it reminds me a lot of my own country.
anyhoot: welcome!
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- Sheepyhead
- Kobold
- Posts: 6
- Joined: Wed Aug 30, 2017 8:53 am
- Location: Aarhus, Denmark
Re: New to the Maptools codebase
Thanks for the welcome, and yes, it's in Denmark. Tiny city for being the second-largest city in the country, but I've always lived in or around it. The university is pretty well-known for having quality comsci courses though, which is nice. I can't talk about the trump-trolling subreddit though, I try to stay out of politicswolph42 wrote:Hi, welcome to the rptools forum and thank you for the offer. I'll inform the devs of your request and perhaps one of them can help.
Aarhus IRC that lies in Danmark right? Recently read an article concerning the chief moderator (Viking83) of the trump-trolling subreddit forum and the impact he had on american society. Alledgedly he lived in Aarhus.
Been a couple of times to Denmark, it reminds me a lot of my own country.
anyhoot: welcome!
I've already posted a comment on the issue tracker under the same account name as here, for now I'm just looking through the code base trying to figure out what's what.
Re: New to the Maptools codebase
i wasn't expecting to discuss politics with you. It as just that I read about Aarhus last week. I've informed the devs and also saw your notice on github.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: New to the Maptools codebase
Welcome aboard! I don't know where that code is offhand either, I would have to dig for it as well, sorry. But I would suspect it's not just chat parsing that causes issue but also rendering on the map... Some of the image stuff is also handled in rplib, a separate project and you may need to check that one out as well from github...
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
- Sheepyhead
- Kobold
- Posts: 6
- Joined: Wed Aug 30, 2017 8:53 am
- Location: Aarhus, Denmark
Re: New to the Maptools codebase
What I was thinking was that if I could follow the flow of events upon posting a message to the chat (at least locally), I'd find a point where it would make sense to look at what type of image it is, and reject it if it's animated, but the flow of events is a bit of an ordeal to track... I think a general overview of how MapTools works would help me quite a bit though.JamzTheMan wrote:Welcome aboard! I don't know where that code is offhand either, I would have to dig for it as well, sorry. But I would suspect it's not just chat parsing that causes issue but also rendering on the map... Some of the image stuff is also handled in rplib, a separate project and you may need to check that one out as well from github...
Re: New to the Maptools codebase
Welcome to RPTools!
All images go through the AssetManager, IIRC. That means that any GIF loaded by MT that has to be used anywhere would be processed by that class. I would suggest setting a breakpoint in the code that loads and/or retrieves images and watch it get hit the first time the image is used. (And if I've got the name wrong, there are two other ways to determine which class it is: follow the code for the asset:// URL handler, or the code that loads tokens from .token files since images have to be added to the cache when that happens.)
In terms of why it might crash, my fix would be to check any loaded GIF and if it appears to be an animated GIF, only keep the first frame and throw the other frames away. Then have the AssetManager cache that single frame so in the future only the single frame version is returned. This means that animated GIFs from the web would also work when dragged and dropped onto MT, since it's the AssetManager (or one of its related classes) that creates the cache under .maptool.
Such a fix would mean animated GIFs would work in the chat window an and also as tokens when dropped on a map, and their thumbnail would show up correctly in the Library panel.
All images go through the AssetManager, IIRC. That means that any GIF loaded by MT that has to be used anywhere would be processed by that class. I would suggest setting a breakpoint in the code that loads and/or retrieves images and watch it get hit the first time the image is used. (And if I've got the name wrong, there are two other ways to determine which class it is: follow the code for the asset:// URL handler, or the code that loads tokens from .token files since images have to be added to the cache when that happens.)
In terms of why it might crash, my fix would be to check any loaded GIF and if it appears to be an animated GIF, only keep the first frame and throw the other frames away. Then have the AssetManager cache that single frame so in the future only the single frame version is returned. This means that animated GIFs from the web would also work when dragged and dropped onto MT, since it's the AssetManager (or one of its related classes) that creates the cache under .maptool.
Such a fix would mean animated GIFs would work in the chat window an and also as tokens when dropped on a map, and their thumbnail would show up correctly in the Library panel.
- Sheepyhead
- Kobold
- Posts: 6
- Joined: Wed Aug 30, 2017 8:53 am
- Location: Aarhus, Denmark
Re: New to the Maptools codebase
Awesome, thanks for the hints! I'll take another look at it tomorrow, gotta go work out and then crash! Nice to meet you allAzhrei wrote:Welcome to RPTools!
All images go through the AssetManager, IIRC. That means that any GIF loaded by MT that has to be used anywhere would be processed by that class. I would suggest setting a breakpoint in the code that loads and/or retrieves images and watch it get hit the first time the image is used. (And if I've got the name wrong, there are two other ways to determine which class it is: follow the code for the asset:// URL handler, or the code that loads tokens from .token files since images have to be added to the cache when that happens.)
In terms of why it might crash, my fix would be to check any loaded GIF and if it appears to be an animated GIF, only keep the first frame and throw the other frames away. Then have the AssetManager cache that single frame so in the future only the single frame version is returned. This means that animated GIFs from the web would also work when dragged and dropped onto MT, since it's the AssetManager (or one of its related classes) that creates the cache under .maptool.
Such a fix would mean animated GIFs would work in the chat window an and also as tokens when dropped on a map, and their thumbnail would show up correctly in the Library panel.
- Sheepyhead
- Kobold
- Posts: 6
- Joined: Wed Aug 30, 2017 8:53 am
- Location: Aarhus, Denmark
Re: New to the Maptools codebase
I've looked into this now. So far it seems that the images in the chat do not pass through any of the createAsset() or getAsset() functions... I'll keep searchingAzhrei wrote:Welcome to RPTools!
All images go through the AssetManager, IIRC. That means that any GIF loaded by MT that has to be used anywhere would be processed by that class. I would suggest setting a breakpoint in the code that loads and/or retrieves images and watch it get hit the first time the image is used. (And if I've got the name wrong, there are two other ways to determine which class it is: follow the code for the asset:// URL handler, or the code that loads tokens from .token files since images have to be added to the cache when that happens.)
In terms of why it might crash, my fix would be to check any loaded GIF and if it appears to be an animated GIF, only keep the first frame and throw the other frames away. Then have the AssetManager cache that single frame so in the future only the single frame version is returned. This means that animated GIFs from the web would also work when dragged and dropped onto MT, since it's the AssetManager (or one of its related classes) that creates the cache under .maptool.
Such a fix would mean animated GIFs would work in the chat window an and also as tokens when dropped on a map, and their thumbnail would show up correctly in the Library panel.
Re: New to the Maptools codebase
Thanks for taking this on. It's been an oft requested bit of functionality. It will be nice to have it working properly.
Plus - you can use an animated gif on a token? I never knew that.
Plus - you can use an animated gif on a token? I never knew that.
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: New to the Maptools codebase
You can't.RPTroll wrote:Plus - you can use an animated gif on a token? I never knew that.
At least, not yet.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: New to the Maptools codebase
MapTool would a lot cooler if you could.
Re: New to the Maptools codebase
You can show animated gifs in other parts like chat or frames but you will need to reference an external url.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: New to the Maptools codebase
I also didn't know you could reference external URLs in frames. Geeze. I've been gone too long.
- Sheepyhead
- Kobold
- Posts: 6
- Joined: Wed Aug 30, 2017 8:53 am
- Location: Aarhus, Denmark
Re: New to the Maptools codebase
The entire issue right now seems to be that whatever is rendering images is sorta bad at animated gifs, some will show, some will cause a stack overflow, and some will freeze the entire program. For now the proper solution seems to be either displaying the error picture, or displaying only the first frame of the gif. I still haven't figured out where the frak embedded images pass through though...