teeworlds_network/examples/04_player_infos.rb

38 lines
824 B
Ruby
Raw Normal View History

2022-11-05 10:07:16 +00:00
#!/usr/bin/env ruby
2022-11-05 16:27:54 +00:00
# frozen_string_literal: true
2022-11-05 10:07:16 +00:00
2022-11-04 15:57:50 +00:00
# Set custom skin and other player infos
require_relative '../lib/teeworlds_client'
2022-11-04 15:57:50 +00:00
client = TeeworldsClient.new(verbose: true)
# all keys are optional
# if not provided they will fall back to the default value
2023-09-17 17:19:06 +00:00
client.set_startinfo(
2022-11-05 16:19:05 +00:00
name: 'ruby gamer',
clan: '',
country: -1,
body: 'spiky',
marking: 'duodonny',
decoration: '',
hands: 'standard',
feet: 'standard',
eyes: 'standard',
custom_color_body: 0,
custom_color_marking: 0,
custom_color_decoration: 0,
custom_color_hands: 0,
custom_color_feet: 0,
custom_color_eyes: 0,
color_body: 0,
color_marking: 0,
color_decoration: 0,
color_hands: 0,
color_feet: 0,
color_eyes: 0
)
2022-11-04 15:57:50 +00:00
# connect to localhost and block the current thread
2022-11-05 10:07:16 +00:00
client.connect('localhost', 8303, detach: false)