Help for this page

Select Code to Download


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