GithubHelp home page GithubHelp logo

soapbox-race-core's Introduction

Discord

SBRW Core

About/Overview

The soapbox-race-core project is focused on developing a game server compatible with the game Need for Speed: World. Currently, most of the original game functionality is implemented, but development is still ongoing.

Technical details

The server is an application built to run on the Wildfly platform, through Thorntail. Maven is used as the build system. All code is written for Java 8.

Installation

Installation documentation is WIP.

Contributing

Want to make a contribution? It's easy - just follow these steps:

  1. Fork this repository if you haven't done so already
  2. Create a new branch with an appropriate name in relation to your changes
  3. Commit and push your changes (please try to avoid putting in irrelevant changes, focus on your idea)
  4. Make a pull request against this repository. Make sure to explain what you did, how you tested it, and if it is a breaking change.
  5. Sit back and wait for feedback on your pull request.

soapbox-race-core's People

Contributors

dependabot[bot] avatar leocodes21 avatar metonator avatar nilzao avatar vladmanyanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

soapbox-race-core's Issues

Lobby consistency is not enforced

Under certain conditions, it is possible to have lobbies with more than 8 players. Lobby invitations should be handled in a safer way than they currently are.

Automatic scenery group management

Administrators should be able to configure date ranges for particular seasonal scenery groups to be activated. The server should automatically manage the scenery groups, so that manual configuration is unnecessary.

TODO: how should overrides work?

kubernetes

Hi brothers, easy way to run sbrw, first yaml version:

apiVersion: v1
kind: Namespace
metadata:
  name: sbrw
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: openfire
  name: openfire-lb
  namespace: sbrw
spec:
  ports:
    - name: admin-console
      port: 9090
      protocol: TCP
      targetPort: 9090
    - name: xmpp
      port: 5222
      protocol: TCP
      targetPort: 5222
  selector:
    app: openfire
  sessionAffinity: None
  type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: mysql
  name: mysql-lb
  namespace: sbrw
spec:
  ports:
    - name: mysql
      port: 3306
      protocol: TCP
      targetPort: 3306
  selector:
    app: mysql
  sessionAffinity: None
  type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: wildfly
  name: wildfly-lb
  namespace: sbrw
spec:
  ports:
    - name: wildfly
      port: 8080
      protocol: TCP
      targetPort: 8080
  selector:
    app: wildfly
  sessionAffinity: None
  type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: freeroam
  name: freeroam-lb
  namespace: sbrw
spec:
  ports:
    - name: freeroam
      port: 9999
      protocol: UDP
      targetPort: 9999
  selector:
    app: freeroam
  sessionAffinity: None
  type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: multiplayer
  name: multiplayer-lb
  namespace: sbrw
spec:
  ports:
    - name: multiplayer
      port: 9998
      protocol: UDP
      targetPort: 9998
  selector:
    app: multiplayer
  sessionAffinity: None
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  labels:
    app: openfire
  name: openfire
  namespace: sbrw
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: openfire
  template:
    metadata:
      labels:
        app: openfire
    spec:
      containers:
        - image: registry.gitlab.com/soapboxrace/openfire:latest
          env:
            - name: DOMAIN
              value: 192.168.13.121
            - name: FQDN
              value: 192.168.13.121
            - name: ADMIN_PASSWORD
              value: admin
            - name: REST_API_SECRET
              value: superSecret2
          imagePullPolicy: Always
          name: openfire
          ports:
            - containerPort: 9090
              protocol: TCP
            - containerPort: 5222
              protocol: TCP
      dnsPolicy: ClusterFirst
      restartPolicy: Always
---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  labels:
    app: mysql
  name: mysql
  namespace: sbrw
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: mysql
  template:
    metadata:
      labels:
        app: mysql
    spec:
      containers:
        - image: registry.gitlab.com/soapboxrace/mysql:latest
          imagePullPolicy: Always
          name: mysql
          ports:
            - containerPort: 3306
              protocol: TCP
      dnsPolicy: ClusterFirst
      restartPolicy: Always
