-
Notifications
You must be signed in to change notification settings - Fork 42
/
onlinehowto.txt
107 lines (82 loc) · 4.57 KB
/
onlinehowto.txt
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
===============================================================
Online Gameplay
---------------
===============================================================
Online Gameplay consists of two elements, client and server.
CLIENT: It is the machine that runs My-PyChess code.
SERVER: It is a machine that accepts connections from different clients(upto 10)
Back when I was actively working on this project, the networking element of this
app was made with security in mind. I had not used the python "pickle" module,
which is normally used in such applications. This has security risks associated.
The server keeps absolutely NO DATA of any user that connects to it.
No names, accounts, emails, IP address, Location - nothing. PRIVACY IS RESPECTED.
The client and server speak over Raw TCP protocol with no sort of encryption.
This means that any bad guys may read the messages that the client and server
send to one another. But the best part is the fact that the client and server DO NOT
EXCHANGE ANY SENSITIVE DATA. This means that the information is practically useless
for the bad guys. So they will not invest their time and efforts to do such things.
If they did so, they would be in major dissapointment.
The public global test server is not being hosted anymore.
==========================================================================
SELF-HOSTING MY_PYCHESS SERVER
==========================================================================
HOW TO RUN SERVER:
==================
Run server.py, as simple as that!
Python v3.6 or above has to be used.
HOW TO CONNECT TO THIS SERVER:
==============================
The server and client must be connected to the same router. When the server runs,
it will message it's IP address in the shell. Enter this in the client's menu.
IT IS TO BE NOTED THAT THE IP ADDRESS IT GIVES IS THE PRIVATE IP ADDRESS, NOT PUBLIC
If for some reason, you want the server's PUBLIC IP ADDRESS,
I have covered that part below. This will not be required for most usecases.
HOW TO CONFIGURE THE SERVER (FOR ADVANCED USAGE):
=================================================
On top of server.py, there are two constants - LOG and IPV6.
They are set to False by default.
IT IS RECOMMENDED YOU DO NOT CHANGE THESE.
But if you really need to, then you can change those.
If you set 'LOG = True', the server will log it's output to a file. The file
will be named by the current date and time of logging. This feature is not
recommended because it will consume more CPU power and RAM than when it is not
logging.
If you set 'IPV6 = True', the server will start in IPv6 mode. This means that
any client that is using the IPv6 protocol can connect to the server. Both client
and server must support IPv6 for this to work. By default, the server opens in
IPv4 mode, which is the protocol that is supported by most of the systems of today.
IPv6 is a more modern protocol, that will take time to be widely adopted because
most of the internet runs on IPv4.
MANAGING THE SERVER WHILE IT IS RUNNING
=======================================
When the server is running, it is constantly messaging you whatever is going
on. You can enter commands to the server.
Commands are listed below:
1) report
Gives the current status of the server with useful information like the
number of threads the server is running, number of people online etc etc
2) mypublicip
Enter this command to know the server's public IP Address.
3) lock
This will put the server in a "locked" state. After this, anyone will not
be able to connect to the server. This will not affect anyone who is
aldready connected to the server.
4) unlock
This will "unlock" the server, the server that is locked will be "unlocked",
then anybody can connect to the server. This is the default state of the
server.
3) kickall
Kick EVERYONE connected to the server.
4) kick <id1> [<id2> <id3> ...]
Kick a particular player (whose id is <id1>).
Can specify more than one id.
example: 'kick 3294', 'kick 9492 2839 5138', 'kick 9327 4392', etc
5) quit
Enter this to stop the server and quit. Recommended way of closing server.
IF YOU WANT TO CLOSE THE SERVER WHILE IT IS RUNNING, ENTER "quit" IN SHELL.
TRYING TO FORCE CLOSE THE SERVER MAY GIVE UNEXPECTED RESULTS TO CLIENTS
CONNECTED.
WHAT IS AN ID, WHAT IS A KEY?
=============================
When the clients connect to server, the server issues the client a unique
4-digit number as their 'ID' or 'key'.