Closed leegao closed 13 years ago
i vote for decompiling cs2d_dedicated... somehow
ya ask dc
lawlz, blitz compiled code doesn't leave any stack markers so it's literally like trying to read a soup of jumbled asm code <_<
anyways, DC said that it's preprocessed into grayscale (/4) and then compressed using zlib (which kind of groups contiguous regions together) When decompressed, it should be a grayscale bitmap of 32x32 (1 byte for each pixel -> 1024 bytes)
So to get it back to a bitmap again, we just have to mod the sequence by 32, flip it vertically (pivoted by the x-axis), and then add a fixed bmp header and save (and make sure that we get the same thing back.)
I'll get back once I have the patch up
wait hold on... u dont even need to decompress it just send the same data to the clients when they connect.... :D? i assume that the server also uses zlib
i.e. player 1 joins server and sends myspray=102398710847395 to server.
player 2 joins server and sends myspray=134570123487083 to server. server sends player2spray=134570123487083 to player 1. server sends player1spray=102398710847395 to player 2.
player 3 joins server and sends 253098741038100 to server. server sends player3spray=253098741038100 to player 1 and player 2 server sends player1spray=102398710847395 to player 3 server sends player2spray=134570123487083 to player 3
etc...
and the server has absolutely no idea that's encoded in those messages.
yeah, but that's less fun <_<, need something to help me procrastinate :D
oh, btw, I just grabbed the last copy of K&R's "The C Programming Language" off the shelf, not to actually read, but to make other people think that I am a programmer :D
lol u know you can download the pdf online nvm didn't read ur last line lol
ill finish grenade buying stuff today
lol, yeah, I've already read it 4 times, it's actually an interesting read as far as tech manuals go.
btw how did prelims/midterms go?
did well on first. failed second one kinda what i expectd
it's okay, it'll be another 15 years before people begins catching up with you xD
lol..
btw clang is only 3 seconds faster -.-
eh@netbook:~/customcs2dsrv$ time make clang
clang -lm -lrt -I"include" -I"lua/src" src/.c lua/src/_.c -o bin/clang_srv
src/cross_layer.c:164:2: warning: implicit declaration of function
'gettimeofday' is invalid in C99 [-Wimplicit-function-declaration]
gettimeofday(&tv,NULL);
^
1 diagnostic generated.
src/lua_env.c:408:39: warning: if statement has empty body [-Wempty-body]
if (luaL_dostring(_G, strict_print));
^
1 diagnostic generated.
/tmp/cc-jKnKZa.o: In function os_tmpname': lua/src/loslib.c:(.text+0x893): warning: the use of
tmpnam' is dangerous, better use `mkstemp'
real 0m9.620s user 0m8.689s sys 0m1.076s eh@netbook:~/custom_cs2dsrv$ time make gcc -O3 -lm -lrt -I"include" -I"lua/src" src/*.c -L. -llua -o bin/custom_cs2dsrv
real 0m12.864s
user 0m12.253s
sys 0m0.500s
eh@netbook:~/customcs2dsrv$ time make no-shared
gcc -O3 -lm -lrt -I"include" -I"lua/src" src/.c lua/src/_.c -o bin/custom_cs2dsrv
/tmp/ccWPOkAI.o: In function os_tmpname': loslib.c:(.text+0x46): warning: the use of
tmpnam' is dangerous, better use `mkstemp'
real 0m42.677s user 0m39.978s sys 0m1.724s
ps I got the decompression working too, patched in the for_the_lawlz branch, which will use zlib if needed (zlib comes standard on linux) (only the clang target will build on zlib by default)
also, clang doesn't require a dynamic library, which means that it's "sort of" portable on linux machines
but still whats the point in having the server see people's sprays???
none <_<, I was bored okay?
but we do need to zlib map data and file transfer data
btw, each datagram holds only 0xffff bytes, so there must be some way of splitting larger files using zlib's upperbound compressBound(int) method and some way of denoting file transfer (the upper bound on a 32x32 bitmap is less than 1024, so no worries here)
oh right it's in the forthelawlz branch :P
Any idea what this does?
nvm it's the spray, it seems to use some weird serialization for the bitmap
Edit 2: I think \x1c\0\1 requests for the spray logo o_O Plan of attack: create 262144 (3232 \ 256, 32/32 for the number of white squares that we're going to stack on each other contiguously, 256 for the shades of gray for each) tiles and then individually profile them or ask DC... I vote that we ask DC :P