Giter VIP home page Giter VIP logo

yetanothernet's Introduction

Welcome to my Circus!

Join Clown's Circus Discord Server Follow on Mastodon

About me:

I develop games and apps as a hobby.

I primarily work on Roblox, having the most experience in the Luau Programming Language. I design games, UI/UX, and more. On Roblox, I've worked for a 11k member SCPF group and currently work on various independent projects as well as for a 55k member roleplaying group.

Outside of Roblox, I create Rust and JavaScript Applications & Games, 3D Model, and do Graphic Design. Though not as good as my knowledge in Luau, I do know the JavaScript Programming Language and am currently learning the Rust Programming Language. I primarily use these languages to create applications on Discord and Rust to build games as an hobby.

Want to see more?

Join my Discord Server here!

My Discord Server serves as a hub for all of my projects, from information to support, and as a place to support and talk to other friends or fellow developers.

yetanothernet's People

Contributors

atk422 avatar integralsgetyouarea avatar littletsu avatar yetanotherclown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

yetanothernet's Issues

Matter setup routes does not compile in roblox-ts

In the typescript documentation for Matter setup the following routes.ts is recommended:

import { Route } from "@rbxts/yetanothernet";

const defaultConfiguration = {
  Channel: "Reliable",
  Event: "default",
}

// Replicate Matter Components
const MatterReplication = new Route(defaultConfiguration);

// Signal that the Player has loaded
const PlayerLoaded: Route<[boolean]> = new Route(defaultConfiguration);

export = {
  MatterReplication: MatterReplication,
  PlayerLoaded: PlayerLoaded,
}

This results in the following error by default: Argument of type '{ Channel: string; Event: string; }' is not assignable to parameter of type 'Configuration'. Types of property 'Channel' are incompatible. Type 'string' is not assignable to type '"Reliable" | "Unreliable" | undefined'.

I fixed this by moving the Configuration type to the Net namespace

declare namespace Net {
    const server: "NET_SERVER";
    
    type Configuration = {
        Channel: "Reliable" | "Unreliable" | undefined,
        Event: string | undefined,
    }
...

and make the defaultConfiguration use this type

import { Route, Configuration } from "@rbxts/yetanothernet";

const defaultConfiguration: Configuration = {
	Channel: "Reliable",
	Event: "default",
};

// Replicate Matter Components
const MatterReplication = new Route(defaultConfiguration);

// Signal that the Player has loaded
const PlayerLoaded: Route<[boolean]> = new Route(defaultConfiguration);

export = {
	MatterReplication: MatterReplication,
	PlayerLoaded: PlayerLoaded,
};

Add Roblox-TS Types

The Matter ECS has a large user base of Typescript users, we should provide them an opportunity to use Net as well.

Personally, I have not ever used Typescript and currently do not have time to learn it and work on Roblox-TS Types for Net, this issue exists in case anyone would like to help out with Roblox-TS Types. Resources on the process would be appreciated, I'd be interested in supporting Roblox-TS myself in the future.

Incorrect `routes` type in `Net.start` and `Net.createHook` for roblox-ts

As of now the definition for Net.start is the following:

    function start<T extends Array<any>>(loop: any, routes: Array<Route<T>>): void

This expects an Array, which only allows numeric indexes unlike Luau's tables, it also forces all routes to be the same type T and because of this the recommended matter setup route definition cannot be used:

import { Route } from "@rbxts/yetanothernet";

const defaultConfiguration = {
  Channel: "Reliable",
  Event: "default",
}

// Replicate Matter Components
const MatterReplication = new Route(defaultConfiguration);

// Signal that the Player has loaded
const PlayerLoaded: Route<[boolean]> = new Route(defaultConfiguration);

export = {
  MatterReplication: MatterReplication,
  PlayerLoaded: PlayerLoaded,
}

I fixed this by turning the routes Array in the type into an object and removing the type parameter and for this to work we also have to give the Route a default value:

    // on index.d.ts Route definition
    class Route<T extends Array<any> = Array<any>> {
        public constructor(configuration: Configuration | null);
    // on index.d.ts start definition
    function start(loop: any, routes: {[index: string]: Route}): void

``Route:query()`` return values are not typed when using generalized iteration

This is a Luau bug, but since this affects Net this issue will serve as a guide for how to workaround this and provide information on it.
If you would like to track the Luau Issue, it is here luau-lang/luau#819.

In order to workaround this bug, you can do this when querying:

for pos, sender, str, num in route:query():__iter() do
     -- Do something
end

In the meantime, there is nothing we can do to fix this for Net, you will either have to use the workaround or wait until the new Luau Type Solver comes out.

Rojo live-syncing breaks Net

The issue is that the parent of the remote event is under the script, which Rojo overwrites.
To fix this simply move the replicated event outside of the script and somewhere where Rojo can't touch it.
I'll draft a PR tomorrow unless someone else wants to do this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.