loshadka (empty) → 0.1
raw patch · 4 files changed
+78/−0 lines, 4 filesdep +aesondep +basedep +binarysetup-changed
Dependencies added: aeson, base, binary, bytestring, cryptohash, directory, hex, network, process, split
Files
- LICENSE +23/−0
- Setup.hs +2/−0
- loshadka.cabal +23/−0
- src/Main.hs +30/−0
+ LICENSE view
@@ -0,0 +1,23 @@+© 2014, George Timoschenko+https://so.mu++Permission is hereby granted, free of charge, to any person+obtaining a copy of this software and associated documentation+files (the “Software”), to deal in the Software without+restriction, including without limitation the rights to use,+copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the+Software is furnished to do so, subject to the following+conditions:++The above copyright notice and this permission notice shall be+included in all copies or substantial portions of the Software.++The software is provided “as is”, without warranty of any kind,+express or implied, including but not limited to the warranties+of merchantability, fitness for a particular purpose and+noninfrigement. In no event shall the authors or copyright+holders be liable for any claim, damages or other liability,+whether in an action of contract, tort or otherwise, arising+from, out of or in connection with the software or the use or+other dealings in the software.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ loshadka.cabal view
@@ -0,0 +1,23 @@+name: loshadka+version: 0.1+synopsis: Minecraft 1.7 server proxy that answers to queries when the server is offline+homepage: https://github.com/tvorcesky/loshadka+license: MIT+license-file: LICENSE+author: George Timoschenko+maintainer: somu@so.mu+category: Network+build-type: Simple+cabal-version: >=1.8++source-repository this+ type: git+ location: https://github.com/tvorcesky/loshadka.git+ tag: v0.1++executable loshadka+ build-depends: base ==4.6.*, directory ==1.2.*, bytestring ==0.10.*,+ binary ==0.7.*, network ==2.4.*, split ==0.2.*,+ aeson ==0.7.*, process ==1.1.*, cryptohash ==0.11.*, hex ==0.1.*+ hs-source-dirs: src+ main-is: Main.hs
+ src/Main.hs view
@@ -0,0 +1,30 @@+module Main where++import Network.Loshadka.Server (serve)+import Network.Loshadka.Settings (readSettings)++import System.Environment (getArgs)+import System.Exit (exitFailure)+import Data.List (null, isInfixOf)++main :: IO()+main = do+ as <- getArgs+ if null as+ then initialize "." as+ else let a = head as in+ if "help" `isInfixOf` a || "-h" == a+ then help+ else case last a of+ '/' -> initialize (init a) as+ _ -> initialize a as++initialize :: String -> [String] -> IO()+initialize path args = do+ settings <- readSettings path args+ serve settings++help :: IO()+help = do+ putStrLn "Usage: loshadka <server_directory> [jar_flags]"+ exitFailure