Commit graph

33 commits

Author SHA1 Message Date
Eric House
ea0b176b2a debug-build-only macros to find proto-based crashes
When a stream reader and writer are out of sync it often shows up as
trying to read off the end of the stream (firing an assert.) It's useful
to know where that's coming from on android where there's usually no
stack trace in the jin world. So pass __func__ in using macros, and log
before asserting. Crude but quick and already useful.
2019-06-28 21:22:45 -07:00
Eric House
976db7b181 add mem_stream_make_raw 2018-06-27 23:24:45 -07:00
Eric House
fecbfdddb6 tweaks to logging for stack hash debugging 2018-04-08 20:46:35 -07:00
Eric House
22dde029c8 Merge tag 'android_beta_100' into android_branch
ready for release
2016-01-03 11:36:37 -08:00
Eric House
ebcae1a523 move hashing into memstream impl, and reintroduce the old/broken
treatment of the final 8 bits. I'll need to release a version that
still produces the incorrect hash for compatibility with existing
clients that expect it, but that also looks for the correct hash. When
that's out there I can do a new release that sends the correct hash.
2016-01-01 17:57:14 -08:00
Eric House
4813c95976 cleanup: rename function and remove unused param 2015-12-31 15:47:48 -08:00
Eric House
89138edae1 when dumping stream, preserve the subset of bits in the last word
that's real data. This fixes assertions that after popping a move off
the move stack the hash is the same as before it was pushed. It may or
may not be sufficient to fix reported stalls, but it's certainly
necessary.
2015-12-30 05:56:01 -08:00
Eric House
fd06bca151 assert stream version being set consistently, not changed 2015-07-06 20:24:45 -07:00
Eric House
e66ddc3765 make stream_catString work with null ptr 2012-11-01 21:08:58 -07:00
Eric House
4f18f01cb8 don't malloc(0) 2012-09-11 19:17:10 -07:00
Eric House
5c683f173a add mem_stream_make_sized, meant to make saving games more efficient 2012-09-11 19:06:27 -07:00
Eric House
9354e0e0cd fix off-by-one error in stream_copyBits that seems to have been
responsible for HASH_STREAM not working.
2012-05-24 22:16:22 -07:00
Eric House
60e1d50f43 add stream_copyBits, and use it to hash the move stack -- commented
out via conditional compile as it still doesn't work in all cases.
2012-05-22 19:24:54 -07:00
Eric House
47dde6cf3c init bitfield to 0 in case I want to hash stream directly 2012-05-03 19:00:43 -07:00
Eric House
f51c0b39e6 use const where possible for game_writeToStream and others it calls.
No other code changes.
2012-03-11 18:28:14 -07:00
Eric House
07fba2c71b Fix problem with writing server to stream changing its internal state
so that snapshotting made score strings disappear.  Also rename
stream_copyFromStream to stream_getFromStream to make it clearer that
the src is modified.  And swap params in stream_setPos().
2012-03-11 14:57:28 -07:00
Andy2
63893b8a0d add stream_getPtr() and use to remove a couple of allocs, including
one per message sent.
2011-09-18 16:54:36 -07:00
Eric House
c77d3039cc add XP_FREEP. Should be no change in behavior. 2011-04-07 18:07:45 -07:00
ehouse
1fba7d7ef6 add a couple of consts 2009-10-01 04:09:46 +00:00
ehouse
926f5963a3 rename only: stream_putString to stream_catString. 2009-03-29 18:26:59 +00:00
ehouse
5457ea1b59 replace all __FUNCTION__ with __func__ 2007-12-02 19:13:25 +00:00
ehouse
30897a709f Debug-build macros to pass __LINE__ and __FILE__ for logging 2006-11-14 06:40:36 +00:00
ehouse
1be6172e16 use tmp buffer to avoid copying one byte at a time. 2006-09-10 18:53:03 +00:00
ehouse
e0edcb52a8 bug fix: reset stack data stream before getting length and writing. Assert
so easier to catch similar problems.
2006-09-01 04:32:57 +00:00
ehouse
12f115b2ac make getSize return diff between what's been written and what's already
been read.
2006-08-29 13:13:43 +00:00
ehouse
74c6b241d7 Put up BT device browser while user is picking connection method
rather than when trying to send for first time, then pass address
through from conns dialog to bt code.
2006-08-26 21:12:10 +00:00
ehouse
ef6ebe6bac Add, and use, stream_putString. Saves 500 bytes on win32. 2006-04-25 13:31:15 +00:00
ehouse
92485783af update email address in header comments: no code change 2006-01-08 01:25:02 +00:00
ehouse
bef309be3f add stream_setOnCloseProc 2005-08-21 14:33:38 +00:00
ehouse
68b5a6371f cleanup 2004-10-30 16:55:59 +00:00
ehouse
173eba64e3 version now part of stream 2004-06-24 05:19:31 +00:00
ehouse
c1032ee957 comment typo 2003-11-16 19:26:18 +00:00
ehouse
5776da0b93 first checkin 2003-11-01 05:35:29 +00:00