Sign in to follow this  
ImRaginBro

Web Control Panel / Web RMI API / Live Online Map Viewer

Recommended Posts

RMI API & RMI Mod

 

Information/Readme: https://github.com/Garrett92/WurmWebRMI

 

RMI API Download: https://github.com/Garrett92/WurmWebRMI/releases/latest

RMI Mod Download: https://github.com/Garrett92/WurmRMImod/releases/latest

 

LifesaverM had the idea for a basic interface to use this tool. So I threw together a simple HTML/JS file that will allow you to use these commands and display the RMI output through an iframe.

example: http://rageland.from-ca.com/basicrmicontroller/basicRMI.html

download: http://rageland.from-ca.com/basicrmicontroller/download.php

Be sure to change the var 'RMI_CONTROLLER_IP' on line 11.

 

Usage:

http://localhost:8080/broadcast?Broadcast this message to the server
http://localhost:8080/shutdown?60&Server maintenance
http://localhost:8080/getOnlnePlayers
http://localhost:8080/getAllPlayers

 

Data will need to be parsed by a separate program/script. I've been using php for my website.

 

Custom Commands: (WurmRMI Mod)

Spoiler

messagePlayerCustom?[wurmID]&[customWindowTitle]&[senderName]&[message]&[red]&[green]&[blue]
	Sends the player a message - this command gives full control over the message
	Red, Green, and Blue will be the color of the text and should be a value of 0-255 for each.
	customWindowTitle will be the target tab. (You can set ':Event' for event log, or ':Local' or make your own)
	sender name will show up in the message as '<senderName> message'
messagePlayerPopup?[wurmID]&[windowTitle]&[message]
	Sends the player a popup window
messagePlayerPM?[wurmID]&[senderName]&[windowTitle]&[message]
	Sends the player a message through 'PM: windowTitle' <senderName> message
messagePlayerSystemPM?[wurmID]&[windowTitle]&[message]
	Sends the player a message through 'PM: windowTitle' <System> message
messagePlayer?[wurmID]&[messageType]&[message]
	Sends a message to the player through the event log (must be online)
getItemTemplates
	Returns a list of all item template ID's and names (used for giveItem command)
isPlayerOnline?[wurmID]
	Returns true or false if the player is online or not
giveItem?[wurmID]&[itemTemplateID]&[itemQuality]&[itemRarity]&[creator]&[itemAmount]
	Gives the specified player items (must be online)
changePower?[wurmID]&[powerLevel]
	Sets the players admin power level (must be online)
kickPlayer?[wurmID]&[message]
	Kicks the player and gives them a reason
getAllStructures
	Returns a list of all structures(houses/bridges) in the format STRUCTUREID=NAME
getAllGuardTowers
	Returns a list of all guard towers format: STRUCTUREID=[X,Y,CREATORID,CREATORNAME,QL,DMG]
getAllSteamIDs
	Returns a list of SteamID's stored in the DB in the format PLAYERID=[NAME,STEAMID64]

 

Commands: (no mod required)

Spoiler

broadcast?[message]
	Sends a message visible to all players on the server
shutdown?[time in seconds]&[message]
	Tells the server to shutdown in the specified amount of time along with a reason for the shutdown
cancelShutdown
	If a shutdown has been initiated, this will cancel it
isRunning
	Returns 'true' if running
	
getServerStatus
	Returns status of server - (If it is being shutdown or running)
getWurmTime
	Returns current time in wurm (as if you ran the /time command in-game)
getUpTime
	Returns the amount of time the server has been online in days, hours, and minutes
getAllServers
	Returns list of servers?
getAllServerInternalAddresses
	Returns list of servers?
	
getPlayerCount
	Returns the amount of players currently online
getOnlinePlayers
	Returns list of connected players in the format ID=[NAME,X-COORD,Y-COORD,(SEC)TIME-ONLINE]
getRecentPlayers?[timeInSeconds]
	Returns list of players that have been online within the specified time in the format
	ID=[NAME,(SECONDS)LAST-ONLINE,(BOOL)CURRENTLY-ONLINE].
	Note: If they are online, it will be (SECONDS)TIME-ONLINE
getAllPlayers
	Returns list of all characters registered on the server in the format NAME=PLAYERID
getPlayerStates?[playerID]&[playerID]&...
	Returns array of bytes of player states (unknown)
getPlayerIpAddresses
	Returns list of all players currently online along with their IP
doesPlayerExist?[playerName]
	Returns information on if the player exists or not
getSkills
	Returns list of the skill names and skill IDs
