Skip to content

Instantly share code, notes, and snippets.

View sapier's full-sized avatar

sapier

View GitHub Profile
@sapier
sapier / gist:8775519
Created February 2, 2014 21:57
minetest command line interface
$ ./madmin.lua 13094 playerlist full
Current players on server: 1
sapier
IP Address : 127.0.0.1
IP Version : 4
min. rtt : 0.0010
max. rtt : 0.0150
avg. rtt : 0.0010
min. jitter : 0.0000
max. jitter : 0.0120
print("FCT: " .. dump(serialized_function))
print("DATA: " .. dump(serialized_data))
../LuaJIT-2.0.0-beta6/src/luajit test.lua
1 a
2 b
3 c
table: 0x41e287b0 tval
../LuaJIT-2.0.0-beta6/src/luajit: attempt to index a string value
stack traceback:
[C]: in function 'decode'
test.lua:29: in main chunk
[C]: ?
+------------+-----------+---------------------+------------+-------------------+--------------------------+---------------------+
+ C-Version | S-Version | Textures@Client | Curl | Models visible | connect successfull | players delayed |
+------------+-----------+---------------------+------------+-------------------+--------------------------+---------------------+
+ 0.4.9 | no fix | no | no | ? | no | ? +
+ 0.4.9 | no fix | yes | no | yes | yes | yes +
+ 0.4.9 | no fix | no | yes | yes | yes | yes +
+ 0.4.9 | no fix | yes | yes | yes | yes | yes +
+------------+-----------+---------------------+------------+-------------------+--------------------------
/*
* State Transitions
Start
(peer connect)
|
v
/-----------------\
| |
| Created |
std::wstring wlabel = narrow_to_wide(label.c_str());
FieldSpec spec(
narrow_to_wide(name.c_str()),
wlabel,
L"",
258+m_fields.size()
);
spec.ftype = f_Button;
if(type == "button_exit")
u32 getDeltaMs(u32 old_time_ms,u32 new_time_ms) {
if (new_time_ms > old_time_ms) {
return (new_time_ms - old_time_ms);
}
else {
return ((0xFFFFFFFF - old_time_ms) + new_time_ms);
}
}
bool JSemaphore::Wait(unsigned int time_ms) {
struct timespec waittime;
struct timeval now;
if (gettimeofday(&now, NULL) == -1) {
assert("Unable to get time by clock_gettime!" == 0);
return false;
}
int clock_gettime(clockid_t clk_id, struct timespec *tp) {
struct timeval tv;
gettimeofday(&tv, NULL);
tp.tv_sec = tv.tv_sec;
tp.tv_nsec = tv.tv_usec*1000;
}
@sapier
sapier / gist:9745980
Last active August 29, 2015 13:57
Minetest android port issues
Latest test version: http://animalsmod.comuf.com/downloads/Minetest-debug.apk
1) Far too much mesh regen lag
--> no idea if I can change anything about this
2) Inventory button is too small
--> design decision, it's smaller on purpose, maybe some poll should tell us about this
3) When not moving, jump only works if you hold it
--> I'm gonna check this seems to be a bug