add base64 encryption to grid when it has been sended to server
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
@@ -20,5 +20,6 @@
|
||||
{{ ws_client() }}
|
||||
|
||||
<script type="text/javascript" src="{{ asset('node/howler/dist/howler.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('node/js-base64/base64.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('js/index.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user