Giter VIP home page Giter VIP logo

rpg's Introduction

rpg's People

Contributors

sigmanificient avatar vbetsch avatar

Watchers

 avatar

rpg's Issues

:bug: Crash when trying to modify or delete a character on a new account

If the user dont have any character, trying to call the menu to delete a character will cause the program to crash.

See the play log:

[Figmou]
-----------MENU-----------
- Modifier votre compte (m)
- Supprimer votre compte (s)
- Jouer (j)
- Se déconnecter (d)
- Quitter (q)
j

[Figmou]
Veuillez choisir un personnage pour jouer
===========PERSONNAGES===========
- Choisir un personnage (c)
- Ajouter un personnage (a)
- Voir un personnage (v)
- Donner un personnage (d)
- Modifier un personnage (m)
- Supprimer un personnage (s)
- Liste des personnages (p)
- Voir les roles (r)
- Jouer (j)
- Quitter (q)
s
Quel est le nom du personnage que vous voulez supprimer ? dsjkl

Traceback

Traceback (most recent call last):
  File ".../rpg/main.py", line 452, in <module>
    if menu(make_choice()) is False:
  File ".../rpg/main.py", line 437, in menu
    return {
  File ".../rpg/main.py", line 393, in char
    if fiche_char(active_player, char_to_delete):
  File ".../rpg/main.py", line 223, in fiche_char
    if character.sexe == 'H':
AttributeError: 'NoneType' object has no attribute 'sexe'

This come from char_to_delete being None


The same occurs when trying tryng to modify a character

[Non connecté]
Veuillez choisir un personnage pour jouer
===========PERSONNAGES===========
- Choisir un personnage (c)
- Ajouter un personnage (a)
- Voir un personnage (v)
- Donner un personnage (d)
- Modifier un personnage (m)
- Supprimer un personnage (s)
- Liste des personnages (p)
- Voir les roles (r)
- Jouer (j)
- Quitter (q)
m
Quel est le nom du personnage que vous voulez modifier ? fghfhhg
Traceback (most recent call last):
  File "/home/dev/repo/Sigmanificient/rpg/main.py", line 457, in <module>
    if menu(make_choice()) is False:
  File "/home/dev/repo/Sigmanificient/rpg/main.py", line 442, in menu
    return {
  File "/home/dev/repo/Sigmanificient/rpg/main.py", line 386, in char
    modify_char(active_player, search_char(active_player, input(
  File "/home/dev/repo/Sigmanificient/rpg/main.py", line 271, in modify_char
    if not fiche_char(player, character):
  File "/home/dev/repo/Sigmanificient/rpg/main.py", line 223, in fiche_char
    if character.sexe == 'H':
AttributeError: 'NoneType' object has no attribute 'sexe'

Process finished with exit code 1

Documentation is uncomplete

The documentation is missing a step to install the mysql-connector-python package.
A requirements.txtand a indication within the readme would solve this issue

inclusion

Could you please add an other field or just accept user input instead of a binary choice ?

  sexe = "Aucun"
  if character.sexe == 'H':
      sexe = "Homme"
  elif character.sexe == 'F':
      sexe = "Femme"

:bulb: Improving game portability

Hi, I've noticed that the game uses the MySQL DBMS (Database Management System).

The user have to install that dependency by they own, which can be difficult on some OS, such a windows.
MySQL is also a pretty heavy piece of software, that wouldn't be of much use for a project of such scale.
Moreover, you then have to create a config for the sole purpose of defining the authentication string to the database.

Using something a sqlite would be preferable, as it comes without any requirements than the python library use to connect with it. It create a single file for store the whole database, which is more the enough since there is a single schema defining a few tables.

Overall, It would make things easier to install and lighter
I recommend you to read the documentation on the sqlite3 module, here

:bug: Create create a new account

image

Every name you enter is detected as Taken due to test_player returning a Player type that is evaluated as True

if test_player(name):
    print("Ce nom est déjà prit\n")
    return default_player
def test_player(name: str) -> Player:
    player = default_player
    for all_player in players:
        if all_player.name == name:
            player = all_player
            break
    return player

test_player = Player(0, 'test', 0)
print(bool(test_player))

true

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.