Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dickreuter committed Aug 21, 2023
1 parent 9cf89c4 commit f472ca2
Show file tree
Hide file tree
Showing 8 changed files with 319 additions and 7 deletions.
8 changes: 4 additions & 4 deletions poker/decisionmaker/montecarlo_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def run_montecarlo_wrapper(p, ui_action_and_signals, config, ui, t, L, preflop_s
elif t.gameStage == "Flop":

if t.isHeadsUp:
for i in range(p.total_players-1):
for i in range(t.total_players-1):
if t.other_players[i]['status'] == 1:
break
n = t.other_players[i]['utg_position']
Expand All @@ -332,7 +332,7 @@ def run_montecarlo_wrapper(p, ui_action_and_signals, config, ui, t, L, preflop_s
else:

if t.isHeadsUp:
for i in range(p.total_players-1):
for i in range(t.total_players-1):
if t.other_players[i]['status'] == 1:
break
n = t.other_players[i]['utg_position']
Expand All @@ -343,7 +343,7 @@ def run_montecarlo_wrapper(p, ui_action_and_signals, config, ui, t, L, preflop_s

t.assumedPlayers = t.other_active_players + 1

max_assumed_players = p.total_players-2
max_assumed_players = t.total_players-2
t.assumedPlayers = min(max(t.assumedPlayers, 2), max_assumed_players)

t.PlayerCardList = []
Expand Down Expand Up @@ -384,7 +384,7 @@ def run_montecarlo_wrapper(p, ui_action_and_signals, config, ui, t, L, preflop_s

if t.gameStage != 'PreFlop':
try:
for abs_pos in range(p.total_players-1):
for abs_pos in range(t.total_players-1):
if t.other_players[abs_pos]['status'] == 1:
sheet_name = preflop_state.get_reverse_sheetname(abs_pos, t, h)
ranges = preflop_state.get_rangecards_from_sheetname(abs_pos, sheet_name, t, h, p)
Expand Down
2 changes: 1 addition & 1 deletion poker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
warnings.filterwarnings("ignore", category=UserWarning)
warnings.filterwarnings("ignore", category=RuntimeWarning)

version = 6.61
version = 6.62
ui = None


Expand Down
13 changes: 12 additions & 1 deletion poker/restapi_local.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
"""Local Restapi used for React frontend"""
import io

import uvicorn
from fastapi import FastAPI, Response
from fastapi.middleware.cors import CORSMiddleware

from poker.tools.screen_operations import take_screenshot

app = FastAPI()

app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:5173",
"http://deepermind-pokerbot.com"], # Allow this origin
allow_credentials=True,
allow_methods=["*"], # Allow all methods
allow_headers=["*"], # Allow all headers
)


def local_restapi():

@app.get("/screenshot_result")
@app.get("/take_screenshot")
async def get_screenshot_result():
screenshot = take_screenshot()
image_bytes_io = io.BytesIO()
Expand Down
1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"deps": "^1.0.0",
"nivo": "^0.31.0",
"react": "^18.2.0",
"react-bootstrap": "^2.8.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.15.0",
Expand Down
2 changes: 1 addition & 1 deletion website/src/App.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#root {
max-width: 1280px;
max-width: 100%;
margin: 0 auto;
padding: 2rem;
text-align: center;
Expand Down
2 changes: 2 additions & 0 deletions website/src/routes/Routing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Home from "../views/Home"
import PaymentCards from "../views/Purchase"
import TableAnalyzer from "../views/TableAnalyzer"
import StrategyAnalyzer from "../views/StrategyAnalyzer"
import TableMapper from "../views/TableMapper"

function Routing() {
return (
Expand All @@ -13,6 +14,7 @@ function Routing() {
<Route path="tableanalyzer" element={<TableAnalyzer />} />
<Route path="/" element={<Home />} />
<Route path="/purchase" element={<PaymentCards />} />
<Route path="/tablemapper" element={<TableMapper />} />
</Routes>
</div>
)
Expand Down
56 changes: 56 additions & 0 deletions website/src/views/TableMapper.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.screenshotWindow {
width: 100%;
height: 700px;
border: 1px solid black;
margin-left: 20px;
display: inline-block;
overflow: auto;
}

.previewWindow {
width: 100%;
height: 700px;
max-height: 700px;
overflow: scroll;
}

.page {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
align-items: flex-start; /* add this line */
}

.tm_button {
font-size: .8rem;
width: 200px;
height: 25px;
display: inline-block;
text-align: center;
line-height: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.tm_button2 {
font-size: .8rem;
width: 100px;
height: 25px;
display: inline-block;
text-align: center;
line-height: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.toplevel-container {
vertical-align: top;
}

canvas {
border: 2px dashed red;
background-color: #f0f0f0;
}
Loading

0 comments on commit f472ca2

Please sign in to comment.