---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  labels:
    app: wildfly
  name: wildfly
  namespace: sbrw
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: wildfly
  template:
    metadata:
      labels:
        app: wildfly
    spec:
      containers:
        - image: registry.gitlab.com/soapboxrace/wildfly12-mysql:latest
          env:
            - name: MYSQL_JDBC
              value: jdbc:mysql://mysql-lb.sbrw:3306/SOAPBOX
            - name: XMPP_IP
              value: 192.168.13.121
            - name: UDP_FREEROAM_IP
              value: 192.168.13.121
            - name: UDP_RACE_IP
              value: 192.168.13.121
            - name: OPENFIRE_ADDRESS
              value: http://openfire-lb.sbrw:9090/plugins/restapi/v1
          imagePullPolicy: Always
          name: wildfly
          ports:
            - containerPort: 8080
              protocol: TCP
          livenessProbe:
            exec:
              command:
                - /bin/sh
                - -c
                - "status_code=$(curl -s -o /dev/null -w '%{http_code}' 'http://127.0.0.1:8080/soapbox-race-core/'); if [ $status_code -ne 200 ]; then exit 1; fi"
            initialDelaySeconds: 60
            periodSeconds: 10
      dnsPolicy: ClusterFirst
      restartPolicy: Always
---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  labels:
    app: freeroam
  name: freeroam
  namespace: sbrw
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: freeroam
  template:
    metadata:
      labels:
        app: freeroam
    spec:
      containers:
        - image: registry.gitlab.com/soapboxrace/freeroam:latest
          imagePullPolicy: Always
          name: freeroam
          ports:
            - containerPort: 9999
              protocol: UDP
      dnsPolicy: ClusterFirst
      restartPolicy: Always
---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  labels:
    app: multiplayer
  name: multiplayer
  namespace: sbrw
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: multiplayer
  template:
    metadata:
      labels:
        app: multiplayer
    spec:
      containers:
        - image: registry.gitlab.com/soapboxrace/multiplayer:latest
          imagePullPolicy: Always
          name: multiplayer
          ports:
            - containerPort: 9998
              protocol: UDP
      dnsPolicy: ClusterFirst
      restartPolicy: Always
kubectl apply -f sbrw.yaml

if powerups not working, kill wildfly pod and wait the new pod run.

tested on lan, just change the 192.168.13.121 address to your ipv4 lan address before run kubectl apply

tested with linux k8s cluster with metallb

tested with docker desktop for windows 10, with kubernetes enabled.

to persist the mysql database, need to create a volume mount.

have fun

Level restrictions are not enforced on basket transactions

Issue:
It is possible to buy level-restricted items under the required level as the server does not enforce or check this condition. It's only checked client side.
Sending a request directly on an under-level account would succeed if all other conditions are met.

Improved punishment system

Rework the ban system and turn it into something more generic - support mute, ban, kick, etc, with proper support for "responsibility" as well as expiration dates

Related to #16 - expose functionality through a remote API

powerup

Hi,

i open this issue because powerups not work and i need help for make it work please

OS : Windows 11
Mysql 8
java 10
Redis enabled and working
thanks

Fail to deploy core.war over WildFly

server fails to deploy when used over wildfly 19.0.0 (have tried older versions as well but the error is the same).

