Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/magynhard/wc3_protocol
Warcraft III protocol implementation in Ruby
https://github.com/magynhard/wc3_protocol
lan network protocol warcraft warcraft3
Last synced: 3 days ago
JSON representation
Warcraft III protocol implementation in Ruby
- Host: GitHub
- URL: https://github.com/magynhard/wc3_protocol
- Owner: magynhard
- License: mit
- Created: 2023-10-21T18:15:25.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-05T14:38:36.000Z (3 months ago)
- Last Synced: 2024-11-07T13:56:22.351Z (8 days ago)
- Topics: lan, network, protocol, warcraft, warcraft3
- Language: Ruby
- Homepage:
- Size: 74.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# wc3_protocol
[![Gem](https://img.shields.io/gem/v/wc3_protocol?color=default&style=plastic&logo=ruby&logoColor=red)](https://rubygems.org/gems/wc3_protocol)
![downloads](https://img.shields.io/gem/dt/wc3_protocol?color=blue&style=plastic)
[![License: MIT](https://img.shields.io/badge/License-MIT-gold.svg?style=plastic&logo=mit)](LICENSE)> The ruby gem to find and retrieve information of Warcraft3 games on LAN
# Contents
* [Usage](#usage)
* [Installation](#installation)
* [Documentation](#documentation)
* [Contributing](#contributing)### Find games in LAN
```ruby
require 'wc3_protocol'# examples with explicit default parameters
games = Wc3Protocol::Broadcast.find_games port: 6112, version: '1.27', game_type: 'TFT'
# => [Wc3Protocol::ServerInfo, Wc3Protocol::ServerInfo, ...]games.each do |g|
puts "=================================================="
puts "Found game on #{g.remote_address}:#{g.remote_port}"
puts
puts "Type: #{g.game_type}"
puts "Version: #{g.game_version}"
puts "Name: #{g.name}"
puts "Map: #{g.map_name}"
puts "Players: #{g.taken_slots}/#{g.max_slots}"
puts
# =================================================="
# Found game on 192.168.178.20:6112"
#
# Type: The Frozen Throne
# Version: 1.27
# Name: Local game (SuperPlayer)
# Map: (4)Tanaris.w3x
# Players: 3/4"
#
end```
Add this line to your application's Gemfile:
```ruby
gem 'wc3_protocol'
```And then execute:
$ bundle install
Or install it yourself by:
$ gem install wc3_protocol
## Documentation
Check out the doc at RubyDoc
https://www.rubydoc.info/gems/wc3_protocolBug reports and pull requests are welcome on GitHub at https://github.com/magynhard/wc3_protocol. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.