Git Product home page Git Product logo

trakman's People

Contributors

felacek avatar lythx avatar vtxsrb avatar wsrvn 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

Watchers

 avatar  avatar  avatar  avatar

trakman's Issues

Server links

Hia,

is planned something like zeroswitch or server neighborhood?

common design consensus

for chat messages, and in general, we should choose a colour palette of sorts (what to use (by default) for votes, admin stuff, queue).
also would be useful to think of how to format the chat notices. in xaseco, private messages (sent with Chat*ToLogin etc) are prefixed with >, global ones with >>.
we dont have to necessarily copy that but having some """""guidelines""""" would improve consistency overall, no one really wants everything to look like rainbow puke (unless with a plugin that does exactly that).

CP times

no way to get them directly, so we need to store them for each player for each run. Or just have a global table with all the players and all the checkpoints like xasecer.

Missing xaseco feautures

Hia,

is planned musicserver and forcemods implementation? Also add some discord ingame button.

naming consistency

we have challenge, map, track
score, time
manialink, widget .. etc need to agree what to use everywhere

controller hanging unexpectedly with no error present

happened at least 4 times on loltards, it is reproducible in daemon mode (npm run daemon), but not in normal launch mode (npm run start). no error is output in the log, so debuggin is impossible idk how to fix

Dedimania on TMUF

Yo,

After trying this controller on TMUF (snow server)

I have this error:
<ERROR> [19 Feb 2023 21:28:18] (Dedimania.js:111) Failed to fetch dedimania records for map Snow 2011 Lolly Jump (eY8soznlJRerRcKFVWvUfZvLXni), received error: Dedimania server responded with an error Error in method_handler.php(926): Invalid Environment: TMU,Snow Code:
that all

ui windows todo

list of ui components to design and code:

  • tmxinfo
  • maplist (these 2 are a thing already just need to refactor a bit and change design)
  • player stats windows - things like topsums etc there probably will be a lot of them but these are very easy to do and also are kinda important cuz we have button linking to playerstats so thats a good thing to start with I think
  • detailed map info - i guess for that one we can display all info we have in memory along with tmx description and full ranking, and karma-over-time graph (ye this one is a bit difficult so maybe leave it for later)
  • banlist
  • blacklist
  • mutelist
  • guestlist (these 4 need to have functionality eg unban/change reason/change time etc so we need to come up with design for that)
  • donation widget below liverecs probably (?)
  • live cps on top of the screen probably or something idk how we make it look good with live finishes tbh xdd, maybe do two vertical lists like in nations fullspeed but with some styling
  • live finishes asdasd
  • personal cps - replacement for the nadeo thing in bottom (can do it similar to nations fullspeed too but with better design)
  • player list - easy access ban/kick etc.. (only for op and above)

on the very first start, a ton of database errors pop up

initially reported in #208, but known for quite some time: on the very first controller start, you will encounter a plethora of database errors that are related to operations executing in parallel.

quoting my friend @lythx:

fixing it would be insanely cancer
cuz
we purposefully dont await some actions as they take time on launch
but when the db gets created theres just too many calls and delay is too big
so it crashes

you could always restart a few times tho..

widget update events

some of the current ui doesnt update in time (if it does at all), maybe this list will be updated idk rtbh

locals dont update on //delrec (or //prunerecs), can be fixed by emitting Controller.LocalRecords, PlayerRecord won't do it since we kinda have nothing to send if the record is removed instead.

karma doesnt update in general atm, but for the future we'll need to update it for everyone whenever theres a new vote. might need something like Controller.KarmaVote or whatever to handle that.

buttons afaik dont update, or it doesnt seem like they do:

  • players/specs button should be updated on Controller.PlayerJoin, Controller.PlayerLeave, Controller.PlayerInfoChanged and ofc on ready.
  • visitors button is tricky since its a database call, it would be inefficient to call update on every playerjoin, we can of course only count the 0-visits people with an if, but why bother.
  • maps list count should be updated on ChallengeListModified. we dont have that in controller events yet.

tmx records should be updated on either Controller.PlayerFinish or Controller.PlayerRecord to update the relative colours n shit.

update the regex for strip()

while our solution works just fine for the majority of the cases, there still appear to be a few outliers that manage to break the matching. note that the algorithm may be unoptimised too, so thats a thing to look out for as well.

