Correction bug bdd docker
continuous-integration/drone/push Build is passing Details

peristanceBDD
Thomas Chazot 2 years ago
parent e18aec54b2
commit e95a26746c

@ -29,7 +29,8 @@ $conn->query("CREATE TABLE `T_H_CONVERSATION_COV` (
$conn->query("CREATE TRIGGER `before_delete_conversation` BEFORE DELETE ON `T_H_CONVERSATION_COV` FOR EACH ROW DELETE FROM T_H_MESSAGE_MSG WHERE PK_ID = (SELECT FK_MESSAGE $conn->query("CREATE TRIGGER `before_delete_conversation` BEFORE DELETE ON `T_H_CONVERSATION_COV` FOR EACH ROW DELETE FROM T_H_MESSAGE_MSG WHERE PK_ID = (SELECT FK_MESSAGE
FROM T_J_CONTAIN_MESSAGE_CMG FROM T_J_CONTAIN_MESSAGE_CMG
WHERE FK_CONVERSATION=OLD.PK_ID);"); WHERE FK_CONVERSATION=OLD.PK_ID);
END;");
$conn->query("CREATE TABLE `T_H_MESSAGE_MSG` ( $conn->query("CREATE TABLE `T_H_MESSAGE_MSG` (
`PK_ID` int(11) NOT NULL, `PK_ID` int(11) NOT NULL,
@ -84,7 +85,7 @@ $conn->query("CREATE TABLE `T_S_USER_USR` (
);"); );");
$conn->query("CREATE TRIGGER `after_insert_user` AFTER INSERT ON `T_S_USER_USR` FOR EACH ROW INSERT INTO T_J_OWN_SKIN_OWN VALUES(NEW.PK_ID,1);"); $conn->query("CREATE TRIGGER `after_insert_user` AFTER INSERT ON `T_S_USER_USR` FOR EACH ROW INSERT INTO T_J_OWN_SKIN_OWN VALUES(NEW.PK_ID,1); END;");
$conn->query("ALTER TABLE `T_E_GAME_GAM` $conn->query("ALTER TABLE `T_E_GAME_GAM`

@ -66,7 +66,7 @@ FC<{nav: any}> =
getUsers(); getUsers();
return( return(
<View style={stylesScreen.bodyStartCenter}> <View style={stylesScreen.bodyStartCenter}>
<Text style={style.text}>Match ID : {MANAGER_MATCH.getCurrentMatch()?.getCode()}</Text> <Text style={style.text}>Match ID : {useMatchStore().match?.getCode()}</Text>
<FlatList <FlatList
data={useMatchStore().tabUser} data={useMatchStore().tabUser}
keyExtractor={usr =>usr?.getUsername() || usr} keyExtractor={usr =>usr?.getUsername() || usr}

@ -19,7 +19,6 @@ export const UserPreview :
FC<{user: User | null}> = FC<{user: User | null}> =
({user}) => ({user}) =>
{ {
console.log(user);
if(user !== null){ if(user !== null){
return ( return (
<View style= {styles.view}> <View style= {styles.view}>

@ -1,5 +1,5 @@
import { StatusBar } from 'expo-status-bar' import { StatusBar } from 'expo-status-bar'
import {View, FlatList, Text} from 'react-native' import {View, FlatList, Text, Alert} from 'react-native'
import React, { useState } from 'react'; import React, { useState } from 'react';
import { TopBar } from '../components/TopBar'; import { TopBar } from '../components/TopBar';
import { BotBar } from '../components/BotBar'; import { BotBar } from '../components/BotBar';
@ -8,7 +8,7 @@ import { ScreenIndicator } from '../components/ScreenIndicator';
import { TextInput } from 'react-native-gesture-handler'; import { TextInput } from 'react-native-gesture-handler';
import stylesScreen from './style/screens.style' import stylesScreen from './style/screens.style'
import styles from './style/GameChoice.style' import styles from './style/GameChoice.style'
import { MANAGER_GAME } from '../../appManagers'; import { MANAGER_GAME, MANAGER_MATCH, MANAGER_USER } from '../../appManagers';
import { GameList } from '../components/GameList'; import { GameList } from '../components/GameList';
function GameChoice(props: { navigation: any}) { function GameChoice(props: { navigation: any}) {
@ -16,6 +16,18 @@ function GameChoice(props: { navigation: any}) {
const [matchId, setMatchId] = useState(''); const [matchId, setMatchId] = useState('');
async function joinMatch(id:string){
const newId = parseInt(id);
const tmp=MANAGER_USER.getCurrentUser();
if (tmp !== null){
await MANAGER_MATCH.getsaverMatch().joinMatch(tmp, newId).then((res) =>{
if (res===null){
Alert.alert()
}
});
}
}
if(MANAGER_GAME.currentGameType === "solo" ){ if(MANAGER_GAME.currentGameType === "solo" ){
return ( return (
<View style={stylesScreen.container}> <View style={stylesScreen.container}>
@ -48,7 +60,7 @@ function GameChoice(props: { navigation: any}) {
/> />
<View style={{backgroundColor: '#2D2C33', flexDirection: 'row', alignContent: 'flex-start', margin: '2%', borderRadius: 15}}> <View style={{backgroundColor: '#2D2C33', flexDirection: 'row', alignContent: 'flex-start', margin: '2%', borderRadius: 15}}>
<Text style={styles.text}>Rejoindre un match</Text> <Text style={styles.text}>Rejoindre un match</Text>
<TextInput style={styles.textInput} placeholder='Id' onChangeText={(val) => setMatchId(val)} autoCapitalize='none' /> <TextInput style={styles.textInput} placeholder='Id' onChangeText={(val) => setMatchId(val)} onSubmitEditing={(val) => {joinMatch(val)}} autoCapitalize='none' />
</View> </View>
</View> </View>
<BotBar <BotBar

@ -26,7 +26,7 @@ export class LoaderConversationApi implements ILoaderConversation{
url: url, url: url,
}) })
.then(async function (response: any) { .then(async function (response: any) {
if (response.data != null || response.data != undefined){ if (response.data != null && response.data != undefined){
tabConv=await jsonToConversation(response); tabConv=await jsonToConversation(response);
} }
}); });

@ -12,16 +12,16 @@ export default class LoaderGameApi implements ILoaderGame{
async loadAllGames(): Promise<Game[]> { async loadAllGames(): Promise<Game[]> {
let tab: Game[]=[]; let tab: Game[]=[];
const url=this.baseUrl+"http://localhost:8888/api-rest/index.php/getGames"; const url=this.baseUrl+"getGames";
await this.axios({ await this.axios({
method: 'get', method: 'get',
url: url, url: url,
}) })
.then(function (response: any) { .then(function (response: any) {
if (response.data != null || response.data != undefined){ if (response.data != null && response.data != undefined){
response.data.forEach(game => { response.data.forEach(game => {
switch(game.type){ switch(game.type){
case "GameSolo": case "GameSolo":
let mapSolo = new Map(); let mapSolo = new Map();

Loading…
Cancel
Save