Port moved to settings struct and default to 8889
This commit is contained in:
parent
3a4c493835
commit
870210e6a2
6 changed files with 12 additions and 12 deletions
|
@ -1,12 +1,12 @@
|
||||||
Default port is 8888, if you change this, you must change it in the 3DS's 3DSController.ini as well,
|
Default port is 8889, if you change this, you must change it in the 3DS's 3DSController.ini as well,
|
||||||
Circle Pad and Touch can be either JOYSTICK or MOUSE,
|
Circle Pad and Touch can be either JOYSTICK or MOUSE,
|
||||||
Buttons can either be a letter for example B, or a special key, like SPACE, CLICK, RIGHT CLICK, ENTER, BACKSPACE, SHIFT, TAB, LEFT, RIGHT, UP, DOWN, PAGE UP, PAGE DOWN, or WINDOWS,
|
Buttons can either be a letter for example B, or a special key, like SPACE, CLICK, RIGHT CLICK, ENTER, BACKSPACE, SHIFT, TAB, LEFT, RIGHT, UP, DOWN, PAGE UP, PAGE DOWN, or WINDOWS,
|
||||||
Alternatively, you can disable a key by binding it to NONE,
|
Alternatively, you can disable a key by binding it to NONE,
|
||||||
Make sure to use a space, not a tab for seperating settings
|
Make sure to use a space, not a tab for seperating settings
|
||||||
Throttle controls the delay between checking for new packets (in milliseconds), a high number will have slightly more lag between pressing a button on the 3DS and receiving it on the PC, however will make the application use less CPU. In my experience, 20 is a reasonable throttling amount.
|
Throttle controls the delay between checking for new packets (in milliseconds), a high number will have slightly more lag between pressing a button on the 3DS and receiving it on the PC, however will make the application use less CPU. In my experience, 20 is a reasonable throttling amount.
|
||||||
|
|
||||||
Throttle: 20
|
|
||||||
Port: 8889
|
Port: 8889
|
||||||
|
Throttle: 20
|
||||||
Circle Pad: JOYSTICK
|
Circle Pad: JOYSTICK
|
||||||
Touch: MOUSE
|
Touch: MOUSE
|
||||||
Mouse Speed: 4
|
Mouse Speed: 4
|
||||||
|
|
|
@ -8,6 +8,7 @@ enum analogue {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct settings {
|
struct settings {
|
||||||
|
int port;
|
||||||
int throttle;
|
int throttle;
|
||||||
enum analogue circlePad;
|
enum analogue circlePad;
|
||||||
enum analogue touch;
|
enum analogue touch;
|
||||||
|
|
|
@ -30,8 +30,6 @@ struct packet {
|
||||||
} touch;
|
} touch;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int port;
|
|
||||||
|
|
||||||
extern SOCKET listener;
|
extern SOCKET listener;
|
||||||
extern SOCKET client;
|
extern SOCKET client;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
|
||||||
|
|
||||||
initNetwork();
|
initNetwork();
|
||||||
|
|
||||||
printf("Port: %d\n", port);
|
printf("Port: %d\n", settings.port);
|
||||||
|
|
||||||
printf("Running on: %s\n", hostName);
|
printf("Running on: %s\n", hostName);
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
struct settings settings;
|
struct settings settings;
|
||||||
|
|
||||||
struct settings defaultSettings = {
|
struct settings defaultSettings = {
|
||||||
|
port: 8889,
|
||||||
throttle: 20,
|
throttle: 20,
|
||||||
circlePad: joystick,
|
circlePad: joystick,
|
||||||
touch: mouse,
|
touch: mouse,
|
||||||
|
@ -93,12 +94,12 @@ bool readSettings(void) {
|
||||||
|
|
||||||
char setting[64] = { '\0' };
|
char setting[64] = { '\0' };
|
||||||
|
|
||||||
if(getSetting("Throttle: ", buffer, setting)) {
|
if(getSetting("Port: ", buffer, setting)) {
|
||||||
sscanf(setting, "%d", &settings.throttle);
|
sscanf(setting, "%d", &settings.port);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getSetting("Port: ", buffer, setting)) {
|
if(getSetting("Throttle: ", buffer, setting)) {
|
||||||
sscanf(setting, "%d", &port);
|
sscanf(setting, "%d", &settings.throttle);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getSetting("Circle Pad: ", buffer, setting)) {
|
if(getSetting("Circle Pad: ", buffer, setting)) {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
|
|
||||||
#include "wireless.h"
|
#include "settings.h"
|
||||||
|
|
||||||
int port = 8888;
|
#include "wireless.h"
|
||||||
|
|
||||||
SOCKET listener;
|
SOCKET listener;
|
||||||
SOCKET client;
|
SOCKET client;
|
||||||
|
@ -55,7 +55,7 @@ void startListening(void) {
|
||||||
|
|
||||||
serverInfo.sin_family = AF_INET;
|
serverInfo.sin_family = AF_INET;
|
||||||
serverInfo.sin_addr.s_addr = IP;
|
serverInfo.sin_addr.s_addr = IP;
|
||||||
serverInfo.sin_port = htons(port);
|
serverInfo.sin_port = htons(settings.port);
|
||||||
|
|
||||||
u_long one = 1;
|
u_long one = 1;
|
||||||
ioctlsocket(listener, FIONBIO, &one);
|
ioctlsocket(listener, FIONBIO, &one);
|
||||||
|
|
Loading…
Add table
Reference in a new issue