Replace hirunner with hilauncher.

This commit is contained in:
SilicaAndPina 2020-12-31 11:43:23 +13:00
parent 1a8c418d36
commit 6bea119831
33 changed files with 317 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View file

@ -1,2 +0,0 @@
@echo off
start hirunner.exe "http://127.0.0.1/horseisle_projector.swf?SERVER=127.0.0.1&PORT=12321"

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,18 @@
const { app, BrowserWindow } = require('electron')
function createWindow () {
const win = new BrowserWindow({
width: 790,
height: 500,
webPreferences: {
nodeIntegration: true
}
})
win.loadFile('src/index.html')
win.setMenu(null)
win.setTitle("Horse Isle - Secret Land of Horses")
win.setIcon("favicon.ico")
}
app.whenReady().then(createWindow)

View file

@ -0,0 +1,18 @@
{
"name": "h1-launcher",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "electron .",
"build": "electron-packager . \"H1 Launcher\" --icon=favicon.ico --platform=win32 --arch=ia32"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"electron": "^11.1.1",
"electron-packager": "^15.2.0"
},
"dependencies": {}
}

View file

@ -0,0 +1,33 @@
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<audio src="media/bg-music.mp3" loop autoplay></audio>
<video class="background" src="media/background.webm" width="100%" height="100%" autoplay loop></video>
<div class="content">
<div class="center-content">
<div class="logo"></div>
<div class="input">
<div class="name">URL:</div>
<input type="text" id="urlInput">
</div>
<div class="input">
<div class="name">IP:</div>
<input type="text" id="ipInput">
</div>
<div class="input">
<div class="name">PORT:</div>
<input type="text" id="portInput">
</div>
<img class="button" id="enterButton" src="./media/enter-button.png" alt="">
</div>
<div class="servers-list" id="serversList">
</div>
<img class="settings-button" id="settingsButton" src="./media/settings-button.svg">
</div>
<script src="./populateServersList.js"></script>
<script src="./inputHandler.js"></script>
</body>
</html>

View file

