Skip to content

OverPowered-Network/ow2-scrimtime-ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ow2-scrimtime-ws

WebSocket server for LogTime/ScrimTime OW2 Workshop.

Watches the .csv file outputted and structures the data into JSON format.

Note: this code is quite inefficient and goes through the whole file. Feel free to make changes

Tested with Node.js version 16.x.x. Might work with other versions idk

cd project/directory
yarn

Running

Change this line to your correct Workshop directory path

const baseDir = "C:/Users/rjame/OneDrive/Documents/Overwatch/Workshop";

cd project/directory
yarn start

Connect to the WebSocket and send the message START The server will now look for the newest file in the directory and start watching for file changes. You can also send a STOP message to tell the server to stop watching the file

Data structure will look like

interface OW2_API {
    map?: string
    round_status?: "match_end" | "round_start" | "round_end"
    players?: {
        [key: string]: OW2_Players_API
    }
    player_stats?: { [key: string]: OW2_POST_MAP_STATS }
}

interface OW2_Players_API {
    hero?: string
    playerName?: string
    kills?: number
    deaths?: number
    off_assists?: number
    def_assists?: number
    ultimate_status?: "ended" | "charged" | "started"
}

interface OW2_POST_MAP_STATS {
    round?: number
    heroList?: string[]
    eliminations?: number
    final_blows?: number
    deaths?: number
    hero_damage?: number
    healing_dealt?: number
    damage_taken?: number
    damage_mitigated?: number
    defensive_assists?: number
    offensive_assists?: number
    weapon_accuracy?: number
}