Skip to content

Commit

Permalink
Do not detach in sample code
Browse files Browse the repository at this point in the history
the sample code should be batteries included ready to go
putting the detach sample in a ruby file and running it
does not keep running
  • Loading branch information
ChillerDragon committed Sep 17, 2023
1 parent 27bfbc2 commit a98295b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions docs/v0.0.1/classes/TeeworldsClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ client.on_input_timing do |context|
puts "time_left: #{context.message.time_left}"
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_maplist_entry_rem"></a> #on_maplist_entry_rem(&block)
Expand All @@ -34,7 +34,7 @@ client.on_maplist_entry_rem do |context|
puts context.message.name
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_maplist_entry_add"></a> #on_maplist_entry_add(&block)
Expand All @@ -53,7 +53,7 @@ client.on_maplist_entry_add do |context|
puts context.message.name
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_rcon_cmd_rem"></a> #on_rcon_cmd_rem(&block)
Expand All @@ -70,7 +70,7 @@ client.on_rcon_cmd_rem do |context|
# TODO: generated documentation
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_rcon_cmd_add"></a> #on_rcon_cmd_add(&block)
Expand All @@ -87,7 +87,7 @@ client.on_rcon_cmd_add do |context|
# TODO: generated documentation
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_auth_off"></a> #on_auth_off(&block)
Expand All @@ -104,7 +104,7 @@ client.on_auth_off do |context|
# TODO: generated documentation
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_auth_on"></a> #on_auth_on(&block)
Expand All @@ -121,7 +121,7 @@ client.on_auth_on do |context|
# TODO: generated documentation
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_snapshot"></a> #on_snapshot(&block)
Expand All @@ -138,7 +138,7 @@ client.on_snapshot do |context|
# TODO: generated documentation
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_rcon_line"></a> #on_rcon_line(&block)
Expand All @@ -155,7 +155,7 @@ client.on_rcon_line do |context|
# TODO: generated documentation
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_disconnect"></a> #on_disconnect(&block)
Expand All @@ -172,7 +172,7 @@ client.on_disconnect do |context|
# TODO: generated documentation
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_connected"></a> #on_connected(&block)
Expand All @@ -189,7 +189,7 @@ client.on_connected do |context|
# TODO: generated documentation
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_client_info"></a> #on_client_info(&block)
Expand All @@ -206,7 +206,7 @@ client.on_client_info do |context|
# TODO: generated documentation
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_chat"></a> #on_chat(&block)
Expand All @@ -227,7 +227,7 @@ client.on_chat do |context, msg|
puts "[chat] #{msg}"
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```
### <a name="on_map_change"></a> #on_map_change(&block)

Expand All @@ -248,7 +248,7 @@ client.on_map_change do |context|
context.cancel
end

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)
```

### <a name="on_client_drop"></a> #on_client_drop(&block)
Expand Down Expand Up @@ -321,7 +321,7 @@ Send a chat message. Takes the chat message as String.
```ruby
client = TeeworldsClient.new(verbose: true)

client.connect('localhost', 8303, detach: true)
client.connect('localhost', 8303, detach: false)

client.send_chat('hello world!')
```
2 changes: 1 addition & 1 deletion scripts/hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function add_hook_doc() {
fi
local tmpdoc
local obj_var=client
local run="client.connect('localhost', 8303, detach: true)"
local run="client.connect('localhost', 8303, detach: false)"
if [[ "$ruby_class" =~ Server ]]
then
obj_var=server
Expand Down

0 comments on commit a98295b

Please sign in to comment.