{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit."core.war".component.OpenFireSoapBoxCli.START" => "java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: javax.ejb.EJBTransactionRolledbackException
Caused by: java.lang.NullPointerException"}}

Achievement processing prone to transaction/locking errors

com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
....
    at com.soapboxrace.core.dao.PersonaAchievementDAO$$$view91.findByPersonaIdAndAchievementId
    at com.soapboxrace.core.bo.AchievementBO.updateAchievements(AchievementBO.java:277)
    at com.soapboxrace.core.bo.AchievementBO.lambda$commitTransaction$0(AchievementBO.java:87)
    at java.util.ArrayList.forEach(ArrayList.java:1540)
    at com.soapboxrace.core.bo.AchievementBO.lambda$commitTransaction$1(AchievementBO.java:87)
    at java.util.HashMap.forEach(HashMap.java:1336)
    at com.soapboxrace.core.bo.AchievementBO.commitTransaction(AchievementBO.java:87)
    ....
    at com.soapboxrace.core.bo.CommerceBO$$$view10.doCommerce
    at com.soapboxrace.core.api.Personas.commerce(Personas.java:64)
    ....
javax.ejb.EJBTransactionRolledbackException: could not execute statement
    at com.soapboxrace.core.dao.PersonaAchievementDAO$$$view91.findByPersonaIdAndAchievementId
    at com.soapboxrace.core.bo.AchievementBO.updateAchievements(AchievementBO.java:277)
    at com.soapboxrace.core.bo.AchievementBO.lambda$commitTransaction$0(AchievementBO.java:87)
    at java.util.ArrayList.forEach(ArrayList.java:1540)
    at com.soapboxrace.core.bo.AchievementBO.lambda$commitTransaction$1(AchievementBO.java:87)
    at java.util.HashMap.forEach(HashMap.java:1336)
    at com.soapboxrace.core.bo.AchievementBO.commitTransaction(AchievementBO.java:87)
    at com.soapboxrace.core.bo.CommerceBO.doCommerce(CommerceBO.java:245)
    ....
    at com.soapboxrace.core.api.Personas.commerce(Personas.java:64)
    ....

Achievement progress updates sometimes fail

In certain cases, the game client fails to process achievement progress update messages from the server. This can potentially be alleviated by batching the updates into one message.

Catalog Data - catalog-data.sql

Why are we storing all this parsed XML in the SQL database rather then as plain XML files? Seems like it would be a waste of resources quarrying the SQL database rather then looking up the xml file on the server.

Amplifiers as a reward do not properly stack

Currently, amplifiers can be dropped as rewards. However, the amplifier part of the inventory subsystem was not built to handle this case. We should always override an existing amplifier (if there is one), so that these drops can be considered to work properly.

Webhook support

Implement support for Discord webhooks in various subsystems. Some potential applications:

  • Reporting unhandled exceptions (easier than grep-ing a log file, or paying for Bugsnag)
  • Notifying staff of reports; also audit logging
  • In the future: chat bridge?

CarSlotBO.scheduledRemoval task throws transaction errors

Nov 14 18:18:00 xxxxxxxxxxxx.privatedns.com game-server[yyyyy]: Caused by: javax.persistence.PersistenceException: org.hibernate.HibernateException: Transaction was rolled back in a different thread!
Nov 14 18:18:00 xxxxxxxxxxxx.privatedns.com game-server[yyyyy]: at [email protected]//org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
Nov 14 18:18:00 xxxxxxxxxxxx.privatedns.com game-server[yyyyy]: at [email protected]//org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1515)
Nov 14 18:18:00 xxxxxxxxxxxx.privatedns.com game-server[yyyyy]: at [email protected]//org.hibernate.query.Query.getResultList(Query.java:132)
Nov 14 18:18:00 xxxxxxxxxxxx.privatedns.com game-server[yyyyy]: at deployment.core.war//com.soapboxrace.core.dao.CarSlotDAO.findAllExpired(CarSlotDAO.java:58)
...
Nov 14 18:18:00 xxxxxxxxxxxx.privatedns.com game-server[yyyyy]: at deployment.core.war//com.soapboxrace.core.bo.CarSlotBO.scheduledRemoval(CarSlotBO.java:37)

This issue seems to stem from the fact that CarSlotBO is annotated with the @Stateless annotation. All other classes with scheduled tasks are singleton beans.

Fix stock vinyl related issues

Some presets include "stock" vinyls that are not available in the shop (usually, at least). That by itself is not an issue. However, there appears to be an internal inconsistency in data, since attempting to perform any customization will usually result in a "Invalid Basket" error.

Can't seem to recieve a cryptoticket

When testing a new instance of the server locally the client doesn't seem it wants to retrieve a cryptoticket before connecting to the udp server, might this be because of the absence of a xmpp server?

Remote management API

Create an API that can be used for remote server management. Some examples of potential use cases:

  • Enable/disable maintenance mode
  • Broadcast chat announcement to all connected players
  • Manage moderation/punishments
  • Retrieve player info
  • Update server information (max online, name, etc)

Would most likely be a JSON API, for ease of consumption.

Advanced treasure hunt rewards

Upgrade the treasure hunt reward system to allow for rewards based on streak "milestones". Ideally, each streak milestone would point to a unique reward table, allowing for rewards to get better (or rarer) as players progress further.

"Switch Driver" option in exit menu leads to FailedSessionSecurityPolicy error

from tests on staging server

[2020-01-19 15:55:10.804] [Server] [Info] <request token="89" method="POST" restUri="http://STAGING_IP:8080/Engine.svc/User/SecureLogoutPersona?userId=1&personaId=100"></request>
[2020-01-19 15:55:10.918] [Server] [Info] <request token="90" method="POST" restUri="http://STAGING_IP:8080/Engine.svc/DriverPersona/UpdatePersonaPresence?personaId=100&presence=1"></request>

UpdatePersonaPresence after SecureLogoutPersona is forbidden by the server. This leads to the game crashing with a server error message. This needs to be handled properly somehow.

Can anyone give me some advice on how to build a nfsw server?

Can you give detailed instructions on the different software versions used eg.

  • MVN and JAVA Version at "mvn package" on Core Server
  • MVN and JAVA Version at "mvn verify" on Openfire, openfire-restAPI-plugin and openfire-nonSaslAuthentication-plugin
  • JAVA Version at runnable Server Core jar and Server Openfire

Also I found that when I add the plugin The openfire-restAPI-plugin in Openfire cannot be accessed due to an error plugin.

However, the choice of branch and fork for each person is still confusing because git master doesn't provide complete components such as no SQL structure, location to set in database of SOAPBOX and openfire, so I had to try loading git by looking at Forks list and load them all to try. It shows that important data files are scattered among each person's forks, although I've gathered them until I'm sure there are many. But being addicted to various problems makes me think that Is there any information I need to set up the server that I don't know yet?

I have tried installing both in Ubuntu 18.04 and Windows 10. The basic tools that I installed and tried are as follows.

  • mvn 3.0.0 - 3.8.1
  • java version 8, 9, 11
  • redis-server
  • openfire 4.5.0 < default, 4.6.1
  • mysql 8

I initially followed the instructions in the wiki, but found that there were many problems that could not be solved with git master alone. I've tried searching for older versions like Soapbox Race World Core 1.0.0 - 1.0.3 and put it in a test build but it still doesn't work. So I'd like to ask for some advice on setting up and including sql structure, will that help me?

It seems that the core is not connected to FreeRoam and MP

It seems that the core is not connected to FreeRoam and MP, making it invisible to other players on the server. Or may be able to use Powerups as well. I noticed that sbrw.xxx in Openfire is not online except sbrw.engine.engine What code can I edit to make these functions work?

Unnecessary duplicate database lookups

There are several places in the code where the same entity is fetched by primary key more than once. This is an obvious performance issue that can be alleviated by passing around entities rather than IDs.

Building a server today... outdated tutorial.

This: https://github.com/berkayylmao/setting-up-sbrw

tutorial Is not entirely up to date, since there is a very lot of repositories/dependencies in POM.XML is not correct anymore, you need to fix it manually, but when you are build up your server it wont work with the provided openfire version(the only one was i able to use is not SBRW openfire its the original, not the one i built, i copyed over the rest and other plugins to make them work and it seems that it works, but in reality only the login system works..) The server starts up, working, i can go ingame singleplayer, but no POwerups or any type of multiplayer, i did the tutorial modnet part, but beside that what i need? i need to need to install beside something in the tutorial? How can i make work multiplayer and powerups my own server? Also why is that that sbrw custom build openfire wont work?

I added my log file of the core. Please check it for me, i cannot ask any help from anywhere...

If i use the custom built openfire 4.5.0 Alpha then i get this warnings about SSL or something... :

kép_2021-12-14_220456

After this it will work; however the core wont and it causes error messages both openfire and the program itself then the core.jar crashes.

Here is the logs::
CORE j jar error: core.log
OPENFIRE error log: openfire.log

Then it crashes, this is the recommended openfire the 4.5.0 alpha from the tutorial. i am using everything like in the tutorial even the folders is the same.

MY OTHER solution was that i use the latest version of openfire(4.6.5)... now, then it is working without errors, but the MODNET part of the tutorial is a bit missing parts and not too concrete... i have an XMPP server with index.json and i added all neceserry part of the moddong parameters for the modnet, but.. it is not clear i need to install some modnet framework somehow on windows or how should i use that? I can go ingame but no powerups nor multiplayer, nothing... I am trying to host this of my small friend comminity privately on a VPN... Also freeroam server is not working either the players not seeing each other ect ect...

Can someone help me? I WOULD RELLY want to do this but no one is willing to help me... i did tried to be as much detailed as possible, but here is an other sum:

  • OS: Windows server 2012R2 (Virtual with 6GB ram and 12 VCore)
  • OpenJava 10
  • Mysql 8.0.23 - that is on the tutorial
  • Apache MAven
  • GO installed, and all programs are in the reuied paths i can now compile without a problem my only problem is that this is not working well at all...

Can you people help me? If there is needed some more details just yell. I can provide any log and thingy...

New Contributors

Hello! Is this project under development? Do you accept contributions?

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.