Commit graph

65 commits

Author SHA1 Message Date
Daniel López Guimaraes
300253aaea
Add mutex for accessing server clients
Prevents server panic from client overload.
2023-09-02 19:47:40 +01:00
Daniel López Guimaraes
16c5f5eca9
Use crypto/rand over math/rand
Also add error handling for rand.Read()
2023-08-06 01:36:14 +01:00
Jonathan Barrow
e57bba0665
Make NewServer use NewNEXVersion in SetDefaultNEXVersion 2023-07-12 16:31:38 -04:00
Jonathan Barrow
b4521a7879
Added NAT Traversal protocol version 2023-07-12 16:30:03 -04:00
Jonathan Barrow
981504d417
Fixed SetDefaultNEXVersion setting all versions to the same pointer 2023-07-12 16:27:10 -04:00
Jonathan Barrow
8a4a2aedba
Added missing error checks 2023-06-07 23:18:05 -04:00
Jonathan Barrow
0c4508e64f
All relevant methods now return errors, and all errors are now checked 2023-06-07 23:12:13 -04:00
Daniel López Guimaraes
a97e9e6b19
Add getter for PasswordFromPIDFunction
This allows the common authentication protocol to reuse this function
and avoid confusion.
2023-04-23 18:05:19 +01:00
Daniel López Guimaraes
98fc727028
Add HPP protocol support
Implement an HTTP server that supports HPP requests, and add a fake
packet `HPPPacket` that allows interaction with existing code.

The `RMCResponse` won't write the protocol ID bytes if it's set to zero.
This allows support for HPP, as the RMC responses of this protocol don't
include the protocol ID.
2023-04-23 16:00:28 +01:00
Jonathan Barrow
0b5e809431
Merge pull request #23 from PretendoNetwork/kick-all
KickAll command + "graceful" kick
2023-04-15 22:49:34 -04:00
shutterbug2000
b1d7004d6b remove stray version assignment 2023-04-15 21:41:12 -05:00
Jonathan Barrow
6fb5c7d0f0
Added default NEX version to all servers 2023-04-10 22:32:12 -04:00
shutterbug2000
a50ff5b21c Set correct version for packets (oops lol) 2023-04-09 23:42:09 -05:00
shutterbug2000
3fcc1d44c7 Seperate kick methods for graceful and timeout 2023-04-09 23:24:05 -05:00
shutterbug2000
3c7a22f99c KickAll command + "graceful" kick 2023-04-09 02:44:51 -05:00
Jonathan Barrow
cd950eff9e
More consistent PRUDP method naming 2023-04-05 19:31:00 -04:00
Jonathan Barrow
86eb9b08e0
Removed SetNexVersion and added methods for setting specific NEX protocol versions 2023-04-05 19:28:18 -04:00
Jonathan Barrow
aa7f415a24
Acknowledge disconnect packet 3 times 2023-03-25 20:55:58 -04:00
Jonathan Barrow
252726d5e3
Added WriteToUDP error check 2023-01-01 13:58:25 -05:00
Jonathan Barrow
7afc45a760
Removed additional type assertions in server.Emit method 2023-01-01 13:55:16 -05:00
Jonathan Barrow
3efe2d90b8
Added godoc package comment 2022-12-31 11:21:52 -05:00
shutterbug2000
8a5d8d23eb Fix connection issues in Splatoon. 2022-09-17 06:58:53 +00:00
Jonathan Barrow
7ee7af5f38
Disconnect lingering connections 2022-09-11 14:55:31 -04:00
Jonathan Barrow
bb6d6348b0
Removed duplicate code in V1 ACK encoding 2022-09-05 09:51:38 -04:00
Jonathan Barrow
95ecd962f0
Remove event handler type assertion 2022-09-05 09:48:11 -04:00
Jonathan Barrow
4bb09fd0ea
Track client PRUDP minor version and supported functions 2022-09-05 09:45:36 -04:00
Jonathan Barrow
52b2001c00
Removed useless line breaks 2022-09-05 09:11:55 -04:00
Jonathan Barrow
d62f77a58f
Added (Set)SupportedFunctions methods 2022-09-05 09:08:54 -04:00
Jonathan Barrow
003b4c2baa
Added (Set)PRUDPProtocolMinorVersion methods and corrected misuse of server NEX version 2022-09-05 08:57:56 -04:00
Jonathan Barrow
3f91013496 Added kerberos password field 2022-04-16 19:58:00 -04:00
Jonathan Barrow
655d59f4ae Added plogger logging 2022-04-15 16:51:05 -04:00
Jonathan Barrow
0f54daac27 Removed unused code found only in the original Rendez-Vous library 2022-04-10 16:07:00 -04:00
Jonathan Barrow
7790a5e23a Added kerberos ticket version 2022-04-03 10:00:47 -04:00
Jonathan Barrow
8be2d8bca2 Moved all source files back to root 2022-03-29 00:15:55 -04:00
Jonathan Barrow
a2d673a235 Moving to Go modules 2022-03-27 19:59:17 -04:00
Jonathan Barrow
19520fa349 Merge branch 'master' of https://github.com/PretendoNetwork/nex-go 2021-12-02 09:07:20 -05:00
shutterbug2000
64b6ab825f
Fix prudp fragment issues
Fixes friends failing to load when the friend list gets too long
2021-12-01 00:48:10 -06:00
Jonathan Barrow
af513d18c0 Moved connection ID counter to nex-go 2021-11-21 20:55:45 -05:00
Jonathan Barrow
47a0b52b7f Added SetFragmentSize 2021-11-21 00:53:15 -05:00
Jonathan Barrow
4fc1ab819c moved ping timeout timer ti Go Timer channel 2021-11-18 08:43:20 -05:00
Jonathan Barrow
13ee75a2bb Added a ping timeout 2021-11-02 10:59:58 -04:00
Jonathan Barrow
c5ce72ce26 remove redundant SendPing 2021-11-02 10:04:28 -04:00
Jonathan Barrow
7462a7f43f Added FindClientFromPID 2021-10-28 09:06:21 -04:00
Jonathan Barrow
24a4f22d93 use fragmentID 2021-09-29 19:16:38 -04:00
Jonathan Barrow
caecee00e9 removed commented code and whitespace 2021-08-22 18:29:58 -04:00
Jonathan Barrow
f78cd960d8 Changed getters to be more Go-like
Removed "Get" prefix from getters to conform to effective Go standards
2020-04-19 21:40:04 -04:00
Jonathan Barrow
49762a9957 Renamed nexMinorVersion
Renamed nexMinorVersion since NEX versions are more specific in reality
2020-04-19 21:32:02 -04:00
Jonathan Barrow
3469a4893a Moved unreachable code 2020-04-19 12:01:43 -04:00
Jonathan Barrow
1d690de84d New StreamOut API
StreamOut now has an abstraction layer to clean up some method calls from crunch
2020-02-16 17:42:03 -05:00
Jonathan Barrow
e1d1dfe90a Removed broken pings and fixed client state reuse
Ping packets were never being sent from the server. This is now fixed. Also removed the buggy StartPing loop, which never worked due to struct properties not being updated in different goroutine threads. Ping packets now get sent from the server whenever one is sent from the client

Client states were also being reused when a connection was made with an existing port on the same console, which broke NNID switching. Client states now get reset when connections begin
2020-02-16 16:48:54 -05:00