General BanchoServer cleanup
This commit is contained in:
parent
0d68b07e9c
commit
09dc1ffb76
2 changed files with 50 additions and 48 deletions
|
@ -180,7 +180,6 @@ export default async function HandleRequest(req:IncomingMessage, res:ServerRespo
|
|||
PacketUser.match?.setStateNotReady(PacketUser);
|
||||
break;
|
||||
|
||||
// TODO: Match leave so the matches actually close
|
||||
case Packets.Client_PartMatch:
|
||||
await PacketUser.match?.leaveMatch(PacketUser);
|
||||
break;
|
||||
|
@ -274,12 +273,17 @@ export default async function HandleRequest(req:IncomingMessage, res:ServerRespo
|
|||
break;
|
||||
|
||||
case Packets.Client_UserPresenceRequest:
|
||||
UserPresence(PacketUser, PacketUser.id); // Can't really think of a way to generalize this?
|
||||
UserPresence(PacketUser, PacketUser.id);
|
||||
break;
|
||||
|
||||
// Ignored packets
|
||||
|
||||
case Packets.Client_Pong:
|
||||
case Packets.Client_BeatmapInfoRequest:
|
||||
case Packets.Client_ReceiveUpdates:
|
||||
break;
|
||||
|
||||
default:
|
||||
// Ignore client_beatmapInfoRequest and client_receiveUpdates
|
||||
if (CurrentPacket.id == 68 || CurrentPacket.id == 79 || CurrentPacket.id == 4) break;
|
||||
// Print out unimplemented packet
|
||||
console.dir(CurrentPacket);
|
||||
break;
|
||||
|
@ -290,7 +294,7 @@ export default async function HandleRequest(req:IncomingMessage, res:ServerRespo
|
|||
PacketUser.clearQueue();
|
||||
} else {
|
||||
// User's token is invlid, force a reconnect
|
||||
ConsoleHelper.printBancho(`Forced client re-login (Token is invalid)`);
|
||||
ConsoleHelper.printBancho(`Forced client re-connect (Token is invalid)`);
|
||||
const osuPacketWriter = osu.Bancho.Writer();
|
||||
osuPacketWriter.Announce("Reconnecting...");
|
||||
osuPacketWriter.Restart(0);
|
||||
|
|
|
@ -192,8 +192,6 @@ export default async function LoginProcess(req:IncomingMessage, res:ServerRespon
|
|||
UserPresenceBundle(newUser);
|
||||
|
||||
osuPacketWriter.Announce(`Welcome back ${loginInfo.username}!`);
|
||||
// TODO: Remove once merged into master
|
||||
osuPacketWriter.Announce("Heads up!\nWhile the TypeScript server rewrite is mostly stable it still has some issues.");
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue