-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
205 lines (162 loc) · 7.39 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
// Load & Initialize all the things
console.log('Welcome to the console!');
// So, without further ado. Let's get started!
// Load the packages we need
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const morgan = require('morgan');
const mongoose = require('mongoose');
// Load the user character config file which will hold all dynamic information about the environment, the meta verse that they are visiting and the code they intend to bring in. This is a safety mechanism and a strong gamified experience.
const config = require('./config'); // Load the config file and assign it to the state variable config on the server hosted on the server.
// Servers can be embedded in other servers.
// This is a complex concept.
// The server can be embedded in another server.
// It is simple, yet, it is powerful.
// iFrame embedding is a powerful concept.
// It is similar to a window into another metaverse if you reference two different servers in the right iFrame strategy.
// To learn more about iFrame embedding, visit https://www.youtube.com/watch?v=Q_X_Q_X_Q_X <---- Not a real link (We need to make an NFT collection of ASCII Art too).
console.log('Enabling codesharing and community coding session on the server.');
console.log('Tunnel connected for the server to be accessed by the client.');
console.log('Client discovery started');
console.log('Logging for internal teams on network traffic.'); // Share your network traffic with your team in the Github Project link here: [Github Project Link]
const clientConnected = (event,client) => {
console.log(`Client connected: ${client.id}`);
};
const securityCheck = (event,client) => {
console.log(`Client security check: ${client.id}`);
};
const createTransaction = (event,client, payload) => {
console.log(`Client transaction: ${client.id}`);
};
// What does this do?
// This is a function that is called when the server is started that will connect to the MongoDB database.
// What is MongoDB database?
// MongoDB is a database that is used to store data.
// Can you teach me code?
const gatekeeperNPC = (event,client, payload) => {
console.log(`Client gatekeeperNPC: ${client.id}`);
// embed additional functions for the gatekeeperNPC here so that he can protect the server from malicious users.
// One function that would be helpful is to check if the user is a member of the community by looking for an ERC20 token that was sold on OpenSea.
// If the user is a member of the community, then he can access the server.
// If the user is not a member of the community, then he can not access the server.
};
const checkWallet = (client,wallet) => {
console.log(`Client wallet check: ${client.id}`);
// Ensure the wallet has the correct token in it.
// If the wallet has the token, then the user is a member of the community.
// There is no further need for security checks.
// If the wallet does not have the token, then the user is not a member of the community.
// Redirect them to the community website to join the community.
}
// Event listener for socket connection on the server to run when a client connects to the server or disconnects
const clientDisconnected = (event,client) => {
console.log(`Client disconnected: ${client.id}`);
};
console.log('Client connected, starting the server.');
console.log('server started');
// Load the routes
const routes = require('./routes');
// Load the models
const models = require('./models');
// Load the middleware
const middleware = require('./middleware');
// Load the services
const services = require('./services');
// Load the utils
const utils = require('./utils');
// Load the constants
const constants = require('./constants');
// Hello! I'm Rosca Santigria! I am the gatekeeper of the server.
// I am the gatekeeper of the server.
// My job is to protect the server from malicious users.
// The gatekeeper will monitor the server for malicious users with a variety of web, mobile and blockchain security checks.
// Most of the system is automated and the gatekeeper will not be able to stop malicious users from accessing the server without the help of the developers and the community.
// This is Jon Senterfitt, and I am establishing the DAO in the codebase that will become our metaverses.
// Additional characters we will need to succeed in our jrouney of crushing quests and code challenges are
// The gatekeeper NPC
// The developer
// The designer
// The community
// The community manager
// The community member
// The avatar maker
// The code slinger
// The promoter
// The wallet maker
// The wallet stylist
// The wallet checker
// The bouncer
// The lawyer
// The architett
// There will also be fun characters that exist in this metaverse and throughout this code.
// Thanks to AI (NPC and ML) we are able to create characters that will be able to interact with the server.
// This is what an NPC is in the codebase.
// A scene in the metaverse top down pixel game with the gatekeeper and the developer to build the metaverse.
// It should also be able to create characters and interact with the server.
// Create the gatekeeper NPC that will be able to protect the server from malicious users.
const gatekeeperNPC = (event,client, payload) => {
console.log(`Client gatekeeperNPC: ${client.id}`);
console.log('Authenticated as Rosca Santigria');
// This will also load and reference an upgradeable smart contract on the Polygon and Ethereum blockchain.
// The smart contract will be able to check if the user is a member of the community.
// This is the gatekeeper's skill.
// He has manu skills and skill sets.
// this is the leveling system for the architect.
}
// A shared frontal lobe that allows all NPCs to communiticare from a centralized, distributed ledger of internal transaction nd mining logs on the network as source data for enhanced augemented artificaial intelligence training.
// This is the centralized ledger of internal transaction and mining logs on the network.
// The simple shared state:
const NPC_NFT_TRADING_CARD_COLLECTION = {
"cloud": {},
"gatekeeper": {},
"developer": {},
"designer": {},
"community": {},
"communityManager": {},
"communityMember": {},
"avatarMaker": {},
"codeSlinger": {},
"promoter": {},
"walletMaker": {},
"walletStylist": {},
"walletChecker": {},
"bouncer": {},
"lawyer": {},
"architect": {},
"npc": {},
"ml": {},
"server": {},
"client": {},
"github": {},
"nft": {},
"skills": {
"totalAvailable": 0,
},
"levels": {},
"transactions": {},
"mining": {},
"logs": {},
}
const floorTransactionPrice = 100;
const codeRoyalty = 0.1;
// NPC character skill set and stats
const GATEKEEPER = {
"name": "gatekeeper",
"level": 1,
"skills": {
"addMember": floorTransactionPrice * codeRoyalty,
"removeMember": floorTransactionPrice * codeRoyalty,
"addSkill": floorTransactionPrice * codeRoyalty,
"removeSkill": floorTransactionPrice * codeRoyalty,
"addLevel": floorTransactionPrice * codeRoyalty,
"removeLevel": floorTransactionPrice * codeRoyalty,
"addTransaction": floorTransactionPrice * codeRoyalty,
"removeTransaction": floorTransactionPrice * codeRoyalty,
},
"royalties": {
"0xAE034C930aA3E0cD2C7719fa7EF8Bb71cf3a7C42": {
"identifier": "NeoDAO Public Wallet"
},
}
}