Skip to content

Commit

Permalink
#267 Added first client functionality~
Browse files Browse the repository at this point in the history
  • Loading branch information
lxgr-linux committed May 2, 2023
1 parent a4be20d commit 4f9d000
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions pokete.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import scrap_engine as se
import pokete_data as p_data
from pokete_classes import animations
from pokete_classes.multiplayer.connector import connector
from pokete_classes.multiplayer.menu import ModeChooser
from pokete_classes.pokestats import PokeStats
from pokete_classes.poke import Poke, upgrade_by_one_lvl
Expand Down Expand Up @@ -928,6 +929,7 @@ def exiter():
reset_terminal()
logging.info("[General] Exiting...")
print("\033[?1049l\033[1A")
connector.ensure_closure()
if audio.curr is not None:
audio.kill()

Expand Down
10 changes: 5 additions & 5 deletions pokete_classes/multiplayer/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pokete_classes.multiplayer.modeprovider import modeProvider, Mode
from pokete_classes.tss import tss
from pokete_classes.ui_elements import BetterChooseBox
from pokete_classes import movemap as mvp
from .connector import connector


class PreGameMap(gm.GameSubmap):
Expand All @@ -29,9 +29,9 @@ def __init__(self):
)
super().__init__(
1, [
se.Text("Singleplayer"),
se.Text("Multiplayer"),
se.Text("Leave..."),
se.Text("Singleplayer", state="float"),
se.Text("Multiplayer", state="float"),
se.Text("Leave...", state="float"),
], name="Mode",
overview=self.map,
_map=self.map
Expand All @@ -53,7 +53,7 @@ def __call__(self):
return
elif num == 1:
modeProvider.mode = Mode.MULTI
# Connection entrypoint here
connector(self.map, self)
return
else:
sys.exit()
Expand Down
2 changes: 1 addition & 1 deletion server/responses/responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func writeResponse(connection *net.Conn, response Response) error {
return err
}

_, err = (*connection).Write(resp)
_, err = (*connection).Write(append(resp, []byte("<END>")...))
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion server/test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import socket, time, json, sys

HOST = "localhost" # The server's hostname or IP address
PORT = 9988 # The port used by the server
PORT = 9988 # The port used by the server

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
Expand Down

0 comments on commit 4f9d000

Please sign in to comment.