Client/Server solution to read in trade messages and provide a web front-end. Uses GWCA to interface with the Guild Wars client, and NodeJS to provide a web facing server.
- Run Guild Wars
- Compile and run client, inject using au3 script. Client dll must be in same folder as au3 script.
- Install NodeJS
- Run
npm install
from /server folder - Server is now running on
http://localhost
orhttp://172.0.0.1
For every URL documented below, the server will separate into pre-searing or kamadan trade:
- If the requested domain name contains "ascalon" e.g. https://ascalon.gwtoolbox.com it will be recognised as a pre-searing session.
- If the requested domain name does not contain "ascalon" e.g. https://kamadan.gwtoolbox.com it will be recognised as a kamadan session.
- http://localhost/ = Main site
- http://localhost/search/WTS%20ecto = Example search result as webpage.
- All timestamps are UTC
- All API responses are in JSON format
- A message object with an "r" key means that it replaces the message identified by this value, e.g. if a user re-sends the same trade message.
- See live examples of the below API endpoints on the HTML page @ http://localhost/
Endpoint: ws://localhost:80
Description: Websocket connection, allows clients to receive message in real-time as they come in.
Example:
OUTGOING SEARCH REQUEST (Sent from client when searching for messages. "from" and "to" is optional.)
{"query":"WTS Clock","from":1581706000","to":1581707000}
INCOMING MESSAGE (Received as live messages come through in real time):
{"s":"Circus Of Horrors","m":"WTS Clockwork Scythe Q9 pm offer WTB CC FC Q9 pm offer ","t":1581706017001}
INCOMING SEARCH RESPONSE (Received in response to a search query):
{"query":"WTS Clock","num_results":1,"messages":["s":"Circus Of Horrors","m":"WTS Clockwork Scythe Q9 pm offer WTB CC FC Q9 pm offer ","t":1581706017001]}
Endpoint: http://localhost/m
Description: Used to fetch the latest trade messages.
Returns HTTP 200 with JSON encoded array of trade messages, or HTTP 304 (Not Modified) if there have been no new messages.
Headers:
If-None-Match (Optional) The timestamp of the latest trade message. The server will respond with all messages since this one.
If no valid hash is given, the server will respond with the most recent 100 trade messages.
Example:
REQUEST HEADERS:
GET /m HTTP/1.1
Host: localhost
if-none-match: 1581704474123
RESPONSE HEADERS:
HTTP/1.1 200 OK
etag: 1581706017001
Content-Type: application/json; charset=utf-8
RESPONSE BODY:
[
{"s":"Baby Sugardoll","m":"WTB RESTO FROGGY pm me","t":1581704474123},
{"s":"Thyrion Asuryan","m":"WTS gift of the traveler X5 5e each","t":1581704460123},
{"s":"A L V E U S","m":"WTT Celestials (Me) pig or Dog btwn (you) Rat all unded can add few ectos","t":1581704451123},
{"s":"Xu Li Pam","m":"wtb vs q9 400e","t":1581704446123},
{"s":"Planinum Illuminati","m":"WTB Diessa Chalice 5E/ea I Shards 4A/stk I GotT 15/1A I Elite Tomes 2e/ea I Superb Charr Carvings 1a/stk","t":1581704440123}
]
Endpoint: http://localhost/s/<search_term>
Description: Used to search for trade messages. Returns HTTP 200 with JSON encoded array of trade messages.
Example:
REQUEST HEADERS:
GET /s/eternal%20blade HTTP/1.1
Host: localhost
RESPONSE HEADERS:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
ETag: "rZJ64ws4R0vSnPPuM6MGcQ=="
RESPONSE BODY:
[
{"t":1581704832,"s":"Nemesis Asheth","m":"WTB Delicious Cake x82, 1e/each"},
{"t":1581540741,"s":"Ron The Spirit","m":"WTS ~~ Cupcakes 20e ea ~~"},
{"t":1581540663,"s":"A Noise In The Dark","m":"wts 54 cupcakes"}
]
Endpoint: http://localhost/s/user:<player_name>
Description: Used to fetch trade messages by player. Returns HTTP 200 with JSON encoded array of trade messages.
Example:
REQUEST HEADERS:
GET /s/user:agonizing%20blades HTTP/1.1
Host: localhost
RESPONSE HEADERS:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
ETag: "rZJ64ws4R0vSnPPuM6MGcQ=="
RESPONSE BODY:
[
{"t":1581708548,"s":"Agonizing Blades","m":"WTS EL Tonics Vekk,Livia,Melonni,Goren,Morgahn,Margrid,Norgu,Pyre,Tahlkora,Ogden,Hayda,Dunkoro AND UNDED MINIS PM ME"},
{"t":1581708181,"s":"Agonizing Blades","m":"WTS EL Tonics Vekk,Livia,Melonni,Goren,Morgahn,Margrid,Norgu,Pyre,Tahlkora,Ogden,Hayda,Dunkoro PM ME"},
{"t":1581708149,"s":"Agonizing Blades","m":"WTS Tonics Vekk,Livia,Melonni,Goren,Morgahn,Margrid,Norgu,Pyre,Tahlkora,Ogden,Hayda,Dunkoro PM ME"}
]