FloooD / custom_cs2dsrv

Jermuk's custom Counter Strike 2D Server written in C and modified by FloooD and leegao.
173.192.35.85:36000
3 stars 0 forks source link

players + weapons #9

Closed FloooD closed 13 years ago

FloooD commented 13 years ago

the current player/weapon system is incredibly confusing...

first, player[p_id].actualweapon refers to the the slot of the weapon the player is using so... getting the name of that weapon means... weapons[player[p_id].slot[player[p_id].actualweapon].id].name

ew... from what i can tell, if you have two weapons in one slot, the server can only figure out the name/id of one of those weapons...

which makes me wonder how the hell weapon switching works

i think i'll redo the entire weapon/player structs

leegao commented 13 years ago

:D, btw when you have time check out the pull request, I rewrote the send into a queue.

FloooD commented 13 years ago

k forget about slots. since each weapon may go into only one slot the current system redundant (and messy). gonna replace player[p_id].slot with player[p_id].wpntable actualweapon will be the id of the weapon the player is holding

struct PLAYER_WEAPON { short status; //0 - don't have, 1 - normal, 2 - zoom1/burst, 3 - zoom2 short ammo1, ammo2; }

struct PLAYER { //blablabla struct PLAYER_WEAPON wpntable[0xff] //blablabla }

gah this "github flavored markdown" is annoying. cant they just do plain text

leegao commented 13 years ago

o_O just add 4 spaces before everything (using tab in eclipse, copy, and then shit+tab to restore)

FloooD commented 13 years ago

shit+tab? lol lemme try

include int main(void) {puts("hello world"); return 0;}

cool lol
leegao commented 13 years ago

TT, typos happen okay? too bad there isn't a syntax checker for real life <<

FloooD commented 13 years ago

rofl... so apparently slot in jermuk's code has no relation to the weapon slot in the client-.-

oh well my system is still simpler. Well I guess it uses more mory but less for-loops :p

leegao commented 13 years ago

btw I won't be able to work on the server today or tomorrow, we have a 24 hour hackathon thing

FloooD commented 13 years ago

ok lol havefun :p

leegao commented 13 years ago

ahhh, knife now has 0 ammo unless you buy a weapon and then buy ammo (which is automatic for weapon buy), quite funny when I tried to demo the server to a few friends so, we were like huh? pulled up the log, and then were like ohhh

FloooD commented 13 years ago

rofl haha uh i think it's something in the start weapons

like it doesn't know that u have a knife by default hence 0 ammo :P

anyway ill figure out most of these problems when i start working on the standard gamemode. for now... time to redo hit system ;p

leegao commented 13 years ago

a lil bit of linear algebra should suffice, I wonder how Jermuk did it. Btw, I'll write a quad tree for amortized log-time lookup of the map entities and tiles.

FloooD commented 13 years ago

eh... i rly dont think a quad tree would be necessary. i mean our maps aren't 10000x10000 right?

jermuk's method is pretty ugly... and i think it's what is used by dc as well. look at the onfire function ew @ big for loop

im basically gonna port https://gist.github.com/854210 to c

but first, physics homework :D

FloooD commented 13 years ago

eh closed