for reference, heres the (fully commented) presumably working version of the function, courtesy of xymph (WARNING PHP):

// (markdown is a bit trippy here, everything preceded by // is a comment despite the incorrect highlighting)
function stripFormatting($input, $for_tm = true) {
    return
        // Replace all occurrences of a null character back with a pair of dollar signs for displaying in TM, or a single dollar for log messages etc.
        str_replace("\0", ($for_tm ? '$$' : '$'),
            // Replace links (introduced in TMU)
            preg_replace(
                '/
                // Strip TMF H, L & P links by stripping everything between each square bracket pair until another $H, $L or $P sequence (or EoS) is found, this allows a $H to close a $L and vice versa, as does the game
                \\$[hlp](.*?)(?:\\[.*?\\](.*?))*(?:\\$[hlp]|$)
                /ixu',
                // Keep the first and third capturing groups if present
                '$1$2',
                // Replace various patterns beginning with an unescaped dollar
                preg_replace(
                    '/
                    // Match a single dollar sign and any of the following:
                    \\$
                    (?:
                        // Strip color codes by matching any hexadecimal character and any other two characters following it (except $)
                        [0-9a-f][^$][^$]
                        // Strip any incomplete color codes by matching any hexadecimal character followed by another character (except $)
                        |[0-9a-f][^$]
                        // Strip any single style code (including an invisible UTF8 char) that is not an H, L or P link or a bracket ($[ and $])
                        |[^][hlp]
                        // Strip the dollar sign if it is followed by [ or ], but do not strip the brackets themselves
                        |(?=[][])
                        // Strip the dollar sign if it is at the end of the string
                        |$
                    )
                    // Ignore alphabet case, ignore whitespace in pattern & use UTF-8 mode
                    /ixu',
                    // Replace any matches with nothing (i.e. strip matches)
                    '',
                    // Replace all occurrences of dollar sign pairs with a null character
                    str_replace('$$', "\0", $input)
                )
            )
        )
    ;
}

ignoring the comments and """fancy""" format (aka i love wasting space in my editor):

function stripColours($input, $forTM = true) {
	return 
	str_replace("\0", ($forTM ? '$$' : '$'), 
	preg_replace('/\\$[hlp](.*?)(?:\\[.*?\\](.*?))*(?:\\$[hlp]|$)/ixu', '$1$2', 
	preg_replace('/\\$(?:[0-9a-f][^$][^$]|[0-9a-f][^$]|[^][hlp]|(?=[][])|$)/ixu', '', 
	str_replace('$$', "\0", $input))));
}

forTM can obviously be ignored. it is unused even in xaseco itself XD.

NOTE that the function above does not remove the other formatting codes, for that \$[SHWIPLONGTZ]\ should be used (usually as the last OR statement)

here's a list of entries that should be tested against the regex to ensure its working (use regexr or something similar, dont overcomplicate your life lol):

$0CFωα$0CFғ$0CFα$i$000$i | $3CFNexogg GF
$L[goo.gl/UJy69u]$fffмσтι$0C6$fffи|ғ
$H[manialinker]$Hheythere$P[manialinker]
$000[$5f6CMC$000]$b$f60GuessWho
$B$FFFUber Bug
TM$5$6/$0$ARU DES
|$fadǵ$faeƒ$faf.$i$fffsabø$f|
$i$adf$wP$fffazeh
$<thefunnyname$>
dollar$$dollar

expected output:

ωαғα | Nexogg GF
мσтιи|ғ
heythere
[CMC]GuessWho
Uber Bug
TM DES
ǵƒ.sabø
Pazeh
thefunnyname
dollar$$dollar

current output:

ωαғα | Nexogg GF
мσтιи|ғ
heythere
[CMC]$bGuessWho
$BUber Bug
TM$5$0 DES
|ǵƒ.sabø
Pazeh
$<thefunnyname$>
dollar$lar

Utils/getTimeString & TM/msToTime dont work properly

gettimestring: .10 is displayed as .010 which is misleading, flat times can be bugged as well, eg. 25.00 displaying as 24.100.
mstotime: for some reason adds 2 hours or something to the playtime (sometimes). i assume has something to do with js Date being garbo.

Maplist not reloaded after adding maps with external tool

Hi,
just a little feature suggestion:
I would like to easily add maps from Adminserv or my discord bot without restart the controller

