all hardcore ips and ports moved to Main.kt

This commit is contained in:
MaximZaitsev
2016-07-29 13:10:53 +03:00
parent 1c26bc49d2
commit 8d47aa3357
3 changed files with 8 additions and 4 deletions
+3 -1
View File
@@ -1,4 +1,3 @@
import exceptions.RcControlException
import net.server.handlers.AbstractHandler
import net.server.handlers.flash.LoadBin
import net.server.handlers.main.GetLocation
@@ -17,6 +16,9 @@ val deltaTimeLocationRefresh: Int = 100//ms
val serverPort: Int = 8888
val serverIp: String = "127.0.0.1"
val mainServerAddress = "127.0.0.1"
val mainServerPort = 7925
val protoBuf = require("protobufjs")
fun main(args: Array<String>) {
+4 -2
View File
@@ -1,6 +1,8 @@
package net
import require
import mainServerAddress
import mainServerPort
/**
* Created by user on 7/28/16.
@@ -9,8 +11,8 @@ val http = require("http")
fun sendRequest(dataBuffer: dynamic, url: String, successCallback: (responseData: ByteArray) -> Unit, errorCallback: (err: dynamic) -> Unit) {
val options: dynamic = {}
val serverAddress = "127.0.0.1"
val port = 7925
val serverAddress = mainServerAddress
val port = mainServerPort
js("options = {hostname:serverAddress, port:port, path:url, method:'POST'}")
val request = http.request(options, { response ->
+1 -1
View File
@@ -8,7 +8,7 @@ import net.server.handlers.AbstractHandler
* Created by user on 7/27/16.
*/
fun start(handlers: MutableMap<String, AbstractHandler>, port:Int) {
fun start(handlers: MutableMap<String, AbstractHandler>, port: Int) {
val http = require("http")
val url = require("url")
http.createServer({ request, response ->