{"id":18675056,"url":"https://github.com/spring/springls","last_synced_at":"2025-10-27T07:16:26.862Z","repository":{"id":672402,"uuid":"315816","full_name":"spring/SpringLS","owner":"spring","description":"A spring lobby server written in Java (unmaintained, please use https://github.com/spring/uberserver )","archived":false,"fork":false,"pushed_at":"2012-03-23T08:10:56.000Z","size":3001,"stargazers_count":11,"open_issues_count":2,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-25T21:51:12.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://springrts.com/wiki/SpringLS","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spring.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-09-23T22:06:30.000Z","updated_at":"2024-03-11T20:51:21.000Z","dependencies_parsed_at":"2022-08-16T10:40:11.014Z","dependency_job_id":null,"html_url":"https://github.com/spring/SpringLS","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spring%2FSpringLS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spring%2FSpringLS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spring%2FSpringLS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spring%2FSpringLS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spring","download_url":"https://codeload.github.com/spring/SpringLS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505928,"owners_count":21115354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T09:22:14.805Z","updated_at":"2025-10-27T07:16:21.823Z","avatar_url":"https://github.com/spring.png","language":"Java","readme":"# Java Spring Lobby Server\n\n__README__\n\nThis software is a lobby server for the Spring RTS engine. You may think of it\nas something similar to an IRC server with additional protocol instructions to\nmanage battles.\n\nHistorically seen, this was the first, and till 2010 also the main/official\nlobby server implementation.\n\nThis repository also contained two other tiny applications, which were removed\nin 2010, because they were no longer of use alone or in combination with the\nlobby server:\n* TransferOldAccounts\n* WebServer\n\n\n## Building\n\nMaven is used as the project management system.\nThe project description file is `pom.xml`, which contains everything\nMaven needs to know about the project, in order to:\n\n* Download dependencies\n* Compile the sources\n* Pack the class files together with all the dependencies into a single,\n  executable jar file\n\n### Installing Maven\n\nYou need Maven version 2 or later.\nIn case you already have it installed, skip this paragraph.\n\n* _Windows_\n\n\tDownload the latest stable version (not the source)\n\t[here](http://maven.apache.org/download.html).\n\tThen extract to eg. your `C:\\Program Files`,\n\tand make sure the bin sub-dir of the extracted folder is in your `PATH`\n\tenvironment variable.\n\n* _Unix, Linux, BSD, OS X_\n\n\tInstall the `maven2` package in your systems way of doing so.\n\tOn Ubuntu for example, you would do this:\n\n\t\t\u003e sudo apt-get install maven2\n\n\n### Building the software\n\n1.\tMake sure you have Maven 2 or later installed.\n\tYou can check that with the following command:\n\n\t\t\u003e mvn --version\n\n2.\tcompile and package:\n\n\t\t\u003e mvn package\n\n\tThis may take quite some time, if you are running Maven for the first time,\n\tas it has to download all the dependencies for the different build steps,\n\tplus our own dependencies.\n\nIf everything went smoothly, this was it already!\n\nAll the output of the build process is under the `target` sub-dir.\nThis is also where you find the final jar files:\n`target/springls*.jar`\n\n\n## Running\n\nThe minimum requirement is the Java run-time environment (JRE) 6 or later.\nThe latest version can be found\n[here](http://java.sun.com/j2se/1.6.0/download.jsp).\n\nUse `runServer.sh` (Unix, Linux, BSD, OS X) or `runServer.bat` (Windows)\nto start the server if you built it with Maven.\nYou should also see the documentation in these files, for further info.\n\n### LAN mode\nWhen the server is up and running, people from the local network will be able to\njoin it as well as people from the internet. Although those from the internet\nwill not be able to join games hosted by local clients, local clients in turn\nwill be able to join games hosted by outside players.\nYou do not need to create any accounts when joining a LAN server,\nit will accept any user-name/password.\n\nIf you experience problems using the server in LAN mode (like other clients\nbeing timed-out when connecting to your game), you should try this:\nLet the player who is NOT running the server host. This is important\nwhen the server assigns a player (who is using the same computer as the server)\nthe `localhost` IP (`127.0.0.1`). In this case, other players on the LAN would\nreceive this IP, and when they try to connect to the game host at `127.0.0.1`,\nthe connection attempt will fail.\nThe server should replace this IP with a local one (`192.168.x.y`) automatically,\nbut if it fails for any reason, you should use the method described above.\n\nTo be able to accept connections from outside the LAN, you will have to forward\nports 8200 (TCP) and 8201 (UDP) to the machine running the lobby.\n\n### Logging\nTo configure logging details, for example using a higher verbosity level,\nyou have to create a custom config file.\nIf you are using the `runServer.*` script,\nthis is done most easily using the following steps:\n\n_Unix, Linux, BSD, OS X_\n\n\tcp src/main/resources/logback.xml conf\n\t${EDITOR} conf/logback.xml\n\n_Windows_\n\n\tcopy src\\main\\resources\\logback.xml conf\n\tnotepad conf\\logback.xml\n\nFor documentation about logback configuration,\nsee [this link](http://logback.qos.ch/manual/configuration.html).\n\n### Configuring the DB\nIn additiona to the `--database` command line parameter,\nyou need to tell the server which database connection to use\nfor storing account- and other info,\nby configuring JPA (Java Persistence API) details.\nIf you are using the `runServer.*` script,\nthis is done most easily using the following steps:\n\n_Unix, Linux, BSD, OS X_\n\n\tcp conf/META-INF/persistence.xml.template conf/META-INF/persistence.xml\n\t${EDITOR} conf/META-INF/persistence.xml\n\n_Windows_\n\n\tcopy conf\\META-INF\\persistence.xml.template conf\\META-INF\\persistence.xml\n\tnotepad conf\\META-INF\\persistence.xml\n\nInfo about the default persistence provider (Hibernate)\ncan be found [here](http://docs.jboss.org/hibernate/stable/entitymanager/reference/en/html/configuration.html).\n\n\n## Command line arguments\n\nExample of usage:\n\n\t\u003e java -jar springls-*.jar --port 8200 --nat-port 8201\n\nArguments are case sensitive.\nFor the full list of arguments, use `--help`.\n\nTo stop the server, issue _[Ctrl]+[C]_.\n\n\n## Running with a DB\n\nNormal mode means, using a database or a flat file for storing the user accounts.\nThis is how you prepare for using a database:\n\n_Unix:_\n\n\t\u003e # copy the configuration template\n\t\u003e cp conf/META-INF/persistence.xml.template conf/META-INF/persistence.xml\n\t\u003e # edit the configuration\n\t\u003e ${EDITOR} conf/META-INF/persistence.xml\n\n_Windows:_\n\n\t\u003e # copy the configuration template\n\t\u003e copy conf\\META-INF\\persistence.xml.template conf\\META-INF\\persistence.xml\n\t\u003e # edit the configuration\n\t\u003e notepad conf\\META-INF\\persistence.xml\n\nInfo about the default persistence provider:\n[Hibernate configuration](http://docs.jboss.org/hibernate/stable/entitymanager/reference/en/html/configuration.html)\n\nWhen you are using MySQL, and you are experiencing problems to authenticate on\nthe DB, have a look [here](http://queuemetrics.com/faq.jsp#faq-009).\nInstead of `localhost.localdomain`, you may face the same problem\nwith `127.0.0.1`.\n\nYou have to use the `--database` switch on the command-line,\nbecause otherwise the server will run in LAN-mode, and not use the DB.\n\n\n## Release a SNAPSHOT (devs only)\n\nTo release a development version to the Sonatype snapshot repository only:\n\n\t\tmvn clean deploy -Dgithub.downloads.dryRun=true\n\n\n## Release (devs only)\n\n### Prepare \"target/\" for the release process\n\n\tmvn release:clean\n\n### Prepare the release\n* asks for the version to use\n* packages\n* signs with GPG\n* commits\n* tags\n* pushes to origin\n\n\t\tmvn release:prepare\n\n### Perform the release (main part)\n* checks-out the release tag\n* builds\n* deploy into sonatype staging repository\n* uploads artifacts to the github download section\n\n\t\tmvn release:perform\n\n### Release the site\n* generates the site, and pushes it to the github gh-pages branch,\n  visible under http://spring.github.com/SpringLS/\n\n\t\tgit checkout \u003crelease-tag\u003e\n\t\tmvn site\n\t\tgit checkout master\n\n### Promote it on Maven\nMoves it from the sonatype staging to the main sonatype repo\n\n1. using the Nexus staging plugin:\n\n\t\tmvn nexus:staging-close\n\t\tmvn nexus:staging-release\n\n2. ... alternatively, using the web-interface:\n\t* firefox https://oss.sonatype.org\n\t* login\n\t* got to the \"Staging Repositories\" tab\n\t* select \"com.springrts...\"\n\t* \"Close\" it\n\t* select \"com.springrts...\" again\n\t* \"Release\" it\n\n\n## Dev Notes\n\n* Try not to edit the account file manually! If you do, do not forget that\n  access numbers must be in binary form!\n\n* Whenever you use `killClient()` within a for loop, do not forget to decrease\n  loop counter as you will skip next client in the list otherwise. This was the\n  cause for some of the \"ambiguous data\" errors. Or better, use the\n  `killClientDelayed()` method.\n\n* Note that access to long's is not guaranteed to be atomic, but you should use\n  synchronization anyway, if you use multiple threads.\n\n\n## Dev Links\n\nGreat article on how to handle network timeouts in Java:\nhttp://www.javacoffeebreak.com/articles/network_timeouts/\n\nAnother one on network timeouts and alike:\nhttp://www.mindprod.com/jgloss/socket.html\n\nGreat article on thread synchronization:\nhttp://today.java.net/pub/a/today/2004/08/02/sync1.html\n\nThrowing exceptions:\nhttp://java.sun.com/docs/books/tutorial/essential/exceptions/throwing.html\n\nSun's tutorial on sockets:\nhttp://java.sun.com/docs/books/tutorial/networking/sockets/\n\nHow to redirect program's output by duplicating handles in windows' command\nprompt:\nhttp://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx\n\nHow to get local IP address (like \"192.168.1.1\" and not \"127.0.0.1\"):\nhttp://forum.java.sun.com/thread.jspa?threadID=619056\u0026messageID=3477258\n\nip-to-country databases:\nhttp://ip-to-country.webhosting.info\nhttp://software77.net/cgi-bin/ip-country/geo-ip.pl\n\nAnother set of 232 country flags:\nhttp://www.ip2location.com/free.asp\n\nSome source code on how to build client-server with java.nio classes;\nBetalord used ChatterServer.java code from the first link, found through the\nsecond:\nhttp://brackeen.com/javagamebook/ch06src.zip\nhttp://www.gamedev.net/community/forums/topic.asp?topic_id=318099\n\nSource for some simple threaded UDP server:\nhttp://java.sun.com/docs/books/tutorial/networking/datagrams/example-1dot1/QuoteServerThread.java\n\nHow to properly document thread-safety when writing classes:\nhttp://www-128.ibm.com/developerworks/java/library/j-jtp09263.html\n\nGood article on immutables (like String etc.):\nhttp://macchiato.com/columns/Durable2.html\n\nGeneral info on thread-safety in java:\nhttp://mindprod.com/jgloss/threadsafe.html\n\nHow to use ZIP with java:\nhttp://java.sun.com/developer/technicalArticles/Programming/compression/\n\nHow to download file from URL:\nhttp://schmidt.devlib.org/java/file-download.html\n\nVery good article on exceptions:\nhttp://www.freshsources.com/Apr01.html\n\nShort introduction to generics in JDK 1.5.0:\nhttp://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html\n\n\n## NAT-Traversal\n\nThe primary NAT traversal technique that this lobby server implements is\n_hole punching_. See these links for more info:\n\nhttp://www.brynosaurus.com/pub/net/p2pnat/\nhttp://www.potaroo.net/ietf/idref/draft-ford-natp2p/\nhttp://www.newport-networks.com/whitepapers/nat-traversal1.html\n\nSee the source code for implementation details.\n\n\n## Protocol\n\nThe most recent lobby protocol specification can be found here:\nhttps://github.com/spring/LobbyProtocol\n\n\n## Change-Log\n\n### 0.35+\nFor detailed changes after 0.35, please see the SCM commit messages.\n\n### 0.35\n* added 'servermode' argument to TASSERVER command\n\n### 0.34\n* message IDs are now actually working\n* added TESTLOGIN, TESTLOGINACCEPT and TESTLOGINDENY commands\n\n### 0.33\n* added \"update properties\" (updateProperties object)\n* added SETLATESTSPRINGVERSION and RELOADUPDATEPROPERTIES commands\n\n### 0.32\n* added option to mute by ip\n* replaced CLIENTPORT command with CLIENTOIPPORT command and also\n  removed ip field from the ADDUSER command (this way IPs are no longer\n  public unless you join a battle that uses nat traversal, where host\n  needs to know your ip in order for the nat traversal trick to work)\n\n### 0.31\n* added new bot mode for accounts (increases traffic limit when using bot mode)\n\n### 0.30\n* added MAPGRADES command\n* added FORCESPECTATORMODE command\n\n### 0.26\n* fixed some charset bug\n* added UPDATEMOTD command\n* fixed small bug with JOINBATTLE command not checking if battle is already\n  in-game\n* fixed minor bug with mute entries not expiring on the fly\n* added MUTELISTSTART, MUTELIST, MUTELISTEND commands\n\n### 0.25\n* added -LANADMIN switch\n* modified protocol to support arbitrary colors (RGB format)\n\n### 0.23\n* channel mute list now gets updated when user renames his account\n\n### 0.22\n* added SETCHANNELKEY command, also modified JOIN command to accept extra\n  argument for locked channels\n* added FORCELEAVECHANNEL command\n* LEFT command now contains (optional) \"reason\" parameter\n* replaced CHANNELS command with CHANNEL and ENDOFCHANNELS commands (see\n  protocol description)\n* limited maximum length of chat messages\n\n### 0.20\n* added CHANGEPASSWORD command\n* GETINGAMETIME now also accepts no argument (to return your own in-game time)\n* CHANNELTOPIC command now includes author name and time\n* added -LOGMAIN switch\n* added GETLASTIP command, FINDIP is available to privileged users as well now\n* fixed bug with /me being available even after being muted\n* CHANNELMESSAGE command now available to moderators as well\n\n### 0.195\n* fixed RING command not working for battle hosts\n\n### 0.194\n* integrated ploticus graphics generator and a simple web server to give access\n  to server's statistics.\n* fixed RING command (only host can ring players participating in his own\n  battle, unless the target is host himself)\n* fixed KICK command so that now player who's been kicked is notified about it\n  (also kick command accepts \"reason\" string now)\n* added \"GETLASTLOGINTIME\" command (for moderators)\n* fixed bug with clients behind same NAT not getting local IPs in certain cases\n* added simple UDP server to help with NAT traversing (see NATHelpServer.java)\n* added UDPSOURCEPORT, CLIENTPORT and HOSTPORT commands (used with NAT\n  traversing)\n\n### 0.191\n* fixed bug with server allowing clients to have several battles open at the\n  same time\n\n### 0.19\n* improved server code (meaning less \"ambigious\" commands)\n* added RENAMEACCOUNT command, also userName may now contain \"[\" and \"]\"\n  characters\n* added CHANNELMESSAGE command\n* added MUTE, UNMUTE and MUTELIST commands\n* clients behind same NAT now get local IPs instead of external one (from the\n  server). This should resolve some issues with people playing games behind same\n  NAT.\n* added \"agreement\"\n\n### 0.18\n* multiple mod side support (battle status bits have changed)\n* user who flood are now automatically banned by server\n\n### 0.17\n* server now keeps in-game time even after player has reached maximum level\n  (max. in-game time server can record is 2^20 minutes)\n* rewrote the network code to use java.nio classes. This fixes several known\n  problems with server and also fixes multiplayer replay option.\n* implemented simple anti-flood protection\n* removed old file transfer commands\n\n### 0.16\n* added new host option - diminishing metal maker returns\n* switched to Webnet77's ip-to-country database, which seems to be more\n  frequently updated: http://software77.net/cgi-bin/ip-country/geo-ip.pl\n* added \"locked\" parameter to UPDATEBATTLEINFO command\n* added \"multiplayer replays\" support\n\n### 0.152\n* fixed small bug with server not updating rank when maximum level has been\n  reached\n* added ban list\n\n### 0.151\n* added OFFERUPDATEEX command\n* added country code support\n* added simple protection against rank exploiters\n* added cpu info (LOGIN command now requires additional parameter)\n* limited usernames/passwords to 20 chars\n\n### 0.141\n* fixed issue with server not notifying users about user's rank on login\n* added command: CHANNELTOPIC\n\n### 0.14\n* added FORCETEAMCOLOR command\n* fixed bug which allowed users to register accounts with userName/password\n  containing chars from 43 to 57 (dec), which should be numbers (the correct\n  number range is 48 to 57). Invalid chars are \"+\", \",\", \"-\", \".\" and \"/\".\n* added ranking system\n\n### 0.13\n* added AI support\n* added KICKUSER command (admins only)\n* fixed bug when server did not allow client to change its ally number if\n  someone else used it, even if that was only a spectator.\n* added away status bit\n* fixed bug when server denied  request to battle, if there were maxplayers+1\n  players already in the battle.\n* added new commands: SERVERMSG, SERVERMSGBOX, REQUESTUPDATEFILE, GETFILE\n* added some admin commands\n* changed registration process so that now you can't register userName which is\n  same as someone elses, if we ignore case. Usernames are still case-sensitive\n  though.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspring%2Fspringls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspring%2Fspringls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspring%2Fspringls/lists"}