Author Topic: BL-Browser - The in-game Browser [Experimental][v0.2.1]  (Read 47800 times)

I was able to see videos on another server so I made one with the mod running and loaded a page yet others can't see it. Those other players had it work for them on another server before. Is there anything I need to do as a host so my players can see the screen? They bind the textures and everything but it doesn't show up.
yeah you need server sided code to tell the clients to load the page you are looking at. currently only supports youtube links, though.

its just not working for me. If i try booting up using steam it does not authenticate with the master server and if i boot blockland up using the run.bat i need to input a key... But i only have a steam key.
weird. i know a number of people who use steam and have no problem with getting this mod to work. maybe try restarting steam or such. run.bat wont work since that loads bl without the launcher and thus assumes you have a key.dat in your folder to authenticate with

Put -steam at the end of the batch command, that might work

this is actually pretty cool, reminds me of minecraft's web displays mod.

continue your work, it's nice.

I think it would be beneficial to add some calls to get or print Windows system error code messages when you use Windows API calls. Something along the lines of this would help users describe any issues going on.

Code: [Select]
std::string getError() {
    char *pBuffer = nullptr;
    DWORD dwSize = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
        nullptr, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast<char*>(&pBuffer), 0, nullptr);

    if (dwSize > 0) {
        return std::string(pBuffer, dwSize);
        LocalFree(pBuffer);
    }

    return std::string("Unable to fetch error message");
}

yeah you need server sided code to tell the clients to load the page you are looking at. currently only supports youtube links, though.
Is this server sided code available somewhere?

So if you made a massive print, would it scale up the same resolution or adjust to the new one?  Because making large screen prints seems like a really good idea with this, if resolution can be adjusted.

Nevermind, actually read the topic and saw it's been done.  So what some kind of remote Add-On, where the host and perhaps admins have control over a remote that can be "passed around".  Sever and Client, where the Client is a remote GUI?
« Last Edit: January 18, 2017, 11:18:24 AM by SWAT One »


status update?
Rewriting the code to make it possible to call ::setView(%viewIndex) on a guibitmapctrl for gui support. ( Up to 64 different browser pages )
Harder than I expected since I have to include the structure for console object, simobject, simset, simgroup, guicontrol, textureobject, texturehandle, and of course guibitmapctrl.
Also have to figure out how to create a TextureObject so I can actually set it to the GuiBitmapCtrl without piggy backing off of an already made texture.

Bump.
V 0.2.0 released, this isn't the release that adds guibitmapctrl support, but it adds a lot of new features.
You can now send mouse and keyboard events to the view via AWS_MouseEvent(%x, %y, %btn) and AWS_KeyboardEvent(%char, %shift);
Scrolling is also possible with AWS_scrollWheel(%vert, %horiz);
Also with this release adds automatic AWS_BindTexture(); on spawning, AWS_LoadUrl(""); (loads a blank page) on leaving, aand clientCmdAWS_LoadUrl(%url); for loading any page the server requests.
Release page is here, along with a list of functions.


Also forgot to post this, an example on how to utilize the AWS_MouseEvent.

Code: [Select]
function fxDTSBrick::getBrowserPos(%this, %location) {
%vec = vectorSub(%location, %this.getTransform());
return ((getWord(%vec, (%this.angleID&1) ? 0:1) * ((%this.angleID>>1) ? "-1":1) )+ 4)/8*1024 SPC 768-(getWord(%vec, 2)+3)/6*768;
}
package browserSupport {
function GameConnection::browserSupport(%this) {
cancel(%this.bs);
if(isObject(%player=%this.player)) {
%ray = containerRaycast(%player.getEyePoint(), vectorAdd(vectorScale(%player.getEyeVector(), 30), %player.getEyePoint()), $TypeMasks::FxBrickObjectType, "");
if(isObject(%ray) && %ray.getDatablock().printAspectRatio $= "Screen") {
%playero = %ray.getBrowserPos(posFromRaycast(%ray));
bottomPrint(%this, "\c6" @ %playero, 3);
commandToClient(%this, 'AWS_MouseEvent', getWord(%playero, 0) | 0, getWord(%playero, 1) | 0, 4);
}
}
%this.bs = %this.schedule(100, browserSupport);
}
function Player::activateStuff(%player) {
if(isObject(%client = %player.client)) {
%ray = containerRaycast(%player.getEyePoint(), vectorAdd(vectorScale(%player.getEyeVector(), 30), %player.getEyePoint()), $TypeMasks::FxBrickObjectType, "");
if(isObject(%ray) && %ray.getDatablock().printAspectRatio $= "Screen") {
%playero = %ray.getBrowserPos(posFromRaycast(%ray));
commandToClient(%client, 'AWS_MouseEvent', getWord(%playero, 0) | 0, getWord(%playero, 1) | 0, 0);

}
}
return Parent::activateStuff(%player);
}
};
activatePackage("browserSupport");


no joke, i'm writing this using the browser in-game. i've no idea how to backspace
also please add a function to set/get html from the page.
« Last Edit: February 01, 2017, 01:43:14 PM by RTBARCHIVE »

no joke, i'm writing this using the browser in-game. i've no idea how to backspace
also please add a function to get html from the page. this would bypass blockland's limitations for https  in some way.
Found out how to backspace. After some research, I discovered that this does it:
ws_keyboardevent("\x08",1);

also
« Last Edit: February 01, 2017, 03:13:50 PM by RTBARCHIVE »

How have you guys been getting videos to go full screen?
Nevermind, I'm an idiot. Figured it out

« Last Edit: February 01, 2017, 03:49:22 PM by EcstaticEggplant »