From de985f3af3af997671fdb452bc355519ca93785f Mon Sep 17 00:00:00 2001 From: Evoleo Date: Sat, 16 Nov 2024 17:36:12 +0300 Subject: [PATCH] Chat system start --- Client/Client.resource_order | 13 ++-- Client/Client.yyp | 1 + Client/objects/oChatManager/Create_0.gml | 3 + Client/objects/oChatManager/Draw_64.gml | 2 + Client/objects/oChatManager/oChatManager.yy | 36 ++++++++++ Client/scripts/__WarpConfig/__WarpConfig.gml | 2 +- TypescriptServer/src/concepts/chat.ts | 69 ++++++++++++++++++++ 7 files changed, 119 insertions(+), 7 deletions(-) create mode 100644 Client/objects/oChatManager/Create_0.gml create mode 100644 Client/objects/oChatManager/Draw_64.gml create mode 100644 Client/objects/oChatManager/oChatManager.yy create mode 100644 TypescriptServer/src/concepts/chat.ts diff --git a/Client/Client.resource_order b/Client/Client.resource_order index 0a091e5..ca1de6b 100644 --- a/Client/Client.resource_order +++ b/Client/Client.resource_order @@ -29,14 +29,15 @@ ], "ResourceOrderSettings":[ {"name":"MultiClient","order":1,"path":"extensions/MultiClient/MultiClient.yy",}, + {"name":"oChatManager","order":7,"path":"objects/oChatManager/oChatManager.yy",}, {"name":"oDualInstance","order":1,"path":"objects/oDualInstance/oDualInstance.yy",}, {"name":"oEntityManager","order":2,"path":"objects/oEntityManager/oEntityManager.yy",}, - {"name":"oFindingMatch","order":7,"path":"objects/oFindingMatch/oFindingMatch.yy",}, - {"name":"oFriendList","order":6,"path":"objects/oFriendList/oFriendList.yy",}, - {"name":"oLobbiesDemo","order":2,"path":"objects/oLobbiesDemo/oLobbiesDemo.yy",}, - {"name":"oLoginMenu","order":3,"path":"objects/oLoginMenu/oLoginMenu.yy",}, - {"name":"oMainMenu","order":4,"path":"objects/oMainMenu/oMainMenu.yy",}, - {"name":"oPartyUI","order":5,"path":"objects/oPartyUI/oPartyUI.yy",}, + {"name":"oFindingMatch","order":6,"path":"objects/oFindingMatch/oFindingMatch.yy",}, + {"name":"oFriendList","order":5,"path":"objects/oFriendList/oFriendList.yy",}, + {"name":"oLobbiesDemo","order":1,"path":"objects/oLobbiesDemo/oLobbiesDemo.yy",}, + {"name":"oLoginMenu","order":2,"path":"objects/oLoginMenu/oLoginMenu.yy",}, + {"name":"oMainMenu","order":3,"path":"objects/oMainMenu/oMainMenu.yy",}, + {"name":"oPartyUI","order":4,"path":"objects/oPartyUI/oPartyUI.yy",}, {"name":"oPhysicsEntity","order":1,"path":"objects/oPhysicsEntity/oPhysicsEntity.yy",}, {"name":"oPingManager","order":3,"path":"objects/oPingManager/oPingManager.yy",}, {"name":"oPlayer","order":1,"path":"objects/oPlayer/oPlayer.yy",}, diff --git a/Client/Client.yyp b/Client/Client.yyp index 1856323..86d54a1 100644 --- a/Client/Client.yyp +++ b/Client/Client.yyp @@ -59,6 +59,7 @@ {"id":{"name":"fTitle","path":"fonts/fTitle/fTitle.yy",},}, {"id":{"name":"ProjectStructure","path":"notes/ProjectStructure/ProjectStructure.yy",},}, {"id":{"name":"oBox","path":"objects/oBox/oBox.yy",},}, + {"id":{"name":"oChatManager","path":"objects/oChatManager/oChatManager.yy",},}, {"id":{"name":"oClient","path":"objects/oClient/oClient.yy",},}, {"id":{"name":"oDemo","path":"objects/oDemo/oDemo.yy",},}, {"id":{"name":"oDualInstance","path":"objects/oDualInstance/oDualInstance.yy",},}, diff --git a/Client/objects/oChatManager/Create_0.gml b/Client/objects/oChatManager/Create_0.gml new file mode 100644 index 0000000..b13b3d6 --- /dev/null +++ b/Client/objects/oChatManager/Create_0.gml @@ -0,0 +1,3 @@ +/// @desc + +messages = [] diff --git a/Client/objects/oChatManager/Draw_64.gml b/Client/objects/oChatManager/Draw_64.gml new file mode 100644 index 0000000..0d816d3 --- /dev/null +++ b/Client/objects/oChatManager/Draw_64.gml @@ -0,0 +1,2 @@ +/// @desc + diff --git a/Client/objects/oChatManager/oChatManager.yy b/Client/objects/oChatManager/oChatManager.yy new file mode 100644 index 0000000..c203ea4 --- /dev/null +++ b/Client/objects/oChatManager/oChatManager.yy @@ -0,0 +1,36 @@ +{ + "$GMObject":"", + "%Name":"oChatManager", + "eventList":[ + {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + ], + "managed":true, + "name":"oChatManager", + "overriddenProperties":[], + "parent":{ + "name":"Menu", + "path":"folders/Warp Demo/Objects/Menu.yy", + }, + "parentObjectId":null, + "persistent":false, + "physicsAngularDamping":0.1, + "physicsDensity":0.5, + "physicsFriction":0.2, + "physicsGroup":1, + "physicsKinematic":false, + "physicsLinearDamping":0.1, + "physicsObject":false, + "physicsRestitution":0.1, + "physicsSensor":false, + "physicsShape":1, + "physicsShapePoints":[], + "physicsStartAwake":true, + "properties":[], + "resourceType":"GMObject", + "resourceVersion":"2.0", + "solid":false, + "spriteId":null, + "spriteMaskId":null, + "visible":true, +} \ No newline at end of file diff --git a/Client/scripts/__WarpConfig/__WarpConfig.gml b/Client/scripts/__WarpConfig/__WarpConfig.gml index b34da8a..1401140 100644 --- a/Client/scripts/__WarpConfig/__WarpConfig.gml +++ b/Client/scripts/__WarpConfig/__WarpConfig.gml @@ -1,7 +1,7 @@ // All the macro/config definitions go here // feather ignore GM1038 -#macro WARP_VERSION "v6.0.0" +#macro WARP_VERSION "v7.0.0" #macro GAME_VERSION "v1.0.0" trace("Welcome to Warp % by Evoleo!", WARP_VERSION) diff --git a/TypescriptServer/src/concepts/chat.ts b/TypescriptServer/src/concepts/chat.ts new file mode 100644 index 0000000..936abd8 --- /dev/null +++ b/TypescriptServer/src/concepts/chat.ts @@ -0,0 +1,69 @@ +import Client from "#concepts/client"; +import Account, { IProfile } from "#schemas/profile"; + +import { ObjectId } from "mongoose"; + + +export interface IMessage { + profile_id: ObjectId | string; + name: string; + content: string; +} + +export class Message implements IMessage { + id: number; + profile_id: string; + name: string; + content: string; +} + +// export class Chat { +// chat_id: string; // id of the chat room +// online_members: Client[]; +// members: string[]; // profile_id[] +// messages: Message[]; + +// constructor(members?: Client[]) { +// if (members) { +// for(let member in members) { +// this.addMember(member); +// } +// } + +// } + +// async save() { + +// } + +// addMember(member: Client) { +// this.members.push(member); +// } + +// kickMember(member: Client) { +// let idx = this.members.indexOf(member); +// this.members.splice(idx, 1); +// } + +// disconnectMember(member: Client) { + +// } +// } + +// export class GlobalChat extends Chat { +// constructor() { +// super(global.clients); +// } +// } + +// export class DirectChat extends Chat { +// constructor(client1:Client, client2:Client) { +// super([client1, client2]); +// } +// } + +// export class GroupChat extends Chat { +// constructor(members: Client[]) { +// super(members); +// } +// } \ No newline at end of file