Private
Public Access
1
0

add base64 encryption to grid when it has been sended to server

This commit is contained in:
2016-10-31 19:44:20 +01:00
parent 625c0e9c91
commit 23d334ab27
4 changed files with 8 additions and 6 deletions

View File

@@ -53,7 +53,7 @@ class MineSeeker extends React.Component {
session
.call(
this.state.gameInherited ? "sample/connectGame" : "sample/startGame",
this.state.gameInherited ? this.state.gameAssoc : [gridClient, this.state.gameAssoc]
this.state.gameInherited ? this.state.gameAssoc : [Base64.encode(JSON.stringify(gridClient)), this.state.gameAssoc]
)
.then(
(gridServer) => {
@@ -63,7 +63,7 @@ class MineSeeker extends React.Component {
/** save session to GridControl */
this.refs.gridControl.setState({
grid: this.state.gameInherited ? JSON.parse(gridServer) : gridClient,
grid: this.state.gameInherited ? JSON.parse(Base64.decode(gridServer)) : gridClient,
session: this.state.session,
channel: this.state.channel
});