X39.io
A fancy world of magic, unicorns and a raging lazy dev

About the OnePlus5 and their first come last serve policy
by X39


I usually keep calm when things do not go as expected ... but this time? This time it is too much!

I ordered the OnePlus 5 as my new smartphone on tuesday and ... the entire delivery is a disaster ...

First you discover that ppl who ordered a half day after you, who patiently watched the livestream for that bloody damn fucking "access code" so that you could order the doomed phone, not only have their phone already sent, no! They also already received it.

Then after contacting the support, and ranting in reddit about that they fucked up their order sorting, your phone finally gets shipped. But wait! There is more!

Now that it finally got on the way to you, you feel kinda happy it arrived in the DHL HUB and you think "now nothing can go wrong, everything will be fine from here" but well ... not here, not now

"Technical issues" prevent further processing ... something that seems to be common with the OnePlus releases

so you start getting angry and contact DHL just to discover that finding the right contact formular is a mess ... after an hour of searching the right one you finally sent the message to them

hours later, still no reply ... you contact the one plus support and ask them .. they just say "our logistic specialist is on it" and thats it ... case closed, nothing to do ...

you start considering calling the support hotline but as angry as you are right now, you know you would just start yelling after 2 minutes when they repeat those default questions again and again and again and again just because they want to get you done ...

so here i am now ... fucking angry and writing a rant to calm down ... i am pissed, and already considered to cancel my OnePlus 5 and just grab ... idk ... a nokia ... one of the ancient ones

at last, this is the worst experience i EVER had with with delivery especially when it gets as expensive as it is right now (>500€ for that fucking phone) things like this are not acceptable ...

anyway ... i need to get back to F5ing my email inbox

A quick update about my modding & tool activities
by X39


Recently checked the different sources again and noticed: i got various questions about XInsurgency, ArmA-UI-Editor, ...

soooo ... why are all theese things "dead"?

well ... first of all: they are not dead, they are on hold. Currently, there are higher priorities then a free non-money bringing hobby ...

what does that mean?

I am currently busy ... and cannot work on my projects :3

i do when i find spare time ... but most things are just waaaayyy to big to simply throw out an update here and there .. do not worry ... i will continue sooner or later ... but right now ... there is simply no way for me to spend more time in my hobby

kindly regards, X39

HTTPS enabled again
by X39


Implementing LUA 5.3 with custom C functions
by X39


I recently had to implement a script language to make developing new "features" for my lil IRC bot more simple.

turned out this was more complicated then i initially thought ... the different stackoverflow pages and tutorials for the various things required all talk about different versions which differ highly as mostly deprecated functions have been used ... sooo lets start telling you how you also can use LUA :)

Preparations

As with pretty much everything, you have to prepare your LUA object before you actually can use it. Preparing means in this context:

  • create the LUA Virtual Machine
  • load the different libraries

should not be that hard right? well ... you are right :)

first of all, you have to include the lua headers

#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>

when this is done, you have to create your LUA-VM and save it to a variable by using lua_State *LUAVM = luaL_newstate()

Now that you finally got your LUA object initialized, open the libraries you want to use. The default ones can be loaded via luaL_openlibs(LUAVM)

and thats it :)

Your very own C-Functions in LUA

Now this topic ... this was really a hard one ...

the documentation is kinda good but also a gigantic beast ... hard to google, harder to understand properly unless you read everything ...

soooooooo ... lets get trhough it quickly :)

first of all, let me introduce you to the LUA-Function callback int lh_your_fnc(lua_State *L). This little function head will be your best friend for all theese nasty C functions you want to create. The return value will tell lua if there is a return value on the stack (1) or not (0) and the lua_State variable will contain the VM that is calling that specific function.

Lets write a little test function that does nothing but printing something to stdout :)

int lh_hello_world(lua_State *L)
{
    printf("hello world\n");
}

the question now is: how to call this function from within lua? well: you either have to put theese into a separated library and use require to load them or you have to load them manually

but how does that work? that is where the different versions will fuck around with your google searches and where i will help you :)

First you will need to create a new lua function int lh_my_lib(lua_State *L) in which you create a new luaL_Reg structure. That luaL_Reg structure will contain your different functions and has to end with a { NULL, NULL } entry. When created, you have to pass it to the luaL_newlib function to create the table for your library and then return a 1 as result for that function as you left something on the stack. Now lets throw this together for our hello_world function:

int lh_my_lib(lua_State *L)
{
    static const struct luaL_Reg my_lib[] = {
        { "helloworld", lh_hello_world },
        { NULL, NULL }
    };
    luaL_newlib(L, my_lib);
    return 1;
}

but hold on! we are not yet done! To now get it into your VM, you have to "assign" it a global variable ^^

this is done by calling luaL_requiref(LUAVM, "testlib", lh_my_lib, 1) which is basically the C variant of the require function in LUA.

After all this, you finally can call the helloworld function by using testlib.helloworld() in lua :)

Moved Server
by X39


You might have noticed a few changes on the webpage (eg. HTTPS currently is no longer working .... gahhahah :3)

those changes come due to a server change

i threw away that crap which is no longer needed (eg. the WIKI) and just kept the "important" stuff also now using nginx ... but thats not interesting for this specific webpage :P (but thats the reason why there is no HTTPS yet ^^')

everything else should work like usual however, if you expecience any error, please e-mail me or write me a PN on the usual sources

Redesign
by X39


Hello there

as you, the visitor, might have noticed, i changed a "few" things on my webpage in regards of the design

first of all: this wont be the last change loads of back-end code is getting rewritten ... but well ... for now, try hovering the bar at the top :)

X39