Coder Social home page Coder Social logo

albianwarpclient's Introduction

AlbianWarpClient

The AlbianWarpClient is the Client component of the AlbianWarp Project. Its main purpose is to bridge Creatures3/Dockingstation and the AlbianWarpServer via the Shared Memory Interface.

Getting Started

To get started Download the latest release from here and follow the Installation Instruction in the wiki

Installation from source

this section is still under construction

Built With

  • Python3 - Language used for the Client logic
  • Requests - HTTP Library used for almost all client/server communication
  • ws4py - WebSocket client and server library for Python 2 and 3 as well as PyPy
  • pywin32 - Provides access to Win32 APIs for handling the CAOS Injection.

Contributing

Contributions are very welcome!

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the GPL3 License - see the LICENSE.md file for details

albianwarpclient's People

Contributors

amaikokonut avatar keyboardinterrupt avatar puppypi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

albianwarpclient's Issues

Expanding DMAs/RTMDAs to include a mesg-writ function?

This is related to #36 but is kind of it's own thing. If the client could mesg writ the engine after injecting RT/DMAs, it would save a lot of resources on the engine's part since it wouldn't have to have scripts that constantly check for new RT/DMAs and slow things down. This might become quite an issue once a lot of warp-reliant agents are being developed.

I propose that an RTD/MA could have two optional variables, called "aw_target_agent" and "aw_target_script".
"aw_target_agent" would be a string corresponding to a game variable that holds an agent, for example "aw_housekeeper_agent" or "aw_immigrant_checker". "aw_target_script" would hold the script number that would be messaged.

There would have to be a way to 'whitelist' scripts so people aren't sending DMAs to any agent's scripts just to force someone's game to execute them. I propose that if an agent wanted to be set up to receive mesg-writs from the client, it would have to:

  • Set a GAME variable to itself, the variable name being the same as the one that would be specified as the "aw_target_agent" in the DMA (such as "aw_immigrant_checker" etc)
  • Set (to 1) a name variable on itself named "allow_#" wherein # is the script number that is allowed to be triggered via an RT/DMA.

Example:

A mail message DMA is created:
"aw_recipient" = "bob"
"aw_target_agent" = "aw_mailman_agent"
"aw_target_script" = 1005
"some_other_vars" = "some other content"

  • The sender's client picks up the message and sends it to bob.
  • Bob's client injects the DMA.
  • Bobs client then checks to see if GAME "aw_mailman_agent" actually exists and is a valid agent.
  • If it is, it TARGs the agent and checks if NAME "allow_1005" equals 1.
  • If it does, the client goes ahead and mesg writ's the agent with script 1005.
  • Script 1005 goes off and checks for DMAs, doing whatever it does with them.

Does this seem like a viable thing to consider for future development?

Utilize websocket for notifying the client of events...

...like:

  • receive Creature
  • receive DMA

This could then be used instead of the recurrent polling.
The Client could Ask for new Creatures and DMA's once when the player goes online, instead of hammering the API every few seconds.
This should decrease the Load significantly (not that it is a Problem currently anyway.)

Feature: world detection

Currently the client naively thinks that you are in a world and will start injecting DMA's and alter GAME variables as soon as you log in, as this totally does not work, while on the world selection screen, we must implement a mechanism to detect whether a players is inside a world, or not.

Wiki

On the wiki ".\AlbianWarpPythonClient.exe" should be changed to one of:

  • .\AlbianWarpPython.exe
  • .\AlbianWarpPythonClient.exe or .\AlbianWarpPythonClient.exe

As at the executables name has been changed since the wiki was made it seems.

Make the Client/Websocket more resilient to connection Issues.

Websocket sometimes dies with 'invalid closing frame code'
We should investigate why that happens, and also we should try to open up a new socket when it happens!
I suppose this was related to the Bonkers Server.
The Websocket should be able to recover from a connection loss non the less, This Issue will be made into a feature request. to make the Websocket more resilient.

Client notifying the engine of incoming events (and generally communicating better)

If the client could notify the engine of incoming creatures, DMAs, RTDMAs, and other stuff via a MESG WRIT/WRT+, it would make receiving/interpreting messages a lot faster and save the engine a lot of resources ticking through a long timer script.

