8000 GitHub - Lekuruu/chio: A bancho packet serialization library written in go
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Lekuruu/chio

Repository files navigation

Chio

Chio (Bancho Input/Output) is a bancho packet serialization library written in go, that aims to support as many clients as possible.

Warning

This project is a work in progress and is not ready for production usage yet. For a full implementation, please view chio.py!

Example Usage

import (
    "io"
    "fmt"

    "github.com/lekuruu/chio"
)

// Assuming you have some kind of tcp server
func HandleConnection(stream io.ReadWriteCloser, version int) {
    defer stream.Close()

    io := chio.GetClientInterface(version)
    io.WriteLoginReply(stream, 2)
    io.WriteUserStats(stream, chio.UserInfo{ ... })
    io.WriteAnnouncement(stream, "Hello, World!")

    for {
        packet, err := client.IO.ReadPacket(stream)
        if err != nil {
            fmt.Println("Error reading packet:", err.Error())
            break
        }

        fmt.Printf("Received packet: %d, %v\n", packet.Id, packet.Data)
    }
}

About

A bancho packet serialization library written in go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages

0