![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /opt/rh/gcc-toolset-11/root/usr/share/systemtap/examples/stapgames/tapset/ |
# Miscellaneous routines for games # Copyright (C) 2008 Masami Hiramatsu <[email protected]> # # This file is free software and is distributed under the terms of the GNU # General Public License (GPL); either version 2, or (at your option) any # later version. global __GM_rand_seed function game_srand(seed:long) { __GM_rand_seed = seed } function __game_lfsr(val:long) /* pure */ %{ u64 r = THIS->val; r = (r >> 1) ^ ((-(r & 1ULL)) & 0xd800000000000000ULL); THIS->__retvalue = r; %} function game_rand() { return __GM_rand_seed = __game_lfsr(__GM_rand_seed) } function game_urand() { rand = game_rand() return rand<0?-rand:rand }