Paired with SMAs (#32), this could establish a closer relationship between the client and engine and be used to handle problems such as creatures that don't warp in/out properly.

Let the client only update the ingame Contacts on Changes

Currently the Client is Hammering the Contact update script like crazy!
To not slow down the game unnecessarily, we should only trigger this upon a change, i.e. every time a players online status changed, or a new player is added to the List.

Remove Sent Creatures

Get the client (or engine, or something) to delete outgoing creatures from the export folder once they have been safely uploaded.

Prefill Contact List with everyone

To enable online functionallity like sending mail and creatures to someon, a contact is needed.

To get things going we should simply add everyone registerd to the contact list.

The Client must utilize the Endpoint provided by AlbianWarp/AlbianWarpServer#1 to inject all contacts into the game via:

rtar 1 1 157 mesg wrt+ targ 1000 "user" 0 0

No additional game changes should be needed for this to work.

This can be enhanced later on of course!

Expected numeric rvalue at token 'e'

Log attached: message.txt

Everything seems to be normal until suddenly:

DBG: OUTS:
e
DBG: OUTS:
e
DBG: OUTS:
e
DBG: OUTS:
e
e
DBG: OUTS:
e
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 3 seconds...
e
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 3 seconds...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 3 seconds...
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 6 seconds...
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 6 seconds...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 6 seconds...
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 12 seconds...
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 12 seconds...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 12 seconds...

etc.

Seems to be related to this line:

r'targ agnt %s sets va00 "" outs "{" loop namn va00 doif va00 ne "" outs "\"" outs va00 outs "\": " setv va10 type name va00 doif va10 eq 2 outx name va00 elif va10 lt 2 outv name va00 endi outs "," endi untl va00 eq "" outs "}"'

Bootstrap auto updater

We should get rid of the manual process of installing and updating the GameModifications into Bootstrap.

Needed:

  • the client should be able to tell if a new GameModifications version is available

  • the client should be able to automatically replace the old GameModifications with the new one

  • the client should be able to check if a world still has an old version of the GameModifications

  • the client should then warn the player and instruct him on how to update the world (Reinjection via Agent)

  • Use Serverside Cached GH API Endpoint

  • Modify "Game Modifications" to feature a Version Number.

Bonus Points:
- [ ] the client automatically detects the correct Bootstrap Directory

Exception Handling

currently the Client degrades into a undefined state once it encounters an unhandled exception.

We need to add some Exception handling to maintain a defined state and to kill the Client of once it reaches a blocking state.

Add a GUI to the AlbianWarp Client

While functioning fine as a console application, the client should non the less provide a GUI.

Having a GUI would allow for easy access to i.E. the Configuration.
Also the usability and presentation could be greatly enhanced.

Improve CAOS Error Messages

An Error caused by Syntax, or other Issues, should also contain the Input CAOS commands, This is not a Usefull Error Message!:

Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 3 seconds...
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 6 seconds...
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 12 seconds...
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
RETRY: WARNING: Expecting value: line 1 column 1 (char 0), Retrying in 24 seconds...
Expected numeric rvalue at token 'e'
 [targ agnt {@}e sets va00 "" outs "{" loop namn va00   ...
ERROR: Expecting value: line 1 column 1 (char 0)
Exception in thread Thread-7:
Traceback (most recent call last):
  File "threading.py", line 916, in _bootstrap_inner
  File "threading.py", line 864, in run
  File "AlbianWarpPythonClient.py", line 452, in rtdma_send_handler
  File "AlbianWarpPythonClient.py", line 447, in rtdma_send_handler
  File "util.py", line 40, in f_retry
  File "AlbianWarpPythonClient.py", line 429, in send_rtdma
  File "CaosEvolution\Agent.py", line 99, in dict
  File "json\__init__.py", line 354, in loads
  File "json\decoder.py", line 339, in decode
  File "json\decoder.py", line 357, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

DEBUG: dma_send_handler thread ended
DEBUG: creature_download_handler thread ended
DEBUG: contactlist_handler thread ended
DEBUG: dma_receive_handler thread ended
DEBUG: creature_upload_handler thread ended
Press Enter to Exit...
´´´

Specification of SystemMessageAgent system

Scope of this issue is to internally discuss how SMA's could be implemented, what they should be used for and what they should not be used for.

I think we will eventually need another Agent type for System/Albianwarp Messages, like:

  • Errors
  • Update Notifications
  • Dialog Boxes (for user feedback)
    • Yes/No

SMA's are probably only exchanged between the Client and the game, and the Server itself, they are not sent from one Player to another. (Thats what RTDMA's and regular DMA's are for)

Provide 32Bit executable

With this being such an old game it makes sense people are more likely to run it on old 32Bit systems, we should accommodate for that by providing a 32Bit version of the client.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.