WebUI for iPhone, Android, and other mobile devices

Chish

Member
Note: EggMan247 and I are not web developers and we know next to nothing about HTML, javascript, and CSS. (real niggaz code in C.) Minor functionality is present and we're hoping someone that has a better idea of what they are doing will jump on our project to help out. It looks fairly bad right now. The gCLI works so you can do basically anything. The ultimate goal is to have a browser interface that looks just like regular old mafia.

here's some screenshots of the latest release:
http://i.imgur.com/xHg58.png
http://i.imgur.com/Ugjzv.png

here is some code that is quite bad. While it is not technically a "relay override script" I included it in this section of the forum because it belongs in /relay.

View attachment kolmafiawebui.zip

Installation instructions:
extract the zip to your KoLmafia folder
log in using KoLmafia
load up [your IP address]:[port -- typically 60080]/webui.html in your web browser
 

Attachments

  • webui.zip
    3.1 KB · Views: 131
Last edited:

Chish

Member
Please do not support bug reports or complain about the low quality yet as we are well aware of exactly how shitty this is.

Do add to the discussion or share ideas, though!
 

Chish

Member
Could you specify how to use this...?


1. Run mafia on your computer. In "General --> Preferences," check the option "Allow network devices to access relay browser (requires restart)."
2. restart mafia (not needed if you had already checked that option), login
3. Open up [your computer's network IP address]:[the port mafia is running on, typically 60080]/adventure.html in your browser on your mobile device. This should give you a URL that looks something like "192.168.1.38:60080/adventure.html" as seen in the screenshot, although the last two octets (especially the last one) in the IP address will likely be different.

If you cannot figure out your computer's network IP address, this is not the place to ask. Google it.
 

xKiv

Active member
If you cannot figure out your computer's network IP address, this is not the place to ask. Google it.

Note: Google will probably not tell you what your computer's IP address is (unless you are directly on the internet without any NATs, like if you already have IPv6), just how to find it ;-)
 

fronobulax

Developer
Staff member
Note: Google will probably not tell you what your computer's IP address is (unless you are directly on the internet without any NATs, like if you already have IPv6), just how to find it ;-)

Ah, the ambiguity of English. I clearly understood the post to mean "Google the internet to find a way to find out your IP address". For the record this network scanner is one of several tools that can tell you either your internal or external IP address so the lazy do not have to search. As described, it seems to me that the Android and computer running mafia will need to be on the same LAN (or behind the same NAT) or the external address will be required anyway.
 

Theraze

Active member
But you need your private, internal IP address. If your public IP address is actually the same one as your computer's IP address, you're right on the internet without a router, and if you've left all your ports open without a firewall, it should take about... 30 seconds, I think, for your computer to become a part of a botnet farm. Believe that was the figure I heard.

If you're on a 'normal' home network, you have a router that's sitting between you and the internet and providing private IPs, generally in the 192.xx.xx.xx range. Googling your public IP won't tell you what that is...

Example:
Your public IP address is 152.xx.xx.xx
My actual IP, from ipconfig:
IPv4 Address. . . . . . . . . . . : 10.1.xx.xx
That's the one I'd need to connect to my computer if I'm not trusting everyone in the world to have good intentions... :)
 

xKiv

Active member
I clearly understood the post to mean "Google the internet to find a way to find out your IP address".

So did I, but we both already know and understand what the diffferences are.

Also, if I want my "internal" IP address, I would never trust jsut any program from the interent.
Windows has ipconfig, unix/linux ifconfig.
 

Chish

Member
This thread already has over 200 views. Jeez.

Posting to let you know we didn't die over the weekend. Progress on this project is slow but steady. the javascript and css have been separated out into their own files and are getting additions. The HTML itself is being rewritten to actually be at least somewhat standard-compliant.

Some features will likely be missing for a while (example: Item Manager) as it seems impossible to code without altering Mafia's base code. We are not averse to that, but we are averse to users of the WebUI being forced to download an unofficial build, apply a bunch of patches, and then compile it themselves just to use it. But we'll cross that bridge when we get to it.
 

Catch-22

Active member
RE: IP address stuffs.

Your local IP address will only be useful for accessing the WebGUI if you're on your home network (such as connected via WiFi), OR if you have a VPN connection setup between your mobile device and your home network.

If you want to access the relay browser from outside your home network, you're going to need to allow KoLmafia through any firewalls you have (such as Windows Firewall) and (assuming you're behind a NAT like most home users on the internet) forward the ports on your router.

it should take about... 30 seconds, I think, for your computer to become a part of a botnet farm.

Theraze, I think someone may have been pulling your leg when they gave you those figures (or they were trying to sell you security software, haha). Lots of single port modems don't do routing, they just hand the PPP session directly to the computer. You'd need a listening service on the local machine binding to the internet address with a vulnerability that allows remote code execution and privilege escalation, even then someone would have to find you on the internet first through aggressive port scanning of large ranges of public IP address. Having said all that, giving your PC a public IP address or placing your device in a DMZ is a bad idea unless you know exactly what you're doing.
 
Last edited:

Theraze

Active member
Oh, I was talking about if you were attached to the internet using a straight up hub or a pass-through modem (DMZ would be similar, but still slightly more protective), which hasn't worked for me personally for ~12 years, but used to be possible before ISPs realized that giving unlimited IPs just because you asked for them was a bad idea. :)

But ~13-17 years ago when my worksite at the time had all of the clients directly on the internet with static IPs and BlackIce was still considered an awesome firewall, you'd get scanned every minute or two by someone or another. :) Think it was about 13 years ago when they finally decided that just because they had 8 class Cs didn't mean they needed to use them, and they could start using DHCP and private IPs. Heh.
 

Chish

Member
Updated! Progress continues. Now use webui.html rather than adventure.html.

Please note that none of the top buttons actually work yet. We're working on it, we just wanted to get a less terrible version out to help generate some more discussion.
 
Top