- or download this
## read a string until a '\x00' is encountered (-> null termination of
+ strings in C!)
sub read_complete_string {
...
return $string;
}
- or download this
## read the specified number of bytes from buffer, called by the other
+ read_* functions
sub read_buffer {
...
return $length;
}
- or download this
struct client_t {
short ping;
...
char clanTag[32]; // NULL-terminated
byte isBot;
};
- or download this
sub read_short {
my ($self) = @_;
...
# elsewhere in the code:
print "ping: " . $self->package_reader->read_short() . "\n";