Merge pull request #27 from danilt2000/Swino4ka

Swino4ka
This commit is contained in:
Swino4ka
2024-04-17 18:21:40 +02:00
committed by GitHub
7 changed files with 137 additions and 39 deletions

View File

@@ -177,7 +177,27 @@
font-weight: 700; font-weight: 700;
} }
/* /Crash-Graph */ /* /Crash-History */
.crash__history {
background: linear-gradient(90deg, rgba(34, 37, 47, 0.8) -0.54%, rgba(34, 37, 47, 0.8) 83.03%, rgba(73, 59, 74, 0.64) 103.54%);
width: 66%;
height: 50px;
border-radius: 18px;
margin-left: 455px;
display: flex;
gap: 10px;
padding: 0 10px;
}
.crash-history__component {
background: linear-gradient(#18213E, #263873);
width: 12%;
height: 80%;
display: inline;
margin: auto;
border-radius: 10px;
}
/* Crash-Players */ /* Crash-Players */

View File

@@ -1,5 +1,8 @@
import { BackendApiUrl } from '@/properties/Сonfig.js'; import { BackendApiUrl } from '@/properties/Сonfig.js';
import { GetCookie } from "@/assets/js/storage/CookieStorage"; import { GetCookie } from "@/assets/js/storage/CookieStorage";
export async function GetReferralData () { export async function GetReferralData () {
const myHeaders = new Headers(); const myHeaders = new Headers();

View File

@@ -1,5 +1,24 @@
import { BackendApiUrl } from '@/properties/Сonfig.js'; import { BackendApiUrl } from '@/properties/Сonfig.js';
export async function CrashHistory () {
const myHeaders = new Headers();
myHeaders.append("Cookie", "ARRAffinity=a6e48b9e9d2653435be7b61998d8624b44115214104213d6c8b8c526cc56dc70; ARRAffinitySameSite=a6e48b9e9d2653435be7b61998d8624b44115214104213d6c8b8c526cc56dc70");
const requestOptions = {
method: "POST",
headers: myHeaders,
redirect: "follow"
};
fetch("https://spsystemcore20231122004605.azurewebsites.net/api/GameCrash/GetCrashXHistory", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
}
export async function JoinCrashGame(userData, amount) { export async function JoinCrashGame(userData, amount) {
const data = { const data = {
userCredentials: { userCredentials: {

View File

@@ -71,11 +71,34 @@ export default {
ClaimDatamsg(msg) { ClaimDatamsg(msg) {
const now = Date.now(); const now = Date.now();
if (!this.lastMsgTime || now - this.lastMsgTime >= 1000) { if (!this.lastMsgTime || now - this.lastMsgTime >= 1000) {
SendMessageToChat(msg[0]); const processedMsg = this.processMessage(msg[0]);
SendMessageToChat(processedMsg);
this.lastMsgTime = now; this.lastMsgTime = now;
} else { } else {
alert("Вы не можете отправлять сообщения так часто"); alert("Вы не можете отправлять сообщения так часто");
} }
},
processMessage(message) {
const maxLength = 5; // Тут макс допустимых символов писать
const processedMessage = [];
let currentSymbol = "";
let count = 0;
for (let i = 0; i < message.length; i++) {
if (message[i] === currentSymbol) {
count++;
} else {
currentSymbol = message[i];
count = 1;
}
if (count <= maxLength) {
processedMessage.push(message[i]);
}
}
return processedMessage.join("");
}, },
muteChat() { muteChat() {
// Mute the chat by disabling the event listener for incoming messages. // Mute the chat by disabling the event listener for incoming messages.
@@ -116,9 +139,11 @@ export default {
let imageUrl = let imageUrl =
"https://avatar.spworlds.ru/face/55/" + element.userName; "https://avatar.spworlds.ru/face/55/" + element.userName;
const processedMsg = this.processMessage(element.message); // Process the message
const MsgUser = { const MsgUser = {
id: this.id + 1, id: this.id + 1,
msg: element.message, msg: processedMsg, // Use the processed message
username: element.userName, username: element.userName,
icon: imageUrl, icon: imageUrl,
}; };
@@ -133,6 +158,27 @@ export default {
} }
}); });
}, },
processMessage(message) {
const maxLength = 5; // Тут макс допустимых символов писать
const processedMessage = [];
let currentSymbol = "";
let count = 0;
for (let i = 0; i < message.length; i++) {
if (message[i] === currentSymbol) {
count++;
} else {
currentSymbol = message[i];
count = 1;
}
if (count <= maxLength) {
processedMessage.push(message[i]);
}
}
return processedMessage.join("");
},
}; };
</script> </script>

View File

@@ -68,7 +68,7 @@
type="checkbox" type="checkbox"
:class="{ 'animate-start-btn': errorAgree }" :class="{ 'animate-start-btn': errorAgree }"
/> />
<h3>Я согласен с <a href="https://docs.google.com/document/d/1lU_zTWJdD1lcMlIAFDIVz-DlZAoq3a-OFkoO8WBIkzo/edit?usp=sharing">пользовательским соглашением</a></h3> <h3>Я согласен с <a href="https://docs.google.com/document/d/1ytKHnXr67o7mu5TKqlpgRjO8DEvQDRHNnaphhzbr_sg/edit?usp=sharing">пользовательским соглашением</a></h3>
</div> </div>
<div <div
class="btn-deposit btn-text-style btn-display-deposit btn-style-payments" class="btn-deposit btn-text-style btn-display-deposit btn-style-payments"
@@ -115,7 +115,7 @@
</div> </div>
<div class="withdraw-checkbox checkbox-styles"> <div class="withdraw-checkbox checkbox-styles">
<input @click="agreeUser = !agreeUser" type="checkbox" /> <input @click="agreeUser = !agreeUser" type="checkbox" />
<h3>Я согласен <a href="https://docs.google.com/document/d/1lU_zTWJdD1lcMlIAFDIVz-DlZAoq3a-OFkoO8WBIkzo/edit?usp=sharing">пользовательским соглашением</a></h3> <h3>Я согласен <a href="https://docs.google.com/document/d/1ytKHnXr67o7mu5TKqlpgRjO8DEvQDRHNnaphhzbr_sg/edit?usp=sharing">пользовательским соглашением</a></h3>
</div> </div>
<div class="error-captcha" v-if="errorCaptcha && agreeUser === true"> <div class="error-captcha" v-if="errorCaptcha && agreeUser === true">
<h2>Пройдите проверку!</h2> <h2>Пройдите проверку!</h2>

View File

@@ -81,7 +81,7 @@
type="checkbox" type="checkbox"
:class="{ 'animate-start-btn': errorAgree }" :class="{ 'animate-start-btn': errorAgree }"
/> />
<h3>Я согласен с <a href="https://docs.google.com/document/d/1lU_zTWJdD1lcMlIAFDIVz-DlZAoq3a-OFkoO8WBIkzo/edit?usp=sharing">пользовательским соглашением</a></h3> <h3>Я согласен с <a href="https://docs.google.com/document/d/1ytKHnXr67o7mu5TKqlpgRjO8DEvQDRHNnaphhzbr_sg/edit?usp=sharing">пользовательским соглашением</a></h3>
</div> </div>
<div <div
class="btn-deposit btn-text-style btn-display-deposit btn-style-payments" class="btn-deposit btn-text-style btn-display-deposit btn-style-payments"

View File

@@ -60,23 +60,37 @@
<section class="crash-game__players" v-if="crashObject && crashObject.Players"> <section class="crash-game__players" v-if="crashObject && crashObject.Players">
<div class="crash-game-players__content"> <div class="crash-game-players__content">
<div class="crash__history">
<div class="crash-history__component"> <h2></h2> </div>
<div class="crash-history__component"></div>
<div class="crash-history__component"></div>
<div class="crash-history__component"></div>
<div class="crash-history__component"></div>
<div class="crash-history__component"></div>
<div class="crash-history__component"></div>
<div class="crash-history__component"></div>
</div>
<ul class="user-list" v-if="crashObject.Players.length"> <ul class="user-list" v-if="crashObject.Players.length">
<li class="user-crash" v-for="(player, index) in crashObject.Players.sort((a, b) => b.Bid - a.Bid)" :key="index"> <li class="user-crash" v-for="(player, index) in crashObject.Players.sort((a, b) => b.Bid - a.Bid)" :key="index">
<div class="user-crash-content" :class="{ 'user-crash-content__lose' : crashObject.Status === 'GameEnd' && player.WinningX <= 0, 'user-crash-content__win' : player.WinningX >= 1 }"> <div class="user-crash-content" :class="{ 'user-crash-content__lose' : crashObject.Status === 'GameEnd' && player.WinningX <= 0, 'user-crash-content__win' : player.WinningX >= 1 }">
<div class="user-name-crash"> <div class="user-name-crash">
<img class="user-crash__icon" :src="`https://avatar.spworlds.ru/face/55/${player.UserName}`"> <img class="user-crash__icon" :src="`https://avatar.spworlds.ru/face/55/${player.UserName}`">
<h2>{{ player.UserName }}</h2> <h2>{{ player.UserName }}</h2>
</div> </div>
<div class="user-bid-crash"> <div class="user-bid-crash">
<h2 v-if="player.WinningMoney >= 1" class="wingame__win-bid-crash">{{ player.WinningMoney.toFixed(2) }}</h2> <h2 v-if="player.WinningMoney >= 1" class="wingame__win-bid-crash">{{ player.WinningMoney.toFixed(2) }}</h2>
<h2 v-else>{{ player.Bid }}</h2> <h2 v-else>{{ player.Bid }}</h2>
<img src="@/assets/icons-games/saper-game/icon-diamond-ore-saper.png"> <img src="@/assets/icons-games/saper-game/icon-diamond-ore-saper.png">
</div> </div>
<div class="user-game-status-crash"> <div class="user-game-status-crash">
<h2 class="ingame-crash" v-if="crashObject.Status === 'WaitingForPlayers' && player.WinningX <= 1 || crashObject.Status === 'InGame' && player.WinningX <= 0">В&nbsp;игре</h2> <h2 class="ingame-crash" v-if="crashObject.Status === 'WaitingForPlayers' && player.WinningX <= 1 || crashObject.Status === 'InGame' && player.WinningX <= 0">В&nbsp;игре</h2>
<h2 class="lostgame-crash" v-if="crashObject.Status === 'GameEnd' && player.WinningX <= 0">Проиграл</h2> <h2 class="lostgame-crash" v-if="crashObject.Status === 'GameEnd' && player.WinningX <= 0">Проиграл</h2>
<h2 class="wingame-crash" v-if="player.WinningX >= 1">{{ player.WinningX.toFixed(2) }}x</h2> <h2 class="wingame-crash" v-if="player.WinningX >= 1">{{ player.WinningX.toFixed(2) }}x</h2>
</div> </div>
</div> </div>
</li> </li>
</ul> </ul>
@@ -101,7 +115,7 @@ import SaperNumbers from "@/mocks/SaperNumbers";
import {GetCurrentMoney} from "@/assets/js/rest/RestMethods"; import {GetCurrentMoney} from "@/assets/js/rest/RestMethods";
import {GetCookie} from "@/assets/js/storage/CookieStorage"; import {GetCookie} from "@/assets/js/storage/CookieStorage";
import {eventBus} from "@/main"; import {eventBus} from "@/main";
import {ExitAndTakeMoneyFromCrashGame, JoinCrashGame} from "@/assets/js/games/crash/CrashAPI"; import {ExitAndTakeMoneyFromCrashGame, JoinCrashGame, CrashHistory} from "@/assets/js/games/crash/CrashAPI";
export default { export default {
components: { HeaderComponent, AsideBarComponent, ChatComponent, CrashGraphComponent }, components: { HeaderComponent, AsideBarComponent, ChatComponent, CrashGraphComponent },
@@ -227,13 +241,9 @@ export default {
} }
}, },
}, },
props: ["payments"],
async created() { async created() {
if (GetCookie('AUTHTOKEN') && GetCookie('SearchToken')) { this.CHistory = await CrashHistory();
await GetCurrentMoney(GetCookie('AUTHTOKEN'), GetCookie('SearchToken'))
.then((response) => {
this.balance = response.currentMoney
})
}
}, },
methods: { methods: {
async updateUserMoney() { async updateUserMoney() {