getSkillStats?[SkillID]
	Returns list of players with high levels in the specified skill
getBattleRanks?[Amount]
	Returns list of players and their battle ranks - limited by the amount specified
getPlayersForKingdom?[KingdomID]
	Returns list of players online in the specified kingdom
getAreaHistory?[Amount]
	Returns list of all history for the server limited by the amount specified
getKingdoms
	Returns list of kingdoms/IDs on the server
getKingdomInfluence
	Returns information about kingdom influence
setWeather?[windRotation]&[windPower]&[windDir]
	Unknown command - all vars requested are floats
	
getTileSummary?[TileX]&[TileY]&[Boolean surfaceTile]
	Returns information about the tile (surfaceTile argument must be 'true' or 'false')
getStructureSummary?[structureID]
	Returns information about the structure
getItemSummary?[itemID]
	Returns information about the item

getBannedIP
	Returns list of banned IP addresses
removeBannedIP?[IP]
	Removes specified banned IP address
addBannedIP?[IP]&[Reason]&[Days]
	Bans specified IP with reason and time length in days
getBannedPlayers
	Returns list of banned players
pardonBan?[playerName]
	Removes specified banned player from the banned list
banPlayer?[playerName]&[reason]&[days]
	Bans specified player with reason and time length in days

getDeeds
	Returns a list of active deeds on the server along with their villageID
getDeedSummary?[villageID]
	Returns information about the deed
getPlayersForDeed?[villageID]
	Returns list of players that are a part of the village
getHistoryForDeed?[villageID]&[Amount]
	Returns list of village history - limited by the amount specified
getAlliesForDeed?[villageID]
	Returns list of allies for the village

getPlayerID?[playerName]
	Returns players playerID
getPlayerSummary?[playerID]
	Returns information about the player
getFriends?[playerID]
	Returns characters on the players friends list
getPower?[playerID]
	Returns integer value of players administration power
getInventory?[playerID]
	Returns list of players inventory contents (must be online)
getBodyItems?[playerID]
	Returns list of the players body contents (must be online)
getBankAccount?[playerID]
	Returns list of players bank contents
getSkillsForPlayer?[playerID]
	Returns list of players skills in the format SKILL NAME=SKILL LEVEL
getMoney?[playerID]&[playerName]
	Returns players banked money in iron. (20000 would be 2 silver)
addMoneyToBank?[playerName]&[playerID]&[amount in iron]
	Adds money to players bank
chargeMoney?[playerName]&[amount in iron]
	Removes money from players bank
	
findPlayersWithSteamID?[steamID64]
	Matches any players with the supplied steamID returns PLAYERID=[PLAYERNAME,POWER]
findSteamIDPower?[steamID64]
	Returns the integer value of the highest power player from the findPlayersWithSteamID list
genPassword?[playerName]&[steamID64]
	Returns the encrypted password so you can match it with the database
checkUserPass?[playerName]&[steamID64]
	Returns some information the player if the name/password is valid
	
createPlayer?[playerName]&[steamID64]&[kingdomID]&[gender]&[power]
	Creates a player on the Wurm Unlimited server
renameCharacter?[oldName]&[newName]&[steamID64]
	Renames the player
changePassword?[playerName]&[steamID64]
	Changes the players password
changeEmail?[playerName]&[oldEmail]&[newEmail]
	Changes the email assigned to the player account

 

 


Wurm Unlimited Control Panel

This is an early release - but it has the basic functions/features

Requires the RMI API to be running, and the mod for some of the available commands.

Download: https://github.com/Garrett92/WurmUnlimitedControlPanel/releases

 

Live Example: http://rageland.from-ca.com/

 

Features:

  • Steam API login system
  • Administrator levels automatically assigned based off of in-game power (using the Steam API)
  • Access to every command and page is able to be customized for the different power levels
  • Basic server information (Players Online / Up-time)
  • Live listings for Players/Villages (along with information)
  • User-claimed wurm-unlimited.com voting rewards system
  • Player controls - Give Item, Give/Remove Money, Ban/Unban Player, Change Power
  • Map Page with an iframe for linking to an online map

 


Live Online Map Viewer

 

Development has been taken over by LordOfAwesomnia, please go to his forum post for any questions/bugs.

 

 

Download: https://github.com/Garrett92/WurmMapGen/releases/latest

 

Live Example: http://rageland.from-ca.com/map/index.php

 

Note: Using the live (index.php) version requires the RMI API to be running, otherwise use index.html

 

