Thread Rating:
- 0 Votes - 0 Average
- 1
- 2
- 3
- 4
- 5
Linux/Bash: Creating Axis2 Web-Profile
|
Author |
Message |
wuffel
Apprentice
Posts: 28
Likes Given: 0
Likes Received: 4 in 2 posts
Joined: Mar 2012
Reputation: 1
|
Linux/Bash: Creating Axis2 Web-Profile
Hello,
We were struggling a bit to deliver a complete itemlist for Axis2 to all our GameMasters and Players who help creating buildings on a special build-server. Since we dont want share the entire gameserver-logic with the whole world.
So we made this - and it works fine.
File 1 should be a bashfile. Please be aware, that...
- you have to adjust the pathes
- need awk
- need unix2dos
- need axis 2.0.4j
Code:
#!/bin/bash
SCRIPTPATH="/home/of/your/scripts"
awk -f /path/of/srvScriptStrip.awk $SCRIPTPATH/*.scp $SCRIPTPATH/custom/*.scp $SCRIPTPATH/npcs/*.scp $SCRIPTPATH/items/*.scp $SCRIPTPATH/stone/*.scp >output.txt
unix2dos output.txt
Code:
File 2 - srvScriptStrip.awk:
BEGIN{
}
{
$0 = tolower($0)
sub(/^\xef\xbb\xbf/,"")
if (($0 ~ /^\[itemdef/) || ($0 ~ /^id/) || ($0 ~ /^defname/) || ($0 ~ /^\[defname/) || ($0 ~ /^\[typedef/) || ($0 ~ /^\[chardef/) || ($0 ~ /^group/) || ($0 ~ /^p=/) || ($0 ~ /^\[spell/) || ($0 ~ /^\[skill/) || ($0 ~ /^\[areadef/) || ($0 ~ /^category/) || ($0 ~ /^subsection/) || ($0 ~ /^description/) || ($0 ~ /^name/) || ($0 ~ /^dupelist/) || ($0 ~ /^dupeitem/) || ($0 ~ /^\[template/) || ($0 ~ /^\[spawn/) || ($0 ~ /\[itemdef/)){
print($0)
}
}
(This post was last modified: 05-24-2016 06:51 AM by wuffel.)
|
|
05-24-2016 06:48 AM |
|
The following 2 users Like wuffel's post:2 users Like wuffel's post
karma (05-24-2016), XuN (05-28-2016)
|
pointhz
Journeyman
Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1
|
RE: Linux/Bash: Creating Axis2 Web-Profile
(05-31-2016 02:30 AM)Coruja Wrote: nice code
but just a quick tip: sphere already have this function, you just need to set StripPath folder on sphere.ini and use STRIP console command, it will dump all template names (itemdef, spawndef, etc) to an external file that can be used on Axis/TNG
Coruja, does that mean you dont have to add code like
CATEGORY=
SUBSECTION=
DESCRIPTION=
To every item so that it shows up on axis?
Can you just script everything normally and then do that you just said to use axis?
(This post was last modified: 06-03-2016 05:30 AM by pointhz.)
|
|
06-03-2016 05:30 AM |
|
|
User(s) browsing this thread: 1 Guest(s)