Just need to reload the maplist on "TrackMania.ChallengeListModified" callback (src/Listeners.ts)

Crashing on podium

Yo, the controller is crashing at the begining of the podium

[30 Apr 2023 02:05:20] (Logger.js:28) Unhandled rejection occured:
Cannot read properties of undefined (reading 'callerLogin')
TypeError: Cannot read properties of undefined (reading 'callerLogin')
at Object.callback (file:///home/TM/TMUF/Trakman/TMN/built/src/Listeners.js:245:55)
at Object.emit (file:///home/TM/TMUF/Trakman/TMN/built/src/Events.js:66:18)
at ClientSocket.handleResponseChunk (file:///home/TM/TMUF/Trakman/TMN/built/src/client/ClientSocket.js:120:24)
at ClientSocket.handleResponseStart (file:///home/TM/TMUF/Trakman/TMN/built/src/client/ClientSocket.js:107:14)
at ClientSocket.handleResponseChunk (file:///home/TM/TMUF/Trakman/TMN/built/src/client/ClientSocket.js:125:18)
at ClientSocket.handleResponseStart (file:///home/TM/TMUF/Trakman/TMN/built/src/client/ClientSocket.js:107:14)
at ClientSocket.handleResponseChunk (file:///home/TM/TMUF/Trakman/TMN/built/src/client/ClientSocket.js:125:18)
at ClientSocket.handleResponseStart (file:///home/TM/TMUF/Trakman/TMN/built/src/client/ClientSocket.js:107:14)
at ClientSocket.handleResponseChunk (file:///home/TM/TMUF/Trakman/TMN/built/src/client/ClientSocket.js:125:18)
at ClientSocket.handleResponseStart (file:///home/TM/TMUF/Trakman/TMN/built/src/client/ClientSocket.js:107:14)

i'm using the latest version [1.3.2], freshly installed

adding a map that is already present destroys the server queue

using //add to queue a tmx map breaks the server map list entirely if the said map was already on the server.

in this case, the "ChooseNextChallenge" call always responds with an error stating "challenge is not in the selection", despite the map being present in both the database and the matchsettings file.

the filepaths in either also match, thus eliminating file mismatch as the culprit.

main issue here is the inability to ever queue the map in question, even after the controller restart. the error will keep reappearing until you shutdown and relaunch the dedicated server entirely, therefore this might not be our bug at all.

doesn't work

doesn't run
my system:
neofetch

wiseraven@dell 
OS: Arch Linux x86_64 
Host: G5 5590 
Kernel: 5.17.3-arch1-1 
Uptime: 21 days, 4 hours, 5 mins 
Packages: 1250 (pacman) 
Shell: bash 5.1.16 
Resolution: 1920x1080 
DE: GNOME 42.0 
WM: Mutter 
WM Theme: Adwaita 
Theme: Adwaita-dark [GTK2/3] 
Icons: Numix-Circle [GTK2/3] 
Terminal: gnome-terminal 
CPU: Intel i7-9750H (12) @ 2.600GHz 
GPU: Intel CoffeeLake-H GT2 [UHD Graph 
GPU: NVIDIA GeForce RTX 2060 Mobile 
Memory: 5616MiB / 15812MiB

uname -a

Linux dell 5.17.3-arch1-1 #1 SMP PREEMPT Thu, 14 Apr 2022 01:18:36 +0000 x86_64 GNU/Linux

lsblk

sda           8:0    0 931,5G  0 disk 
├─sda1        8:1    0   300M  0 part 
├─sda2        8:2    0 914,2G  0 part /mnt/5baf9c22-b345-4dc3-8851-417eb41ee159
└─sda3        8:3    0    17G  0 part 
nvme0n1     259:0    0 238,5G  0 disk 
├─nvme0n1p1 259:1    0   300M  0 part /boot/efi
├─nvme0n1p2 259:2    0 221,2G  0 part /var/log
│                                     /var/cache
│                                     /home
│                                     /
└─nvme0n1p3 259:3    0    17G  0 part [SWAP]

lspci

00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 07)
00:01.0 PCI bridge: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) (rev 07)
00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 07)
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model
00:12.0 Signal processing controller: Intel Corporation Cannon Lake PCH Thermal Controller (rev 10)
00:14.0 USB controller: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller (rev 10)
00:14.2 RAM memory: Intel Corporation Cannon Lake PCH Shared SRAM (rev 10)
00:14.3 Network controller: Intel Corporation Cannon Lake PCH CNVi WiFi (rev 10)
00:15.0 Serial bus controller: Intel Corporation Cannon Lake PCH Serial IO I2C Controller #0 (rev 10)
00:15.1 Serial bus controller: Intel Corporation Cannon Lake PCH Serial IO I2C Controller #1 (rev 10)
00:16.0 Communication controller: Intel Corporation Cannon Lake PCH HECI Controller (rev 10)
00:17.0 SATA controller: Intel Corporation Cannon Lake Mobile PCH SATA AHCI Controller (rev 10)
00:1b.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #21 (rev f0)
00:1d.0 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #9 (rev f0)
00:1d.5 PCI bridge: Intel Corporation Cannon Lake PCH PCI Express Root Port #14 (rev f0)
00:1f.0 ISA bridge: Intel Corporation HM470 Chipset LPC/eSPI Controller (rev 10)
00:1f.3 Audio device: Intel Corporation Cannon Lake PCH cAVS (rev 10)
00:1f.4 SMBus: Intel Corporation Cannon Lake PCH SMBus Controller (rev 10)
00:1f.5 Serial bus controller: Intel Corporation Cannon Lake PCH SPI Controller (rev 10)
01:00.0 VGA compatible controller: NVIDIA Corporation TU106M [GeForce RTX 2060 Mobile] (rev a1)
01:00.1 Audio device: NVIDIA Corporation TU106 High Definition Audio Controller (rev a1)
01:00.2 USB controller: NVIDIA Corporation TU106 USB 3.1 Host Controller (rev a1)
01:00.3 Serial bus controller: NVIDIA Corporation TU106 USB Type-C UCSI Controller (rev a1)
02:00.0 PCI bridge: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] (rev 02)
03:00.0 PCI bridge: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] (rev 02)
03:01.0 PCI bridge: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] (rev 02)
03:02.0 PCI bridge: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] (rev 02)
04:00.0 System peripheral: Intel Corporation JHL6340 Thunderbolt 3 NHI (C step) [Alpine Ridge 2C 2016] (rev 02)
3a:00.0 USB controller: Intel Corporation JHL6340 Thunderbolt 3 USB 3.1 Controller (C step) [Alpine Ridge 2C 2016] (rev 02)
3b:00.0 Non-Volatile memory controller: SK hynix BC511

journalctl (sorry not full (its about 2 gigabytes))

апр 02 00:47:20 dell wpa_supplicant[658]: wlan0: WPA: Group rekeying completed >
апр 02 00:49:57 dell kernel: usb 1-2: USB disconnect, device number 81
апр 02 00:49:58 dell kernel: usb 1-2: new full-speed USB device number 82 using>
апр 02 00:49:58 dell kernel: usb 1-2: New USB device found, idVendor=0c45, idPr>
апр 02 00:49:58 dell kernel: usb 1-2: New USB device strings: Mfr=1, Product=2,>
апр 02 00:49:58 dell kernel: usb 1-2: Product: USB DEVICE
апр 02 00:49:58 dell kernel: usb 1-2: Manufacturer: SONiX
апр 02 00:49:58 dell kernel: input: SONiX USB DEVICE as /devices/pci0000:00/000>
апр 02 00:49:58 dell kernel: hid-generic 0003:0C45:7697.018F: input,hidraw1: US>
апр 02 00:49:58 dell kernel: input: SONiX USB DEVICE Keyboard as /devices/pci00>
апр 02 00:49:58 dell kernel: input: SONiX USB DEVICE Wireless Radio Control as >
апр 02 00:49:58 dell kernel: input: SONiX USB DEVICE as /devices/pci0000:00/000>
апр 02 00:49:58 dell kernel: hid-generic 0003:0C45:7697.0190: input,hiddev96,hi>
апр 02 00:49:58 dell mtp-probe[3785098]: checking bus 1, device 82: "/sys/devic>
апр 02 00:49:58 dell mtp-probe[3785098]: bus: 1, device: 82 was not an MTP devi>
апр 02 00:49:58 dell systemd-logind[566]: Watching system buttons on /dev/input>
апр 02 00:49:58 dell systemd-logind[566]: Watching system buttons on /dev/input>
апр 02 00:49:58 dell mtp-probe[3785113]: checking bus 1, device 82: "/sys/devic>
апр 02 00:49:58 dell mtp-probe[3785113]: bus: 1, device: 82 was not an MTP devi>
апр 02 00:57:20 dell wpa_supplicant[658]: wlan0: WPA: Group rekeying completed >
апр 02 01:07:20 dell wpa_supplicant[658]: wlan0: WPA: Group rekeying completed >
апр 02 01:17:20 dell wpa_supplicant[658]: wlan0: WPA: Group rekeying completed >
апр 02 01:27:20 dell wpa_supplicant[658]: wlan0: WPA: Group rekeying completed >

lua -v

Lua 5.4.4  Copyright (C) 1994-2022 Lua.org, PUC-Rio

php -v

PHP 8.1.5 (cli) (built: Apr 14 2022 18:36:20) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.5, Copyright (c) Zend Technologies
with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans

python --version

Python 3.10.4

ruby --version

ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux]

perl --version

This is perl 5, version 34, subversion 1 (v5.34.1) built for x86_64-linux-thread-multi

Copyright 1987-2022, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

gcc --version

gcc (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE

pls fix :D

im so fucking gay holy shit i love men hahahahahahahah holy shit
https://instagram.fbeg5-1.fna.fbcdn.net/v/t51.2885-15/300792508_559396782540888_6207724973983813330_n.jpg?stp=dst-jpg_e35&cb=2d435ae8-0fbdf7c6&_nc_ht=instagram.fbeg5-1.fna.fbcdn.net&_nc_cat=1&_nc_ohc=mkOY_whzj2EAX--UlJ2&tn=dd3tBC0utWAH-jGW&edm=AJ9x6zYBAAAA&ccb=7-5&ig_cache_key=MjkxMjU3NjY4OTAwMjAwNzQ5Mw%3D%3D.2-ccb7-5&oh=00_AT9jjdrpLHGiA5hL3SzVwve4tPLtPHonLQ5vuFy95oiPPw&oe=630E254D&_nc_sid=cff2a4

Errors

Figure out how to handle errors there's like 34589576 ways and none of them work...

connect to maniakarma

need to connect to maniakarma api to be able to supply global karma for tracks. while this is not 100% necessary (if anything its a chore to add), it will let us have feature parity with xaseco in the karma department (gfxkd confirmd???). api is obviously undocumented, and is rather obscure. on failure, the http codes returned do not conform to any standards and at times seem random.

most of the information thats needed was obtained via vardump in request, so it should be accurate enough for reproducing it in our code. see below:

Authentication Request [@Controller.Ready?]
Host: worldwide.mania-karma.com
Path: /api/tmforever-trackmania-v4.php
?Action=Auth
&login=autisticserv
&name=JGZmZsKsJDBGNUEkMEY2dSQxRjZ0JDFGN2kkMUY4cyQxRjl0JDJGOWljICQyRjlTJDFGOGVyJDFGN3YkMEY2ZSQwRjVyJGZmZiE=
&game=TmForever
&zone=United+Kingdom%7CEngland%7CLondon
&nation=GBR
User-Agent: XAseco/1.16 mania-karma/2.0.1 TmForever/2011-02-21 php/8.1.7 Linux/5.18.2-arch1-1 x86_64

login is the server login, name is base64encoded (??) server name, game is obvious, zone is the full path to the server, missing world, nation is the 3-letter code of the server nation. useragent, likely, can be dropped.

Authentication Response
Code: 200 OK
Message: 
<?xml version="1.0" encoding="utf-8" ?>
<result api="4.0.0">
 <status>200</status>
 <authcode>5dc12ba0c4c30d4be274d6e9d9707d3e</authcode>
 <import_done>true</import_done>
 <api_url>http://europe.mania-karma.com/api/tmforever-trackmania-v4.php</api_url>
</result>

authcode here is important, this is going to be used in every request after authentication, import_done is likely always true, api_url is the URL we'll have to use with the authcode from before for all the following API requests.

Ping Request [@Controller.BeginChallenge?]
Host: europe.mania-karma.com
Path: api/tmforever-trackmania-v4.php?
Action=Ping
&login=autisticserv
&authcode=5dc12ba0c4c30d4be274d6e9d9707d3e
User-Agent: XAseco/1.16 mania-karma/2.0.1 TmForever/2011-02-21 php/8.1.7 Linux/5.18.2-arch1-1 x86_64

note the authcode and changed Host. this request is made on every challenge start in xaseco, i dont know whether its useful.

Ping Response
Code: 200 OK
Message: 
<?xml version="1.0" encoding="utf-8" ?>
<releases>
    <xaseco1xx>1.0.7</xaseco1xx>
    <xaseco2xx>1.0.7</xaseco2xx>
    <aseco220c>0.9.9</aseco220c>
    <rcp4live>1.0</rcp4live>
</releases>

lol dont even ask. seems like irrelevant information about latest supported version for some controllers. funnily enough not even true since current version is 2.0.1 XD.

Receive Votes Request [@Controller.PlayerJoin]
Host: europe.mania-karma.com
Path: api/tmforever-trackmania-v4.php?
Action=Get
&login=autisticserv
&authcode=5dc12ba0c4c30d4be274d6e9d9707d3e
&uid=sUGewrlQqp05JcWLBzVIbxmdJFk
&map=UG9qZWJhbmEgVHJhc2EgTnIxICEhISEhIDwz
&author=brantt
&env=Stadium
&player=redgreendevil
User-Agent: XAseco/1.16 mania-karma/2.0.1 TmForever/2011-02-21 php/8.1.7 Linux/5.18.2-arch1-1 x86_64

yeah, this is sent on playerjoin, not beginchallenge. login is the server login, authcode is the authentication code from before, uid is the map UId, map is base64encoded (??) map name, author is the map author, env is the map environment and player is the arriving player's login.

Receive Votes Response
Code: 200 OK
Message:
<?xml version="1.0" encoding="utf-8" ?>
<result api="4.0.0">
 <status>200</status>
 <uid>sm7g0aAHLMG9QAVapzt8TzLbPhh</uid>
 <image_present>true</image_present>
 <votes>
  <karma>56</karma>
  <fantastic percent="13.40" count="52" />
  <beautiful percent="17.27" count="67" />
  <good percent="40.21" count="156" />
  <bad percent="10.05" count="39" />
  <poor percent="5.41" count="21" />
  <waste percent="13.66" count="53" />
 </votes>
 <players>
  <player login="redgreendevil" vote="0" />
 </players>
</result>

image_present is somethnig i have no clue about. could be the tmx image its referring to. karma is the current map karma, calculated with mk, rest of course should be understandable (just like the player nodes).

Send Votes Request [@Controller.EndChallenge?]
Host: europe.mania-karma.com
Path: api/tmforever-trackmania-v4.php?
Action=Vote
&login=autisticserv
&authcode=5dc12ba0c4c30d4be274d6e9d9707d3e
&uid=SnZUQoHMfN0tG4UIu3ochGcALO0
&map=JGIkbiRmODBLciRmZmZvJGY4MEwkZmZmbyRmODBMIDEy
&author=acedepuma
&atime=11450
&ascore=0
&nblaps=0
&nbchecks=2
&mood=Day
&env=Stadium
&votes=ciekma_czakwal=3|redgreendevil=-3
&tmx=
User-Agent: XAseco/1.16 mania-karma/2.0.1 TmForever/2011-02-21 php/8.1.7 Linux/5.18.2-arch1-1 x86_64

login is the server login, authcode is the authentication code, uid is the map UId, map is the base64encoded (?) map name, author is the map author, atime is the author time, ascore is the author score (stunsts mode), nblaps is laps amount for multilap maps, nbchecks is the checkpoint amount of the map, mood is the map mood, env is the map environment, votes is an array of vote pairs (login=vote) joined by a pipe (|) and tmx is always empty, as its a leftover from tm2 version that included mx karma (sort of).

Send Votes Response
Code: 200 OK

i believe thats all we can possibly get, as those are all the api requests from the xaseco mk plugin. might wanna hardcode some values that we dont have access to for now, like the server zone (genuinely useless information)

todo callbacks list

  • Trackmania.PlayerConnect
    ([0] = Login, [1] = IsSpectator)
  • Trackmania.PlayerDisconnect
    ([0] = Login)
  • Trackmania.PlayerChat
    ([0] = PlayerUid, [1] = Login, [2] = Text, [3] = IsRegisteredCmd)
  • TrackMania.PlayerServerMessageAnswer (TMN ESWC ONLY)
    ([0] = PlayerUid, [1] = Login, [2] = Answer)
  • TrackMania.PlayerCheckpoint
    ([0] = PlayerUid, [1] = Login, [2] = TimeOrScore, [3] = CurLap, [4] = CheckpointIndex)
  • TrackMania.PlayerFinish
    ([0] = PlayerUid, [1] = Login, [2] = TimeOrScore)
  • TrackMania.BeginRace
    ([0] = Challenge)
  • TrackMania.EndRace
    ([0] = Rankings[arr], [1] = Challenge)
  • TrackMania.BeginRound
    (Nothing)
  • TrackMania.StatusChanged
    ([0] = StatusCode, [1] = StatusName)
    ([1] = Waiting, [2] = Launching, [3] = Running - Synchronization, [4] = Running - Play, [5] = Running - Finish)
  • TrackMania.EndRound
    (Nothing)
  • TrackMania.BeginChallenge
    ([0] = Challenge, [1] = WarmUp, [2] = MatchContinuation)
  • TrackMania.EndChallenge
    ([0] = Rankings[arr], [1] = Challenge, [2] = WasWarmUp, [3] = MatchContinuesOnNextChallenge, [4] = RestartChallenge)
  • TrackMania.PlayerManialinkPageAnswer
    ([0] = PlayerUid, [1] = Login, [2] = Answer)
  • TrackMania.BillUpdated
    ([0] = BillId, [1] = State, [2] = StateName, [3] = TransactionId)
  • TrackMania.ChallengeListModified
    ([0] = CurChallengeIndex, [1] = NextChallengeIndex, [2] = IsListModified)
  • TrackMania.PlayerInfoChanged
    ([0] = PlayerInfo)
  • TrackMania.PlayerIncoherence
    ([0] = PlayerUid, [1] = Login)
  • TrackMania.TunnelDataReceived (RELAY ONLY)
    ([0] = PlayerUid, [1] = Login, [2] = Data)
  • TrackMania.Echo
    ([0] = Internal, [1] = Public)
  • TrackMania.ManualFlowControlTransition
    ([0] = Transition)
  • TrackMania.VoteUpdated
    ([0] = StateName, [1] = Login, [2] = CmdName, [3] = CmdParam)

Skipping during "please wait" screen before the race starts crashes trakman

Same for restarting

file:///home/petr/dox/Programs/tm/trakman/built/src/Socket.js:85
                        reject(new Error(`${response.errorString} Code: ${response.errorCode}`));
                               ^

Error: Change in progress. Code: -1000
    at Timeout._onTimeout (file:///home/petr/dox/Programs/tm/trakman/built/src/Socket.js:85:32)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7)

handshake doesnt go through

if handshake failed (due to timeout etc) it still displays as success in the log (and nothing happens afterwards)
<info> Main.js:8 (main) handshake success

TODO list

-push challenges to database on startup
-push logins to database on login
-push records to database on finish
-chat styling in Chat.js
-handle more events (add callbacks to Listeners.js file)

//less important
-storing setting like server password etc. in database and loading it on start (file Config.js/ConfigLoader.js)

rounds mode support

need to support rounds-based gamemodes in the future: rounds (0), teams (2), laps (3) & cup (5).

Static methods

Client, Listeners and so on should be static for plugin reasons. :D

privileges

privileges needs to be a separate table from players (most players arent likely to be more than 0)
privileges commands in general need a rework as they allow certain things that shouldnt be possible, eg demoting a person of higher rank than you (or equal, if that matters).. i didnt fix it back then lolol

When to exit the process

Since we don't want unnecessary crashes (which happen in xaseco quite often as far as i know), we should think about on which errors the process should be exited. Obviously there are cases when controller needs to crash such as error in initializing services or losing connection with the server on socket, however exiting process on every failed database query or client call seems unnecessary (especially considering that external plugins irrelevant to core contoller functionality may use these methods). My suggestion is that in methods like these instead of throwing right away we just log the error and then return it. That would allow us to check for error on method call and then decide if we throw the program or not. For example if 'authorize' call in main retuns error we throw because there is no sense in continuing, but if a 'displayManialink' call from a plugin returns error we just log it since server can run without it. Maybe theres some better way to do it tho, also it would be nice to hear from our expert mr. Waseraven about what caused most crashes in XASECO cuz we might run into similar problems

Controller Name PLEASE

preferably we want an actual name other than "TRAKMAN" (not saying it's bad)
suggest anything that comes to your mind, acronyms are preferred but not a must.

Some words you could potentially use:
Controller
Mania
TypeScript (TS)

what we have so far:
NAME (New Age Mania Evolution)
CORE (Controller Redux)
SCORE (Script Controller Redux)

tx

more admin commands todo

we should add more admin commands, likely including those already in xaseco for feature parity.
ill list them all here, with checkmark indicating completeness/redundancy.
commands exclusive to our project arent in this list of course.

  • help - display help for commands with privilege > 0
  • ssn/setservername - set server name
  • sc/setcomment - set server comment
  • sp/setpwd - set server player password
  • ssp/setspecpwd - set server spectator password
  • srp/setrefpwd - set server referee password (unneeded IMO)
  • smp/setmaxplayers - set the max player amount
  • sms/setmaxspecs - set the max spectators amount
  • sgm/setgamemode - set the next gamemode
  • srm/setrefmode - set the referee mode (unneeded too)
  • skip/nm/next/nextmap - skip the current map
  • ne/nextenv - skip to the next map with the same environment (irrelevant)
  • res - restart the current map
  • add - add map from tmx (works, maybe needs some tidying up)
  • al/addlocal - add map from local files
  • kick - kick a player
  • kg/kickghost - kick a ""ghost"" player (very few usecases)
  • ban - ban a player
  • unban - unban a player
  • banip - ban an ip address
  • unbanip - unban an ip address
  • bl/blacklist - blacklist a player
  • ubl/unblacklist - unblacklist a player
  • ag/addguest - add a player to the guestlist
  • rg/removeguest - remove a player from the guestlist
  • er/endround - end current round, in rounds based gamemodes
  • shuffle/shufflemaps - shuffle the current tracklist
  • rt/removetrack/et/erasetrack - remove a map
  • mute/ignore - mute a player
  • um/unmute/unignore - unmute a player
  • ad/addadmin - add a new admin
  • op/addop - add a new operator
  • removeadmin/removeop - remove admin/op - implemented better in privileges
  • #126
  • pr/prunerecords - delete all records
  • acdl - set acdl
  • disablerespawn - disable cp respawns
  • fso/forceshowopp - force show opponents
  • fp/forceplay - force spectator into play mode
  • fs/forcespec - force player into spec mode
  • coppers - check server coppers
  • pay - pay coppers to a player
  • pm - send a pm to admins (maybe useless)
  • pmlog - display admin pm log (see above)
  • call - execute a dedicated server method (shouldnt be painful)
  • sd/shutdown - shutdown the server
  • sda/shutdownall - //sd does what this is suppsoed to do

these commands will need voting system to work first:

  • pv/passvote/pass - pass a vote (will be implemented after votes)
  • cv/cancelvote/cancel - cancel a vote

these commands will need the queue/jukebox system to work first:

  • prev - go back to the previous map (will only be implemented after/with the queue)
  • replay - requeue the current map
  • dq/dropqueue/djb/dropjukebox - drop specific map from the queue
  • cq/clearqueue/cjb/clearjukebox - clear the queue
  • ch/clearhistory - clear track history file (used to stop you from enqueuing a recent map)

these commands will need the ui system to work first:

  • warn - warn a player
  • players - display list of known players
  • dbll/displayblacklist/listblacks - display current blacklist
  • dbl/displaybanlist/listbans - display current ban list
  • dgl/displayguestlist/listguests - display current guestlist
  • dbil/displaybannediplist/listips - display banned ips list
  • dml/displaymutelist/listmutes - display current mute list
  • dmal/displaymasteradminlist/listmasters - display masteradmins list
  • dal/displayadminlist/listadmins - display admin list
  • dol/displayoperatorlist/listops - display operators list
  • wall/mta - display a message for everyone
  • dc/disablechat - disable chat for a player (custom ui ml)
  • ec/enablechat - enable chat for a player (custom ui ml)

records don't work for shit

the service class is awful, it does almost the exact same thing in each case but each of the cases is written out. i do not get this

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.