Post Reply 
 
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



Post: #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. Smile

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
Find all posts by this user Like Post Quote this message in a reply
[+] 2 users Like wuffel's post
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #2
RE: Linux/Bash: Creating Axis2 Web-Profile
Nice!
05-24-2016 04:35 PM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 856
Likes Given: 4
Likes Received: 201 in 165 posts
Joined: Jul 2012
Reputation: 6

Dimension Shard

Post: #3
RE: Linux/Bash: Creating Axis2 Web-Profile
nice code Big Grin
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
(This post was last modified: 05-31-2016 02:35 AM by Coruja.)
05-31-2016 02:30 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
pointhz
Journeyman
*

Posts: 144
Likes Given: 1
Likes Received: 52 in 27 posts
Joined: Oct 2013
Reputation: 1



Post: #4
RE: Linux/Bash: Creating Axis2 Web-Profile
(05-31-2016 02:30 AM)Coruja Wrote:  nice code Big Grin
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
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

This forum uses Lukasz Tkacz MyBB addons.