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;
}
/* /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 */

View File

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

View File

@@ -1,5 +1,24 @@
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) {
const data = {
userCredentials: {

View File

@@ -69,14 +69,37 @@ export default {
return msg.msg.includes(GetCookie("SpUserName"));
},
ClaimDatamsg(msg) {
const now = Date.now();
if (!this.lastMsgTime || now - this.lastMsgTime >= 1000) {
SendMessageToChat(msg[0]);
this.lastMsgTime = now;
} else {
alert("Вы не можете отправлять сообщения так часто");
}
},
const now = Date.now();
if (!this.lastMsgTime || now - this.lastMsgTime >= 1000) {
const processedMsg = this.processMessage(msg[0]);
SendMessageToChat(processedMsg);
this.lastMsgTime = now;
} else {
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() {
// Mute the chat by disabling the event listener for incoming messages.
this.eventBus.$off("dataChat");
@@ -110,29 +133,52 @@ export default {
});
},
created() {
GetChatHistory().then((response) => {
if (response && response.length) {
response.forEach((element) => {
let imageUrl =
"https://avatar.spworlds.ru/face/55/" + element.userName;
GetChatHistory().then((response) => {
if (response && response.length) {
response.forEach((element) => {
let imageUrl =
"https://avatar.spworlds.ru/face/55/" + element.userName;
const MsgUser = {
id: this.id + 1,
msg: element.message,
username: element.userName,
icon: imageUrl,
};
const processedMsg = this.processMessage(element.message); // Process the message
if (MsgUser.username === "🛠️ System") {
MsgUser.icon = "https://avatar.spworlds.ru/face/55/CONSOLE";
}
const MsgUser = {
id: this.id + 1,
msg: processedMsg, // Use the processed message
username: element.userName,
icon: imageUrl,
};
this.array.push(MsgUser);
});
this.ScrollToBottom();
}
});
},
if (MsgUser.username === "🛠️ System") {
MsgUser.icon = "https://avatar.spworlds.ru/face/55/CONSOLE";
}
this.array.push(MsgUser);
});
this.ScrollToBottom();
}
});
},
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>

View File

@@ -68,7 +68,7 @@
type="checkbox"
: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
class="btn-deposit btn-text-style btn-display-deposit btn-style-payments"
@@ -115,7 +115,7 @@
</div>
<div class="withdraw-checkbox checkbox-styles">
<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 class="error-captcha" v-if="errorCaptcha && agreeUser === true">
<h2>Пройдите проверку!</h2>

View File

@@ -81,7 +81,7 @@
type="checkbox"
: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
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">
<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">
<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-name-crash">
<img class="user-crash__icon" :src="`https://avatar.spworlds.ru/face/55/${player.UserName}`">
<h2>{{ player.UserName }}</h2>
</div>
<div class="user-bid-crash">
<h2 v-if="player.WinningMoney >= 1" class="wingame__win-bid-crash">{{ player.WinningMoney.toFixed(2) }}</h2>
<h2 v-else>{{ player.Bid }}</h2>
<img src="@/assets/icons-games/saper-game/icon-diamond-ore-saper.png">
</div>
<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="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>
</div>
</div>
</li>
</ul>
@@ -101,7 +115,7 @@ import SaperNumbers from "@/mocks/SaperNumbers";
import {GetCurrentMoney} from "@/assets/js/rest/RestMethods";
import {GetCookie} from "@/assets/js/storage/CookieStorage";
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 {
components: { HeaderComponent, AsideBarComponent, ChatComponent, CrashGraphComponent },
@@ -227,13 +241,9 @@ export default {
}
},
},
props: ["payments"],
async created() {
if (GetCookie('AUTHTOKEN') && GetCookie('SearchToken')) {
await GetCurrentMoney(GetCookie('AUTHTOKEN'), GetCookie('SearchToken'))
.then((response) => {
this.balance = response.currentMoney
})
}
this.CHistory = await CrashHistory();
},
methods: {
async updateUserMoney() {