fixed bug
This commit is contained in:
Generated
+62
-12
@@ -20,12 +20,36 @@
|
|||||||
<path>
|
<path>
|
||||||
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||||
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
|
||||||
<item name="BRANCH:bk" type="e8cecc67:BranchNodeDescriptor" />
|
<item name="BRANCH:master" type="e8cecc67:BranchNodeDescriptor" />
|
||||||
</path>
|
</path>
|
||||||
</select>
|
</select>
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="f9039135-aa11-4abd-ad74-f40c84e4fdb2" name="Default Changelist" comment="" />
|
<list default="true" id="f9039135-aa11-4abd-ad74-f40c84e4fdb2" name="Default Changelist" comment="">
|
||||||
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/Action.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/Action.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/BuyIn.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/BuyIn.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/SitList.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/SitList.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/audio.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/Audio.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/cardList.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/CardList.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/gameRecord.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/GameRecord.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/notice.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/Notice.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/player.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/Player.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/range.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/Range.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/record.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/Record.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/sendMsg.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/SendMsg.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/components/toast.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/components/Toast.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/utils/PokerStyle.ts" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/utils/PokerStyle.ts" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/utils/map.ts" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/utils/map.ts" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/views/game.vue" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/views/game.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/server/src.zip" beforeDir="false" afterPath="$PROJECT_DIR$/server/src.zip" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/server/src/app/core/PokerGame.ts" beforeDir="false" afterPath="$PROJECT_DIR$/server/src/app/core/PokerGame.ts" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/server/src/app/core/PokerStyle.ts" beforeDir="false" afterPath="$PROJECT_DIR$/server/src/app/core/PokerStyle.ts" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/server/src/app/io/controller/game.ts" beforeDir="false" afterPath="$PROJECT_DIR$/server/src/app/io/controller/game.ts" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/server/src/app/io/middleware/join.ts" beforeDir="false" afterPath="$PROJECT_DIR$/server/src/app/io/middleware/join.ts" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/server/src/app/router.ts" beforeDir="false" afterPath="$PROJECT_DIR$/server/src/app/router.ts" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/server/src/lib/baseSocketController.ts" beforeDir="false" afterPath="$PROJECT_DIR$/server/src/lib/baseSocketController.ts" afterDir="false" />
|
||||||
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
@@ -37,6 +61,7 @@
|
|||||||
<option value="Vue" />
|
<option value="Vue" />
|
||||||
<option value="Less File" />
|
<option value="Less File" />
|
||||||
<option value="TypeScript File" />
|
<option value="TypeScript File" />
|
||||||
|
<option value="Vue Single File Component" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
@@ -47,7 +72,7 @@
|
|||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
<option name="RESET_MODE" value="MIXED" />
|
<option name="RESET_MODE" value="SOFT" />
|
||||||
</component>
|
</component>
|
||||||
<component name="JsFlowSettings">
|
<component name="JsFlowSettings">
|
||||||
<service-enabled>true</service-enabled>
|
<service-enabled>true</service-enabled>
|
||||||
@@ -81,9 +106,6 @@
|
|||||||
<property name="ts.external.directory.path" value="$PROJECT_DIR$/server/node_modules/typescript/lib" />
|
<property name="ts.external.directory.path" value="$PROJECT_DIR$/server/node_modules/typescript/lib" />
|
||||||
</component>
|
</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
|
||||||
<recent name="$PROJECT_DIR$" />
|
|
||||||
</key>
|
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
<recent name="$PROJECT_DIR$" />
|
<recent name="$PROJECT_DIR$" />
|
||||||
<recent name="$PROJECT_DIR$/server" />
|
<recent name="$PROJECT_DIR$/server" />
|
||||||
@@ -91,6 +113,9 @@
|
|||||||
<recent name="$PROJECT_DIR$/client/src/interface" />
|
<recent name="$PROJECT_DIR$/client/src/interface" />
|
||||||
<recent name="$PROJECT_DIR$/server/src/service" />
|
<recent name="$PROJECT_DIR$/server/src/service" />
|
||||||
</key>
|
</key>
|
||||||
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
|
<recent name="$PROJECT_DIR$" />
|
||||||
|
</key>
|
||||||
</component>
|
</component>
|
||||||
<component name="SvnConfiguration">
|
<component name="SvnConfiguration">
|
||||||
<configuration />
|
<configuration />
|
||||||
@@ -129,6 +154,16 @@
|
|||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
<option name="version" value="2" />
|
<option name="version" value="2" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="Vcs.Log.History.Properties">
|
||||||
|
<option name="COLUMN_ORDER">
|
||||||
|
<list>
|
||||||
|
<option value="0" />
|
||||||
|
<option value="2" />
|
||||||
|
<option value="3" />
|
||||||
|
<option value="1" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
<component name="Vcs.Log.Tabs.Properties">
|
<component name="Vcs.Log.Tabs.Properties">
|
||||||
<option name="TAB_STATES">
|
<option name="TAB_STATES">
|
||||||
<map>
|
<map>
|
||||||
@@ -154,15 +189,21 @@
|
|||||||
<option name="oldMeFiltersMigrated" value="true" />
|
<option name="oldMeFiltersMigrated" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="WindowStateProjectService">
|
<component name="WindowStateProjectService">
|
||||||
<state x="100" y="100" width="1240" height="700" key="DiffContextDialog" timestamp="1593348545499">
|
<state x="184" y="98" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1600508433832">
|
||||||
<screen x="0" y="23" width="1440" height="828" />
|
<screen x="0" y="23" width="1440" height="827" />
|
||||||
|
</state>
|
||||||
|
<state x="184" y="98" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.23.1440.827@0.23.1440.827" timestamp="1600508433832" />
|
||||||
|
<state x="100" y="100" width="1240" height="696" key="DiffContextDialog" timestamp="1607254387585">
|
||||||
|
<screen x="0" y="23" width="1440" height="823" />
|
||||||
</state>
|
</state>
|
||||||
<state x="100" y="100" width="1240" height="700" key="DiffContextDialog/0.0.1440.900@0.0.1440.900" timestamp="1593070402308" />
|
<state x="100" y="100" width="1240" height="700" key="DiffContextDialog/0.0.1440.900@0.0.1440.900" timestamp="1593070402308" />
|
||||||
|
<state x="100" y="100" width="1240" height="696" key="DiffContextDialog/0.23.1440.823@0.23.1440.823" timestamp="1607254387585" />
|
||||||
<state x="100" y="100" width="1240" height="700" key="DiffContextDialog/0.23.1440.828@0.23.1440.828" timestamp="1593348545499" />
|
<state x="100" y="100" width="1240" height="700" key="DiffContextDialog/0.23.1440.828@0.23.1440.828" timestamp="1593348545499" />
|
||||||
<state x="100" y="100" width="1240" height="702" key="com.intellij.history.integration.ui.views.FileHistoryDialog" timestamp="1599912309818">
|
<state x="100" y="99" width="1240" height="695" key="com.intellij.history.integration.ui.views.FileHistoryDialog" timestamp="1607254387585">
|
||||||
<screen x="0" y="23" width="1440" height="832" />
|
<screen x="0" y="23" width="1440" height="823" />
|
||||||
</state>
|
</state>
|
||||||
<state x="100" y="100" width="1240" height="700" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.0.1440.900@0.0.1440.900" timestamp="1593351376798" />
|
<state x="100" y="100" width="1240" height="700" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.0.1440.900@0.0.1440.900" timestamp="1593351376798" />
|
||||||
|
<state x="100" y="99" width="1240" height="695" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.23.1440.823@0.23.1440.823" timestamp="1607254387585" />
|
||||||
<state x="100" y="100" width="1240" height="700" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.23.1440.827@0.23.1440.827" timestamp="1593358666478" />
|
<state x="100" y="100" width="1240" height="700" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.23.1440.827@0.23.1440.827" timestamp="1593358666478" />
|
||||||
<state x="100" y="100" width="1240" height="700" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.23.1440.828@0.23.1440.828" timestamp="1599741084335" />
|
<state x="100" y="100" width="1240" height="700" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.23.1440.828@0.23.1440.828" timestamp="1599741084335" />
|
||||||
<state x="100" y="100" width="1240" height="702" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.23.1440.832@0.23.1440.832" timestamp="1599912309818" />
|
<state x="100" y="100" width="1240" height="702" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.23.1440.832@0.23.1440.832" timestamp="1599912309818" />
|
||||||
@@ -170,10 +211,19 @@
|
|||||||
<screen x="0" y="0" width="1440" height="900" />
|
<screen x="0" y="0" width="1440" height="900" />
|
||||||
</state>
|
</state>
|
||||||
<state x="378" y="207" width="683" height="490" key="find.popup/0.0.1440.900@0.0.1440.900" timestamp="1593070201850" />
|
<state x="378" y="207" width="683" height="490" key="find.popup/0.0.1440.900@0.0.1440.900" timestamp="1593070201850" />
|
||||||
<state x="450" y="362" key="vcs.readOnlyHandler.ReadOnlyStatusDialog" timestamp="1599740214397">
|
<state x="385" y="197" key="run.anything.popup" timestamp="1605708588099">
|
||||||
<screen x="0" y="23" width="1440" height="828" />
|
<screen x="0" y="23" width="1440" height="823" />
|
||||||
|
</state>
|
||||||
|
<state x="385" y="197" key="run.anything.popup/0.23.1440.823@0.23.1440.823" timestamp="1605708588099" />
|
||||||
|
<state x="385" y="174" width="670" height="676" key="search.everywhere.popup" timestamp="1600510032147">
|
||||||
|
<screen x="0" y="23" width="1440" height="827" />
|
||||||
|
</state>
|
||||||
|
<state x="385" y="174" width="670" height="676" key="search.everywhere.popup/0.23.1440.827@0.23.1440.827" timestamp="1600510032147" />
|
||||||
|
<state x="450" y="362" key="vcs.readOnlyHandler.ReadOnlyStatusDialog" timestamp="1600495902702">
|
||||||
|
<screen x="0" y="23" width="1440" height="829" />
|
||||||
</state>
|
</state>
|
||||||
<state x="450" y="369" key="vcs.readOnlyHandler.ReadOnlyStatusDialog/0.0.1440.900@0.0.1440.900" timestamp="1591504016729" />
|
<state x="450" y="369" key="vcs.readOnlyHandler.ReadOnlyStatusDialog/0.0.1440.900@0.0.1440.900" timestamp="1591504016729" />
|
||||||
<state x="450" y="362" key="vcs.readOnlyHandler.ReadOnlyStatusDialog/0.23.1440.828@0.23.1440.828" timestamp="1599740214397" />
|
<state x="450" y="362" key="vcs.readOnlyHandler.ReadOnlyStatusDialog/0.23.1440.828@0.23.1440.828" timestamp="1599740214397" />
|
||||||
|
<state x="450" y="362" key="vcs.readOnlyHandler.ReadOnlyStatusDialog/0.23.1440.829@0.23.1440.829" timestamp="1600495902702" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
v-show="currPlayer && raiseSize === currPlayer.counter">Allin
|
v-show="currPlayer && raiseSize === currPlayer.counter">Allin
|
||||||
</div>
|
</div>
|
||||||
<range :max="currPlayer && currPlayer.counter"
|
<range :max="currPlayer && currPlayer.counter"
|
||||||
:min="minActionSize"
|
:min="0"
|
||||||
:is-horizontal="true"
|
:is-horizontal="true"
|
||||||
v-model="raiseSize"
|
v-model="raiseSize"
|
||||||
@change="getActionSize"></range>
|
@change="getActionSize"></range>
|
||||||
@@ -108,9 +108,7 @@ import { IPlayer } from '@/interface/IPlayer';
|
|||||||
|
|
||||||
@Watch('raiseSize')
|
@Watch('raiseSize')
|
||||||
private wRaiseSize(val: number) {
|
private wRaiseSize(val: number) {
|
||||||
this.raiseSize = val > this.currPlayer.counter ? this.currPlayer.counter : val < this.minActionSize
|
this.raiseSize = val > this.currPlayer.counter ? this.currPlayer.counter : val;
|
||||||
? this.minActionSize
|
|
||||||
: val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get canActionSize() {
|
get canActionSize() {
|
||||||
@@ -152,7 +150,11 @@ import { IPlayer } from '@/interface/IPlayer';
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getActionSize(size: number) {
|
private getActionSize(size: number) {
|
||||||
this.raiseSize = size;
|
if (size > this.minActionSize) {
|
||||||
|
this.raiseSize = size;
|
||||||
|
} else {
|
||||||
|
this.$plugin.toast('raise size too small');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private addSize() {
|
private addSize() {
|
||||||
@@ -170,8 +172,8 @@ import { IPlayer } from '@/interface/IPlayer';
|
|||||||
|| (this.isPreFlop
|
|| (this.isPreFlop
|
||||||
&& this.isTwoPlayer
|
&& this.isTwoPlayer
|
||||||
&& this.currPlayer?.type === 'd'
|
&& this.currPlayer?.type === 'd'
|
||||||
&& this.prevSize === 2)
|
&& this.prevSize === this.baseSize * 2)
|
||||||
|| (this.currPlayer?.type === 'bb' && this.prevSize === 2 &&
|
|| (this.currPlayer?.type === 'bb' && this.prevSize === this.baseSize * 2 &&
|
||||||
this.isPreFlop);
|
this.isPreFlop);
|
||||||
}
|
}
|
||||||
// raise
|
// raise
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
input{
|
input{
|
||||||
width: 50px;
|
width: 70px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,12 @@
|
|||||||
<div class="shadow"
|
<div class="shadow"
|
||||||
v-show="shadow(card)"></div>
|
v-show="shadow(card)"></div>
|
||||||
<b class="number">{{ map(card)[0] }}</b>
|
<b class="number">{{ map(card)[0] }}</b>
|
||||||
<b class="color">{{ map(card)[1] }}</b>
|
<b class="color">
|
||||||
<b class="color big">{{ map(card)[1] }}</b>
|
<cardStyle size="small" :type="map(card)[1]"></cardStyle>
|
||||||
|
</b>
|
||||||
|
<b class="color big">
|
||||||
|
<cardStyle size="big" :type="map(card)[1]"></cardStyle>
|
||||||
|
</b>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -21,8 +25,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Prop, Vue } from 'vue-property-decorator';
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
||||||
import { mapCard } from '@/utils/map';
|
import { mapCard } from '@/utils/map';
|
||||||
|
import cardStyle from '@/components/CardStyle.vue';
|
||||||
|
|
||||||
@Component
|
@Component({
|
||||||
|
components: {
|
||||||
|
cardStyle,
|
||||||
|
},
|
||||||
|
})
|
||||||
export default class Card extends Vue {
|
export default class Card extends Vue {
|
||||||
@Prop() private cardList: any;
|
@Prop() private cardList: any;
|
||||||
@Prop({ default: () => [], type: Array }) private valueCards!: string[];
|
@Prop({ default: () => [], type: Array }) private valueCards!: string[];
|
||||||
@@ -32,7 +41,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private isBlack(type: string) {
|
private isBlack(type: string) {
|
||||||
return type === '♠' || type === '♣';
|
return type === 's' || type === 'c';
|
||||||
}
|
}
|
||||||
|
|
||||||
private map(card: string) {
|
private map(card: string) {
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<template>
|
||||||
|
<div class="card-style-container">
|
||||||
|
<div class="svg">
|
||||||
|
<svg viewBox="0 0 100 100" :width="`${sizeValue}px`" :height="`${sizeValue}px`" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path :d="path" :fill="color"/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export default class CardStyle extends Vue {
|
||||||
|
@Prop() private type: any;
|
||||||
|
@Prop() private size!: string;
|
||||||
|
private pathObj: any = {
|
||||||
|
h: 'M 0,25 A 25,25 0,0,1 50,25 A 25,25 0,0,1 100,25 C 100,60 70,60 50,100 C 30,60 0,60 0,25',
|
||||||
|
c: 'M25,25 A25,25 0,0,1 75,25 A25,25 0,1,1 52,65 A35,35 0,0,0 75,100 L25,100 A35,35 0,0,0 48,65 A25,25 0,1,1 25,25',
|
||||||
|
s: 'M 4,65 A 22,22 0,0,0 48,65 Q 50,90 30,100 L 70,100 Q 50,90 52,65 A 22,22 0,0,0 96,65 C 96,40 70,40 50,0 C 30,40 4,40 4,65',
|
||||||
|
d: 'M 50,0 Q50,15 15,50 Q50,85 50,100 Q50,85 85,50 Q50,15 50,0',
|
||||||
|
};
|
||||||
|
private sizeObj: any = {
|
||||||
|
big: 22,
|
||||||
|
small: 12,
|
||||||
|
default: 20,
|
||||||
|
};
|
||||||
|
get sizeValue() {
|
||||||
|
return this.sizeObj[this.size];
|
||||||
|
}
|
||||||
|
get path() {
|
||||||
|
return this.pathObj[this.type];
|
||||||
|
}
|
||||||
|
get color() {
|
||||||
|
return this.type === 'h' || this.type === 'd' ? 'red' : 'black';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
|
<style scoped
|
||||||
|
lang="less">
|
||||||
|
.card-style-container {
|
||||||
|
.svg {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,59 +1,59 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="notice-container">
|
<div class="notice-container">
|
||||||
<div class="notice-body">
|
<div class="notice-body">
|
||||||
<i v-for="message in messageList"
|
<i v-for="message in messageList"
|
||||||
v-if="message !== ''"
|
v-if="message !== ''"
|
||||||
:style="{top: `${message.top}vh`}"
|
:style="{top: `${message.top}vh`}"
|
||||||
>{{message.message}}</i>
|
>{{message.message}}</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {Component, Prop, Watch, Vue} from 'vue-property-decorator';
|
import {Component, Prop, Watch, Vue} from 'vue-property-decorator';
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class Notice extends Vue {
|
export default class Notice extends Vue {
|
||||||
@Prop() private messageList!: any[];
|
@Prop() private messageList!: any[];
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
<style scoped
|
<style scoped
|
||||||
lang="less">
|
lang="less">
|
||||||
.notice-container {
|
.notice-container {
|
||||||
.notice-body{
|
.notice-body{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
i{
|
i{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 20px;
|
top: 20px;
|
||||||
left: 0;
|
left: 0;
|
||||||
transform: translate3d(100vw,0,0);
|
transform: translate3d(100vw,0,0);
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
animation: 4s move linear forwards;
|
animation: 8s move linear forwards;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
background-color: rgba(0,0,0,0.4);
|
background-color: rgba(0,0,0,0.4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@-webkit-keyframes move /* Safari 与 Chrome */ {
|
@-webkit-keyframes move /* Safari 与 Chrome */ {
|
||||||
0% {
|
0% {
|
||||||
transform: translate3d(100vw,0,0);
|
transform: translate3d(100vw,0,0);
|
||||||
}
|
}
|
||||||
99%{
|
99%{
|
||||||
transform: translate3d(-198px, 0px, 0px);
|
transform: translate3d(-198px, 0px, 0px);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
100% {
|
100% {
|
||||||
transform: translate3d(-200px, 0px, 0px);
|
transform: translate3d(-200px, 0px, 0px);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
<div class="range-body">
|
<div class="range-body">
|
||||||
<input type="range"
|
<input type="range"
|
||||||
v-model="rangeSize"
|
v-model="rangeSize"
|
||||||
|
|
||||||
:class="{horizontal: !!isHorizontal}">
|
:class="{horizontal: !!isHorizontal}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<BuyIn :showBuyIn.sync="showBuyIn"
|
<BuyIn :showBuyIn.sync="showBuyIn"
|
||||||
:min="0"
|
:min="0"
|
||||||
:max="1000"
|
:max="roomConfig.smallBlind * 1000"
|
||||||
@buyIn='buyIn'></BuyIn>
|
@buyIn='buyIn'></BuyIn>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -123,9 +123,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private buyIn(size: number) {
|
private buyIn(size: number) {
|
||||||
console.log('ccc');
|
|
||||||
this.showBuyIn = false;
|
this.showBuyIn = false;
|
||||||
this.currPlayer.counter += size;
|
this.currPlayer.counter += Number(size);
|
||||||
this.$emit('buyIn', Number(size));
|
this.$emit('buyIn', Number(size));
|
||||||
this.sitDown(this.currSit);
|
this.sitDown(this.currSit);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ enum ShortPokerStyleEnum {
|
|||||||
'FOUR_KIND',
|
'FOUR_KIND',
|
||||||
'FLUSH',
|
'FLUSH',
|
||||||
'FULL_HOUSE',
|
'FULL_HOUSE',
|
||||||
'THREE_KIND',
|
|
||||||
'STRAIGHT',
|
'STRAIGHT',
|
||||||
|
'THREE_KIND',
|
||||||
'TWO_PAIR',
|
'TWO_PAIR',
|
||||||
'PAIR',
|
'PAIR',
|
||||||
'HIGH_CARD',
|
'HIGH_CARD',
|
||||||
@@ -93,8 +93,8 @@ export class PokerStyle implements IPokerStyle {
|
|||||||
'FOUR_KIND',
|
'FOUR_KIND',
|
||||||
'FLUSH',
|
'FLUSH',
|
||||||
'FULL_HOUSE',
|
'FULL_HOUSE',
|
||||||
'THREE_KIND',
|
|
||||||
'STRAIGHT',
|
'STRAIGHT',
|
||||||
|
'THREE_KIND',
|
||||||
'TWO_PAIR',
|
'TWO_PAIR',
|
||||||
'PAIR',
|
'PAIR',
|
||||||
'HIGH_CARD',
|
'HIGH_CARD',
|
||||||
@@ -250,35 +250,19 @@ export class PokerStyle implements IPokerStyle {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.isShort) {
|
|
||||||
// three of kind
|
|
||||||
if (isThree.length > 0) {
|
|
||||||
isThreeKind = isThree.join('');
|
|
||||||
isThreeKind += highCard[0] + highCard[1];
|
|
||||||
this.pokerStyle[5] = isThreeKind;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// straight
|
// straight
|
||||||
if (this.isStraight() !== '0') {
|
if (this.isStraight() !== '0') {
|
||||||
this.pokerStyle[6] = `${this.isStraight()}`;
|
this.pokerStyle[5] = `${this.isStraight()}`;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
// three of kind
|
||||||
// straight
|
if (isThree.length > 0) {
|
||||||
if (this.isStraight() !== '0') {
|
isThreeKind = isThree.join('');
|
||||||
this.pokerStyle[5] = `${this.isStraight()}`;
|
isThreeKind += highCard[0] + highCard[1];
|
||||||
return;
|
this.pokerStyle[6] = isThreeKind;
|
||||||
}
|
return;
|
||||||
|
|
||||||
// three of kind
|
|
||||||
if (isThree.length > 0) {
|
|
||||||
isThreeKind = isThree.join('');
|
|
||||||
isThreeKind += highCard[0] + highCard[1];
|
|
||||||
this.pokerStyle[6] = isThreeKind;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// tow pair
|
// tow pair
|
||||||
|
|||||||
+18
-18
@@ -1,18 +1,18 @@
|
|||||||
export default (cards: string []) => {
|
export default (cards: string []) => {
|
||||||
const cardNumber = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K', 'A'];
|
const cardNumber = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K', 'A'];
|
||||||
const color = ['♦', '♣', '♥', '♠'];
|
const color = ['♦', '♣', '♥', '♠'];
|
||||||
return cards?.map((c: string) => {
|
return cards?.map((c: string) => {
|
||||||
const cNumber = c.charCodeAt(0) - 97;
|
const cNumber = c.charCodeAt(0) - 97;
|
||||||
const cColor = Number(c[1]) - 1;
|
const cColor = Number(c[1]) - 1;
|
||||||
return [`${cardNumber[cNumber]}`, `${color[cColor]}`];
|
return [`${cardNumber[cNumber]}`, `${color[cColor]}`];
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapCard = (card: string) => {
|
const mapCard = (card: string) => {
|
||||||
const cardNumber = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K', 'A'];
|
const cardNumber = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K', 'A'];
|
||||||
const color = ['♦', '♣', '♥', '♠'];
|
const color = ['d', 'c', 'h', 's'];
|
||||||
const cNumber = card.charCodeAt(0) - 97;
|
const cNumber = card.charCodeAt(0) - 97;
|
||||||
const cColor = Number(card[1]) - 1;
|
const cColor = Number(card[1]) - 1;
|
||||||
return [`${cardNumber[cNumber]}`, `${color[cColor]}`];
|
return [`${cardNumber[cNumber]}`, `${color[cColor]}`];
|
||||||
};
|
};
|
||||||
export { mapCard };
|
export { mapCard };
|
||||||
|
|||||||
@@ -44,12 +44,13 @@
|
|||||||
<div class="setting-body"
|
<div class="setting-body"
|
||||||
:class="{show: showSetting}">
|
:class="{show: showSetting}">
|
||||||
<i @click="showBuyInDialog()">buy in</i>
|
<i @click="showBuyInDialog()">buy in</i>
|
||||||
|
<i @click="standUp()">stand Up</i>
|
||||||
<i @click="showCounterRecord">counter record</i>
|
<i @click="showCounterRecord">counter record</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<BuyIn :showBuyIn.sync='showBuyIn'
|
<BuyIn :showBuyIn.sync='showBuyIn'
|
||||||
:min='0'
|
:min='0'
|
||||||
:max='1000'
|
:max='baseSize * 1000'
|
||||||
@buyIn='buyIn'></BuyIn>
|
@buyIn='buyIn'></BuyIn>
|
||||||
<toast :show.sync="showMsg"
|
<toast :show.sync="showMsg"
|
||||||
:text="msg"></toast>
|
:text="msg"></toast>
|
||||||
@@ -106,6 +107,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const GAME_BASE_SIZE = 1;
|
const GAME_BASE_SIZE = 1;
|
||||||
|
const ACTION_TIME = 60;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
@@ -142,10 +144,9 @@
|
|||||||
private actionUserId = '';
|
private actionUserId = '';
|
||||||
private showAllin = false;
|
private showAllin = false;
|
||||||
private showMsg = false;
|
private showMsg = false;
|
||||||
private baseSize = GAME_BASE_SIZE;
|
|
||||||
private playIncome = false;
|
private playIncome = false;
|
||||||
private msg = '';
|
private msg = '';
|
||||||
private time = 30;
|
private time = ACTION_TIME;
|
||||||
private timeSt = 0;
|
private timeSt = 0;
|
||||||
private commandRecordList = [];
|
private commandRecordList = [];
|
||||||
private showCommandRecord = false;
|
private showCommandRecord = false;
|
||||||
@@ -179,7 +180,7 @@
|
|||||||
|
|
||||||
@Watch('actionUserId')
|
@Watch('actionUserId')
|
||||||
private actionUserIdChange() {
|
private actionUserIdChange() {
|
||||||
this.time = 30;
|
this.time = ACTION_TIME;
|
||||||
clearTimeout(this.timeSt);
|
clearTimeout(this.timeSt);
|
||||||
this.doCountDown();
|
this.doCountDown();
|
||||||
}
|
}
|
||||||
@@ -230,7 +231,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
get minActionSize() {
|
get minActionSize() {
|
||||||
return this.prevSize <= 0 ? GAME_BASE_SIZE * 2 : this.prevSize * 2;
|
return this.prevSize <= 0 ? this.baseSize * 2 : this.prevSize * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
get baseSize() {
|
||||||
|
return this.roomConfig.smallBlind || GAME_BASE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private init() {
|
private init() {
|
||||||
@@ -239,7 +244,7 @@
|
|||||||
this.commonCard = [];
|
this.commonCard = [];
|
||||||
this.pot = 0;
|
this.pot = 0;
|
||||||
this.prevSize = 0;
|
this.prevSize = 0;
|
||||||
this.time = 30;
|
this.time = ACTION_TIME;
|
||||||
this.winner = [];
|
this.winner = [];
|
||||||
this.showBuyIn = false;
|
this.showBuyIn = false;
|
||||||
this.initSitLink();
|
this.initSitLink();
|
||||||
@@ -391,6 +396,7 @@
|
|||||||
if (msg.action === 'gameInfo') {
|
if (msg.action === 'gameInfo') {
|
||||||
this.players = msg.data.players;
|
this.players = msg.data.players;
|
||||||
this.pot = msg.data.pot || 0;
|
this.pot = msg.data.pot || 0;
|
||||||
|
this.roomConfig.smallBlind = msg.data.smallBlind;
|
||||||
this.prevSize = msg.data.prevSize;
|
this.prevSize = msg.data.prevSize;
|
||||||
this.actionUserId = msg.data.currPlayer.userId;
|
this.actionUserId = msg.data.currPlayer.userId;
|
||||||
// this.isAction = !!(this.userInfo && this.userInfo.userId === msg.data.currPlayer.userId);
|
// this.isAction = !!(this.userInfo && this.userInfo.userId === msg.data.currPlayer.userId);
|
||||||
@@ -474,6 +480,10 @@
|
|||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private standUp() {
|
||||||
|
this.emit('standUp');
|
||||||
|
this.showSetting = false;
|
||||||
|
}
|
||||||
|
|
||||||
private play() {
|
private play() {
|
||||||
if (this.players.length >= 2) {
|
if (this.players.length >= 2) {
|
||||||
|
|||||||
Binary file not shown.
@@ -45,7 +45,7 @@ export enum EGameStatus {
|
|||||||
* Action time
|
* Action time
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
const ACTION_TIME = 30 * 1000;
|
const ACTION_TIME = 60 * 1000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class representing a poker game
|
* Class representing a poker game
|
||||||
@@ -387,12 +387,15 @@ export class PokerGame {
|
|||||||
&& this.prevSize !== this.smallBlind * 2 && this.prevSize !== 0), 'tst', size, nextPlayer.actionSize, this.prevSize);
|
&& this.prevSize !== this.smallBlind * 2 && this.prevSize !== 0), 'tst', size, nextPlayer.actionSize, this.prevSize);
|
||||||
// all check actionSize === -1
|
// all check actionSize === -1
|
||||||
// all player allin
|
// all player allin
|
||||||
// only 2 player, curr player fold, next player alrecommand add errorady action
|
// only 2 player, curr player fold, next player already action
|
||||||
// only one player ,one player fold,other player allin
|
// only one player,one player fold,other player allin
|
||||||
// pre flop big blind check and other player call
|
// pre flop big blind check and other player call
|
||||||
// pre flop big blind fold and other player call
|
// pre flop big blind fold and other player call
|
||||||
if (this.playerSize === 0
|
if (this.playerSize === 0
|
||||||
|| (this.playerSize === 1 && this.currActionAllinPlayer.length === 0)
|
|| (this.playerSize === 1
|
||||||
|
&& (this.currActionAllinPlayer.length === 0
|
||||||
|
|| (command === ECommand.ALL_IN
|
||||||
|
&& this.currPlayer.node.actionSize < this.prevSize)))
|
||||||
|| (this.commonCard.length !== 0 && nextPlayer.actionSize === this.smallBlind * 2
|
|| (this.commonCard.length !== 0 && nextPlayer.actionSize === this.smallBlind * 2
|
||||||
&& nextPlayer.actionSize === size && size === this.prevSize)
|
&& nextPlayer.actionSize === size && size === this.prevSize)
|
||||||
|| (nextPlayer.actionSize === this.prevSize
|
|| (nextPlayer.actionSize === this.prevSize
|
||||||
@@ -571,18 +574,24 @@ export class PokerGame {
|
|||||||
counting() {
|
counting() {
|
||||||
let prevEvPot = 0;
|
let prevEvPot = 0;
|
||||||
this.winner.forEach((winnerList, key) => {
|
this.winner.forEach((winnerList, key) => {
|
||||||
if (key !== 0) {
|
winnerList.sort((prev, next) => prev.inPot - next.inPot);
|
||||||
prevEvPot = this.winner[key - 1][0].evPot;
|
let roundPotCount = 0;
|
||||||
}
|
|
||||||
winnerList.forEach((winner, index) => {
|
winnerList.forEach((winner, index) => {
|
||||||
const pot = winner.evPot === Infinity ? this.pot : winner.evPot;
|
const pot = winner.evPot >= this.pot ? this.pot : winner.evPot;
|
||||||
const leftPot = pot - prevEvPot;
|
const leftPot = pot - prevEvPot;
|
||||||
const isDivide = leftPot % winnerList.length;
|
let income = leftPot / (winnerList.length - index);
|
||||||
let income = leftPot / winnerList.length;
|
if (index === winnerList.length - 1) {
|
||||||
if (index === 0 && winnerList.length > 1 && isDivide > 0) {
|
// not only one winner
|
||||||
income = ((leftPot - isDivide) / winnerList.length) + isDivide;
|
if (index !== 0) {
|
||||||
|
income = pot - roundPotCount;
|
||||||
|
}
|
||||||
|
winner.setIncome(income);
|
||||||
|
prevEvPot = winner.evPot;
|
||||||
|
} else {
|
||||||
|
roundPotCount += income;
|
||||||
|
winner.setIncome(income);
|
||||||
}
|
}
|
||||||
winner.setIncome(income);
|
console.log('winner----------', winnerList, roundPotCount, pot, leftPot);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,36 +137,17 @@ export class PokerStyle implements IPokerStyle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log('come in -------', isThree);
|
console.log('come in -------', isThree);
|
||||||
|
// straight
|
||||||
if (this.isShort) {
|
if (this.isStraight() !== '0') {
|
||||||
// three of kind
|
this.pokerStyle[5] = `${this.isStraight()}`;
|
||||||
if (isThree.length > 0) {
|
return;
|
||||||
isThreeKind = isThree.join('');
|
}
|
||||||
isThreeKind += highCard[0] + highCard[1];
|
// three of kind
|
||||||
this.pokerStyle[5] = isThreeKind;
|
if (isThree.length > 0) {
|
||||||
return;
|
isThreeKind = isThree.join('');
|
||||||
}
|
isThreeKind += highCard[0] + highCard[1];
|
||||||
|
this.pokerStyle[6] = isThreeKind;
|
||||||
// straight
|
return;
|
||||||
if (this.isStraight() !== '0') {
|
|
||||||
this.pokerStyle[6] = `${this.isStraight()}`;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// straight
|
|
||||||
if (this.isStraight() !== '0') {
|
|
||||||
this.pokerStyle[5] = `${this.isStraight()}`;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// three of kind
|
|
||||||
if (isThree.length > 0) {
|
|
||||||
isThreeKind = isThree.join('');
|
|
||||||
isThreeKind += highCard[0] + highCard[1];
|
|
||||||
this.pokerStyle[6] = isThreeKind;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// tow pair
|
// tow pair
|
||||||
@@ -240,7 +221,7 @@ export class PokerStyle implements IPokerStyle {
|
|||||||
let isFlush = false;
|
let isFlush = false;
|
||||||
this.pokerStyle.forEach((style, key) => {
|
this.pokerStyle.forEach((style, key) => {
|
||||||
if (style !== '0') {
|
if (style !== '0') {
|
||||||
isFlush = key === 1 || key === 4;
|
isFlush = key === 1 || this.isShort ? key === 3 : key === 4;
|
||||||
valueStyle = style;
|
valueStyle = style;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class GameController extends BaseSocketController {
|
|||||||
roomInfo.game = new PokerGame({
|
roomInfo.game = new PokerGame({
|
||||||
users: sitDownPlayer,
|
users: sitDownPlayer,
|
||||||
isShort: roomInfo.config.isShort,
|
isShort: roomInfo.config.isShort,
|
||||||
smallBlind: 1,
|
smallBlind: roomInfo.config.smallBlind,
|
||||||
actionRoundComplete: async () => {
|
actionRoundComplete: async () => {
|
||||||
let slidePots: number [] = [];
|
let slidePots: number [] = [];
|
||||||
if (roomInfo.game) {
|
if (roomInfo.game) {
|
||||||
@@ -197,9 +197,9 @@ class GameController extends BaseSocketController {
|
|||||||
userId: BB.userId,
|
userId: BB.userId,
|
||||||
type: BB.type,
|
type: BB.type,
|
||||||
gameStatus: 0,
|
gameStatus: 0,
|
||||||
pot: 3,
|
pot: roomInfo.config.smallBlind * 3,
|
||||||
commonCard: '',
|
commonCard: '',
|
||||||
command: 'bb:2',
|
command: `bb:${roomInfo.config.smallBlind * 2}`,
|
||||||
gameId: result.id,
|
gameId: result.id,
|
||||||
counter: BB.counter,
|
counter: BB.counter,
|
||||||
};
|
};
|
||||||
@@ -208,9 +208,9 @@ class GameController extends BaseSocketController {
|
|||||||
userId: SB.userId,
|
userId: SB.userId,
|
||||||
type: SB.type,
|
type: SB.type,
|
||||||
gameStatus: 0,
|
gameStatus: 0,
|
||||||
pot: 1,
|
pot: roomInfo.config.smallBlind,
|
||||||
commonCard: '',
|
commonCard: '',
|
||||||
command: 'sb:1',
|
command: `sb:${roomInfo.config.smallBlind}`,
|
||||||
gameId: result.id,
|
gameId: result.id,
|
||||||
counter: SB.counter,
|
counter: SB.counter,
|
||||||
};
|
};
|
||||||
@@ -370,6 +370,7 @@ class GameController extends BaseSocketController {
|
|||||||
const { payload } = this.message;
|
const { payload } = this.message;
|
||||||
const sitList = payload.sitList;
|
const sitList = payload.sitList;
|
||||||
const roomInfo = await this.getRoomInfo();
|
const roomInfo = await this.getRoomInfo();
|
||||||
|
console.log('sitList=============', sitList);
|
||||||
roomInfo.sit = sitList;
|
roomInfo.sit = sitList;
|
||||||
await this.adapter('online', 'sitList', {
|
await this.adapter('online', 'sitList', {
|
||||||
sitList,
|
sitList,
|
||||||
@@ -378,7 +379,24 @@ class GameController extends BaseSocketController {
|
|||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
async standUp() {
|
||||||
|
try {
|
||||||
|
console.log('come in');
|
||||||
|
const userInfo: IPlayer = await this.getUserInfo();
|
||||||
|
const roomInfo = await this.getRoomInfo();
|
||||||
|
roomInfo.sit.forEach((s: ISit) => {
|
||||||
|
if (s.player && s.player.userId === userInfo.userId) {
|
||||||
|
delete s.player;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const sitList = roomInfo.sit;
|
||||||
|
await this.adapter('online', 'sitList', {
|
||||||
|
sitList,
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
async action() {
|
async action() {
|
||||||
try {
|
try {
|
||||||
const { payload } = this.message;
|
const { payload } = this.message;
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ export default function join(): any {
|
|||||||
currPlayer: {
|
currPlayer: {
|
||||||
userId: roomInfo.game?.currPlayer.node.userId,
|
userId: roomInfo.game?.currPlayer.node.userId,
|
||||||
},
|
},
|
||||||
|
smallBlind: roomInfo.config.smallBlind,
|
||||||
};
|
};
|
||||||
const game = ctx.helper.parseMsg('gameInfo', {
|
const game = ctx.helper.parseMsg('gameInfo', {
|
||||||
data: gameInfo,
|
data: gameInfo,
|
||||||
|
|||||||
@@ -7,4 +7,6 @@ export default function (app: Application) {
|
|||||||
app.io.of('/socket').route('playGame', app.io.controller.game.playGame);
|
app.io.of('/socket').route('playGame', app.io.controller.game.playGame);
|
||||||
app.io.of('/socket').route('action', app.io.controller.game.action);
|
app.io.of('/socket').route('action', app.io.controller.game.action);
|
||||||
app.io.of('/socket').route('sitDown', app.io.controller.game.sitDown);
|
app.io.of('/socket').route('sitDown', app.io.controller.game.sitDown);
|
||||||
|
app.io.of('/socket').route('standUp', app.io.controller.game.standUp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ export default class BaseSocketController extends Controller {
|
|||||||
currPlayer: {
|
currPlayer: {
|
||||||
userId: roomInfo.game.currPlayer.node.userId,
|
userId: roomInfo.game.currPlayer.node.userId,
|
||||||
},
|
},
|
||||||
|
smallBlind: roomInfo.config.smallBlind,
|
||||||
};
|
};
|
||||||
await this.adapter('online', 'gameInfo', gameInfo);
|
await this.adapter('online', 'gameInfo', gameInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user