pvp lan is now in maintenance cuz RCE
This commit is contained in:
parent
58f59a3335
commit
5255ec30c9
|
|
@ -7,6 +7,10 @@ I will make and train the AI myself.
|
||||||
I might make a GUI in Pygame, depends if i cbs
|
I might make a GUI in Pygame, depends if i cbs
|
||||||
|
|
||||||
todo list:
|
todo list:
|
||||||
3 gamemodes total. ~~player vs player on the same device~~, ~~player vs player lan~~, and player vs computer
|
~~player vs player on the same device~~, player vs player lan, and player vs computer
|
||||||
|
|
||||||
remember last ip you played against. stop multiple ppl from joining a game lmao. make it so when ppl leave the game ends instead of just crashing.
|
pvp lan todo:
|
||||||
|
(It's in maintenance rn cuz of 1,000,000 serious vulns)
|
||||||
|
remember the last ip you played against. remember ip input with a name?
|
||||||
|
stop multiple ppl joining one game (or add spectators)
|
||||||
|
make it so when ppl leave, the game ends instead of hanging or crashing.
|
||||||
|
|
|
||||||
28
main.py
28
main.py
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import socket
|
import socket
|
||||||
from colours import Colours
|
from colours import Colours as C
|
||||||
|
|
||||||
# ===========================
|
# ===========================
|
||||||
# | Helper functions |
|
# | Helper functions |
|
||||||
|
|
@ -11,13 +11,13 @@ def clear():
|
||||||
|
|
||||||
def colourTile(tile):
|
def colourTile(tile):
|
||||||
if tile == 'R':
|
if tile == 'R':
|
||||||
return f"{Colours.BOLD}{Colours.RED}R{Colours.END}"
|
return f"{C.BOLD}{C.RED}R{C.END}"
|
||||||
elif tile == 'Y':
|
elif tile == 'Y':
|
||||||
return f"{Colours.BOLD}{Colours.YELLOW}Y{Colours.END}"
|
return f"{C.BOLD}{C.YELLOW}Y{C.END}"
|
||||||
elif tile == 'r':
|
elif tile == 'r':
|
||||||
return f"{Colours.BOLD}{Colours.LIGHT_GREEN}R{Colours.END}"
|
return f"{C.BOLD}{C.LIGHT_GREEN}R{C.END}"
|
||||||
elif tile == 'y':
|
elif tile == 'y':
|
||||||
return f"{Colours.BOLD}{Colours.LIGHT_GREEN}Y{Colours.END}"
|
return f"{C.BOLD}{C.LIGHT_GREEN}Y{C.END}"
|
||||||
else:
|
else:
|
||||||
return "O"
|
return "O"
|
||||||
|
|
||||||
|
|
@ -26,15 +26,15 @@ def printBoard(board):
|
||||||
for i in range(6):
|
for i in range(6):
|
||||||
row = ""
|
row = ""
|
||||||
for column in board:
|
for column in board:
|
||||||
row += f"{Colours.BOLD}| {Colours.END}" + colourTile(column[i]) + " "
|
row += f"{C.BOLD}| {C.END}" + colourTile(column[i]) + " "
|
||||||
row += f"{Colours.BOLD}|{Colours.END}"
|
row += f"{C.BOLD}|{C.END}"
|
||||||
rows.append(row)
|
rows.append(row)
|
||||||
rows.reverse()
|
rows.reverse()
|
||||||
|
|
||||||
print(f""" {Colours.BOLD}CONNECT FOUR
|
print(f""" {C.BOLD}CONNECT FOUR
|
||||||
============================={Colours.END}
|
============================={C.END}
|
||||||
{'\n'.join(rows)}
|
{'\n'.join(rows)}
|
||||||
{Colours.BOLD}==1===2===3===4===5===6===7=={Colours.END}""")
|
{C.BOLD}==1===2===3===4===5===6===7=={C.END}""")
|
||||||
|
|
||||||
def getIntInput(prompt, board=None):
|
def getIntInput(prompt, board=None):
|
||||||
while True:
|
while True:
|
||||||
|
|
@ -126,6 +126,10 @@ def play_local_pvp():
|
||||||
play_game(local_move_provider, local_move_provider)
|
play_game(local_move_provider, local_move_provider)
|
||||||
|
|
||||||
def play_lan_server():
|
def play_lan_server():
|
||||||
|
print("PvP LAN is in maintenance due to exploits.!")
|
||||||
|
input("Press Enter to return to menu...")
|
||||||
|
return
|
||||||
|
|
||||||
HOST, PORT = "0.0.0.0", 65432
|
HOST, PORT = "0.0.0.0", 65432
|
||||||
try:
|
try:
|
||||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||||
|
|
@ -146,6 +150,10 @@ def play_lan_server():
|
||||||
s.close()
|
s.close()
|
||||||
|
|
||||||
def play_lan_client():
|
def play_lan_client():
|
||||||
|
print("PvP LAN is in maintenance due to exploits.!")
|
||||||
|
input("Press Enter to return to menu...")
|
||||||
|
return
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
HOST, PORT = input("Enter server IP: "), 65432
|
HOST, PORT = input("Enter server IP: "), 65432
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user