Features:

  • Displays deeds, guard towers, structures, bridges, and player locations (player locations require the RMI API)
  • Live map shows player locations, guard towers, and structures in real time
  • Fast multi-threaded map generation.
  • Made using Leaflet
  • Easily customizable - many addons/options to choose from for leaflet

 

Edited by ImRaginBro
Cleaned up page
  • Like 5

Share this post


Link to post
Share on other sites

No

Edited by Sklo:D
  • Like 1

Share this post


Link to post
Share on other sites

Played around with this a bit just to see what worked and what I could do on a test box. My biggest critique at this point is this. Since you are are not using a web server on the box but a separate process you absolutely need the ability in the configuration to bind it to an IP. It does not play well on multi-IP boxes. Not one of my servers has less than 7 IPs with a combination of Private and Public Network IPs and IPv4 and IPv6 (though I certainly don't expect IPv6 functionality from this tool). In addition if I know the URL I can screw with the box which troubles me however if I can bind the web server to the IP of the Private LAN vs a Public IP then I'm happy with the whole thing as is because the risk is mitigated. I'd love to have buttons/menus/GUI but even as is there are some nice abilities here, in particular if running your custom MOD.

 

This is a nice framework however not quite ready for a production environment yet at least IMO. However I really look forward to seeing what you do with it! Keep up the good work.

 

Now on to the Map Generator. Hello this is on the fast track to greatness. Having to click on the names is different but not bad. Having shown it to some people they actually preferred it. It renders quite fast, and it loads images faster on the client side even driven from the same webserver. The deed borders and colors work well but the map doesn't seem to be displaying guard towers at all (which is something I REALLY want). Other than that I have quite a bit of praise to give.

Share this post


Link to post
Share on other sites
19 hours ago, LifesaverM said:

Played around with this a bit just to see what worked and what I could do on a test box. My biggest critique at this point is this. Since you are are not using a web server on the box but a separate process you absolutely need the ability in the configuration to bind it to an IP. It does not play well on multi-IP boxes. Not one of my servers has less than 7 IPs with a combination of Private and Public Network IPs and IPv4 and IPv6 (though I certainly don't expect IPv6 functionality from this tool). In addition if I know the URL I can screw with the box which troubles me however if I can bind the web server to the IP of the Private LAN vs a Public IP then I'm happy with the whole thing as is because the risk is mitigated. I'd love to have buttons/menus/GUI but even as is there are some nice abilities here, in particular if running your custom MOD.

 

This is a nice framework however not quite ready for a production environment yet at least IMO. However I really look forward to seeing what you do with it! Keep up the good work.

 

Now on to the Map Generator. Hello this is on the fast track to greatness. Having to click on the names is different but not bad. Having shown it to some people they actually preferred it. It renders quite fast, and it loads images faster on the client side even driven from the same webserver. The deed borders and colors work well but the map doesn't seem to be displaying guard towers at all (which is something I REALLY want). Other than that I have quite a bit of praise to give.

 

Thanks for the feedback! 

I'll definitely look into the ability to bind the socket to a specific IP.

 

As for the guard tower location on the map... it does require the RMI tool along with the mod running on the server.

If you already have that setup, it could be a problem with my code - I've only tested it on a creative server, so I'm not sure if the adventure guard towers are different.

But, if you do have the RMI tool and mod running, try this and see if it is printing all of the guard towers. 

Also - be sure you are loading the map with the index.php file, not the index.html

 

EDIT:

Okay, I went ahead and finished those updates. I don't have a server configured with multiple IP's, but from the couple of tests that I was able to do, this seems to be working.

Added 2 new options to the properties file for binding the socket and whitelisting IPs. Test it out and let me know if it works!

#Bind socket to a specific IP (leave blank to bind to all local IP, otherwise specify IP)
bindSocket=
 
#Allow connections from specified addresses (* = allow all, otherwise specify allowed IPs separated by commas)
#You may use an asterisk(*) as a wildcard
#Multi-IP Example: limitConnection=127.0.0.1,192.168.1.*
limitConnection=*

 

EDIT 2:

Updated the MapGen as well. Should be able to see guard towers and structures without the RMI tool. (index.php will still contain the live-updater through RMI, index.html will be data stored on generation)

Edited by ImRaginBro
  • Like 1

Share this post


Link to post
Share on other sites

Just a couple tidbits from previous testing: None of the servers on this box are Adventure, and I was running all 3 pieces of your software. Custom RMI mod, the RMI tool and the Map Gen. I'd have to check the priority order for which file extension the webserver will grab first. I didn't specify either index file so whatever it pulled up by default is what I got, though the towers have existed on the server for a long time so when I ran the script to generate the files I'd think it would have grabbed them.

 

I'll update everything, give it a whirl and report back. :)

Share this post


Link to post
Share on other sites

Ahh I see. On my server it does load index.html if nothing is specified.

It doesn't matter now though, either one will work. Be sure to delete the browser cache if you do have any issues.

 

index.php uses the .php script includes - so it can update the map live on the server using the RMI tool.

Though I'm honestly not sure if this will be tough for a server with lots of structures/players/guard towers... it could be quite a bit of data to load on every page refresh.

 

index.html uses .js script includes - which is the data that is stored during generation, pulled from the server DB's

Edited by ImRaginBro

Share this post


Link to post
Share on other sites

I messed with both html and php versions. I don't have enough data yet to determine server load on the dynamic version will collect more data. I did look at the webserver and yes index.html is higher in the default order so it is loading it by default which is good at this point. I may look to restrict access to the index.php file through some security function so that only my staff can access it. I could see two reasons 1) Not sure I want everyone seeing where everyone is live however this would be a big benefit to staff. 2) Server load variable at this point with as many hits as our online map viewer gets now and plethora of refreshes not sure if this will be a good thing. Again need more data to establish a proper opinion. However again like the previous point staff having basically a true live view rather wait till the top of the hour for a refresh (how often I have our map viewer refresh currently, once an hour) could be a real asset and time saver.

 

All options appear to be generating correctly now and the php version is pulling the online player placement as expected.

 

As for the webRMI tool itself I've gone thru each function and have notes on oddities:

  • getPlayerIpAddresses - did not appear to return any data, just a blank page no errors
  • getKingdoms - returns kingdom list for only players online don't know if this in intended behavior or not
  • getAllSteamIDs - same as above returns data for online players only, not sure if this is intended or not
  • did not yet test the add/remove player/IP bans, however the lists seem fine
  • getFriends, getAlliesForDeed, createPlayer, renameCharacter, changePassword, changeEmail - not tested
  • messagePlayer - what are the accepted variables for MessageType?

I'll also send you a PM on a couple other tidbits.

 

EDIT: Realizing I'm tired and forgot to test the binding of the IP and the whitelist (great idea btw) I will test those in the morning.

Edited by LifesaverM
Adt'l Info

Share this post


Link to post
Share on other sites

getPlayerIpAddresses - this command works for me? -- only shows online players IP's

 

getKingdoms - I'm not totally sure to be honest. this is a default RMI command. Do you only have one kingdom on the server? or multiple? (Mine returns "4=Freedom Isles", but I only have one kingdom)

 

getAllSteamIDs - this is actually a totally separate database. The RMI mod creates a database to store SteamIDs... so until a player logs in, you wont have their steamID. So you should notice this list grow over time as more users log in. It's the only way I could make this happen, as wurm doesn't store the players steamID anywhere. (Check out your mods/customRMImod directory... you will see a steamID.db located there)

 

messagePlayer - message type is 0 or 1. If I remember correctly: 0 sends to event log... 1 sends to event log and the players screen

Share this post


Link to post
Share on other sites
16 hours ago, ImRaginBro said:

getPlayerIpAddresses - this command works for me? -- only shows online players IP's

Ok, did some further testing it seems this command for whatever reason is only returning IPs for Power 0 players. Others characters (tested with power 1, 4 and 5) are not showing. This really isn't a problem in its current state though, now that I know what it is doing.

 

 

16 hours ago, ImRaginBro said:

getKingdoms - I'm not totally sure to be honest. this is a default RMI command. Do you only have one kingdom on the server? or multiple? (Mine returns "4=Freedom Isles", but I only have one kingdom)

Ok if this is the default command then it should return online players in a kingdom or single if a homed server from my understanding of the code.

 

16 hours ago, ImRaginBro said:

getAllSteamIDs - this is actually a totally separate database. The RMI mod creates a database to store SteamIDs... so until a player logs in, you wont have their steamID. So you should notice this list grow over time as more users log in. It's the only way I could make this happen, as wurm doesn't store the players steamID anywhere. (Check out your mods/customRMImod directory... you will see a steamID.db located there)

Aye, further testing proved this. Seems to be functioning as intended.

 

16 hours ago, ImRaginBro said:

messagePlayer - message type is 0 or 1. If I remember correctly: 0 sends to event log... 1 sends to event log and the players screen

Delightful tested both and they are wonderful. Do you think color coding would work like you can via ingame chat? Right now its white which unless you are doing event window and screen I could see someone missing this easily. Other than that I'm delighted by this ability. If I'm on the run and need to let someone know something in world and to be able to tell them something without having to jump in game is wonderful.

 

----

In other news: Both the IP binding and the White-listing work perfectly. Having this extra layer(s) of security has me well satisfied and I'm looking forward to rolling this to production very quickly now that I can mitigate security risks.

 

Additionally completed tests of all the Player and IP banning/pardoning and all commands work. As well as getFriends, getAlliesForDeed. So only 4 commands I haven't tested now are createPlayer, renameCharacter, changePassword, changeEmail.

  • Like 1

Share this post


Link to post
Share on other sites

Released the control panel source for anyone interested.

It's an early beta and there are still quite a few things I plan to change.

But this will give some basic functionality for server information/player control.

 

Control panel source: https://github.com/Garrett92/WurmUnlimitedControlPanel

Releases: https://github.com/Garrett92/WurmUnlimitedControlPanel/releases

  • Like 1

Share this post


Link to post
Share on other sites

MalwareBytes are a bit sensitive, and results in a lot of false positives.

They have managed to block a pile of things I use for games and dev stuff :(

 

 

Share this post


Link to post
Share on other sites

I've tested the Live Map Viewer as a replacement for Jonneh's live map viewer.  Looks great and loads fast.  Only gripe from my players is that it only shows flat view.  I think my playerbase liked the 3D view by default with the option to switch to flat view.  Any chances for this to be added in a future update?

  • Like 1

Share this post


Link to post
Share on other sites

Any idea why the guardtowers and structures only appear when I look at the map using a browser on the server itself, but another machine on the LAN just sees the map, deeds, and players?

 

I'm running on IIS if that is a factor.

Share this post


Link to post
Share on other sites
On 9/28/2017 at 1:33 PM, mwdennis said:

I've tested the Live Map Viewer as a replacement for Jonneh's live map viewer.  Looks great and loads fast.  Only gripe from my players is that it only shows flat view.  I think my playerbase liked the 3D view by default with the option to switch to flat view.  Any chances for this to be added in a future update?

It's actually not a flat view more of a blended view. The map does show in 3D height but renders things like highways with the flat concept.

 

On 10/7/2017 at 2:56 AM, vardoj said:

Any idea why the guardtowers and structures only appear when I look at the map using a browser on the server itself, but another machine on the LAN just sees the map, deeds, and players?

 

I'm running on IIS if that is a factor.

Can't think of any reason that would be happening. Have a link to your map so I can see what displays to test? (I run IIS as well)

Share this post


Link to post
Share on other sites
On 9/28/2017 at 10:33 AM, mwdennis said:

I've tested the Live Map Viewer as a replacement for Jonneh's live map viewer.  Looks great and loads fast.  Only gripe from my players is that it only shows flat view.  I think my playerbase liked the 3D view by default with the option to switch to flat view.  Any chances for this to be added in a future update?

I don't plan to add a 3D view, I never really cared much for the look of it. Though I do believe the Wurm Map API includes the function to generate it. If you'd like that, you are on your own. I haven't had much time for coding anything lately as I've started a new job.

 

On 10/6/2017 at 11:56 PM, vardoj said:

Any idea why the guardtowers and structures only appear when I look at the map using a browser on the server itself, but another machine on the LAN just sees the map, deeds, and players?

 

I'm running on IIS if that is a factor.

I'm not to sure what would cause this. Check access to these files from the other machine:

includes/structures.php, includes/guardtowers.php

(or for the html version)

includes/structures.js, includes/guardtowers.js

Share this post


Link to post
Share on other sites

About guard towers: I found that the live view (PHP) can break easily if you have towers without a creator wurm ID, with a side effect of these towers only appearing at the far top right corner (position 0, 0). Whereas on the static view (HTML) they would appear, but some towers would just be missing or have a "null" creator.

 

To resolve this you'd need to ensure that all guard towers have a creator wurm ID, which involves shutting down your server and editing the items database in an SQLite editor. Open up the "ITEMS" table, search for all items with name "guard tower", and ensure the "LASTOWNERID" column for each tower item has a valid wurm ID number. If you find any with zero, negative, or empty numbers just put yours in temporarily.

 

(This is a fault with your world database, not a fault with the map viewer here.)

Edited by Adambean

Share this post


Link to post
Share on other sites

Could someone please post step by step install instructions for the Web Control Panel / Web RMI API. Would be very appreciated! :)

Edited by Darkness1990

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this