mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-05-24 15:08:26 +02:00
Added eslit and circle.yml
This commit is contained in:
@@ -1,26 +1,16 @@
|
||||
module.exports = function() {
|
||||
|
||||
// initialize servers store if doesn't exist
|
||||
localStorage.servers = localStorage.servers || "[]";
|
||||
localStorage.servers = localStorage.servers || '[]';
|
||||
|
||||
// function to save servers into localStorage
|
||||
function save() {
|
||||
localStorage.servers = JSON.stringify(servers);
|
||||
}
|
||||
|
||||
// default servers
|
||||
var defaultServers = [
|
||||
{name: 'LattyCraft', ip: 'us.latty.info', port: 25565}
|
||||
];
|
||||
|
||||
// load servers from localstorage
|
||||
var servers = JSON.parse(localStorage.servers);
|
||||
|
||||
|
||||
// if no servers are saved, load the default ones
|
||||
if (!servers || servers.length === 0) {
|
||||
servers = defaultServers;
|
||||
save();
|
||||
// function to save servers into localStorage
|
||||
function save() {
|
||||
localStorage.servers = JSON.stringify(servers);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,4 +31,4 @@ module.exports = function() {
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
module.exports = function() {
|
||||
|
||||
var io = io;
|
||||
|
||||
var socket = io(window.location.host);
|
||||
return socket;
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
module.exports = function() {
|
||||
|
||||
var connected = "connected";
|
||||
var error = "error";
|
||||
var createjs = createjs;
|
||||
|
||||
createjs.Sound.registerSound("/sounds/connected.mp3", connected);
|
||||
var connected = 'connected';
|
||||
|
||||
createjs.Sound.registerSound('/sounds/connected.mp3', connected);
|
||||
|
||||
return {
|
||||
connected: function() {
|
||||
|
||||
Reference in New Issue
Block a user