Create a Stendhal server extension: Difference between revisions

Content deleted Content added
imported>Hendrik Brummermann
imported>Hendrik Brummermann
added navigation menu
 
(12 intermediate revisions by the same user not shown)
Line 1:
{{Navigation for Stendhal Top|Building & Hosting}}
 
How to create a server extension? This will teach you how to! Todays project: add the commands "/date" and "/time" for the users, so that they can check what time or what date it is.
==Requirements==
Whats required?
*An OS
Line 8 ⟶ 10:
*Java knowledge is recommened
 
==Getting your own setup==
Ok, let's be cliched here. The "hello, world!" of stendhal server extensions!
 
===The file===
Create a file in <downloaded stendhal source>/src/games/stendhal/server/extension/ called "HelloWorldExtension.java" and add this to it (just for now):
<source lang="java">
Line 122 ⟶ 124:
Now, if you've been following the tut, don't just copy/paste the second line - add 'date_time' to the end of the list, with a comma before it. Also, if you've saved the file somewhere else (which I don't recommend doing, it's in a folder called "extension") you're going to have to change the class path to point to that.
 
==Done==
Done! Now you've completely added 2 extensions, one of which is pointless other than, "I did it! I did it!" Have your users be notified of the change; they may or may not like it!