Skip to content
Karmel0x edited this page Dec 8, 2022 · 5 revisions

directories

Core - core functions containing most basic functions which are necessary for project like networking etc.

Functions - additional functions which are necessary for project but doesn't fits to core, rather used for logic

Game - functions which are necessary for specific game type (moba)

GameObjects - basically every possible object in game which has own position and netId (identificator)

Handlers - how program should respond to specific packet

Packets - packet structures (S2C - server to client, C2S - client to server)

  • packet-inspector probably most important tool atm, which helps you to:
    • inspect packets - run packet-inspector, open your browser, load packet replays
    • parse packets - run packet-inspector, open your browser, click add packet and paste hex data
    • monitor packets - run packet-inspector, open your browser, then run server, packets from server will appear in your browser in real time

sending packets

  • initializing packet
     var packet = global.Network.createPacket('PacketName');
    
     // probably will be changed to:
     // var PacketName = require('/Packets/S2C/PacketName')
     // var packet = new PacketName();
    
  • setting packet properties
     //packet.netId = this.netId;
     packet.someProperty = 1234;
    
  • sending packet (these functions exists but aren't finished yet)
     // sending packet to everyone
     this.sendTo_everyone(packet);
    
     // sending packet to specific player
     this.sendTo_self(packet);
    
     // sending packet to players which has vision on you
     this.sendTo_vision(packet);
    
     // sending packet to team
     this.sendTo_team(packet);