Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
chore: add readme and todo list
Browse files Browse the repository at this point in the history
  • Loading branch information
leia-uwu committed Jan 4, 2024
1 parent 52da61c commit 5512905
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 24 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Open source surviv.io server

This is really work in progress and nowhere near finished

Requires surviv client version 0.8.82 (SURVIV RELOADED CLIENT WON'T WORK)

### [TODO LIST AND PROGRESS](./TODO.md)
133 changes: 133 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
## TODO LIST / PROGRESS

### Player
- [x] Moving
- [x] Collision
- [x] Health and dying
- [x] Kill messages
- [x] Armor and vests
- [ ] Adrenaline
- [ ] Scopes
- [ ] Consumable items
- [ ] Spectating
- [ ] Slowdown on water
- [ ] Kill Leader
- [ ] Loadouts
- [ ] Emotes
- [ ] Roles and cobalt classes

### Guns
- [ ] Switch delays
- [ ] Firing delays
- [ ] Ammo
- [ ] Reloading
- [x] Firing logic (should be 1/1 to surviv firing logic)

### Bullets
- [x] Collision
- [x] Reflection
- [x] Culling

### Melee weapons
- [x] Collision
- [x] Delays
- [ ] Auto use (hook)

### Obstacles
- [x] Spawning, destroying, collision
- [x] Windows
- [ ] Doors
- [ ] Sliding doors
- [ ] Buttons
- [ ] Loot

### Buildings
- [x] Generation
- [ ] Ceiling Zoom
- [ ] Destroying and damaging ceilings
- [ ] Puzzles

### Structures
- [x] Generation
- [x] Switching layers (currently kinda buggy and needs refactoring)

### Map Generation
- [x] Basic generation
- [ ] Getting objects to not overlap
- [x] Partially done
- [ ] Spawning objects on beach and rivers properly
- [ ] River generation

### Loot
- [ ] Loot game object and physics
- [ ] Picking up loot
- [ ] Switching layers
- [ ] River flow

### Modes defs
Some modes server definitions were leaked in an old stats page app.js
but they are outdated and missing some stuff
this is the ones ported so far (but not fully updated):
- [x] Main Mode
- [x] Desert
- [x] Faction
- [x] Halloween
- [x] Potato
- [x] Woods
- [ ] Seasonal variants of normal and woods map

Modes not in the leaked definitions:
- [ ] Cobalt
- [ ] Savannah

### Perks
- [ ] Cast Iron Skin
- [x] Bullet Reflection
- [ ] Size Change
- [ ] Damage Reduction
- [ ] Splinter
- [ ] Damage reduction of main bullet
- [x] Explosive Rounds (logic is done but requires explosions)

won't list all that need to be competently done because lazy

### Squad / Duos
- [ ] API
- [ ] Map Indicators
- [ ] Randomized duos / squads when not using create team

### Other features
- [ ] Explosions
- [ ] Throwables
- [ ] Airdrops
- [ ] Planes
- [ ] Gas

### Server and core stuff
- [x] Port all definitions from the client
- [x] Port all game objects serializations
- [ ] Port all msgs serializations
- [ ] Join
- [ ] Disconnect
- [x] Input
- [ ] Edit
- [x] Joined
- [x] Update
- [x] Kill
- [x] GameOver
- [ ] Pickup
- [x] Map
- [ ] Spectate
- [ ] DropItem
- [ ] Emote
- [x] PlayerStats
- [ ] AdStatus
- [ ] Loadout
- [ ] RoleAnnouncement
- [ ] Stats
- [ ] UpdatePass
- [x] AliveCounts
- [ ] PerkModeRoleSelect
- [ ] Connections limit per ip
- [ ] Banning Ips
- [ ] Matchmaking algorithm
10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "resurviv",
"version": "0.0.1",
"description": "A community-made resurrection of the defunct online game surviv.io.",
"description": "Open Source Surviv.io Server",
"scripts": {
"build": "tsc",
"start": "node --enable-source-maps dist/src/server.js",
Expand All @@ -13,16 +13,8 @@
"engines": {
"node": ">=18.16.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/SurvivReloaded/survivreloaded-server.git"
},
"author": "Leia",
"license": "GPL-3.0-or-later",
"bugs": {
"url": "https://github.com/SurvivReloaded/survivreloaded-server/issues"
},
"homepage": "https://resurviv.io",
"dependencies": {
"bit-buffer": "^0.2.5",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.34.0"
Expand Down
16 changes: 8 additions & 8 deletions src/net/net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,26 @@ export const NetConstants = {

export enum MsgType {
None,
Join, // done
Join,
Disconnect,
Input, // done
Input,
Edit,
Joined, // done
Update, // done
Joined,
Update,
Kill,
GameOver, // done
GameOver,
Pickup,
Map, // done
Map,
Spectate,
DropItem,
Emote,
PlayerStats, // done
PlayerStats,
AdStatus,
Loadout,
RoleAnnouncement,
Stats,
UpdatePass,
AliveCounts, // done
AliveCounts,
PerkModeRoleSelect
}

Expand Down
3 changes: 2 additions & 1 deletion src/objects/bullet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ export class Bullet implements BulletData {

let isHeadShot = false;
// headshots >:3
if (Math.random() < 0.15) {
const sourceDef = GameObjectDefs[this.sourceType] as GunDef;
if ((sourceDef.headshotMult ?? 1) > 1 && Math.random() < 0.15) {
finalDamage *= (GameObjectDefs[this.sourceType] as GunDef).headshotMult;
isHeadShot = true;
}
Expand Down
4 changes: 3 additions & 1 deletion src/objects/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class Player extends GameObject implements PlayerFullData, PlayerPartialD
this.socket = socket;

if (game.config.mode !== "faction") {
this.groupId = this.teamId = this.game.nextGroupId++;
this.groupId = this.teamId = ++this.game.nextGroupId;
}

for (const item in GameConfig.bagSizes) {
Expand Down Expand Up @@ -509,6 +509,8 @@ export class Player extends GameObject implements PlayerFullData, PlayerPartialD
...this,
playerId: this.id
}];
gameOverMsg.teamId = this.teamId;
gameOverMsg.winningTeamId = -1;
this.msgsToSend.push(gameOverMsg);

const deadBody = new DeadBody(this.game, this.pos, this.id, this.layer);
Expand Down
4 changes: 1 addition & 3 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {

import { URLSearchParams } from "node:url";
import { Game } from "./game";
// import { type Player } from "./objects/player";
import { Logger } from "./utils/logger";
import { type Player } from "./objects/player";

Expand Down Expand Up @@ -139,7 +138,7 @@ app.get("/api/site_info", (res) => {

const data = {
modes: [
{ mapName: "main", teamMode: 1 }
{ mapName: Config.mode, teamMode: 1 }
],
pops: {
local: `${playerCount} players`
Expand Down Expand Up @@ -283,7 +282,6 @@ app.ws("/play", {
const game = games[data.gameID];
if (game === undefined) return;
data.player = game.addPlayer(socket);
// data.player.sendGameOverPacket(false) // uncomment to test game over screen
},

/**
Expand Down
7 changes: 5 additions & 2 deletions src/utils/weaponManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export class WeaponManager {

curWeapIdx = 2;

weapons: Array<{ type: string, ammo: number }> = [];
weapons: Array<{
type: string
ammo: number
}> = [];

get activeWeapon(): string {
return this.weapons[this.curWeapIdx].type;
Expand All @@ -37,7 +40,7 @@ export class WeaponManager {
});
}
this.weapons[0].type = "awc";
this.weapons[1].type = "vector";
this.weapons[1].type = "mp220";
this.weapons[0].ammo = 1;
this.weapons[1].ammo = 1;
}
Expand Down

0 comments on commit 5512905

Please sign in to comment.