@ -0,0 +1,65 @@
const util = require('util');
const exec = util.promisify(require('child_process').exec)
const urlInput = document.getElementById("urlInput")
const ipInput = document.getElementById("ipInput")
const portInput = document.getElementById("portInput")
const enterButton = document.getElementById("enterButton")
const settingsButton = document.getElementById("settingsButton")
let showServerList = false;
const lastDetails = JSON.parse(localStorage.getItem("lastDetails"));
if (lastDetails) {
urlInput.value = lastDetails.url;
ipInput.value = lastDetails.ip;
portInput.value = lastDetails.port;
}
enterButton.addEventListener("click", async () => {
const url = urlInput.value;
const ip = ipInput.value;
const port = portInput.value;
localStorage.setItem("lastDetails", JSON.stringify({
url,
ip,
port
}))
runCommand(`hirunner.exe "${url}?SERVER=${ip}&PORT=${port}"`)
setTimeout(() => {
window.close()
}, 500);
})
async function runCommand(command) {
const { stdout, stderr } = await exec(command);
if(DEBUG_MODE)
{
console.log('stdout:', stdout);
console.log('stderr:', stderr);
}
}
serversList.addEventListener("click", (event) => {
if (!event.target.closest(".item")) return;
const name = event.target.innerText;
const fullUrl = new URL(officialServers[name].url);
const url = fullUrl.protocol + "//" + fullUrl.host + fullUrl.pathname;
const ip = fullUrl.searchParams.get("SERVER");
const port = fullUrl.searchParams.get("PORT");
urlInput.value = url;
ipInput.value = ip;
portInput.value = port;
})
settingsButton.addEventListener("click", () => {
serversList.style.display = showServerList ? "none" : "block";
showServerList = !showServerList;
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:xlink="http://www.w3.org/1999/xlink" height="16.0px" width="38.0px" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0)">
<use height="16.0" transform="matrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0)" width="38.0" xlink:href="#shape0"/>
</g>
<defs>
<g id="shape0" transform="matrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0)">
<pattern height="16" id="PatternID_534_1" overflow="visible" patternTransform="matrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0)" patternUnits="userSpaceOnUse" viewBox="0 0 38 16" width="38">
<image height="16" width="38" xlink:href="data:image/PNG;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAQCAYAAAB6Hg0eAAABbklEQVR42s2WMYqDQBRAvYA3kICkEoLHyCE8hU0KQYstky5VQHMFsQtYWmgnYmNnISZBq4AgKEn8m5lds4ZEo7MJux8e6sh8njPD/1LUd7AsC5fLn8JxHFDNGI1G+MVisYDVagWapvVmvV7fMGRuE1VVscNkMvmSYxgGDyyXS7BtG8IwhDiOn7LdbmG/30OSJJCmKQY973a7XvObRFEEQRCAaZrYhed5LAez2QwPFkUBVVUBCpqmb3gWaN75fMbUOR5FV14kaRhGvbUUyLIMruveSY3HY0yX3Ol0OiCOx+OhLEt03yr2LG+WZbDZbH7EFEUB3/dbv6pr5S4iJeIiVqJoE+uTM8/z63Y+FBuSlIS2IBJDSz+dTn9FvX1vERMEgYi3iTUPLSlEW+l5HtHh7xtEh1+SJHAcB9egoeWCRK53uRBFEXRdxy9ICyzpynUV2I+6T1qW1bslvZK2lnRt4vP5fHATfxV3Tfy//vZ8ApRFCeeNxG6uAAAAAElFTkSuQmCC"/>
</pattern>
<path d="M0.0 0.0 L38.0 0.0 38.0 16.0 0.0 16.0 0.0 0.0" style="fill:url(#PatternID_534_1)"/>
</g>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,46 @@
{
"Pinto": {
"url": "http://pinto.horseisle.com/horseisle.swf?SERVER=pintoip&PORT=443",
"icon": "pinto.gif"
},
"Roan": {
"url": "http://roan.horseisle.com/horseisle.swf?SERVER=roanip&PORT=443",
"icon": "roan.gif"
},
"Palomino": {
"url": "http://palomino.horseisle.com/horseisle.swf?SERVER=palominoip&PORT=443",
"icon": "palomino.gif"
},
"Bay": {
"url": "http://bay.horseisle.com/horseisle.swf?SERVER=bayip&PORT=443",
"icon": "bay.gif"
},
"Dun": {
"url": "http://dun.horseisle.com/horseisle.swf?SERVER=dunip&PORT=443",
"icon": "dun.gif"
},
"Grey": {
"url": "http://grey.horseisle.com/horseisle.swf?SERVER=greyip&PORT=443",
"icon": "grey.gif"
},
"White": {
"url": "http://white.horseisle.com/horseisle.swf?SERVER=whiteip&PORT=443",
"icon": "white.gif"
},
"Chestnut": {
"url": "http://chestnut.horseisle.com/horseisle.swf?SERVER=chestnutip&PORT=443",
"icon": "chestnut.gif"
},
"Cremello": {
"url": "http://cremello.horseisle.com/horseisle.swf?SERVER=cremelloip&PORT=443",
"icon": "cremello.gif"
},
"Brown": {
"url": "http://brown.horseisle.com/horseisle.swf?SERVER=brownip&PORT=443",
"icon": "brown.gif"
},
"Black": {
"url": "http://black.horseisle.com/horseisle.swf?SERVER=blackip&PORT=443",
"icon": "black.gif"
}
}

View file

@ -0,0 +1,10 @@
const officialServers = require("./official-servers.json");
const serversList = document.getElementById("serversList")
for (let i = 0; i < Object.keys(officialServers).length; i++) {
const name = Object.keys(officialServers)[i];
const icon = officialServers[name].icon
serversList.innerHTML+= `<div class="item"><img src="./media/servericons/${icon}"><div class="name">${name}</div></div>`
}

View file

@ -0,0 +1,106 @@
body, html {
margin: 0;
height: 100%;
font-family: Arial, Helvetica, sans-serif;
}
.background {
object-fit: cover;
position: absolute;
z-index: -1;
}
.content {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
align-items: center;
}
.logo {
background-image: url("./media/logo.png");
image-rendering: -webkit-optimize-contrast;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
height: 220px;
width: 220px;
margin-top: 30px;
margin-bottom: 50px;
}
.center-content {
display: flex;
flex-direction: column;
margin: auto;
align-items: center;
}
.input {
display: flex;
color: white;
text-shadow: 2px 2px 2px black;
font-size: 20px;
font-weight: bold;
margin-top: 10px;
}
.input .name {
width: 70px;
}
.input input {
border: solid 1px black;
outline: none;
font-size: 18px;
width: 150px;
padding-bottom: 2px;
padding-top: 2px;
box-shadow: 2px 2px 2px 0 black;
}
.button {
height: 25px;
width: 127.95px;
margin-top: 15px;
cursor: pointer;
width: auto;
}
.settings-button {
height: 18px;
width: auto;
position: absolute;
cursor: pointer;
bottom: 15px;
right: 10px;
}
.servers-list {
position: absolute;
background-color: #a797a7;
bottom: 60px;
right: 15px;
border: solid 1px black;
display: none;
flex-shrink: 0;
max-height: 300px;
overflow-y: auto;
}
.servers-list .item {
background: #cccccc;
border: solid 3px white;
margin: 5px;
font-weight: bold;
padding: 5px;
cursor: pointer;
color: #333333;
padding-right: 20px;
flex-shrink: 0;
display: flex;
align-items: center;
align-content: center;
box-shadow: 2px 2px 2px 0 black;
}
.servers-list .item .name {
margin-left: auto;
}
.servers-list .item img {
width: 20px;
height: auto;
margin-right: 10px;
flex-shrink: 0;
}

View file

@ -22,6 +22,12 @@ namespace HISP.Game
int count = 0;
foreach(DroppedItem droppedItem in dropedItems)
{
if (droppedItem.instance == null)
{
continue;
RemoveDroppedItem(droppedItem);
}
if(droppedItem.instance.ItemId == item.Id)
{
count++;

View file

@ -1444,7 +1444,7 @@ namespace HISP.Server
throw new Exception("Userid " + id + " Allready in userext.");
MySqlCommand sqlCommand = db.CreateCommand();
sqlCommand.CommandText = "INSERT INTO UserExt VALUES(@id,@x,@y,@timestamp,0,0,0,'','',0,0,'NO',0,0,1000,1000,1000, 360)";
sqlCommand.CommandText = "INSERT INTO UserExt VALUES(@id,@x,@y,@timestamp,0,0,0,'','',0,0,'NO',0,0,1000,1000,1000, 180)";
sqlCommand.Parameters.AddWithValue("@id", id);
sqlCommand.Parameters.AddWithValue("@timestamp", Convert.ToInt32(new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds()));
sqlCommand.Parameters.AddWithValue("@x", Map.NewUserStartX);