Skip to content

Commit

Permalink
v5.1 Release!
Browse files Browse the repository at this point in the history
  • Loading branch information
evolutionleo committed Apr 29, 2023
1 parent 6f9518c commit 382f90f
Show file tree
Hide file tree
Showing 19 changed files with 81 additions and 13 deletions.
7 changes: 7 additions & 0 deletions JavascriptServer/cmd/senders/types/auth.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare module "#cmd/sendStuff" {
interface SendStuff {
sendRegister(status: string, reason?: string): any;
sendLogin(status: string, reason?: string): any;
}
}
export {};
6 changes: 6 additions & 0 deletions JavascriptServer/cmd/senders/types/custom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { IPlayerInputs } from "#entity/player";
declare module "#cmd/sendStuff" {
interface SendStuff {
sendPlayerControls(data: IPlayerInputs): any;
}
}
7 changes: 7 additions & 0 deletions JavascriptServer/cmd/senders/types/friends.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { IProfile, ProfileInfo } from "#schemas/profile";
declare module '#cmd/sendStuff' {
interface SendStuff {
sendFriends(friends: IProfile[]): any;
sendIncomingFriendRequests(from_profiles: ProfileInfo[]): any;
}
}
10 changes: 10 additions & 0 deletions JavascriptServer/cmd/senders/types/game_loop.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Lobby from "#concepts/lobby";
import Room from "#concepts/room";
import Point from '#types/point';
declare module '#cmd/sendStuff' {
interface SendStuff {
sendPlay(lobby: Lobby, room?: Room, start_pos?: Point, uuid?: string): void;
sendRoomTransition(room_to: Room, start_pos?: Point, uuid?: string): void;
sendGameOver(outcome: string, reason?: string): void;
}
}
11 changes: 11 additions & 0 deletions JavascriptServer/cmd/senders/types/lobby.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Lobby from '#concepts/lobby';
declare module '#cmd/sendStuff' {
interface SendStuff {
sendLobbyJoin(lobby: Lobby): void;
sendLobbyReject(lobby: Lobby, reason?: string): void;
sendLobbyLeave(lobby: Lobby, reason?: string, forced?: boolean): void;
sendLobbyUpdate(lobby: Lobby): void;
sendLobbyInfo(lobbyid: string): void;
sendLobbyList(): void;
}
}
10 changes: 10 additions & 0 deletions JavascriptServer/cmd/senders/types/party.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Party from "#concepts/party";
declare module '#cmd/sendStuff' {
interface SendStuff {
sendPartyInvite(party: Party): any;
sendPartyLeave(party: Party, reason: string, forced: boolean): any;
sendPartyJoin(party: Party): any;
sendPartyReject(party?: Party, reason?: string): any;
sendPartyInviteSent(): any;
}
}
10 changes: 10 additions & 0 deletions JavascriptServer/cmd/senders/types/system.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ValidationError } from "fastest-validator";
declare module '#cmd/sendStuff' {
interface SendStuff {
sendServerInfo(compatible: boolean): any;
sendPing(): any;
sendPong(T: number): any;
sendServerTime(client_t: number): any;
sendInvalidInput(from_cmd: string, errors: ValidationError[]): any;
}
}
2 changes: 1 addition & 1 deletion JavascriptServer/concepts/client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import trace from '#util/logging';
import chalk from 'chalk';
import SendStuff from '#cmd/sendStuff';
import { SendStuff } from '#cmd/sendStuff';

import mongoose from 'mongoose';
const ObjectId = mongoose.Types.ObjectId;
Expand Down
6 changes: 5 additions & 1 deletion JavascriptServer/initializers/10_cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ const __dirname = dirname(fileURLToPath(import.meta.url));


async function loadFolder(type) {
let files = fs.readdirSync(__dirname + `/../cmd/${type}s`, 'utf8');
let dir = __dirname + `/../cmd/${type}s`;
let files = fs.readdirSync(dir, 'utf8');
trace(chalk.blueBright(`Loading ${type}s...`));

// load everything asynchronously
await Promise.all(files.map(file => {
if (fs.statSync(dir + '/' + file).isDirectory())
return;

trace(chalk.blueBright(`> loading ${type}:`, file));
return import(`file://${__dirname}/../cmd/${type}s/${file}`);
}));
Expand Down
Binary file modified Release/GMClient.zip
Binary file not shown.
Binary file modified Release/JSServer.zip
Binary file not shown.
Binary file modified Release/TSServer.zip
Binary file not shown.
Binary file modified Release/Warp.yymps
Binary file not shown.
10 changes: 4 additions & 6 deletions TypescriptServer/src/cmd/sendStuff.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import trace from '#util/logging';
import packet from '#packet';
import { Socket } from 'net';
import Lobby, { lobbyList } from '#concepts/lobby';
import { Account, getAccountInfo, IAccount } from '#schemas/account';
import { Profile, IProfile, getProfileInfo, ProfileInfo } from '#schemas/profile'
import Lobby from '#concepts/lobby';
import { IAccount } from '#schemas/account';
import { IProfile } from '#schemas/profile'
import Room from '#concepts/room';
import Client from '#concepts/client';
import PlayerEntity, { IPlayerInputs } from '#entity/player';
import PlayerEntity from '#entity/player';
import { SockType, Sock } from '#types/socktype';
import * as net from 'net';
import * as ws from 'ws';
Expand Down
2 changes: 1 addition & 1 deletion TypescriptServer/src/cmd/senders/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ declare module "#cmd/sendStuff" {
}

/**
* @param {string} status
* @param {string} status
* @param {string} [reason='']
*/
SendStuff.prototype.sendRegister = function(status:string, reason:string = ''):void {
Expand Down
4 changes: 2 additions & 2 deletions TypescriptServer/src/cmd/senders/custom.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SendStuff from "#cmd/sendStuff"
import Client from "#concepts/client";
import { IPlayerInputs } from "#entity/player";
import Client from "#concepts/client"
import { IPlayerInputs } from "#entity/player"

declare module "#cmd/sendStuff" {
interface SendStuff {
Expand Down
2 changes: 1 addition & 1 deletion TypescriptServer/src/concepts/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import trace from '#util/logging';
import chalk from 'chalk';
import SendStuff from '#cmd/sendStuff';
import { SendStuff } from '#cmd/sendStuff';

import mongoose from 'mongoose';
const ObjectId = mongoose.Types.ObjectId;
Expand Down
5 changes: 4 additions & 1 deletion TypescriptServer/src/initializers/10_cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ const __dirname = dirname(fileURLToPath(import.meta.url));


async function loadFolder(type) {
let files = fs.readdirSync(__dirname + `/../cmd/${type}s`, 'utf8');
let dir = __dirname + `/../cmd/${type}s`;
let files = fs.readdirSync(dir, 'utf8');
trace(chalk.blueBright(`Loading ${type}s...`));

// load everything asynchronously
await Promise.all(files.map(file => {
if (fs.statSync(dir + '/' + file).isDirectory()) return;

trace(chalk.blueBright(`> loading ${type}:`, file));
return import(`file://${__dirname}/../cmd/${type}s/${file}`);
}));
Expand Down
2 changes: 2 additions & 0 deletions TypescriptServer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"allowJs": true,
"removeComments": false,
"moduleResolution": "Node",
"baseUrl": "src",
"outDir": "out/",
Expand All @@ -9,6 +10,7 @@
"target": "ESNext",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
// "declaration": true,
"paths": {
"#schemas/*": ["schemas/*"],
"#entity/*": ["entities/entity_types/*"],
Expand Down

0 comments on commit 382f90f

Please sign in to comment.