-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathuserSystem.h
More file actions
61 lines (53 loc) · 2.54 KB
/
userSystem.h
File metadata and controls
61 lines (53 loc) · 2.54 KB
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
#ifndef _USERSYSTEMH
#define _USERSYSTEMH
#ifdef INFORMATION
Copyright (C)2011-2024 by Bruce Wilcox
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
#define MAX_USED 30 // we want to track 20, keeping 10 available for new input from user
#define SAID_LIMIT 1000
extern char chatbotSaid[MAX_USED+1][SAID_LIMIT+3]; // last n messages sent to user
extern char humanSaid[MAX_USED+1][SAID_LIMIT+3]; // last n messages read from human
extern int humanSaidIndex;
extern int chatbotSaidIndex;
extern bool noretrybackup;
extern char timeturn15[100];
extern char ipAddress[ID_SIZE];
extern char timeturn0[50];
extern char timePrior[50];
extern unsigned int userFirstLine;
extern bool stopUserWrite;
extern uint64 setControl;
extern unsigned int userFactCount;
extern FACT* migratetop;
extern char caller[MAX_WORD_SIZE];
extern char callee[MAX_WORD_SIZE];
extern char* userDataBase;
// login data
extern char computerID[ID_SIZE];
extern char computerIDwSpace[ID_SIZE];
extern char loginID[ID_SIZE]; // lower case form of loginName
extern char loginName[ID_SIZE]; // as user typed it
extern char callerIP[ID_SIZE];
extern bool serverRetryOK;
// process user
void GetUserData(ResetMode& buildReset,char* input);
void ReadNewUser();
void ReadUserData();
void WriteUserData(time_t curr,bool nobackup);
char* WriteUserVariables(char* ptr,bool sharefile, bool compiling,char* saveJSON);
void RecoverUser();
void CopyUserTopicFile(char* newname);
// login
void ReadComputerID();
bool Login(char* ptr,char* callee,char* ip,char* incoming);
void PartialLogin(char* caller,char* ip);
void ResetUserChat();
void KillShare();
#endif